Mojira Archive
MC-50079

Blocks are not affected properly by explosions

This bug is in 1.7.2, and probably in all versions after as I have not seen it reported.

Blocks are not affected properly by explosions due to the following error in the Entity class:

Entity.java
public float func_145772_a(Explosion p_145772_1_, World p_145772_2_, int p_145772_3_, int p_145772_4_, int p_145772_5_, Block p_145772_6_)
{
        return p_145772_6_.getExplosionResistance(this, p_145772_2_, p_145772_3_, p_145772_3_, p_145772_4_, posX, posY + getEyeHeight(), posZ);
}

Notice that par3 is passed TWICE, as in (x, x, y) for the coordinates rather than (x, y, z).

EDIT: By "not affected properly", I mean that the block's actual explosion resistance may not be taken into account, but instead will be calculated using a block at different coordinates.l

For vanilla blocks, this is never noticed because par6 is a Block, so the correct block type is used to check explosion resistance and vanilla block explosion resistance does not depend on coordinates; to test, create a block that returns different explosion resistance based on its metadata state, and the issue will quickly become clear.

Invalid

Brian Sandall

[Mojang] Searge (Michael Stoyke)

2014-03-03, 05:46 AM

2014-08-26, 05:33 PM

2014-08-26, 11:06 AM

1

4

Plausible

Minecraft 1.7.4 - Minecraft 1.8-pre2Minecraft 1.7.4, Minecraft 1.7.10, Minecraft 14w33c, Minecraft 14w34a, Minecraft 14w34b, Minecraft 14w34c, Minecraft 14w34d, Minecraft 1.8-pre1, Minecraft 1.8-pre2

-