diff options
author | Techlone <techlone.mc@gmail.com> | 2017-06-13 17:44:13 +0500 |
---|---|---|
committer | Techlone <techlone.mc@gmail.com> | 2017-06-13 17:44:13 +0500 |
commit | bfd3ff4b19f79efd7f68aec22998c70e09d024f8 (patch) | |
tree | d2c18ed50733042779a8585cb20b4e78453f3816 /src/main/java/gregtech/common/GT_Client.java | |
parent | 3fa72fd1f110f11f2825e27a81f586f807b82bc4 (diff) | |
parent | d7debfd34ece3435dc0f47c54635946c8f29d6f9 (diff) | |
download | GT5-Unofficial-bfd3ff4b19f79efd7f68aec22998c70e09d024f8.tar.gz GT5-Unofficial-bfd3ff4b19f79efd7f68aec22998c70e09d024f8.tar.bz2 GT5-Unofficial-bfd3ff4b19f79efd7f68aec22998c70e09d024f8.zip |
Merge branch 'unstable' of https://github.com/Techlone/GT5-Unofficial into unstable
Diffstat (limited to 'src/main/java/gregtech/common/GT_Client.java')
-rw-r--r-- | src/main/java/gregtech/common/GT_Client.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/main/java/gregtech/common/GT_Client.java b/src/main/java/gregtech/common/GT_Client.java index ff4968cd16..494e399762 100644 --- a/src/main/java/gregtech/common/GT_Client.java +++ b/src/main/java/gregtech/common/GT_Client.java @@ -30,6 +30,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.client.event.DrawBlockHighlightEvent; +import net.minecraftforge.oredict.OreDictionary; import org.lwjgl.opengl.GL11; import java.net.URL; @@ -327,6 +328,12 @@ public class GT_Client extends GT_Proxy @SubscribeEvent public void onClientTickEvent(cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent aEvent) { if (aEvent.phase == cpw.mods.fml.common.gameevent.TickEvent.Phase.END) { + if(changeDetected>0)changeDetected--; + int newHideValue=shouldHeldItemHideThings(); + if(newHideValue!=hideValue){ + hideValue=newHideValue; + changeDetected=5; + } mAnimationTick++; if (mAnimationTick % 50L == 0L) {mAnimationDirection = !mAnimationDirection;} @@ -493,4 +500,27 @@ public class GT_Client extends GT_Proxy else aWorld.playSound(aX, aY, aZ, tString, 3F, tString.startsWith("note.") ? (float) Math.pow(2D, (double) (aStack.stackSize - 13) / 12D) : 1.0F, false); } + + public static int hideValue=0; + public static int changeDetected=0; + + private static int shouldHeldItemHideThings() { + try { + EntityPlayer player = Minecraft.getMinecraft().thePlayer; + if (player == null) return 0; + ItemStack held = player.getCurrentEquippedItem(); + if (held == null) return 0; + int[] ids = OreDictionary.getOreIDs(held); + int hide = 0; + for (int i : ids) { + if (OreDictionary.getOreName(i).equals("craftingToolSolderingIron")) { + hide |= 0x1; + break; + } + } + return hide; + }catch(Exception e){ + return 0; + } + } }
\ No newline at end of file |