This commit is contained in:
Calclavia 2013-08-03 12:59:54 -04:00
commit dca07d2cf1
5 changed files with 56 additions and 10 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View file

@ -37,12 +37,14 @@ public class BlockEMContractor extends BlockBase implements ITileEntityProvider
@Override @Override
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{ {
TileEntityEMContractor contractor = (TileEntityEMContractor)par1World.getBlockTileEntity(par2, par3, par4);
if(!par5EntityPlayer.isSneaking()) if(!par5EntityPlayer.isSneaking())
{ {
TileEntityEMContractor contractor = (TileEntityEMContractor)par1World.getBlockTileEntity(par2, par3, par4);
contractor.incrementFacing(); contractor.incrementFacing();
}
return true; else {
contractor.suck = !contractor.suck;
} }
return true; return true;

View file

@ -48,7 +48,13 @@ public class TileEntityEMContractor extends TileEntity
entityItem.motionX = 0; entityItem.motionX = 0;
entityItem.motionZ = 0; entityItem.motionZ = 0;
entityItem.motionY = Math.max(-MAX_SPEED, entityItem.motionY-ACCELERATION); if(!suck)
{
entityItem.motionY = Math.max(-MAX_SPEED, entityItem.motionY-ACCELERATION);
}
else {
entityItem.motionY = Math.min((MAX_SPEED*4), entityItem.motionY+(ACCELERATION*5));
}
entityItem.isAirBorne = true; entityItem.isAirBorne = true;
break; break;
@ -61,7 +67,13 @@ public class TileEntityEMContractor extends TileEntity
entityItem.motionX = 0; entityItem.motionX = 0;
entityItem.motionZ = 0; entityItem.motionZ = 0;
entityItem.motionY = Math.min((MAX_SPEED*4), entityItem.motionY+(ACCELERATION*5)); if(!suck)
{
entityItem.motionY = Math.min((MAX_SPEED*4), entityItem.motionY+(ACCELERATION*5));
}
else {
entityItem.motionY = Math.max(-MAX_SPEED, entityItem.motionY-ACCELERATION);
}
entityItem.isAirBorne = true; entityItem.isAirBorne = true;
break; break;
@ -74,7 +86,13 @@ public class TileEntityEMContractor extends TileEntity
entityItem.motionY = 0; entityItem.motionY = 0;
entityItem.motionZ = 0; entityItem.motionZ = 0;
entityItem.motionX = Math.min(MAX_SPEED, entityItem.motionX+ACCELERATION); if(!suck)
{
entityItem.motionX = Math.min(MAX_SPEED, entityItem.motionX+ACCELERATION);
}
else {
entityItem.motionX = Math.max(-MAX_SPEED, entityItem.motionX-ACCELERATION);
}
entityItem.isAirBorne = true; entityItem.isAirBorne = true;
break; break;
@ -87,7 +105,13 @@ public class TileEntityEMContractor extends TileEntity
entityItem.motionY = 0; entityItem.motionY = 0;
entityItem.motionZ = 0; entityItem.motionZ = 0;
entityItem.motionX = Math.max(-MAX_SPEED, entityItem.motionX-ACCELERATION); if(!suck)
{
entityItem.motionX = Math.max(-MAX_SPEED, entityItem.motionX-ACCELERATION);
}
else {
entityItem.motionX = Math.min(MAX_SPEED, entityItem.motionX+ACCELERATION);
}
entityItem.isAirBorne = true; entityItem.isAirBorne = true;
break; break;
@ -100,7 +124,13 @@ public class TileEntityEMContractor extends TileEntity
entityItem.motionX = 0; entityItem.motionX = 0;
entityItem.motionY = 0; entityItem.motionY = 0;
entityItem.motionZ = Math.min(MAX_SPEED, entityItem.motionZ+ACCELERATION); if(!suck)
{
entityItem.motionZ = Math.min(MAX_SPEED, entityItem.motionZ+ACCELERATION);
}
else {
entityItem.motionZ = Math.max(-MAX_SPEED, entityItem.motionZ-ACCELERATION);
}
entityItem.isAirBorne = true; entityItem.isAirBorne = true;
break; break;
@ -113,7 +143,13 @@ public class TileEntityEMContractor extends TileEntity
entityItem.motionX = 0; entityItem.motionX = 0;
entityItem.motionY = 0; entityItem.motionY = 0;
entityItem.motionZ = Math.max(-MAX_SPEED, entityItem.motionZ-ACCELERATION); if(!suck)
{
entityItem.motionZ = Math.max(-MAX_SPEED, entityItem.motionZ-ACCELERATION);
}
else {
entityItem.motionZ = Math.min(MAX_SPEED, entityItem.motionZ+ACCELERATION);
}
entityItem.isAirBorne = true; entityItem.isAirBorne = true;
break; break;

View file

@ -14,6 +14,7 @@ public class RenderEMContractor extends TileEntitySpecialRenderer
{ {
public static final ModelEMContractor MODEL = new ModelEMContractor(); public static final ModelEMContractor MODEL = new ModelEMContractor();
public static final ResourceLocation TEXTURE = new ResourceLocation(ResonantInduction.DOMAIN, ResonantInduction.MODEL_TEXTURE_DIRECTORY + "em_contractor.png"); public static final ResourceLocation TEXTURE = new ResourceLocation(ResonantInduction.DOMAIN, ResonantInduction.MODEL_TEXTURE_DIRECTORY + "em_contractor.png");
public static final ResourceLocation TEXTURE_PUSH = new ResourceLocation(ResonantInduction.DOMAIN, ResonantInduction.MODEL_TEXTURE_DIRECTORY + "em_contractor_push.png");
@Override @Override
public void renderTileEntityAt(TileEntity t, double x, double y, double z, float f) public void renderTileEntityAt(TileEntity t, double x, double y, double z, float f)
@ -48,7 +49,14 @@ public class RenderEMContractor extends TileEntitySpecialRenderer
break; break;
} }
this.func_110628_a(TEXTURE); if(((TileEntityEMContractor)t).suck)
{
this.func_110628_a(TEXTURE);
}
else {
this.func_110628_a(TEXTURE_PUSH);
}
MODEL.render(0.0625f); MODEL.render(0.0625f);
GL11.glPopMatrix(); GL11.glPopMatrix();