Class FakePlayerFactory
java.lang.Object
net.neoforged.neoforge.common.util.FakePlayerFactory
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Map<FakePlayerFactory.FakePlayerKey, FakePlayer> private static final com.mojang.authlib.GameProfile -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FakePlayerget(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 FakePlayergetMinecraft(ServerLevel level) static voidunloadLevel(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
-