Package net.minecraftforge.common.util
Class FakePlayerFactory
java.lang.Object
net.minecraftforge.common.util.FakePlayerFactory
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final Map<FakePlayerFactory.FakePlayerKey,
FakePlayer> private static final com.mojang.authlib.GameProfile
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate static FakePlayer
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.static FakePlayer
getMinecraft
(ServerLevel level) static void
unloadLevel
(ServerLevel level)
-
Field Details
-
MINECRAFT
private static final com.mojang.authlib.GameProfile MINECRAFT -
fakePlayers
-
-
Constructor Details
-
FakePlayerFactory
public FakePlayerFactory()
-
-
Method Details
-
getMinecraft
-
get
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
-
create
-