From 89e814815853ec5187f0e23e9bf1de8422cb94a5 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 16 Oct 2023 17:04:18 +0200 Subject: [PATCH] Fix Trace Show consolidating too early --- .../src/de/steamwar/bausystem/Permission.java | 29 ------------------- .../features/tracer/TraceCommand.java | 2 +- .../tracer/show/TraceShowManager.java | 2 +- 3 files changed, 2 insertions(+), 31 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/Permission.java b/BauSystem_Main/src/de/steamwar/bausystem/Permission.java index fb1902f4..b2f14e4f 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/Permission.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/Permission.java @@ -59,33 +59,4 @@ public enum Permission { public static boolean hasPermission(Player member, Permission permission) { 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 { - - 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); - } - } - } } \ No newline at end of file diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java index a6de0ebb..366cc7a3 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java @@ -198,7 +198,7 @@ public class TraceCommand extends SWCommand { @AllArgsConstructor 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)); private BiFunction> showModeBiFunction; diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/TraceShowManager.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/TraceShowManager.java index e3745391..695c8115 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/TraceShowManager.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/TraceShowManager.java @@ -66,7 +66,7 @@ public class TraceShowManager implements Listener { } _hide(region, player, false); - ShowMode showMode = showModes.computeIfAbsent(region, __ -> new HashMap<>()).computeIfAbsent(player, __ -> new EntityShowMode(player, new ShowModeParameter(), 10)); + ShowMode showMode = showModes.computeIfAbsent(region, __ -> new HashMap<>()).computeIfAbsent(player, __ -> new EntityShowMode(player, new ShowModeParameter(), 16)); StoredRecords.show(region, getShowFilter(player, region), showMode); }