Jump to content

Recommended Posts

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

Posted

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.

Posted

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

Posted

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.

Posted

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.

Posted

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);
Posted

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.

Posted
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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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