diff options
8 files changed, 690 insertions, 21 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index e0384239ba..56d15fa479 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -35,21 +35,33 @@ import com.github.bartimaeusnek.bartworks.common.loaders.BioLabLoader; import com.github.bartimaeusnek.bartworks.common.loaders.GTNHBlocks; import com.github.bartimaeusnek.bartworks.common.loaders.LoaderRegistry; import com.github.bartimaeusnek.bartworks.common.net.BW_Network; +import com.github.bartimaeusnek.bartworks.util.BW_Util; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.event.FMLServerStartedEvent; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; +import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.SubTag; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import java.util.HashSet; + +import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap; + @Mod( modid = MainMod.MOD_ID, name = MainMod.NAME, version = MainMod.VERSION, dependencies = "required-after:IC2; " @@ -110,4 +122,29 @@ public final class MainMod { new GTNHBlocks().run(); BioObjectAdder.regenerateBioFluids(); } + + @Mod.EventHandler + public void onServerStarted(FMLServerStartedEvent event){ + eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String)null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 1, 0, 1, "", 1, "", true, true); + for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList){ + if (recipe == null || recipe.mInputs == null) + continue; + ItemStack input = recipe.mInputs[0]; + int i = 0; + while(checkForExplosives(input)){ + try { + i++; + input = recipe.mInputs[i]; + }catch (ArrayIndexOutOfBoundsException e){ + LOGGER.error("CAUGHT DEFECTIVE IMPLOSION COMPRESSOR RECIPE."); + e.printStackTrace(); + } + } + eicMap.addRecipe(true,new ItemStack[]{input}, recipe.mOutputs,null,null,null,recipe.mDuration, BW_Util.getMachineVoltageFromTier(10),0); + } + } + + private boolean checkForExplosives(ItemStack input){ + return (GT_Utility.areStacksEqual(input,new ItemStack(Blocks.tnt)) || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("industrialTnt", 1L)) || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("dynamite", 1L))|| GT_Utility.areStacksEqual(input, ItemList.Block_Powderbarrel.get(1L))); + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index bdfe5c9850..c945a19d14 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -31,6 +31,7 @@ import com.github.bartimaeusnek.bartworks.common.items.*; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_RotorBlock; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_HeatedWaterPump; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_DEHP; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaBlastFurnace; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaVacuumFreezer; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_AcidGenerator; @@ -161,7 +162,7 @@ public class ItemRegistry { dehp = new GT_TileEntity_DEHP(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 1, 1, "DEHP", "Deep Earth Heating Pump").getStackForm(1L); megaMachines[0] = new GT_TileEntity_MegaBlastFurnace(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 2, "MegaBlastFurnace", StatCollector.translateToLocal("tile.bw.mbf.name")).getStackForm(1L); megaMachines[1] = new GT_TileEntity_MegaVacuumFreezer(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 3, "MegaVacuumFreezer", StatCollector.translateToLocal("tile.bw.mvf.name")).getStackForm(1L); - + new GT_TileEntity_ElectricImplosionCompressor( ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 4,"Electric Implosion Compressor","Electric Implosion Compressor"); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 972eacef2d..fe2af47746 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -24,6 +24,7 @@ package com.github.bartimaeusnek.bartworks.common.loaders; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_LESU; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ManualTrafo; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_Windmill; @@ -56,16 +57,16 @@ public class RecipeLoader implements Runnable { * GTNH "hardmode" Recipes */ - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(Blocks.lapis_block), Materials.Iron.getMolten(1296L), new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), 100, (int) (GT_Values.V[3] - (GT_Values.V[3] / 10))); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), Materials.Lapis.getPlates(9), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 2L), GT_Utility.getIntegratedCircuit(17)}, FluidRegistry.getFluidStack("ic2coolant", 1000), new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), 100, (int) (GT_Values.V[3] - (GT_Values.V[3] / 10))); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), Materials.Lapis.getBlocks(8), GT_Utility.getIntegratedCircuit(17)}, GT_Values.NF, new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100, (int) (GT_Values.V[3] - (GT_Values.V[3] / 10))); + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(Blocks.lapis_block), Materials.Iron.getMolten(1296L), new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), 100, BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), Materials.Lapis.getPlates(9), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 2L), GT_Utility.getIntegratedCircuit(17)}, FluidRegistry.getFluidStack("ic2coolant", 1000), new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), 100, BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), Materials.Lapis.getBlocks(8), GT_Utility.getIntegratedCircuit(17)}, GT_Values.NF, new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100, BW_Util.getMachineVoltageFromTier(3)); } else { /* * Vanilla Recipes */ - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{Materials.Lapis.getBlocks(8), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Basic, 1L), GT_Utility.getIntegratedCircuit(17)}, GT_Values.NF, new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100, (int) (GT_Values.V[1] - (GT_Values.V[1] / 10))); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{Materials.Lapis.getBlocks(8), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Basic, 1L), GT_Utility.getIntegratedCircuit(17)}, GT_Values.NF, new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100, BW_Util.getMachineVoltageFromTier(1)); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.BW_BLOCKS[1]), @@ -78,9 +79,9 @@ public class RecipeLoader implements Runnable { 'C', "circuitBasic" }); - GT_Values.RA.addCutterRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[1]), new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 1), GT_Values.NI, 100, (int) (GT_Values.V[1] - (GT_Values.V[1] / 10))); - GT_Values.RA.addCompressorRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 1), new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100, (int) (GT_Values.V[1] - (GT_Values.V[1] / 10))); - GT_Values.RA.addCompressorRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 0), new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100, (int) (GT_Values.V[1] - (GT_Values.V[1] / 10))); + GT_Values.RA.addCutterRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[1]), new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 1), GT_Values.NI, 100, BW_Util.getMachineVoltageFromTier(1)); + GT_Values.RA.addCompressorRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 1), new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100, BW_Util.getMachineVoltageFromTier(1)); + GT_Values.RA.addCompressorRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 0), new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100, BW_Util.getMachineVoltageFromTier(1)); GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), RecipeLoader.BITSD, new Object[]{new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1)}); GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), RecipeLoader.BITSD, new Object[]{new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0)}); } @@ -462,7 +463,7 @@ public class RecipeLoader implements Runnable { Materials.Plastic.getMolten(1152L), new ItemStack(ItemRegistry.BW_BLOCKS[2], 1, 1), 20, - (int) (GT_Values.V[3] - (GT_Values.V[3] / 10)) + BW_Util.getMachineVoltageFromTier(3) ); GT_ModHandler.addCraftingRecipe( @@ -479,7 +480,7 @@ public class RecipeLoader implements Runnable { } ); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Good, 1L), Materials.Aluminium.getPlates(1), ItemList.Circuit_Board_Plastic.get(1L), ItemList.Battery_RE_LV_Lithium.get(1L)}, Materials.SolderingAlloy.getMolten(288L), new ItemStack(ItemRegistry.CIRCUIT_PROGRAMMER), 600, (int) (GT_Values.V[2] - (GT_Values.V[2] / 10))); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Good, 1L), Materials.Aluminium.getPlates(1), ItemList.Circuit_Board_Plastic.get(1L), ItemList.Battery_RE_LV_Lithium.get(1L)}, Materials.SolderingAlloy.getMolten(288L), new ItemStack(ItemRegistry.CIRCUIT_PROGRAMMER), 600, BW_Util.getMachineVoltageFromTier(2)); GT_ModHandler.addCraftingRecipe( new GT_TileEntity_Windmill(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 2, "bw.windmill", StatCollector.translateToLocal("tile.bw.windmill.name")).getStackForm(1L), @@ -614,6 +615,63 @@ public class RecipeLoader implements Runnable { 'W', "logWood", } ); + + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[]{ + "WEs", + "WZh", + "WDf", + 'Z', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), + 'E', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), + 'D', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), + 'W', "logWood", + } + ); + + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[]{ + "WEs", + "WZh", + "WDf", + 'D', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), + 'Z', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), + 'E', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), + 'W', "logWood", + } + ); + + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[]{ + "WEs", + "WZh", + "WDf", + 'E', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), + 'D', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), + 'Z', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), + 'W', "logWood", + } + ); + + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[]{ + "WEs", + "WZh", + "WDf", + 'Z', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), + 'D', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), + 'E', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), + 'W', "logWood", + } + ); + GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.LEATHER_ROTOR), GT_ModHandler.RecipeBits.NOT_REMOVABLE, @@ -672,8 +730,6 @@ public class RecipeLoader implements Runnable { ); } - - - } + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java new file mode 100644 index 0000000000..d0a242b23f --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.multis; + +import com.github.bartimaeusnek.bartworks.util.BWRecipes; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DistillationTower; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +import java.util.ArrayList; + +public class GT_TileEntity_CrackingDistillTower extends GT_MetaTileEntity_DistillationTower { + + public GT_TileEntity_CrackingDistillTower(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_TileEntity_CrackingDistillTower(String aName) { + super(aName); + } + + @Override + public boolean checkRecipe(ItemStack itemStack) { + if (!GT_Utility.areStacksEqual(itemStack, GT_Utility.getIntegratedCircuit(0),true)) + return false; + else{ + FluidStack[] array = new FluidStack[0]; + ArrayList<FluidStack> fluidInputs = new ArrayList<FluidStack>(); + for (GT_MetaTileEntity_Hatch_Input hatch : this.mInputHatches){ + if (hatch != null){ + fluidInputs.add(hatch.getFluid()); + } + } + array = fluidInputs.toArray(array); + GT_Recipe.GT_Recipe_Map rMapCracking = GT_Recipe.GT_Recipe_Map.sCrakingRecipes; + GT_Recipe.GT_Recipe_Map rMapDistillTower = GT_Recipe.GT_Recipe_Map.sDistillationRecipes; + GT_Recipe recipeCracking = rMapCracking.findRecipe(this.getBaseMetaTileEntity(),false,this.getMaxInputVoltage(),array,itemStack); + if (recipeCracking == null) + return false; + GT_Recipe recipeDistill = rMapDistillTower.findRecipe(this.getBaseMetaTileEntity(),false,this.getMaxInputVoltage(),recipeCracking.mFluidOutputs); + if (recipeDistill == null) + return false; + float ratio = (float)recipeCracking.mFluidOutputs[0].amount/(float)recipeDistill.mFluidInputs[0].amount; + FluidStack[] nuoutputs = new FluidStack[recipeDistill.mFluidOutputs.length]; + for (int i = 0; i < nuoutputs.length; i++) { + nuoutputs[i]=recipeDistill.mFluidOutputs[i]; + nuoutputs[i].amount=(int)(Math.floor(recipeDistill.mFluidOutputs[i].amount*ratio)); + } + BWRecipes.DynamicGTRecipe combined = new BWRecipes.DynamicGTRecipe(true,null,recipeDistill.mOutputs,null,recipeDistill.mChances,recipeCracking.mFluidInputs,nuoutputs,(int)(Math.floor(recipeDistill.mDuration*ratio))+recipeCracking.mDuration,Math.max((int)(Math.floor(recipeDistill.mEUt*ratio)),recipeCracking.mEUt),0); + if (combined.isRecipeInputEqual(true, array)){ + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + BW_Util.calculateOverclockedNessMulti(combined.mEUt, combined.mDuration, 1, this.getMaxInputVoltage(), this); + if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + this.mOutputFluids=combined.mFluidOutputs.clone(); + this.mOutputItems=combined.mOutputs.clone(); + this.updateSlots(); + return true; + } + } + return false; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java new file mode 100644 index 0000000000..2c326887ed --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -0,0 +1,263 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.multis; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.common.GT_Pollution; +import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ImplosionCompressor; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; + +import java.util.ArrayList; +import java.util.Iterator; + +import static com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry.BW_BLOCKS; + +public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity_ImplosionCompressor { + + private boolean piston; + + public GT_TileEntity_ElectricImplosionCompressor(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_TileEntity_ElectricImplosionCompressor(String aName) { + super(aName); + } + + public static GT_Recipe.GT_Recipe_Map eicMap; + + @Override + public boolean checkRecipe(ItemStack aStack) { + + if (this.mEnergyHatches.get(0).getEUVar() <= 0 || this.mEnergyHatches.get(1).getEUVar() <= 0 ) + return false; + + ArrayList<ItemStack> tInputList = this.getStoredInputs(); + int tInputList_sS = tInputList.size(); + + for(int i = 0; i < tInputList_sS - 1; ++i) { + for(int j = i + 1; j < tInputList_sS; ++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(i--); + tInputList_sS = tInputList.size(); + break; + } + + tInputList.remove(j--); + tInputList_sS = tInputList.size(); + } + } + } + + ItemStack[] tInputs = (ItemStack[])tInputList.toArray(new ItemStack[tInputList.size()]); + if (tInputList.size() > 0) { + GT_Recipe tRecipe = eicMap.findRecipe(this.getBaseMetaTileEntity(), false, 9223372036854775807L, (FluidStack[])null, tInputs); + if (tRecipe != null && tRecipe.isRecipeInputEqual(true, (FluidStack[])null, tInputs)) { + this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000; + this.mEfficiencyIncrease = 10000; + this.mEUt = -tRecipe.mEUt; + this.mMaxProgresstime = Math.max(1, tRecipe.mDuration); + this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0), tRecipe.getOutput(1)}; + this.sendLoopStart((byte)20); + this.updateSlots(); + return true; + } + } + + return false; + } + + @Override + public boolean onRunningTick(ItemStack aStack) { + if (this.mRuntime % 10 == 0) + togglePiston(); + return super.onRunningTick(aStack); + } + + public void stopMachine(){ + resetPiston(); + super.stopMachine(); + } + + @Override + public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { + piston = true; + } + + private void resetPiston(){ + if (this.getBaseMetaTileEntity().getWorld().isRemote) + return; + if (!piston){ + int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX; + int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ; + int aX = this.getBaseMetaTileEntity().getXCoord(),aY = this.getBaseMetaTileEntity().getYCoord() ,aZ = this.getBaseMetaTileEntity().getZCoord(); + for (int x = -1; x <= 1; x++) { + for (int z = -1; z <= 1; z++) { + if (!(Math.abs(x) == 1 && Math.abs(z) == 1)) + this.getBaseMetaTileEntity().getWorld().setBlock(xDir + aX + x, aY + 2, zDir + aZ + z, GregTech_API.sBlockMetal5, 2, 3); + } + } + GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); + piston = !piston; + } + } + private void togglePiston() { + if (this.getBaseMetaTileEntity().getWorld().isRemote) + return; + int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX; + int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ; + int aX = this.getBaseMetaTileEntity().getXCoord(),aY = this.getBaseMetaTileEntity().getYCoord() ,aZ = this.getBaseMetaTileEntity().getZCoord(); + boolean hax = false; + if(piston){ + for (int x = -1; x <= 1; x++) { + for (int z = -1; z <= 1; z++) { + if (!(Math.abs(x) == 1 && Math.abs(z) == 1)) { + if (this.getBaseMetaTileEntity().getBlock(xDir+aX+x,aY+2,zDir+aZ+z) != GregTech_API.sBlockMetal5 && this.getBaseMetaTileEntity().getMetaID(xDir+aX+x,aY+2,zDir+aZ+z) != 2 ) { + hax = true; + } + this.getBaseMetaTileEntity().getWorld().setBlockToAir(xDir + aX + x, aY + 2, zDir + aZ + z); + } + } + } + GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); + piston=!piston; + } else { + for (int x = -1; x <= 1; x++) { + for (int z = -1; z <= 1; z++) { + if (!(Math.abs(x) == 1 && Math.abs(z) == 1)) + this.getBaseMetaTileEntity().getWorld().setBlock(xDir+aX+x,aY+2,zDir+aZ+z,GregTech_API.sBlockMetal5,2,3); + } + } + GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); + piston = !piston; + } + if (hax) + this.explodeMultiblock(); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setBoolean("piston",piston); + super.saveNBTData(aNBT); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + piston=aNBT.getBoolean("piston"); + super.loadNBTData(aNBT); + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; + + for (int x = -1; x <= 1; x++) { + for (int y = -2; y < 7; y++) { + for (int z = -1; z <= 1; z++) { + IGregTechTileEntity te = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir+x,y,z+zDir); + if (y == -2 || y == 6) { + if (!(x == 0 && z == 0)) { + if (!this.addMaintenanceToMachineList(te, 16) && !this.addMufflerToMachineList(te, 16) && !this.addInputToMachineList(te, 16) && !this.addOutputToMachineList(te, 16)) { + Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z); + byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z); + if ((tBlock != GregTech_API.sBlockCasings2 || tMeta != 0) && (tBlock != GregTech_API.sBlockCasings3 || tMeta != 4)) { + return false; + } + } + } + else if (x == 0 && z == 0) { + if (y == -2) + if (!this.addEnergyInputToMachineList(te, 16)) + return false; + if (y == 6) + if (!this.addEnergyInputToMachineList(te, 16)) + return false; + } + } + else if ((y > -2 && y < 1) || (y > 3 && y < 6)){ + if (y == 0 && xDir+x == 0 && zDir+z==0) + continue; + Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z); + byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z); + if (x == 0 && z == 0) { + if (tBlock != BW_BLOCKS[2] || tMeta != 0) + return false; + }else{ + if (tBlock != BW_BLOCKS[2] || tMeta != 1) + return false; + } + + } + else if (y == 1) { + if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 1, zDir + z),1,aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)), Materials.Neutronium.getBlocks(1))) + return false; + } + else if (y == 2) { + if (!piston) { + if (Math.abs(x) == 1 && Math.abs(z) == 1) { + if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 2, zDir + z),1,aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)), Materials.Neutronium.getBlocks(1))) + return false; + } + }else if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 2, zDir + z),1,aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)), Materials.Neutronium.getBlocks(1))) + return false; + } + else if (y == 3) { + if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 3, zDir + z),1,aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)), Materials.Neutronium.getBlocks(1))) + return false; + } + } + } + } + return true; + } + + + @Override + public int getPollutionPerTick(ItemStack itemStack) { + return 0; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_TileEntity_ElectricImplosionCompressor(this.mName); + } + + @Override + public String[] getDescription() { + return new String[0]; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java new file mode 100644 index 0000000000..414b7b3122 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java @@ -0,0 +1,207 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; + +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import gregtech.GT_Mod; +import gregtech.api.enums.GT_Values; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ProcessingArray; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; +import org.apache.commons.lang3.ArrayUtils; + +import java.util.ArrayList; +import java.util.List; + +import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine.isValidForLowGravity; + +public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_ProcessingArray { + public GT_TileEntity_MegaProcessingArray(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_TileEntity_MegaProcessingArray(String aName) { + super(aName); + } + + private GT_Recipe mLastRecipe; + private int tTier = 0; + private int mMult = 0; + private String mMachine = ""; + + private GT_MetaTileEntity_Hatch_InputBus machineBus; + + public boolean checkRecipe(ItemStack aStack) { + if (!isCorrectMachinePart(machineBus.mInventory[0])) { + return false; + } + + GT_Recipe.GT_Recipe_Map map = getRecipeMap(); + if (map == null) return false; + ArrayList<ItemStack> tInputList = getStoredInputs(); + + if (mInventory[1].getUnlocalizedName().endsWith("10")) { + tTier = 9; + mMult = 2;//u need 4x less machines and they will use 4x less power + } else if (mInventory[1].getUnlocalizedName().endsWith("11")) { + tTier = 9; + mMult = 4;//u need 16x less machines and they will use 16x less power + } else if (mInventory[1].getUnlocalizedName().endsWith("12") || + mInventory[1].getUnlocalizedName().endsWith("13") || + mInventory[1].getUnlocalizedName().endsWith("14") || + mInventory[1].getUnlocalizedName().endsWith("15")) { + tTier = 9; + mMult = 6;//u need 64x less machines and they will use 64x less power + } else if (mInventory[1].getUnlocalizedName().endsWith("1")) { + tTier = 1; + mMult = 0;//*1 + } else if (mInventory[1].getUnlocalizedName().endsWith("2")) { + tTier = 2; + mMult = 0;//*1 + } else if (mInventory[1].getUnlocalizedName().endsWith("3")) { + tTier = 3; + mMult = 0;//*1 + } else if (mInventory[1].getUnlocalizedName().endsWith("4")) { + tTier = 4; + mMult = 0;//*1 + } else if (mInventory[1].getUnlocalizedName().endsWith("5")) { + tTier = 5; + mMult = 0;//*1 + } else if (mInventory[1].getUnlocalizedName().endsWith("6")) { + tTier = 6; + mMult = 0;//*1 + } else if (mInventory[1].getUnlocalizedName().endsWith("7")) { + tTier = 7; + mMult = 0;//*1 + } else if (mInventory[1].getUnlocalizedName().endsWith("8")) { + tTier = 8; + mMult = 0;//*1 + } else if (mInventory[1].getUnlocalizedName().endsWith("9")) { + tTier = 9; + mMult = 0;//*1 + } else { + tTier = 0; + mMult = 0;//*1 + } + + if (!mMachine.equals(mInventory[1].getUnlocalizedName())) mLastRecipe = null; + mMachine = mInventory[1].getUnlocalizedName(); + ItemStack[] tInputs = (ItemStack[]) tInputList.toArray(new ItemStack[tInputList.size()]); + + ArrayList<FluidStack> tFluidList = getStoredFluids(); + + FluidStack[] tFluids = (FluidStack[]) tFluidList.toArray(new FluidStack[tFluidList.size()]); + if (tInputList.size() > 0 || tFluids.length > 0) { + GT_Recipe tRecipe = map.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); + if (tRecipe != null) { + if (GT_Mod.gregtechproxy.mLowGravProcessing && tRecipe.mSpecialValue == -100 && + !isValidForLowGravity(tRecipe, getBaseMetaTileEntity().getWorld().provider.dimensionId)) + return false; + + mLastRecipe = tRecipe; + this.mEUt = 0; + this.mOutputItems = null; + this.mOutputFluids = null; + int machines = Math.min(64, mInventory[1].stackSize << mMult); //Upped max Cap to 64 + int i = 0; + for (; i < machines; i++) { + if (!tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { + if (i == 0) { + return false; + } + break; + } + } + this.mMaxProgresstime = tRecipe.mDuration; + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + BW_Util.calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, map.mAmperage, GT_Values.V[tTier],this); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + this.mEUt = GT_Utility.safeInt(((long) this.mEUt * i) >> mMult, 1); + if (mEUt == Integer.MAX_VALUE - 1) + return false; + + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + ItemStack[] tOut = new ItemStack[tRecipe.mOutputs.length]; + for (int h = 0; h < tRecipe.mOutputs.length; h++) { + if (tRecipe.getOutput(h) != null) { + tOut[h] = tRecipe.getOutput(h).copy(); + tOut[h].stackSize = 0; + } + } + FluidStack tFOut = null; + if (tRecipe.getFluidOutput(0) != null) tFOut = tRecipe.getFluidOutput(0).copy(); + for (int f = 0; f < tOut.length; f++) { + if (tRecipe.mOutputs[f] != null && tOut[f] != null) { + for (int g = 0; g < i; g++) { + if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(f)) + tOut[f].stackSize += tRecipe.mOutputs[f].stackSize; + } + } + } + if (tFOut != null) { + int tSize = tFOut.amount; + tFOut.amount = tSize * i; + } + tOut = clean(tOut); + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + List<ItemStack> overStacks = new ArrayList<ItemStack>(); + for (int f = 0; f < tOut.length; f++) { + while (tOut[f].getMaxStackSize() < tOut[f].stackSize) { + if (tOut[f] != null) { + ItemStack tmp = tOut[f].copy(); + tmp.stackSize = tmp.getMaxStackSize(); + tOut[f].stackSize = tOut[f].stackSize - tOut[f].getMaxStackSize(); + overStacks.add(tmp); + } + } + } + if (overStacks.size() > 0) { + ItemStack[] tmp = new ItemStack[overStacks.size()]; + tmp = overStacks.toArray(tmp); + tOut = ArrayUtils.addAll(tOut, tmp); + } + List<ItemStack> tSList = new ArrayList<ItemStack>(); + for (ItemStack tS : tOut) { + if (tS.stackSize > 0) tSList.add(tS); + } + tOut = tSList.toArray(new ItemStack[tSList.size()]); + this.mOutputItems = tOut; + this.mOutputFluids = new FluidStack[]{tFOut}; + updateSlots(); + return true; + }/* else{ + ...remoteRecipeCheck() + }*/ + } + return false; + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java index 2ba88bf4ee..65fb30e847 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java @@ -23,11 +23,13 @@ package com.github.bartimaeusnek.bartworks.server.container; import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.common.items.Circuit_Programmer; import com.github.bartimaeusnek.bartworks.common.net.CircuitProgrammerPacket; import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.gui.GT_Slot_Holo; +import gregtech.api.gui.GT_Slot_Render; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; @@ -63,10 +65,13 @@ public class GT_Container_CircuitProgrammer extends Container { addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); } } + for (int i = 0; i < 9; i++) { - addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142)); + if (GT_Utility.isStackValid(inventory.getStackInSlot(i)) && inventory.getStackInSlot(i).getItem() instanceof Circuit_Programmer) + addSlotToContainer(new GT_Slot_Render(inventory, i, 8 + i * 18, 142)); + else + addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142)); } - } @Override @@ -79,7 +84,7 @@ public class GT_Container_CircuitProgrammer extends Container { return ((Slot) this.inventorySlots.get(0)).getStack(); } detectAndSendChanges(); - return super.slotClick(slot, button, aShifthold, entityPlayer);//( (Slot) this.inventorySlots.get(slot)).getStack(); + return super.slotClick(slot, button, aShifthold, entityPlayer); } @Override @@ -168,7 +173,6 @@ public class GT_Container_CircuitProgrammer extends Container { Player.inventory.setInventorySlotContents(Player.inventory.currentItem, toBind); if (!Player.isClientWorld()) MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket(Player.worldObj.provider.dimensionId, Player.getEntityId(), true, (byte) itemStack.getItemDamage())); - } else if (BW_Util.checkStackAndPrefix(itemStack) && GT_OreDictUnificator.getAssociation(itemStack).mPrefix.equals(OrePrefixes.circuit) && GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.equals(Materials.Basic)) { Slot = GT_Utility.getIntegratedCircuit(0); Slot.stackSize = 1; @@ -180,8 +184,11 @@ public class GT_Container_CircuitProgrammer extends Container { Player.inventory.setInventorySlotContents(Player.inventory.currentItem, toBind); if (!Player.isClientWorld()) MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket(Player.worldObj.provider.dimensionId, Player.getEntityId(), true, (byte) 0)); - - } else { + }/* else if (GT_Utility.isStackValid(itemStack) && itemStack.getItem() instanceof Circuit_Programmer) { + ForgeHooks.onPlayerTossEvent(Player, itemStack, false); + this.closeInventory(); + Player.closeScreen(); + }*/ else { ForgeHooks.onPlayerTossEvent(Player, itemStack, false); tag = toBind.getTagCompound(); tag.setBoolean("HasChip", false); @@ -189,7 +196,6 @@ public class GT_Container_CircuitProgrammer extends Container { Player.inventory.setInventorySlotContents(Player.inventory.currentItem, toBind); if (!Player.isClientWorld()) MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket(Player.worldObj.provider.dimensionId, Player.getEntityId(), false, (byte) 0)); - } } @@ -226,7 +232,6 @@ public class GT_Container_CircuitProgrammer extends Container { @Override public void closeInventory() { - } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index 2e2760b954..1ee1be96f3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -88,6 +88,8 @@ public class BWRecipes { "EU generated: ", 1000, "", false, true ); + + public BWRecipes() { if (ConfigHandler.BioLab) { @@ -482,6 +484,12 @@ public class BWRecipes { return false; } + public static class DynamicGTRecipe extends GT_Recipe{ + public DynamicGTRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); + } + } + public static class BW_Recipe_Map_LiquidFuel extends GT_Recipe.GT_Recipe_Map_Fuel { public BW_Recipe_Map_LiquidFuel(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); |