diff --git a/buildlocal.bat b/buildlocal.bat index f81dd63e2..16717b13f 100644 --- a/buildlocal.bat +++ b/buildlocal.bat @@ -12,15 +12,15 @@ runtime\bin\python\python_mcp runtime\reobfuscate.py %* ::ZIP-UP cd reobf\minecraft\ -"..\..\..\7za.exe" a "..\..\builds\%FILE_NAME%" "*" +7z a "..\..\builds\%FILE_NAME%" "*" cd ..\..\ cd resources\ -"..\..\7za.exe" a "..\builds\%FILE_NAME%" "*" -"..\..\7za.exe" a "..\builds\%BACKUP_NAME%" "*" -pdarkguardsman +7z a "..\builds\%FILE_NAME%" "*" +7z a "..\builds\%BACKUP_NAME%" "*" -pdarkguardsman cd ..\ cd src\ -"..\..\7za.exe" a "..\builds\%BACKUP_NAME%" "*\assemblyline\" -pdarkguardsman -"..\..\7za.exe" a "..\builds\%API_NAME%" "*\assemblyline\api\" +7z a "..\builds\%BACKUP_NAME%" "*\assemblyline\" -pdarkguardsman +7z a "..\builds\%API_NAME%" "*\assemblyline\api\" cd ..\ echo Done building %FILE_NAME% for UE %UE_VERSION% diff --git a/models/Crane/Arm.tcn b/models/Crane/Arm.tcn new file mode 100644 index 000000000..a5a94b814 Binary files /dev/null and b/models/Crane/Arm.tcn differ diff --git a/models/Crane/Head.tcn b/models/Crane/Head.tcn new file mode 100644 index 000000000..e6917f8ce Binary files /dev/null and b/models/Crane/Head.tcn differ diff --git a/models/Crane/MountPoint.tcn b/models/Crane/MountPoint.tcn new file mode 100644 index 000000000..1238814e0 Binary files /dev/null and b/models/Crane/MountPoint.tcn differ diff --git a/models/Crane/ArmMountPoint.tcn b/models/Crane/old/ArmMountPoint.tcn similarity index 100% rename from models/Crane/ArmMountPoint.tcn rename to models/Crane/old/ArmMountPoint.tcn diff --git a/models/Crane/craneArm.tcn b/models/Crane/old/craneArm.tcn similarity index 100% rename from models/Crane/craneArm.tcn rename to models/Crane/old/craneArm.tcn diff --git a/models/Crane/craneArmHoist.tcn b/models/Crane/old/craneArmHoist.tcn similarity index 100% rename from models/Crane/craneArmHoist.tcn rename to models/Crane/old/craneArmHoist.tcn diff --git a/src/minecraft/assemblyline/client/ClientProxy.java b/src/minecraft/assemblyline/client/ClientProxy.java index 566a2ba27..773a81365 100644 --- a/src/minecraft/assemblyline/client/ClientProxy.java +++ b/src/minecraft/assemblyline/client/ClientProxy.java @@ -63,13 +63,16 @@ public class ClientProxy extends CommonProxy { TileEntity tileEntity = world.getBlockTileEntity(x, y, z); - switch (ID) + if (tileEntity != null) { - case GUI_IMPRINTER: - return new GuiImprinter(player.inventory, (TileEntityImprinter) tileEntity); - case GUI_ENCODER: - if (tileEntity != null && tileEntity instanceof TileEntityEncoder) - return new GuiEncoder(player.inventory, (TileEntityEncoder) tileEntity); + switch (ID) + { + case GUI_IMPRINTER: + return new GuiImprinter(player.inventory, (TileEntityImprinter) tileEntity); + case GUI_ENCODER: + if (tileEntity != null && tileEntity instanceof TileEntityEncoder) + return new GuiEncoder(player.inventory, (TileEntityEncoder) tileEntity); + } } return null; diff --git a/src/minecraft/assemblyline/client/model/ModelCraneArmMount.java b/src/minecraft/assemblyline/client/model/ModelCraneArmMount.java new file mode 100644 index 000000000..49d4fae0a --- /dev/null +++ b/src/minecraft/assemblyline/client/model/ModelCraneArmMount.java @@ -0,0 +1,93 @@ +package assemblyline.client.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class ModelCraneArmMount extends ModelBase +{ + // fields + private ModelRenderer RailGuard1; + private ModelRenderer ArmMount; + private ModelRenderer RailGuard2; + private ModelRenderer Base; + private ModelRenderer WheelMount1; + private ModelRenderer Wheel2; + private ModelRenderer WheelMount2; + private ModelRenderer Wheel1; + + public ModelCraneArmMount() + { + textureWidth = 64; + textureHeight = 64; + + RailGuard1 = new ModelRenderer(this, 0, 20); + RailGuard1.addBox(0F, 0F, 0F, 16, 8, 2); + RailGuard1.setRotationPoint(-8F, 12F, 4F); + RailGuard1.setTextureSize(64, 32); + RailGuard1.mirror = true; + setRotation(RailGuard1, 0F, 0F, 0F); + ArmMount = new ModelRenderer(this, 36, 26); + ArmMount.addBox(0F, 0F, 0F, 8, 4, 2); + ArmMount.setRotationPoint(-4F, 4F, -8F); + ArmMount.setTextureSize(64, 32); + ArmMount.mirror = true; + setRotation(ArmMount, 0F, 0F, 0F); + RailGuard2 = new ModelRenderer(this, 0, 20); + RailGuard2.addBox(0F, 0F, 0F, 16, 8, 2); + RailGuard2.setRotationPoint(-8F, 12F, -6F); + RailGuard2.setTextureSize(64, 32); + RailGuard2.mirror = true; + setRotation(RailGuard2, 0F, 0F, 0F); + Base = new ModelRenderer(this, 0, 0); + Base.addBox(0F, 0F, 0F, 16, 4, 16); + Base.setRotationPoint(-8F, 8F, -8F); + Base.setTextureSize(64, 32); + Base.mirror = true; + setRotation(Base, 0F, 0F, 0F); + WheelMount1 = new ModelRenderer(this, 0, 30); + WheelMount1.addBox(0F, 0F, 0F, 14, 4, 4); + WheelMount1.setRotationPoint(-7F, 4F, 2F); + WheelMount1.setTextureSize(64, 32); + WheelMount1.mirror = true; + setRotation(WheelMount1, 0F, 0F, 0F); + Wheel2 = new ModelRenderer(this, 36, 20); + Wheel2.addBox(0F, 0F, 0F, 5, 4, 2); + Wheel2.setRotationPoint(1F, 6F, -1F); + Wheel2.setTextureSize(64, 32); + Wheel2.mirror = true; + setRotation(Wheel2, 0F, 0F, 0F); + WheelMount2 = new ModelRenderer(this, 0, 30); + WheelMount2.addBox(0F, 0F, 0F, 14, 4, 4); + WheelMount2.setRotationPoint(-7F, 4F, -6F); + WheelMount2.setTextureSize(64, 32); + WheelMount2.mirror = true; + setRotation(WheelMount2, 0F, 0F, 0F); + Wheel1 = new ModelRenderer(this, 36, 20); + Wheel1.addBox(0F, 0F, 0F, 5, 4, 2); + Wheel1.setRotationPoint(-6F, 6F, -1F); + Wheel1.setTextureSize(64, 32); + Wheel1.mirror = true; + setRotation(Wheel1, 0F, 0F, 0F); + } + + public void render(float scale) + { + RailGuard1.render(scale); + ArmMount.render(scale); + RailGuard2.render(scale); + Base.render(scale); + WheelMount1.render(scale); + Wheel2.render(scale); + WheelMount2.render(scale); + Wheel1.render(scale); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/src/minecraft/assemblyline/client/model/ModelLaserDrill.java b/src/minecraft/assemblyline/client/model/ModelLaserDrill.java index e7ee42133..df3de8cf5 100644 --- a/src/minecraft/assemblyline/client/model/ModelLaserDrill.java +++ b/src/minecraft/assemblyline/client/model/ModelLaserDrill.java @@ -6,32 +6,32 @@ import net.minecraft.client.model.ModelRenderer; public class ModelLaserDrill extends ModelBase { // fields - ModelRenderer Spitze; + ModelRenderer Tip; ModelRenderer Upper_plating; ModelRenderer Middle_plating; ModelRenderer Shape3_1; ModelRenderer Shape3_2; ModelRenderer Shape3_3; ModelRenderer Shape3_4; - ModelRenderer lower_plating; - ModelRenderer lower_plating_2; - ModelRenderer Hubbel_1; - ModelRenderer Hubbel_2; - ModelRenderer Hubbel_3; - ModelRenderer Hubbel_4; - ModelRenderer Querbatzen; + ModelRenderer LowerPlating_1; + ModelRenderer LowerPlating_2; + ModelRenderer Bump_1; + ModelRenderer Bump_2; + ModelRenderer Bump_3; + ModelRenderer Bump_4; + ModelRenderer Cross; public ModelLaserDrill() { textureWidth = 64; textureHeight = 32; - Spitze = new ModelRenderer(this, 0, 8); - Spitze.addBox(-1F, 0F, -1F, 2, 16, 2); - Spitze.setRotationPoint(0F, 8F, 0F); - Spitze.setTextureSize(64, 32); - Spitze.mirror = true; - setRotation(Spitze, 0F, 0F, 0F); + Tip = new ModelRenderer(this, 0, 8); + Tip.addBox(-1F, 0F, -1F, 2, 16, 2); + Tip.setRotationPoint(0F, 8F, 0F); + Tip.setTextureSize(64, 32); + Tip.mirror = true; + setRotation(Tip, 0F, 0F, 0F); Upper_plating = new ModelRenderer(this, 0, 0); Upper_plating.addBox(-2F, 0F, -2F, 4, 1, 4); Upper_plating.setRotationPoint(0F, 11F, 0F); @@ -68,66 +68,66 @@ public class ModelLaserDrill extends ModelBase Shape3_4.setTextureSize(64, 32); Shape3_4.mirror = true; setRotation(Shape3_4, 0F, 0F, 0F); - lower_plating = new ModelRenderer(this, 40, 0); - lower_plating.addBox(-2F, 0F, -2F, 4, 1, 4); - lower_plating.setRotationPoint(0F, 18F, 0F); - lower_plating.setTextureSize(64, 32); - lower_plating.mirror = true; - setRotation(lower_plating, 0F, 0F, 0F); - lower_plating_2 = new ModelRenderer(this, 40, 0); - lower_plating_2.addBox(-2F, 0F, -2F, 4, 1, 4); - lower_plating_2.setRotationPoint(0F, 20F, 0F); - lower_plating_2.setTextureSize(64, 32); - lower_plating_2.mirror = true; - setRotation(lower_plating_2, 0F, 0F, 0F); - Hubbel_1 = new ModelRenderer(this, 56, 0); - Hubbel_1.addBox(-0.5F, -0.5F, -0.5F, 1, 4, 1); - Hubbel_1.setRotationPoint(0F, 12F, 3F); - Hubbel_1.setTextureSize(64, 32); - Hubbel_1.mirror = true; - setRotation(Hubbel_1, 0F, 0.7853982F, 0F); - Hubbel_2 = new ModelRenderer(this, 56, 0); - Hubbel_2.addBox(-0.5F, -0.5F, -0.5F, 1, 4, 1); - Hubbel_2.setRotationPoint(3F, 12F, 0F); - Hubbel_2.setTextureSize(64, 32); - Hubbel_2.mirror = true; - setRotation(Hubbel_2, 0F, 0.7853982F, 0F); - Hubbel_3 = new ModelRenderer(this, 56, 0); - Hubbel_3.addBox(-0.5F, -0.5F, -0.5F, 1, 4, 1); - Hubbel_3.setRotationPoint(0F, 12F, -3F); - Hubbel_3.setTextureSize(64, 32); - Hubbel_3.mirror = true; - setRotation(Hubbel_3, 0F, 0.7853982F, 0F); - Hubbel_4 = new ModelRenderer(this, 56, 0); - Hubbel_4.addBox(-0.5F, -0.5F, -0.5F, 1, 4, 1); - Hubbel_4.setRotationPoint(-3F, 12F, 0F); - Hubbel_4.setTextureSize(64, 32); - Hubbel_4.mirror = true; - setRotation(Hubbel_4, 0F, 0.7853982F, 0F); - Querbatzen = new ModelRenderer(this, 14, 8); - Querbatzen.addBox(-0.5F, -0.5F, -0.5F, 3, 1, 3); - Querbatzen.setRotationPoint(-1.5F, 11F, 0F); - Querbatzen.setTextureSize(64, 32); - Querbatzen.mirror = true; - setRotation(Querbatzen, 0F, 0.7853982F, 0F); + LowerPlating_1 = new ModelRenderer(this, 40, 0); + LowerPlating_1.addBox(-2F, 0F, -2F, 4, 1, 4); + LowerPlating_1.setRotationPoint(0F, 18F, 0F); + LowerPlating_1.setTextureSize(64, 32); + LowerPlating_1.mirror = true; + setRotation(LowerPlating_1, 0F, 0F, 0F); + LowerPlating_2 = new ModelRenderer(this, 40, 0); + LowerPlating_2.addBox(-2F, 0F, -2F, 4, 1, 4); + LowerPlating_2.setRotationPoint(0F, 20F, 0F); + LowerPlating_2.setTextureSize(64, 32); + LowerPlating_2.mirror = true; + setRotation(LowerPlating_2, 0F, 0F, 0F); + Bump_1 = new ModelRenderer(this, 56, 0); + Bump_1.addBox(-0.5F, -0.5F, -0.5F, 1, 4, 1); + Bump_1.setRotationPoint(0F, 12F, 3F); + Bump_1.setTextureSize(64, 32); + Bump_1.mirror = true; + setRotation(Bump_1, 0F, 0.7853982F, 0F); + Bump_2 = new ModelRenderer(this, 56, 0); + Bump_2.addBox(-0.5F, -0.5F, -0.5F, 1, 4, 1); + Bump_2.setRotationPoint(3F, 12F, 0F); + Bump_2.setTextureSize(64, 32); + Bump_2.mirror = true; + setRotation(Bump_2, 0F, 0.7853982F, 0F); + Bump_3 = new ModelRenderer(this, 56, 0); + Bump_3.addBox(-0.5F, -0.5F, -0.5F, 1, 4, 1); + Bump_3.setRotationPoint(0F, 12F, -3F); + Bump_3.setTextureSize(64, 32); + Bump_3.mirror = true; + setRotation(Bump_3, 0F, 0.7853982F, 0F); + Bump_4 = new ModelRenderer(this, 56, 0); + Bump_4.addBox(-0.5F, -0.5F, -0.5F, 1, 4, 1); + Bump_4.setRotationPoint(-3F, 12F, 0F); + Bump_4.setTextureSize(64, 32); + Bump_4.mirror = true; + setRotation(Bump_4, 0F, 0.7853982F, 0F); + Cross = new ModelRenderer(this, 14, 8); + Cross.addBox(-0.5F, -0.5F, -0.5F, 3, 1, 3); + Cross.setRotationPoint(-1.5F, 11F, 0F); + Cross.setTextureSize(64, 32); + Cross.mirror = true; + setRotation(Cross, 0F, 0.7853982F, 0F); } public void render(float rotation, float f5) { - Spitze.render(f5); + Tip.render(f5); Upper_plating.render(f5); Middle_plating.render(f5); Shape3_1.render(f5); Shape3_2.render(f5); Shape3_3.render(f5); Shape3_4.render(f5); - lower_plating.render(f5); - lower_plating_2.render(f5); - Hubbel_1.render(f5); - Hubbel_2.render(f5); - Hubbel_3.render(f5); - Hubbel_4.render(f5); - Querbatzen.render(f5); + LowerPlating_1.render(f5); + LowerPlating_2.render(f5); + Bump_1.render(f5); + Bump_2.render(f5); + Bump_3.render(f5); + Bump_4.render(f5); + Cross.render(f5); } private void setRotation(ModelRenderer model, float x, float y, float z) diff --git a/src/minecraft/assemblyline/common/AssemblyLine.java b/src/minecraft/assemblyline/common/AssemblyLine.java index 8a4d2fab9..1177b0682 100644 --- a/src/minecraft/assemblyline/common/AssemblyLine.java +++ b/src/minecraft/assemblyline/common/AssemblyLine.java @@ -1,5 +1,7 @@ package assemblyline.common; +import ic2.api.Ic2Recipes; + import java.io.File; import java.util.logging.Logger; @@ -93,8 +95,9 @@ public class AssemblyLine public static Logger FMLog = Logger.getLogger(AssemblyLine.NAME); - // TODO: MAKE THIS FALSE EVERY BUILD! - public static final boolean DEBUG_MODE = false; + //TODO: MAKE THIS FALSE EVERY BUILD! + public static final boolean DEBUG = false; + public static boolean REQUIRE_NO_POWER = false; @PreInit public void preInit(FMLPreInitializationEvent event) @@ -119,6 +122,8 @@ public class AssemblyLine itemImprint = new ItemImprinter(CONFIGURATION.getItem("Imprint", ITEM_ID_PREFIX).getInt()); itemDisk = new ItemDisk(CONFIGURATION.getItem("Disk", ITEM_ID_PREFIX + 1).getInt()); + + REQUIRE_NO_POWER = DEBUG || !CONFIGURATION.get("general", "requirePower", true).getBoolean(true); CONFIGURATION.save(); NetworkRegistry.instance().registerGuiHandler(this, this.proxy); @@ -149,46 +154,105 @@ public class AssemblyLine FMLog.info("Loaded: " + TranslationHelper.loadLanguages(LANGUAGE_PATH, LANGUAGES_SUPPORTED) + " languages."); // Crane Controller - //GameRegistry.addRecipe(new ShapedOreRecipe(blockCraneController, new Object[] { "SFS", "MCM", "SMS", 'F', blockCraneFrame, 'S', "plateSteel", 'C', "advancedCircuit", 'I', "ingotSteel", 'M', "motor" })); + // GameRegistry.addRecipe(new ShapedOreRecipe(blockCraneController, new Object[] { "SFS", + // "MCM", "SMS", 'F', blockCraneFrame, 'S', "plateSteel", 'C', "advancedCircuit", 'I', + // "ingotSteel", 'M', "motor" })); // Crane Frame - //GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockCraneFrame, 4), new Object[] { "ISI", "ISI", 'I', Item.ingotIron, 'S', Item.stick })); - //GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockCraneFrame, 4), new Object[] { "ISI", "ISI", 'I', "ingotBronze", 'S', Item.stick })); + // GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockCraneFrame, 4), new + // Object[] { "ISI", "ISI", 'I', Item.ingotIron, 'S', Item.stick })); + // GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockCraneFrame, 4), new + // Object[] { "ISI", "ISI", 'I', "ingotBronze", 'S', Item.stick })); + boolean ic2 = Loader.isModLoaded("IC2"); + boolean ue = Loader.isModLoaded("BasicComponents"); + + createStandardRecipes(); + if (ic2) + { + createIC2Recipes(); + } + if (ue) + { + createUERecipes(); + } + if (!ic2 && !ue) + { + createVanillaRecipes(); + REQUIRE_NO_POWER = true; + } + } + + private void createVanillaRecipes() + { + // Armbot + GameRegistry.addRecipe(new ShapedOreRecipe(blockArmbot, new Object[] { "II ", "SIS", "MCM", 'S', "ingotIron", 'C', Item.redstoneRepeater, 'I', "ingotIron", 'M', Block.pistonBase })); + // Disk + GameRegistry.addRecipe(new ShapedOreRecipe(itemDisk, new Object[] { "III", "ICI", "III", 'I', itemImprint, 'C', Item.redstoneRepeater })); + // Encoder + GameRegistry.addRecipe(new ShapedOreRecipe(blockEncoder, new Object[] { "SIS", "SCS", "SSS", 'I', itemImprint, 'S', "ingotIron", 'C', Item.redstoneRepeater })); + // Detector + GameRegistry.addRecipe(new ShapedOreRecipe(blockDetector, new Object[] { "SES", "SCS", "SPS", 'S', "ingotIron", 'C', Block.torchRedstoneActive, 'E', Item.eyeOfEnder })); + // Conveyor Belt + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockConveyorBelt, 10), new Object[] { "III", "WMW", 'I', "ingotIron", 'W', Block.wood, 'M', Block.pistonBase })); + // Rejector + GameRegistry.addRecipe(new ShapedOreRecipe(blockRejector, new Object[] { "WPW", "@R@", '@', "ingotIron", 'R', Item.redstone, 'P', Block.pistonBase, 'C', Block.torchRedstoneActive, 'W', Item.redstone })); + // Turntable + GameRegistry.addRecipe(new ShapedOreRecipe(blockTurntable, new Object[] { "P", "P", 'P', Block.pistonBase })); + // Manipulator + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(blockManipulator, 2), new Object[] { Block.dispenser, Block.torchRedstoneActive })); + } + + private void createUERecipes() + { // Armbot GameRegistry.addRecipe(new ShapedOreRecipe(blockArmbot, new Object[] { "II ", "SIS", "MCM", 'S', "plateSteel", 'C', "advancedCircuit", 'I', "ingotSteel", 'M', "motor" })); - // Disk GameRegistry.addRecipe(new ShapedOreRecipe(itemDisk, new Object[] { "III", "ICI", "III", 'I', itemImprint, 'C', "advancedCircuit" })); - // Encoder GameRegistry.addRecipe(new ShapedOreRecipe(blockEncoder, new Object[] { "SIS", "SCS", "SSS", 'I', itemImprint, 'S', "ingotSteel", 'C', "advancedCircuit" })); - - // Imprint - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemImprint, 2), new Object[] { "R", "P", "I", 'P', Item.paper, 'R', Item.redstone, 'I', new ItemStack(Item.dyePowder, 1, 0) })); - - // Imprinter (VANILLA) - GameRegistry.addRecipe(new ShapedOreRecipe(blockImprinter, new Object[] { "SIS", "SPS", "WCW", 'S', Item.ingotIron, 'C', Block.chest, 'W', Block.workbench, 'P', Block.pistonBase, 'I', new ItemStack(Item.dyePowder, 1, 0) })); - // Detector GameRegistry.addRecipe(new ShapedOreRecipe(blockDetector, new Object[] { "SES", "SCS", "SPS", 'S', "ingotSteel", 'C', "basicCircuit", 'E', Item.eyeOfEnder })); + // Conveyor Belt + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockConveyorBelt, 10), new Object[] { "III", "WMW", 'I', "ingotSteel", 'W', Block.wood, 'M', "motor" })); + // Rejector + GameRegistry.addRecipe(new ShapedOreRecipe(blockRejector, new Object[] { "WPW", "@R@", '@', "ingotSteel", 'R', Item.redstone, 'P', Block.pistonBase, 'C', "basicCircuit", 'W', "copperWire" })); + // Turntable + GameRegistry.addRecipe(new ShapedOreRecipe(blockTurntable, new Object[] { "M", "P", 'M', "motor", 'P', Block.pistonBase })); + // Manipulator + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(blockManipulator, 2), new Object[] { Block.dispenser, "basicCircuit" })); + } - // Crate (VANILLA) + private void createIC2Recipes() + { + // Armbot + Ic2Recipes.addCraftingRecipe(new ItemStack(blockArmbot, 1), new Object[] { "II ", "SIS", "MCM", 'S', "advancedAlloy", 'C', "electronicCircuit", 'I', "ingotRefinedIron", 'M', "generator" }); + // Disk + Ic2Recipes.addCraftingRecipe(new ItemStack(itemDisk, 1), new Object[] { "III", "ICI", "III", 'I', itemImprint, 'C', "advancedCircuit" }); + // Encoder + Ic2Recipes.addCraftingRecipe(new ItemStack(blockEncoder, 1), new Object[] { "SIS", "SCS", "SSS", 'I', itemImprint, 'S', "ingotRefinedIron", 'C', "advancedCircuit" }); + // Detector + Ic2Recipes.addCraftingRecipe(new ItemStack(blockDetector, 1), new Object[] { "SES", "SCS", "SPS", 'S', "ingotRefinedIron", 'C', "electronicCircuit", 'E', Item.eyeOfEnder }); + // Conveyor Belt + Ic2Recipes.addCraftingRecipe(new ItemStack(blockConveyorBelt, 10), new Object[] { "III", "WMW", 'I', "ingotRefinedIron", 'W', Block.wood, 'M', "generator" }); + // Rejector + Ic2Recipes.addCraftingRecipe(new ItemStack(blockRejector, 1), new Object[] { "WPW", "@R@", '@', "ingotRefinedIron", 'R', Item.redstone, 'P', Block.pistonBase, 'C', "electronicCircuit", 'W', "insulatedCopperCableItem" }); + // Turntable + Ic2Recipes.addCraftingRecipe(new ItemStack(blockTurntable, 1), new Object[] { "M", "P", 'M', "generator", 'P', Block.pistonBase }); + // Manipulator + Ic2Recipes.addCraftingRecipe(new ItemStack(blockManipulator, 2), new Object[] { Block.dispenser, "electronicCircuit" }); + } + + private void createStandardRecipes() + { + // Imprint + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemImprint, 2), new Object[] { "R", "P", "I", 'P', Item.paper, 'R', Item.redstone, 'I', new ItemStack(Item.dyePowder, 1, 0) })); + // Imprinter + GameRegistry.addRecipe(new ShapedOreRecipe(blockImprinter, new Object[] { "SIS", "SPS", "WCW", 'S', Item.ingotIron, 'C', Block.chest, 'W', Block.workbench, 'P', Block.pistonBase, 'I', new ItemStack(Item.dyePowder, 1, 0) })); + // Crate GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockCrate, 1, 0), new Object[] { "TST", "S S", "TST", 'S', Item.ingotIron, 'T', Block.wood })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockCrate, 1, 1), new Object[] { "TST", "SCS", "TST", 'C', new ItemStack(blockCrate, 1, 0), 'S', Item.ingotIron, 'T', Block.wood })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockCrate, 1, 2), new Object[] { "TST", "SCS", "TST", 'C', new ItemStack(blockCrate, 1, 1), 'S', Item.ingotIron, 'T', Block.wood })); - - // Conveyor Belt - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockConveyorBelt, 10), new Object[] { "III", "WMW", 'I', "ingotSteel", 'W', Block.wood, 'M', "motor" })); - - // Rejector - GameRegistry.addRecipe(new ShapedOreRecipe(blockRejector, new Object[] { "WPW", "@R@", '@', "ingotSteel", 'R', Item.redstone, 'P', Block.pistonBase, 'C', "basicCircuit", 'W', "copperWire" })); - - // Turntable - GameRegistry.addRecipe(new ShapedOreRecipe(blockTurntable, new Object[] { "M", "P", 'M', "motor", 'P', Block.pistonBase })); - - // Manipulator - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(blockManipulator, 2), new Object[] { Block.dispenser, "basicCircuit" })); } public static void printSidedData(String data) diff --git a/src/minecraft/assemblyline/common/CommonProxy.java b/src/minecraft/assemblyline/common/CommonProxy.java index 3ce520ce0..1e62a4987 100644 --- a/src/minecraft/assemblyline/common/CommonProxy.java +++ b/src/minecraft/assemblyline/common/CommonProxy.java @@ -1,5 +1,7 @@ package assemblyline.common; +import ic2.api.Items; + import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; @@ -117,15 +119,18 @@ public class CommonProxy implements IGuiHandler public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { TileEntity tileEntity = world.getBlockTileEntity(x, y, z); - - switch (ID) + + if (tileEntity != null) { - case GUI_IMPRINTER: - return new ContainerImprinter(player.inventory, (TileEntityImprinter) tileEntity); - case GUI_ENCODER: + switch (ID) { - if (tileEntity != null && tileEntity instanceof TileEntityEncoder) - return new ContainerEncoder(player.inventory, (TileEntityEncoder) tileEntity); + case GUI_IMPRINTER: + return new ContainerImprinter(player.inventory, (TileEntityImprinter) tileEntity); + case GUI_ENCODER: + { + if (tileEntity != null && tileEntity instanceof TileEntityEncoder) + return new ContainerEncoder(player.inventory, (TileEntityEncoder) tileEntity); + } } } @@ -149,6 +154,6 @@ public class CommonProxy implements IGuiHandler { return false; } - return player.getCurrentEquippedItem().getItem() instanceof IToolWrench; + return player.getCurrentEquippedItem().getItem() instanceof IToolWrench || (Items.getItem("wrench") != null && player.getCurrentEquippedItem().isItemEqual(Items.getItem("wrench"))); } } diff --git a/src/minecraft/assemblyline/common/machine/TileEntityAssemblyNetwork.java b/src/minecraft/assemblyline/common/machine/TileEntityAssemblyNetwork.java index f593b467c..6b4b58fbb 100644 --- a/src/minecraft/assemblyline/common/machine/TileEntityAssemblyNetwork.java +++ b/src/minecraft/assemblyline/common/machine/TileEntityAssemblyNetwork.java @@ -23,7 +23,7 @@ public abstract class TileEntityAssemblyNetwork extends TIC2Runnable public boolean isRunning() { - return AssemblyLine.DEBUG_MODE || this.powerTransferRange > 0 || this.wattsReceived > this.getRequest().getWatts(); + return AssemblyLine.REQUIRE_NO_POWER || this.powerTransferRange > 0 || this.wattsReceived > this.getRequest().getWatts(); } public void updatePowerTransferRange() diff --git a/src/minecraft/assemblyline/common/machine/imprinter/TileEntityImprinter.java b/src/minecraft/assemblyline/common/machine/imprinter/TileEntityImprinter.java index 5517a013b..be8ea8bc4 100644 --- a/src/minecraft/assemblyline/common/machine/imprinter/TileEntityImprinter.java +++ b/src/minecraft/assemblyline/common/machine/imprinter/TileEntityImprinter.java @@ -206,6 +206,8 @@ public class TileEntityImprinter extends TileEntityAdvanced implements ISidedInv @Override public boolean isUseableByPlayer(EntityPlayer player) { + if (this.worldObj.getBlockTileEntity(xCoord, yCoord, zCoord) != this) + return false; return true; }