Skip to content

Commit d64d735

Browse files
authored
No Interact module's block mine whitelist now actually works (#6365)
1 parent 331c276 commit d64d735

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

  • src/main/java/meteordevelopment/meteorclient/systems/modules/player

src/main/java/meteordevelopment/meteorclient/systems/modules/player/NoInteract.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,13 @@ private void onInteractEntity(InteractEntityEvent event) {
149149
}
150150

151151
private boolean shouldAttackBlock(BlockPos blockPos) {
152-
if (blockMineMode.get() == ListMode.WhiteList &&
153-
blockMine.get().contains(mc.level.getBlockState(blockPos).getBlock())) {
154-
return false;
155-
}
152+
boolean blockInList = blockMine.get().contains(mc.level.getBlockState(blockPos).getBlock());
156153

157-
return blockMineMode.get() != ListMode.BlackList ||
158-
!blockMine.get().contains(mc.level.getBlockState(blockPos).getBlock());
154+
if (blockMineMode.get() == ListMode.WhiteList) {
155+
return blockInList;
156+
} else {
157+
return !blockInList;
158+
}
159159
}
160160

161161
private boolean shouldInteractBlock(BlockHitResult hitResult, InteractionHand hand) {
@@ -167,13 +167,13 @@ private boolean shouldInteractBlock(BlockHitResult hitResult, InteractionHand ha
167167
}
168168

169169
// Blocks
170-
if (blockInteractMode.get() == ListMode.BlackList &&
171-
blockInteract.get().contains(mc.level.getBlockState(hitResult.getBlockPos()).getBlock())) {
172-
return false;
173-
}
170+
boolean blockInList = blockInteract.get().contains(mc.level.getBlockState(hitResult.getBlockPos()).getBlock());
174171

175-
return blockInteractMode.get() != ListMode.WhiteList ||
176-
blockInteract.get().contains(mc.level.getBlockState(hitResult.getBlockPos()).getBlock());
172+
if (blockInteractMode.get() == ListMode.WhiteList) {
173+
return blockInList;
174+
} else {
175+
return !blockInList;
176+
}
177177
}
178178

179179
private boolean shouldAttackEntity(Entity entity) {

0 commit comments

Comments
 (0)