diff --git a/src/main/java/com/minelittlepony/pony/data/IPony.java b/src/main/java/com/minelittlepony/pony/data/IPony.java index aec13f04..47481dba 100644 --- a/src/main/java/com/minelittlepony/pony/data/IPony.java +++ b/src/main/java/com/minelittlepony/pony/data/IPony.java @@ -46,6 +46,11 @@ public interface IPony { */ boolean isFullySubmerged(EntityLivingBase entity); + /** + * Returns true if the provided entity is partially submerged. That is if any part of it is in contact with water. + */ + boolean isPartiallySubmerged(EntityLivingBase entity); + /** * Returns true if an entity is wearing any headgear. This is used to hide things like the snout when wearing items * such as the pumpkin, a player's head, or any other types of blocks. diff --git a/src/main/java/com/minelittlepony/pony/data/Pony.java b/src/main/java/com/minelittlepony/pony/data/Pony.java index 3201d5cf..dfdc82d3 100644 --- a/src/main/java/com/minelittlepony/pony/data/Pony.java +++ b/src/main/java/com/minelittlepony/pony/data/Pony.java @@ -124,6 +124,12 @@ public class Pony implements IPony { return isFullySubmerged(entity) && !(entity.onGround || entity.isOnLadder()); } + @Override + public boolean isPartiallySubmerged(EntityLivingBase entity) { + return entity.isInWater() + || entity.getEntityWorld().getBlockState(new BlockPos(entity.posX, entity.posY, entity.posZ)).getMaterial() == Material.WATER; + } + @Override public boolean isFullySubmerged(EntityLivingBase entity) { return entity.isInWater() diff --git a/src/main/java/com/minelittlepony/render/player/RenderSeaponyPlayer.java b/src/main/java/com/minelittlepony/render/player/RenderSeaponyPlayer.java index de5303bd..37a80554 100644 --- a/src/main/java/com/minelittlepony/render/player/RenderSeaponyPlayer.java +++ b/src/main/java/com/minelittlepony/render/player/RenderSeaponyPlayer.java @@ -22,7 +22,7 @@ public class RenderSeaponyPlayer extends RenderPonyPlayer { public IPony getEntityPony(AbstractClientPlayer player) { IPony pony = super.getEntityPony(player); - boolean wet = pony.isFullySubmerged(player); + boolean wet = pony.isPartiallySubmerged(player); mainModel = renderPony.setPonyModel(wet ? seapony : normalPony);