diff options
author | bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> | 2018-12-16 17:59:04 +0100 |
---|---|---|
committer | bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> | 2018-12-16 17:59:04 +0100 |
commit | c27b9a2f34029b6af977317688caef7a315625e7 (patch) | |
tree | 0e90a97e42948ac555de5aa05ab75462c4be263f /src | |
parent | 55e33d2071504bc7bcdfdaef638dc96e4d4ca970 (diff) | |
download | GT5-Unofficial-c27b9a2f34029b6af977317688caef7a315625e7.tar.gz GT5-Unofficial-c27b9a2f34029b6af977317688caef7a315625e7.tar.bz2 GT5-Unofficial-c27b9a2f34029b6af977317688caef7a315625e7.zip |
Version 0.1.0 out of Techdemo stage
+Added all missing texts and textures
+Added Circuit Programmer
+Hopefully fixed the ManualTrafo in Single Modes
Diffstat (limited to 'src')
22 files changed, 843 insertions, 295 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java index 1a19fa32d6..7d2f2d4628 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java @@ -1,6 +1,8 @@ package com.github.bartimaeusnek.bartworks; +import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_CircuitProgrammer; import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_Destructopack; +import com.github.bartimaeusnek.bartworks.server.container.GT_Container_CircuitProgrammer; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_Item_Destructopack; import cpw.mods.fml.common.network.IGuiHandler; import net.minecraft.entity.player.EntityPlayer; @@ -12,6 +14,7 @@ public class GuiHandler implements IGuiHandler { public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { switch (ID){ case 0: return new GT_Container_Item_Destructopack(player.inventory); + case 1: return new GT_Container_CircuitProgrammer(player.inventory); } return null; } @@ -20,6 +23,7 @@ public class GuiHandler implements IGuiHandler { public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { switch (ID){ case 0: return new GT_GUIContainer_Destructopack(player.inventory); + case 1: return new GT_GUIContainer_CircuitProgrammer(player.inventory); } return null; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index cb5ab327f3..a2fc611223 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -36,6 +36,7 @@ public final class MainMod { public static final CreativeTabs GT2 = new GT2Tab("GT2C"); public static final CreativeTabs BWT = new bartworksTab("bartworks"); public static final IGuiHandler GH = new GuiHandler(); + @Mod.Instance(modID) public static MainMod instance; public static ConfigHandler CHandler; @@ -58,9 +59,6 @@ public final class MainMod { @Mod.EventHandler public void postInit(FMLPostInitializationEvent postinit) { NetworkRegistry.INSTANCE.registerGuiHandler(instance,GH); - - - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java new file mode 100644 index 0000000000..d511369435 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java @@ -0,0 +1,23 @@ +package com.github.bartimaeusnek.bartworks.client.gui; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.server.container.GT_Container_CircuitProgrammer; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class GT_GUIContainer_CircuitProgrammer extends GuiContainer { + + public GT_GUIContainer_CircuitProgrammer(InventoryPlayer p_i1072_1_) { + super(new GT_Container_CircuitProgrammer(p_i1072_1_)); + } + public static final ResourceLocation texture = new ResourceLocation(MainMod.modID, "textures/GUI/GUI_CircuitP.png"); + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { + GL11.glColor4f(1F, 1F, 1F, 1F); + Minecraft.getMinecraft().getTextureManager().bindTexture(texture); + drawTexturedModalRect(guiLeft-79, guiTop, 0, 0, 256, 165); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java index 89198f35d3..4a0b1ada5b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java @@ -1,6 +1,7 @@ package com.github.bartimaeusnek.bartworks.client.gui; import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.common.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_LESU; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_LESU; import gregtech.api.gui.GT_GUIContainer; @@ -29,7 +30,7 @@ public class GT_GUIContainer_LESU extends GT_GUIContainer { protected void drawGuiContainerForegroundLayer(final int par1, final int par2) { this.drawString(this.fontRendererObj,"L.E.S.U.", 11, 8, 16448255); if (this.mContainer != null) { - String percell = String.valueOf(c.energyPerCell).substring(1); + String percell = String.valueOf(ConfigHandler.energyPerCell).substring(1); this.drawString(this.fontRendererObj,"EU: " + String.valueOf(this.mContainer.mEnergy), 11, 16, 16448255); this.drawString(this.fontRendererObj,"MAX: " + (this.c.getBaseMetaTileEntity().isActive() ? String.valueOf(this.mContainer.mOutput)+ percell : Integer.toString(0)), 11, 24, 16448255); this.drawString(this.fontRendererObj,"MAX EU/t IN: " + String.valueOf(this.mContainer.mInput), 11, 32, 16448255); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/ConfigHandler.java index 45cfd43cbb..33999f71d4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/ConfigHandler.java @@ -2,7 +2,6 @@ package com.github.bartimaeusnek.bartworks.common; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_LESU; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import gregtech.api.enums.GT_Values; import net.minecraftforge.common.config.Configuration; @@ -14,18 +13,22 @@ public class ConfigHandler { public static final int IDU=1+ GT_Values.VN.length; public static boolean ezmode = false; public static boolean teslastaff = false; + public static long energyPerCell = 100000L; + public static boolean newStuff = true; public final Configuration c; public ConfigHandler(FMLPreInitializationEvent e){ c = new Configuration(new File(e.getModConfigurationDirectory().toString()+"/"+MainMod.modID+".cfg")); IDOffset=c.get("System","ID Offset",12600,"ID Offset for this mod. This Mod uses "+IDU+" IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").getInt(12600); - GT_TileEntity_LESU.energyPerCell=c.get("Multiblocks","energyPerLESUCell",1000000,"This will set Up the Energy per LESU Cell",1000000,Integer.MAX_VALUE).getInt(1000000); + energyPerCell=c.get("Multiblocks","energyPerLESUCell",1000000,"This will set Up the Energy per LESU Cell",1000000,Integer.MAX_VALUE).getInt(1000000); ezmode=c.get("System","Mode switch",false,"If GTNH is Loaded, this will enable easy recipes, if not, it will enable harder recipes.").getBoolean(false); MainMod.GTNH = ezmode ? !MainMod.GTNH : MainMod.GTNH; teslastaff=c.get("System","Enable Teslastaff",false,"Enables the Teslastaff, an Item used to destroy Electric Armors").getBoolean(false); + newStuff=!c.get("System","Disable non-original-GT-stuff",false,"This switch disables my new content, that is not part of the GT2 compat").getBoolean(false); if (c.hasChanged()) c.save(); + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java new file mode 100644 index 0000000000..42167e7209 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java @@ -0,0 +1,90 @@ +package com.github.bartimaeusnek.bartworks.common.items; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.GT_Values; +import gregtech.api.items.GT_Generic_Item; +import ic2.api.item.ElectricItem; +import ic2.api.item.IElectricItem; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +import java.util.List; + +public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem { + + public Circuit_Programmer() { + super("BWCircuitProgrammer","Circuit Programmer","Programs Integrated Circuits"); + this.setMaxStackSize(1); + this.setNoRepair(); + this.setHasSubtypes(false); + this.setCreativeTab(MainMod.BWT); + } + @Override + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { + super.addInformation(aStack,aPlayer,aList,aF3_H); + aList.add("Has Circuit inside? "+ (aStack.getTagCompound().getBoolean("HasChip") ? "Yes" : "No")); + aList.add("Added by"+ ChatColorHelper.DARKGREEN +" BartWorks"); + } + + @Override + public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { + if (ElectricItem.manager.use(aStack,100,aPlayer)) { + aPlayer.openGui(MainMod.instance, 1, aWorld, 0, 0, 0); + } + return aStack; + } + + @SideOnly(Side.CLIENT) + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List itemList) { + ItemStack itemStack = new ItemStack(this, 1); + if (getChargedItem(itemStack) == this) { + ItemStack charged = new ItemStack(this, 1); + ElectricItem.manager.charge(charged, Integer.MAX_VALUE, Integer.MAX_VALUE, true, false); + itemList.add(charged); + } + if (getEmptyItem(itemStack) == this) { + itemList.add(new ItemStack(this, 1, getMaxDamage())); + } + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister aIconRegister) { + this.mIcon = aIconRegister.registerIcon("bartworks:CircuitProgrammer"); + } + public int getTier(ItemStack var1){ + return 1; + } + + @Override + public boolean canProvideEnergy(ItemStack itemStack) { + return false; + } + + @Override + public Item getChargedItem(ItemStack itemStack) { + return this; + } + + @Override + public Item getEmptyItem(ItemStack itemStack) { + return this; + } + + @Override + public double getMaxCharge(ItemStack itemStack) { + return 10000; + } + + @Override + public double getTransferLimit(ItemStack itemStack) { + return GT_Values.V[1]; + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java index f3976ad979..88883a039c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java @@ -1,6 +1,7 @@ package com.github.bartimaeusnek.bartworks.common.items; import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.items.GT_Generic_Item; @@ -9,6 +10,8 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; +import java.util.List; + public class GT_Destructopack_Item extends GT_Generic_Item { @@ -21,10 +24,17 @@ public class GT_Destructopack_Item extends GT_Generic_Item } @Override + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { + super.addInformation(aStack,aPlayer,aList,aF3_H); + aList.add("Added by"+ ChatColorHelper.DARKGREEN +" BartWorks"); + } + + @Override public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { aPlayer.openGui(MainMod.instance, 0, aWorld, 0, 0, 0); return aStack; } + @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister aIconRegister) { this.mIcon = aIconRegister.registerIcon("bartworks:gt.GT2Destructopack"); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java index 939659c332..3148281c38 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java @@ -1,6 +1,7 @@ package com.github.bartimaeusnek.bartworks.common.items; import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import com.google.common.collect.Sets; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -53,6 +54,7 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) { aList.add("Tier: " + GT_Values.VN[this.mTier]); + aList.add("Added by"+ ChatColorHelper.DARKGREEN +" BartWorks"); } public void onUpdate(ItemStack aStack, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java index b1fc581475..59f8ac5835 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java @@ -1,6 +1,7 @@ package com.github.bartimaeusnek.bartworks.common.items; import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import com.google.common.collect.Sets; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -20,7 +21,7 @@ import net.minecraft.util.IIcon; import java.util.List; import java.util.Set; -public class GT_Teslastaff_Item extends ItemTool implements ic2.api.item.IElectricItem +public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { public double mCharge; public double mTransfer; @@ -45,6 +46,7 @@ public class GT_Teslastaff_Item extends ItemTool implements ic2.api.item.IElectr @Override public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) { aList.add("No warranty!"); + aList.add("Added by"+ ChatColorHelper.DARKGREEN +" BartWorks"); } public boolean hitEntity(ItemStack aStack, EntityLivingBase aTarget, EntityLivingBase aPlayer) { 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 ea3d2f27f7..11567daeee 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 @@ -15,6 +15,7 @@ import net.minecraft.item.ItemStack; import static com.github.bartimaeusnek.bartworks.MainMod.BWT; import static com.github.bartimaeusnek.bartworks.MainMod.GT2; +import static com.github.bartimaeusnek.bartworks.common.ConfigHandler.newStuff; public class ItemRegistry implements Runnable { @@ -23,6 +24,7 @@ public class ItemRegistry implements Runnable { public static final Item RockcutterLV = new GT_Rockcutter_Item(1); public static final Item RockcutterMV = new GT_Rockcutter_Item(2); public static final Item RockcutterHV = new GT_Rockcutter_Item(3); + public static final Item CircuitProgrammer = new Circuit_Programmer(); public static ItemStack[] Diode2A= new ItemStack[GT_Values.VN.length]; public static ItemStack[] Diode4A= new ItemStack[GT_Values.VN.length]; public static ItemStack[] Diode8A= new ItemStack[GT_Values.VN.length]; @@ -42,8 +44,8 @@ public class ItemRegistry implements Runnable { new BW_Blocks("BW_Machinery_Casings",new String[]{ MainMod.modID+":NickelFerriteBlocks", MainMod.modID+":TransformerCoil", - MainMod.modID+":DEHP_Casing", - MainMod.modID+":DEHP_Casing_Base" + // MainMod.modID+":DEHP_Casing", + // MainMod.modID+":DEHP_Casing_Base" },BWT), }; @@ -52,12 +54,15 @@ public class ItemRegistry implements Runnable { @Override public void run() { - GameRegistry.registerBlock(BW_BLOCKS[0], BW_ItemBlocks.class,"BW_ItemBlocks"); - GameRegistry.registerBlock(BW_BLOCKS[1], BW_ItemBlocks.class,"GT_LESU_CASING"); - GameRegistry.registerBlock(BW_BLOCKS[2], BW_ItemBlocks.class,"BW_Machinery_Casings"); + if (newStuff) { + GameRegistry.registerBlock(BW_BLOCKS[2], BW_ItemBlocks.class, "BW_Machinery_Casings"); + GT_OreDictUnificator.registerOre(OrePrefixes.block, Materials.NickelZincFerrite, new ItemStack(BW_BLOCKS[2])); + } - GT_OreDictUnificator.registerOre(OrePrefixes.block, Materials.NickelZincFerrite,new ItemStack(BW_BLOCKS[2])); + //GT2 stuff + GameRegistry.registerBlock(BW_BLOCKS[0], BW_ItemBlocks.class,"BW_ItemBlocks"); + GameRegistry.registerBlock(BW_BLOCKS[1], BW_ItemBlocks.class,"GT_LESU_CASING"); if (ConfigHandler.teslastaff) GameRegistry.registerItem(Teslastaff,Teslastaff.getUnlocalizedName()); 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 b7a992f2e5..9dd005076f 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 @@ -2,6 +2,7 @@ package com.github.bartimaeusnek.bartworks.common.loaders; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.ConfigHandler; +import com.github.bartimaeusnek.bartworks.common.items.Circuit_Programmer; import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_Diode; import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_EnergyDistributor; import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_LESU; @@ -18,6 +19,8 @@ import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidRegistry; +import static com.github.bartimaeusnek.bartworks.common.ConfigHandler.newStuff; + public class RecipeLoader implements Runnable { private final static long bitsd = GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE; @@ -25,22 +28,21 @@ public class RecipeLoader implements Runnable { @Override public void run() { - if(MainMod.GTNH) { + if (MainMod.GTNH) { /* * 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))); - } - else { + 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))); + } 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, (int) (GT_Values.V[1] - (GT_Values.V[1] / 10))); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.BW_BLOCKS[1]), @@ -53,11 +55,11 @@ 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_ModHandler.addShapelessCraftingRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0],1,0),bitsd,new Object[]{new ItemStack(ItemRegistry.BW_BLOCKS[0],1,1)}); - GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0],1,1),bitsd,new Object[]{new ItemStack(ItemRegistry.BW_BLOCKS[0],1,0)}); + 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_ModHandler.addShapelessCraftingRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), bitsd, new Object[]{new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1)}); + GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), bitsd, new Object[]{new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0)}); } /* @@ -65,15 +67,15 @@ public class RecipeLoader implements Runnable { */ GT_ModHandler.addCraftingRecipe( - new GT_TileEntity_LESU(ConfigHandler.IDOffset,"LESU","LESU").getStackForm(1L), + new GT_TileEntity_LESU(ConfigHandler.IDOffset, "LESU", "LESU").getStackForm(1L), bitsd, new Object[]{ "CDC", "SBS", "CFC", - 'C', GT_OreDictUnificator.get(OrePrefixes.circuit, MainMod.GTNH ? Materials.Advanced : Materials.Basic,1L), + 'C', GT_OreDictUnificator.get(OrePrefixes.circuit, MainMod.GTNH ? Materials.Advanced : Materials.Basic, 1L), 'D', ItemList.Cover_Screen.get(1L), - 'S', GT_OreDictUnificator.get(OrePrefixes.cableGt12, MainMod.GTNH ? Materials.Platinum : Materials.AnnealedCopper,1L), + 'S', GT_OreDictUnificator.get(OrePrefixes.cableGt12, MainMod.GTNH ? Materials.Platinum : Materials.AnnealedCopper, 1L), 'B', new ItemStack(ItemRegistry.BW_BLOCKS[1]), 'F', MainMod.GTNH ? ItemList.Field_Generator_HV.get(1L) : ItemList.Field_Generator_LV.get(1L) }); @@ -85,8 +87,8 @@ public class RecipeLoader implements Runnable { "CPC", "PLP", "CPC", - 'C', GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced,1L), - 'P', GT_OreDictUnificator.get(MainMod.GTNH ? OrePrefixes.plateDouble : OrePrefixes.plate, Materials.Aluminium,1L), + 'C', GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 1L), + 'P', GT_OreDictUnificator.get(MainMod.GTNH ? OrePrefixes.plateDouble : OrePrefixes.plate, Materials.Aluminium, 1L), 'L', new ItemStack(Items.lava_bucket) }); @@ -97,8 +99,8 @@ public class RecipeLoader implements Runnable { "CPC", "PLP", "CPC", - 'C', GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced,1L), - 'P', GT_OreDictUnificator.get(MainMod.GTNH ? OrePrefixes.plateDouble : OrePrefixes.plate, MainMod.GTNH ? Materials.Steel : Materials.Iron,1L), + 'C', GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 1L), + 'P', GT_OreDictUnificator.get(MainMod.GTNH ? OrePrefixes.plateDouble : OrePrefixes.plate, MainMod.GTNH ? Materials.Steel : Materials.Iron, 1L), 'L', new ItemStack(Items.lava_bucket) }); @@ -109,9 +111,9 @@ public class RecipeLoader implements Runnable { "DS ", "DP ", "DCB", - 'D', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond,1L), - 'S', GT_OreDictUnificator.get(OrePrefixes.stick,Materials.TungstenSteel,1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate,Materials.TungstenSteel,1L), + 'D', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), + 'S', GT_OreDictUnificator.get(OrePrefixes.stick, Materials.TungstenSteel, 1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 1L), 'C', "circuitGood", 'B', ItemList.IC2_AdvBattery.get(1L) }); @@ -123,9 +125,9 @@ public class RecipeLoader implements Runnable { "DS ", "DP ", "DCB", - 'D', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond,1L), - 'S', GT_OreDictUnificator.get(OrePrefixes.stick,Materials.Titanium,1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate,Materials.Titanium,1L), + 'D', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), + 'S', GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Titanium, 1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), 'C', "circuitBasic", 'B', ItemList.IC2_ReBattery.get(1L) }); @@ -137,9 +139,9 @@ public class RecipeLoader implements Runnable { "DS ", "DP ", "DCB", - 'D', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond,1L), - 'S', GT_OreDictUnificator.get(OrePrefixes.stick,Materials.Iridium,1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate,Materials.Iridium,1L), + 'D', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), + 'S', GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Iridium, 1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 1L), 'C', "circuitAdvanced", 'B', ItemList.IC2_EnergyCrystal.get(1L) }); @@ -152,171 +154,194 @@ public class RecipeLoader implements Runnable { "BO ", "OP ", " P", - 'O', GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Superconductor,1L), + 'O', GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Superconductor, 1L), 'B', ItemList.Energy_LapotronicOrb.get(1L), 'P', "plateAlloyIridium", }); + if (newStuff) { + Materials[] cables = {Materials.Lead, Materials.Tin, Materials.AnnealedCopper, Materials.Gold, Materials.Aluminium, Materials.Tungsten, Materials.VanadiumGallium, Materials.Naquadah, Materials.NaquadahAlloy, Materials.Superconductor}; + Materials[] hulls = {Materials.WroughtIron, Materials.Steel, Materials.Aluminium, Materials.StainlessSteel, Materials.Titanium, Materials.TungstenSteel, Materials.Chrome, Materials.Iridium, Materials.Osmium, Materials.Naquadah}; - Materials[] cables = {Materials.Lead, Materials.Tin,Materials.AnnealedCopper,Materials.Gold,Materials.Aluminium,Materials.Tungsten, Materials.VanadiumGallium,Materials.Naquadah, Materials.NaquadahAlloy, Materials.Superconductor}; - Materials[] hulls = {Materials.WroughtIron, Materials.Steel,Materials.Aluminium,Materials.StainlessSteel,Materials.Titanium,Materials.TungstenSteel, Materials.Chrome,Materials.Iridium, Materials.Osmium, Materials.Naquadah}; - - for (int i = 0; i < GT_Values.VN.length; i++) { - try{ - Materials cable = cables[i]; - Materials hull = hulls[i]; - ItemStack machinehull = ItemList.MACHINE_HULLS[i].get(1L); + for (int i = 0; i < GT_Values.VN.length; i++) { + try { + Materials cable = cables[i]; + Materials hull = hulls[i]; + ItemStack machinehull = ItemList.MACHINE_HULLS[i].get(1L); - GT_ModHandler.addCraftingRecipe( - new GT_MetaTileEntity_EnergyDistributor(ConfigHandler.IDOffset+1+i,"Energy Distributor "+GT_Values.VN[i], "Energy Distributor "+GT_Values.VN[i], i, "Splits Amperage into several Sides").getStackForm(1L), - bitsd, - new Object[]{ - "PWP", - "WCW", - "PWP", - 'W', GT_OreDictUnificator.get(OrePrefixes.wireGt16,cable,1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), - 'C', machinehull - }); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode12A[i]=new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset+GT_Values.VN.length*4+1+i,"Cable Diode 12A "+GT_Values.VN[i], "Cable Diode 12A "+GT_Values.VN[i], i,12).getStackForm(1L), - bitsd, - new Object[]{ - "WDW", - "DCD", - "PDP", - 'D', ItemList.Circuit_Parts_Diode.get(1L,ItemList.Circuit_Parts_DiodeSMD.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt12,cable,1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode12A[i], - bitsd, - new Object[]{ - "WDW", - "DCD", - "PDP", - 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L,ItemList.Circuit_Parts_Diode.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt12,cable,1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode8A[i]=new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset+GT_Values.VN.length*3+1+i,"Cable Diode 8A "+GT_Values.VN[i], "Cable Diode 8A "+GT_Values.VN[i], i,8).getStackForm(1L), - bitsd, - new Object[]{ - "WDW", - "DCD", - "PDP", - 'D', ItemList.Circuit_Parts_Diode.get(1L,ItemList.Circuit_Parts_DiodeSMD.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt08,cable,1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode8A[i], - bitsd, - new Object[]{ - "WDW", - "DCD", - "PDP", - 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L,ItemList.Circuit_Parts_Diode.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt08,cable,1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode4A[i]=new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset+GT_Values.VN.length*2+1+i,"Cable Diode 4A "+GT_Values.VN[i], "Cable Diode 4A "+GT_Values.VN[i], i,4).getStackForm(1L), - bitsd, - new Object[]{ - "WDW", - "DCD", - "PDP", - 'D', ItemList.Circuit_Parts_Diode.get(1L,ItemList.Circuit_Parts_DiodeSMD.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt04,cable,1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode4A[i], - bitsd, - new Object[]{ - "WDW", - "DCD", - "PDP", - 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L,ItemList.Circuit_Parts_Diode.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt04,cable,1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode2A[i]=new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset+GT_Values.VN.length+1+i,"Cable Diode 2A "+GT_Values.VN[i], "Cable Diode 2A "+GT_Values.VN[i], i,2).getStackForm(1L), - bitsd, - new Object[]{ - "WDW", - "DCD", - "PDP", - 'D', ItemList.Circuit_Parts_Diode.get(1L,ItemList.Circuit_Parts_DiodeSMD.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt02,cable,1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode2A[i], - bitsd, - new Object[]{ - "WDW", - "DCD", - "PDP", - 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L,ItemList.Circuit_Parts_Diode.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt02,cable,1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode16A[i]=new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset+GT_Values.VN.length*5+5+i,"Cable Diode 16A "+GT_Values.VN[i], "Cable Diode 16A "+GT_Values.VN[i], i,16).getStackForm(1L), - bitsd, - new Object[]{ - "WHW", - "DCD", - "PDP", - 'H', ItemList.Circuit_Parts_Coil.get(1L), - 'D', ItemList.Circuit_Parts_Diode.get(1L,ItemList.Circuit_Parts_DiodeSMD.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.wireGt16,cable,1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode16A[i], - bitsd, - new Object[]{ - "WHW", - "DCD", - "PDP", - 'H', ItemList.Circuit_Parts_Coil.get(1L), - 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L,ItemList.Circuit_Parts_Diode.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.wireGt16,cable,1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), - 'C', machinehull - } - ); + GT_ModHandler.addCraftingRecipe( + new GT_MetaTileEntity_EnergyDistributor(ConfigHandler.IDOffset + 1 + i, "Energy Distributor " + GT_Values.VN[i], "Energy Distributor " + GT_Values.VN[i], i, "Splits Amperage into several Sides").getStackForm(1L), + bitsd, + new Object[]{ + "PWP", + "WCW", + "PWP", + 'W', GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'C', machinehull + }); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.Diode12A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 4 + 1 + i, "Cable Diode 12A " + GT_Values.VN[i], "Cable Diode 12A " + GT_Values.VN[i], i, 12).getStackForm(1L), + bitsd, + new Object[]{ + "WDW", + "DCD", + "PDP", + 'D', ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), + 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt12, cable, 1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'C', machinehull + } + ); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.Diode12A[i], + bitsd, + new Object[]{ + "WDW", + "DCD", + "PDP", + 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), + 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt12, cable, 1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'C', machinehull + } + ); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.Diode8A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 3 + 1 + i, "Cable Diode 8A " + GT_Values.VN[i], "Cable Diode 8A " + GT_Values.VN[i], i, 8).getStackForm(1L), + bitsd, + new Object[]{ + "WDW", + "DCD", + "PDP", + 'D', ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), + 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt08, cable, 1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'C', machinehull + } + ); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.Diode8A[i], + bitsd, + new Object[]{ + "WDW", + "DCD", + "PDP", + 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), + 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt08, cable, 1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'C', machinehull + } + ); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.Diode4A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 2 + 1 + i, "Cable Diode 4A " + GT_Values.VN[i], "Cable Diode 4A " + GT_Values.VN[i], i, 4).getStackForm(1L), + bitsd, + new Object[]{ + "WDW", + "DCD", + "PDP", + 'D', ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), + 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt04, cable, 1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'C', machinehull + } + ); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.Diode4A[i], + bitsd, + new Object[]{ + "WDW", + "DCD", + "PDP", + 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), + 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt04, cable, 1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'C', machinehull + } + ); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.Diode2A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length + 1 + i, "Cable Diode 2A " + GT_Values.VN[i], "Cable Diode 2A " + GT_Values.VN[i], i, 2).getStackForm(1L), + bitsd, + new Object[]{ + "WDW", + "DCD", + "PDP", + 'D', ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), + 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt02, cable, 1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'C', machinehull + } + ); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.Diode2A[i], + bitsd, + new Object[]{ + "WDW", + "DCD", + "PDP", + 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), + 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt02, cable, 1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'C', machinehull + } + ); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.Diode16A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 5 + 5 + i, "Cable Diode 16A " + GT_Values.VN[i], "Cable Diode 16A " + GT_Values.VN[i], i, 16).getStackForm(1L), + bitsd, + new Object[]{ + "WHW", + "DCD", + "PDP", + 'H', ItemList.Circuit_Parts_Coil.get(1L), + 'D', ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), + 'W', GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'C', machinehull + } + ); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.Diode16A[i], + bitsd, + new Object[]{ + "WHW", + "DCD", + "PDP", + 'H', ItemList.Circuit_Parts_Coil.get(1L), + 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), + 'W', GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'C', machinehull + } + ); - }catch(ArrayIndexOutOfBoundsException e){ - //e.printStackTrace(); + } catch (ArrayIndexOutOfBoundsException e) { + //e.printStackTrace(); } } - new GT_TileEntity_ManualTrafo(ConfigHandler.IDOffset+GT_Values.VN.length*6+1,"ManualTravo","ManualTravo"); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.AnnealedCopper, 64L), GT_Utility.getIntegratedCircuit(17)}, + Materials.Plastic.getMolten(1152L), + new ItemStack(ItemRegistry.BW_BLOCKS[2]), + 20, + (int) (GT_Values.V[3] - (GT_Values.V[3] / 10)) + ); + + GT_ModHandler.addCraftingRecipe( + new GT_TileEntity_ManualTrafo(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 1, "Manual Travo", "Manual Travo").getStackForm(1L), + bitsd, + new Object[]{ + "SCS", + "CHC", + "ZCZ", + 'S', GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Titanium, 1L), + 'C', new ItemStack(ItemRegistry.BW_BLOCKS[2]), + 'H', ItemList.Hull_HV.get(1L), + 'Z', GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 1L) + } + ); + + 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.CircuitProgrammer),600,(int) (GT_Values.V[2] - (GT_Values.V[2] / 10))); //current ID: ConfigHandler.IDOffset+GT_Values.VN.length*6+1 } + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_Diode.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_Diode.java index 0ad4ec3142..b2775252c9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_Diode.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_Diode.java @@ -35,6 +35,6 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { return new GT_MetaTileEntity_Diode(this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); } public String[] getDescription() { - return new String[] {mDescription,"Voltage: "+ ChatColorHelper.YELLOW + GT_Values.V[this.mTier],"Amperage IN: " + ChatColorHelper.YELLOW + maxAmperesIn(),"Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut(), "Added by bartimaeusnek via BartWorks"}; + return new String[] {mDescription,"Voltage: "+ ChatColorHelper.YELLOW + GT_Values.V[this.mTier],"Amperage IN: " + ChatColorHelper.YELLOW + maxAmperesIn(),"Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut(), "Added by bartimaeusnek via "+ChatColorHelper.DARKGREEN+"BartWorks"}; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java index 239484460e..218f8f0d50 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java @@ -47,7 +47,7 @@ public class GT_MetaTileEntity_EnergyDistributor extends GT_MetaTileEntity_Trans } public String[] getDescription() { - return new String[] {mDescription,"Voltage: "+ ChatColorHelper.YELLOW +GT_Values.V[this.mTier],"Amperage IN: " + ChatColorHelper.YELLOW + maxAmperesIn(),"Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut(), "Added by bartimaeusnek via BartWorks"}; + return new String[] {mDescription,"Voltage: "+ ChatColorHelper.YELLOW +GT_Values.V[this.mTier],"Amperage IN: " + ChatColorHelper.YELLOW + maxAmperesIn(),"Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut(), "Added by bartimaeusnek via "+ChatColorHelper.DARKGREEN+"BartWorks"}; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_DEHP.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_DEHP.java index 150678ea23..1b2a2934fb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_DEHP.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_DEHP.java @@ -20,7 +20,7 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return null; + return new GT_TileEntity_DEHP(this.mName); } @Override @@ -35,31 +35,33 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { @Override protected ItemList getCasingBlockItem() { - return null; + return ItemList.Casing_HeatProof; } @Override protected Materials getFrameMaterial() { - return null; + return Materials.Tungsten; } @Override protected int getCasingTextureIndex() { - return 0; + return 13; } @Override protected int getMinTier() { - return 0; + return 5; } @Override protected boolean checkHatches() { - return false; + return !this.mMaintenanceHatches.isEmpty() && !this.mOutputHatches.isEmpty() && !this.mInputHatches.isEmpty(); } @Override protected void setElectricityStats() { + + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java index ef60d24828..501849bfcb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java @@ -31,22 +31,14 @@ import net.minecraft.world.World; public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { - @SideOnly(Side.CLIENT) - static IIcon[] iIcons = new IIcon[4]; - @SideOnly(Side.CLIENT) - static IIconContainer[] iIconContainers = new IIconContainer[4]; - @SideOnly(Side.CLIENT) - static ITexture[][] iTextures = new ITexture[4][1]; - @SideOnly(Side.CLIENT) - static final byte TEXID_SIDE = 0; - @SideOnly(Side.CLIENT) - static final byte TEXID_CHARGING = 1; - @SideOnly(Side.CLIENT) - static final byte TEXID_IDLE = 2; - @SideOnly(Side.CLIENT) - static final byte TEXID_EMPTY = 3; - public static long energyPerCell = 100000L; + private static IIcon[] iIcons = new IIcon[4]; + private static IIconContainer[] iIconContainers = new IIconContainer[4]; + private static ITexture[][] iTextures = new ITexture[4][1]; + private static final byte TEXID_SIDE = 0; + private static final byte TEXID_CHARGING = 1; + private static final byte TEXID_IDLE = 2; + private static final byte TEXID_EMPTY = 3; private long mStorage; public ConnectedBlocksChecker connectedcells; @@ -54,7 +46,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { public GT_TileEntity_LESU(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); - this.mStorage = energyPerCell; + this.mStorage = ConfigHandler.energyPerCell; } public GT_TileEntity_LESU(String aName){ @@ -104,7 +96,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override public long maxEUOutput() { - return Math.min(Math.max(this.mStorage / energyPerCell, 1L), 32768L); + return Math.min(Math.max(this.mStorage / ConfigHandler.energyPerCell, 1L), 32768L); } @Override @@ -142,18 +134,19 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { return new String[]{ "Controller Block for the GT2-Styled L.E.S.U.", "Size: ANY", - "Storage per LESU Casing: " + this.energyPerCell+"EU", + "Storage per LESU Casing: " + ConfigHandler.energyPerCell+"EU", "Output EU: LESU Casings amount"+ "Input EU: Next Voltage Tier to Output EU", "Input/Output Amps can be configured via 4 Circuits in GUI", "Output Side has a dot on it.", ChatColorHelper.RED+"Only one Controller allowed, no Wallsharing!", - "Added by bartimaeusnek via BartWorks" + "Added by bartimaeusnek via "+ChatColorHelper.DARKGREEN+"BartWorks" }; } @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister aBlockIconRegister) { + for (int i = 0; i < iTextures.length; i++) { iIcons[i]=aBlockIconRegister.registerIcon(MainMod.modID+":LESU_CASING_"+i); final int finalI = i; @@ -204,6 +197,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { ITexture[] ret = new ITexture[0]; if(this.isClientSide()) { + for (int i = 0; i < iTextures.length; i++) { iTextures[i][0] = new GT_RenderedTexture(iIconContainers[i], Dyes.getModulation(0, Dyes.MACHINE_METAL.mRGBa)); } @@ -331,7 +325,6 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override public boolean onRunningTick(ItemStack aStack){ this.mMaxProgresstime=1; - return true; } @@ -366,7 +359,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { } this.mEfficiency=this.getMaxEfficiency(null); - this.mStorage=(energyPerCell * connectedcells.hashset.size() >= Long.MAX_VALUE-1 || energyPerCell * connectedcells.hashset.size() < 0) ? Long.MAX_VALUE-1 : energyPerCell * connectedcells.hashset.size() ; + this.mStorage=(ConfigHandler.energyPerCell * connectedcells.hashset.size() >= Long.MAX_VALUE-1 || ConfigHandler.energyPerCell * connectedcells.hashset.size() < 0) ? Long.MAX_VALUE-1 : ConfigHandler.energyPerCell * connectedcells.hashset.size() ; this.mMaxProgresstime=1; this.mProgresstime=0; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_ManualTrafo.java index 2c0c255ce8..369a69ba38 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_ManualTrafo.java @@ -1,27 +1,34 @@ package com.github.bartimaeusnek.bartworks.common.tileentities; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Utility; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; -import static gregtech.api.enums.GT_Values.V; - public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase { + private byte mode = 0; private byte texid = 2; private long mCoilWicks = 0; private boolean upstep = true; + private static final byte SINGLE_UPSTEP = 0; + private static final byte SINGLE_DOWNSTEP = 1; + private static final byte MULTI_UPSTEP = 2; + private static final byte MULTI_DOWNSTEP = 3; + public GT_TileEntity_ManualTrafo(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } @@ -32,80 +39,134 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase @Override public boolean isCorrectMachinePart(ItemStack itemStack) { - return false; + return true; } @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (!this.getBaseMetaTileEntity().isAllowedToWork()) + this.stopMachine(); super.onPostTick(aBaseMetaTileEntity,aTick); } @Override public boolean onRunningTick(ItemStack aStack){ - if (this.mEfficiency < this.getMaxEfficiency(null)) - this.mEfficiency += 100; - else - this.mEfficiency = this.getMaxEfficiency(null); + if (this.mode > SINGLE_DOWNSTEP){ + return false; + } + + if (!this.getBaseMetaTileEntity().isAllowedToWork()) { + this.stopMachine(); + return false; + } + this.mProgresstime=0; + this.mMaxProgresstime=1; + if (this.getBaseMetaTileEntity().getTimer() % 40 == 0) + if (this.mEfficiency < this.getMaxEfficiency(null)) + this.mEfficiency += 100; + else + this.mEfficiency = this.getMaxEfficiency(null); + + boolean ret = this.drainEnergyInput(this.getInputTier() * 2 * this.mEnergyHatches.size()) && this.addEnergyOutput(this.getInputTier() * 2 * this.mEnergyHatches.size() * (long)this.mEfficiency / this.getMaxEfficiency(null)); - return this.drainEnergyInput((long)this.mEUt * 2 * this.mEnergyHatches.size()) && this.addEnergyOutput((long)this.mEUt * 2 * this.mEnergyHatches.size() * (long)this.mEfficiency / 10000L); + return ret; } - + + public long getInputTier() { + if (this.mEnergyHatches.size()>0) + return (long) GT_Utility.getTier(this.mEnergyHatches.get(0).getBaseMetaTileEntity().getInputVoltage()); + else return 0; + } + + public long getOutputTier() { + if (this.mDynamoHatches.size()>0) + return (long) GT_Utility.getTier(this.mDynamoHatches.get(0).getBaseMetaTileEntity().getOutputVoltage()); + else return 0; + } + @Override public boolean checkRecipe(ItemStack itemStack) { - this.upstep= !(this.mInventory[1] != null && this.mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit")); - this.mMaxProgresstime=1; + + if (!this.getBaseMetaTileEntity().isAllowedToWork()) { + this.stopMachine(); + return false; + } + this.mode = this.mInventory[1] == null ? 0 : this.mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit") ? this.mInventory[1].getItemDamage() > 4 ? (byte) this.mInventory[1].getItemDamage() : 0 : 0; + this.upstep= (this.mode == 0 || this.mode == 2); this.mProgresstime=0; - this.mEfficiency=1000; - this.mEUt= (int) V[this.mEnergyHatches.get(0).mTier]; + this.mMaxProgresstime=1; + this.mEfficiency= this.mEfficiency > 100 ? this.mEfficiency : 100; return this.upstep ? this.getOutputTier() - this.getInputTier() == mCoilWicks : this.getInputTier() - this.getOutputTier() == mCoilWicks; } @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; - - //check height - int y = 1; - boolean stillcoil = true; - while (stillcoil) { - for (int x = -1; x <= 1; ++x) { - for (int z = -1; z <= 1; ++z) { - if (x != 0 || z != 0) { - stillcoil = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 1; - if (stillcoil) { - if (mCoilWicks != 0 && mCoilWicks % 8 == 0) { - ++y; - continue; - } - this.mCoilWicks++; - } else - break; + + this.mode = this.mInventory[1] == null ? 0 : this.mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit") ? this.mInventory[1].getItemDamage() > 4 ? (byte) this.mInventory[1].getItemDamage() : 0 : 0; + + if(this.mode <= 1){ + + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; + + //check height + int y = 1; + boolean stillcoil = true; + while (stillcoil) { + for (int x = -1; x <= 1; ++x) { + for (int z = -1; z <= 1; ++z) { + if (x != 0 || z != 0) { + stillcoil = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 1; + if (stillcoil) { + ++this.mCoilWicks; + if (mCoilWicks % 8 == 0) { + ++y; + continue; + } + } else + break; + } } + if (!stillcoil) + break; } - if (!stillcoil) - break; } - } - if (mCoilWicks % 8 != 0) - return false; + System.out.println(mCoilWicks); + if (mCoilWicks % 8 != 0) + return false; - this.mCoilWicks = this.mCoilWicks / 8; + this.mCoilWicks = this.mCoilWicks / 8; - //check interior (NiFeZn02 Core) - for (int i = 1; i <= this.mCoilWicks; ++i) { - if (!aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir, y, zDir) == 0) { - return false; + //check interior (NiFeZn02 Core) + for (int i = 1; i <= this.mCoilWicks; ++i) { + if (!aBaseMetaTileEntity.getBlockOffset(xDir, i, zDir).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir, i, zDir) == 0) { + return false; + } } - } - //check Bottom - for (int x = -1; x <= 1; ++x) - for (int z = -1; z <= 1; ++z) - if (xDir + x != 0 || zDir + z != 0) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, 0, zDir + z); - if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addEnergyInputToMachineList(tTileEntity, texid)) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 0, zDir + z) != GregTech_API.sBlockCasings1) { + //check Bottom + for (int x = -1; x <= 1; ++x) + for (int z = -1; z <= 1; ++z) + if (xDir + x != 0 || zDir + z != 0) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, 0, zDir + z); + if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addEnergyInputToMachineList(tTileEntity, texid)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 0, zDir + z) != GregTech_API.sBlockCasings1) { + return false; + } + /* + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 0, zDir + z) != 11) { + return false; + } + */ + } + } + + //check Top + for (int x = -1; x <= 1; ++x) + for (int z = -1; z <= 1; ++z) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z); + if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addDynamoToMachineList(tTileEntity, texid)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z) != GregTech_API.sBlockCasings1) { return false; } /* @@ -116,37 +177,132 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase } } - //check Top - for (int x = -1; x <= 1; ++x) - for (int z = -1; z <= 1; ++z) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, (int) this.mCoilWicks+1, zDir + z); - if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addDynamoToMachineList(tTileEntity, texid)) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, (int) this.mCoilWicks+1, zDir + z) != GregTech_API.sBlockCasings1) { + // check dynamos and energy hatches for the same tier + byte outtier = this.mDynamoHatches.get(0).mTier; + for (GT_MetaTileEntity_Hatch_Dynamo out : this.mDynamoHatches) { + if (out.mTier != outtier) + return false; + } + + byte intier = this.mEnergyHatches.get(0).mTier; + for (GT_MetaTileEntity_Hatch_Energy in : this.mEnergyHatches) { + if (in.mTier != intier) return false; + } + } else { + + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2; + int yDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetY * 2; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2; + //check height + int y = 1; + boolean stillcoil = true; + while (stillcoil) { + for (int x = -1; x <= 1; ++x) { + for (int z = -1; z <= 1; ++z) { + if (x != 0 || z != 0) { + stillcoil = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 1; + if (stillcoil) { + ++this.mCoilWicks; + if (mCoilWicks % 8 == 0) { + ++y; + continue; + } + } else + break; + } + } + if (!stillcoil) + break; } + } + + if (mCoilWicks % 8 != 0) + return false; + + this.mCoilWicks = this.mCoilWicks / 8; + + //check interior (NiFeZn02 Core) + for (int i = 1; i <= this.mCoilWicks; ++i) { + if (!aBaseMetaTileEntity.getBlockOffset(xDir, i, zDir).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir, i, zDir) == 0) { + return false; + } + } + + //check Bottom + for (int x = -2; x <= 2; ++x) + for (int z = -2; z <= 2; ++z) + if (xDir + x != 0 || zDir + z != 0) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, 0, zDir + z); + if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addEnergyInputToMachineList(tTileEntity, texid)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 0, zDir + z) != GregTech_API.sBlockCasings1) { + return false; + } /* if (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 0, zDir + z) != 11) { return false; } */ + } + } + + //check Top + for (int x = -2; x <= 2; ++x) + for (int z = -2; z <= 2; ++z) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z); + if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addDynamoToMachineList(tTileEntity, texid)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z) != GregTech_API.sBlockCasings1) { + return false; + } + /* + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 0, zDir + z) != 11) { + return false; + } + */ + } + } + + if (this.mDynamoHatches.size() <= 0 || this.mEnergyHatches.size() <= 0) + return false; + + byte outtier = this.mDynamoHatches.get(0).mTier; + for (GT_MetaTileEntity_Hatch_Dynamo out : this.mDynamoHatches) { + if (out.mTier != outtier) + return false; } - } - if (this.mDynamoHatches.size() <= 0 || this.mEnergyHatches.size() <= 0 || this.mDynamoHatches.size() > this.mEnergyHatches.size() ) - return false; + byte intier = this.mEnergyHatches.get(0).mTier; + for (GT_MetaTileEntity_Hatch_Energy in : this.mEnergyHatches) { + if (in.mTier != intier) + return false; + } - // check dynamos and energy hatches for the same tier - byte outtier = this.mDynamoHatches.get(0).mTier; - for (GT_MetaTileEntity_Hatch_Dynamo out : this.mDynamoHatches){ - if (out.mTier!=outtier) - return false; - } - byte intier = this.mEnergyHatches.get(0).mTier; - for (GT_MetaTileEntity_Hatch_Energy in : this.mEnergyHatches){ - if (in.mTier!=intier) + //check tap hull + for (int ty = 1; ty <= y; ++ty) { + + byte leveltier = 0; + if (this.mInventory[1].getItemDamage() == 2) + leveltier = ((byte) (intier - ty)); + else if (this.mInventory[1].getItemDamage() == 3) + leveltier = ((byte) (intier + ty)); + else + return false; + + for (int x = -2; x <= 2; ++x) + for (int z = -2; z <= 2; ++z) + if (x == -2 || z == -2 || x == 2 || z == 2) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, ty, zDir + z); + if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addEnergyInputToMachineList(tTileEntity, texid, leveltier) && !this.addDynamoToMachineList(tTileEntity, texid, leveltier)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, ty, zDir + z) != GregTech_API.sBlockCasings1) { + return false; + } + } + } + } + } + if (this.mDynamoHatches.size() <= 0 || this.mEnergyHatches.size() <= 0) return false; - } return true; } @@ -178,7 +334,23 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase @Override public String[] getDescription() { - return new String[]{"blalbabla"}; + return new String[]{ + "Controller Block for the Manual Trafo", + //"Operates in 4 Differents Modes:", + "Operates currently in 2 Differents Modes:", + "Mode 1: Circuit 0 in controller: Direct-Upstep", + "Mode 2: Circuit 1 in controller: Direct-Downstep", + //"Mode 3: Circuit 2 in controller: Tapped-Upstep", + //"Mode 4: Circuit 3 in controller: Tapped-Downstep", + "For direct Modes: 3xHx3", + "Base Contains at least 1 Energy Hatch", + "1 Layer of Dynamo Coils for each Tier transformed", + "Middle of Dynamo Coils needs to be a NickelFerrite Core", + "Top Contains at least 1 Dynamo Hatch", + "Maintenance Hatch can be placed anywhere", + "Added by bartimaeusnek via "+ ChatColorHelper.DARKGREEN+"BartWorks" + //"Tapped Mode is disabled." + }; } @Override @@ -197,4 +369,43 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[texid], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[texid]}; } + + public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex, short tier) { + if (aTileEntity == null) { + return false; + } else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) { + if (tier == ((GT_MetaTileEntity_Hatch)aMetaTileEntity).mTier) { + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); + } + return false; + } else { + return false; + } + } + } + + public boolean addDynamoToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex, short tier) { + if (aTileEntity == null) { + return false; + } else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) { + if (tier == ((GT_MetaTileEntity_Hatch)aMetaTileEntity).mTier) { + ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); + return this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo)aMetaTileEntity); + } + return false; + } else { + 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 new file mode 100644 index 0000000000..aa2f248fec --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java @@ -0,0 +1,176 @@ +package com.github.bartimaeusnek.bartworks.server.container; + +import gregtech.api.gui.GT_Slot_Holo; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +public class GT_Container_CircuitProgrammer extends Container { + + public GT_Container_CircuitProgrammer(InventoryPlayer inventory){ + + IInventory inv = new pinv(inventory.player); + + addSlotToContainer(new Slot(inv,0,44,61));//-45, 84)); + + for (int i = 1; i < 13; i++) { + addSlotToContainer(new GT_Slot_Holo(inv, i, -64+i*18, 22, false, false, 1)); + } + for (int i = 0; i < 12; i++) { + addSlotToContainer(new GT_Slot_Holo(inv, i+12, -46+i*18, 40, false, false, 1)); + } + + for (int i = 0; i < 3; i++) { + for (int j = 0; j < 9; j++) { + 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)); + } + + } + + @Override + public ItemStack slotClick(int slot, int button, int aShifthold, EntityPlayer entityPlayer){ + if (slot > 0 && slot < 25 && ((Slot)this.inventorySlots.get(0)).getStack() != null){ + ((Slot)this.inventorySlots.get(0)).getStack().setItemDamage(slot); + detectAndSendChanges(); + return ( (Slot) this.inventorySlots.get(0)).getStack(); + } + return super.slotClick(slot, button, aShifthold, entityPlayer);//( (Slot) this.inventorySlots.get(slot)).getStack(); + } + + @Override + public boolean canInteractWith(EntityPlayer p_75145_1_) { + return true; + } + + @Override + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int SlotNR) + { + Slot chipslot = (Slot)this.inventorySlots.get(0); + if (SlotNR > 24) { + Slot slot = (Slot) this.inventorySlots.get(SlotNR); + if (slot != null && slot.getStack().getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())){ + if ( chipslot.getStack()== null ){ + chipslot.putStack(slot.getStack()); + slot.decrStackSize(1); + } + } + }else if (SlotNR == 0 && chipslot.getStack() != null){ + for (int i = 25; i < this.inventorySlots.size(); i++) { + if (((Slot)this.inventorySlots.get(i)).getStack() == null){ + Slot empty = ( (Slot) this.inventorySlots.get(i)); + empty.putStack(chipslot.getStack()); + chipslot.decrStackSize(1); + break; + } + } + } + return null; + } + + class pinv implements IInventory { + + public pinv(EntityPlayer Player){ + super(); + this.Player=Player; + this.toBind=Player.inventory.getCurrentItem(); + NBTTagCompound tag = this.toBind.getTagCompound(); + if (tag.getBoolean("HasChip")) + Slot = GT_Utility.getIntegratedCircuit(tag.getByte("ChipConfig")); + } + + ItemStack toBind; + EntityPlayer Player; + ItemStack Slot; + + @Override + public int getSizeInventory() { + return 1; + } + + @Override + public ItemStack getStackInSlot(int slot) { + return slot == 0 ? Slot : null; + } + + @Override + public ItemStack decrStackSize(int slotNR, int count) { + ItemStack ret = Slot.copy(); + Slot = null; + NBTTagCompound tag = toBind.getTagCompound(); + tag.setBoolean("HasChip",false); + toBind.setTagCompound(tag); + Player.inventory.setInventorySlotContents(Player.inventory.currentItem,toBind); + return ret; + } + + @Override + public ItemStack getStackInSlotOnClosing(int p_70304_1_) { + return Slot; + } + + @Override + public void setInventorySlotContents(int slotNR, ItemStack itemStack) { + if (itemStack != null && itemStack.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())) { + Slot = itemStack.copy().splitStack(1); + itemStack.stackSize--; + NBTTagCompound tag = toBind.getTagCompound(); + tag.setBoolean("HasChip",true); + tag.setByte("ChipConfig", (byte) itemStack.getItemDamage()); + toBind.setTagCompound(tag); + Player.inventory.setInventorySlotContents(Player.inventory.currentItem,toBind); + } + } + + @Override + public String getInventoryName() { + return null; + } + + @Override + public boolean hasCustomInventoryName() { + return false; + } + + @Override + public int getInventoryStackLimit() { + return 1; + } + + @Override + public void markDirty() { + + } + + @Override + public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { + return true; + } + + @Override + public void openInventory() { + + } + + @Override + public void closeInventory() { + + } + + @Override + public boolean isItemValidForSlot(int p_94041_1_, ItemStack itemStack) { + if (itemStack!= null && itemStack.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())) + return true; + return false; + } + } + +} diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index ebb7c3ff15..f726682955 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -6,3 +6,6 @@ BW_ItemBlocks.0.name=Etched Lapis Cell BW_ItemBlocks.1.name=Plated Lapis Cell GT_LESU_CASING.0.name=LESU Casing itemGroup.GT2C=Gregtech 2 Compat +itemGroup.bartworks=BartWorks Inter Temporal +BW_Machinery_Casings.0.name=Nickel-Zinc Ferrite Block +BW_Machinery_Casings.1.name=Transformer-Winding Block diff --git a/src/main/resources/assets/bartworks/textures/GUI/GUI_CircuitP.png b/src/main/resources/assets/bartworks/textures/GUI/GUI_CircuitP.png Binary files differnew file mode 100644 index 0000000000..29cb0caf40 --- /dev/null +++ b/src/main/resources/assets/bartworks/textures/GUI/GUI_CircuitP.png diff --git a/src/main/resources/assets/bartworks/textures/blocks/NickelFerriteBlocks.png b/src/main/resources/assets/bartworks/textures/blocks/NickelFerriteBlocks.png Binary files differnew file mode 100644 index 0000000000..f5976c093b --- /dev/null +++ b/src/main/resources/assets/bartworks/textures/blocks/NickelFerriteBlocks.png diff --git a/src/main/resources/assets/bartworks/textures/blocks/TransformerCoil.png b/src/main/resources/assets/bartworks/textures/blocks/TransformerCoil.png Binary files differnew file mode 100644 index 0000000000..349709d3ee --- /dev/null +++ b/src/main/resources/assets/bartworks/textures/blocks/TransformerCoil.png diff --git a/src/main/resources/assets/bartworks/textures/items/CircuitProgrammer.png b/src/main/resources/assets/bartworks/textures/items/CircuitProgrammer.png Binary files differnew file mode 100644 index 0000000000..5021c2834e --- /dev/null +++ b/src/main/resources/assets/bartworks/textures/items/CircuitProgrammer.png |