Add pipe/wire hiding when holding soldering iron.
This commit is contained in:
parent
3362fe92a7
commit
d47a698e19
4 changed files with 28 additions and 29 deletions
|
@ -17,6 +17,7 @@ import gregtech.api.metatileentity.BaseMetaPipeEntity;
|
||||||
import gregtech.api.metatileentity.MetaPipeEntity;
|
import gregtech.api.metatileentity.MetaPipeEntity;
|
||||||
import gregtech.api.objects.GT_RenderedTexture;
|
import gregtech.api.objects.GT_RenderedTexture;
|
||||||
import gregtech.api.util.GT_Utility;
|
import gregtech.api.util.GT_Utility;
|
||||||
|
import gregtech.common.GT_Client;
|
||||||
import ic2.api.energy.tile.IEnergySink;
|
import ic2.api.energy.tile.IEnergySink;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
@ -300,6 +301,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float getThickNess() {
|
public float getThickNess() {
|
||||||
|
if(GT_Client.hideValue==1) return 0.125F;
|
||||||
return mThickNess;
|
return mThickNess;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ import gregtech.api.objects.GT_RenderedTexture;
|
||||||
import gregtech.api.objects.XSTR;
|
import gregtech.api.objects.XSTR;
|
||||||
import gregtech.api.util.GT_Log;
|
import gregtech.api.util.GT_Log;
|
||||||
import gregtech.api.util.GT_Utility;
|
import gregtech.api.util.GT_Utility;
|
||||||
|
import gregtech.common.GT_Client;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
@ -382,6 +383,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float getThickNess() {
|
public float getThickNess() {
|
||||||
|
if(GT_Client.hideValue==1) return 0.125F;
|
||||||
return mThickNess;
|
return mThickNess;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -10,6 +10,7 @@ import gregtech.api.metatileentity.BaseMetaPipeEntity;
|
||||||
import gregtech.api.metatileentity.MetaPipeEntity;
|
import gregtech.api.metatileentity.MetaPipeEntity;
|
||||||
import gregtech.api.objects.GT_RenderedTexture;
|
import gregtech.api.objects.GT_RenderedTexture;
|
||||||
import gregtech.api.util.GT_Utility;
|
import gregtech.api.util.GT_Utility;
|
||||||
|
import gregtech.common.GT_Client;
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.inventory.ISidedInventory;
|
import net.minecraft.inventory.ISidedInventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
@ -313,6 +314,7 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float getThickNess() {
|
public float getThickNess() {
|
||||||
|
if(GT_Client.hideValue==1) return 0.125F;
|
||||||
return mThickNess;
|
return mThickNess;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -36,6 +36,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.ChatComponentText;
|
import net.minecraft.util.ChatComponentText;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.client.event.DrawBlockHighlightEvent;
|
import net.minecraftforge.client.event.DrawBlockHighlightEvent;
|
||||||
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
@ -370,7 +371,7 @@ public class GT_Client extends GT_Proxy
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onClientTickEvent(cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent aEvent) {
|
public void onClientTickEvent(cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent aEvent) {
|
||||||
if (aEvent.phase == cpw.mods.fml.common.gameevent.TickEvent.Phase.END) {
|
if (aEvent.phase == cpw.mods.fml.common.gameevent.TickEvent.Phase.END) {
|
||||||
//hideValue=shouldHeldItemHideThings();
|
hideValue=shouldHeldItemHideThings();
|
||||||
mAnimationTick++;
|
mAnimationTick++;
|
||||||
if (mAnimationTick % 50L == 0L)
|
if (mAnimationTick % 50L == 0L)
|
||||||
{mAnimationDirection = !mAnimationDirection;}
|
{mAnimationDirection = !mAnimationDirection;}
|
||||||
|
@ -538,33 +539,25 @@ public class GT_Client extends GT_Proxy
|
||||||
aWorld.playSound(aX, aY, aZ, tString, 3F, tString.startsWith("note.") ? (float) Math.pow(2D, (double) (aStack.stackSize - 13) / 12D) : 1.0F, false);
|
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 hideValue=0;
|
||||||
|
|
||||||
//private static int shouldHeldItemHideThings() {
|
private static int shouldHeldItemHideThings() {
|
||||||
// try {
|
try {
|
||||||
// EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||||
// if (player == null) return 0;
|
if (player == null) return 0;
|
||||||
// ItemStack held = player.getCurrentEquippedItem();
|
ItemStack held = player.getCurrentEquippedItem();
|
||||||
// if (held == null) return 0;
|
if (held == null) return 0;
|
||||||
// int[] ids = OreDictionary.getOreIDs(held);
|
int[] ids = OreDictionary.getOreIDs(held);
|
||||||
// int hide = 0;
|
int hide = 0;
|
||||||
// for (int i : ids) {
|
for (int i : ids) {
|
||||||
// if (OreDictionary.getOreName(i).equals("craftingToolWrench")) {
|
if (OreDictionary.getOreName(i).equals("craftingToolSolderingIron")) {
|
||||||
// hide |= 0x1;
|
hide |= 0x1;
|
||||||
// continue;
|
break;
|
||||||
// }
|
}
|
||||||
// if (OreDictionary.getOreName(i).equals("craftingToolWireCutter")) {
|
}
|
||||||
// hide |= 0x2;
|
return hide;
|
||||||
// continue;
|
}catch(Exception e){
|
||||||
// }
|
return 0;
|
||||||
// if (OreDictionary.getOreName(i).equals("craftingToolSolderingIron")) {
|
}
|
||||||
// hide |= 0x3;
|
}
|
||||||
// continue;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// return hide;
|
|
||||||
// }catch(Exception e){
|
|
||||||
// return 0;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue