diff --git a/src/main/java/com/minelittlepony/unicopia/client/render/EntityDisguiseRenderer.java b/src/main/java/com/minelittlepony/unicopia/client/render/EntityDisguiseRenderer.java index 40a83c9d..74137b58 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/render/EntityDisguiseRenderer.java +++ b/src/main/java/com/minelittlepony/unicopia/client/render/EntityDisguiseRenderer.java @@ -9,7 +9,6 @@ import com.minelittlepony.unicopia.entity.behaviour.Disguise; import com.minelittlepony.unicopia.entity.behaviour.EntityAppearance; import com.minelittlepony.unicopia.mixin.MixinBlockEntity; -import net.minecraft.block.BlockState; import net.minecraft.block.entity.BlockEntity; import net.minecraft.client.MinecraftClient; import net.minecraft.client.render.OverlayTexture; @@ -19,10 +18,7 @@ import net.minecraft.client.render.entity.LivingEntityRenderer; import net.minecraft.client.render.entity.model.BipedEntityModel; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.Entity; -import net.minecraft.state.property.Properties; -import net.minecraft.util.math.Direction; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.RotationAxis; import net.minecraft.util.math.Vec3d; class EntityDisguiseRenderer { @@ -90,15 +86,7 @@ class EntityDisguiseRenderer { ((MixinBlockEntity)blockEntity).setPos(e.getBlockPos()); blockEntity.setWorld(e.getWorld()); matrices.push(); - - BlockState state = blockEntity.getCachedState(); - Direction direction = state.contains(Properties.HORIZONTAL_FACING) ? state.get(Properties.HORIZONTAL_FACING) : Direction.UP; - matrices.translate(x, y, z); - - matrices.multiply(direction.getRotationQuaternion()); - matrices.multiply(RotationAxis.NEGATIVE_X.rotationDegrees(90)); - matrices.translate(-0.5, 0, -0.5); r.render(blockEntity, 1, matrices, vertexConsumers, light, OverlayTexture.DEFAULT_UV); 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 a04113e6..09511f47 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/behaviour/EntityBehaviour.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/behaviour/EntityBehaviour.java @@ -34,7 +34,6 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.projectile.LlamaSpitEntity; import net.minecraft.entity.projectile.thrown.SnowballEntity; import net.minecraft.item.ItemStack; -import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; import net.minecraft.registry.Registry; @@ -138,12 +137,6 @@ public class EntityBehaviour { double y = positionOffset.y + Math.floor(from.getY()); double z = positionOffset.z + Math.floor(from.getZ()) + 0.5; - BlockPos pos = BlockPos.ofFloored(x, y, z); - - if (!from.getWorld().isAir(pos) && !from.getWorld().isWater(pos)) { - y++; - } - to.prevX = x; to.prevY = y; to.prevZ = z; diff --git a/src/main/java/com/minelittlepony/unicopia/entity/behaviour/FallingBlockBehaviour.java b/src/main/java/com/minelittlepony/unicopia/entity/behaviour/FallingBlockBehaviour.java index d932e0cc..c3f7e05a 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/behaviour/FallingBlockBehaviour.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/behaviour/FallingBlockBehaviour.java @@ -25,7 +25,6 @@ import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.FallingBlockEntity; import net.minecraft.entity.damage.DamageSource; import net.minecraft.state.property.Properties; -import net.minecraft.registry.tag.BlockTags; import net.minecraft.util.math.Direction; import net.minecraft.util.math.Vec3d; @@ -74,7 +73,11 @@ public class FallingBlockBehaviour extends EntityBehaviour { BlockState state = entity.getBlockState(); Block block = state.getBlock(); - if (state.isIn(BlockTags.DOORS) && block instanceof DoorBlock) { + if (block instanceof BlockEntityProvider bep) { + context.addBlockEntity(bep.createBlockEntity(entity.getBlockPos(), state)); + } + + if (block instanceof DoorBlock) { BlockState lowerState = state.with(DoorBlock.HALF, DoubleBlockHalf.LOWER); BlockState upperState = state.with(DoorBlock.HALF, DoubleBlockHalf.UPPER); @@ -83,10 +86,6 @@ public class FallingBlockBehaviour extends EntityBehaviour { return configure(MixinFallingBlockEntity.createInstance(entity.getWorld(), entity.getX(), entity.getY() + 1, entity.getZ(), lowerState), block); } - if (block instanceof BlockEntityProvider bep) { - context.addBlockEntity(bep.createBlockEntity(entity.getBlockPos(), state)); - } - return configure(entity, block); } @@ -100,15 +99,10 @@ public class FallingBlockBehaviour extends EntityBehaviour { if (state.get(Properties.WATERLOGGED) != logged) { entity = MixinFallingBlockEntity.createInstance(entity.getWorld(), entity.getX(), entity.getY(), entity.getZ(), state.with(Properties.WATERLOGGED, logged)); spell.getDisguise().setAppearance(entity); - return; } } EntityAppearance disguise = spell.getDisguise(); - List attachments = disguise.getAttachments(); - if (attachments.size() > 0) { - copyBaseAttributes(source.asEntity(), attachments.get(0), UP); - } BlockEntity be = disguise.getBlockEntity(); @@ -122,5 +116,10 @@ public class FallingBlockBehaviour extends EntityBehaviour { ceb.tick(); be.setWorld(null); } + + List attachments = disguise.getAttachments(); + if (attachments.size() > 0) { + copyBaseAttributes(source.asEntity(), attachments.get(0), UP); + } } }