Skip to content

Commit

Permalink
terrible
Browse files Browse the repository at this point in the history
  • Loading branch information
TropheusJ committed Nov 5, 2024
1 parent b0d6a34 commit 6731dd7
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ public static boolean isCorrectToolForDrops(@NotNull BlockState state, @NotNull
return player.hasCorrectToolForDrops(state);
}

public static int onBlockBreakEvent(Level world, GameType gameType, ServerPlayer entityPlayer, BlockPos pos) {
BlockState state = world.getBlockState(pos);
Item item = entityPlayer.getMainHandItem().getItem();
boolean canAttackBlock = item.canAttackBlock(state, world, pos, entityPlayer);
return onBlockBreakEvent(world, gameType, entityPlayer, pos, canAttackBlock);
}

public static int onBlockBreakEvent(Level world, GameType gameType, ServerPlayer entityPlayer, BlockPos pos, boolean canAttackBlock) {
// Logic from tryHarvestBlock for pre-canceling the event
boolean preCancelEvent = false;
Expand Down

0 comments on commit 6731dd7

Please sign in to comment.