Version Bump

This commit is contained in:
Henry Mao 2012-12-15 11:48:44 +08:00
parent 6ef0840fdb
commit 75bf4c9244
13 changed files with 170 additions and 179 deletions

View file

@ -1 +1 @@
0.1.5 0.1.6

View file

@ -2,7 +2,7 @@
{ {
"modid" : "AssemblyLine", "modid" : "AssemblyLine",
"name" : "Assembly Line", "name" : "Assembly Line",
"version" : "0.1.5", "version" : "0.1.6",
"url" : "http://calclavia.com/universalelectricity/?m=18", "url" : "http://calclavia.com/universalelectricity/?m=18",
"credits" : "", "credits" : "",
"authors": [ "authors": [

View file

@ -5,12 +5,12 @@ import net.minecraft.tileentity.TileEntity;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import cpw.mods.fml.common.Side;
import cpw.mods.fml.common.asm.SideOnly;
import assemblyline.client.model.ModelConveyorBelt; import assemblyline.client.model.ModelConveyorBelt;
import assemblyline.common.AssemblyLine; import assemblyline.common.AssemblyLine;
import assemblyline.common.machine.belt.TileEntityConveyorBelt; import assemblyline.common.machine.belt.TileEntityConveyorBelt;
import cpw.mods.fml.common.Side;
import cpw.mods.fml.common.asm.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class RenderConveyorBelt extends TileEntitySpecialRenderer public class RenderConveyorBelt extends TileEntitySpecialRenderer
{ {

View file

@ -8,8 +8,6 @@ import org.lwjgl.opengl.GL11;
import assemblyline.common.block.TileEntityCrate; import assemblyline.common.block.TileEntityCrate;
import universalelectricity.core.vector.Vector3;
public class RenderCrate extends TileEntitySpecialRenderer public class RenderCrate extends TileEntitySpecialRenderer
{ {

View file

@ -38,7 +38,7 @@ public class RenderHelper implements ISimpleBlockRenderingHandler
modelConveyorBelt.render(0.0625F, 0, false, false, false); modelConveyorBelt.render(0.0625F, 0, false, false, false);
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
else if (block.blockID == AssemblyLine.blockInteraction.blockID) else if (block.blockID == AssemblyLine.blockMulti.blockID)
{ {
if (metadata == MachineType.SORTER.metadata) if (metadata == MachineType.SORTER.metadata)
{ {

View file

@ -44,7 +44,7 @@ public class AssemblyLine
public static final String NAME = "Assembly Line"; public static final String NAME = "Assembly Line";
public static final String VERSION = "0.1.5"; public static final String VERSION = "0.1.6";
public static final String CHANNEL = "AssemblyLine"; public static final String CHANNEL = "AssemblyLine";
@ -59,7 +59,7 @@ public class AssemblyLine
public static final int BLOCK_ID_PREFIX = 3030; public static final int BLOCK_ID_PREFIX = 3030;
public static Block blockConveyorBelt; public static Block blockConveyorBelt;
public static Block blockInteraction; public static Block blockMulti;
public static Block blockArchitectTable; public static Block blockArchitectTable;
public static Block blockCrate; public static Block blockCrate;
@ -71,7 +71,7 @@ public class AssemblyLine
CONFIGURATION.load(); CONFIGURATION.load();
blockConveyorBelt = new BlockConveyorBelt(CONFIGURATION.getBlock("Conveyor Belt", BLOCK_ID_PREFIX).getInt()); blockConveyorBelt = new BlockConveyorBelt(CONFIGURATION.getBlock("Conveyor Belt", BLOCK_ID_PREFIX).getInt());
blockInteraction = new BlockMulti(CONFIGURATION.getBlock("Machine", BLOCK_ID_PREFIX + 1).getInt()); blockMulti = new BlockMulti(CONFIGURATION.getBlock("Machine", BLOCK_ID_PREFIX + 1).getInt());
blockArchitectTable = new BlockArchitectTable(CONFIGURATION.getBlock("Architect's Table", BLOCK_ID_PREFIX + 2).getInt()); blockArchitectTable = new BlockArchitectTable(CONFIGURATION.getBlock("Architect's Table", BLOCK_ID_PREFIX + 2).getInt());
blockCrate = new BlockCrate(CONFIGURATION.getBlock("Crate", BLOCK_ID_PREFIX + 3).getInt()); blockCrate = new BlockCrate(CONFIGURATION.getBlock("Crate", BLOCK_ID_PREFIX + 3).getInt());
CONFIGURATION.save(); CONFIGURATION.save();
@ -80,7 +80,7 @@ public class AssemblyLine
GameRegistry.registerBlock(blockConveyorBelt); GameRegistry.registerBlock(blockConveyorBelt);
GameRegistry.registerBlock(blockArchitectTable); GameRegistry.registerBlock(blockArchitectTable);
GameRegistry.registerBlock(blockCrate, ItemBlockCrate.class); GameRegistry.registerBlock(blockCrate, ItemBlockCrate.class);
GameRegistry.registerBlock(blockInteraction, ItemBlockMulti.class); GameRegistry.registerBlock(blockMulti, ItemBlockMulti.class);
UpdateNotifier.INSTANCE.checkUpdate(NAME, VERSION, "http://calclavia.com/downloads/al/recommendedversion.txt"); UpdateNotifier.INSTANCE.checkUpdate(NAME, VERSION, "http://calclavia.com/downloads/al/recommendedversion.txt");
@ -130,17 +130,17 @@ public class AssemblyLine
// Add Names // Add Names
for (MachineType type : MachineType.values()) for (MachineType type : MachineType.values())
{ {
LanguageRegistry.addName(new ItemStack(blockInteraction, 1, type.metadata), type.name); LanguageRegistry.addName(new ItemStack(blockMulti, 1, type.metadata), type.name);
} }
// Conveyor Belt // Conveyor Belt
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockConveyorBelt, 4), new Object[] { "III", "WMW", 'I', "ingotSteel", 'W', Block.wood, 'M', "motor" })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockConveyorBelt, 4), new Object[] { "III", "WMW", 'I', "ingotSteel", 'W', Block.wood, 'M', "motor" }));
// Rejector // Rejector
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockInteraction, 1, MachineType.SORTER.metadata), new Object[] { "WPW", "@R@", '@', "plateSteel", 'R', Item.redstone, 'P', Block.pistonBase, 'C', "basicCircuit", 'W', "copperWire" })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockMulti, 1, MachineType.SORTER.metadata), new Object[] { "WPW", "@R@", '@', "plateSteel", 'R', Item.redstone, 'P', Block.pistonBase, 'C', "basicCircuit", 'W', "copperWire" }));
// Retriever // Retriever
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(blockInteraction, 1, MachineType.MANIPULATOR.metadata), new Object[] { Block.dispenser, "basicCircuit" })); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(blockMulti, 1, MachineType.MANIPULATOR.metadata), new Object[] { Block.dispenser, "basicCircuit" }));
UETab.setItemStack(new ItemStack(blockConveyorBelt)); UETab.setItemStack(new ItemStack(blockConveyorBelt));
} }

View file

@ -14,10 +14,8 @@ public class ArmHelper
/** /**
* Used to locate items in an area * Used to locate items in an area
* *
* @param start * @param start - start xyz
* - start xyz * @param End - end xyz
* @param End
* - end xyz
* @return list of items * @return list of items
*/ */
public List<EntityItem> findItems(World world, Vector3 start, Vector3 end) public List<EntityItem> findItems(World world, Vector3 start, Vector3 end)

View file

@ -21,8 +21,7 @@ public abstract class Task
/** /**
* Called by the TaskManager to propagate tick updates * Called by the TaskManager to propagate tick updates
* *
* @param ticks * @param ticks The amount of ticks this task has been running
* The amount of ticks this task has been running
* @return false if the task is finished and can be removed, true otherwise * @return false if the task is finished and can be removed, true otherwise
*/ */
protected boolean doTask() protected boolean doTask()

View file

@ -23,11 +23,11 @@ public class TaskManager
*/ */
try try
{ {
Task task; Task task;
Iterator<Task> iter = tasks.iterator(); Iterator<Task> iter = tasks.iterator();
while (iter.hasNext()) while (iter.hasNext())
{ {
task = iter.next(); task = iter.next();
if (task.getTickInterval() > 0) if (task.getTickInterval() > 0)
{ {
if (this.ticks % task.getTickInterval() == 0) if (this.ticks % task.getTickInterval() == 0)
@ -51,8 +51,8 @@ public class TaskManager
} }
/** /**
* Used to register Tasks for a TileEntity, executes onTaskStart * Used to register Tasks for a TileEntity, executes onTaskStart for the Task after registering
* for the Task after registering it * it
* *
* @param tileEntity TE instance to register the task for * @param tileEntity TE instance to register the task for
* @param task Task instance to register * @param task Task instance to register

View file

@ -1,7 +1,6 @@
package assemblyline.common.block; package assemblyline.common.block;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;

View file

@ -63,7 +63,7 @@ public class BlockConveyorBelt extends BlockMachine
/** /**
* @author AtomicStryker * @author AtomicStryker
*/ */
//@Override // @Override
public void onEntityCollidedWithBlockTest(World world, int x, int y, int z, Entity entity) public void onEntityCollidedWithBlockTest(World world, int x, int y, int z, Entity entity)
{ {
TileEntityConveyorBelt tileEntity = (TileEntityConveyorBelt) world.getBlockTileEntity(x, y, z); TileEntityConveyorBelt tileEntity = (TileEntityConveyorBelt) world.getBlockTileEntity(x, y, z);

View file

@ -10,10 +10,9 @@ import net.minecraft.world.World;
import universalelectricity.core.vector.Vector3; import universalelectricity.core.vector.Vector3;
/** /**
* Paradigm: The Crafting Arm is made of *TO BE DETERMINED* jointed segments. * Paradigm: The Crafting Arm is made of *TO BE DETERMINED* jointed segments. We do not save any of
* We do not save any of these. They are automatically 'created' by the Renderer * these. They are automatically 'created' by the Renderer to connect the 'Claw' to the TileEntity
* to connect the 'Claw' to the TileEntity fittingly. That's right they do not * fittingly. That's right they do not actually exist. MAGIC.
* actually exist. MAGIC.
*/ */
public class EntityCraftingArm extends Entity public class EntityCraftingArm extends Entity
{ {
@ -27,15 +26,15 @@ public class EntityCraftingArm extends Entity
} }
/** /**
* Maximal extended length of the Crafting Arm, to abort grabbings if the target * Maximal extended length of the Crafting Arm, to abort grabbings if the target moves out of
* moves out of range. * range.
*/ */
private static final float MAX_GRAB_DISTANCE = 3F; private static final float MAX_GRAB_DISTANCE = 3F;
/** /**
* At which distance from the target Item entity should the claw 'grab' it * At which distance from the target Item entity should the claw 'grab' it
*/ */
private static final float GRAB_CONNECT_DISTANCE = 0.2F; private static final float GRAB_CONNECT_DISTANCE = 0.2F;
/** /**
* type of arm this robotic arm currently is * type of arm this robotic arm currently is
@ -78,9 +77,9 @@ public class EntityCraftingArm extends Entity
@Override @Override
protected void entityInit() protected void entityInit()
{ {
dataWatcher.addObject(5, String.valueOf(clawPos.x)); dataWatcher.addObject(5, String.valueOf(clawPos.x));
dataWatcher.addObject(6, String.valueOf(clawPos.y)); dataWatcher.addObject(6, String.valueOf(clawPos.y));
dataWatcher.addObject(7, String.valueOf(clawPos.z)); dataWatcher.addObject(7, String.valueOf(clawPos.z));
} }
@Override @Override
@ -94,7 +93,7 @@ public class EntityCraftingArm extends Entity
if (nbt.hasKey("itemStackBeingHeld")) if (nbt.hasKey("itemStackBeingHeld"))
{ {
itemStackBeingHeld = ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("itemStackBeingHeld")); itemStackBeingHeld = ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("itemStackBeingHeld"));
} }
} }
@ -109,135 +108,134 @@ public class EntityCraftingArm extends Entity
if (itemStackBeingHeld != null) if (itemStackBeingHeld != null)
{ {
NBTTagCompound itemNBT = new NBTTagCompound(); NBTTagCompound itemNBT = new NBTTagCompound();
itemNBT = itemStackBeingHeld.writeToNBT(itemNBT); itemNBT = itemStackBeingHeld.writeToNBT(itemNBT);
nbt.setCompoundTag("itemStackBeingHeld", itemNBT); nbt.setCompoundTag("itemStackBeingHeld", itemNBT);
} }
} }
@Override @Override
public void onUpdate() public void onUpdate()
{ {
super.onUpdate(); super.onUpdate();
if (!worldObj.isRemote) if (!worldObj.isRemote)
{ {
// server only computations here, eg claw movement // server only computations here, eg claw movement
updateClawMovement(); updateClawMovement();
} }
updateNetworkedClawPosition(); updateNetworkedClawPosition();
} }
@Override @Override
public void setDead() public void setDead()
{ {
// TODO deal with this error case // TODO deal with this error case
super.setDead(); super.setDead();
} }
@Override @Override
public void setFire(int fire) // fire proof. public void setFire(int fire) // fire proof.
{ {
} }
@Override @Override
public AxisAlignedBB getBoundingBox() public AxisAlignedBB getBoundingBox()
{ {
// TODO bounding box // TODO bounding box
return null; return null;
} }
@Override
public AxisAlignedBB getCollisionBox(Entity par1Entity)
{
// TODO bounding box
return null;
}
@Override @Override
public void applyEntityCollision(Entity collidingEnt) // immovable public AxisAlignedBB getCollisionBox(Entity par1Entity)
{ {
} // TODO bounding box
return null;
}
/**
* Called when a player right clicks the crafting Arm
*/
@Override @Override
public boolean interact(EntityPlayer entPlayer) public void applyEntityCollision(Entity collidingEnt) // immovable
{ {
// TODO let the player take whatever the arm is holding? }
return false;
}
/** /**
* Deals with the Claw moving to and hitting the target Item Entity, also * Called when a player right clicks the crafting Arm
* aborts if that moves out of range.
*/ */
private void updateClawMovement() @Override
{ public boolean interact(EntityPlayer entPlayer)
if (itemEntityTarget != null) {
{ // TODO let the player take whatever the arm is holding?
float distance = getDistanceToEntity(itemEntityTarget); return false;
if (distance > MAX_GRAB_DISTANCE) }
{
itemEntityTarget = null;
}
else
{
if (distance < GRAB_CONNECT_DISTANCE)
{
grabItem();
}
else
{
double diffX = posX - itemEntityTarget.posX;
double diffY = posY - itemEntityTarget.posY;
double diffZ = posZ - itemEntityTarget.posZ;
// TODO decide on how fast the claw should move toward the target, and move it
}
}
}
else
{
// TODO claw should return to some sort of 'waiting' position
}
}
/** /**
* On serverside, writes the current local claw position into the dataWatchers. * Deals with the Claw moving to and hitting the target Item Entity, also aborts if that moves
* On client, retrieves the current remote claw values. * out of range.
* Yes DataWatchers lack a Double getter method. */
private void updateClawMovement()
{
if (itemEntityTarget != null)
{
float distance = getDistanceToEntity(itemEntityTarget);
if (distance > MAX_GRAB_DISTANCE)
{
itemEntityTarget = null;
}
else
{
if (distance < GRAB_CONNECT_DISTANCE)
{
grabItem();
}
else
{
double diffX = posX - itemEntityTarget.posX;
double diffY = posY - itemEntityTarget.posY;
double diffZ = posZ - itemEntityTarget.posZ;
// TODO decide on how fast the claw should move toward the target, and move it
}
}
}
else
{
// TODO claw should return to some sort of 'waiting' position
}
}
/**
* On serverside, writes the current local claw position into the dataWatchers. On client,
* retrieves the current remote claw values. Yes DataWatchers lack a Double getter method.
*/ */
private void updateNetworkedClawPosition() private void updateNetworkedClawPosition()
{ {
if (worldObj.isRemote) if (worldObj.isRemote)
{ {
clawPos.x = Double.valueOf(dataWatcher.getWatchableObjectString(5)); clawPos.x = Double.valueOf(dataWatcher.getWatchableObjectString(5));
clawPos.y = Double.valueOf(dataWatcher.getWatchableObjectString(6)); clawPos.y = Double.valueOf(dataWatcher.getWatchableObjectString(6));
clawPos.z = Double.valueOf(dataWatcher.getWatchableObjectString(7)); clawPos.z = Double.valueOf(dataWatcher.getWatchableObjectString(7));
} }
else else
{ {
dataWatcher.updateObject(5, String.valueOf(clawPos.x)); dataWatcher.updateObject(5, String.valueOf(clawPos.x));
dataWatcher.updateObject(6, String.valueOf(clawPos.x)); dataWatcher.updateObject(6, String.valueOf(clawPos.x));
dataWatcher.updateObject(7, String.valueOf(clawPos.x)); dataWatcher.updateObject(7, String.valueOf(clawPos.x));
} }
} }
public ItemStack getCurrentlyHeldItem() public ItemStack getCurrentlyHeldItem()
{ {
return itemStackBeingHeld; return itemStackBeingHeld;
} }
/** /**
* Designate an Item Entity as target for the claw to go to and grab. * Designate an Item Entity as target for the claw to go to and grab.
*
* @param entItem Item Entity instance to grab * @param entItem Item Entity instance to grab
*/ */
private void setTargetEntityItem(EntityItem entItem) private void setTargetEntityItem(EntityItem entItem)
{ {
itemEntityTarget = entItem; itemEntityTarget = entItem;
} }
/** /**
@ -246,20 +244,21 @@ public class EntityCraftingArm extends Entity
*/ */
private void grabItem() private void grabItem()
{ {
itemStackBeingHeld = itemEntityTarget.item; itemStackBeingHeld = itemEntityTarget.item;
playGrabbingEffects(itemEntityTarget.posX, itemEntityTarget.posY, itemEntityTarget.posZ); playGrabbingEffects(itemEntityTarget.posX, itemEntityTarget.posY, itemEntityTarget.posZ);
itemEntityTarget.setDead(); itemEntityTarget.setDead();
itemEntityTarget = null; itemEntityTarget = null;
} }
/** /**
* Displays particles and/or play's sounds to emphasize the claw having grabbed something * Displays particles and/or play's sounds to emphasize the claw having grabbed something
*
* @param posX coordinate of grab * @param posX coordinate of grab
* @param posY coordinate of grab * @param posY coordinate of grab
* @param posZ coordinate of grab * @param posZ coordinate of grab
*/ */
private void playGrabbingEffects(double posX, double posY, double posZ) private void playGrabbingEffects(double posX, double posY, double posZ)
{ {
// TODO sound, particles, etc // TODO sound, particles, etc
} }
} }

View file

@ -33,17 +33,15 @@ public class TaskArmSearch extends Task
this.searchSpeed = searchSpeed; this.searchSpeed = searchSpeed;
} }
@Override @Override
public void onTaskStart() public void onTaskStart()
{ {
List found = tileEntity.worldObj.getEntitiesWithinAABB(entityToInclude, List found = tileEntity.worldObj.getEntitiesWithinAABB(entityToInclude, AxisAlignedBB.getBoundingBox(tileEntity.xCoord - radius, tileEntity.yCoord - radius, tileEntity.zCoord - radius, tileEntity.xCoord + radius, tileEntity.yCoord + radius, tileEntity.zCoord + radius));
AxisAlignedBB.getBoundingBox(tileEntity.xCoord - radius, tileEntity.yCoord - radius, tileEntity.zCoord - radius, if (found != null && !found.isEmpty())
tileEntity.xCoord + radius, tileEntity.yCoord + radius, tileEntity.zCoord + radius)); {
if (found != null && !found.isEmpty()) foundEntity = (Entity) found.get(0);
{ }
foundEntity = (Entity) found.get(0); }
}
}
@Override @Override
protected boolean doTask() protected boolean doTask()