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/*
/runtime/*
/temp/*
/src/minecraft/assemblyline/textures/*
CHANGELOG
LICENSE.txt
*.bat

View file

@ -5,3 +5,4 @@
@ AssemblyLine_v0.0.6.6.jar
@ AssemblyLine_v0.0.6.7.jar
@ 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)
{
entity.motionZ -= 1 * this.speed;
entity.posX = this.xCoord +0.5D;
}
if (direction == 1)
{
entity.motionX += 1 * this.speed;
entity.posZ = this.zCoord +0.5D;
}
if (direction == 2)
{
entity.motionZ += 1 * this.speed;
entity.posX = this.xCoord +0.5D;
}
if (direction == 3)
{
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.PacketManager;
import assemblyline.AssemblyLine;
import assemblyline.api.IManipulator;
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.
@ -104,16 +105,9 @@ public class TileEntityManipulator extends TileEntityElectricityReceiver impleme
remainingStack = this.tryPlaceInPosition(remainingStack, outputPosition, this.getBeltDirection().getOpposite());
}
if (remainingStack != null)
if (remainingStack != null && remainingStack.stackSize > 0)
{
if (remainingStack.stackSize > 0)
{
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);
}
this.rejectItem(outputPosition, remainingStack);
}
entity.setDead();
@ -159,11 +153,7 @@ public class TileEntityManipulator extends TileEntityElectricityReceiver impleme
{
if (itemStack.stackSize > 0)
{
EntityItem entityItem = new EntityItem(worldObj, outputPosition.x + 0.5, outputPosition.y + 0.8, outputPosition.z + 0.5, itemStack);
entityItem.motionX = 0;
entityItem.motionZ = 0;
entityItem.motionY /= 5;
worldObj.spawnEntityInWorld(entityItem);
this.rejectItem(outputPosition, itemStack);
}
}
}
@ -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
* 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())
{
//TODO remove after testing
this.wattsReceived += 100;
//this.wattsReceived += 100;
int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
this.firePiston = false;