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

View File

@ -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() );
;
}
}

View File

@ -52,7 +52,7 @@ public class RenderTinyTNTPrimed extends Render
{
final BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
GlStateManager.pushMatrix();
GlStateManager.translate( (float) x, (float) y + 0.5F, (float) z );
GlStateManager.translate( (float) x, (float) y + 0.25F, (float) z );
float f2;
if( tnt.getFuse() - life + 1.0F < 10.0F )

View File

@ -1,81 +1,41 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"parent": "block/block",
"elements": [
{
"from": [ 4, 0, 4 ],
"to": [ 12, 8, 12 ],
"faces": {
"down": {
"texture": "#2",
"uv": [
0.0,
0.0,
16.0,
16.0
]
"texture": "#bottom",
"uv": [ 0, 0, 16, 16 ]
},
"east": {
"texture": "#0",
"uv": [
0.0,
0.0,
16.0,
16.0
]
"texture": "#side",
"uv": [ 0, 0, 16, 16 ]
},
"north": {
"texture": "#0",
"uv": [
0.0,
0.0,
16.0,
16.0
]
"texture": "#side",
"uv": [ 0, 0, 16, 16 ]
},
"south": {
"texture": "#0",
"uv": [
0.0,
0.0,
16.0,
16.0
]
"texture": "#side",
"uv": [ 0, 0, 16, 16 ]
},
"up": {
"texture": "#1",
"uv": [
0.0,
0.0,
16.0,
16.0
]
"texture": "#top",
"uv": [ 0, 0, 16, 16 ]
},
"west": {
"texture": "#0",
"uv": [
0.0,
0.0,
16.0,
16.0
]
"texture": "#side",
"uv": [ 0, 0, 16, 16 ]
}
},
"from": [
4.0,
0.0,
4.0
],
"name": "Cube",
"to": [
12.0,
8.0,
12.0
]
}
}
],
"parent": "block/block",
"textures": {
"particle": "blocks/tnt_bottom",
"0": "blocks/tnt_side",
"1": "blocks/tnt_top",
"2": "blocks/tnt_bottom"
"particle": "blocks/tnt_side",
"side": "blocks/tnt_side",
"top": "blocks/tnt_top",
"bottom": "blocks/tnt_bottom"
}
}