mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-08 17:38:20 +01:00
[trunk] Unlimited: Display a message when user already has permissions to avoid confusion.
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1116 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
parent
4dbf568cf8
commit
66bf05621c
@ -5,6 +5,7 @@ import com.earth2me.essentials.InventoryWorkaround;
|
||||
import com.earth2me.essentials.ItemDb;
|
||||
import com.earth2me.essentials.User;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.craftbukkit.inventory.CraftInventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@ -38,6 +39,24 @@ public class Commandunlimited extends EssentialsCommand
|
||||
target = getPlayer(server, args, 1);
|
||||
}
|
||||
|
||||
if (target.isAuthorized("essentials.unlimited.eggthrow") && stack.getType() == Material.EGG) {
|
||||
user.sendMessage(ChatColor.RED + "Unlimited eggs already activated by permissions.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (target.isAuthorized("essentials.unlimited.buckets") &&
|
||||
(stack.getType() == Material.WATER_BUCKET || stack.getType() == Material.LAVA_BUCKET)) {
|
||||
user.sendMessage(ChatColor.RED + "Unlimited buckets already activated by permissions.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (target.isAuthorized("essentials.unlimited.placing") &&
|
||||
(stack.getType() != Material.WATER_BUCKET && stack.getType() != Material.LAVA_BUCKET &&
|
||||
stack.getType() != Material.EGG)) {
|
||||
user.sendMessage(ChatColor.RED + "Unlimited placing already activated by permissions.");
|
||||
return;
|
||||
}
|
||||
|
||||
String itemName = stack.getType().name().toLowerCase().replace('_', ' ');
|
||||
|
||||
if (target.hasUnlimited(stack)) {
|
||||
|
Loading…
Reference in New Issue
Block a user