Moved Stuff and toyed with belts

no major changes just yet, need to teach my new coders how to make mods
first.
This commit is contained in:
Rseifert 2012-11-06 01:35:24 -05:00
parent 8be97739c9
commit 449890530c
13 changed files with 43 additions and 18 deletions

1
.gitignore vendored
View file

@ -10,6 +10,7 @@
/reobf/* /reobf/*
/runtime/* /runtime/*
/temp/* /temp/*
/src/minecraft/assemblyline/textures/*
CHANGELOG CHANGELOG
LICENSE.txt LICENSE.txt
*.bat *.bat

View file

@ -1 +1 @@
9 9

View file

@ -5,3 +5,4 @@
@ AssemblyLine_v0.0.6.6.jar @ AssemblyLine_v0.0.6.6.jar
@ AssemblyLine_v0.0.6.7.jar @ AssemblyLine_v0.0.6.7.jar
@ AssemblyLine_v0.0.6.8.jar AssemblyLine_v0.0.6.8_api.zip @ AssemblyLine_v0.0.6.8.jar AssemblyLine_v0.0.6.8_api.zip
stable AssemblyLine_v0.0.6.10.jar AssemblyLine_v0.0.6.10_api.zip

View file

@ -0,0 +1,17 @@
package assemblyline.api;
import net.minecraft.src.ItemStack;
import universalelectricity.core.Vector3;
public interface IManipulator
{
/**
* Throws the items from the manipulator into the world
* @param outputPosition
* @param items
*/
public void rejectItem(Vector3 outputPosition, ItemStack items);
//TODO add a few more methods here to access the functions the manipulator
//can do. For example storing items, and retrieving items, or power on/off
}

View file

@ -159,18 +159,22 @@ public class TileEntityConveyorBelt extends TileEntityElectricityReceiver implem
if (direction == 0) if (direction == 0)
{ {
entity.motionZ -= 1 * this.speed; entity.motionZ -= 1 * this.speed;
entity.posX = this.xCoord +0.5D;
} }
if (direction == 1) if (direction == 1)
{ {
entity.motionX += 1 * this.speed; entity.motionX += 1 * this.speed;
entity.posZ = this.zCoord +0.5D;
} }
if (direction == 2) if (direction == 2)
{ {
entity.motionZ += 1 * this.speed; entity.motionZ += 1 * this.speed;
entity.posX = this.xCoord +0.5D;
} }
if (direction == 3) if (direction == 3)
{ {
entity.motionX -= 1 * this.speed; entity.motionX -= 1 * this.speed;
entity.posZ = this.zCoord +0.5D;
} }
} }
} }

View file

@ -24,9 +24,10 @@ import universalelectricity.prefab.TileEntityElectricityReceiver;
import universalelectricity.prefab.network.IPacketReceiver; import universalelectricity.prefab.network.IPacketReceiver;
import universalelectricity.prefab.network.PacketManager; import universalelectricity.prefab.network.PacketManager;
import assemblyline.AssemblyLine; import assemblyline.AssemblyLine;
import assemblyline.api.IManipulator;
import assemblyline.machines.BlockMulti.MachineType; import assemblyline.machines.BlockMulti.MachineType;
public class TileEntityManipulator extends TileEntityElectricityReceiver implements IRedstoneReceptor, IPacketReceiver public class TileEntityManipulator extends TileEntityElectricityReceiver implements IRedstoneReceptor, IPacketReceiver,IManipulator
{ {
/** /**
* Joules required to run this thing. * Joules required to run this thing.
@ -104,16 +105,9 @@ public class TileEntityManipulator extends TileEntityElectricityReceiver impleme
remainingStack = this.tryPlaceInPosition(remainingStack, outputPosition, this.getBeltDirection().getOpposite()); remainingStack = this.tryPlaceInPosition(remainingStack, outputPosition, this.getBeltDirection().getOpposite());
} }
if (remainingStack != null) if (remainingStack != null && remainingStack.stackSize > 0)
{ {
if (remainingStack.stackSize > 0) this.rejectItem(outputPosition, remainingStack);
{
EntityItem entityItem = new EntityItem(worldObj, outputPosition.x + 0.5, outputPosition.y + 0.8, outputPosition.z + 0.5, remainingStack);
entityItem.motionX = 0;
entityItem.motionZ = 0;
entityItem.motionY /= 5;
worldObj.spawnEntityInWorld(entityItem);
}
} }
entity.setDead(); entity.setDead();
@ -159,11 +153,7 @@ public class TileEntityManipulator extends TileEntityElectricityReceiver impleme
{ {
if (itemStack.stackSize > 0) if (itemStack.stackSize > 0)
{ {
EntityItem entityItem = new EntityItem(worldObj, outputPosition.x + 0.5, outputPosition.y + 0.8, outputPosition.z + 0.5, itemStack); this.rejectItem(outputPosition, itemStack);
entityItem.motionX = 0;
entityItem.motionZ = 0;
entityItem.motionY /= 5;
worldObj.spawnEntityInWorld(entityItem);
} }
} }
} }
@ -173,7 +163,19 @@ public class TileEntityManipulator extends TileEntityElectricityReceiver impleme
} }
} }
} }
/**
* Throws the items from the manipulator into the world
* @param outputPosition
* @param items
*/
public void rejectItem(Vector3 outputPosition, ItemStack items)
{
EntityItem entityItem = new EntityItem(worldObj, outputPosition.x + 0.5, outputPosition.y + 0.8, outputPosition.z + 0.5, items);
entityItem.motionX = 0;
entityItem.motionZ = 0;
entityItem.motionY /= 5;
worldObj.spawnEntityInWorld(entityItem);
}
/** /**
* Tries to place an itemStack in a specific * Tries to place an itemStack in a specific
* position if it is an inventory. * position if it is an inventory.

View file

@ -78,7 +78,7 @@ public class TileEntityRejector extends TileEntityElectricityReceiver implements
if (this.ticks % 5 == 0 && !this.isDisabled()) if (this.ticks % 5 == 0 && !this.isDisabled())
{ {
//TODO remove after testing //TODO remove after testing
this.wattsReceived += 100; //this.wattsReceived += 100;
int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
this.firePiston = false; this.firePiston = false;