diff --git a/src/minecraft/dark/api/al/coding/ILogicTask.java b/src/minecraft/dark/api/al/coding/ILogicTask.java index 8e6f7da6b..66dc4690b 100644 --- a/src/minecraft/dark/api/al/coding/ILogicTask.java +++ b/src/minecraft/dark/api/al/coding/ILogicTask.java @@ -8,7 +8,7 @@ import universalelectricity.core.vector.Vector2; * the entry point, and exit points. As well handle anything in between. Examples are IF statements * and loops. Do your logic in the refresh method as it should be called each time a new task is * selected. - * + * * @author DarkGuardsman */ public interface ILogicTask extends ITask { diff --git a/src/minecraft/dark/api/al/coding/IProgram.java b/src/minecraft/dark/api/al/coding/IProgram.java index 7862dcea7..a41e89aa8 100644 --- a/src/minecraft/dark/api/al/coding/IProgram.java +++ b/src/minecraft/dark/api/al/coding/IProgram.java @@ -8,7 +8,7 @@ import universalelectricity.core.vector.Vector2; /** Flow chart style program. Each command in the program needs to have a stored location so it can * be saved and loaded with its correct connections. Though the location only need to be a simple * Column and row based system. - * + * * @author DarkGuardsman */ public interface IProgram extends Cloneable { diff --git a/src/minecraft/dark/api/al/coding/ITask.java b/src/minecraft/dark/api/al/coding/ITask.java index f8d5f763e..ece4861be 100644 --- a/src/minecraft/dark/api/al/coding/ITask.java +++ b/src/minecraft/dark/api/al/coding/ITask.java @@ -4,7 +4,6 @@ import java.util.HashMap; import java.util.List; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; import universalelectricity.core.vector.Vector2; import dark.api.al.coding.args.ArgumentData; diff --git a/src/minecraft/dark/api/al/coding/args/ArgumentDoubleData.java b/src/minecraft/dark/api/al/coding/args/ArgumentDoubleData.java index 2b69fd9b8..637bb945a 100644 --- a/src/minecraft/dark/api/al/coding/args/ArgumentDoubleData.java +++ b/src/minecraft/dark/api/al/coding/args/ArgumentDoubleData.java @@ -2,7 +2,7 @@ package dark.api.al.coding.args; /** Used to create argument data for the encoder. Should only be used if the value needs to be * clearly limited inside the encoder display. - * + * * @author DarkGuardsman */ public class ArgumentDoubleData extends ArgumentData { diff --git a/src/minecraft/dark/api/al/coding/args/ArgumentFloatData.java b/src/minecraft/dark/api/al/coding/args/ArgumentFloatData.java index 0ecb07bc6..c9eb360a2 100644 --- a/src/minecraft/dark/api/al/coding/args/ArgumentFloatData.java +++ b/src/minecraft/dark/api/al/coding/args/ArgumentFloatData.java @@ -2,7 +2,7 @@ package dark.api.al.coding.args; /** Used to create argument data for the encoder. Should only be used if the value needs to be * clearly limited inside the encoder display. - * + * * @author DarkGuardsman */ public class ArgumentFloatData extends ArgumentData { diff --git a/src/minecraft/dark/api/al/coding/args/ArgumentIntData.java b/src/minecraft/dark/api/al/coding/args/ArgumentIntData.java index 4ba53bf3b..800fd557e 100644 --- a/src/minecraft/dark/api/al/coding/args/ArgumentIntData.java +++ b/src/minecraft/dark/api/al/coding/args/ArgumentIntData.java @@ -2,7 +2,7 @@ package dark.api.al.coding.args; /** Used to create argument data for the encoder. Should only be used if the value needs to be * clearly limited inside the encoder display. - * + * * @author DarkGuardsman */ public class ArgumentIntData extends ArgumentData { diff --git a/src/minecraft/dark/assembly/client/gui/GuiEncoderBase.java b/src/minecraft/dark/assembly/client/gui/GuiEncoderBase.java index 120445d47..411185b30 100644 --- a/src/minecraft/dark/assembly/client/gui/GuiEncoderBase.java +++ b/src/minecraft/dark/assembly/client/gui/GuiEncoderBase.java @@ -8,13 +8,13 @@ import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; -import calclavia.lib.gui.GuiBase; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import dark.assembly.common.AssemblyLine; import dark.assembly.common.CommonProxy; import dark.assembly.common.machine.encoder.TileEntityEncoder; +import dark.core.prefab.invgui.GuiBase; import dark.core.prefab.invgui.GuiButtonImage; /** A base class for all ICBM Sentry GUIs. @@ -33,7 +33,7 @@ public abstract class GuiEncoderBase extends GuiBase { this.tileEntity = tileEntity; this.entityPlayer = player; - this.ySize = 380 / 2; + this.guiSize.y = 380 / 2; } @Override @@ -42,11 +42,11 @@ public abstract class GuiEncoderBase extends GuiBase super.initGui(); this.buttonList.clear(); // Inventory - this.buttonList.add(new GuiButtonImage(0, (this.width - this.xSize) / 2 - 22, (this.height - this.ySize) / 2 + 0, 3)); + this.buttonList.add(new GuiButtonImage(0, (this.width - this.guiSize.intX()) / 2 - 22, (this.height - this.guiSize.intY()) / 2 + 0, 3)); // Coding - this.buttonList.add(new GuiButtonImage(1, (this.width - this.xSize) / 2 - 22, (this.height - this.ySize) / 2 + 22, 0)); + this.buttonList.add(new GuiButtonImage(1, (this.width - this.guiSize.intX()) / 2 - 22, (this.height - this.guiSize.intY()) / 2 + 22, 0)); // Help - this.buttonList.add(new GuiButtonImage(2, (this.width - this.xSize) / 2 - 22, (this.height - this.ySize) / 2 + 44, 2)); + this.buttonList.add(new GuiButtonImage(2, (this.width - this.guiSize.intX()) / 2 - 22, (this.height - this.guiSize.intY()) / 2 + 44, 2)); } @@ -77,19 +77,19 @@ public abstract class GuiEncoderBase extends GuiBase @Override protected void drawForegroundLayer(int x, int y, float var1) { - this.fontRenderer.drawString("\u00a77" + "Encoder", (int) (this.xSize / 2 - 7 * 2.5), 4, 4210752); + this.fontRenderer.drawString("\u00a77" + "Encoder", (int) (this.guiSize.intX() / 2 - 7 * 2.5), 4, 4210752); /** Render Tool Tips */ if (((GuiButtonImage) this.buttonList.get(0)).isIntersect(x, y)) { - this.drawTooltip(x - this.guiLeft, y - this.guiTop + 10, "Inventory"); + this.drawTooltip(x - this.guiTopLeftCorner.intX(), y - this.guiTopLeftCorner.intY() + 10, "Inventory"); } else if (((GuiButtonImage) this.buttonList.get(1)).isIntersect(x, y)) { - this.drawTooltip(x - this.guiLeft, y - this.guiTop + 10, "Coder"); + this.drawTooltip(x - this.guiTopLeftCorner.intX(), y - this.guiTopLeftCorner.intY() + 10, "Coder"); } else if (((GuiButtonImage) this.buttonList.get(2)).isIntersect(x, y)) { - this.drawTooltip(x - this.guiLeft, y - this.guiTop + 10, "Help"); + this.drawTooltip(x - this.guiTopLeftCorner.intX(), y - this.guiTopLeftCorner.intY() + 10, "Help"); } } @@ -101,9 +101,9 @@ public abstract class GuiEncoderBase extends GuiBase GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - int containerWidth = (this.width - this.xSize) / 2; - int containerHeight = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(containerWidth, containerHeight, 0, 0, this.xSize, this.ySize); + int containerWidth = (this.width - this.guiSize.intX()) / 2; + int containerHeight = (this.height - this.guiSize.intY()) / 2; + this.drawTexturedModalRect(containerWidth, containerHeight, 0, 0, this.guiSize.intX(), this.guiSize.intY()); } @Override @@ -139,9 +139,9 @@ public abstract class GuiEncoderBase extends GuiBase var9 += 2 + (toolTips.length - 1) * 10; } - if (this.guiTop + var7 + var9 + 6 > this.height) + if (this.guiTopLeftCorner.intY() + var7 + var9 + 6 > this.height) { - var7 = this.height - var9 - this.guiTop - 6; + var7 = this.height - var9 - this.guiTopLeftCorner.intY() - 6; } this.zLevel = 300.0F; diff --git a/src/minecraft/dark/assembly/client/gui/GuiEncoderCoder.java b/src/minecraft/dark/assembly/client/gui/GuiEncoderCoder.java index c8d4929e8..6922e98ad 100644 --- a/src/minecraft/dark/assembly/client/gui/GuiEncoderCoder.java +++ b/src/minecraft/dark/assembly/client/gui/GuiEncoderCoder.java @@ -1,13 +1,13 @@ package dark.assembly.client.gui; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ResourceLocation; + import org.lwjgl.opengl.GL11; import cpw.mods.fml.client.FMLClientHandler; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.ResourceLocation; import dark.assembly.common.AssemblyLine; import dark.assembly.common.machine.encoder.TileEntityEncoder; -import dark.core.prefab.invgui.GuiButtonImage; public class GuiEncoderCoder extends GuiEncoderBase { @@ -31,10 +31,10 @@ public class GuiEncoderCoder extends GuiEncoderBase GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - int containerWidth = (this.width - this.xSize) / 2; - int containerHeight = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(containerWidth, containerHeight, 0, 0, this.xSize, this.ySize); - taskListGui.drawConsole(this.mc, (this.width - this.xSize) / 2 + 15, (this.height - this.ySize) / 2 + 20); + int containerWidth = (this.width - this.guiSize.intX()) / 2; + int containerHeight = (this.height - this.guiSize.intY()) / 2; + this.drawTexturedModalRect(containerWidth, containerHeight, 0, 0, this.guiSize.intX(), this.guiSize.intY()); + taskListGui.drawConsole(this.mc, (this.width - this.guiSize.intX()) / 2 + 15, (this.height - this.guiSize.intY()) / 2 + 20); } } diff --git a/src/minecraft/dark/assembly/client/gui/GuiEncoderContainer.java b/src/minecraft/dark/assembly/client/gui/GuiEncoderContainer.java index e50820b53..f359bc8c0 100644 --- a/src/minecraft/dark/assembly/client/gui/GuiEncoderContainer.java +++ b/src/minecraft/dark/assembly/client/gui/GuiEncoderContainer.java @@ -19,7 +19,6 @@ import dark.assembly.common.machine.encoder.ContainerEncoder; import dark.assembly.common.machine.encoder.TileEntityEncoder; import dark.core.prefab.invgui.GuiButtonImage; - @SideOnly(Side.CLIENT) public abstract class GuiEncoderContainer extends GuiContainer { diff --git a/src/minecraft/dark/assembly/client/gui/GuiEncoderHelp.java b/src/minecraft/dark/assembly/client/gui/GuiEncoderHelp.java index 695e15a6c..5a8eba9b1 100644 --- a/src/minecraft/dark/assembly/client/gui/GuiEncoderHelp.java +++ b/src/minecraft/dark/assembly/client/gui/GuiEncoderHelp.java @@ -19,6 +19,6 @@ public class GuiEncoderHelp extends GuiEncoderBase protected void drawForegroundLayer(int x, int y, float var1) { String out = "Help for using the encoder is currently not ready"; - this.fontRenderer.drawString("\u00a77" + out, (int) (this.xSize / 2 - out.length() * 2.5), 20, 4210752); + this.fontRenderer.drawString("\u00a77" + out, (int) (this.guiSize.intX() / 2 - out.length() * 2.5), 20, 4210752); } } diff --git a/src/minecraft/dark/assembly/client/gui/GuiTask.java b/src/minecraft/dark/assembly/client/gui/GuiTask.java index df67b5078..cb3483fa9 100644 --- a/src/minecraft/dark/assembly/client/gui/GuiTask.java +++ b/src/minecraft/dark/assembly/client/gui/GuiTask.java @@ -12,6 +12,7 @@ import cpw.mods.fml.relauncher.SideOnly; import dark.api.al.coding.IRedirectTask; import dark.api.al.coding.ITask; import dark.core.common.DarkMain; +import dark.core.prefab.ModPrefab; @SideOnly(Side.CLIENT) public class GuiTask extends Gui @@ -53,21 +54,20 @@ public class GuiTask extends Gui switch (task.getType()) { case DATA: - gui_pic = new ResourceLocation(DarkMain.GUI_DIRECTORY + "logic/DATA.png"); + gui_pic = new ResourceLocation(ModPrefab.GUI_DIRECTORY + "logic/DATA.png"); break; case PROCESS: - gui_pic = new ResourceLocation(DarkMain.GUI_DIRECTORY + "logic/PROCESS.png"); + gui_pic = new ResourceLocation(ModPrefab.GUI_DIRECTORY + "logic/PROCESS.png"); break; case DEFINEDPROCESS: - gui_pic = new ResourceLocation(DarkMain.GUI_DIRECTORY + "logic/DEFINEDPROCESS.png"); + gui_pic = new ResourceLocation(ModPrefab.GUI_DIRECTORY + "logic/DEFINEDPROCESS.png"); break; case DECISION: - gui_pic = new ResourceLocation(DarkMain.GUI_DIRECTORY + "logic/IF.png"); + gui_pic = new ResourceLocation(ModPrefab.GUI_DIRECTORY + "logic/IF.png"); break; } } - public void drawTask(Minecraft par1Minecraft, int par2, int par3) { if (this.drawButton) diff --git a/src/minecraft/dark/assembly/client/gui/GuiTaskList.java b/src/minecraft/dark/assembly/client/gui/GuiTaskList.java index e5b21ccc4..b86c117de 100644 --- a/src/minecraft/dark/assembly/client/gui/GuiTaskList.java +++ b/src/minecraft/dark/assembly/client/gui/GuiTaskList.java @@ -25,7 +25,7 @@ import dark.assembly.common.armbot.command.TaskStart; import dark.core.interfaces.IScroll; /** Not a gui itself but a component used to display task as a box inside of a gui - * + * * @author DarkGuardsman */ public class GuiTaskList extends Gui implements IScroll { @@ -271,7 +271,7 @@ public class GuiTaskList extends Gui implements IScroll vv = 128; break; } - FMLClientHandler.instance().getClient().renderEngine.bindTexture(this.TEXTURE_PROCESS); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(GuiTaskList.TEXTURE_PROCESS); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); Vector2 center = new Vector2((x + 35 - (xx / 2)) * sW + (spacingX * j), (y + 25 - (yy / 2)) * sh + (spacingY * i)); this.drawTexturedModalRect(center.intX(), center.intY(), uu, vv, xx, yy); diff --git a/src/minecraft/dark/assembly/client/render/BlockRenderingHandler.java b/src/minecraft/dark/assembly/client/render/BlockRenderingHandler.java index a4c567991..95e24c5b6 100644 --- a/src/minecraft/dark/assembly/client/render/BlockRenderingHandler.java +++ b/src/minecraft/dark/assembly/client/render/BlockRenderingHandler.java @@ -17,6 +17,7 @@ import dark.assembly.client.model.ModelCrusher; import dark.assembly.client.model.ModelGrinder; import dark.assembly.client.model.ModelManipulator; import dark.assembly.client.model.ModelRejectorPiston; +import dark.assembly.common.ALRecipeLoader; import dark.assembly.common.AssemblyLine; import dark.core.prefab.ModPrefab; @@ -34,7 +35,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler @Override public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - if (AssemblyLine.recipeLoader.blockConveyorBelt != null && block.blockID == AssemblyLine.recipeLoader.blockConveyorBelt.blockID) + if (ALRecipeLoader.blockConveyorBelt != null && block.blockID == ALRecipeLoader.blockConveyorBelt.blockID) { GL11.glPushMatrix(); GL11.glTranslatef(0.0F, 1.5F, 0.0F); @@ -43,7 +44,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler modelConveyorBelt.render(0.0625F, 0, false, false, false, false); GL11.glPopMatrix(); } - else if (AssemblyLine.recipeLoader.blockRejector != null && block.blockID == AssemblyLine.recipeLoader.blockRejector.blockID) + else if (ALRecipeLoader.blockRejector != null && block.blockID == ALRecipeLoader.blockRejector.blockID) { FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(AssemblyLine.instance.DOMAIN, ModPrefab.MODEL_DIRECTORY + "rejector.png")); GL11.glPushMatrix(); @@ -54,7 +55,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler modelEjector.renderPiston(0.0625F, 1); GL11.glPopMatrix(); } - else if (AssemblyLine.recipeLoader.blockManipulator != null && block.blockID == AssemblyLine.recipeLoader.blockManipulator.blockID) + else if (ALRecipeLoader.blockManipulator != null && block.blockID == ALRecipeLoader.blockManipulator.blockID) { FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(AssemblyLine.instance.DOMAIN, ModPrefab.MODEL_DIRECTORY + "manipulator1.png")); GL11.glPushMatrix(); @@ -64,7 +65,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler modelInjector.render(0.0625F, true, 0); GL11.glPopMatrix(); } - else if (AssemblyLine.recipeLoader.blockArmbot != null && block.blockID == AssemblyLine.recipeLoader.blockArmbot.blockID) + else if (ALRecipeLoader.blockArmbot != null && block.blockID == ALRecipeLoader.blockArmbot.blockID) { FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(AssemblyLine.instance.DOMAIN, ModPrefab.MODEL_DIRECTORY + RenderArmbot.TEXTURE)); GL11.glPushMatrix(); @@ -75,7 +76,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler RenderArmbot.MODEL.render(0.0625F, 0, 0); GL11.glPopMatrix(); } - else if (AssemblyLine.recipeLoader.processorMachine != null && block.blockID == AssemblyLine.recipeLoader.processorMachine.blockID && metadata == 0) + else if (ALRecipeLoader.processorMachine != null && block.blockID == ALRecipeLoader.processorMachine.blockID && metadata == 0) { FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(AssemblyLine.instance.DOMAIN, ModPrefab.MODEL_DIRECTORY + "CrusherBlock.png")); GL11.glPushMatrix(); @@ -86,7 +87,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler this.modelCrushor.renderPiston(0.0625f, 4); GL11.glPopMatrix(); } - else if (AssemblyLine.recipeLoader.processorMachine != null && block.blockID == AssemblyLine.recipeLoader.processorMachine.blockID && metadata == 4) + else if (ALRecipeLoader.processorMachine != null && block.blockID == ALRecipeLoader.processorMachine.blockID && metadata == 4) { FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(AssemblyLine.instance.DOMAIN, ModPrefab.MODEL_DIRECTORY + "GrinderBlock.png")); GL11.glPushMatrix(); diff --git a/src/minecraft/dark/assembly/common/AssemblyLine.java b/src/minecraft/dark/assembly/common/AssemblyLine.java index 0f523527d..558a33b09 100644 --- a/src/minecraft/dark/assembly/common/AssemblyLine.java +++ b/src/minecraft/dark/assembly/common/AssemblyLine.java @@ -4,7 +4,6 @@ import java.io.File; import java.util.Arrays; import java.util.logging.Logger; -import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraftforge.common.Configuration; @@ -91,8 +90,6 @@ public class AssemblyLine extends ModPrefab public static boolean REQUIRE_NO_POWER = false; public static boolean VINALLA_RECIPES = false; - - @Override @EventHandler public void preInit(FMLPreInitializationEvent event) @@ -117,14 +114,14 @@ public class AssemblyLine extends ModPrefab recipeLoader.loadRecipes(); //GameRegistry.registerBlock(recipeLoader.blockConveyorBelt, "ConveyorBelt"); - GameRegistry.registerBlock(recipeLoader.blockCrate, ItemBlockCrate.class, "Crate"); - GameRegistry.registerBlock(recipeLoader.blockManipulator, "Manipulator"); - GameRegistry.registerBlock(recipeLoader.blockImprinter, "Imprinter"); - GameRegistry.registerBlock(recipeLoader.blockEncoder, "Encoder"); - GameRegistry.registerBlock(recipeLoader.blockDetector, "Detector"); - GameRegistry.registerBlock(recipeLoader.blockRejector, "Rejector"); - GameRegistry.registerBlock(recipeLoader.blockArmbot, "Armbot"); - GameRegistry.registerBlock(recipeLoader.blockTurntable, "Turntable"); + GameRegistry.registerBlock(ALRecipeLoader.blockCrate, ItemBlockCrate.class, "Crate"); + GameRegistry.registerBlock(ALRecipeLoader.blockManipulator, "Manipulator"); + GameRegistry.registerBlock(ALRecipeLoader.blockImprinter, "Imprinter"); + GameRegistry.registerBlock(ALRecipeLoader.blockEncoder, "Encoder"); + GameRegistry.registerBlock(ALRecipeLoader.blockDetector, "Detector"); + GameRegistry.registerBlock(ALRecipeLoader.blockRejector, "Rejector"); + GameRegistry.registerBlock(ALRecipeLoader.blockArmbot, "Armbot"); + GameRegistry.registerBlock(ALRecipeLoader.blockTurntable, "Turntable"); GameRegistry.registerTileEntity(TileEntityConveyorBelt.class, "ALConveyorBelt"); GameRegistry.registerTileEntity(TileEntityRejector.class, "ALSorter"); @@ -135,7 +132,7 @@ public class AssemblyLine extends ModPrefab GameRegistry.registerTileEntity(TileEntityArmbot.class, "ALArmbot"); GameRegistry.registerTileEntity(TileEntityImprinter.class, "ALImprinter"); - DMCreativeTab.tabAutomation.setIconItemStack(new ItemStack(recipeLoader.blockConveyorBelt)); + DMCreativeTab.tabAutomation.setIconItemStack(new ItemStack(ALRecipeLoader.blockConveyorBelt)); } @@ -147,19 +144,19 @@ public class AssemblyLine extends ModPrefab recipeLoader = new ALRecipeLoader(); } CONFIGURATION.load(); - recipeLoader.blockConveyorBelt = ModObjectRegistry.createNewBlock("ALBlockConveyor", AssemblyLine.MOD_ID, BlockConveyorBelt.class); - recipeLoader.blockManipulator = new BlockManipulator(); - recipeLoader.blockCrate = new BlockCrate(); - recipeLoader.blockImprinter = new BlockImprinter(); - recipeLoader.blockDetector = new BlockDetector(); - recipeLoader.blockRejector = new BlockRejector(); - recipeLoader.blockEncoder = new BlockEncoder(); - recipeLoader.blockArmbot = new BlockArmbot(); - recipeLoader.blockTurntable = new BlockTurntable(); - recipeLoader.processorMachine = ModObjectRegistry.createNewBlock("ALBlockProcessor", AssemblyLine.MOD_ID, BlockProcessor.class, ItemBlockHolder.class); + ALRecipeLoader.blockConveyorBelt = ModObjectRegistry.createNewBlock("ALBlockConveyor", AssemblyLine.MOD_ID, BlockConveyorBelt.class); + ALRecipeLoader.blockManipulator = new BlockManipulator(); + ALRecipeLoader.blockCrate = new BlockCrate(); + ALRecipeLoader.blockImprinter = new BlockImprinter(); + ALRecipeLoader.blockDetector = new BlockDetector(); + ALRecipeLoader.blockRejector = new BlockRejector(); + ALRecipeLoader.blockEncoder = new BlockEncoder(); + ALRecipeLoader.blockArmbot = new BlockArmbot(); + ALRecipeLoader.blockTurntable = new BlockTurntable(); + ALRecipeLoader.processorMachine = ModObjectRegistry.createNewBlock("ALBlockProcessor", AssemblyLine.MOD_ID, BlockProcessor.class, ItemBlockHolder.class); - recipeLoader.itemImprint = new ItemImprinter(CONFIGURATION.getItem("Imprint", ITEM_ID_PREFIX).getInt()); - recipeLoader.itemDisk = new ItemDisk(CONFIGURATION.getItem("Disk", ITEM_ID_PREFIX + 1).getInt()); + ALRecipeLoader.itemImprint = new ItemImprinter(CONFIGURATION.getItem("Imprint", ITEM_ID_PREFIX).getInt()); + ALRecipeLoader.itemDisk = new ItemDisk(CONFIGURATION.getItem("Disk", ITEM_ID_PREFIX + 1).getInt()); AssemblyLine.VINALLA_RECIPES = CONFIGURATION.get("general", "Vinalla_Recipes", false).getBoolean(false); diff --git a/src/minecraft/dark/assembly/common/armbot/Program.java b/src/minecraft/dark/assembly/common/armbot/Program.java index d4a242dd0..31161b461 100644 --- a/src/minecraft/dark/assembly/common/armbot/Program.java +++ b/src/minecraft/dark/assembly/common/armbot/Program.java @@ -162,7 +162,7 @@ public class Program implements IProgram } /** Move all tasks at the row and in the direction given. - * + * * @param row - row number or Y value of the position from the task * @param up - true will move all the tasks up one, false will move all the tasks down one */ public void moveAll(int row, boolean up) diff --git a/src/minecraft/dark/assembly/common/armbot/TileEntityArmbot.java b/src/minecraft/dark/assembly/common/armbot/TileEntityArmbot.java index 8e6cce8a4..497e78874 100644 --- a/src/minecraft/dark/assembly/common/armbot/TileEntityArmbot.java +++ b/src/minecraft/dark/assembly/common/armbot/TileEntityArmbot.java @@ -30,7 +30,7 @@ import dan200.computer.api.IPeripheral; import dark.api.al.coding.IArmbot; import dark.api.al.coding.IProgram; import dark.api.al.coding.ProgramHelper; -import dark.assembly.common.AssemblyLine; +import dark.assembly.common.ALRecipeLoader; import dark.assembly.common.machine.TileEntityAssembly; import dark.assembly.common.machine.encoder.ItemDisk; import dark.core.common.DarkMain; @@ -477,7 +477,7 @@ public class TileEntityArmbot extends TileEntityAssembly implements IMultiBlock, @Override public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return itemstack != null && itemstack.itemID == AssemblyLine.recipeLoader.itemDisk.itemID; + return itemstack != null && itemstack.itemID == ALRecipeLoader.itemDisk.itemID; } @Override diff --git a/src/minecraft/dark/assembly/common/armbot/command/TaskGOTO.java b/src/minecraft/dark/assembly/common/armbot/command/TaskGOTO.java index 7d2d68bd4..3a6e3f15c 100644 --- a/src/minecraft/dark/assembly/common/armbot/command/TaskGOTO.java +++ b/src/minecraft/dark/assembly/common/armbot/command/TaskGOTO.java @@ -38,7 +38,7 @@ public class TaskGOTO extends TaskBase implements IRedirectTask public void refresh() { super.refresh(); - if(task == null && taskPos != null) + if (task == null && taskPos != null) { this.task = this.program.getTaskAt(taskPos); } diff --git a/src/minecraft/dark/assembly/common/armbot/command/TaskStart.java b/src/minecraft/dark/assembly/common/armbot/command/TaskStart.java index 5435f95a2..bc03bbae8 100644 --- a/src/minecraft/dark/assembly/common/armbot/command/TaskStart.java +++ b/src/minecraft/dark/assembly/common/armbot/command/TaskStart.java @@ -4,7 +4,7 @@ import dark.assembly.common.armbot.TaskBase; /** Fake task as the player can not create, edit, or do anything with this task. Its only used to * allow the gui to render the task as an actual task instance - * + * * @author DarkGaurdsman */ public class TaskStart extends TaskBase { diff --git a/src/minecraft/dark/assembly/common/imprinter/ContainerImprinter.java b/src/minecraft/dark/assembly/common/imprinter/ContainerImprinter.java index a5873f5d7..0ae4b34b0 100644 --- a/src/minecraft/dark/assembly/common/imprinter/ContainerImprinter.java +++ b/src/minecraft/dark/assembly/common/imprinter/ContainerImprinter.java @@ -5,7 +5,7 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import dark.assembly.common.AssemblyLine; +import dark.assembly.common.ALRecipeLoader; import dark.core.prefab.invgui.ISlotWatcher; import dark.core.prefab.invgui.SlotCraftingResult; import dark.core.prefab.invgui.SlotRestricted; @@ -32,7 +32,7 @@ public class ContainerImprinter extends Container implements ISlotWatcher } // Imprint Input for Imprinting - this.addSlotToContainer(new SlotRestricted(this.tileEntity, TileEntityImprinter.IMPRINTER_MATRIX_START, 68, 34, new ItemStack(AssemblyLine.recipeLoader.itemImprint))); + this.addSlotToContainer(new SlotRestricted(this.tileEntity, TileEntityImprinter.IMPRINTER_MATRIX_START, 68, 34, new ItemStack(ALRecipeLoader.itemImprint))); // Item to be imprinted this.addSlotToContainer(new WatchedSlot(this.tileEntity, TileEntityImprinter.IMPRINTER_MATRIX_START + 1, 92, 34, this)); // Result of Crafting/Imprinting diff --git a/src/minecraft/dark/assembly/common/machine/BlockAssembly.java b/src/minecraft/dark/assembly/common/machine/BlockAssembly.java index 98e95073f..10ca8033c 100644 --- a/src/minecraft/dark/assembly/common/machine/BlockAssembly.java +++ b/src/minecraft/dark/assembly/common/machine/BlockAssembly.java @@ -3,7 +3,6 @@ package dark.assembly.common.machine; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.Icon; import net.minecraft.world.World; import dark.assembly.common.AssemblyLine; import dark.core.common.DMCreativeTab; diff --git a/src/minecraft/dark/assembly/common/machine/BlockCrate.java b/src/minecraft/dark/assembly/common/machine/BlockCrate.java index 4a598a0d1..b24a7cbbc 100644 --- a/src/minecraft/dark/assembly/common/machine/BlockCrate.java +++ b/src/minecraft/dark/assembly/common/machine/BlockCrate.java @@ -21,7 +21,7 @@ import dark.core.registration.ModObjectRegistry.BlockBuildData; /** A block that allows the placement of mass amount of a specific item within it. It will be allowed * to go on Conveyor Belts - * + * * @author DarkGuardsman */ public class BlockCrate extends BlockAssembly { @@ -217,7 +217,7 @@ public class BlockCrate extends BlockAssembly } /** Inserts all items of the same type this player has into the crate. - * + * * @return True on success */ public boolean insertAllItems(TileEntityCrate tileEntity, EntityPlayer player) { @@ -262,7 +262,7 @@ public class BlockCrate extends BlockAssembly } /** Ejects and item out of the crate and spawn it under the player entity. - * + * * @param tileEntity * @param player * @param requestSize - The maximum stack size to take out. Default should be 64. @@ -314,7 +314,7 @@ public class BlockCrate extends BlockAssembly } /** Puts an itemStack into the crate. - * + * * @param tileEntity * @param itemStack */ public static ItemStack addStackToCrate(TileEntityCrate tileEntity, ItemStack itemStack) diff --git a/src/minecraft/dark/assembly/common/machine/BlockTurntable.java b/src/minecraft/dark/assembly/common/machine/BlockTurntable.java index 24813c01b..1e5f04f24 100644 --- a/src/minecraft/dark/assembly/common/machine/BlockTurntable.java +++ b/src/minecraft/dark/assembly/common/machine/BlockTurntable.java @@ -11,7 +11,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Icon; import net.minecraft.util.MathHelper; -import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.ForgeDirection; import universalelectricity.core.vector.Vector3; @@ -112,7 +111,8 @@ public class BlockTurntable extends BlockAssembly else if (Block.blocksList[blockID] instanceof IRotatableBlock) { currentDirection = ((IRotatableBlock) Block.blocksList[blockID]).getDirection(world, position.intX(), position.intY(), position.intZ()); - }else if(Block.blocksList[blockID] != null) + } + else if (Block.blocksList[blockID] != null) { Block.blocksList[blockID].rotateBlock(world, x, y, z, direction.getOpposite()); } diff --git a/src/minecraft/dark/assembly/common/machine/TileEntityDetector.java b/src/minecraft/dark/assembly/common/machine/TileEntityDetector.java index beced173d..8a98f1e00 100644 --- a/src/minecraft/dark/assembly/common/machine/TileEntityDetector.java +++ b/src/minecraft/dark/assembly/common/machine/TileEntityDetector.java @@ -13,7 +13,7 @@ import net.minecraftforge.common.ForgeDirection; import com.google.common.io.ByteArrayDataInput; import cpw.mods.fml.common.network.Player; -import dark.assembly.common.AssemblyLine; +import dark.assembly.common.ALRecipeLoader; import dark.assembly.common.imprinter.prefab.TileEntityFilterable; import dark.core.network.PacketHandler; @@ -66,13 +66,13 @@ public class TileEntityDetector extends TileEntityFilterable if (powerCheck != this.powering) { this.powering = powerCheck; - this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, AssemblyLine.recipeLoader.blockDetector.blockID); - this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord + 1, this.zCoord, AssemblyLine.recipeLoader.blockDetector.blockID); + this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, ALRecipeLoader.blockDetector.blockID); + this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord + 1, this.zCoord, ALRecipeLoader.blockDetector.blockID); for (int x = this.xCoord - 1; x <= this.xCoord + 1; x++) { for (int z = this.zCoord - 1; z <= this.zCoord + 1; z++) { - this.worldObj.notifyBlocksOfNeighborChange(x, this.yCoord + 1, z, AssemblyLine.recipeLoader.blockDetector.blockID); + this.worldObj.notifyBlocksOfNeighborChange(x, this.yCoord + 1, z, ALRecipeLoader.blockDetector.blockID); } } @@ -84,8 +84,8 @@ public class TileEntityDetector extends TileEntityFilterable @Override public void invalidate() { - this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, AssemblyLine.recipeLoader.blockDetector.blockID); - this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord + 1, this.zCoord, AssemblyLine.recipeLoader.blockDetector.blockID); + this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, ALRecipeLoader.blockDetector.blockID); + this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord + 1, this.zCoord, ALRecipeLoader.blockDetector.blockID); super.invalidate(); } diff --git a/src/minecraft/dark/assembly/common/machine/belt/TileEntityConveyorBelt.java b/src/minecraft/dark/assembly/common/machine/belt/TileEntityConveyorBelt.java index cdff227f5..ced211497 100644 --- a/src/minecraft/dark/assembly/common/machine/belt/TileEntityConveyorBelt.java +++ b/src/minecraft/dark/assembly/common/machine/belt/TileEntityConveyorBelt.java @@ -17,7 +17,7 @@ import com.google.common.io.ByteArrayDataInput; import cpw.mods.fml.common.network.Player; import dark.api.al.IBelt; -import dark.assembly.common.AssemblyLine; +import dark.assembly.common.ALRecipeLoader; import dark.assembly.common.machine.TileEntityAssembly; import dark.core.common.DarkMain; import dark.core.network.PacketHandler; @@ -72,7 +72,7 @@ public class TileEntityConveyorBelt extends TileEntityAssembly implements IBelt, } if (this.worldObj.isRemote && this.isFunctioning()) { - if (this.ticks % 10 == 0 && this.worldObj.isRemote && this.worldObj.getBlockId(this.xCoord - 1, this.yCoord, this.zCoord) != AssemblyLine.recipeLoader.blockConveyorBelt.blockID && this.worldObj.getBlockId(xCoord, yCoord, zCoord - 1) != AssemblyLine.recipeLoader.blockConveyorBelt.blockID) + if (this.ticks % 10 == 0 && this.worldObj.isRemote && this.worldObj.getBlockId(this.xCoord - 1, this.yCoord, this.zCoord) != ALRecipeLoader.blockConveyorBelt.blockID && this.worldObj.getBlockId(xCoord, yCoord, zCoord - 1) != ALRecipeLoader.blockConveyorBelt.blockID) { this.worldObj.playSound(this.xCoord, this.yCoord, this.zCoord, "mods.assemblyline.conveyor", 0.5f, 0.7f, true); } diff --git a/src/minecraft/dark/assembly/common/machine/encoder/ContainerEncoder.java b/src/minecraft/dark/assembly/common/machine/encoder/ContainerEncoder.java index c1ef013c4..d7108bb68 100644 --- a/src/minecraft/dark/assembly/common/machine/encoder/ContainerEncoder.java +++ b/src/minecraft/dark/assembly/common/machine/encoder/ContainerEncoder.java @@ -5,7 +5,7 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import dark.assembly.common.AssemblyLine; +import dark.assembly.common.ALRecipeLoader; import dark.core.prefab.invgui.SlotRestricted; public class ContainerEncoder extends Container @@ -20,7 +20,7 @@ public class ContainerEncoder extends Container this.tileEntity = encoder; // Disk - this.addSlotToContainer(new SlotRestricted(encoder, 0, 80, 24 + Y_OFFSET, new ItemStack(AssemblyLine.recipeLoader.itemDisk))); + this.addSlotToContainer(new SlotRestricted(encoder, 0, 80, 24 + Y_OFFSET, new ItemStack(ALRecipeLoader.itemDisk))); int row; diff --git a/src/minecraft/dark/assembly/common/machine/encoder/SlotDisk.java b/src/minecraft/dark/assembly/common/machine/encoder/SlotDisk.java index f9f1daf1d..560bc21c1 100644 --- a/src/minecraft/dark/assembly/common/machine/encoder/SlotDisk.java +++ b/src/minecraft/dark/assembly/common/machine/encoder/SlotDisk.java @@ -3,7 +3,7 @@ package dark.assembly.common.machine.encoder; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import dark.assembly.common.AssemblyLine; +import dark.assembly.common.ALRecipeLoader; public class SlotDisk extends Slot { @@ -16,7 +16,7 @@ public class SlotDisk extends Slot @Override public boolean isItemValid(ItemStack itemStack) { - return itemStack.itemID == AssemblyLine.recipeLoader.itemDisk.itemID; + return itemStack.itemID == ALRecipeLoader.itemDisk.itemID; } }