From ac74b1fbd3d1e552514103033d69e4818661d84e Mon Sep 17 00:00:00 2001 From: Sollace Date: Sun, 27 Sep 2020 18:49:39 +0200 Subject: [PATCH] Changelings disguised as blocks shouldn't overlap real blocks --- .../unicopia/entity/behaviour/EntityBehaviour.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/minelittlepony/unicopia/entity/behaviour/EntityBehaviour.java b/src/main/java/com/minelittlepony/unicopia/entity/behaviour/EntityBehaviour.java index 419f9724..8757dd19 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/behaviour/EntityBehaviour.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/behaviour/EntityBehaviour.java @@ -17,6 +17,7 @@ import net.minecraft.entity.passive.TameableEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.util.Identifier; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; import net.minecraft.util.registry.Registry; @@ -49,6 +50,12 @@ public class EntityBehaviour { double y = positionOffset.y + Math.floor(from.getY()); double z = positionOffset.z + Math.floor(from.getZ()) + 0.5; + BlockPos pos = new BlockPos(x, y, z); + + if (!from.world.isAir(pos) && !from.world.isWater(pos)) { + y++; + } + to.prevX = x; to.prevY = y; to.prevZ = z;