add setHearts command for ops
This commit is contained in:
parent
76bf3d93f9
commit
4ea21a8d75
|
@ -6,4 +6,10 @@ api-version: 1.18
|
||||||
commands:
|
commands:
|
||||||
deletemydata:
|
deletemydata:
|
||||||
description: Deletes your amount of lives, then bans you.
|
description: Deletes your amount of lives, then bans you.
|
||||||
usage: "Usage: Not the way you used it, that's for sure"
|
usage: "Usage: Not the way you used it, that's for sure"
|
||||||
|
setHearts:
|
||||||
|
permission: lifesteal.sethearts
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
lifesteal.sethearts:
|
||||||
|
default: op
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
package ca.thetechrobo.smp;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandExecutor;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
public class ExploitAbuse101ByLunarRam implements CommandExecutor {
|
||||||
|
@Override
|
||||||
|
public boolean onCommand(CommandSender senderr, Command arg1, String arg2, String[] args) {
|
||||||
|
if (args.length != 2) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
ScoreboardWrapper tmp = new ScoreboardWrapper();
|
||||||
|
Player p = Bukkit.getPlayer(args[0]);
|
||||||
|
Double newHearts = Double.parseDouble(args[1]);
|
||||||
|
tmp.setHearts(p, newHearts);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
|
@ -45,6 +45,7 @@ public class LifestealPlugin extends JavaPlugin {
|
||||||
DeleteMyData dlmydata = new DeleteMyData();
|
DeleteMyData dlmydata = new DeleteMyData();
|
||||||
dlmydata.initialise(dl.scores);
|
dlmydata.initialise(dl.scores);
|
||||||
this.getCommand("deletemydata").setExecutor(dlmydata);
|
this.getCommand("deletemydata").setExecutor(dlmydata);
|
||||||
|
this.getCommand("setHearts").setExecutor(new ExploitAbuse101ByLunarRam());
|
||||||
addRecipes();
|
addRecipes();
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue