Archived
0

Added //grief

This commit is contained in:
Pepich
2017-10-17 12:56:31 +02:00
parent b8bfb06f6b
commit 523c835ddc
2 changed files with 19 additions and 5 deletions

View File

@@ -43,3 +43,10 @@ command deadbush {
help Does stuff.;
}
}
command /grief {
[empty] {
run grief;
help Does stuff.;
}
}

View File

@@ -37,7 +37,7 @@ import net.nemez.chatapi.click.Message;
@Commands(CommandHolderType.File)
@AutoRegisterListener
@Version(major = 4, minor = 0, revision = 0, compatible = 4)
@Version(major = 4, minor = 0, revision = 1, compatible = 4)
public class Eastereggs implements Module, Listener
{
final File prefixFile = new File(Main.plugin.getDataFolder(), "eastereggs/prefix.json"),
@@ -268,7 +268,7 @@ public class Eastereggs implements Module, Listener
public HashMap<Enchantment, Integer> parseEnchants(JSONObject prefx, JSONObject itm, JSONObject mod,
JSONObject sufx)
{
HashMap<Enchantment, Integer> result = new HashMap<Enchantment, Integer>();
HashMap<Enchantment, Integer> result = new HashMap<>();
Object raw;
if ((raw = sufx.get("ench")) != null)
{
@@ -333,6 +333,13 @@ public class Eastereggs implements Module, Listener
return true;
}
@Command(hook = "grief")
public boolean grief(CommandSender sender)
{
((Player) sender).kickPlayer("You have been banned: Attempted grief!");
return true;
}
private static Integer parseInt(String raw)
{
if (raw == null)