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;
|
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
|
||||||
|
|
|
@ -39,4 +39,8 @@ public class FakePlayerUtil{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void unloadFakePlayer(){
|
||||||
|
theFakePlayer = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue