Update Permission #220
@ -40,6 +40,9 @@ public enum Permission {
|
|||||||
}),
|
}),
|
||||||
SPECTATOR(bauweltMember -> {
|
SPECTATOR(bauweltMember -> {
|
||||||
return !BUILD.permissionPredicate.test(bauweltMember);
|
return !BUILD.permissionPredicate.test(bauweltMember);
|
||||||
|
}),
|
||||||
|
MEMBER(bauweltMember -> {
|
||||||
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
private final Predicate<BauweltMember> permissionPredicate;
|
private final Predicate<BauweltMember> permissionPredicate;
|
||||||
|
@ -48,13 +48,6 @@ public class ClearCommand extends SWCommand {
|
|||||||
BauSystem.MESSAGE.send("OTHER_CLEAR_TO", p, target.getName());
|
BauSystem.MESSAGE.send("OTHER_CLEAR_TO", p, target.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ClassValidator(value = Player.class, local = true)
|
|
||||||
public TypeValidator<Player> validator() {
|
|
||||||
return (commandSender, player, messageSender) -> {
|
|
||||||
return !messageSender.send(!Permission.hasPermission(player, Permission.WORLD), "OTHER_CLEAR_NO_PERMS");
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
private void clear(Player player) {
|
private void clear(Player player) {
|
||||||
player.getInventory().clear();
|
player.getInventory().clear();
|
||||||
player.getInventory().setHelmet(new ItemStack(Material.AIR));
|
player.getInventory().setHelmet(new ItemStack(Material.AIR));
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren