Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@ private void onInteractEntity(InteractEntityEvent event) {
}

private boolean shouldAttackBlock(BlockPos blockPos) {
if (blockMineMode.get() == ListMode.WhiteList &&
blockMine.get().contains(mc.level.getBlockState(blockPos).getBlock())) {
return false;
}
boolean blockInList = blockMine.get().contains(mc.level.getBlockState(blockPos).getBlock());

return blockMineMode.get() != ListMode.BlackList ||
!blockMine.get().contains(mc.level.getBlockState(blockPos).getBlock());
if (blockMineMode.get() == ListMode.WhiteList) {
return blockInList;
} else {
return !blockInList;
}
}

private boolean shouldInteractBlock(BlockHitResult hitResult, InteractionHand hand) {
Expand All @@ -167,13 +167,13 @@ private boolean shouldInteractBlock(BlockHitResult hitResult, InteractionHand ha
}

// Blocks
if (blockInteractMode.get() == ListMode.BlackList &&
blockInteract.get().contains(mc.level.getBlockState(hitResult.getBlockPos()).getBlock())) {
return false;
}
boolean blockInList = blockInteract.get().contains(mc.level.getBlockState(hitResult.getBlockPos()).getBlock());

return blockInteractMode.get() != ListMode.WhiteList ||
blockInteract.get().contains(mc.level.getBlockState(hitResult.getBlockPos()).getBlock());
if (blockInteractMode.get() == ListMode.WhiteList) {
return blockInList;
} else {
return !blockInList;
}
}

private boolean shouldAttackEntity(Entity entity) {
Expand Down