Class FakePlayerFactory

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

public class FakePlayerFactory extends Object
  • Field Details

  • Constructor Details

    • FakePlayerFactory

      public FakePlayerFactory()
  • Method Details

    • getMinecraft

      public static FakePlayer getMinecraft(ServerLevel level)
    • get

      public static FakePlayer get(ServerLevel level, 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, or call this function every time and let Forge take care of the cleanup.
    • unloadLevel

      public static void unloadLevel(ServerLevel level)
    • create

      private static FakePlayer create(FakePlayerFactory.FakePlayerKey key)