From c1a110a7fba458ef691cb31cf9bec4f8e988cf32 Mon Sep 17 00:00:00 2001 From: Alexdoru <57050655+Alexdoru@users.noreply.github.com> Date: Tue, 12 Nov 2024 12:53:07 +0100 Subject: Delete NBT data about crafting components on MetaTileEntity (#3476) Co-authored-by: Martin Robertz --- .../api/metatileentity/BaseMetaTileEntity.java | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java') diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java index da81e7d9cb..36c3fc3f04 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java @@ -126,7 +126,6 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity private long mLastCheckTick = 0; private String mOwnerName = ""; private UUID mOwnerUuid = GTUtility.defaultUuid; - private NBTTagCompound mRecipeStuff = new NBTTagCompound(); private int cableUpdateDelay = 30; public BaseMetaTileEntity() {} @@ -158,7 +157,6 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity nbt.setBoolean("mWorks", !mWorks); nbt.setBoolean("mInputDisabled", mInputDisabled); nbt.setBoolean("mOutputDisabled", mOutputDisabled); - nbt.setTag("GT.CraftingComponents", mRecipeStuff); nbt.setString("shutDownReasonID", getLastShutDownReason().getID()); nbt.setTag("shutDownReason", getLastShutDownReason().writeToNBT(new NBTTagCompound())); } catch (Throwable e) { @@ -215,7 +213,6 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity mOtherUpgrades = (byte) (aNBT.getByte("mOtherUpgrades") + aNBT.getByte("mBatteries") + aNBT.getByte("mLiBatteries")); - mRecipeStuff = aNBT.getCompoundTag("GT.CraftingComponents"); final int nbtVersion = aNBT.getInteger("nbtVersion"); readCoverNBT(aNBT); loadMetaTileNBT(aNBT); @@ -1412,14 +1409,6 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity } } } - if (mRecipeStuff != null) { - for (int i = 0; i < 9; i++) { - if (this.getRandomNumber(100) < 50) { - dropItems(GTUtility.loadItem(mRecipeStuff, "Ingredient." + i)); - } - } - } - Pollution.addPollution((TileEntity) this, GTMod.gregtechproxy.mPollutionOnExplosion); mMetaTileEntity.doExplosion(aAmount); } @@ -1455,10 +1444,9 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity public ArrayList getDrops() { final ItemStack rStack = new ItemStack(GregTechAPI.sBlockMachines, 1, mID); final NBTTagCompound tNBT = new NBTTagCompound(); - if (mRecipeStuff != null && !mRecipeStuff.hasNoTags()) tNBT.setTag("GT.CraftingComponents", mRecipeStuff); - if (mMuffler) tNBT.setBoolean("mMuffler", mMuffler); - if (mLockUpgrade) tNBT.setBoolean("mLockUpgrade", mLockUpgrade); - if (mSteamConverter) tNBT.setBoolean("mSteamConverter", mSteamConverter); + if (mMuffler) tNBT.setBoolean("mMuffler", true); + if (mLockUpgrade) tNBT.setBoolean("mLockUpgrade", true); + if (mSteamConverter) tNBT.setBoolean("mSteamConverter", true); if (mColor > 0) tNBT.setByte("mColor", mColor); if (mOtherUpgrades > 0) tNBT.setByte("mOtherUpgrades", mOtherUpgrades); -- cgit