From 9c71ae70fc2276b4c56baa26217be2d23dde63b6 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Thu, 10 Oct 2019 18:44:32 +0100 Subject: + Added OD tag 'rodBlaze' to blaze rods. $ Corrected certain multiblocks not counting their casings during construction. Fixes #549. $ Stopped custom MTE's incorrectly handling getDrops(). Fixes #553. $ Stopped GT++ Multis trying to reduce the 'wait' time on themselves when placed or first loaded. Fixes #556. --- .../api/metatileentity/BaseCustomTileEntity.java | 38 +++++++++++++++++----- .../base/GregtechMeta_MultiBlockBase.java | 4 +-- 2 files changed, 31 insertions(+), 11 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java index e637365c1e..f6bec1f402 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java @@ -11,6 +11,7 @@ import gregtech.api.util.GT_Log; import gregtech.api.util.GT_Utility; import gregtech.common.GT_Pollution; import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; @@ -96,17 +97,36 @@ public class BaseCustomTileEntity extends BaseMetaTileEntity { } public ArrayList getDrops() { - ItemStack rStack = new ItemStack(Meta_GT_Proxy.sBlockMachines, 1, this.getMetaTileID()); - NBTTagCompound aSuperNBT = super.getDrops().get(0).getTagCompound(); - NBTTagCompound tNBT = aSuperNBT; - if (this.hasValidMetaTileEntity()) { - this.mMetaTileEntity.setItemNBT(tNBT); + ArrayList aDrops = new ArrayList(); + ItemStack rStack = new ItemStack(GregTech_API.sBlockMachines, 1, this.getMetaTileID()); + // Currently not using my custom block. + // ItemStack rStack = new ItemStack(Meta_GT_Proxy.sBlockMachines, 1, + // this.getMetaTileID()); + boolean fail = true; + + ArrayList aSuperDrops = super.getDrops(); + if (aSuperDrops != null && !aSuperDrops.isEmpty()) { + ItemStack aSuperStack = super.getDrops().get(0); + if (aSuperStack != null && aSuperStack.hasTagCompound()) { + NBTTagCompound aSuperNBT = aSuperStack.getTagCompound(); + if (aSuperNBT != null && !aSuperNBT.hasNoTags()) { + NBTTagCompound tNBT = (NBTTagCompound) aSuperNBT.copy(); + if (tNBT != null && !tNBT.hasNoTags()) { + if (this.hasValidMetaTileEntity()) { + this.mMetaTileEntity.setItemNBT(tNBT); + rStack.setTagCompound(tNBT); + fail = false; + aDrops.add(rStack); + } + } + } + + } } - if (!tNBT.hasNoTags()) { - rStack.setTagCompound(tNBT); + if (fail) { + aDrops.add(rStack); } - - return new ArrayList(Arrays.asList(new ItemStack[] { rStack })); + return aDrops; } public boolean isTeleporterCompatible(Direction aSide) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java index b556dc10f9..c16f62866f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java @@ -2232,9 +2232,9 @@ GT_MetaTileEntity_MultiBlockBase { } private final void tryTickWaitTimerDown() { - if (mStartUpCheck > 10) { + /*if (mStartUpCheck > 10) { mStartUpCheck = 10; - } + }*/ } -- cgit