Changed the Primitive Blast Furnace so that it uses the new Recipe Map
This commit is contained in:
parent
7982374b38
commit
b3e0b41ee6
1 changed files with 271 additions and 273 deletions
|
@ -9,6 +9,7 @@ import gregtech.api.metatileentity.MetaTileEntity;
|
|||
import gregtech.api.objects.GT_ItemStack;
|
||||
import gregtech.api.objects.XSTR;
|
||||
import gregtech.api.util.GT_OreDictUnificator;
|
||||
import gregtech.api.util.GT_Recipe;
|
||||
import gregtech.api.util.GT_Utility;
|
||||
import gregtech.common.GT_Pollution;
|
||||
import gregtech.common.gui.GT_Container_BronzeBlastFurnace;
|
||||
|
@ -22,22 +23,29 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.ChunkPosition;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEntity {
|
||||
private static final int INPUT_SLOTS = 2, OUTPUT_SLOTS = 2;
|
||||
|
||||
public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace
|
||||
extends MetaTileEntity {
|
||||
public int mMaxProgresstime = 0;
|
||||
public int mUpdate = 5;
|
||||
public int mProgresstime = 0;
|
||||
public boolean mMachine = false;
|
||||
|
||||
public ItemStack[] mOutputItems = new ItemStack[OUTPUT_SLOTS];
|
||||
|
||||
@Deprecated
|
||||
public ItemStack mOutputItem1;
|
||||
@Deprecated
|
||||
public ItemStack mOutputItem2;
|
||||
|
||||
public GT_MetaTileEntity_PrimitiveBlastFurnace(int aID, String aName, String aNameRegional) {
|
||||
super(aID, aName, aNameRegional, 4);
|
||||
super(aID, aName, aNameRegional, INPUT_SLOTS + OUTPUT_SLOTS);
|
||||
}
|
||||
|
||||
public GT_MetaTileEntity_PrimitiveBlastFurnace(String aName) {
|
||||
super(aName, 4);
|
||||
super(aName, INPUT_SLOTS + OUTPUT_SLOTS);
|
||||
}
|
||||
|
||||
public boolean isSteampowered() {
|
||||
|
@ -104,15 +112,14 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace
|
|||
public void saveNBTData(NBTTagCompound aNBT) {
|
||||
aNBT.setInteger("mProgresstime", this.mProgresstime);
|
||||
aNBT.setInteger("mMaxProgresstime", this.mMaxProgresstime);
|
||||
if (this.mOutputItem1 != null) {
|
||||
if (this.mOutputItems != null) {
|
||||
for (int i = 0; i < mOutputItems.length; i++) {
|
||||
if (this.mOutputItems[i] != null) {
|
||||
NBTTagCompound tNBT = new NBTTagCompound();
|
||||
this.mOutputItem1.writeToNBT(tNBT);
|
||||
aNBT.setTag("mOutputItem1", tNBT);
|
||||
this.mOutputItems[i].writeToNBT(tNBT);
|
||||
aNBT.setTag("mOutputItem" + i, tNBT);
|
||||
}
|
||||
}
|
||||
if (this.mOutputItem2 != null) {
|
||||
NBTTagCompound tNBT = new NBTTagCompound();
|
||||
this.mOutputItem2.writeToNBT(tNBT);
|
||||
aNBT.setTag("mOutputItem2", tNBT);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -120,8 +127,10 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace
|
|||
this.mUpdate = 5;
|
||||
this.mProgresstime = aNBT.getInteger("mProgresstime");
|
||||
this.mMaxProgresstime = aNBT.getInteger("mMaxProgresstime");
|
||||
this.mOutputItem1 = GT_Utility.loadItem(aNBT, "mOutputItem1");
|
||||
this.mOutputItem2 = GT_Utility.loadItem(aNBT, "mOutputItem2");
|
||||
this.mOutputItems = new ItemStack[OUTPUT_SLOTS];
|
||||
for (int i = 0; i < OUTPUT_SLOTS; i++) {
|
||||
this.mOutputItems[i] = GT_Utility.loadItem(aNBT, "mOutputItem" + i);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
|
||||
|
@ -148,10 +157,13 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace
|
|||
for (int k = -1; k < 2; k++) {
|
||||
if ((xDir + i != 0) || (j != 0) || (zDir + k != 0)) {
|
||||
if ((i != 0) || (j == -1) || (k != 0)) {
|
||||
if (!isCorrectCasingBlock(getBaseMetaTileEntity().getBlockOffset(xDir + i, j, zDir + k)) || !isCorrectCasingMetaID(getBaseMetaTileEntity().getMetaIDOffset(xDir + i, j, zDir + k))) {
|
||||
if (!isCorrectCasingBlock(getBaseMetaTileEntity().getBlockOffset(xDir + i, j, zDir + k))
|
||||
|| !isCorrectCasingMetaID(getBaseMetaTileEntity().getMetaIDOffset(xDir + i, j, zDir + k))) {
|
||||
return false;
|
||||
}
|
||||
} else if ((!GT_Utility.arrayContains(getBaseMetaTileEntity().getBlockOffset(xDir + i, j, zDir + k), new Object[]{Blocks.lava, Blocks.flowing_lava, null})) && (!getBaseMetaTileEntity().getAirOffset(xDir + i, j, zDir + k))) {
|
||||
} else if ((!GT_Utility.arrayContains(getBaseMetaTileEntity().getBlockOffset(xDir + i, j, zDir + k),
|
||||
new Object[] { Blocks.lava, Blocks.flowing_lava, null }))
|
||||
&& (!getBaseMetaTileEntity().getAirOffset(xDir + i, j, zDir + k))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -170,9 +182,11 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace
|
|||
}
|
||||
|
||||
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
|
||||
if ((aBaseMetaTileEntity.isClientSide()) &&
|
||||
(aBaseMetaTileEntity.isActive())) {
|
||||
aBaseMetaTileEntity.getWorld().spawnParticle("largesmoke", aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1) + (new XSTR()).nextFloat(), aBaseMetaTileEntity.getOffsetY(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1) + (new XSTR()).nextFloat(), 0.0D, 0.3D, 0.0D);
|
||||
if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive())) {
|
||||
aBaseMetaTileEntity.getWorld().spawnParticle("largesmoke",
|
||||
aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1) + (new XSTR()).nextFloat(),
|
||||
aBaseMetaTileEntity.getOffsetY(aBaseMetaTileEntity.getBackFacing(), 1),
|
||||
aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1) + (new XSTR()).nextFloat(), 0.0D, 0.3D, 0.0D);
|
||||
}
|
||||
if (aBaseMetaTileEntity.isServerSide()) {
|
||||
if (this.mUpdate-- == 0) {
|
||||
|
@ -182,37 +196,54 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace
|
|||
if (this.mMaxProgresstime > 0) {
|
||||
if (++this.mProgresstime >= this.mMaxProgresstime) {
|
||||
addOutputProducts();
|
||||
this.mOutputItem1 = null;
|
||||
this.mOutputItem2 = null;
|
||||
this.mOutputItems = null;
|
||||
this.mProgresstime = 0;
|
||||
this.mMaxProgresstime = 0;
|
||||
GT_Mod.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "steel");
|
||||
GT_Mod.achievements.issueAchievement(
|
||||
aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "steel");
|
||||
}
|
||||
} else if (aBaseMetaTileEntity.isAllowedToWork()) {
|
||||
checkRecipe();
|
||||
}
|
||||
}
|
||||
if(this.mMaxProgresstime>0 && (aTimer % 20L == 0L)){
|
||||
GT_Pollution.addPollution(this.getBaseMetaTileEntity().getWorld(), new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 50);
|
||||
if (this.mMaxProgresstime > 0 && (aTimer % 20L == 0L)) {
|
||||
GT_Pollution.addPollution(this.getBaseMetaTileEntity().getWorld(),
|
||||
new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(),
|
||||
this.getBaseMetaTileEntity().getZCoord()),
|
||||
50);
|
||||
}
|
||||
|
||||
aBaseMetaTileEntity.setActive((this.mMaxProgresstime > 0) && (this.mMachine));
|
||||
if (aBaseMetaTileEntity.isActive()) {
|
||||
if (aBaseMetaTileEntity.getAir(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1))) {
|
||||
aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.lava, 1, 2);
|
||||
if (aBaseMetaTileEntity.getAir(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1),
|
||||
aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1))) {
|
||||
aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1),
|
||||
aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1),
|
||||
Blocks.lava, 1, 2);
|
||||
this.mUpdate = 1;
|
||||
}
|
||||
if (aBaseMetaTileEntity.getAir(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1))) {
|
||||
aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.lava, 1, 2);
|
||||
if (aBaseMetaTileEntity.getAir(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1),
|
||||
aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1))) {
|
||||
aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1),
|
||||
aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1),
|
||||
Blocks.lava, 1, 2);
|
||||
this.mUpdate = 1;
|
||||
}
|
||||
} else {
|
||||
if (aBaseMetaTileEntity.getBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)) == Blocks.lava) {
|
||||
aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.air, 0, 2);
|
||||
if (aBaseMetaTileEntity.getBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1),
|
||||
aBaseMetaTileEntity.getYCoord(),
|
||||
aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)) == Blocks.lava) {
|
||||
aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1),
|
||||
aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1),
|
||||
Blocks.air, 0, 2);
|
||||
this.mUpdate = 1;
|
||||
}
|
||||
if (aBaseMetaTileEntity.getBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)) == Blocks.lava) {
|
||||
aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.air, 0, 2);
|
||||
if (aBaseMetaTileEntity.getBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1),
|
||||
aBaseMetaTileEntity.getYCoord() + 1,
|
||||
aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)) == Blocks.lava) {
|
||||
aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1),
|
||||
aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1),
|
||||
Blocks.air, 0, 2);
|
||||
this.mUpdate = 1;
|
||||
}
|
||||
}
|
||||
|
@ -220,25 +251,28 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace
|
|||
}
|
||||
|
||||
private void addOutputProducts() {
|
||||
if (this.mOutputItem1 != null) {
|
||||
if (this.mInventory[2] == null) {
|
||||
this.mInventory[2] = GT_Utility.copy(new Object[]{this.mOutputItem1});
|
||||
} else if (GT_Utility.areStacksEqual(this.mInventory[2], this.mOutputItem1)) {
|
||||
this.mInventory[2].stackSize = Math.min(this.mOutputItem1.getMaxStackSize(), this.mOutputItem1.stackSize + this.mInventory[2].stackSize);
|
||||
if (this.mOutputItems == null) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (this.mOutputItem2 != null) {
|
||||
if (this.mInventory[3] == null) {
|
||||
this.mInventory[3] = GT_Utility.copy(new Object[]{this.mOutputItem2});
|
||||
} else if (GT_Utility.areStacksEqual(this.mInventory[3], this.mOutputItem2)) {
|
||||
this.mInventory[3].stackSize = Math.min(this.mOutputItem2.getMaxStackSize(), this.mOutputItem2.stackSize + this.mInventory[3].stackSize);
|
||||
int limit = Math.min(mOutputItems.length, OUTPUT_SLOTS);
|
||||
for (int i = 0; i < limit; i++) {
|
||||
int absi = INPUT_SLOTS + i;
|
||||
if (this.mInventory[absi] == null) {
|
||||
this.mInventory[absi] = GT_Utility.copy(this.mOutputItems[i]);
|
||||
} else if (GT_Utility.areStacksEqual(this.mInventory[absi], this.mOutputItems[i])) {
|
||||
this.mInventory[absi].stackSize = Math.min(this.mInventory[absi].getMaxStackSize(),
|
||||
this.mInventory[absi].stackSize + this.mOutputItems[i].stackSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean spaceForOutput(ItemStack aStack1, ItemStack aStack2) {
|
||||
if (((this.mInventory[2] == null) || (aStack1 == null) || ((this.mInventory[2].stackSize + aStack1.stackSize <= this.mInventory[2].getMaxStackSize()) && (GT_Utility.areStacksEqual(this.mInventory[2], aStack1)))) && (
|
||||
(this.mInventory[3] == null) || (aStack2 == null) || ((this.mInventory[3].stackSize + aStack2.stackSize <= this.mInventory[3].getMaxStackSize()) && (GT_Utility.areStacksEqual(this.mInventory[3], aStack2))))) {
|
||||
private boolean spaceForOutput(ItemStack outputStack, int relativeOutputSlot) {
|
||||
int absoluteSlot = relativeOutputSlot + INPUT_SLOTS;
|
||||
if (this.mInventory[absoluteSlot] == null || outputStack == null) {
|
||||
return true;
|
||||
}
|
||||
if (((this.mInventory[absoluteSlot].stackSize + outputStack.stackSize <= this.mInventory[absoluteSlot].getMaxStackSize())
|
||||
&& (GT_Utility.areStacksEqual(this.mInventory[absoluteSlot], outputStack)))) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -248,77 +282,41 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace
|
|||
if (!this.mMachine) {
|
||||
return false;
|
||||
}
|
||||
if ((this.mInventory[0] != null) && (this.mInventory[1] != null) && (this.mInventory[0].stackSize >= 1)) {
|
||||
if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "dustIron")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "ingotIron"))) {
|
||||
if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 4) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 4L)))) {
|
||||
getBaseMetaTileEntity().decrStackSize(0, 1);
|
||||
getBaseMetaTileEntity().decrStackSize(1, 4);
|
||||
this.mMaxProgresstime = 7200;
|
||||
return true;
|
||||
}
|
||||
if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")) && (this.mInventory[1].stackSize >= 2) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 4L)))) {
|
||||
getBaseMetaTileEntity().decrStackSize(0, 1);
|
||||
getBaseMetaTileEntity().decrStackSize(1, 2);
|
||||
this.mMaxProgresstime = 4800;
|
||||
return true;
|
||||
}
|
||||
if ((this.mInventory[0].stackSize >= 9) && ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))) && (this.mInventory[1].stackSize >= 4) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L)))) {
|
||||
getBaseMetaTileEntity().decrStackSize(0, 9);
|
||||
getBaseMetaTileEntity().decrStackSize(1, 4);
|
||||
this.mMaxProgresstime = 64800;
|
||||
return true;
|
||||
}
|
||||
} else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "dustSteel")) {
|
||||
if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 2) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 2L)))) {
|
||||
getBaseMetaTileEntity().decrStackSize(0, 1);
|
||||
getBaseMetaTileEntity().decrStackSize(1, 2);
|
||||
this.mMaxProgresstime = 3600;
|
||||
return true;
|
||||
}
|
||||
if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")) && (this.mInventory[1].stackSize >= 1) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 2L)))) {
|
||||
getBaseMetaTileEntity().decrStackSize(0, 1);
|
||||
getBaseMetaTileEntity().decrStackSize(1, 1);
|
||||
this.mMaxProgresstime = 2400;
|
||||
return true;
|
||||
}
|
||||
if ((this.mInventory[0].stackSize >= 9) && ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))) && (this.mInventory[1].stackSize >= 2) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 2L)))) {
|
||||
getBaseMetaTileEntity().decrStackSize(0, 9);
|
||||
getBaseMetaTileEntity().decrStackSize(1, 2);
|
||||
this.mMaxProgresstime = 32400;
|
||||
return true;
|
||||
}
|
||||
} else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "blockIron")) {
|
||||
if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 36) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L)))) {
|
||||
getBaseMetaTileEntity().decrStackSize(0, 1);
|
||||
getBaseMetaTileEntity().decrStackSize(1, 36);
|
||||
this.mMaxProgresstime = 64800;
|
||||
return true;
|
||||
}
|
||||
if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")) && (this.mInventory[1].stackSize >= 18) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Ash, 4L)))) {
|
||||
getBaseMetaTileEntity().decrStackSize(0, 1);
|
||||
getBaseMetaTileEntity().decrStackSize(1, 18);
|
||||
this.mMaxProgresstime = 43200;
|
||||
return true;
|
||||
}
|
||||
if (((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))) && (this.mInventory[1].stackSize >= 4) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L)))) {
|
||||
getBaseMetaTileEntity().decrStackSize(0, 1);
|
||||
getBaseMetaTileEntity().decrStackSize(1, 4);
|
||||
this.mMaxProgresstime = 64800;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.mOutputItem1 = null;
|
||||
this.mOutputItem2 = null;
|
||||
ItemStack[] inputs = new ItemStack[INPUT_SLOTS];
|
||||
System.arraycopy(mInventory, 0, inputs, 0, INPUT_SLOTS);
|
||||
GT_Recipe recipe = GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.findRecipe(getBaseMetaTileEntity(), false, 0, null, inputs);
|
||||
if (recipe == null) {
|
||||
this.mOutputItems = null;
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < OUTPUT_SLOTS; i++) {
|
||||
if (!spaceForOutput(recipe.getOutput(i), i)) {
|
||||
this.mOutputItems = null;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!recipe.isRecipeInputEqual(true, null, inputs)) {
|
||||
this.mOutputItems = null;
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < INPUT_SLOTS; i++) {
|
||||
if (mInventory[i] != null && mInventory[i].stackSize == 0) {
|
||||
mInventory[i] = null;
|
||||
}
|
||||
}
|
||||
|
||||
this.mMaxProgresstime = recipe.mDuration;
|
||||
this.mOutputItems = recipe.mOutputs;
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isGivingInformation() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
|
||||
return aIndex > 1;
|
||||
return aIndex > INPUT_SLOTS;
|
||||
}
|
||||
|
||||
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
|
||||
|
|
Loading…
Reference in a new issue