mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 15:18:34 +01:00
Unload the fake player when leaving a world so that it doesn't persist and break stuff
This commit is contained in:
parent
af8356c9ef
commit
1aeea1ef6d
2 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -39,4 +39,8 @@ public class FakePlayerUtil{
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static void unloadFakePlayer(){
|
||||
theFakePlayer = null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue