@Override
public void onStateReplaced(BlockState state, World world, BlockPos pos,
BlockState newState, boolean moved) {
if (state.getBlock() != newState.getBlock()) {
BlockEntity be = world.getBlockEntity(pos);
if (be instanceof BigBundleEntity bundle) {
if (!world.isClient) {
ItemStack drop = new ItemStack(this.asItem());
drop.set(DataComponentTypes.CONTAINER, ContainerComponent.fromStacks(bundle.getItems()));
ItemScatterer.spawn(world, pos.getX(), pos.getY(), pos.getZ(), drop);
}
world.removeBlockEntity(pos);
}
super.onStateReplaced(state, world, pos, newState, moved);
}
}
#Updating a Mod To 1.21.5
8 messages · Page 1 of 1 (latest)
onStateReplaced appears appears to have removed the BlockState newState argument in 1.21.5
Also for future:
!!code
You can use codeblocks in discord as shown below:
```java
code
```
You can also specify the syntax highlighting to use by specifying the language after the last backtick (`) on the top.
or `single backticks` for inline code segments like I used above
Although according to the fabric changelist for 1.21.5: