mirror of
https://github.com/GTNewHorizons/Applied-Energistics-2-Unofficial.git
synced 2026-10-26 14:25:20 +00:00
clear view helper player on each dimension change (#1262)
This commit is contained in:
1 parent
6850d8b28b
commit
0ac43ad8fd
1 file changed
+9
-1
@@ -4,6 +4,7 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
|
||||
import appeng.core.AEConfig;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
@@ -28,7 +29,6 @@ public class BlockRendererPreviewEvent {
|
||||
if (AEConfig.instance.previewBlocks) {
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
if (player == null) {
|
||||
ViewHelper.setPlayer(null);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -50,6 +50,14 @@ public class BlockRendererPreviewEvent {
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onWorldUnload(WorldEvent.Unload event) {
|
||||
if (event.world.isRemote) {
|
||||
ViewHelper.setPlayer(null);
|
||||
ViewHelper.clearCache();
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onRenderWorldLast(RenderWorldLastEvent event) {
|
||||
if (AEConfig.instance.previewBlocks) {
|
||||
|
||||
Reference in new issue
Block a user