From 36e8584e4ceb7e8fdc4c2834f54518519b082d88 Mon Sep 17 00:00:00 2001 From: MauveCloud Date: Tue, 14 Mar 2017 10:00:51 -0700 Subject: [PATCH] Partial fix for #955 Restores ability to use different explosives. --- .../GT_MetaTileEntity_SeismicProspector.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java index 29b02755..8e23ff1d 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java @@ -11,6 +11,10 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.objects.ItemData; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; +import gregtech.api.util.GT_ModHandler; +import ic2.core.ref.BlockName; +import ic2.core.ref.ItemName; +import ic2.core.ref.TeBlock; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; @@ -45,11 +49,21 @@ public class GT_MetaTileEntity_SeismicProspector extends GT_MetaTileEntity_Basic if (aBaseMetaTileEntity.isServerSide()) { ItemStack aStack = aPlayer.getHeldItem(hand); if (!ready && (aStack != null) && ( - (aStack.getItem() == Item.getItemFromBlock(Blocks.TNT) && aStack.stackSize > 3 ) || - (GT_OreDictUnificator.getItemData(aStack).mMaterial.mMaterial == Materials.Glyceryl && aStack.stackSize > 0 ) + (aStack.getItem() == Item.getItemFromBlock(Blocks.TNT) && aStack.stackSize > 3 ) || + (aStack.getItem() == GT_ModHandler.getIC2Item(BlockName.te, TeBlock.itnt, 1).getItem() && aStack.stackSize > 1 ) || + (aStack.getItem() == GT_ModHandler.getIC2Item(ItemName.dynamite, 1).getItem() && aStack.stackSize > 7 ) || + (GT_OreDictUnificator.getItemData(aStack).mMaterial.mMaterial == Materials.Glyceryl && aStack.stackSize > 0 ) ) ) { if ((!aPlayer.capabilities.isCreativeMode) && (aStack.stackSize != 111)) { + if(aStack.getItem() == Item.getItemFromBlock(Blocks.TNT)){ aStack.stackSize -= 4; + }else if(aStack.getItem() == GT_ModHandler.getIC2Item(BlockName.te, TeBlock.itnt, 1).getItem()){ + aStack.stackSize -= 2; + }else if(aStack.getItem() == GT_ModHandler.getIC2Item(ItemName.dynamite, 1).getItem()){ + aStack.stackSize -= 8; + }else{ + aStack.stackSize -= 1; + } } this.ready = true; this.mMaxProgresstime = 200;