diff --git a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/entity/furniture/hitbox/ShulkerHitBox.java b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/entity/furniture/hitbox/ShulkerHitBox.java index f4bcbebb7..fa1878850 100644 --- a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/entity/furniture/hitbox/ShulkerHitBox.java +++ b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/entity/furniture/hitbox/ShulkerHitBox.java @@ -44,11 +44,23 @@ public class ShulkerHitBox extends AbstractHitBox { if (this.interactionEntity) { // make it a litter bigger - InteractionEntityData.Height.addEntityDataIfNotDefaultValue(getPhysicalPeek(peek * 0.01F) * scale + 1.01f, cachedInteractionValues); + InteractionEntityData.Height.addEntityDataIfNotDefaultValue((float) (getHeight(peek, scale, direction) + 0.01f), cachedInteractionValues); InteractionEntityData.Width.addEntityDataIfNotDefaultValue(scale + 0.005f, cachedInteractionValues); InteractionEntityData.Responsive.addEntityDataIfNotDefaultValue(interactive, cachedInteractionValues); } } + private static double getHeight(byte inPeek, float scale, Direction direction) { + float peek = getPhysicalPeek(inPeek * 0.01F); + double y1 = 0.0; + double y2 = scale; + double dy = (double) direction.stepY() * peek * (double) scale; + if (dy > 0) { + y2 += dy; + } else if (dy < 0) { + y1 += dy; + } + return y2 - y1; + } @Override public Optional optionalCollider() {