SteamWar/BauSystem2.0
Archiviert
12
0

Fix Trace Show consolidating too early
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2023-10-16 17:04:18 +02:00
Ursprung d281860b81
Commit 89e8148158
3 geänderte Dateien mit 2 neuen und 31 gelöschten Zeilen

Datei anzeigen

@ -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);
}
}
}
} }

Datei anzeigen

@ -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;

Datei anzeigen

@ -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);
} }