diff options
author | Technus <daniel112092@gmail.com> | 2017-05-18 10:50:21 +0200 |
---|---|---|
committer | Technus <daniel112092@gmail.com> | 2017-05-18 10:50:21 +0200 |
commit | 08cd5fe48560f7b8db2252733afe59d160eaf426 (patch) | |
tree | 8fdf2be2af875d89707420bdf9d978c788fea4cd /src/main/java/gregtech | |
parent | 90eaac5c7434aef000163b57ac000bc1a212a7d1 (diff) | |
download | GT5-Unofficial-08cd5fe48560f7b8db2252733afe59d160eaf426.tar.gz GT5-Unofficial-08cd5fe48560f7b8db2252733afe59d160eaf426.tar.bz2 GT5-Unofficial-08cd5fe48560f7b8db2252733afe59d160eaf426.zip |
Make the save/load the same as in bloodasp
Diffstat (limited to 'src/main/java/gregtech')
-rw-r--r-- | src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java | 17 | ||||
-rw-r--r-- | src/main/java/gregtech/loaders/materialprocessing/ProcessingConfig.java | 2 |
2 files changed, 12 insertions, 7 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java index 9256117ab3..8cbffc0cf2 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java @@ -119,23 +119,25 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { aNBT.setInteger("mRuntime", mRuntime); if (mOutputItems != null) { - aNBT.setInteger("mOutputItemsLength", mOutputItems.length); - for (int i = 0; i < mOutputItems.length; i++) + aNBT.setInteger("mOutputItemsLength", mOutputItems.length); + for (int i = 0; i < mOutputItems.length; i++) if (mOutputItems[i] != null) { NBTTagCompound tNBT = new NBTTagCompound(); mOutputItems[i].writeToNBT(tNBT); aNBT.setTag("mOutputItem" + i, tNBT); } } + if (mOutputFluids != null) { - aNBT.setInteger("mOutputFluidsLength", mOutputFluids.length); - for (int i = 0; i < mOutputFluids.length; i++) + aNBT.setInteger("mOutputFluidsLength", mOutputFluids.length); + for (int i = 0; i < mOutputFluids.length; i++) if (mOutputFluids[i] != null) { NBTTagCompound tNBT = new NBTTagCompound(); mOutputFluids[i].writeToNBT(tNBT); aNBT.setTag("mOutputFluids" + i, tNBT); } } + aNBT.setBoolean("mWrench", mWrench); aNBT.setBoolean("mScrewdriver", mScrewdriver); aNBT.setBoolean("mSoftHammer", mSoftHammer); @@ -154,12 +156,12 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { mEfficiency = aNBT.getInteger("mEfficiency"); mPollution = aNBT.getInteger("mPollution"); mRuntime = aNBT.getInteger("mRuntime"); - + int aOutputItemsLength = aNBT.getInteger("mOutputItemsLength"); if (aOutputItemsLength > 0) { mOutputItems = new ItemStack[aOutputItemsLength]; for (int i = 0; i < mOutputItems.length; i++) - mOutputItems[i] = GT_Utility.loadItem(aNBT, "mOutputItem" + i); + mOutputItems[i] = GT_Utility.loadItem(aNBT, "mOutputItem" + i); } int aOutputFluidsLength = aNBT.getInteger("mOutputFluidsLength"); @@ -168,7 +170,8 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { for (int i = 0; i < mOutputFluids.length; i++) mOutputFluids[i] = GT_Utility.loadFluid(aNBT, "mOutputFluids" + i); } - + + mWrench = aNBT.getBoolean("mWrench"); mScrewdriver = aNBT.getBoolean("mScrewdriver"); mSoftHammer = aNBT.getBoolean("mSoftHammer"); diff --git a/src/main/java/gregtech/loaders/materialprocessing/ProcessingConfig.java b/src/main/java/gregtech/loaders/materialprocessing/ProcessingConfig.java index 1baf79e6d9..abf63abe29 100644 --- a/src/main/java/gregtech/loaders/materialprocessing/ProcessingConfig.java +++ b/src/main/java/gregtech/loaders/materialprocessing/ProcessingConfig.java @@ -3,6 +3,7 @@ package gregtech.loaders.materialprocessing; import gregtech.api.GregTech_API; import gregtech.api.enums.Dyes; import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TextureSet; public class ProcessingConfig implements gregtech.api.interfaces.IMaterialHandler { @@ -12,6 +13,7 @@ public class ProcessingConfig implements gregtech.api.interfaces.IMaterialHandle @Override public void onMaterialsInit() { + /** This is just left here as an example of how to add new materials. **/ int i = 0; for (int j = GregTech_API.sMaterialProperties.get("general", "AmountOfCustomMaterialSlots", 16); i < j; i++) { String aID = (i < 10 ? "0" : "") + i; |