public class FakePlayerFactory
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.util.Map<com.mojang.authlib.GameProfile,FakePlayer> |
fakePlayers |
private static com.mojang.authlib.GameProfile |
MINECRAFT |
private static java.lang.ref.WeakReference<FakePlayer> |
MINECRAFT_PLAYER |
Constructor and Description |
---|
FakePlayerFactory() |
Modifier and Type | Method and Description |
---|---|
static FakePlayer |
get(ServerWorld 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.
|
static FakePlayer |
getMinecraft(ServerWorld world) |
static void |
unloadWorld(ServerWorld world) |
private static com.mojang.authlib.GameProfile MINECRAFT
private static java.util.Map<com.mojang.authlib.GameProfile,FakePlayer> fakePlayers
private static java.lang.ref.WeakReference<FakePlayer> MINECRAFT_PLAYER
public static FakePlayer getMinecraft(ServerWorld world)
public static FakePlayer get(ServerWorld world, com.mojang.authlib.GameProfile username)
public static void unloadWorld(ServerWorld world)