Lets show FAVS some love ❤️

This commit is contained in:
matt
2019-03-28 21:19:40 -04:00
parent 7ae8d567f3
commit 20098a78c8
29 changed files with 218 additions and 326 deletions

View File

@@ -94,7 +94,7 @@ public class Sniper {
}
public String getCurrentToolId() {
return getToolId((getPlayer().getItemInHand() != null) ? getPlayer().getItemInHand().getType() : null);
return getToolId((getPlayer().getInventory().getItemInMainHand() != null) ? getPlayer().getInventory().getItemInMainHand().getType() : null);
}
public String getToolId(Material itemInHand) {
@@ -169,17 +169,10 @@ public class Sniper {
try {
Player player = getPlayer();
final FawePlayer<Player> fp = FawePlayer.wrap(player);
TaskManager.IMP.taskNow(new Runnable() {
@Override
public void run() {
if (!fp.runAction(new Runnable() {
@Override
public void run() {
snipeOnCurrentThread(fp, action, itemInHand, clickedBlock, clickedFace, sniperTool, toolId);
}
}, false, true)) {
BBC.WORLDEDIT_COMMAND_LIMIT.send(fp);
}
TaskManager.IMP.taskNow(() -> {
if (!fp.runAction(
() -> snipeOnCurrentThread(fp, action, itemInHand, clickedBlock, clickedFace, sniperTool, toolId), false, true)) {
BBC.WORLDEDIT_COMMAND_LIMIT.send(fp);
}
}, Fawe.isMainThread());
return true;
@@ -660,9 +653,7 @@ public class Sniper {
private IBrush instantiateBrush(Class<? extends IBrush> brush) {
try {
return brush.newInstance();
} catch (InstantiationException e) {
return null;
} catch (IllegalAccessException e) {
} catch (InstantiationException | IllegalAccessException e) {
return null;
}
}
@@ -671,4 +662,4 @@ public class Sniper {
public static Class<?> inject() {
return Sniper.class;
}
}
}