Posted February 22, 20178 yr 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
February 22, 20178 yr 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.
February 22, 20178 yr 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.
February 22, 20178 yr 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
February 22, 20178 yr 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.
February 22, 20178 yr 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.
February 22, 20178 yr 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 FarmerFakeThaumcraftGolem - Thaumcraft GolemsFakeThaumcraftBore - 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.
February 22, 20178 yr Author We need to be able to detect automatically if the entered name is a "FakePlayerName" and we need to get its GameProfile.
February 22, 20178 yr Author To allow the fakePlayer work execute work inside the defined protected area.
February 22, 20178 yr 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);
February 22, 20178 yr 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.
February 22, 20178 yr Author the FakePlayerFactory doesn't contain a list of all fakePlayers? I can't just search them for the incoming name?
February 24, 20178 yr My Code: FakePlayer fakePlayer = FakePlayerFactory.get(Minecraft.getMinecraft().getIntegratedServer().worldServerForDimension(0), new GameProfile("tattyseal_fake", "tattyseal"));
February 24, 20178 yr 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.