Add addInvItems command to allow redstone minigames to readd lobby items

This commit is contained in:
kaenganxt
2014-12-27 18:52:15 +01:00
parent 01205032c0
commit 175ac2f2f9
2 changed files with 18 additions and 1 deletions

View File

@@ -2,6 +2,7 @@ package de.anura.core.commands;
import de.anura.core.API.Core;
import de.anura.core.API.Errors;
import de.anura.core.API.Inventories;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.BlockCommandSender;
@@ -54,6 +55,19 @@ public class OtherCommands implements CommandExecutor {
Core.getMainClass().aimTheWaterWins.put(player, Core.getMainClass().aimTheWaterWins.get(player) + 1);
return true;
}
} else if (cmd.getName().equalsIgnoreCase("addInvItems")) {
Player pl;
if (args.length == 0) {
if (P == null) return true;
pl = P;
} else if (sender.hasPermission("core.addinvitems.other")) {
if (!Bukkit.getOfflinePlayer(args[0]).isOnline()) return true;
pl = Bukkit.getPlayer(args[0]);
} else {
return true;
}
Inventories.addInvItems(pl);
return true;
}
} catch(Throwable e) {
Errors.reportException(e);

View File

@@ -93,4 +93,7 @@ commands:
usage: /<command> <message>...
warplist:
description: Prints a list of warps
usage: /<command>
usage: /<command>
addInvItems:
description: Add inv items
usage: /<command> [player]