Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hello,

I am trying to figure out how I can get the GameProfile of a FakePlayer only by its name. Some mods add fakePlayers and give them certain names.
Is there a way to check if a fakePlayer with that name exists and to get his gameProfile or fakePlayer object?

Thanks

There is a HashMap containing all FakePlayers located in the FakePlayerFactory class.
Do note that it is private, so you will need to use Reflection to see it.

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

  • Author

We have a protection mechanism for our colonies which only allow players inside a certain list to modify the terrain.

Therefore we need to be able to recognize if the player adds a fakePlayer to the colony permissions and get the fakePlayers UUID.

  • Author

The player types this username to add him to his colony.
We then get the UUID from the username and add the uuid and username to the colony.

But this doesn't work for fakePlayers

  • Author

If a player wants a fakePlayer to be able to make changes to the terrain in the colony he has to add him to the colony to give him permission.
Some mods offer a "Username" of this fakePlayer.

  • Author

Ender IO only offers a name as far as I know "EioKillera" so that players can add them to the mods which implement anti griefing protection.

  • Author

That would be bad for all anti griefing mods.

[Mekanism] - Mekanism
[BuildCraft] - BuildCraft
[Forestry] - Forestry 
ComputerCraft - ComputerCraft
[OpenComputers] - Open Computers
[Stevescart] - Steve's Carts
[MineFactory] - MineFactoryReloaded
[CoFH] - Autonomous Activator
[SFM_PLAYER] - Steve's Factory Manager
[EioFarmer] - Ender IO Farmer
FakeThaumcraftGolem - Thaumcraft Golems
FakeThaumcraftBore - Thaumcraft Arcane Bore
[EioKillera] - Ender IO KillerJoe
[Minecraft] - Extra Utilities

This is a list of all the "well known" fake players of various mods.
I hope these mods have taken these usernames to avoid griefing by them.

  • Author

We need to be able to detect automatically if the entered name is a "FakePlayerName" and we need to get its GameProfile.

  • Author

I don't but we're not able to get the UUID of the fakePlayer entity the same way we get the UUID of the normal player.

 

GameProfile gameprofile = world.getMinecraftServer().getPlayerProfileCache().getGameProfileForUsername(player);
  • Author

But still. I want the players only to add valid players or valid fakePlayers and nothing besides that.
Therefore I need a way to detect if it is really a fakePlayer.

  • Author

the FakePlayerFactory doesn't contain a list of all fakePlayers?
I can't just search them for the incoming name?

My Code:

FakePlayer fakePlayer = FakePlayerFactory.get(Minecraft.getMinecraft().getIntegratedServer().worldServerForDimension(0), new GameProfile("tattyseal_fake", "tattyseal"));

1 minute ago, kimbeardsley said:

My Code:

FakePlayer fakePlayer = FakePlayerFactory.get(Minecraft.getMinecraft().getIntegratedServer().worldServerForDimension(0), new GameProfile("tattyseal_fake", "tattyseal"));

 

That code reaches across logical sides by accessing the server through the Minecraft class, which is client-only. It will also crash the dedicated server.

 

Since FakePlayer extends EntityPlayerMP and requires a WorldServer, it should only be used from the logical server.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.