mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-23 21:38:00 +01:00
Changelings disguised as blocks shouldn't overlap real blocks
This commit is contained in:
parent
e8b970bd82
commit
ac74b1fbd3
1 changed files with 7 additions and 0 deletions
|
@ -17,6 +17,7 @@ import net.minecraft.entity.passive.TameableEntity;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.Vec3d;
|
||||||
import net.minecraft.util.registry.Registry;
|
import net.minecraft.util.registry.Registry;
|
||||||
|
|
||||||
|
@ -49,6 +50,12 @@ public class EntityBehaviour<T extends Entity> {
|
||||||
double y = positionOffset.y + Math.floor(from.getY());
|
double y = positionOffset.y + Math.floor(from.getY());
|
||||||
double z = positionOffset.z + Math.floor(from.getZ()) + 0.5;
|
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.prevX = x;
|
||||||
to.prevY = y;
|
to.prevY = y;
|
||||||
to.prevZ = z;
|
to.prevZ = z;
|
||||||
|
|
Loading…
Reference in a new issue