diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2016-10-20 22:56:00 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2016-10-20 22:56:00 +1000 |
commit | 71884a48d2797c20a82404e12ecdc6f3f4761c8a (patch) | |
tree | 6b10bba81e9dad6bd312142eb774d7df9229b224 /src/Java | |
parent | d6c2e9fd582594f9e19f732398d1c16d20d3b38e (diff) | |
download | GT5-Unofficial-71884a48d2797c20a82404e12ecdc6f3f4761c8a.tar.gz GT5-Unofficial-71884a48d2797c20a82404e12ecdc6f3f4761c8a.tar.bz2 GT5-Unofficial-71884a48d2797c20a82404e12ecdc6f3f4761c8a.zip |
$ Fixed A small mistake with Void Metal and the OreDictionary.
+ Added a 'hopeful' save for fluids when the TileEntity is broken.
Diffstat (limited to 'src/Java')
-rw-r--r-- | src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java | 14 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java | 19 |
2 files changed, 25 insertions, 8 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java index 24d1b0401d..3c285493af 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java @@ -15,6 +15,7 @@ import net.minecraftforge.fluids.FluidStack; public class GT_MetaTileEntity_TieredTank extends GT_MetaTileEntity_BasicTank { + private NBTTagCompound mRecipeStuff = new NBTTagCompound(); /*protected String fluidName = getFluidName(); protected int fluidAmount = getInternalFluidAmount();*/ @@ -73,13 +74,22 @@ public class GT_MetaTileEntity_TieredTank public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); Utils.LOG_INFO("Dumping Fluid data. Name: "+mFluid.getFluid().getName()+" Amount: "+mFluid.amount+"L"); - if (mFluid != null) aNBT.setTag("mFluid", mFluid.writeToNBT(new NBTTagCompound())); + if (mFluid != null){ + aNBT.setTag("mFluid", mFluid.writeToNBT(new NBTTagCompound())); + mRecipeStuff.setString("xFluidName", mFluid.getFluid().getName()); + mRecipeStuff.setInteger("xFluidAmount", mFluid.amount); + aNBT.setTag("GT.CraftingComponents", mRecipeStuff); + } + + + } @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); - mFluid = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid")); + mFluid = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid")); + mRecipeStuff = aNBT.getCompoundTag("GT.CraftingComponents"); } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java index 269f9e1340..a56bb60570 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java @@ -216,17 +216,21 @@ public class GregtechConduits { String output = materialName.substring(0, 1).toUpperCase() + materialName.substring(1); output = output.replace("-", "").replace("_", "").replace(" ", ""); + if (output.equals("VoidMetal")){ + output = "Void"; + } + Utils.LOG_INFO("Generating "+output+" pipes & respective recipes."); ItemStack pipeIngot = UtilsItems.getItemStackOfAmountFromOreDict("ingot"+output, 1).copy(); ItemStack pipePlate = UtilsItems.getItemStackOfAmountFromOreDict("plate"+output, 1).copy(); //Check all pipes are not null - Utils.LOG_WARNING("Generated pipeTiny from "+ materialName +"? "+ ((UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Tiny"+output, 1) != null) ? true : false)); - Utils.LOG_WARNING("Generated pipeSmall from "+ materialName +"? "+ ((UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Small"+output, 1) != null) ? true : false)); - Utils.LOG_WARNING("Generated pipeNormal from "+ materialName +"? "+ ((UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Medium"+output, 1) != null) ? true : false)); - Utils.LOG_WARNING("Generated pipeLarge from "+ materialName +"? "+ ((UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Large"+output, 1) != null) ? true : false)); - Utils.LOG_WARNING("Generated pipeHuge from "+ materialName +"? "+ ((UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Huge"+output, 1) != null) ? true : false)); + Utils.LOG_INFO("Generated pipeTiny from "+ materialName +"? "+ ((UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Tiny"+output, 1) != null) ? true : false)); + Utils.LOG_INFO("Generated pipeSmall from "+ materialName +"? "+ ((UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Small"+output, 1) != null) ? true : false)); + Utils.LOG_INFO("Generated pipeNormal from "+ materialName +"? "+ ((UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Medium"+output, 1) != null) ? true : false)); + Utils.LOG_INFO("Generated pipeLarge from "+ materialName +"? "+ ((UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Large"+output, 1) != null) ? true : false)); + Utils.LOG_INFO("Generated pipeHuge from "+ materialName +"? "+ ((UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Huge"+output, 1) != null) ? true : false)); int eut = 128; if ( @@ -293,13 +297,16 @@ public class GregtechConduits { UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Huge"+output, 1), 4*20, eut); - if (eut < 512){ + if (eut < 512 && !output.equals("Void")){ ItemStack pipePlateDouble = UtilsItems.getItemStackOfAmountFromOreDict("plateDouble"+output, 1).copy(); + if (pipePlateDouble != null) UtilsRecipe.recipeBuilder( pipePlateDouble, "craftingToolHardHammer", pipePlateDouble, pipePlateDouble, null, pipePlateDouble, pipePlateDouble, "craftingToolWrench", pipePlateDouble, UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Huge"+output, 1)); + else + Utils.LOG_INFO("Failed to add a recipe for "+materialName+" Huge pipes. Double plates probably do not exist."); } |