diff options
author | Alkalus <draknyte1@hotmail.com> | 2017-08-06 22:53:03 +0000 |
---|---|---|
committer | Alkalus <draknyte1@hotmail.com> | 2017-08-06 22:53:03 +0000 |
commit | 6287c02d9d0114595424ffa585a55d5b133451ad (patch) | |
tree | b9fb653e62144ff279ad990bfcb7311d1f4eb3ab /src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators | |
parent | 3e342a56584b3ea5775cfc2de276ecdde1996848 (diff) | |
download | GT5-Unofficial-6287c02d9d0114595424ffa585a55d5b133451ad.tar.gz GT5-Unofficial-6287c02d9d0114595424ffa585a55d5b133451ad.tar.bz2 GT5-Unofficial-6287c02d9d0114595424ffa585a55d5b133451ad.zip |
% Improved handling of cached recipe within the RTG.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators')
-rw-r--r-- | src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java index de7299a18e..51569953e4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java @@ -83,16 +83,12 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator this.mDayTick = aNBT.getInteger("mDayTick"); - final NBTTagList list = aNBT.getTagList("mRecipeItem", 10); - ItemStack[] inventory = new ItemStack[1]; - for(int i = 0;i<list.tagCount();i++){ - final NBTTagCompound data = list.getCompoundTagAt(i); - final int slot = data.getInteger("mSlot"); - if((slot >= 0) && (slot < 1)){ - inventory[slot] = ItemStack.loadItemStackFromNBT(data); - } + final NBTTagList list = aNBT.getTagList("mRecipeItem", 10); + final NBTTagCompound data = list.getCompoundTagAt(0); + ItemStack lastUsedFuel = ItemStack.loadItemStackFromNBT(data); + if (lastUsedFuel != null){ + this.mCurrentRecipe = getRecipes().findRecipe(getBaseMetaTileEntity(), false, 9223372036854775807L, null, new ItemStack[] { lastUsedFuel }); } - this.mCurrentRecipe = getRecipes().findRecipe(getBaseMetaTileEntity(), false, 9223372036854775807L, null, new ItemStack[] { inventory[0] }); } public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { |