feat: ajout d'un reset
This commit is contained in:
parent
c849f9d12c
commit
e76c03d2a6
|
@ -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
|
||||
|
|
19
src/main/java/com/tocard/cam/ClearPoints.java
Normal file
19
src/main/java/com/tocard/cam/ClearPoints.java
Normal 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;
|
||||
}
|
||||
}
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue