From a1de8c660f126095d09cabd643822b81435bf086 Mon Sep 17 00:00:00 2001 From: pahimar Date: Sat, 27 Apr 2013 12:34:23 -0400 Subject: [PATCH] Transmutation overly no longer will render when the game is paused or the GUI turned off (nice screenshots possible again :) ) --- .../tileentity/TileEntityGlassBellRenderer.java | 1 - .../core/handlers/DrawBlockHighlightHandler.java | 14 ++++++++++++-- .../TransmutationTargetOverlayHandler.java | 9 +++++++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/ee3_common/com/pahimar/ee3/client/renderer/tileentity/TileEntityGlassBellRenderer.java b/ee3_common/com/pahimar/ee3/client/renderer/tileentity/TileEntityGlassBellRenderer.java index 90e51223..6dd20394 100644 --- a/ee3_common/com/pahimar/ee3/client/renderer/tileentity/TileEntityGlassBellRenderer.java +++ b/ee3_common/com/pahimar/ee3/client/renderer/tileentity/TileEntityGlassBellRenderer.java @@ -100,7 +100,6 @@ public class TileEntityGlassBellRenderer extends TileEntitySpecialRenderer { GL11.glEnable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_LIGHTING); - } } diff --git a/ee3_common/com/pahimar/ee3/core/handlers/DrawBlockHighlightHandler.java b/ee3_common/com/pahimar/ee3/core/handlers/DrawBlockHighlightHandler.java index da759578..92e0f188 100644 --- a/ee3_common/com/pahimar/ee3/core/handlers/DrawBlockHighlightHandler.java +++ b/ee3_common/com/pahimar/ee3/core/handlers/DrawBlockHighlightHandler.java @@ -1,5 +1,6 @@ package com.pahimar.ee3.core.handlers; +import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.Tessellator; import net.minecraft.util.EnumMovingObjectType; import net.minecraftforge.client.event.DrawBlockHighlightEvent; @@ -15,6 +16,10 @@ import com.pahimar.ee3.item.IChargeable; import com.pahimar.ee3.item.ITransmutationStone; import com.pahimar.ee3.lib.Textures; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + /** * Equivalent-Exchange-3 * @@ -24,6 +29,7 @@ import com.pahimar.ee3.lib.Textures; * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) * */ +@SideOnly(Side.CLIENT) public class DrawBlockHighlightHandler { private static int pulse = 0; @@ -32,13 +38,17 @@ public class DrawBlockHighlightHandler { @ForgeSubscribe public void onDrawBlockHighlightEvent(DrawBlockHighlightEvent event) { + Minecraft minecraft = FMLClientHandler.instance().getClient(); + if (event.currentItem != null) { if (event.currentItem.getItem() instanceof ITransmutationStone) { if (event.target.typeOfHit == EnumMovingObjectType.TILE) { TransmutationHelper.updateTargetBlock(event.player.worldObj, event.target.blockX, event.target.blockY, event.target.blockZ); - if (ConfigurationSettings.ENABLE_OVERLAY_WORLD_TRANSMUTATION) { - drawInWorldTransmutationOverlay(event); + if (minecraft.isGuiEnabled() && minecraft.inGameHasFocus) { + if (ConfigurationSettings.ENABLE_OVERLAY_WORLD_TRANSMUTATION) { + drawInWorldTransmutationOverlay(event); + } } } } diff --git a/ee3_common/com/pahimar/ee3/core/handlers/TransmutationTargetOverlayHandler.java b/ee3_common/com/pahimar/ee3/core/handlers/TransmutationTargetOverlayHandler.java index f6c55c39..4ba75b71 100644 --- a/ee3_common/com/pahimar/ee3/core/handlers/TransmutationTargetOverlayHandler.java +++ b/ee3_common/com/pahimar/ee3/core/handlers/TransmutationTargetOverlayHandler.java @@ -21,6 +21,8 @@ import com.pahimar.ee3.lib.Reference; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.common.ITickHandler; import cpw.mods.fml.common.TickType; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; /** * Equivalent-Exchange-3 @@ -31,6 +33,7 @@ import cpw.mods.fml.common.TickType; * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) * */ +@SideOnly(Side.CLIENT) public class TransmutationTargetOverlayHandler implements ITickHandler { @Override @@ -49,8 +52,10 @@ public class TransmutationTargetOverlayHandler implements ITickHandler { if (player != null) { currentItemStack = player.inventory.getCurrentItem(); - if (currentItemStack != null && minecraft.inGameHasFocus && currentItemStack.getItem() instanceof ITransmutationStone && ConfigurationSettings.ENABLE_OVERLAY_WORLD_TRANSMUTATION) { - renderStoneHUD(minecraft, player, currentItemStack, (Float) tickData[0]); + if (minecraft.isGuiEnabled() && minecraft.inGameHasFocus) { + if (currentItemStack != null && currentItemStack.getItem() instanceof ITransmutationStone && ConfigurationSettings.ENABLE_OVERLAY_WORLD_TRANSMUTATION) { + renderStoneHUD(minecraft, player, currentItemStack, (Float) tickData[0]); + } } } }