Fixing Detonator #158
@ -33,7 +33,8 @@ public class CommandDetonator implements CommandExecutor {
|
|||||||
private void help(Player player) {
|
private void help(Player player) {
|
||||||
player.sendMessage("§8/§edetonator wand §8- §7Legt den Fernzünder ins Inventar");
|
player.sendMessage("§8/§edetonator wand §8- §7Legt den Fernzünder ins Inventar");
|
||||||
player.sendMessage("§8/§edetonator detonate §8- §7Benutzt den Fernzünder");
|
player.sendMessage("§8/§edetonator detonate §8- §7Benutzt den Fernzünder");
|
||||||
player.sendMessage("§8/§edetonator reset §8- §7Löscht alle markierten Positionen");
|
player.sendMessage("§8/§edetonator reset §8- §7Lösche alle markierten Positionen");
|
||||||
|
player.sendMessage("§8/§edetonator remove §8- §7Entferne den Fernzünder");
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean permissionCheck(Player player) {
|
private boolean permissionCheck(Player player) {
|
||||||
@ -65,16 +66,20 @@ public class CommandDetonator implements CommandExecutor {
|
|||||||
player.updateInventory();
|
player.updateInventory();
|
||||||
Detonator.getDetonator(player);
|
Detonator.getDetonator(player);
|
||||||
break;
|
break;
|
||||||
case "delete":
|
|
||||||
case "reset":
|
|
||||||
case "remove":
|
case "remove":
|
||||||
Detonator.deleteDetonator(player);
|
Detonator.deleteDetonator(player);
|
||||||
|
player.getInventory().removeItem(Detonator.WAND);
|
||||||
break;
|
break;
|
||||||
case "detonate":
|
case "detonate":
|
||||||
case "click":
|
case "click":
|
||||||
case "use":
|
case "use":
|
||||||
Detonator.getDetonator(player).execute();
|
Detonator.getDetonator(player).execute();
|
||||||
break;
|
break;
|
||||||
|
case "clear":
|
||||||
|
case "delete":
|
||||||
|
case "reset":
|
||||||
|
Detonator.getDetonator(player).clearLocs();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
help(player);
|
help(player);
|
||||||
}
|
}
|
||||||
|
@ -163,7 +163,8 @@ public class Detonator implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerQuit(PlayerQuitEvent event) {
|
public void onPlayerQuit(PlayerQuitEvent event) {
|
||||||
deleteDetonator(event.getPlayer());
|
if(event.getPlayer().equals(player))
|
||||||
|
deleteDetonator(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<Detoloader.DetonatorActivation> getLocations() {
|
Set<Detoloader.DetonatorActivation> getLocations() {
|
||||||
@ -174,6 +175,10 @@ public class Detonator implements Listener {
|
|||||||
return player;
|
return player;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void clearLocs() {
|
||||||
|
locs.clear();
|
||||||
|
}
|
||||||
|
|
||||||
void print(String message, boolean withSize){
|
void print(String message, boolean withSize){
|
||||||
if(withSize)
|
if(withSize)
|
||||||
getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(message + " §8" + getLocations().size()));
|
getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(message + " §8" + getLocations().size()));
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren