From e63189223fb2cddd45658250b57d1a59e9595549 Mon Sep 17 00:00:00 2001 From: kirderf1 Date: Sun, 8 Dec 2024 12:31:01 +0100 Subject: [PATCH] Update visibility of overrided block methods --- .../minestuck/block/CruxtruderLidBlock.java | 2 +- .../minestuck/block/CustomShapeBlock.java | 12 ++++------ .../block/DirectionalCustomShapeBlock.java | 9 +++----- .../mraof/minestuck/block/FragileBlock.java | 8 +++---- .../com/mraof/minestuck/block/GateBlock.java | 6 ++--- .../minestuck/block/GlowystoneWireBlock.java | 10 ++++----- .../mraof/minestuck/block/GoldSeedsBlock.java | 11 ++++------ .../block/LotusTimeCapsuleBlock.java | 3 +-- .../minestuck/block/ReturnNodeBlock.java | 5 ++--- .../minestuck/block/SkaiaPortalBlock.java | 8 +++---- .../minestuck/block/SpecialTNTBlock.java | 8 +++---- .../com/mraof/minestuck/block/SpikeBlock.java | 3 +-- .../minestuck/block/StoneTabletBlock.java | 4 ++-- .../minestuck/block/SulfurBubbleBlock.java | 2 +- .../minestuck/block/TrajectoryBlock.java | 8 +++---- .../block/machine/AlchemiterBlock.java | 4 +--- .../block/machine/ComputerBlock.java | 6 ++--- .../block/machine/GristCollectorBlock.java | 6 ++--- .../minestuck/block/machine/MachineBlock.java | 10 +++------ .../block/machine/MachineProcessBlock.java | 6 ++--- .../block/machine/MiniAlchemiterBlock.java | 8 +++---- .../block/machine/TotemLatheBlock.java | 2 +- .../block/plant/BurnedFoliageBlock.java | 2 +- .../block/plant/DesertFloraBlock.java | 4 ++-- .../block/plant/EndSaplingBlock.java | 8 +++---- .../block/plant/GlowingMushroomBlock.java | 7 +++--- .../plant/GlowingMushroomVinesBlock.java | 14 +++++------- .../block/plant/PetrifiedFloraBlock.java | 4 ++-- .../block/plant/TallEndGrassBlock.java | 5 ++--- .../block/plant/WoodenFloraBlock.java | 4 ++-- .../block/redstone/AreaEffectBlock.java | 9 +++----- .../redstone/BlockPressurePlateBlock.java | 17 +++++--------- .../block/redstone/LogicGateBlock.java | 6 ++--- .../block/redstone/PlatformBlock.java | 22 +++++++------------ .../block/redstone/RemoteComparatorBlock.java | 6 ++--- .../redstone/RetractableSpikesBlock.java | 10 ++++----- .../block/redstone/SummonerBlock.java | 6 ++--- 37 files changed, 100 insertions(+), 165 deletions(-) diff --git a/src/main/java/com/mraof/minestuck/block/CruxtruderLidBlock.java b/src/main/java/com/mraof/minestuck/block/CruxtruderLidBlock.java index 35512e86ae..577b80281b 100644 --- a/src/main/java/com/mraof/minestuck/block/CruxtruderLidBlock.java +++ b/src/main/java/com/mraof/minestuck/block/CruxtruderLidBlock.java @@ -24,7 +24,7 @@ public PushReaction getPistonPushReaction(BlockState state) } @Override - public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, CollisionContext context) + protected VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, CollisionContext context) { return SHAPE; } diff --git a/src/main/java/com/mraof/minestuck/block/CustomShapeBlock.java b/src/main/java/com/mraof/minestuck/block/CustomShapeBlock.java index 9bb8363fbc..ae6978acfe 100644 --- a/src/main/java/com/mraof/minestuck/block/CustomShapeBlock.java +++ b/src/main/java/com/mraof/minestuck/block/CustomShapeBlock.java @@ -54,16 +54,14 @@ public BlockState updateShape(BlockState stateIn, Direction facing, BlockState f return super.updateShape(stateIn, facing, facingState, level, currentPos, facingPos); } - @SuppressWarnings("deprecation") @Override - public BlockState rotate(BlockState state, Rotation direction) + protected BlockState rotate(BlockState state, Rotation direction) { return state.setValue(FACING, direction.rotate(state.getValue(FACING))); } - @SuppressWarnings("deprecation") @Override - public BlockState mirror(BlockState state, Mirror mirrorIn) + protected BlockState mirror(BlockState state, Mirror mirrorIn) { return state.setValue(FACING, mirrorIn.mirror(state.getValue(FACING))); } @@ -75,15 +73,13 @@ protected void createBlockStateDefinition(StateDefinition.Builder getDrops(BlockState state, LootParams.Builder builder) + protected List getDrops(BlockState state, LootParams.Builder builder) { if(builder.getOptionalParameter(LootContextParams.BLOCK_ENTITY) instanceof ItemStackBlockEntity itemBE) { @@ -81,6 +80,7 @@ protected InteractionResult useWithoutItem(BlockState state, Level level, BlockP return InteractionResult.SUCCESS; } + @Nullable @Override public BlockState getStateForPlacement(BlockPlaceContext context) { diff --git a/src/main/java/com/mraof/minestuck/block/SulfurBubbleBlock.java b/src/main/java/com/mraof/minestuck/block/SulfurBubbleBlock.java index 8632bf52ac..9fedf40b2c 100644 --- a/src/main/java/com/mraof/minestuck/block/SulfurBubbleBlock.java +++ b/src/main/java/com/mraof/minestuck/block/SulfurBubbleBlock.java @@ -34,7 +34,7 @@ protected boolean mayPlaceOn(BlockState state, BlockGetter level, BlockPos pos) } @Override - public VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) + protected VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) { Vec3 vec3 = pState.getOffset(pLevel, pPos); return SHAPE.move(vec3.x, vec3.y, vec3.z); diff --git a/src/main/java/com/mraof/minestuck/block/TrajectoryBlock.java b/src/main/java/com/mraof/minestuck/block/TrajectoryBlock.java index 6ea820e7c5..7b81e3941c 100644 --- a/src/main/java/com/mraof/minestuck/block/TrajectoryBlock.java +++ b/src/main/java/com/mraof/minestuck/block/TrajectoryBlock.java @@ -65,17 +65,15 @@ public void stepOn(Level level, BlockPos pos, BlockState state, Entity entityIn) } } - @SuppressWarnings("deprecation") @Override - public void neighborChanged(BlockState state, Level level, BlockPos pos, Block blockIn, BlockPos fromPos, boolean isMoving) + protected void neighborChanged(BlockState state, Level level, BlockPos pos, Block blockIn, BlockPos fromPos, boolean isMoving) { super.neighborChanged(state, level, pos, blockIn, fromPos, isMoving); updatePower(level, pos); } - @SuppressWarnings("deprecation") @Override - public void onPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean isMoving) + protected void onPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean isMoving) { super.onPlace(state, level, pos, oldState, isMoving); updatePower(level, pos); @@ -129,4 +127,4 @@ protected void createBlockStateDefinition(StateDefinition.Builder BlockEntityTicker getTicker(Level level, Block return !level.isClientSide ? BlockUtil.checkTypeForTicker(placedType, MSBlockEntityTypes.GRIST_COLLECTOR.get(), GristCollectorBlockEntity::serverTick) : null; } - @SuppressWarnings("deprecation") @Override - public void neighborChanged(BlockState state, Level level, BlockPos pos, Block blockIn, BlockPos fromPos, boolean isMoving) + protected void neighborChanged(BlockState state, Level level, BlockPos pos, Block blockIn, BlockPos fromPos, boolean isMoving) { super.neighborChanged(state, level, pos, blockIn, fromPos, isMoving); updatePower(level, pos); } - @SuppressWarnings("deprecation") @Override - public void onPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean isMoving) + protected void onPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean isMoving) { super.onPlace(state, level, pos, oldState, isMoving); updatePower(level, pos); diff --git a/src/main/java/com/mraof/minestuck/block/machine/MachineBlock.java b/src/main/java/com/mraof/minestuck/block/machine/MachineBlock.java index bc5a2aafec..64f61a0635 100644 --- a/src/main/java/com/mraof/minestuck/block/machine/MachineBlock.java +++ b/src/main/java/com/mraof/minestuck/block/machine/MachineBlock.java @@ -28,7 +28,6 @@ protected void createBlockStateDefinition(StateDefinition.Builder BlockEntityTicker createMachineTicker(Level level, BlockEntityType placedType, BlockEntityType blockType) { return !level.isClientSide ? BlockUtil.checkTypeForTicker(placedType, blockType, MachineProcessBlockEntity::serverTick) : null; } -} \ No newline at end of file +} diff --git a/src/main/java/com/mraof/minestuck/block/machine/MiniAlchemiterBlock.java b/src/main/java/com/mraof/minestuck/block/machine/MiniAlchemiterBlock.java index 3504b61aab..4a989ba506 100644 --- a/src/main/java/com/mraof/minestuck/block/machine/MiniAlchemiterBlock.java +++ b/src/main/java/com/mraof/minestuck/block/machine/MiniAlchemiterBlock.java @@ -19,8 +19,7 @@ public MiniAlchemiterBlock(Properties properties) } @Override - @SuppressWarnings("deprecation") - public boolean hasAnalogOutputSignal(BlockState state) + protected boolean hasAnalogOutputSignal(BlockState state) { return true; } @@ -28,8 +27,7 @@ public boolean hasAnalogOutputSignal(BlockState state) // Will provide a redstone signal through a comparator with the output level corresponding to how many items can be alchemized with the player's current grist cache. // If no item can be alchemized, it will provide no signal to the comparator. @Override - @SuppressWarnings("deprecation") - public int getAnalogOutputSignal(BlockState blockState, Level level, BlockPos pos) + protected int getAnalogOutputSignal(BlockState blockState, Level level, BlockPos pos) { if(level.getBlockEntity(pos) instanceof MiniAlchemiterBlockEntity alchemiter) return alchemiter.comparatorValue(); @@ -41,4 +39,4 @@ public boolean canConnectRedstone(BlockState state, BlockGetter level, BlockPos { return side != null; } -} \ No newline at end of file +} diff --git a/src/main/java/com/mraof/minestuck/block/machine/TotemLatheBlock.java b/src/main/java/com/mraof/minestuck/block/machine/TotemLatheBlock.java index f6b8f52512..ab4aca5c9a 100644 --- a/src/main/java/com/mraof/minestuck/block/machine/TotemLatheBlock.java +++ b/src/main/java/com/mraof/minestuck/block/machine/TotemLatheBlock.java @@ -134,7 +134,7 @@ public DowelRod(TotemLatheMultiblock machine, CustomVoxelShape emptyShape, Custo } @Override - public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, CollisionContext context) + protected VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, CollisionContext context) { if(state.getValue(DOWEL).equals(EnumDowelType.CARVED_DOWEL)) { diff --git a/src/main/java/com/mraof/minestuck/block/plant/BurnedFoliageBlock.java b/src/main/java/com/mraof/minestuck/block/plant/BurnedFoliageBlock.java index f6065d7524..e85ef90ed8 100644 --- a/src/main/java/com/mraof/minestuck/block/plant/BurnedFoliageBlock.java +++ b/src/main/java/com/mraof/minestuck/block/plant/BurnedFoliageBlock.java @@ -35,7 +35,7 @@ protected boolean mayPlaceOn(BlockState state, BlockGetter level, BlockPos pos) } @Override - public VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) + protected VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) { Vec3 vec3 = pState.getOffset(pLevel, pPos); return SHAPE.move(vec3.x, vec3.y, vec3.z); diff --git a/src/main/java/com/mraof/minestuck/block/plant/DesertFloraBlock.java b/src/main/java/com/mraof/minestuck/block/plant/DesertFloraBlock.java index d2486ff7ec..8f6842aef2 100644 --- a/src/main/java/com/mraof/minestuck/block/plant/DesertFloraBlock.java +++ b/src/main/java/com/mraof/minestuck/block/plant/DesertFloraBlock.java @@ -33,9 +33,9 @@ protected boolean mayPlaceOn(BlockState state, BlockGetter level, BlockPos pos) } @Override - public VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) + protected VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) { Vec3 vec3 = pState.getOffset(pLevel, pPos); return SHAPE.move(vec3.x, vec3.y, vec3.z); } -} \ No newline at end of file +} diff --git a/src/main/java/com/mraof/minestuck/block/plant/EndSaplingBlock.java b/src/main/java/com/mraof/minestuck/block/plant/EndSaplingBlock.java index 5b22d06860..d11e5caec1 100644 --- a/src/main/java/com/mraof/minestuck/block/plant/EndSaplingBlock.java +++ b/src/main/java/com/mraof/minestuck/block/plant/EndSaplingBlock.java @@ -48,8 +48,7 @@ protected MapCodec codec() } @Override - @SuppressWarnings("deprecation") - public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) + protected VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) { return SHAPE; } @@ -114,8 +113,7 @@ protected boolean mayPlaceOn(BlockState state, BlockGetter level, BlockPos pos) } @Override - @SuppressWarnings("deprecation") - public void tick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) + protected void tick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) { if (!level.isClientSide) { @@ -127,4 +125,4 @@ public void tick(BlockState state, ServerLevel level, BlockPos pos, RandomSource } } } -} \ No newline at end of file +} diff --git a/src/main/java/com/mraof/minestuck/block/plant/GlowingMushroomBlock.java b/src/main/java/com/mraof/minestuck/block/plant/GlowingMushroomBlock.java index 8ff1d9f2f1..2fa17cc4c1 100644 --- a/src/main/java/com/mraof/minestuck/block/plant/GlowingMushroomBlock.java +++ b/src/main/java/com/mraof/minestuck/block/plant/GlowingMushroomBlock.java @@ -36,8 +36,7 @@ protected boolean mayPlaceOn(BlockState state, BlockGetter level, BlockPos pos) } @Override - @SuppressWarnings("deprecation") - public void tick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) + protected void tick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) { super.tick(state, level, pos, random); if(canSpread(level, pos, state) && random.nextInt(25) == 0) @@ -72,9 +71,9 @@ public boolean canSpread(Level level, BlockPos pos, BlockState state) } @Override - public VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) + protected VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) { Vec3 vec3 = pState.getOffset(pLevel, pPos); return SHAPE.move(vec3.x, vec3.y, vec3.z); } -} \ No newline at end of file +} diff --git a/src/main/java/com/mraof/minestuck/block/plant/GlowingMushroomVinesBlock.java b/src/main/java/com/mraof/minestuck/block/plant/GlowingMushroomVinesBlock.java index 5a8e811c3e..5258d8d69f 100644 --- a/src/main/java/com/mraof/minestuck/block/plant/GlowingMushroomVinesBlock.java +++ b/src/main/java/com/mraof/minestuck/block/plant/GlowingMushroomVinesBlock.java @@ -24,9 +24,8 @@ public GlowingMushroomVinesBlock(Properties properties) super(properties); } - @SuppressWarnings("deprecation") @Override - public void randomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource rand) + protected void randomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource rand) { BlockPos belowPos = pos.below(); if(rand.nextInt(90) == 0 && level.getBlockState(belowPos).isAir()) @@ -35,29 +34,26 @@ public void randomTick(BlockState state, ServerLevel level, BlockPos pos, Random } } - @SuppressWarnings("deprecation") @Override - public boolean canSurvive(BlockState state, LevelReader level, BlockPos pos) + protected boolean canSurvive(BlockState state, LevelReader level, BlockPos pos) { BlockState aboveState = level.getBlockState(pos.above()); return aboveState.is(this) || aboveState.is(MSTags.Blocks.SHADEWOOD_LEAVES); } - @SuppressWarnings("deprecation") @Override - public VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) + protected VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) { Vec3 vec3 = pState.getOffset(pLevel, pPos); return SHAPE.move(vec3.x, vec3.y, vec3.z); } - @SuppressWarnings("deprecation") @Override - public BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor level, BlockPos currentPos, BlockPos neighborPos) + protected BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor level, BlockPos currentPos, BlockPos neighborPos) { //will be updated to only survive if the block above is another mushroom vine or shadewood leaf block return direction == Direction.UP && !this.canSurvive(state, level, currentPos) ? Blocks.AIR.defaultBlockState() : super.updateShape(state, direction, neighborState, level, currentPos, neighborPos); } -} \ No newline at end of file +} diff --git a/src/main/java/com/mraof/minestuck/block/plant/PetrifiedFloraBlock.java b/src/main/java/com/mraof/minestuck/block/plant/PetrifiedFloraBlock.java index 0577411f03..4b450ab053 100644 --- a/src/main/java/com/mraof/minestuck/block/plant/PetrifiedFloraBlock.java +++ b/src/main/java/com/mraof/minestuck/block/plant/PetrifiedFloraBlock.java @@ -36,9 +36,9 @@ protected boolean mayPlaceOn(BlockState state, BlockGetter level, BlockPos pos) } @Override - public VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) + protected VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) { Vec3 vec3 = pState.getOffset(pLevel, pPos); return shape.move(vec3.x, vec3.y, vec3.z); } -} \ No newline at end of file +} diff --git a/src/main/java/com/mraof/minestuck/block/plant/TallEndGrassBlock.java b/src/main/java/com/mraof/minestuck/block/plant/TallEndGrassBlock.java index 9849029c1d..220a56a377 100644 --- a/src/main/java/com/mraof/minestuck/block/plant/TallEndGrassBlock.java +++ b/src/main/java/com/mraof/minestuck/block/plant/TallEndGrassBlock.java @@ -37,8 +37,7 @@ protected boolean mayPlaceOn(BlockState state, BlockGetter level, BlockPos pos) } @Override - @SuppressWarnings("deprecation") - public void randomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) + protected void randomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) { if(!level.isClientSide && random.nextFloat() >= .75F) { @@ -97,4 +96,4 @@ public void randomTeleport(Level level, LivingEntity livingEntity) } } } -} \ No newline at end of file +} diff --git a/src/main/java/com/mraof/minestuck/block/plant/WoodenFloraBlock.java b/src/main/java/com/mraof/minestuck/block/plant/WoodenFloraBlock.java index 3e1c549cbc..60bf7d241a 100644 --- a/src/main/java/com/mraof/minestuck/block/plant/WoodenFloraBlock.java +++ b/src/main/java/com/mraof/minestuck/block/plant/WoodenFloraBlock.java @@ -37,9 +37,9 @@ protected boolean mayPlaceOn(BlockState state, BlockGetter level, BlockPos pos) } @Override - public VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) + protected VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) { Vec3 vec3 = pState.getOffset(pLevel, pPos); return shape.move(vec3.x, vec3.y, vec3.z); } -} \ No newline at end of file +} diff --git a/src/main/java/com/mraof/minestuck/block/redstone/AreaEffectBlock.java b/src/main/java/com/mraof/minestuck/block/redstone/AreaEffectBlock.java index 0eee9f4ca5..57f5cdb771 100644 --- a/src/main/java/com/mraof/minestuck/block/redstone/AreaEffectBlock.java +++ b/src/main/java/com/mraof/minestuck/block/redstone/AreaEffectBlock.java @@ -75,7 +75,6 @@ public BlockEntityTicker getTicker(Level level, Block } - @SuppressWarnings("deprecation") @Override protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult) { @@ -119,17 +118,15 @@ private void clickWithPotion(Level level, BlockPos pos, Player player, AreaEffec } } - @SuppressWarnings("deprecation") @Override - public void neighborChanged(BlockState state, Level level, BlockPos pos, Block blockIn, BlockPos fromPos, boolean isMoving) + protected void neighborChanged(BlockState state, Level level, BlockPos pos, Block blockIn, BlockPos fromPos, boolean isMoving) { super.neighborChanged(state, level, pos, blockIn, fromPos, isMoving); updatePower(level, pos); } - @SuppressWarnings("deprecation") @Override - public void onPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean isMoving) + protected void onPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean isMoving) { super.onPlace(state, level, pos, oldState, isMoving); updatePower(level, pos); @@ -170,4 +167,4 @@ protected void createBlockStateDefinition(StateDefinition.Builder