From 88b575ed3cccba9fd37eae4f6b4d91f72c31fd27 Mon Sep 17 00:00:00 2001 From: Blood Asp Date: Thu, 23 Apr 2015 20:38:52 +0200 Subject: [PATCH] Fix compatibility with forge older than 1355 --- main/java/gregtech/api/items/GT_MetaBase_Item.java | 4 ++-- .../implementations/GT_MetaPipeEntity_Fluid.java | 4 ++-- .../implementations/GT_MetaTileEntity_BasicTank.java | 4 ++-- main/java/gregtech/api/util/GT_Utility.java | 2 +- .../machines/multi/GT_MetaTileEntity_FusionComputer.java | 8 ++++---- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/main/java/gregtech/api/items/GT_MetaBase_Item.java b/main/java/gregtech/api/items/GT_MetaBase_Item.java index e977ef3f..4a0cd6f6 100644 --- a/main/java/gregtech/api/items/GT_MetaBase_Item.java +++ b/main/java/gregtech/api/items/GT_MetaBase_Item.java @@ -449,11 +449,11 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci } Long[] tStats = getFluidContainerStats(aStack); - if (tStats == null || tStats[0] <= 0 || aFluid == null || aFluid.getFluidID() <= 0 || aFluid.amount <= 0) return 0; + if (tStats == null || tStats[0] <= 0 || aFluid == null || aFluid.getFluid().getID() <= 0 || aFluid.amount <= 0) return 0; FluidStack tFluid = getFluidContent(aStack); - if (tFluid == null || tFluid.getFluidID() <= 0) { + if (tFluid == null || tFluid.getFluid().getID() <= 0) { if (aFluid.amount <= tStats[0]) { if (doFill) { setFluidContent(aStack, aFluid); diff --git a/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java b/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java index 426d4cfb..cb5c1b2f 100644 --- a/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java +++ b/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java @@ -262,9 +262,9 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { @Override public final int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) { - if (aFluid == null || aFluid.getFluidID() <= 0) return 0; + if (aFluid == null || aFluid.getFluid().getID() <= 0) return 0; - if (mFluid == null || mFluid.getFluidID() <= 0) { + if (mFluid == null || mFluid.getFluid().getID() <= 0) { if(aFluid.amount <= getCapacity()) { if (doFill) { mFluid = aFluid.copy(); diff --git a/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicTank.java b/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicTank.java index f5787161..594411c3 100644 --- a/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicTank.java +++ b/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicTank.java @@ -131,9 +131,9 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier @Override public int fill(FluidStack aFluid, boolean doFill) { - if (aFluid == null || aFluid.getFluidID() <= 0 || aFluid.amount <= 0 || !canTankBeFilled() || !isFluidInputAllowed(aFluid)) return 0; + if (aFluid == null || aFluid.getFluid().getID() <= 0 || aFluid.amount <= 0 || !canTankBeFilled() || !isFluidInputAllowed(aFluid)) return 0; - if (getFillableStack() == null || getFillableStack().getFluidID() <= 0) { + if (getFillableStack() == null || getFillableStack().getFluid().getID() <= 0) { if(aFluid.amount <= getCapacity()) { if (doFill) { setFillableStack(aFluid.copy()); diff --git a/main/java/gregtech/api/util/GT_Utility.java b/main/java/gregtech/api/util/GT_Utility.java index 666dc4f2..85a92c32 100644 --- a/main/java/gregtech/api/util/GT_Utility.java +++ b/main/java/gregtech/api/util/GT_Utility.java @@ -881,7 +881,7 @@ public class GT_Utility { if (aFluid == null || aFluid.getFluid() == null) return null; int tmp = 0; try{ - tmp = aFluid.getFluidID(); + tmp = aFluid.getFluid().getID(); }catch(Exception e){ System.err.println(e); } diff --git a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java b/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java index 1dbf25e5..5e8cf38a 100644 --- a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java +++ b/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java @@ -233,9 +233,9 @@ public boolean isCorrectMachinePart(ItemStack aStack) {return true;} public boolean checkRecipe(ItemStack aStack) { if(this.mLastRecipe!=null){; for(GT_MetaTileEntity_Hatch_Input tInput : this.mInputHatches){ - if(tInput.mFluid!=null&& tInput.mFluid!=null&&tInput.mFluid.getFluidID()==this.mLastRecipe.mFluidInputs[0].getFluidID()&&tInput.mFluid.amount>=this.mLastRecipe.mFluidInputs[0].amount){ + if(tInput.mFluid!=null&& tInput.mFluid!=null&&tInput.mFluid.getFluid().getID()==this.mLastRecipe.mFluidInputs[0].getFluid().getID()&&tInput.mFluid.amount>=this.mLastRecipe.mFluidInputs[0].amount){ for(GT_MetaTileEntity_Hatch_Input tInput2 : this.mInputHatches){ - if(tInput2.mFluid!=null&& tInput2.mFluid!=null&&tInput2.mFluid.getFluidID()==this.mLastRecipe.mFluidInputs[1].getFluidID()&&tInput2.mFluid.amount>=this.mLastRecipe.mFluidInputs[1].amount&&getMaxInputVoltage()>=this.mLastRecipe.mEUt){ + if(tInput2.mFluid!=null&& tInput2.mFluid!=null&&tInput2.mFluid.getFluid().getID()==this.mLastRecipe.mFluidInputs[1].getFluid().getID()&&tInput2.mFluid.amount>=this.mLastRecipe.mFluidInputs[1].amount&&getMaxInputVoltage()>=this.mLastRecipe.mEUt){ tInput.drain(this.mLastRecipe.mFluidInputs[0].amount, true); tInput2.drain(this.mLastRecipe.mFluidInputs[1].amount, true); this.mEUt = -(this.mLastRecipe.mEUt*tierOverclock()); @@ -255,11 +255,11 @@ public boolean checkRecipe(ItemStack aStack) { FluidStack tFluid = tRecipe.mFluidInputs[0]; if(tFluid!=null){ for(GT_MetaTileEntity_Hatch_Input tInput : this.mInputHatches){ - if(tFluid.fluid !=null&& tInput.getFluid()!=null && tFluid.fluid.getID()==tInput.getFluid().getFluidID()&&tFluid.amount<=tInput.getFluid().amount){ + if(tFluid.fluid !=null&& tInput.getFluid()!=null && tFluid.fluid.getID()==tInput.getFluid().getFluid().getID()&&tFluid.amount<=tInput.getFluid().amount){ FluidStack tFluid2 = tRecipe.mFluidInputs[1]; if(tFluid2!=null){ for(GT_MetaTileEntity_Hatch_Input tInput2 : this.mInputHatches){ - if(tFluid2.fluid !=null&& tInput2.getFluid()!=null&&tFluid2.fluid.getID()==tInput2.getFluid().getFluidID()&&tFluid2.amount<=tInput2.getFluid().amount&&getMaxInputVoltage()>=tRecipe.mEUt&&this.mEUStore>=tRecipe.mSpecialValue){ + if(tFluid2.fluid !=null&& tInput2.getFluid()!=null&&tFluid2.fluid.getID()==tInput2.getFluid().getFluid().getID()&&tFluid2.amount<=tInput2.getFluid().amount&&getMaxInputVoltage()>=tRecipe.mEUt&&this.mEUStore>=tRecipe.mSpecialValue){ tInput.drain(tFluid.amount, true); tInput2.drain(tFluid2.amount, true); this.mLastRecipe=tRecipe;