Smooth enough for now.
Signing off, will do more work tomorrow.
This commit is contained in:
parent
06000aff4c
commit
dae86c39e9
1 changed files with 32 additions and 15 deletions
|
@ -1,6 +1,5 @@
|
|||
package resonantinduction.contractor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
|
@ -13,8 +12,8 @@ import net.minecraftforge.common.ForgeDirection;
|
|||
public class TileEntityEMContractor extends TileEntity
|
||||
{
|
||||
public static int MAX_REACH = 40;
|
||||
public static double MAX_SPEED = .4;
|
||||
public static double ACCELERATION = .05;
|
||||
public static double MAX_SPEED = .1;
|
||||
public static double ACCELERATION = .01;
|
||||
|
||||
private ForgeDirection facing = ForgeDirection.UP;
|
||||
|
||||
|
@ -41,7 +40,10 @@ public class TileEntityEMContractor extends TileEntity
|
|||
switch(facing)
|
||||
{
|
||||
case DOWN:
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
entityItem.setPosition(xCoord+0.5, entityItem.posY, zCoord+0.5);
|
||||
}
|
||||
|
||||
entityItem.motionX = 0;
|
||||
entityItem.motionZ = 0;
|
||||
|
@ -51,52 +53,67 @@ public class TileEntityEMContractor extends TileEntity
|
|||
entityItem.isAirBorne = true;
|
||||
break;
|
||||
case UP:
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
entityItem.setPosition(xCoord+0.5, entityItem.posY, zCoord+0.5);
|
||||
}
|
||||
|
||||
entityItem.motionX = 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;
|
||||
break;
|
||||
case NORTH:
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
entityItem.setPosition(entityItem.posX, yCoord+0.5, zCoord+0.5);
|
||||
}
|
||||
|
||||
entityItem.motionY = 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;
|
||||
break;
|
||||
case SOUTH:
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
entityItem.setPosition(entityItem.posX, yCoord+0.5, zCoord+0.5);
|
||||
}
|
||||
|
||||
entityItem.motionY = 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;
|
||||
break;
|
||||
case WEST:
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
entityItem.setPosition(xCoord+0.5, yCoord+0.5, entityItem.posZ);
|
||||
}
|
||||
|
||||
entityItem.motionX = 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;
|
||||
break;
|
||||
case EAST:
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
entityItem.setPosition(xCoord+0.5, yCoord+0.5, entityItem.posZ);
|
||||
}
|
||||
|
||||
entityItem.motionX = 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;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue