9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-29 20:09:13 +00:00

feat(core): 添加监听onRemove内部事件

This commit is contained in:
jhqwqmc
2025-07-13 15:11:19 +08:00
parent b893e3bc6c
commit 3ce1917df5
4 changed files with 36 additions and 1 deletions

View File

@@ -123,6 +123,9 @@ public abstract class BlockBehavior {
public void affectNeighborsAfterRemoval(Object thisBlock, Object[] args, Callable<Object> superMethod) throws Exception {
}
public void onRemove(Object thisBlock, Object[] args, Callable<Object> superMethod) throws Exception {
}
// BlockState blockState, BlockGetter blockAccess, BlockPos pos, Direction side
public int getSignal(Object thisBlock, Object[] args, Callable<Object> superMethod) {
return 0;
@@ -145,7 +148,6 @@ public abstract class BlockBehavior {
// BlockState state, ServerLevel level, BlockPos pos, ItemStack stack, boolean dropExperience
public void spawnAfterBreak(Object thisBlock, Object[] args, Callable<Object> superMethod) throws Exception {
superMethod.call();
}
public ImmutableBlockState updateStateForPlacement(BlockPlaceContext context, ImmutableBlockState state) {