Unload the fake player when leaving a world so that it doesn't persist and break stuff

This commit is contained in:
Ellpeck 2016-05-03 21:32:51 +02:00
parent af8356c9ef
commit 1aeea1ef6d
2 changed files with 6 additions and 0 deletions

View file

@ -11,6 +11,7 @@
package de.ellpeck.actuallyadditions.mod.event; package de.ellpeck.actuallyadditions.mod.event;
import de.ellpeck.actuallyadditions.mod.misc.WorldData; import de.ellpeck.actuallyadditions.mod.misc.WorldData;
import de.ellpeck.actuallyadditions.mod.util.FakePlayerUtil;
import net.minecraftforge.event.world.WorldEvent; import net.minecraftforge.event.world.WorldEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
@ -24,6 +25,7 @@ public class WorldLoadingEvents{
@SubscribeEvent @SubscribeEvent
public void onUnload(WorldEvent.Unload event){ public void onUnload(WorldEvent.Unload event){
WorldData.makeDirty(); WorldData.makeDirty();
FakePlayerUtil.unloadFakePlayer();
} }
@SubscribeEvent @SubscribeEvent

View file

@ -39,4 +39,8 @@ public class FakePlayerUtil{
return null; return null;
} }
} }
public static void unloadFakePlayer(){
theFakePlayer = null;
}
} }