Fix lighting rod height calculation (#3167). Thanks to Gaider10
This commit is contained in:
parent
c31a400725
commit
5045566a98
1 changed files with 3 additions and 3 deletions
|
@ -97,8 +97,8 @@ public class LightningRodBlockEntity extends PowerAcceptorBlockEntity implements
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getLightningStrikeMultiplier() {
|
public float getLightningStrikeMultiplier() {
|
||||||
final float actualHeight = 256;
|
final float actualHeight = world.getTopY();
|
||||||
final float groundLevel = world.getTopPosition(Heightmap.Type.MOTION_BLOCKING, getPos()).getY();
|
final float groundLevel = world.getSeaLevel() + 1;
|
||||||
for (int i = pos.getY() + 1; i < actualHeight; i++) {
|
for (int i = pos.getY() + 1; i < actualHeight; i++) {
|
||||||
if (!isValidIronFence(i)) {
|
if (!isValidIronFence(i)) {
|
||||||
if (groundLevel >= i)
|
if (groundLevel >= i)
|
||||||
|
@ -108,7 +108,7 @@ public class LightningRodBlockEntity extends PowerAcceptorBlockEntity implements
|
||||||
return 1.2F - got / max;
|
return 1.2F - got / max;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 4F;
|
return 0.2F;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isValidIronFence(int y) {
|
public boolean isValidIronFence(int y) {
|
||||||
|
|
Loading…
Reference in a new issue