Assembly line no longer uses the core machine
However we now use the core library which will be built into the project.
This commit is contained in:
parent
2da4c62035
commit
bc1df52d11
41 changed files with 191 additions and 447 deletions
39
src/dark/api/al/AutoCraftEvent.java
Normal file
39
src/dark/api/al/AutoCraftEvent.java
Normal file
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
*
|
||||
|
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
// ///////////////////////////////////////
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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<Pair<String, Class<? extends TileEntity>>> list)
|
||||
{
|
||||
list.add(new Pair("DMFrame", TileEntityFrame.class));
|
||||
list.add(new Pair("DMFrameMotor", TileEntityFrameMotor.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getClientTileEntityRenderers(List<Pair<Class<? extends TileEntity>, TileEntitySpecialRenderer>> list)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public enum FrameData
|
||||
{
|
||||
WOOD_FRAME(),
|
||||
IRON_FRAME(),
|
||||
STEEL_FRAME(),
|
||||
BRONZE_FRAME(),
|
||||
BASIC_MOTOR(),
|
||||
ADEPT_MOTOR(),
|
||||
ADVANCED_MOTOR(),
|
||||
ELITE_MOTOR();
|
||||
}
|
||||
}
|
|
@ -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
|
||||
{
|
||||
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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<TileEntity> tileConnections = new ArrayList<TileEntity>();
|
||||
/** 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<TileEntity> 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);
|
||||
}
|
||||
|
||||
}
|
|
@ -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;
|
||||
}
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
*
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue