diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2016-05-23 08:03:30 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2016-05-23 08:03:30 +1000 |
commit | b1c08c2131c5c58e81ba9a6ae10e3738ae7025b4 (patch) | |
tree | 47315845db808283079231d3d86be32800de3fc1 /src/Java/miscutil/gregtech/common | |
parent | dce34f9ba22f173b7bf5d7c9669cf29120f14e3a (diff) | |
download | GT5-Unofficial-b1c08c2131c5c58e81ba9a6ae10e3738ae7025b4.tar.gz GT5-Unofficial-b1c08c2131c5c58e81ba9a6ae10e3738ae7025b4.tar.bz2 GT5-Unofficial-b1c08c2131c5c58e81ba9a6ae10e3738ae7025b4.zip |
Forgot to Commit before the weekend.. Not sure what I change, but making this as a rollback point/changelog.
Diffstat (limited to 'src/Java/miscutil/gregtech/common')
6 files changed, 260 insertions, 79 deletions
diff --git a/src/Java/miscutil/gregtech/common/GregtechRecipeAdder.java b/src/Java/miscutil/gregtech/common/GregtechRecipeAdder.java index 8a4e7a1833..ab6d0ad900 100644 --- a/src/Java/miscutil/gregtech/common/GregtechRecipeAdder.java +++ b/src/Java/miscutil/gregtech/common/GregtechRecipeAdder.java @@ -9,62 +9,89 @@ import net.minecraftforge.fluids.FluidStack; public class GregtechRecipeAdder implements IGregtech_RecipeAdder { - /*@Override - public boolean addCokeOvenRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - if (bInput1 == null || aOutput1 == null || bOutput1 == null || aDuration < 1 || aEUt < 1) { - return false; - } - GregtechRecipe.Gregtech_Recipe_Map.sCokeOvenRecipes.addRecipe(aOptimize, aInputs, aOutputs, aSpecial, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); - return true; - }*/ - - @Override - public boolean addCokeOvenRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt) { - Utils.LOG_INFO("=================================================================================="); - Utils.LOG_INFO("=================================================================================="); + @SuppressWarnings("static-method") + private void debug1(){ Utils.LOG_INFO("=================================================================================="); Utils.LOG_INFO("=================================================================================="); Utils.LOG_INFO("=================================================================================="); Utils.LOG_INFO("Walking Through CokeOven Recipe Creation."); Utils.LOG_INFO("My name is Ralph and I will be your humble host."); - if (((aInput1 == null) /*&& (aFluidInput == null)*/) || ((aOutput == null) && (aFluidOutput == null))) { - Utils.LOG_INFO("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); - Utils.LOG_INFO("Something was null, returning false"); - return false; - } + } + @SuppressWarnings("static-method") + private void debug2(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt){ Utils.LOG_INFO("=================================================================================="); Utils.LOG_INFO("Taking a step forward."); Utils.LOG_INFO("aInput1 == null && aFluidInput == null || aOutput == null && aFluidOutput == null"); Utils.LOG_INFO("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); Utils.LOG_INFO("Passed."); - if ((aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("cokeoven", aOutput, aDuration)) <= 0)) { - Utils.LOG_INFO("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); - Utils.LOG_INFO("Something was null, returning false"); - return false; - } + } + @SuppressWarnings("static-method") + private void debug3(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt){ Utils.LOG_INFO("=================================================================================="); Utils.LOG_INFO("Taking a step forward."); Utils.LOG_INFO("(aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aOutput, aDuration)) <= 0)"); Utils.LOG_INFO("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); Utils.LOG_INFO("Passed."); - if ((aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("cokeoven", aFluidOutput.getFluid().getName(), aDuration)) <= 0)) { - Utils.LOG_INFO("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); - Utils.LOG_INFO("Something was null, returning false"); - return false; - } + } + @SuppressWarnings("static-method") + private void debug4(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt){ Utils.LOG_INFO("=================================================================================="); Utils.LOG_INFO("Taking a step forward."); Utils.LOG_INFO("(aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aFluidOutput.getFluid().getName(), aDuration)) <= 0)"); Utils.LOG_INFO("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); Utils.LOG_INFO("Passed."); Utils.LOG_INFO("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); - GregtechRecipe.Gregtech_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0); - Utils.LOG_INFO("Successfully added a Coke Oven recipe for: "+aOutput.getDisplayName()+" & "+aFluidOutput.getFluid().getName()+", Using "+aInput1.getDisplayName()+", "+aInput2.getDisplayName()+", "+aFluidInput.getFluid().getName()); - Utils.LOG_INFO("=================================================================================="); - Utils.LOG_INFO("=================================================================================="); + + } + @SuppressWarnings("static-method") + private void debug5(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt){ + Utils.LOG_INFO("Successfully added a Coke Oven recipe for: "+aOutput.getDisplayName()+" & "+aFluidOutput.getFluid().getName()+", Using "+aInput1.getDisplayName()+" & "+aInput2.getDisplayName()+" & liquid "+aFluidInput.getFluid().getName()+". This took "+(aDuration/20)+" seconds for "+aEUt+"eu/t."); Utils.LOG_INFO("=================================================================================="); Utils.LOG_INFO("=================================================================================="); Utils.LOG_INFO("=================================================================================="); - return true; + } + + @Override + public boolean addCokeOvenRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt) { + try { + + debug1(); + if (((aInput1 == null) /*&& (aFluidInput == null)*/) || ((aOutput == null) && (aFluidOutput == null))) { + Utils.LOG_INFO("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); + Utils.LOG_INFO("Something was null, returning false"); + return false; + } + + + debug2(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aDuration, aEUt); + if ((aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("cokeoven", aOutput, aDuration)) <= 0)) { + Utils.LOG_INFO("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); + Utils.LOG_INFO("Something was null, returning false"); + return false; + } + + + debug3(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aDuration, aEUt); + if ((aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("cokeoven", aFluidOutput.getFluid().getName(), aDuration)) <= 0)) { + Utils.LOG_INFO("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); + Utils.LOG_INFO("Something was null, returning false"); + return false; + } + + debug4(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aDuration, aEUt); + if (aFluidInput == null){ + GregtechRecipe.Gregtech_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput}, null, null, null, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0); + } + else { + GregtechRecipe.Gregtech_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0); + } + debug5(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aDuration, aEUt); + + return true; + } catch (NullPointerException e){ + Utils.LOG_INFO("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); + Utils.LOG_INFO("Failed."); + return false; + } } } diff --git a/src/Java/miscutil/gregtech/common/blocks/GregtechMetaCasingBlocks.java b/src/Java/miscutil/gregtech/common/blocks/GregtechMetaCasingBlocks.java index e2246504f1..8af461f1e0 100644 --- a/src/Java/miscutil/gregtech/common/blocks/GregtechMetaCasingBlocks.java +++ b/src/Java/miscutil/gregtech/common/blocks/GregtechMetaCasingBlocks.java @@ -23,9 +23,9 @@ extends GregtechMetaCasingBlocksAbstract { Textures.BlockIcons.CASING_BLOCKS[i] = new GT_CopiedBlockTexture(this, 6, i); } GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Centrifuge Casing"); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Centrifuge Top Blocks"); - //GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "MV Machine Casing"); - //GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "HV Machine Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Structural Coke Oven Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Heat Resistant Coke Oven Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "Heat Proof Coke Oven Casing"); //GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "EV Machine Casing"); //GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "IV Machine Casing"); //GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "LuV Machine Casing"); @@ -39,10 +39,10 @@ extends GregtechMetaCasingBlocksAbstract { //GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "Nichrome Coil Block"); //GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".15.name", "Superconducting Coil Block"); GregtechItemList.Casing_Centrifuge1.set(new ItemStack(this, 1, 0)); - GregtechItemList.Casing_Centrifuge2.set(new ItemStack(this, 1, 1)); - /*ItemList.Casing_MV.set(new ItemStack(this, 1, 2)); - ItemList.Casing_HV.set(new ItemStack(this, 1, 3)); - ItemList.Casing_EV.set(new ItemStack(this, 1, 4)); + GregtechItemList.Casing_CokeOven.set(new ItemStack(this, 1, 1)); + GregtechItemList.Casing_CokeOven_Coil1.set(new ItemStack(this, 1, 2)); + GregtechItemList.Casing_CokeOven_Coil2.set(new ItemStack(this, 1, 3)); + /*ItemList.Casing_EV.set(new ItemStack(this, 1, 4)); ItemList.Casing_IV.set(new ItemStack(this, 1, 5)); ItemList.Casing_LuV.set(new ItemStack(this, 1, 6)); ItemList.Casing_ZPM.set(new ItemStack(this, 1, 7)); @@ -60,10 +60,14 @@ extends GregtechMetaCasingBlocksAbstract { public IIcon getIcon(int aSide, int aMeta) { if ((aMeta >= 0) && (aMeta < 16)) { switch (aMeta) { - case 0: + case 0: //Centrifuge return Textures.BlockIcons.MACHINE_CASING_TURBINE.getIcon(); - case 1: - return Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon(); + case 1: //Coke Oven Frame + return Textures.BlockIcons.MACHINE_CASING_GEARBOX_STEEL.getIcon(); + case 2: //Coke Oven Casing Tier 1 + return Textures.BlockIcons.MACHINE_CASING_FIREBOX_BRONZE.getIcon(); + case 3: //Coke Oven Casing Tier 2 + return Textures.BlockIcons.MACHINE_CASING_FIREBOX_STEEL.getIcon(); case 10: return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); case 12: diff --git a/src/Java/miscutil/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java b/src/Java/miscutil/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java index d4ac2a03c3..4080db753a 100644 --- a/src/Java/miscutil/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java +++ b/src/Java/miscutil/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java @@ -1,8 +1,8 @@ package miscutil.gregtech.common.blocks; import gregtech.api.GregTech_API; +import gregtech.api.items.GT_Generic_Block; import gregtech.api.util.GT_LanguageManager; -import gregtech.common.blocks.GT_Block_Casings_Abstract; import java.util.Random; @@ -22,7 +22,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public abstract class GregtechMetaCasingBlocksAbstract - extends GT_Block_Casings_Abstract { + extends GT_Generic_Block { public GregtechMetaCasingBlocksAbstract(Class<? extends ItemBlock> aItemClass, String aName, Material aMaterial) { super(aItemClass, aName, aMaterial); setStepSound(soundTypeMetal); diff --git a/src/Java/miscutil/gregtech/common/blocks/GregtechMetaItemCasings1.java b/src/Java/miscutil/gregtech/common/blocks/GregtechMetaItemCasings1.java new file mode 100644 index 0000000000..41c5552de2 --- /dev/null +++ b/src/Java/miscutil/gregtech/common/blocks/GregtechMetaItemCasings1.java @@ -0,0 +1,33 @@ +package miscutil.gregtech.common.blocks; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public class GregtechMetaItemCasings1 +extends GregtechMetaItemCasingsAbstract { + public GregtechMetaItemCasings1(Block par1) { + super(par1); + } + + @Override + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { + super.addInformation(aStack, aPlayer, aList, aF3_H); + switch (getDamage(aStack)) { + case 0: + aList.add(this.mCasing_Centrifuge); + break; + case 1: + aList.add(this.mCasing_CokeOven); + break; + case 2: + aList.add(this.mCasing_CokeCoil1); + break; + case 3: + aList.add(this.mCasing_CokeCoil2); + break; + } + } +} diff --git a/src/Java/miscutil/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java b/src/Java/miscutil/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java new file mode 100644 index 0000000000..b43fa35190 --- /dev/null +++ b/src/Java/miscutil/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java @@ -0,0 +1,45 @@ +package miscutil.gregtech.common.blocks; + +import gregtech.api.util.GT_LanguageManager; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +public abstract class GregtechMetaItemCasingsAbstract + extends ItemBlock { + + protected final String mCasing_Centrifuge = GT_LanguageManager.addStringLocalization("mu.centrifugecasing", "Warning! Standing in the Centrifuge not recommended"); + protected final String mCasing_CokeOven = GT_LanguageManager.addStringLocalization("mu.cokeoven", "Sturdy and Strong"); + protected final String mCasing_CokeCoil1 = GT_LanguageManager.addStringLocalization("mu.coil01tooltip", "Base Heating Capacity = 1350 Kelvin"); + protected final String mCasing_CokeCoil2 = GT_LanguageManager.addStringLocalization("mu.coil02tooltip", "Base Heating Capacity = 2275 Kelvin"); + protected final String mNoMobsToolTip = GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); + protected final String mNoTileEntityToolTip = GT_LanguageManager.addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); + + public GregtechMetaItemCasingsAbstract(Block par1) { + super(par1); + setMaxDamage(0); + setHasSubtypes(true); + //setCreativeTab(AddToCreativeTab.tabMachines); + } + + @Override + public int getMetadata(int aMeta) { + return aMeta; + } + + @Override + public String getUnlocalizedName(ItemStack aStack) { + return this.field_150939_a.getUnlocalizedName() + "." + getDamage(aStack); + } + + @Override + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { + super.addInformation(aStack, aPlayer, aList, aF3_H); + aList.add(this.mNoMobsToolTip); + aList.add(this.mNoTileEntityToolTip); + } +} diff --git a/src/Java/miscutil/gregtech/common/machines/multi/GregtechMetaTileEntityIndustrialCokeOven.java b/src/Java/miscutil/gregtech/common/machines/multi/GregtechMetaTileEntityIndustrialCokeOven.java index 80c10f7e6e..6a00a34069 100644 --- a/src/Java/miscutil/gregtech/common/machines/multi/GregtechMetaTileEntityIndustrialCokeOven.java +++ b/src/Java/miscutil/gregtech/common/machines/multi/GregtechMetaTileEntityIndustrialCokeOven.java @@ -1,6 +1,5 @@ package miscutil.gregtech.common.machines.multi; -import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.ITexture; @@ -8,16 +7,18 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import java.util.ArrayList; +import java.util.Arrays; +import miscutil.core.block.ModBlocks; import miscutil.gregtech.api.util.GregtechRecipe; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; public class GregtechMetaTileEntityIndustrialCokeOven extends GT_MetaTileEntity_MultiBlockBase { @@ -31,11 +32,13 @@ public class GregtechMetaTileEntityIndustrialCokeOven super(aName); } - public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GregtechMetaTileEntityIndustrialCokeOven(this.mName); } - public String[] getDescription() { + @Override + public String[] getDescription() { return new String[]{"Smelts up to 6-18 Items at once", "Controller Block for the Multi Smelter", "Size: 3x3x3 (Hollow)", @@ -49,36 +52,102 @@ public class GregtechMetaTileEntityIndustrialCokeOven "Heat Proof Machine Casings for the rest"}; } - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[11], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER)}; + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[47], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER)}; } - return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[11]}; + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[47]}; } - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MultiFurnace.png"); } - public GT_Recipe.GT_Recipe_Map getRecipeMap() { + @Override + public GT_Recipe.GT_Recipe_Map getRecipeMap() { return GregtechRecipe.Gregtech_Recipe_Map.sCokeOvenRecipes; + } - public boolean isCorrectMachinePart(ItemStack aStack) { + @Override + public boolean isCorrectMachinePart(ItemStack aStack) { return true; } - public boolean isFacingValid(byte aFacing) { + @Override + public boolean isFacingValid(byte aFacing) { return aFacing > 1; } + @Override public boolean checkRecipe(ItemStack aStack) { ArrayList<ItemStack> tInputList = getStoredInputs(); + for (int i = 0; i < tInputList.size() - 1; i++) { + for (int j = i + 1; j < tInputList.size(); j++) { + if (GT_Utility.areStacksEqual((ItemStack) tInputList.get(i), (ItemStack) tInputList.get(j))) { + if (((ItemStack) tInputList.get(i)).stackSize >= ((ItemStack) tInputList.get(j)).stackSize) { + tInputList.remove(j--); + } else { + tInputList.remove(i--); + break; + } + } + } + } + ItemStack[] tInputs = (ItemStack[]) Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2); + + ArrayList<FluidStack> tFluidList = getStoredFluids(); + for (int i = 0; i < tFluidList.size() - 1; i++) { + for (int j = i + 1; j < tFluidList.size(); j++) { + if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) { + if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) { + tFluidList.remove(j--); + } else { + tFluidList.remove(i--); + break; + } + } + } + } + FluidStack[] tFluids = (FluidStack[]) Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1); + if (tInputList.size() > 0) { + long tVoltage = getMaxInputVoltage(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); + if ((tRecipe != null) && (this.mLevel >= tRecipe.mSpecialValue) && (tRecipe.isRecipeInputEqual(true, tFluids, tInputs))) { + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + if (tRecipe.mEUt <= 16) { + this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1)); + this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1)); + } else { + this.mEUt = tRecipe.mEUt; + this.mMaxProgresstime = tRecipe.mDuration; + while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) { + this.mEUt *= 4; + this.mMaxProgresstime /= 2; + } + } + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0), tRecipe.getOutput(1)}; + updateSlots(); + return true; + } + } + return false; + } + /*public boolean checkRecipe(ItemStack aStack) { + ArrayList<ItemStack> tInputList = getStoredInputs(); if (!tInputList.isEmpty()) { byte tTier = (byte) Math.max(1, GT_Utility.getTier(getMaxInputVoltage())); int j = 0; - this.mOutputItems = new ItemStack[6 * this.mLevel]; + this.mOutputItems = new ItemStack[12 * this.mLevel]; for (int i = 0; (i < 100) && (j < this.mOutputItems.length); i++) { if (null != (this.mOutputItems[j] = GT_ModHandler.getSmeltingOutput((ItemStack) tInputList.get(i % tInputList.size()), true, null))) { j++; @@ -95,45 +164,43 @@ public class GregtechMetaTileEntityIndustrialCokeOven return true; } return false; - } + }*/ - public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; - + //this.mOutputItems = new ItemStack[12 * this.mLevel]; this.mLevel = 0; if (!aBaseMetaTileEntity.getAirOffset(xDir, 1, zDir)) { return false; } - addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 2, zDir), 11); + addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 2, zDir), 1); byte tUsedMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, 1, zDir); switch (tUsedMeta) { - case 12: + case 2: this.mLevel = 1; break; - case 13: + case 3: this.mLevel = 2; break; - case 14: - this.mLevel = 3; - break; default: return false; } for (int i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { if ((i != 0) || (j != 0)) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j) != GregTech_API.sBlockCasings1) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j) != ModBlocks.blockCasingsMisc) { return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j) != tUsedMeta) { return false; } - if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j) != GregTech_API.sBlockCasings1) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j) != ModBlocks.blockCasingsMisc) { return false; } - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j) != 11) { + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j) != 1) { return false; } } @@ -143,11 +210,11 @@ public class GregtechMetaTileEntityIndustrialCokeOven for (int j = -1; j < 2; j++) { if ((xDir + i != 0) || (zDir + j != 0)) { IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j); - if ((!addMaintenanceToMachineList(tTileEntity, 11)) && (!addInputToMachineList(tTileEntity, 11)) && (!addOutputToMachineList(tTileEntity, 11)) && (!addEnergyInputToMachineList(tTileEntity, 11))) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != GregTech_API.sBlockCasings1) { + if ((!addMaintenanceToMachineList(tTileEntity, 1)) && (!addInputToMachineList(tTileEntity, 1)) && (!addOutputToMachineList(tTileEntity, 1)) && (!addEnergyInputToMachineList(tTileEntity, 1))) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != ModBlocks.blockCasingsMisc) { return false; } - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != 11) { + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != 1) { return false; } } @@ -157,23 +224,28 @@ public class GregtechMetaTileEntityIndustrialCokeOven return true; } - public int getMaxEfficiency(ItemStack aStack) { + @Override + public int getMaxEfficiency(ItemStack aStack) { return 10000; } - public int getPollutionPerTick(ItemStack aStack) { - return 20; + @Override + public int getPollutionPerTick(ItemStack aStack) { + return 0; } - public int getDamageToComponent(ItemStack aStack) { + @Override + public int getDamageToComponent(ItemStack aStack) { return 0; } - public int getAmountOfOutputs() { - return 18; + @Override + public int getAmountOfOutputs() { + return 24; } - public boolean explodesOnComponentBreak(ItemStack aStack) { + @Override + public boolean explodesOnComponentBreak(ItemStack aStack) { return false; } } |