Smooth enough for now.

Signing off, will do more work tomorrow.
This commit is contained in:
Aidan Brady 2013-08-03 04:04:42 -04:00
parent 06000aff4c
commit dae86c39e9

View file

@ -1,6 +1,5 @@
package resonantinduction.contractor; package resonantinduction.contractor;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@ -13,8 +12,8 @@ import net.minecraftforge.common.ForgeDirection;
public class TileEntityEMContractor extends TileEntity public class TileEntityEMContractor extends TileEntity
{ {
public static int MAX_REACH = 40; public static int MAX_REACH = 40;
public static double MAX_SPEED = .4; public static double MAX_SPEED = .1;
public static double ACCELERATION = .05; public static double ACCELERATION = .01;
private ForgeDirection facing = ForgeDirection.UP; private ForgeDirection facing = ForgeDirection.UP;
@ -41,62 +40,80 @@ public class TileEntityEMContractor extends TileEntity
switch(facing) switch(facing)
{ {
case DOWN: case DOWN:
entityItem.setPosition(xCoord+0.5, entityItem.posY, zCoord+0.5); if(!worldObj.isRemote)
{
entityItem.setPosition(xCoord+0.5, entityItem.posY, zCoord+0.5);
}
entityItem.motionX = 0; entityItem.motionX = 0;
entityItem.motionZ = 0; entityItem.motionZ = 0;
entityItem.motionY = Math.max(-MAX_SPEED, entityItem.motionY-ACCELERATION); entityItem.motionY = Math.max(-MAX_SPEED, entityItem.motionY-ACCELERATION);
entityItem.isAirBorne = true; entityItem.isAirBorne = true;
break; break;
case UP: case UP:
entityItem.setPosition(xCoord+0.5, entityItem.posY, zCoord+0.5); if(!worldObj.isRemote)
{
entityItem.setPosition(xCoord+0.5, entityItem.posY, zCoord+0.5);
}
entityItem.motionX = 0; entityItem.motionX = 0;
entityItem.motionZ = 0; entityItem.motionZ = 0;
entityItem.motionY = Math.min(MAX_SPEED, entityItem.motionY+ACCELERATION); entityItem.motionY = Math.min((MAX_SPEED*4), entityItem.motionY+(ACCELERATION*5));
entityItem.isAirBorne = true; entityItem.isAirBorne = true;
break; break;
case NORTH: case NORTH:
entityItem.setPosition(entityItem.posX, yCoord+0.5, zCoord+0.5); if(!worldObj.isRemote)
{
entityItem.setPosition(entityItem.posX, yCoord+0.5, zCoord+0.5);
}
entityItem.motionY = 0; entityItem.motionY = 0;
entityItem.motionZ = 0; entityItem.motionZ = 0;
entityItem.motionX = Math.min(MAX_SPEED, entityItem.motionZ+ACCELERATION); entityItem.motionX = Math.min(MAX_SPEED, entityItem.motionX+ACCELERATION);
entityItem.isAirBorne = true; entityItem.isAirBorne = true;
break; break;
case SOUTH: case SOUTH:
entityItem.setPosition(entityItem.posX, yCoord+0.5, zCoord+0.5); if(!worldObj.isRemote)
{
entityItem.setPosition(entityItem.posX, yCoord+0.5, zCoord+0.5);
}
entityItem.motionY = 0; entityItem.motionY = 0;
entityItem.motionZ = 0; entityItem.motionZ = 0;
entityItem.motionX = Math.max(-MAX_SPEED, entityItem.motionZ-ACCELERATION); entityItem.motionX = Math.max(-MAX_SPEED, entityItem.motionX-ACCELERATION);
entityItem.isAirBorne = true; entityItem.isAirBorne = true;
break; break;
case WEST: case WEST:
entityItem.setPosition(xCoord+0.5, yCoord+0.5, entityItem.posZ); if(!worldObj.isRemote)
{
entityItem.setPosition(xCoord+0.5, yCoord+0.5, entityItem.posZ);
}
entityItem.motionX = 0; entityItem.motionX = 0;
entityItem.motionY = 0; entityItem.motionY = 0;
entityItem.motionZ = Math.min(MAX_SPEED, entityItem.motionX+ACCELERATION); entityItem.motionZ = Math.min(MAX_SPEED, entityItem.motionZ+ACCELERATION);
entityItem.isAirBorne = true; entityItem.isAirBorne = true;
break; break;
case EAST: case EAST:
entityItem.setPosition(xCoord+0.5, yCoord+0.5, entityItem.posZ); if(!worldObj.isRemote)
{
entityItem.setPosition(xCoord+0.5, yCoord+0.5, entityItem.posZ);
}
entityItem.motionX = 0; entityItem.motionX = 0;
entityItem.motionY = 0; entityItem.motionY = 0;
entityItem.motionZ = Math.max(-MAX_SPEED, entityItem.motionX-ACCELERATION); entityItem.motionZ = Math.max(-MAX_SPEED, entityItem.motionZ-ACCELERATION);
entityItem.isAirBorne = true; entityItem.isAirBorne = true;
break; break;