From 54b17fa62d6266aea3f2c7fc79fb6c9905d8fc49 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 7 Jan 2023 11:06:24 +0100 Subject: [PATCH] Fix name constant Signed-off-by: yoyosource --- .../bausystem/features/script/variables/Constants.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/script/variables/Constants.java b/BauSystem_Main/src/de/steamwar/bausystem/features/script/variables/Constants.java index 58891d04..e0ec0872 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/script/variables/Constants.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/script/variables/Constants.java @@ -15,8 +15,8 @@ import de.steamwar.bausystem.region.flags.flagvalues.FreezeMode; import de.steamwar.bausystem.region.flags.flagvalues.ProtectMode; import de.steamwar.bausystem.region.flags.flagvalues.TNTMode; import de.steamwar.core.TPSWatcher; +import de.steamwar.sql.SteamwarUser; import lombok.experimental.UtilityClass; -import org.bukkit.Location; import org.bukkit.entity.Player; import org.bukkit.inventory.meta.ItemMeta; @@ -25,7 +25,6 @@ import java.util.Calendar; import java.util.HashMap; import java.util.Map; import java.util.Set; -import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Supplier; @@ -223,7 +222,8 @@ public class Constants { return new ConstantDoubleValue(() -> player.getLocation().getZ()); }); CONSTANTS.put("name", player -> { - return new ConstantStringValue(player::getDisplayName); + SteamwarUser user = SteamwarUser.get(player.getUniqueId()); + return new ConstantStringValue(user::getUserName); }); CONSTANTS.put("sneaking", player -> { return new ConstantBooleanValue(player::isSneaking);