diff --git a/Xplat/src/main/java/vazkii/botania/common/block/FelPumpkinBlock.java b/Xplat/src/main/java/vazkii/botania/common/block/FelPumpkinBlock.java index 38d471c9d7..48322d9b7e 100644 --- a/Xplat/src/main/java/vazkii/botania/common/block/FelPumpkinBlock.java +++ b/Xplat/src/main/java/vazkii/botania/common/block/FelPumpkinBlock.java @@ -19,10 +19,14 @@ import net.minecraft.world.level.ServerLevelAccessor; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.Mirror; +import net.minecraft.world.level.block.Rotation; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import org.jetbrains.annotations.NotNull; + import vazkii.botania.mixin.MobAccessor; import static vazkii.botania.common.lib.ResourceLocationHelper.prefix; @@ -62,4 +66,15 @@ public BlockState getStateForPlacement(BlockPlaceContext context) { return defaultBlockState().setValue(BlockStateProperties.HORIZONTAL_FACING, context.getHorizontalDirection().getOpposite()); } + @NotNull + @Override + public BlockState mirror(@NotNull BlockState state, Mirror mirror) { + return state.setValue(BlockStateProperties.HORIZONTAL_FACING, mirror.mirror(state.getValue(BlockStateProperties.HORIZONTAL_FACING))); + } + + @NotNull + @Override + public BlockState rotate(@NotNull BlockState state, Rotation rot) { + return state.setValue(BlockStateProperties.HORIZONTAL_FACING, rot.rotate(state.getValue(BlockStateProperties.HORIZONTAL_FACING))); + } } diff --git a/Xplat/src/main/java/vazkii/botania/common/block/IncensePlateBlock.java b/Xplat/src/main/java/vazkii/botania/common/block/IncensePlateBlock.java index 9f065e1d79..4b9c262ce9 100644 --- a/Xplat/src/main/java/vazkii/botania/common/block/IncensePlateBlock.java +++ b/Xplat/src/main/java/vazkii/botania/common/block/IncensePlateBlock.java @@ -22,6 +22,8 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.EntityBlock; +import net.minecraft.world.level.block.Mirror; +import net.minecraft.world.level.block.Rotation; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityTicker; import net.minecraft.world.level.block.entity.BlockEntityType; @@ -91,6 +93,18 @@ public BlockState getStateForPlacement(BlockPlaceContext context) { return super.getStateForPlacement(context).setValue(BlockStateProperties.HORIZONTAL_FACING, context.getHorizontalDirection().getOpposite()); } + @NotNull + @Override + public BlockState mirror(@NotNull BlockState state, Mirror mirror) { + return state.setValue(BlockStateProperties.HORIZONTAL_FACING, mirror.mirror(state.getValue(BlockStateProperties.HORIZONTAL_FACING))); + } + + @NotNull + @Override + public BlockState rotate(@NotNull BlockState state, Rotation rot) { + return state.setValue(BlockStateProperties.HORIZONTAL_FACING, rot.rotate(state.getValue(BlockStateProperties.HORIZONTAL_FACING))); + } + @Override public boolean hasAnalogOutputSignal(BlockState state) { return true; diff --git a/Xplat/src/main/java/vazkii/botania/common/block/decor/TinyPotatoBlock.java b/Xplat/src/main/java/vazkii/botania/common/block/decor/TinyPotatoBlock.java index 3579c835c0..51ae51dea7 100644 --- a/Xplat/src/main/java/vazkii/botania/common/block/decor/TinyPotatoBlock.java +++ b/Xplat/src/main/java/vazkii/botania/common/block/decor/TinyPotatoBlock.java @@ -22,9 +22,7 @@ import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.EntityBlock; -import net.minecraft.world.level.block.RenderShape; +import net.minecraft.world.level.block.*; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityTicker; import net.minecraft.world.level.block.entity.BlockEntityType; @@ -115,6 +113,18 @@ public BlockState getStateForPlacement(BlockPlaceContext ctx) { return super.getStateForPlacement(ctx).setValue(BlockStateProperties.HORIZONTAL_FACING, ctx.getHorizontalDirection().getOpposite()); } + @NotNull + @Override + public BlockState mirror(@NotNull BlockState state, Mirror mirror) { + return state.setValue(BlockStateProperties.HORIZONTAL_FACING, mirror.mirror(state.getValue(BlockStateProperties.HORIZONTAL_FACING))); + } + + @NotNull + @Override + public BlockState rotate(@NotNull BlockState state, Rotation rot) { + return state.setValue(BlockStateProperties.HORIZONTAL_FACING, rot.rotate(state.getValue(BlockStateProperties.HORIZONTAL_FACING))); + } + @Override public void setPlacedBy(Level world, BlockPos pos, BlockState state, @Nullable LivingEntity living, ItemStack stack) { if (stack.hasCustomHoverName() && world.getBlockEntity(pos) instanceof TinyPotatoBlockEntity tater) { diff --git a/Xplat/src/main/java/vazkii/botania/common/block/mana/BellowsBlock.java b/Xplat/src/main/java/vazkii/botania/common/block/mana/BellowsBlock.java index e5ba4443a4..c66154f976 100644 --- a/Xplat/src/main/java/vazkii/botania/common/block/mana/BellowsBlock.java +++ b/Xplat/src/main/java/vazkii/botania/common/block/mana/BellowsBlock.java @@ -16,9 +16,7 @@ import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.EntityBlock; -import net.minecraft.world.level.block.RenderShape; +import net.minecraft.world.level.block.*; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityTicker; import net.minecraft.world.level.block.entity.BlockEntityType; @@ -64,6 +62,18 @@ public BlockState getStateForPlacement(BlockPlaceContext context) { return super.getStateForPlacement(context).setValue(BlockStateProperties.HORIZONTAL_FACING, context.getHorizontalDirection()); } + @NotNull + @Override + public BlockState mirror(@NotNull BlockState state, Mirror mirror) { + return state.setValue(BlockStateProperties.HORIZONTAL_FACING, mirror.mirror(state.getValue(BlockStateProperties.HORIZONTAL_FACING))); + } + + @NotNull + @Override + public BlockState rotate(@NotNull BlockState state, Rotation rot) { + return state.setValue(BlockStateProperties.HORIZONTAL_FACING, rot.rotate(state.getValue(BlockStateProperties.HORIZONTAL_FACING))); + } + @Override public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) { if (PlayerHelper.isTruePlayer(player)) { diff --git a/Xplat/src/main/java/vazkii/botania/common/block/mana/ManaPumpBlock.java b/Xplat/src/main/java/vazkii/botania/common/block/mana/ManaPumpBlock.java index 4352536e51..dc77c3fc8a 100644 --- a/Xplat/src/main/java/vazkii/botania/common/block/mana/ManaPumpBlock.java +++ b/Xplat/src/main/java/vazkii/botania/common/block/mana/ManaPumpBlock.java @@ -16,6 +16,8 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.EntityBlock; +import net.minecraft.world.level.block.Mirror; +import net.minecraft.world.level.block.Rotation; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityTicker; import net.minecraft.world.level.block.entity.BlockEntityType; @@ -54,6 +56,18 @@ public BlockState getStateForPlacement(BlockPlaceContext context) { return super.getStateForPlacement(context).setValue(BlockStateProperties.HORIZONTAL_FACING, context.getHorizontalDirection().getOpposite()); } + @NotNull + @Override + public BlockState mirror(@NotNull BlockState state, Mirror mirror) { + return state.setValue(BlockStateProperties.HORIZONTAL_FACING, mirror.mirror(state.getValue(BlockStateProperties.HORIZONTAL_FACING))); + } + + @NotNull + @Override + public BlockState rotate(@NotNull BlockState state, Rotation rot) { + return state.setValue(BlockStateProperties.HORIZONTAL_FACING, rot.rotate(state.getValue(BlockStateProperties.HORIZONTAL_FACING))); + } + @NotNull @Override public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext ctx) {