diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/WorldLoadingEvents.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/WorldLoadingEvents.java index fe7e47fe2..00459099a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/WorldLoadingEvents.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/event/WorldLoadingEvents.java @@ -11,6 +11,7 @@ package de.ellpeck.actuallyadditions.mod.event; import de.ellpeck.actuallyadditions.mod.misc.WorldData; +import de.ellpeck.actuallyadditions.mod.util.FakePlayerUtil; import net.minecraftforge.event.world.WorldEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @@ -24,6 +25,7 @@ public class WorldLoadingEvents{ @SubscribeEvent public void onUnload(WorldEvent.Unload event){ WorldData.makeDirty(); + FakePlayerUtil.unloadFakePlayer(); } @SubscribeEvent diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/FakePlayerUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/FakePlayerUtil.java index 234f21180..89eed29d7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/FakePlayerUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/FakePlayerUtil.java @@ -39,4 +39,8 @@ public class FakePlayerUtil{ return null; } } + + public static void unloadFakePlayer(){ + theFakePlayer = null; + } }