Dieser Commit ist enthalten in:
Ursprung
d281860b81
Commit
89e8148158
@ -59,33 +59,4 @@ public enum Permission {
|
|||||||
public static boolean hasPermission(Player member, Permission permission) {
|
public static boolean hasPermission(Player member, Permission permission) {
|
||||||
return permission.hasPermission(member);
|
return permission.hasPermission(member);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
|
||||||
@Target(ElementType.PARAMETER)
|
|
||||||
@CommandMetaData.Parameter({Player.class})
|
|
||||||
@CommandMetaData.ImplicitValidator(handler = Perm.Handler.class, order = -10)
|
|
||||||
public @interface Perm {
|
|
||||||
Permission value();
|
|
||||||
String message() default "";
|
|
||||||
|
|
||||||
class Handler implements TypeValidator<Player> {
|
|
||||||
|
|
||||||
private Permission permission;
|
|
||||||
private String message;
|
|
||||||
|
|
||||||
public Handler(Perm perm) {
|
|
||||||
this.permission = perm.value();
|
|
||||||
this.message = perm.message();
|
|
||||||
if (message != null && message.isEmpty()) message = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean validate(CommandSender commandSender, Player player, MessageSender messageSender) {
|
|
||||||
if (message == null) {
|
|
||||||
return permission.hasPermission(player);
|
|
||||||
}
|
|
||||||
return !messageSender.send(!permission.hasPermission((Player) commandSender), message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -198,7 +198,7 @@ public class TraceCommand extends SWCommand {
|
|||||||
|
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
private enum ShowModeType {
|
private enum ShowModeType {
|
||||||
ENTITY((player, showModeParameter) -> new EntityShowMode(player, showModeParameter, 10)),
|
ENTITY((player, showModeParameter) -> new EntityShowMode(player, showModeParameter, 16)),
|
||||||
RAW((player, showModeParameter) -> new EntityShowMode(player, showModeParameter, -1));
|
RAW((player, showModeParameter) -> new EntityShowMode(player, showModeParameter, -1));
|
||||||
|
|
||||||
private BiFunction<Player, ShowModeParameter, ShowMode<TNTPosition>> showModeBiFunction;
|
private BiFunction<Player, ShowModeParameter, ShowMode<TNTPosition>> showModeBiFunction;
|
||||||
|
@ -66,7 +66,7 @@ public class TraceShowManager implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_hide(region, player, false);
|
_hide(region, player, false);
|
||||||
ShowMode<TNTPosition> showMode = showModes.computeIfAbsent(region, __ -> new HashMap<>()).computeIfAbsent(player, __ -> new EntityShowMode(player, new ShowModeParameter(), 10));
|
ShowMode<TNTPosition> showMode = showModes.computeIfAbsent(region, __ -> new HashMap<>()).computeIfAbsent(player, __ -> new EntityShowMode(player, new ShowModeParameter(), 16));
|
||||||
StoredRecords.show(region, getShowFilter(player, region), showMode);
|
StoredRecords.show(region, getShowFilter(player, region), showMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren