@@ -36,27 +36,26 @@ public void setPlacedBy(Level worldIn, BlockPos pos, BlockState state, LivingEnt
36
36
}
37
37
38
38
@ Override
39
- public ItemStack getCloneItemStack (BlockState state , HitResult target , BlockGetter world , BlockPos pos ,
40
- Player player ) {
39
+ public ItemStack getCloneItemStack (
40
+ BlockState state ,
41
+ HitResult target ,
42
+ BlockGetter world ,
43
+ BlockPos pos ,
44
+ Player player
45
+ ) {
41
46
return RGBBlockUtils .getCloneItemStack (state , target , world , pos , player );
42
47
}
43
48
44
49
@ Override
45
50
public void tick (BlockState state , ServerLevel worldIn , BlockPos pos , RandomSource rand ) {
46
51
if (worldIn .isEmptyBlock (pos .below ()) || isFree (worldIn .getBlockState (pos .below ())) && pos .getY () >= 0 ) {
47
52
BlockEntity tileEntity = worldIn .getBlockEntity (pos );
48
- RGBFallingBlockEntity fallingBlockEntity = new RGBFallingBlockEntity (worldIn , (double ) pos .getX () + 0.5D ,
49
- pos .getY (), (double ) pos .getZ () + 0.5D ,
50
- state .hasProperty (
51
- BlockStateProperties .WATERLOGGED ) ?
52
- state .setValue (
53
- BlockStateProperties .WATERLOGGED ,
54
- Boolean .valueOf (false )
55
- ) :
56
- state ,
57
- tileEntity instanceof RGBTileEntity ?
58
- ((RGBTileEntity ) tileEntity ).getColor () :
59
- 0
53
+ RGBFallingBlockEntity fallingBlockEntity = new RGBFallingBlockEntity (
54
+ worldIn , (double ) pos .getX () + 0.5D , pos .getY (), (double ) pos .getZ () + 0.5D ,
55
+ state .hasProperty (BlockStateProperties .WATERLOGGED )
56
+ ? state .setValue (BlockStateProperties .WATERLOGGED , Boolean .valueOf (false ))
57
+ : state ,
58
+ tileEntity instanceof RGBTileEntity ? ((RGBTileEntity ) tileEntity ).getColor () : 0
60
59
);
61
60
worldIn .setBlock (pos , state .getFluidState ().createLegacyBlock (), 3 );
62
61
worldIn .addFreshEntity (fallingBlockEntity );
@@ -74,8 +73,13 @@ public void onRemove(BlockState state, Level worldIn, BlockPos pos, BlockState n
74
73
}
75
74
76
75
@ Override
77
- public void onLand (Level world , BlockPos blockPos , BlockState blockBlockState , BlockState entityBlockState ,
78
- FallingBlockEntity entity ) {
76
+ public void onLand (
77
+ Level world ,
78
+ BlockPos blockPos ,
79
+ BlockState blockBlockState ,
80
+ BlockState entityBlockState ,
81
+ FallingBlockEntity entity
82
+ ) {
79
83
super .onLand (world , blockPos , blockBlockState , entityBlockState , entity );
80
84
if (entity instanceof RGBFallingBlockEntity ) {
81
85
RGBTileEntity tileEntity = new RGBTileEntity (blockPos , entityBlockState );
0 commit comments