Skip to content

Commit

Permalink
Fixed brush firing on left click (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinDaGame committed Sep 20, 2022
1 parent 07b6028 commit d647244
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions src/main/java/com/thevoxelbox/voxelsniper/snipe/Sniper.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,21 +149,24 @@ public boolean snipe(Action action, Material itemInHand, Block clickedBlock, Blo
break;
}
}
switch(action) {
case RIGHT_CLICK_AIR:
case RIGHT_CLICK_BLOCK:
if (clickedBlock == null) {
if (targetBlock == null || lastBlock == null) {
sendMessage(Messages.TARGET_MUST_BE_VISIBLE);
return true;
}
}

if (clickedBlock == null) {
if (targetBlock == null || lastBlock == null) {
sendMessage(Messages.TARGET_MUST_BE_VISIBLE);
return true;
}
}
if (sniperTool.getCurrentBrush() instanceof PerformerBrush) {
PerformerBrush performerBrush = (PerformerBrush) sniperTool.getCurrentBrush();
performerBrush.initP(snipeData);
}

if (sniperTool.getCurrentBrush() instanceof PerformerBrush) {
PerformerBrush performerBrush = (PerformerBrush) sniperTool.getCurrentBrush();
performerBrush.initP(snipeData);
return sniperTool.getCurrentBrush().perform(snipeAction, snipeData, targetBlock, lastBlock);
}

return sniperTool.getCurrentBrush().perform(snipeAction, snipeData, targetBlock, lastBlock);

return false;
}


Expand Down

0 comments on commit d647244

Please sign in to comment.