From bc1df52d11e8e90ac042059f5d50aa608686a0af Mon Sep 17 00:00:00 2001 From: Robert Date: Thu, 19 Dec 2013 23:34:27 -0500 Subject: [PATCH] Assembly line no longer uses the core machine However we now use the core library which will be built into the project. --- src/dark/api/al/AutoCraftEvent.java | 39 ++++ src/dark/assembly/ALRecipeLoader.java | 4 +- src/dark/assembly/AssemblyLine.java | 50 ++--- src/dark/assembly/CommonProxy.java | 4 +- src/dark/assembly/armbot/BlockArmbot.java | 2 +- .../assembly/armbot/TileEntityArmbot.java | 10 +- .../armbot/command/TaskGrabEntity.java | 5 +- src/dark/assembly/client/gui/GuiEditTask.java | 6 +- .../assembly/client/gui/GuiEncoderBase.java | 8 +- .../assembly/client/gui/GuiEncoderCoder.java | 5 +- .../assembly/client/gui/GuiManipulator.java | 6 +- src/dark/assembly/client/gui/GuiTaskList.java | 3 +- .../client/render/RenderProcessor.java | 20 +- .../imprinter/ContainerImprinter.java | 10 +- .../assembly/imprinter/ItemImprinter.java | 7 +- .../imprinter/TileEntityImprinter.java | 10 +- src/dark/assembly/machine/BlockAssembly.java | 9 +- .../assembly/machine/BlockManipulator.java | 2 - src/dark/assembly/machine/InventoryCrate.java | 3 +- .../assembly/machine/NetworkAssembly.java | 10 +- .../assembly/machine/TileEntityAssembly.java | 12 +- .../assembly/machine/TileEntityCrate.java | 8 +- .../assembly/machine/belt/BlockConveyor.java | 5 +- .../machine/belt/BlockConveyorBelt.java | 3 +- .../machine/belt/TileEntityConveyor.java | 13 +- .../machine/belt/TileEntityConveyorBelt.java | 4 - .../machine/encoder/ContainerEncoder.java | 4 +- .../assembly/machine/encoder/ItemDisk.java | 7 +- .../machine/encoder/TileEntityEncoder.java | 12 +- .../assembly/machine/frame/BlockFrame.java | 64 ------ .../machine/frame/NetworkFrameDesign.java | 9 - .../machine/frame/NetworkFrameRail.java | 19 -- .../machine/frame/TileEntityFrame.java | 210 ------------------ .../machine/frame/TileEntityFrameMotor.java | 11 - .../machine/processor/BlockProcessor.java | 6 +- .../machine/processor/ContainerProcessor.java | 4 +- .../processor/TileEntityProcessor.java | 8 +- .../machine/red/BlockAdvancedHopper.java | 6 +- .../assembly/machine/red/BlockPistonPlus.java | 8 +- .../machine/red/TileEntityAdvancedHopper.java | 7 +- .../machine/red/TileEntityPistonPlus.java | 5 +- 41 files changed, 191 insertions(+), 447 deletions(-) create mode 100644 src/dark/api/al/AutoCraftEvent.java delete mode 100644 src/dark/assembly/machine/frame/BlockFrame.java delete mode 100644 src/dark/assembly/machine/frame/NetworkFrameDesign.java delete mode 100644 src/dark/assembly/machine/frame/NetworkFrameRail.java delete mode 100644 src/dark/assembly/machine/frame/TileEntityFrame.java delete mode 100644 src/dark/assembly/machine/frame/TileEntityFrameMotor.java diff --git a/src/dark/api/al/AutoCraftEvent.java b/src/dark/api/al/AutoCraftEvent.java new file mode 100644 index 00000000..c2442ef9 --- /dev/null +++ b/src/dark/api/al/AutoCraftEvent.java @@ -0,0 +1,39 @@ +package dark.api.al; + +import com.dark.helpers.AutoCraftingManager.IAutoCrafter; + +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.event.Cancelable; +import net.minecraftforge.event.Event; +import universalelectricity.core.vector.Vector3; + +/** Events called when an automated crafter is working on crafting an item + * + * @author DarkGuardsman */ +public class AutoCraftEvent extends Event +{ + World world; + Vector3 spot; + IAutoCrafter crafter; + ItemStack craftingResult; + + public AutoCraftEvent(World world, Vector3 spot, IAutoCrafter craft, ItemStack stack) + { + this.world = world; + this.spot = spot; + this.crafter = craft; + this.craftingResult = stack; + } + + @Cancelable + /** Called before a crafter checks if it can craft. Use this to cancel crafting */ + public static class PreCraft extends AutoCraftEvent + { + public PreCraft(World world, Vector3 spot, IAutoCrafter craft, ItemStack stack) + { + super(world, spot, craft, stack); + } + } + +} diff --git a/src/dark/assembly/ALRecipeLoader.java b/src/dark/assembly/ALRecipeLoader.java index 5e7f567d..f2e84684 100644 --- a/src/dark/assembly/ALRecipeLoader.java +++ b/src/dark/assembly/ALRecipeLoader.java @@ -5,10 +5,12 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; + +import com.dark.prefab.RecipeLoader; + import cpw.mods.fml.common.registry.GameRegistry; import dark.assembly.machine.BlockCrate; import dark.assembly.machine.processor.BlockProcessor; -import dark.core.prefab.RecipeLoader; public class ALRecipeLoader extends RecipeLoader { diff --git a/src/dark/assembly/AssemblyLine.java b/src/dark/assembly/AssemblyLine.java index 87869568..286d9222 100644 --- a/src/dark/assembly/AssemblyLine.java +++ b/src/dark/assembly/AssemblyLine.java @@ -6,14 +6,16 @@ import java.util.logging.Logger; import net.minecraft.item.ItemStack; import net.minecraftforge.common.Configuration; +import net.minecraftforge.common.MinecraftForge; import org.modstats.ModstatInfo; +import org.modstats.Modstats; import universalelectricity.prefab.TranslationHelper; -import com.dark.DarkCore; import com.dark.CoreRegistry; -import com.dark.IndustryCreativeTab; +import com.dark.DarkCore; +import com.dark.IndustryTabs; import com.dark.prefab.ItemBlockHolder; import cpw.mods.fml.common.FMLLog; @@ -63,13 +65,11 @@ import dark.assembly.machine.encoder.BlockEncoder; import dark.assembly.machine.encoder.ItemDisk; import dark.assembly.machine.processor.BlockProcessor; import dark.assembly.machine.red.BlockAdvancedHopper; -import dark.core.prefab.ModPrefab; -import dark.machines.DarkMain; @ModstatInfo(prefix = "asmline") -@Mod(modid = AssemblyLine.MOD_ID, name = AssemblyLine.MOD_NAME, version = DarkMain.VERSION, dependencies = "required-after:DarkCore", useMetadata = true) +@Mod(modid = AssemblyLine.MOD_ID, name = AssemblyLine.MOD_NAME, version = AssemblyLine.VERSION, dependencies = "required-after:DarkCore", useMetadata = true) @NetworkMod(clientSideRequired = true, serverSideRequired = false) -public class AssemblyLine extends ModPrefab +public class AssemblyLine { public static final String MAJOR_VERSION = "@MAJOR@"; @@ -81,6 +81,14 @@ public class AssemblyLine extends ModPrefab public static final String MOD_ID = "AssemblyLine"; public static final String MOD_NAME = "Assembly Line"; + public static final String DOMAIN = "al"; + public static final String PREFIX = DOMAIN + ":"; + + public static String DIRECTORY_NO_SLASH = "assets/" + DOMAIN + "/"; + public static String DIRECTORY = "/" + DIRECTORY_NO_SLASH; + public static String LANGUAGE_PATH = DIRECTORY + "languages/"; + public static String SOUND_PATH = DIRECTORY + "audio/"; + @SidedProxy(clientSide = "dark.assembly.client.ClientProxy", serverSide = "dark.assembly.CommonProxy") public static CommonProxy proxy; @@ -102,14 +110,14 @@ public class AssemblyLine extends ModPrefab public static boolean VINALLA_RECIPES = false; - @Override @EventHandler public void preInit(FMLPreInitializationEvent event) { - super.preInit(event); FMLog.setParent(FMLLog.getLogger()); - instance = this; + DarkCore.instance().preLoad(); + Modstats.instance().getReporter().registerMod(this); + MinecraftForge.EVENT_BUS.register(this); NetworkRegistry.instance().registerGuiHandler(this, proxy); proxy.preInit(); @@ -134,28 +142,28 @@ public class AssemblyLine extends ModPrefab TaskRegistry.registerCommand(new TaskIdle()); } - @Override @EventHandler public void init(FMLInitializationEvent event) { - super.init(event); + DarkCore.instance().Load(); + this.registerObjects(); proxy.init(); - FMLog.info("Loaded: " + TranslationHelper.loadLanguages(LANGUAGE_PATH, LANGUAGES_SUPPORTED) + " languages."); - IndustryCreativeTab.tabAutomation().setIconItemStack(new ItemStack(ALRecipeLoader.blockConveyorBelt)); + FMLog.info("Loaded: " + TranslationHelper.loadLanguages(DarkCore.LANGUAGE_PATH, LANGUAGES_SUPPORTED) + " languages."); + IndustryTabs.tabAutomation().setIconItemStack(new ItemStack(ALRecipeLoader.blockConveyorBelt)); } - @Override @EventHandler public void postInit(FMLPostInitializationEvent event) { - super.postInit(event); + DarkCore.instance().postLoad(); proxy.postInit(); + this.loadRecipes(); } - @Override public void registerObjects() { + if (recipeLoader == null) { recipeLoader = new ALRecipeLoader(); @@ -184,7 +192,6 @@ public class AssemblyLine extends ModPrefab CONFIGURATION.save(); } - @Override public void loadModMeta() { meta.modId = AssemblyLine.MOD_ID; @@ -194,20 +201,13 @@ public class AssemblyLine extends ModPrefab meta.url = "http://www.universalelectricity.com/coremachine"; meta.logoFile = "/al_logo.png"; - meta.version = DarkMain.VERSION; + meta.version = VERSION; meta.authorList = Arrays.asList(new String[] { "DarkGuardsman", "Briman", "Calclavia" }); meta.credits = "Please see the website."; meta.autogenerated = false; } - @Override - public String getDomain() - { - return "al"; - } - - @Override public void loadRecipes() { recipeLoader.loadRecipes(); diff --git a/src/dark/assembly/CommonProxy.java b/src/dark/assembly/CommonProxy.java index 077f0cd0..298c7b19 100644 --- a/src/dark/assembly/CommonProxy.java +++ b/src/dark/assembly/CommonProxy.java @@ -9,6 +9,9 @@ import java.util.zip.ZipInputStream; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; + +import com.dark.prefab.invgui.ContainerFake; + import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.network.IGuiHandler; import dark.assembly.imprinter.ContainerImprinter; @@ -17,7 +20,6 @@ import dark.assembly.machine.encoder.ContainerEncoder; import dark.assembly.machine.encoder.TileEntityEncoder; import dark.assembly.machine.processor.ContainerProcessor; import dark.assembly.machine.processor.TileEntityProcessor; -import dark.core.prefab.invgui.ContainerFake; public class CommonProxy implements IGuiHandler { diff --git a/src/dark/assembly/armbot/BlockArmbot.java b/src/dark/assembly/armbot/BlockArmbot.java index 55e07b76..8941ba73 100644 --- a/src/dark/assembly/armbot/BlockArmbot.java +++ b/src/dark/assembly/armbot/BlockArmbot.java @@ -13,13 +13,13 @@ import universalelectricity.core.UniversalElectricity; import universalelectricity.core.vector.Vector3; import com.builtbroken.common.Pair; +import com.dark.interfaces.IMultiBlock; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import dark.assembly.client.render.BlockRenderingHandler; import dark.assembly.client.render.RenderArmbot; import dark.assembly.machine.BlockAssembly; -import dark.core.interfaces.IMultiBlock; public class BlockArmbot extends BlockAssembly { diff --git a/src/dark/assembly/armbot/TileEntityArmbot.java b/src/dark/assembly/armbot/TileEntityArmbot.java index 1849975b..81dbc829 100644 --- a/src/dark/assembly/armbot/TileEntityArmbot.java +++ b/src/dark/assembly/armbot/TileEntityArmbot.java @@ -19,9 +19,12 @@ import universalelectricity.core.vector.Vector3; import universalelectricity.prefab.TranslationHelper; import com.builtbroken.common.Pair; +import com.dark.DarkCore; import com.dark.helpers.ItemWorldHelper; import com.dark.helpers.MathHelper; +import com.dark.interfaces.IMultiBlock; import com.dark.network.PacketHandler; +import com.dark.prefab.BlockMulti; import com.google.common.io.ByteArrayDataInput; import cpw.mods.fml.common.FMLCommonHandler; @@ -36,9 +39,6 @@ import dark.api.al.coding.ProgramHelper; import dark.assembly.ALRecipeLoader; import dark.assembly.machine.TileEntityAssembly; import dark.assembly.machine.encoder.ItemDisk; -import dark.core.interfaces.IMultiBlock; -import dark.core.prefab.machine.BlockMulti; -import dark.machines.DarkMain; public class TileEntityArmbot extends TileEntityAssembly implements IMultiBlock, IArmbot, IPeripheral { @@ -347,9 +347,9 @@ public class TileEntityArmbot extends TileEntityAssembly implements IMultiBlock, @Override public void onCreate(Vector3 placedPosition) { - if (DarkMain.blockMulti instanceof BlockMulti) + if (DarkCore.multiBlock instanceof BlockMulti) { - DarkMain.blockMulti.makeFakeBlock(this.worldObj, Vector3.translate(placedPosition, new Vector3(0, 1, 0)), placedPosition); + DarkCore.multiBlock.makeFakeBlock(this.worldObj, Vector3.translate(placedPosition, new Vector3(0, 1, 0)), placedPosition); } } diff --git a/src/dark/assembly/armbot/command/TaskGrabEntity.java b/src/dark/assembly/armbot/command/TaskGrabEntity.java index 8c9c780c..ddd0f568 100644 --- a/src/dark/assembly/armbot/command/TaskGrabEntity.java +++ b/src/dark/assembly/armbot/command/TaskGrabEntity.java @@ -2,14 +2,15 @@ package dark.assembly.armbot.command; import java.util.List; -import com.dark.helpers.EntityDictionary; - import net.minecraft.entity.Entity; import net.minecraft.entity.EntityAgeable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.AxisAlignedBB; + +import com.dark.helpers.EntityDictionary; + import dark.api.al.coding.IArmbot; import dark.api.al.coding.args.ArgumentData; import dark.assembly.armbot.TaskBaseProcess; diff --git a/src/dark/assembly/client/gui/GuiEditTask.java b/src/dark/assembly/client/gui/GuiEditTask.java index 3b2a519d..504e1b72 100644 --- a/src/dark/assembly/client/gui/GuiEditTask.java +++ b/src/dark/assembly/client/gui/GuiEditTask.java @@ -11,15 +11,15 @@ import org.lwjgl.opengl.GL11; import universalelectricity.core.vector.Vector2; import com.dark.DarkCore; +import com.dark.prefab.invgui.GuiBase; +import com.dark.prefab.invgui.GuiMessageBox; +import com.dark.prefab.invgui.IMessageBoxDialog; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.common.FMLCommonHandler; import dark.api.al.coding.ITask; import dark.api.al.coding.args.ArgumentData; import dark.assembly.AssemblyLine; -import dark.core.prefab.invgui.GuiBase; -import dark.core.prefab.invgui.GuiMessageBox; -import dark.core.prefab.invgui.IMessageBoxDialog; public class GuiEditTask extends GuiBase implements IMessageBoxDialog { diff --git a/src/dark/assembly/client/gui/GuiEncoderBase.java b/src/dark/assembly/client/gui/GuiEncoderBase.java index a257fce9..f8548a24 100644 --- a/src/dark/assembly/client/gui/GuiEncoderBase.java +++ b/src/dark/assembly/client/gui/GuiEncoderBase.java @@ -2,11 +2,13 @@ package dark.assembly.client.gui; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; + +import com.dark.prefab.TileEntityMachine; +import com.dark.prefab.invgui.ContainerFake; +import com.dark.prefab.invgui.GuiMachineContainer; + import dark.assembly.AssemblyLine; import dark.assembly.CommonProxy; -import dark.core.prefab.invgui.ContainerFake; -import dark.core.prefab.machine.TileEntityMachine; -import dark.machines.client.gui.GuiMachineContainer; public class GuiEncoderBase extends GuiMachineContainer { diff --git a/src/dark/assembly/client/gui/GuiEncoderCoder.java b/src/dark/assembly/client/gui/GuiEncoderCoder.java index 4aaa32ae..bf22adcd 100644 --- a/src/dark/assembly/client/gui/GuiEncoderCoder.java +++ b/src/dark/assembly/client/gui/GuiEncoderCoder.java @@ -6,9 +6,10 @@ import net.minecraft.entity.player.InventoryPlayer; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; +import com.dark.prefab.invgui.GuiButtonImage; +import com.dark.prefab.invgui.GuiButtonImage.ButtonIcon; + import dark.assembly.machine.encoder.TileEntityEncoder; -import dark.core.prefab.invgui.GuiButtonImage; -import dark.core.prefab.invgui.GuiButtonImage.ButtonIcon; public class GuiEncoderCoder extends GuiEncoderBase { diff --git a/src/dark/assembly/client/gui/GuiManipulator.java b/src/dark/assembly/client/gui/GuiManipulator.java index 3cc32d80..98c7a576 100644 --- a/src/dark/assembly/client/gui/GuiManipulator.java +++ b/src/dark/assembly/client/gui/GuiManipulator.java @@ -1,11 +1,13 @@ package dark.assembly.client.gui; import net.minecraft.entity.player.EntityPlayer; + +import com.dark.prefab.TileEntityMachine; +import com.dark.prefab.invgui.GuiMachineBase; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import dark.assembly.AssemblyLine; -import dark.core.prefab.machine.TileEntityMachine; -import dark.machines.client.gui.GuiMachineBase; @SideOnly(Side.CLIENT) public class GuiManipulator extends GuiMachineBase diff --git a/src/dark/assembly/client/gui/GuiTaskList.java b/src/dark/assembly/client/gui/GuiTaskList.java index 9d0d76ac..a06e159f 100644 --- a/src/dark/assembly/client/gui/GuiTaskList.java +++ b/src/dark/assembly/client/gui/GuiTaskList.java @@ -6,6 +6,8 @@ import net.minecraft.tileentity.TileEntity; import org.lwjgl.opengl.GL11; +import com.dark.interfaces.IScroll; + import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.common.FMLCommonHandler; import dark.api.al.coding.IProgram; @@ -15,7 +17,6 @@ import dark.assembly.armbot.command.TaskEnd; import dark.assembly.armbot.command.TaskIdle; import dark.assembly.armbot.command.TaskStart; import dark.assembly.machine.encoder.TileEntityEncoder; -import dark.core.interfaces.IScroll; /** Not a gui itself but a component used to display task as a box inside of a gui * diff --git a/src/dark/assembly/client/render/RenderProcessor.java b/src/dark/assembly/client/render/RenderProcessor.java index 91ed0d2d..41fdf291 100644 --- a/src/dark/assembly/client/render/RenderProcessor.java +++ b/src/dark/assembly/client/render/RenderProcessor.java @@ -1,5 +1,6 @@ package dark.assembly.client.render; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.ForgeDirection; @@ -14,10 +15,9 @@ import dark.assembly.AssemblyLine; import dark.assembly.client.model.ModelCrusher; import dark.assembly.client.model.ModelGrinder; import dark.assembly.machine.processor.TileEntityProcessor; -import dark.machines.client.renders.RenderTileMachine; @SideOnly(Side.CLIENT) -public class RenderProcessor extends RenderTileMachine +public class RenderProcessor extends TileEntitySpecialRenderer { private ModelCrusher crusherModel; private ModelGrinder grinderModel; @@ -76,14 +76,6 @@ public class RenderProcessor extends RenderTileMachine GL11.glPopMatrix(); } - @Override - public void renderModel(TileEntity tileEntity, double var2, double var4, double var6, float var8) - { - if (tileEntity instanceof TileEntityProcessor) - this.renderAModelAt((TileEntityProcessor) tileEntity, var2, var4, var6, var8); - } - - @Override public ResourceLocation getTexture(int block, int meta) { int g = meta / 4; @@ -98,4 +90,12 @@ public class RenderProcessor extends RenderTileMachine return null; } + + @Override + public void renderTileEntityAt(TileEntity tileEntity, double var2, double var4, double var6, float var8) + { + if (tileEntity instanceof TileEntityProcessor) + this.renderAModelAt((TileEntityProcessor) tileEntity, var2, var4, var6, var8); + + } } \ No newline at end of file diff --git a/src/dark/assembly/imprinter/ContainerImprinter.java b/src/dark/assembly/imprinter/ContainerImprinter.java index 8c72201d..6fdb7781 100644 --- a/src/dark/assembly/imprinter/ContainerImprinter.java +++ b/src/dark/assembly/imprinter/ContainerImprinter.java @@ -5,11 +5,13 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; + +import com.dark.prefab.invgui.ISlotWatcher; +import com.dark.prefab.invgui.SlotCraftingResult; +import com.dark.prefab.invgui.SlotRestricted; +import com.dark.prefab.invgui.WatchedSlot; + import dark.assembly.ALRecipeLoader; -import dark.core.prefab.invgui.ISlotWatcher; -import dark.core.prefab.invgui.SlotCraftingResult; -import dark.core.prefab.invgui.SlotRestricted; -import dark.core.prefab.invgui.WatchedSlot; public class ContainerImprinter extends Container implements ISlotWatcher { diff --git a/src/dark/assembly/imprinter/ItemImprinter.java b/src/dark/assembly/imprinter/ItemImprinter.java index 704c7840..cb67e7c5 100644 --- a/src/dark/assembly/imprinter/ItemImprinter.java +++ b/src/dark/assembly/imprinter/ItemImprinter.java @@ -3,8 +3,6 @@ package dark.assembly.imprinter; import java.util.ArrayList; import java.util.List; -import com.dark.IndustryCreativeTab; - import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityList; @@ -15,6 +13,9 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; + +import com.dark.IndustryTabs; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import dark.assembly.AssemblyLine; @@ -25,7 +26,7 @@ public class ItemImprinter extends Item { super(id); this.setUnlocalizedName("imprint"); - this.setCreativeTab(IndustryCreativeTab.tabAutomation()); + this.setCreativeTab(IndustryTabs.tabAutomation()); this.setHasSubtypes(true); this.maxStackSize = 1; } diff --git a/src/dark/assembly/imprinter/TileEntityImprinter.java b/src/dark/assembly/imprinter/TileEntityImprinter.java index e1e30a50..b0d4a768 100644 --- a/src/dark/assembly/imprinter/TileEntityImprinter.java +++ b/src/dark/assembly/imprinter/TileEntityImprinter.java @@ -23,18 +23,18 @@ import universalelectricity.prefab.network.IPacketReceiver; import universalelectricity.prefab.tile.TileEntityAdvanced; import com.builtbroken.common.Pair; +import com.dark.DarkCore; import com.dark.helpers.AutoCraftingManager; import com.dark.helpers.AutoCraftingManager.IAutoCrafter; import com.dark.network.PacketHandler; +import com.dark.prefab.TileEntityMulti; +import com.dark.prefab.invgui.ISlotPickResult; import com.google.common.io.ByteArrayDataInput; +import dark.api.al.AutoCraftEvent; import dark.api.al.coding.IArmbot; import dark.api.al.coding.IArmbotUseable; import dark.api.al.coding.args.ArgumentData; -import dark.api.events.AutoCraftEvent; -import dark.core.prefab.invgui.ISlotPickResult; -import dark.core.prefab.machine.TileEntityMulti; -import dark.machines.DarkMain; public class TileEntityImprinter extends TileEntityAdvanced implements ISidedInventory, IArmbotUseable, IPacketReceiver, ISlotPickResult, IAutoCrafter { @@ -474,7 +474,7 @@ public class TileEntityImprinter extends TileEntityAdvanced implements ISidedInv @Override public Packet getDescriptionPacket() { - return PacketHandler.instance().getTilePacket(DarkMain.CHANNEL, this, this.searchInventories); + return PacketHandler.instance().getTilePacket(DarkCore.CHANNEL, this, this.searchInventories); } // /////////////////////////////////////// diff --git a/src/dark/assembly/machine/BlockAssembly.java b/src/dark/assembly/machine/BlockAssembly.java index 1d9324e8..e64109f5 100644 --- a/src/dark/assembly/machine/BlockAssembly.java +++ b/src/dark/assembly/machine/BlockAssembly.java @@ -1,21 +1,22 @@ package dark.assembly.machine; -import com.dark.IndustryCreativeTab; - import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; + +import com.dark.IndustryTabs; +import com.dark.prefab.BlockMachine; + import dark.assembly.AssemblyLine; -import dark.core.prefab.machine.BlockMachine; public class BlockAssembly extends BlockMachine { public BlockAssembly(String blockName, Material material) { super(AssemblyLine.CONFIGURATION, blockName, material); - this.setCreativeTab(IndustryCreativeTab.tabAutomation()); + this.setCreativeTab(IndustryTabs.tabAutomation()); } @Override diff --git a/src/dark/assembly/machine/BlockManipulator.java b/src/dark/assembly/machine/BlockManipulator.java index cf15f258..300fa4b8 100644 --- a/src/dark/assembly/machine/BlockManipulator.java +++ b/src/dark/assembly/machine/BlockManipulator.java @@ -15,7 +15,6 @@ import com.builtbroken.common.Pair; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import dark.assembly.CommonProxy; import dark.assembly.client.render.BlockRenderingHandler; import dark.assembly.client.render.RenderManipulator; import dark.assembly.imprinter.prefab.BlockImprintable; @@ -29,7 +28,6 @@ public class BlockManipulator extends BlockImprintable { super("manipulator", UniversalElectricity.machine); this.setBlockBounds(0, 0, 0, 1, 0.29f, 1); - this.guiID = CommonProxy.GUI_MANIPULATOR; } @Override diff --git a/src/dark/assembly/machine/InventoryCrate.java b/src/dark/assembly/machine/InventoryCrate.java index e915bf16..b3c636f0 100644 --- a/src/dark/assembly/machine/InventoryCrate.java +++ b/src/dark/assembly/machine/InventoryCrate.java @@ -3,7 +3,8 @@ package dark.assembly.machine; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import dark.core.prefab.invgui.InvChest; + +import com.dark.prefab.invgui.InvChest; public class InventoryCrate extends InvChest { diff --git a/src/dark/assembly/machine/NetworkAssembly.java b/src/dark/assembly/machine/NetworkAssembly.java index aa660a28..3ecc7769 100644 --- a/src/dark/assembly/machine/NetworkAssembly.java +++ b/src/dark/assembly/machine/NetworkAssembly.java @@ -5,17 +5,17 @@ import java.util.HashSet; import java.util.Iterator; import java.util.Set; -import com.dark.prefab.tile.network.NetworkSharedPower; -import com.dark.prefab.tile.network.NetworkUpdateHandler; -import com.dark.tile.network.INetworkEnergyPart; -import com.dark.tile.network.INetworkPart; - import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.ForgeDirection; import universalelectricity.core.block.IElectrical; import universalelectricity.core.block.IElectricalStorage; import universalelectricity.core.vector.Vector3; +import com.dark.tilenetwork.INetworkEnergyPart; +import com.dark.tilenetwork.INetworkPart; +import com.dark.tilenetwork.prefab.NetworkSharedPower; +import com.dark.tilenetwork.prefab.NetworkUpdateHandler; + public class NetworkAssembly extends NetworkSharedPower { public static final int damandUpdateDelay = 100; diff --git a/src/dark/assembly/machine/TileEntityAssembly.java b/src/dark/assembly/machine/TileEntityAssembly.java index 2697eac5..bbe60ffc 100644 --- a/src/dark/assembly/machine/TileEntityAssembly.java +++ b/src/dark/assembly/machine/TileEntityAssembly.java @@ -4,17 +4,17 @@ import java.util.ArrayList; import java.util.List; import java.util.Random; -import com.dark.prefab.tile.network.NetworkSharedPower; -import com.dark.prefab.tile.network.NetworkTileEntities; -import com.dark.tile.network.INetworkEnergyPart; -import com.dark.tile.network.ITileNetwork; - import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraftforge.common.ForgeDirection; import universalelectricity.core.electricity.ElectricityPack; import universalelectricity.core.vector.Vector3; -import dark.core.prefab.machine.TileEntityEnergyMachine; + +import com.dark.prefab.TileEntityEnergyMachine; +import com.dark.tilenetwork.INetworkEnergyPart; +import com.dark.tilenetwork.ITileNetwork; +import com.dark.tilenetwork.prefab.NetworkSharedPower; +import com.dark.tilenetwork.prefab.NetworkTileEntities; /** A class to be inherited by all machines on the assembly line. This class acts as a single peace * in a network of similar tiles allowing all to share power from one or more sources diff --git a/src/dark/assembly/machine/TileEntityCrate.java b/src/dark/assembly/machine/TileEntityCrate.java index 26e1d11b..a3f7f982 100644 --- a/src/dark/assembly/machine/TileEntityCrate.java +++ b/src/dark/assembly/machine/TileEntityCrate.java @@ -9,14 +9,14 @@ import net.minecraft.network.packet.Packet250CustomPayload; import net.minecraftforge.common.ForgeDirection; import universalelectricity.prefab.network.IPacketReceiver; +import com.dark.DarkCore; import com.dark.interfaces.IExtendedStorage; import com.dark.network.PacketHandler; +import com.dark.prefab.TileEntityInv; import com.google.common.io.ByteArrayDataInput; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; -import dark.core.prefab.machine.TileEntityInv; -import dark.machines.DarkMain; /** Basic single stack inventory * @@ -223,11 +223,11 @@ public class TileEntityCrate extends TileEntityInv implements IPacketReceiver, I ItemStack stack = this.getSampleStack(); if (stack != null) { - return PacketHandler.instance().getTilePacket(DarkMain.CHANNEL, this, true, stack.writeToNBT(new NBTTagCompound()), stack.stackSize); + return PacketHandler.instance().getTilePacket(DarkCore.CHANNEL, this, true, stack.writeToNBT(new NBTTagCompound()), stack.stackSize); } else { - return PacketHandler.instance().getTilePacket(DarkMain.CHANNEL, this, false); + return PacketHandler.instance().getTilePacket(DarkCore.CHANNEL, this, false); } } diff --git a/src/dark/assembly/machine/belt/BlockConveyor.java b/src/dark/assembly/machine/belt/BlockConveyor.java index 7764a2bf..d4f66eaa 100644 --- a/src/dark/assembly/machine/belt/BlockConveyor.java +++ b/src/dark/assembly/machine/belt/BlockConveyor.java @@ -16,7 +16,7 @@ import net.minecraft.world.World; import net.minecraftforge.common.ForgeDirection; import com.builtbroken.common.Pair; -import com.dark.prefab.tile.network.NetworkItemSupply; +import com.dark.tilenetwork.prefab.NetworkItemSupply; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -24,7 +24,6 @@ import dark.assembly.client.render.BlockRenderingHandler; import dark.assembly.client.render.RenderConveyorBelt; import dark.assembly.machine.BlockAssembly; import dark.assembly.machine.belt.TileEntityConveyorBelt.SlantType; -import dark.machines.DarkMain; public class BlockConveyor extends BlockAssembly { @@ -276,7 +275,7 @@ public class BlockConveyor extends BlockAssembly @Override public int getRenderType() { - return DarkMain.zeroRendering ? 0 : BlockRenderingHandler.BLOCK_RENDER_ID; + return BlockRenderingHandler.BLOCK_RENDER_ID; } @Override diff --git a/src/dark/assembly/machine/belt/BlockConveyorBelt.java b/src/dark/assembly/machine/belt/BlockConveyorBelt.java index bfe340ff..d24c9773 100644 --- a/src/dark/assembly/machine/belt/BlockConveyorBelt.java +++ b/src/dark/assembly/machine/belt/BlockConveyorBelt.java @@ -26,7 +26,6 @@ import dark.assembly.client.render.BlockRenderingHandler; import dark.assembly.client.render.RenderConveyorBelt; import dark.assembly.machine.BlockAssembly; import dark.assembly.machine.belt.TileEntityConveyorBelt.SlantType; -import dark.machines.DarkMain; /** The block for the actual conveyor belt! * @@ -354,7 +353,7 @@ public class BlockConveyorBelt extends BlockAssembly @Override public int getRenderType() { - return DarkMain.zeroRendering ? 0 : BlockRenderingHandler.BLOCK_RENDER_ID; + return BlockRenderingHandler.BLOCK_RENDER_ID; } @Override diff --git a/src/dark/assembly/machine/belt/TileEntityConveyor.java b/src/dark/assembly/machine/belt/TileEntityConveyor.java index 9c82d003..53e0f4f2 100644 --- a/src/dark/assembly/machine/belt/TileEntityConveyor.java +++ b/src/dark/assembly/machine/belt/TileEntityConveyor.java @@ -3,20 +3,21 @@ package dark.assembly.machine.belt; import java.util.ArrayList; import java.util.List; -import com.dark.prefab.tile.network.NetworkItemSupply; -import com.dark.tile.network.IMotionPath; -import com.dark.tile.network.INetworkPart; -import com.dark.tile.network.ITileNetwork; - import net.minecraft.entity.Entity; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraftforge.common.ForgeDirection; import universalelectricity.core.vector.Vector3; + +import com.dark.prefab.TileEntityEnergyMachine; +import com.dark.tilenetwork.IMotionPath; +import com.dark.tilenetwork.INetworkPart; +import com.dark.tilenetwork.ITileNetwork; +import com.dark.tilenetwork.prefab.NetworkItemSupply; + import dark.api.al.IBelt; import dark.assembly.machine.TileEntityAssembly; -import dark.core.prefab.machine.TileEntityEnergyMachine; public class TileEntityConveyor extends TileEntityEnergyMachine implements IMotionPath, IBelt, INetworkPart { diff --git a/src/dark/assembly/machine/belt/TileEntityConveyorBelt.java b/src/dark/assembly/machine/belt/TileEntityConveyorBelt.java index 60b3affd..330cb45e 100644 --- a/src/dark/assembly/machine/belt/TileEntityConveyorBelt.java +++ b/src/dark/assembly/machine/belt/TileEntityConveyorBelt.java @@ -20,7 +20,6 @@ import cpw.mods.fml.common.network.Player; import dark.api.al.IBelt; import dark.assembly.ALRecipeLoader; import dark.assembly.machine.TileEntityAssembly; -import dark.machines.DarkMain; /** Conveyer belt TileEntity that allows entities of all kinds to be moved * @@ -76,8 +75,6 @@ public class TileEntityConveyorBelt extends TileEntityAssembly implements IBelt, { this.worldObj.playSound(this.xCoord, this.yCoord, this.zCoord, "mods.assemblyline.conveyor", 0.5f, 0.7f, true); } - if (!DarkMain.zeroAnimation) - { this.wheelRotation = (40 + this.wheelRotation) % 360; float wheelRotPct = wheelRotation / 360f; @@ -99,7 +96,6 @@ public class TileEntityConveyorBelt extends TileEntityAssembly implements IBelt, if (this.animFrame > MAX_SLANT_FRAME) this.animFrame = MAX_SLANT_FRAME; } - } } } diff --git a/src/dark/assembly/machine/encoder/ContainerEncoder.java b/src/dark/assembly/machine/encoder/ContainerEncoder.java index a5068676..8896790a 100644 --- a/src/dark/assembly/machine/encoder/ContainerEncoder.java +++ b/src/dark/assembly/machine/encoder/ContainerEncoder.java @@ -5,8 +5,10 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; + +import com.dark.prefab.invgui.SlotRestricted; + import dark.assembly.ALRecipeLoader; -import dark.core.prefab.invgui.SlotRestricted; public class ContainerEncoder extends Container { diff --git a/src/dark/assembly/machine/encoder/ItemDisk.java b/src/dark/assembly/machine/encoder/ItemDisk.java index 652e665a..7d2e531c 100644 --- a/src/dark/assembly/machine/encoder/ItemDisk.java +++ b/src/dark/assembly/machine/encoder/ItemDisk.java @@ -3,14 +3,15 @@ package dark.assembly.machine.encoder; import java.util.ArrayList; import java.util.List; -import com.dark.IndustryCreativeTab; - import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; + +import com.dark.IndustryTabs; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import dark.assembly.AssemblyLine; @@ -21,7 +22,7 @@ public class ItemDisk extends Item { super(id); this.setUnlocalizedName("disk"); - this.setCreativeTab(IndustryCreativeTab.tabAutomation()); + this.setCreativeTab(IndustryTabs.tabAutomation()); this.setHasSubtypes(true); } diff --git a/src/dark/assembly/machine/encoder/TileEntityEncoder.java b/src/dark/assembly/machine/encoder/TileEntityEncoder.java index 6ceedf3b..cd1de780 100644 --- a/src/dark/assembly/machine/encoder/TileEntityEncoder.java +++ b/src/dark/assembly/machine/encoder/TileEntityEncoder.java @@ -10,7 +10,9 @@ import net.minecraft.network.packet.Packet; import universalelectricity.core.vector.Vector2; import universalelectricity.prefab.network.PacketManager; +import com.dark.DarkCore; import com.dark.network.PacketHandler; +import com.dark.prefab.TileEntityMachine; import com.google.common.io.ByteArrayDataInput; import cpw.mods.fml.common.network.PacketDispatcher; @@ -20,8 +22,6 @@ import dark.api.al.coding.ITask; import dark.api.al.coding.TaskRegistry; import dark.assembly.armbot.Program; import dark.assembly.armbot.command.TaskRotateTo; -import dark.core.prefab.machine.TileEntityMachine; -import dark.machines.DarkMain; public class TileEntityEncoder extends TileEntityMachine implements ISidedInventory { @@ -185,7 +185,7 @@ public class TileEntityEncoder extends TileEntityMachine implements ISidedInvent { this.program.save(tag); } - return PacketHandler.instance().getTilePacket(DarkMain.CHANNEL, this, TileEntityEncoder.PROGRAM_PACKET_ID, exists, tag); + return PacketHandler.instance().getTilePacket(DarkCore.CHANNEL, this, TileEntityEncoder.PROGRAM_PACKET_ID, exists, tag); } @@ -195,7 +195,7 @@ public class TileEntityEncoder extends TileEntityMachine implements ISidedInvent { if (this.worldObj.isRemote) { - PacketDispatcher.sendPacketToServer(PacketHandler.instance().getTilePacket(DarkMain.CHANNEL, this, TileEntityEncoder.REMOVE_TASK_PACKET_ID, vec.intX(), vec.intY())); + PacketDispatcher.sendPacketToServer(PacketHandler.instance().getTilePacket(DarkCore.CHANNEL, this, TileEntityEncoder.REMOVE_TASK_PACKET_ID, vec.intX(), vec.intY())); } else { @@ -213,7 +213,7 @@ public class TileEntityEncoder extends TileEntityMachine implements ISidedInvent { NBTTagCompound nbt = new NBTTagCompound(); editTask.save(nbt); - PacketDispatcher.sendPacketToServer(PacketHandler.instance().getTilePacket(DarkMain.CHANNEL, this, TileEntityEncoder.PROGRAM_CHANGE_PACKET_ID, editTask.getMethodName(), editTask.getCol(), editTask.getRow(), nbt)); + PacketDispatcher.sendPacketToServer(PacketHandler.instance().getTilePacket(DarkCore.CHANNEL, this, TileEntityEncoder.PROGRAM_CHANGE_PACKET_ID, editTask.getMethodName(), editTask.getCol(), editTask.getRow(), nbt)); } else { @@ -231,7 +231,7 @@ public class TileEntityEncoder extends TileEntityMachine implements ISidedInvent { NBTTagCompound nbt = new NBTTagCompound(); editTask.save(nbt); - PacketDispatcher.sendPacketToServer(PacketHandler.instance().getTilePacket(DarkMain.CHANNEL, this, TileEntityEncoder.NEW_TASK_PACKET_ID, editTask.getMethodName(), editTask.getCol(), editTask.getRow(), nbt)); + PacketDispatcher.sendPacketToServer(PacketHandler.instance().getTilePacket(DarkCore.CHANNEL, this, TileEntityEncoder.NEW_TASK_PACKET_ID, editTask.getMethodName(), editTask.getCol(), editTask.getRow(), nbt)); } else { diff --git a/src/dark/assembly/machine/frame/BlockFrame.java b/src/dark/assembly/machine/frame/BlockFrame.java deleted file mode 100644 index cf00bb07..00000000 --- a/src/dark/assembly/machine/frame/BlockFrame.java +++ /dev/null @@ -1,64 +0,0 @@ -package dark.assembly.machine.frame; - -import java.util.List; -import java.util.Set; - -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -import com.builtbroken.common.Pair; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import dark.core.prefab.machine.BlockMachine; -import dark.machines.DarkMain; - -public class BlockFrame extends BlockMachine -{ - public BlockFrame() - { - super(DarkMain.CONFIGURATION, "DMFrame", Material.iron); - } - - @Override - public TileEntity createTileEntity(World world, int metadata) - { - if (metadata >= 0 && metadata < 4) - { - return new TileEntityFrame(); - } - else if (metadata >= 4 && metadata < 8) - { - return new TileEntityFrameMotor(); - } - return super.createTileEntity(world, metadata); - } - - @Override - public void getTileEntities(int blockID, Set>> list) - { - list.add(new Pair("DMFrame", TileEntityFrame.class)); - list.add(new Pair("DMFrameMotor", TileEntityFrameMotor.class)); - } - - @Override - @SideOnly(Side.CLIENT) - public void getClientTileEntityRenderers(List, TileEntitySpecialRenderer>> list) - { - - } - - public enum FrameData - { - WOOD_FRAME(), - IRON_FRAME(), - STEEL_FRAME(), - BRONZE_FRAME(), - BASIC_MOTOR(), - ADEPT_MOTOR(), - ADVANCED_MOTOR(), - ELITE_MOTOR(); - } -} diff --git a/src/dark/assembly/machine/frame/NetworkFrameDesign.java b/src/dark/assembly/machine/frame/NetworkFrameDesign.java deleted file mode 100644 index 037ffd36..00000000 --- a/src/dark/assembly/machine/frame/NetworkFrameDesign.java +++ /dev/null @@ -1,9 +0,0 @@ -package dark.assembly.machine.frame; - -/** All frames, there movers, connections, and sub machines are handled by this network class - * - * @author DarkGuardsman */ -public class NetworkFrameDesign -{ - -} diff --git a/src/dark/assembly/machine/frame/NetworkFrameRail.java b/src/dark/assembly/machine/frame/NetworkFrameRail.java deleted file mode 100644 index 7dbca363..00000000 --- a/src/dark/assembly/machine/frame/NetworkFrameRail.java +++ /dev/null @@ -1,19 +0,0 @@ -package dark.assembly.machine.frame; - -import com.dark.prefab.tile.network.NetworkTileEntities; -import com.dark.tile.network.INetworkPart; - - -/** This is a sub network for the frames that handles only one rail of frames - * - * @author DarkGuardsman */ -public class NetworkFrameRail extends NetworkTileEntities -{ - /** Animation rotation of the frame wheels */ - public float rotation = 0; - - public NetworkFrameRail(INetworkPart... frames) - { - super(frames); - } -} diff --git a/src/dark/assembly/machine/frame/TileEntityFrame.java b/src/dark/assembly/machine/frame/TileEntityFrame.java deleted file mode 100644 index fe308460..00000000 --- a/src/dark/assembly/machine/frame/TileEntityFrame.java +++ /dev/null @@ -1,210 +0,0 @@ -package dark.assembly.machine.frame; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.packet.Packet; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraftforge.common.ForgeDirection; -import universalelectricity.core.vector.Vector3; -import universalelectricity.prefab.tile.IRotatable; - -import com.dark.network.ISimplePacketReceiver; -import com.dark.network.PacketHandler; -import com.dark.tile.network.INetworkPart; -import com.dark.tile.network.ITileNetwork; -import com.google.common.io.ByteArrayDataInput; - -import cpw.mods.fml.common.network.Player; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import dark.core.interfaces.IBlockActivated; -import dark.machines.DarkMain; - -/** A non-updating tileEntity that represents the logic behind the frame. It contains rotation and - * connection information. As well provides a way for a tile network to be created to provide a - * uniform existence between all frame blocks in the rail - * - * @author DarkGuardsman */ -public class TileEntityFrame extends TileEntity implements INetworkPart, IRotatable, ISimplePacketReceiver, IBlockActivated -{ - /** Do we have blocks connected to the side */ - private boolean[] hasConnectionSide = new boolean[6]; - List tileConnections = new ArrayList(); - /** Direction that we are facing though it and its opposite are the same */ - private ForgeDirection getFace = ForgeDirection.DOWN; - - private NetworkFrameRail network; - - @SideOnly(Side.CLIENT) - private float renderRotation = 0; - - /** Adds a connection side. Connections are items that link a block to the rail. This way the - * rail knows to move the block when it moves */ - public void addConnectorSide(ForgeDirection side) - { - this.hasConnectionSide[side.ordinal()] = true; - } - - /** Removes a connection side */ - public void removeConnectionSide(ForgeDirection side) - { - this.hasConnectionSide[side.ordinal()] = true; - } - - /** Do we have a connection on the side */ - public boolean hasConnectionSide(ForgeDirection side) - { - return this.hasConnectionSide[side.ordinal()]; - } - - /** Called from the block when the player right clicks with a connector item */ - public boolean attachConnection(ForgeDirection side) - { - if (!hasConnectionSide(side)) - { - this.addConnectorSide(side); - return this.hasConnectionSide(side); - } - return false; - } - - @Override - public boolean onActivated(EntityPlayer entityPlayer) - { - if (entityPlayer != null && entityPlayer.getHeldItem() != null) - { - //TODO check for connector item then call attachConnection - //If connection call returns true remove item from player inv - } - return false; - } - - /* *********************************************** - * Tile Network Code - ************************************************/ - @Override - public boolean canTileConnect(Connection type, ForgeDirection dir) - { - return type == Connection.NETWORK && (dir == getFace || dir == getFace.getOpposite()); - } - - @Override - public List getNetworkConnections() - { - return tileConnections; - } - - @Override - public void refresh() - { - this.tileConnections.clear(); - TileEntity ent = new Vector3(this).modifyPositionFromSide(this.getFace).getTileEntity(this.worldObj); - TileEntity ent2 = new Vector3(this).modifyPositionFromSide(this.getFace.getOpposite()).getTileEntity(this.worldObj); - - if (ent instanceof TileEntityFrame && (this.getFace == ((TileEntityFrame) ent).getDirection() || this.getFace.getOpposite() == ((TileEntityFrame) ent).getDirection())) - { - this.tileConnections.add(ent); - if (((INetworkPart) ent).getTileNetwork() != this.getTileNetwork()) - { - this.getTileNetwork().mergeNetwork(((INetworkPart) ent).getTileNetwork(), this); - } - } - if (ent2 instanceof TileEntityFrame && (this.getFace == ((TileEntityFrame) ent2).getDirection() || this.getFace.getOpposite() == ((TileEntityFrame) ent2).getDirection())) - { - this.tileConnections.add(ent2); - if (((INetworkPart) ent2).getTileNetwork() != this.getTileNetwork()) - { - this.getTileNetwork().mergeNetwork(((INetworkPart) ent2).getTileNetwork(), this); - } - } - } - - @Override - public NetworkFrameRail getTileNetwork() - { - if (!(this.network instanceof NetworkFrameRail)) - { - this.network = new NetworkFrameRail(this); - } - return this.network; - } - - @Override - public void setTileNetwork(ITileNetwork network) - { - if (this.network instanceof NetworkFrameRail) - { - this.network = (NetworkFrameRail) network; - } - } - - /* *********************************************** - * Rotation code - ************************************************/ - - @Override - public ForgeDirection getDirection() - { - return this.getFace; - } - - @Override - public void setDirection(ForgeDirection direection) - { - this.getFace = direection; - } - - /* *********************************************** - * Load/Save/Packet code - ************************************************/ - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - } - - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - } - - @Override - public Packet getDescriptionPacket() - { - return PacketHandler.instance().getTilePacket(DarkMain.CHANNEL, this, "Desc", this.getTileNetwork().rotation, (byte) this.getFace.ordinal()); - } - - @Override - public boolean simplePacket(String id, ByteArrayDataInput data, Player player) - { - if (this.worldObj.isRemote) - { - if (id.equalsIgnoreCase("Desc")) - { - this.renderRotation = data.readFloat(); - this.getFace = ForgeDirection.getOrientation(data.readByte()); - return true; - } - } - return false; - } - - @Override - public boolean canUpdate() - { - return false; - } - - @SideOnly(Side.CLIENT) - @Override - public AxisAlignedBB getRenderBoundingBox() - { - return AxisAlignedBB.getAABBPool().getAABB(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1); - } - -} diff --git a/src/dark/assembly/machine/frame/TileEntityFrameMotor.java b/src/dark/assembly/machine/frame/TileEntityFrameMotor.java deleted file mode 100644 index 2b8db103..00000000 --- a/src/dark/assembly/machine/frame/TileEntityFrameMotor.java +++ /dev/null @@ -1,11 +0,0 @@ -package dark.assembly.machine.frame; - -import dark.core.prefab.machine.TileEntityEnergyMachine; - -public class TileEntityFrameMotor extends TileEntityEnergyMachine -{ - /** Number of times this motor revolves a second of run time */ - private float revolutionsASecond = 10; - /** Max limit of blocks this motor can move */ - private float getStrenght = 20; -} diff --git a/src/dark/assembly/machine/processor/BlockProcessor.java b/src/dark/assembly/machine/processor/BlockProcessor.java index 8c8e8ce5..f078fd75 100644 --- a/src/dark/assembly/machine/processor/BlockProcessor.java +++ b/src/dark/assembly/machine/processor/BlockProcessor.java @@ -16,7 +16,8 @@ import net.minecraftforge.oredict.OreDictionary; import universalelectricity.core.UniversalElectricity; import com.builtbroken.common.Pair; -import com.dark.IndustryCreativeTab; +import com.dark.IndustryTabs; +import com.dark.prefab.BlockMachine; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; @@ -26,7 +27,6 @@ import dark.assembly.AssemblyLine; import dark.assembly.CommonProxy; import dark.assembly.client.render.BlockRenderingHandler; import dark.assembly.client.render.RenderProcessor; -import dark.core.prefab.machine.BlockMachine; public class BlockProcessor extends BlockMachine { @@ -34,7 +34,7 @@ public class BlockProcessor extends BlockMachine public BlockProcessor() { super(AssemblyLine.CONFIGURATION, "OreProcessor", UniversalElectricity.machine); - this.setCreativeTab(IndustryCreativeTab.tabIndustrial()); + this.setCreativeTab(IndustryTabs.tabIndustrial()); } @Override diff --git a/src/dark/assembly/machine/processor/ContainerProcessor.java b/src/dark/assembly/machine/processor/ContainerProcessor.java index f52d495a..55383c01 100644 --- a/src/dark/assembly/machine/processor/ContainerProcessor.java +++ b/src/dark/assembly/machine/processor/ContainerProcessor.java @@ -7,10 +7,12 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.inventory.SlotFurnace; import net.minecraft.item.ItemStack; + +import com.dark.prefab.EnergyHelper; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import dark.api.reciepes.MachineRecipeHandler; -import dark.core.prefab.machine.EnergyHelper; public class ContainerProcessor extends Container { diff --git a/src/dark/assembly/machine/processor/TileEntityProcessor.java b/src/dark/assembly/machine/processor/TileEntityProcessor.java index 0bad3eaf..f49b27cd 100644 --- a/src/dark/assembly/machine/processor/TileEntityProcessor.java +++ b/src/dark/assembly/machine/processor/TileEntityProcessor.java @@ -5,17 +5,17 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.packet.Packet; import net.minecraftforge.common.ForgeDirection; +import com.dark.interfaces.IInvBox; import com.dark.network.PacketHandler; +import com.dark.prefab.EnergyHelper; +import com.dark.prefab.TileEntityEnergyMachine; +import com.dark.prefab.invgui.InvChest; import com.google.common.io.ByteArrayDataInput; import cpw.mods.fml.common.network.Player; import dark.api.reciepes.MachineRecipeHandler; import dark.api.reciepes.ProcessorType; import dark.assembly.machine.processor.BlockProcessor.ProcessorData; -import dark.core.interfaces.IInvBox; -import dark.core.prefab.invgui.InvChest; -import dark.core.prefab.machine.EnergyHelper; -import dark.core.prefab.machine.TileEntityEnergyMachine; /** Basic A -> B recipe processor machine designed mainly to handle ore blocks * diff --git a/src/dark/assembly/machine/red/BlockAdvancedHopper.java b/src/dark/assembly/machine/red/BlockAdvancedHopper.java index 27425eec..c398aa9d 100644 --- a/src/dark/assembly/machine/red/BlockAdvancedHopper.java +++ b/src/dark/assembly/machine/red/BlockAdvancedHopper.java @@ -15,13 +15,13 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import com.builtbroken.common.Pair; -import com.dark.IndustryCreativeTab; +import com.dark.IndustryTabs; +import com.dark.prefab.BlockMachine; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import dark.assembly.AssemblyLine; import dark.assembly.client.render.RenderAdvancedHopper; -import dark.core.prefab.machine.BlockMachine; /** Block for an advanced version of the vanilla minecraft hopper * @@ -38,7 +38,7 @@ public class BlockAdvancedHopper extends BlockMachine public BlockAdvancedHopper() { super(AssemblyLine.CONFIGURATION, "DMHopper", Material.iron); - this.setCreativeTab(IndustryCreativeTab.tabAutomation()); + this.setCreativeTab(IndustryTabs.tabAutomation()); this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } diff --git a/src/dark/assembly/machine/red/BlockPistonPlus.java b/src/dark/assembly/machine/red/BlockPistonPlus.java index f37deee2..beed4954 100644 --- a/src/dark/assembly/machine/red/BlockPistonPlus.java +++ b/src/dark/assembly/machine/red/BlockPistonPlus.java @@ -1,8 +1,10 @@ package dark.assembly.machine.red; import net.minecraft.block.material.Material; -import dark.core.prefab.machine.BlockMachine; -import dark.machines.DarkMain; + +import com.dark.prefab.BlockMachine; + +import dark.assembly.AssemblyLine; /** This will be a piston that can extend from 1 - 20 depending on teir and user settings * @@ -12,7 +14,7 @@ public class BlockPistonPlus extends BlockMachine public BlockPistonPlus() { - super(DarkMain.CONFIGURATION, "DMPiston", Material.piston); + super(AssemblyLine.CONFIGURATION, "DMPiston", Material.piston); } } diff --git a/src/dark/assembly/machine/red/TileEntityAdvancedHopper.java b/src/dark/assembly/machine/red/TileEntityAdvancedHopper.java index 64f353b4..b560ae29 100644 --- a/src/dark/assembly/machine/red/TileEntityAdvancedHopper.java +++ b/src/dark/assembly/machine/red/TileEntityAdvancedHopper.java @@ -2,14 +2,15 @@ package dark.assembly.machine.red; import java.util.List; -import com.dark.helpers.InvInteractionHelper; -import com.dark.helpers.ItemWorldHelper; - import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.ForgeDirection; import universalelectricity.core.vector.Vector3; + +import com.dark.helpers.InvInteractionHelper; +import com.dark.helpers.ItemWorldHelper; + import dark.assembly.imprinter.ItemImprinter; import dark.assembly.imprinter.prefab.TileEntityFilterable; diff --git a/src/dark/assembly/machine/red/TileEntityPistonPlus.java b/src/dark/assembly/machine/red/TileEntityPistonPlus.java index d3ac8227..7e9bb0ce 100644 --- a/src/dark/assembly/machine/red/TileEntityPistonPlus.java +++ b/src/dark/assembly/machine/red/TileEntityPistonPlus.java @@ -3,8 +3,9 @@ package dark.assembly.machine.red; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import universalelectricity.core.vector.Vector3; -import dark.core.interfaces.IMultiBlock; -import dark.core.prefab.machine.TileEntityMachine; + +import com.dark.interfaces.IMultiBlock; +import com.dark.prefab.TileEntityMachine; public class TileEntityPistonPlus extends TileEntityMachine implements IMultiBlock {