Fix compatibility with forge older than 1355

This commit is contained in:
Blood Asp 2015-04-23 20:38:52 +02:00
parent 7224ac4299
commit 88b575ed3c
5 changed files with 11 additions and 11 deletions

View file

@ -449,11 +449,11 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci
} }
Long[] tStats = getFluidContainerStats(aStack); 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); FluidStack tFluid = getFluidContent(aStack);
if (tFluid == null || tFluid.getFluidID() <= 0) { if (tFluid == null || tFluid.getFluid().getID() <= 0) {
if (aFluid.amount <= tStats[0]) { if (aFluid.amount <= tStats[0]) {
if (doFill) { if (doFill) {
setFluidContent(aStack, aFluid); setFluidContent(aStack, aFluid);

View file

@ -262,9 +262,9 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
@Override @Override
public final int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) { 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(aFluid.amount <= getCapacity()) {
if (doFill) { if (doFill) {
mFluid = aFluid.copy(); mFluid = aFluid.copy();

View file

@ -131,9 +131,9 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier
@Override @Override
public int fill(FluidStack aFluid, boolean doFill) { 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(aFluid.amount <= getCapacity()) {
if (doFill) { if (doFill) {
setFillableStack(aFluid.copy()); setFillableStack(aFluid.copy());

View file

@ -881,7 +881,7 @@ public class GT_Utility {
if (aFluid == null || aFluid.getFluid() == null) return null; if (aFluid == null || aFluid.getFluid() == null) return null;
int tmp = 0; int tmp = 0;
try{ try{
tmp = aFluid.getFluidID(); tmp = aFluid.getFluid().getID();
}catch(Exception e){ }catch(Exception e){
System.err.println(e); System.err.println(e);
} }

View file

@ -233,9 +233,9 @@ public boolean isCorrectMachinePart(ItemStack aStack) {return true;}
public boolean checkRecipe(ItemStack aStack) { public boolean checkRecipe(ItemStack aStack) {
if(this.mLastRecipe!=null){; if(this.mLastRecipe!=null){;
for(GT_MetaTileEntity_Hatch_Input tInput : this.mInputHatches){ 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){ 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); tInput.drain(this.mLastRecipe.mFluidInputs[0].amount, true);
tInput2.drain(this.mLastRecipe.mFluidInputs[1].amount, true); tInput2.drain(this.mLastRecipe.mFluidInputs[1].amount, true);
this.mEUt = -(this.mLastRecipe.mEUt*tierOverclock()); this.mEUt = -(this.mLastRecipe.mEUt*tierOverclock());
@ -255,11 +255,11 @@ public boolean checkRecipe(ItemStack aStack) {
FluidStack tFluid = tRecipe.mFluidInputs[0]; FluidStack tFluid = tRecipe.mFluidInputs[0];
if(tFluid!=null){ if(tFluid!=null){
for(GT_MetaTileEntity_Hatch_Input tInput : this.mInputHatches){ 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]; FluidStack tFluid2 = tRecipe.mFluidInputs[1];
if(tFluid2!=null){ if(tFluid2!=null){
for(GT_MetaTileEntity_Hatch_Input tInput2 : this.mInputHatches){ 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); tInput.drain(tFluid.amount, true);
tInput2.drain(tFluid2.amount, true); tInput2.drain(tFluid2.amount, true);
this.mLastRecipe=tRecipe; this.mLastRecipe=tRecipe;