Class FakePlayerFactory

java.lang.Object
net.minecraftforge.common.util.FakePlayerFactory

public class FakePlayerFactory extends Object
  • Field Details

    • MINECRAFT

      private static com.mojang.authlib.GameProfile MINECRAFT
    • fakePlayers

      private static Map<com.mojang.authlib.GameProfile,​FakePlayer> fakePlayers
    • MINECRAFT_PLAYER

      private static WeakReference<FakePlayer> MINECRAFT_PLAYER
  • Constructor Details

    • FakePlayerFactory

      public FakePlayerFactory()
  • Method Details

    • getMinecraft

      public static FakePlayer getMinecraft(ServerLevel world)
    • get

      public static FakePlayer get(ServerLevel world, com.mojang.authlib.GameProfile username)
      Get a fake player with a given username, Mods should either hold weak references to the return value, or listen for a WorldEvent.Unload and kill all references to prevent worlds staying in memory.
    • unloadWorld

      public static void unloadWorld(ServerLevel world)