feat: ajout d'un reset

This commit is contained in:
Laureηt 2022-05-13 20:41:36 +02:00
parent c849f9d12c
commit e76c03d2a6
No known key found for this signature in database
GPG key ID: D88C6B294FD40994
3 changed files with 26 additions and 2 deletions

View file

@ -22,6 +22,7 @@ public class Camera extends JavaPlugin {
this.getCommand("point").setExecutor(new NewPoint());
this.getCommand("points").setExecutor(new ListPoints());
this.getCommand("goto").setExecutor(new GotoPoint());
this.getCommand("reset").setExecutor(new ClearPoints());
this.getCommand("test").setExecutor(new Test());
// init logger

View file

@ -0,0 +1,19 @@
package com.tocard.cam;
import java.util.ArrayList;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class ClearPoints implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (sender instanceof Player) {
Camera.locations = new ArrayList<>();
}
return true;
}
}

View file

@ -16,8 +16,12 @@ commands:
goto:
description: Goto camera n°i
usage: /goto i
permission: com.tocard.cam.listPoints
permission: com.tocard.cam.gotoPoint
reset:
description: Clear camera points
usage: /reset
permission: com.tocard.cam.resetPoints
test:
description: Test
usage: /test
permission: com.tocard.cam.listPoints
permission: com.tocard.cam.test