diff --git a/src/api/java/blusunrize/immersiveengineering/api/IEProperties.java b/src/api/java/blusunrize/immersiveengineering/api/IEProperties.java index b676485141..8f22ef026c 100644 --- a/src/api/java/blusunrize/immersiveengineering/api/IEProperties.java +++ b/src/api/java/blusunrize/immersiveengineering/api/IEProperties.java @@ -34,7 +34,6 @@ public class IEProperties public static final BooleanProperty MULTIBLOCKSLAVE = BooleanProperty.create("multiblockslave"); public static final BooleanProperty ACTIVE = BooleanProperty.create("active"); - public static final BooleanProperty OPEN = BooleanProperty.create("open"); public static final BooleanProperty MIRRORED = BooleanProperty.create("mirrored"); public static final BooleanProperty UP = BooleanProperty.create("up"); diff --git a/src/datagen/java/blusunrize/immersiveengineering/data/blockstates/BlockStates.java b/src/datagen/java/blusunrize/immersiveengineering/data/blockstates/BlockStates.java index 65f177cd21..fef6764c79 100644 --- a/src/datagen/java/blusunrize/immersiveengineering/data/blockstates/BlockStates.java +++ b/src/datagen/java/blusunrize/immersiveengineering/data/blockstates/BlockStates.java @@ -716,11 +716,11 @@ private void createLadderBlock(Supplier b, ModelFile model, Mod { builder.partialState() .with(IEProperties.FACING_HORIZONTAL, d) - .with(IEProperties.OPEN, false) + .with(MetalLadderBlock.OPEN, false) .setModels(new ConfiguredModel(model, 0, getAngle(d, 180), true)); builder.partialState() .with(IEProperties.FACING_HORIZONTAL, d) - .with(IEProperties.OPEN, true) + .with(MetalLadderBlock.OPEN, true) .setModels(new ConfiguredModel(modelOpen, 0, getAngle(d, 180), false)); } } diff --git a/src/main/java/blusunrize/immersiveengineering/common/blocks/metal/MetalLadderBlock.java b/src/main/java/blusunrize/immersiveengineering/common/blocks/metal/MetalLadderBlock.java index 1e37839e93..a018df4da3 100644 --- a/src/main/java/blusunrize/immersiveengineering/common/blocks/metal/MetalLadderBlock.java +++ b/src/main/java/blusunrize/immersiveengineering/common/blocks/metal/MetalLadderBlock.java @@ -25,6 +25,7 @@ import net.minecraft.world.level.block.LadderBlock; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.shapes.BooleanOp; import net.minecraft.world.phys.shapes.CollisionContext; @@ -37,6 +38,8 @@ public class MetalLadderBlock extends LadderBlock implements IHammerBlockInteraction { + public static final BooleanProperty OPEN = BooleanProperty.create("open"); + private static final Map FRAMES = new EnumMap<>(Direction.class); private static final Map FRAMES_OPEN = new EnumMap<>(Direction.class); @@ -94,7 +97,7 @@ public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, Co else { Direction ladderSide = state.getValue(LadderBlock.FACING); - return state.getValue(IEProperties.OPEN) ? Shapes.joinUnoptimized(base, FRAMES_OPEN.get(ladderSide), BooleanOp.OR) : Shapes.joinUnoptimized(base, FRAMES.get(ladderSide), BooleanOp.OR); + return state.getValue(OPEN) ? Shapes.joinUnoptimized(base, FRAMES_OPEN.get(ladderSide), BooleanOp.OR) : Shapes.joinUnoptimized(base, FRAMES.get(ladderSide), BooleanOp.OR); } } @@ -104,7 +107,7 @@ public BlockState getStateForPlacement(BlockPlaceContext ctx) { BlockState baseState = super.getStateForPlacement(ctx); if(baseState==null) return baseState; - baseState = baseState.setValue(IEProperties.OPEN, false); + baseState = baseState.setValue(OPEN, false); if(type==CoverType.NONE) return baseState; else @@ -122,7 +125,7 @@ public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) @Override protected void createBlockStateDefinition(StateDefinition.Builder state) { - state.add(FACING, WATERLOGGED, IEProperties.OPEN); + state.add(FACING, WATERLOGGED, OPEN); } @Override @@ -131,7 +134,7 @@ public InteractionResult useHammer(BlockState state, Level world, BlockPos pos, if (player==null) return InteractionResult.FAIL; if(type!=CoverType.NONE&&player.isShiftKeyDown()) { - boolean b = world.setBlockAndUpdate(pos, state.setValue(IEProperties.OPEN, !state.getValue(IEProperties.OPEN))); + boolean b = world.setBlockAndUpdate(pos, state.setValue(OPEN, !state.getValue(OPEN))); if(b) return InteractionResult.SUCCESS; else