Fixed above water check breaking horses
@@ -48,13 +48,14 @@ public class Jesus extends ToggleMod {
&& !getLocalPlayer().isSneaking()
&& getLocalPlayer().fallDistance < 3
&& !isInWater(getLocalPlayer())
- && isAboveWater(getLocalPlayer(), false)
+ && (isAboveWater(getLocalPlayer(), false) || isAboveWater(getRidingEntity(), false))
&& isAboveBlock(getLocalPlayer(), event.getPos())) {
AxisAlignedBB axisalignedbb = WATER_WALK_AA.offset(event.getPos());
if (event.getEntityBox().intersects(axisalignedbb)) event.getCollidingBoxes().add(axisalignedbb);
// cancel event, which will stop it from calling the original code
event.setCanceled(true);
}
+
}
@SubscribeEvent
@@ -86,7 +87,9 @@ public class Jesus extends ToggleMod {
}
private static boolean isAboveWater(Entity entity, boolean packet){
- double y = entity.posY - (packet ? 0.03 : 0.2); // increasing this seems to flag more in NCP but needs to be increased so the player lands on solid water
+ if (entity == null) return false;
+
+ double y = entity.posY - (packet ? 0.03 : (EntityUtils.isPlayer(entity) ? 0.2 : 0.5)); // increasing this seems to flag more in NCP but needs to be increased so the player lands on solid water
for(int x = MathHelper.floor(entity.posX); x < MathHelper.ceil(entity.posX); x++)
for (int z = MathHelper.floor(entity.posZ); z < MathHelper.ceil(entity.posZ); z++) {
