diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2018-07-21 08:24:26 +1000 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2018-07-21 08:24:26 +1000 |
commit | f08d4b2bddadb0b2f5e2f045103c56814ae5b4d7 (patch) | |
tree | 2ffb43278207cfe8e7d318e89db99ab73809d0be /src/Java/gtPlusPlus | |
parent | 6d716255c4b759769f4e5c3ef778629f7af5df42 (diff) | |
download | GT5-Unofficial-f08d4b2bddadb0b2f5e2f045103c56814ae5b4d7.tar.gz GT5-Unofficial-f08d4b2bddadb0b2f5e2f045103c56814ae5b4d7.tar.bz2 GT5-Unofficial-f08d4b2bddadb0b2f5e2f045103c56814ae5b4d7.zip |
$ Small Pump fix that allowed mis-use when right clicking.
% Moved Ender Pearl fluid extraction to the base TF recipe class.
Diffstat (limited to 'src/Java/gtPlusPlus')
3 files changed, 43 insertions, 28 deletions
diff --git a/src/Java/gtPlusPlus/core/item/tool/misc/GregtechPump.java b/src/Java/gtPlusPlus/core/item/tool/misc/GregtechPump.java index fd7682b5c2..9b5245a76d 100644 --- a/src/Java/gtPlusPlus/core/item/tool/misc/GregtechPump.java +++ b/src/Java/gtPlusPlus/core/item/tool/misc/GregtechPump.java @@ -32,6 +32,7 @@ import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.NBTUtils; +import gtPlusPlus.core.util.minecraft.PlayerUtils; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; import ic2.api.item.IElectricItemManager; @@ -72,14 +73,14 @@ public class GregtechPump extends Item implements ISpecialElectricItem, IElectri if (tryDrainTile(aStack, aWorld, aPlayer, aX, aY, aZ)) { return true; } else { - return super.onItemUse(aStack, aPlayer, aWorld, aX, aY, aZ, a4, p_77648_8_, p_77648_9_, p_77648_10_); + //return super.onItemUse(aStack, aPlayer, aWorld, aX, aY, aZ, a4, p_77648_8_, p_77648_9_, p_77648_10_); + return false; } } @Override public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { - // TODO Auto-generated method stub - return super.onItemRightClick(p_77659_1_, p_77659_2_, p_77659_3_); + return p_77659_1_; } /** @@ -696,11 +697,19 @@ public class GregtechPump extends Item implements ISpecialElectricItem, IElectri * IFluidContainer Functions */ - public void emptyStoredFluid(ItemStack aStack) { - String fluidname = "@@@@@"; - int amount = 0; - NBTUtils.setString(aStack, "mFluid", fluidname); - NBTUtils.setInteger(aStack, "mFluidAmount", amount); + public void emptyStoredFluid(ItemStack aStack) { + if (aStack.hasTagCompound()) { + NBTTagCompound t = aStack.getTagCompound(); + if (t.hasKey("mInit")) { + t.removeTag("mInit"); + } + if (t.hasKey("mFluid")) { + t.removeTag("mFluid"); + } + if (t.hasKey("mFluidAmount")) { + t.removeTag("mFluidAmount"); + } + } } public void storeFluid(ItemStack aStack, FluidStack aFluid) { @@ -902,8 +911,20 @@ public class GregtechPump extends Item implements ISpecialElectricItem, IElectri return false; } else { int aTier = (aStack.getItemDamage() - 1000); - - if (this.getCharge(aStack) <= 0 && aTier > 1) { + int removal; + if (aTier == 0) { + removal = 0; + } else if (aTier == 1) { + removal = 32; + } else if (aTier == 2) { + removal = 128; + } else if (aTier == 3) { + removal = 512; + } else { + removal = 8; + } + if (!canUse(aStack, removal) && aTier > 0) { + PlayerUtils.messagePlayer(aPlayer, "Not enough power."); Logger.INFO("No Power"); return false; } @@ -918,18 +939,6 @@ public class GregtechPump extends Item implements ISpecialElectricItem, IElectri } else { double aCharge = this.getCharge(aStack); boolean didDrain; - int removal; - if (aTier == 0) { - removal = 0; - } else if (aTier == 1) { - removal = 32; - } else if (aTier == 2) { - removal = 128; - } else if (aTier == 3) { - removal = 512; - } else { - removal = 8; - } if (aTier > 0 && aCharge > 0) { if (discharge(aStack, removal, aTier, true, true, false) > 0) { didDrain = true; @@ -981,7 +990,10 @@ public class GregtechPump extends Item implements ISpecialElectricItem, IElectri } boolean b = setStoredFluidOfVanillaTank(tTileEntity, newStackRemainingInTank); Logger.INFO("Cleared Tank? " + b + " | mAmountInserted: " + mAmountInserted); - Logger.INFO("Returning " + b + " - drainTankVanilla."); + Logger.INFO("Returning " + b + " - drainTankVanilla."); + if (b) { + PlayerUtils.messagePlayer(aPlayer, "Drained "+mAmountInserted+"L of "+aStored.getLocalizedName()+"."); + } return b; } } else { @@ -1028,7 +1040,10 @@ public class GregtechPump extends Item implements ISpecialElectricItem, IElectri } boolean b = setStoredFluidOfGTMachine((IGregTechTileEntity) tTileEntity, newStackRemainingInTank); Logger.INFO("Cleared Tank? " + b + " | mAmountInserted: " + mAmountInserted); - Logger.INFO("Returning " + b + " - drainTankGT."); + Logger.INFO("Returning " + b + " - drainTankGT."); + if (b) { + PlayerUtils.messagePlayer(aPlayer, "Drained "+mAmountInserted+"L of "+aStored.getLocalizedName()+"."); + } return b; } } else { diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java index 6b50dc688a..b0c928404b 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java @@ -747,10 +747,7 @@ public class RECIPES_GREGTECH { ItemList.Battery_Hull_HV.get(4L, new Object[0])); } - private static void fluidExtractorRecipes() { - //Ender Fluid - GT_Values.RA.addFluidExtractionRecipe(ItemUtils.getSimpleStack(Items.ender_pearl), null, - FluidUtils.getFluidStack("ender", 250), 10000, 100, 30); + private static void fluidExtractorRecipes() { //FLiBe fuel GT_Values.RA.addFluidExtractionRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustLi2BeF4", 1), null, FluidUtils.getFluidStack("molten.li2bef4", 144), 10000, 100, 500); diff --git a/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java b/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java index e3aaa1ae2f..7e7047da69 100644 --- a/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java +++ b/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java @@ -49,6 +49,9 @@ public class TF_Gregtech_Recipes { Logger.INFO("Adding Recipes for Blazing Pyrotheum"); GT_Values.RA.addFluidExtractionRecipe(dust_Pyrotheum, GT_Values.NI, getFluidStack("pyrotheum", 250), 10000, 200, 240); + //Ender Fluid + GT_Values.RA.addFluidExtractionRecipe(ItemUtils.getSimpleStack(Items.ender_pearl), GT_Values.NI, getFluidStack("ender", 250), 10000, 100, 30); + ItemStack dustCoal = ItemUtils.getItemStackOfAmountFromOreDict("dustCoal", 1); ItemStack dustSulfur = ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 1); |