Fixes #2499: Tiny TNT model and hitbox not aligned.

Fixes entity renderer translating it 1/4 block to high compared to the
hitbox.
Fixed the hitbox being either a bit too small or too large depending on
the used constructor.
Updated the model for tiny TNT to be a bit more compact.
This commit is contained in:
yueh
2016-10-24 13:11:01 +02:00
parent 0dcdc2e265
commit 581822b234
3 changed files with 30 additions and 67 deletions
@@ -49,17 +49,20 @@ import appeng.util.Platform;
public final class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntityAdditionalSpawnData
{
private static final float SIZE = .5f;
@Reflected
public EntityTinyTNTPrimed( final World w )
{
super( w );
this.setSize( 0.35F, 0.35F );
this.setSize( SIZE, SIZE );
}
public EntityTinyTNTPrimed( final World w, final double x, final double y, final double z, final EntityLivingBase igniter )
{
super( w, x, y, z, igniter );
this.setSize( 0.55F, 0.55F );
this.setSize( SIZE, SIZE );
// this.yOffset = this.height / 2.0F;
}
@@ -89,8 +92,7 @@ public final class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit
if( this.isInWater() && Platform.isServer() ) // put out the fuse.
{
AEApi.instance().definitions().blocks().tinyTNT().maybeStack( 1 ).ifPresent( tntStack ->
{
AEApi.instance().definitions().blocks().tinyTNT().maybeStack( 1 ).ifPresent( tntStack -> {
final EntityItem item = new EntityItem( this.worldObj, this.posX, this.posY, this.posZ, tntStack );
item.motionX = this.motionX;
@@ -162,7 +164,7 @@ public final class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit
if( strength > 0.01 )
{
if( block.getMaterial(state) != Material.AIR )
if( block.getMaterial( state ) != Material.AIR )
{
if( block.canDropFromExplosion( ex ) )
{
@@ -190,6 +192,7 @@ public final class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit
@Override
public void readSpawnData( final ByteBuf data )
{
this.setFuse( data.readByte() );;
this.setFuse( data.readByte() );
;
}
}