diff options
author | Alexdoru <57050655+Alexdoru@users.noreply.github.com> | 2024-11-12 12:53:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-12 11:53:07 +0000 |
commit | c1a110a7fba458ef691cb31cf9bec4f8e988cf32 (patch) | |
tree | 5f351943b64b1b395b2937d9059b579e6f98b9ae | |
parent | ddd00719ff3287b6bd3f9444ce223ef869f86878 (diff) | |
download | GT5-Unofficial-c1a110a7fba458ef691cb31cf9bec4f8e988cf32.tar.gz GT5-Unofficial-c1a110a7fba458ef691cb31cf9bec4f8e988cf32.tar.bz2 GT5-Unofficial-c1a110a7fba458ef691cb31cf9bec4f8e988cf32.zip |
Delete NBT data about crafting components on MetaTileEntity (#3476)
Co-authored-by: Martin Robertz <dream-master@gmx.net>
-rw-r--r-- | src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java | 18 | ||||
-rw-r--r-- | src/main/java/gregtech/api/metatileentity/CoverableTileEntity.java | 2 |
2 files changed, 4 insertions, 16 deletions
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<ItemStack> 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); diff --git a/src/main/java/gregtech/api/metatileentity/CoverableTileEntity.java b/src/main/java/gregtech/api/metatileentity/CoverableTileEntity.java index bf62a1ce74..7669cf8b27 100644 --- a/src/main/java/gregtech/api/metatileentity/CoverableTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/CoverableTileEntity.java @@ -91,7 +91,6 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov protected void writeCoverNBT(NBTTagCompound aNBT, boolean isDrop) { final NBTTagList tList = new NBTTagList(); - final int[] coverSides = new int[] { 0, 0, 0, 0, 0, 0 }; for (final ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) { final CoverInfo coverInfo = getCoverInfoAtSide(side); @@ -107,6 +106,7 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov if (tList.tagCount() > 0) { aNBT.setTag(GTValues.NBT.COVERS, tList); // Backwards compat, in case of a revert... for now + final int[] coverSides = new int[] { 0, 0, 0, 0, 0, 0 }; aNBT.setIntArray("mCoverSides", coverSides); } |