Add addInvItems command to allow redstone minigames to readd lobby items
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -94,3 +94,6 @@ commands:
|
||||
warplist:
|
||||
description: Prints a list of warps
|
||||
usage: /<command>
|
||||
addInvItems:
|
||||
description: Add inv items
|
||||
usage: /<command> [player]
|
||||
Reference in New Issue
Block a user