This commit is contained in:
Henry Mao 2012-11-28 18:29:26 +08:00
parent 14295aece6
commit 232988887a
22 changed files with 75 additions and 141 deletions

View file

@ -73,7 +73,7 @@ public class AssemblyLine
public void load(FMLInitializationEvent evt)
{
proxy.init();
GameRegistry.registerTileEntity(TileEntityConveyorBelt.class, "ConveyorBelt");
GameRegistry.registerTileEntity(TileEntityRejector.class, "Sorter");
GameRegistry.registerTileEntity(TileEntityManipulator.class, "Manipulator");
@ -98,7 +98,7 @@ public class AssemblyLine
// Retriever
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(blockInteraction, 1, MachineType.MANIPULATOR.metadata), new Object[]
{ Block.dispenser, "basicCircuit" }));
UETab.setItemStack(new ItemStack(blockConveyorBelt));
}
}

View file

@ -1,11 +1,9 @@
package assemblyline.ai;
import net.minecraft.src.TileEntity;
import assemblyline.machines.crafter.TileEntityCraftingArm;
/**
* An AI Task that is used by TileEntities with
* AI.
* An AI Task that is used by TileEntities with AI.
*
* @author Calclavia
*
@ -14,18 +12,18 @@ public abstract class Task
{
protected int ticks;
protected TileEntityCraftingArm tileEntity;
public Task(TileEntityCraftingArm arm)
{
this.tileEntity = arm;
this.tileEntity = arm;
}
/**
* Called when a task is being done.
*
* @param ticks
* The amount of ticks this task
* has been elapsed for.
* @return Return true if the task is not
* finished and false if it is.
* The amount of ticks this task has been elapsed for.
* @return Return true if the task is not finished and false if it is.
*/
protected boolean doTask()
{
@ -43,8 +41,7 @@ public abstract class Task
}
/**
* @return The tick interval of this task.
* Return 0 for no ticks.
* @return The tick interval of this task. Return 0 for no ticks.
*/
public int getTickInterval()
{

View file

@ -1,23 +1,21 @@
package assemblyline.ai;
import assemblyline.machines.crafter.TileEntityCraftingArm;
import net.minecraft.src.TileEntity;
public class TaskIdle extends Task
{
public TaskIdle(TileEntityCraftingArm arm)
{
super(arm);
}
{
super(arm);
}
protected boolean doTask()
{
/**
* randomly move the arm to
* similate life in the arm
* if the arm is powered
*/
return true;
{
/**
* randomly move the arm to similate life in the arm if the arm is powered
*/
return true;
}
}

View file

@ -8,19 +8,16 @@ import net.minecraftforge.common.ForgeDirection;
public interface IBelt
{
/**
* Gets the facing direction of the belt, used
* but other machines to know which direction
* to start an item at
* Gets the facing direction of the belt, used but other machines to know which direction to
* start an item at
*
* @return
*/
public ForgeDirection getFacing();
/**
* Causes the belt to ignore the entity for a
* few updates help in cases where another
* machine need to effect this entity without
* the belt doing so as well.
* Causes the belt to ignore the entity for a few updates help in cases where another machine
* need to effect this entity without the belt doing so as well.
*
* @param entity
* - entity being ignored
@ -28,8 +25,7 @@ public interface IBelt
public void ignoreEntity(Entity entity);
/**
* Used to get a list of entities above this
* belt
* Used to get a list of entities above this belt
*
* @return list of entities
*/

View file

@ -6,8 +6,7 @@ import universalelectricity.core.vector.Vector3;
public interface IManipulator
{
/**
* Throws the items from the manipulator into
* the world
* Throws the items from the manipulator into the world
*
* @param outputPosition
* @param items

View file

@ -17,8 +17,7 @@ public class BlockArchitectTable extends Block
}
/**
* Returns the block texture based on the side
* being looked at. Args: side
* Returns the block texture based on the side being looked at. Args: side
*/
public int getBlockTextureFromSide(int par1)
{
@ -26,8 +25,7 @@ public class BlockArchitectTable extends Block
}
/**
* Called upon block activation (right click
* on the block.)
* Called upon block activation (right click on the block.)
*/
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{

View file

@ -19,8 +19,7 @@ import assemblyline.render.RenderHelper;
import cpw.mods.fml.common.network.PacketDispatcher;
/**
* A metadata block containing a bunch of machines
* with direction.
* A metadata block containing a bunch of machines with direction.
*
* @author Darkguardsman, Calclavia
*
@ -55,8 +54,7 @@ public class BlockMulti extends BlockMachine
}
/**
* Gets the direction based on the
* metadata
* Gets the direction based on the metadata
*
* @return A direction value from 0 to 4.
*/
@ -68,8 +66,7 @@ public class BlockMulti extends BlockMachine
/**
* @param currentDirection
* - An integer from 0 to 4.
* @return The metadata this block should
* change into.
* @return The metadata this block should change into.
*/
public int getNextDirectionMeta(int currentDirection)
{
@ -199,8 +196,7 @@ public class BlockMulti extends BlockMachine
}
/**
* Returns the bounding box of the wired
* rectangular prism to render.
* Returns the bounding box of the wired rectangular prism to render.
*/
@Override
public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int x, int y, int z)
@ -209,10 +205,8 @@ public class BlockMulti extends BlockMachine
}
/**
* Returns a bounding box from the pool of
* bounding boxes (this means this box can
* change after the pool has been cleared to
* be reused)
* Returns a bounding box from the pool of bounding boxes (this means this box can change after
* the pool has been cleared to be reused)
*/
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int x, int y, int z)

View file

@ -41,9 +41,7 @@ public class ContainerSorter extends Container
}
/**
* Called to transfer a stack from one
* inventory to the other eg. when shift
* clicking.
* Called to transfer a stack from one inventory to the other eg. when shift clicking.
*/
@Override
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par1)

View file

@ -40,8 +40,7 @@ public class TileEntityManipulator extends TileEntityElectricityReceiver impleme
public double wattsReceived = 0;
/**
* Is the manipulator wrenched to turn into
* output mode?
* Is the manipulator wrenched to turn into output mode?
*/
public boolean isOutput = false;
@ -65,9 +64,7 @@ public class TileEntityManipulator extends TileEntityElectricityReceiver impleme
if (!this.isOutput)
{
/**
* Find items going into the
* manipulator and input them
* into an inventory behind
* Find items going into the manipulator and input them into an inventory behind
* this manipulator.
*/
Vector3 inputPosition = Vector3.get(this);
@ -87,11 +84,8 @@ public class TileEntityManipulator extends TileEntityElectricityReceiver impleme
for (EntityItem entity : itemsInBound)
{
/**
* Try top first, then
* bottom, then the sides
* to see if it is
* possible to insert the
* item into a inventory.
* Try top first, then bottom, then the sides to see if it is possible to
* insert the item into a inventory.
*/
ItemStack remainingStack = this.tryPlaceInPosition(entity.item.copy(), outputUp, ForgeDirection.DOWN);
@ -116,10 +110,7 @@ public class TileEntityManipulator extends TileEntityElectricityReceiver impleme
else
{
/**
* Finds the connected
* inventory and outputs the
* items upon a redstone
* pulse.
* Finds the connected inventory and outputs the items upon a redstone pulse.
*/
if (this.isPowered)
{
@ -165,8 +156,7 @@ public class TileEntityManipulator extends TileEntityElectricityReceiver impleme
}
/**
* Throws the items from the manipulator into
* the world.
* Throws the items from the manipulator into the world.
*
* @param outputPosition
* @param items
@ -181,11 +171,9 @@ public class TileEntityManipulator extends TileEntityElectricityReceiver impleme
}
/**
* Tries to place an itemStack in a specific
* position if it is an inventory.
* Tries to place an itemStack in a specific position if it is an inventory.
*
* @return The ItemStack remained after place
* attempt
* @return The ItemStack remained after place attempt
*/
private ItemStack tryPlaceInPosition(ItemStack itemStack, Vector3 position, ForgeDirection direction)
{
@ -286,8 +274,7 @@ public class TileEntityManipulator extends TileEntityElectricityReceiver impleme
}
/**
* Tries to take a item from a inventory at a
* specific position.
* Tries to take a item from a inventory at a specific position.
*
* @param position
* @return

View file

@ -72,8 +72,7 @@ public class TileEntityRejector extends TileEntityElectricityReceiver implements
super.updateEntity();
/**
* Has to update a bit faster than a
* conveyer belt
* Has to update a bit faster than a conveyer belt
*/
if (this.ticks % 5 == 0 && !this.isDisabled())
{
@ -225,10 +224,8 @@ public class TileEntityRejector extends TileEntityElectricityReceiver implements
}
/**
* Used to change any one of the boolean value
* of on/off array After changing the value if
* it was changed client side it will send a
* packet server side with the changes
* Used to change any one of the boolean value of on/off array After changing the value if it
* was changed client side it will send a packet server side with the changes
*
* @param i
*/

View file

@ -7,7 +7,6 @@ import net.minecraft.src.ItemStack;
import net.minecraft.src.NBTTagCompound;
import net.minecraft.src.NBTTagList;
import net.minecraft.src.Packet250CustomPayload;
import net.minecraft.src.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import universalelectricity.prefab.network.IPacketReceiver;
import universalelectricity.prefab.tile.TileEntityElectricityReceiver;

View file

@ -133,8 +133,7 @@ public class TileEntityConveyorBelt extends TileEntityElectricityReceiver implem
}
/**
* almost unneeded but is change for each
* different belt type
* almost unneeded but is change for each different belt type
*/
public void doBeltAction()
{
@ -147,8 +146,7 @@ public class TileEntityConveyorBelt extends TileEntityElectricityReceiver implem
* @param extendLife
* - increases the items life
* @param preventPickUp
* - prevent a player from picking
* the item up
* - prevent a player from picking the item up
*/
public void conveyItemsHorizontal(boolean extendLife, boolean preventPickUp)
{
@ -159,6 +157,7 @@ public class TileEntityConveyorBelt extends TileEntityElectricityReceiver implem
for (Entity entity : entityOnTop)
{
int direction = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
if (!this.entityIgnoreList.contains(entity))
{
if (!(entity instanceof EntityPlayer && ((EntityPlayer) entity).isSneaking()))
@ -185,6 +184,7 @@ public class TileEntityConveyorBelt extends TileEntityElectricityReceiver implem
}
}
}
if (this.clearCount++ >= 4)
{
// clear the temp ignore

View file

@ -1,9 +1,8 @@
package assemblyline.machine.belt;
/**
* For the moment this is just a render place
* holder, but will be convered to prevent item
* pickups from the belts.
* For the moment this is just a render place holder, but will be convered to prevent item pickups
* from the belts.
*
* @author Rseifert
*

View file

@ -20,8 +20,7 @@ public class TileEntityElevatorBelt extends TileEntityConveyorBelt
}
/**
* Used to detect belt bellow for rendering
* and to prevent items from falling
* Used to detect belt bellow for rendering and to prevent items from falling
*
* @return
*/
@ -33,8 +32,7 @@ public class TileEntityElevatorBelt extends TileEntityConveyorBelt
}
/**
* Same as conveyItemHorizontal but will pull,
* or lower the items up/down the belt like an
* Same as conveyItemHorizontal but will pull, or lower the items up/down the belt like an
* elevator
*
* @param extendLife

View file

@ -46,8 +46,7 @@ public class BlockCrafter extends BlockMachine
}
/**
* Gets the direction based on the
* metadata
* Gets the direction based on the metadata
*
* @return A direction value from 0 to 4.
*/
@ -59,8 +58,7 @@ public class BlockCrafter extends BlockMachine
/**
* @param currentDirection
* - An integer from 0 to 4.
* @return The metadata this block should
* change into.
* @return The metadata this block should change into.
*/
public int getNextDirectionMeta(int currentDirection)
{

View file

@ -8,8 +8,7 @@ import net.minecraft.src.ItemStack;
import net.minecraft.src.Slot;
/**
* I am planning to make the crafter not use a
* GUI.
* I am planning to make the crafter not use a GUI.
*
* @author Calclavia
*
@ -54,9 +53,7 @@ public class ContainerCrafter extends Container
}
/**
* Called to transfer a stack from one
* inventory to the other eg. when shift
* clicking.
* Called to transfer a stack from one inventory to the other eg. when shift clicking.
*/
@Override
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par1)

View file

@ -1,28 +1,25 @@
package assemblyline.machines.crafter;
import net.minecraft.src.EntityItem;
import net.minecraft.src.TileEntity;
import assemblyline.ai.Task;
/**
* Used by arms to collect items in a specific
* region.
* Used by arms to collect items in a specific region.
*
* @author Calclavia
*/
public class TaskArmCollect extends Task
{
/**
* The item to be collected.
*/
private EntityItem entityItem;
public TaskArmCollect(TileEntityCraftingArm arm,EntityItem entityItem)
public TaskArmCollect(TileEntityCraftingArm arm, EntityItem entityItem)
{
super(arm);
this.entityItem = entityItem;
super(arm);
this.entityItem = entityItem;
}
@Override
@ -33,8 +30,7 @@ public class TaskArmCollect extends Task
if (entityItem == null) { return false; }
/**
* Slowly stretch down the arm's model and
* grab the item
* Slowly stretch down the arm's model and grab the item
*/
return true;

View file

@ -2,8 +2,6 @@ package assemblyline.machines.crafter;
import net.minecraft.src.AxisAlignedBB;
import net.minecraft.src.Entity;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
import assemblyline.ai.Task;
/**
@ -25,9 +23,9 @@ public class TaskArmSearch extends Task
private Entity foundEntity;
public TaskArmSearch(TileEntityCraftingArm arm,Class<? extends Entity> entityToInclude, double radius, float searchSpeed)
public TaskArmSearch(TileEntityCraftingArm arm, Class<? extends Entity> entityToInclude, double radius, float searchSpeed)
{
super(arm);
super(arm);
this.entityToInclude = entityToInclude;
this.radius = radius;
this.searchSpeed = searchSpeed;
@ -47,9 +45,7 @@ public class TaskArmSearch extends Task
if (this.entityToInclude == null || this.foundEntity == null) { return false; }
/**
* Move the robotic arm around and emulate
* an item search. Then initiate a collect
* task.
* Move the robotic arm around and emulate an item search. Then initiate a collect task.
*/
return true;

View file

@ -7,7 +7,6 @@ import net.minecraft.src.ItemStack;
import net.minecraft.src.NBTTagCompound;
import net.minecraft.src.NBTTagList;
import net.minecraft.src.Packet250CustomPayload;
import net.minecraft.src.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import universalelectricity.prefab.network.IPacketReceiver;
import universalelectricity.prefab.tile.TileEntityElectricityReceiver;
@ -25,8 +24,7 @@ public class TileEntityCraftingArm extends TileEntityElectricityReceiver impleme
private TaskManager taskManager = new TaskManager();
/**
* Entity robotic arm to be used with this
* tileEntity
* Entity robotic arm to be used with this tileEntity
*/
public EntityCraftingArm EntityArm = null;
@ -56,8 +54,7 @@ public class TileEntityCraftingArm extends TileEntityElectricityReceiver impleme
}
/**
* controls the robotic arm into doing a set
* task
* controls the robotic arm into doing a set task
*/
public void doWork()
{
@ -258,5 +255,4 @@ public class TileEntityCraftingArm extends TileEntityElectricityReceiver impleme
nbt.setTag("Items", var2);
}
}

View file

@ -28,9 +28,7 @@ public class GuiAutoCrafting extends GuiContainer
}
/**
* Draw the foreground layer for the
* GuiContainer (everything in front of the
* items)
* Draw the foreground layer for the GuiContainer (everything in front of the items)
*/
protected void drawGuiContainerForegroundLayer()
{
@ -39,8 +37,7 @@ public class GuiAutoCrafting extends GuiContainer
}
/**
* Draw the background layer for the
* GuiContainer (everything behind the items)
* Draw the background layer for the GuiContainer (everything behind the items)
*/
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{

View file

@ -9,8 +9,7 @@ import cpw.mods.fml.common.Side;
import cpw.mods.fml.common.asm.SideOnly;
/**
* Copied from GSM lib and modified for this mod
* only
* Copied from GSM lib and modified for this mod only
*
* @author Rseifert
*

View file

@ -45,10 +45,8 @@ public class GuiSorter extends GuiContainer
}
/**
* Fired when a control is clicked. This is
* the equivalent of
* ActionListener.actionPerformed(ActionEvent
* e).
* Fired when a control is clicked. This is the equivalent of
* ActionListener.actionPerformed(ActionEvent e).
*/
protected void actionPerformed(GuiButton button)
{
@ -75,9 +73,7 @@ public class GuiSorter extends GuiContainer
}
/**
* Draw the foreground layer for the
* GuiContainer (everything in front of the
* items)
* Draw the foreground layer for the GuiContainer (everything in front of the items)
*/
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2)
@ -88,8 +84,7 @@ public class GuiSorter extends GuiContainer
}
/**
* Draw the background layer for the
* GuiContainer (everything behind the items)
* Draw the background layer for the GuiContainer (everything behind the items)
*/
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)