Skip to content

Commit 7195d0f

Browse files
committed
Move pattern to top to ensure loading sequence during class init
1 parent 5b26459 commit 7195d0f

File tree

2 files changed

+12
-12
lines changed
  • DeathMessagesLegacy/src/main/java/dev/mrshawn/deathmessages/utils
  • DeathMessagesModern/src/main/java/dev/mrshawn/deathmessages/utils

2 files changed

+12
-12
lines changed

DeathMessagesLegacy/src/main/java/dev/mrshawn/deathmessages/utils/Util.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,6 @@
4141

4242
public class Util {
4343

44-
public static final Audience CONSOLE = DeathMessages.getInstance().adventure().console();
45-
public static final TextReplacementConfig PREFIX = TextReplacementConfig.builder()
46-
.matchLiteral("%prefix%")
47-
.replacement(convertFromLegacy(Messages.getInstance().getConfig().getString("Prefix")))
48-
.build();
49-
5044
private static final Pattern BUNGEE_RGB_PATTERN = Pattern.compile("(?<!&)(#[0-9a-fA-F]{6})"); // Match bungee RGB color code only, use Negative Lookbehind to avoid matching code begin with &
5145
public static final Pattern STRIP_COLOR_PATTERN = Pattern.compile("(?i)" + "§" + "[0-9A-FK-ORX]");
5246
public static final Pattern DM_PERM_PATTERN = Pattern.compile("PERMISSION\\[(.*?)]");
@@ -55,6 +49,12 @@ public class Util {
5549
public static final Pattern DM_HOVER_EVENT_PATTERN = Pattern.compile("\\[(.*?)]"); // Match all string between [ and ], e.g. aaa[123]bbb -> [123]
5650
public static final Pattern PAPI_PLACEHOLDER_PATTERN = Pattern.compile("%([^%]+)%");
5751

52+
public static final Audience CONSOLE = DeathMessages.getInstance().adventure().console();
53+
public static final TextReplacementConfig PREFIX = TextReplacementConfig.builder()
54+
.matchLiteral("%prefix%")
55+
.replacement(convertFromLegacy(Messages.getInstance().getConfig().getString("Prefix")))
56+
.build();
57+
5858
public static Pattern[] customWeaponNamePatterns;
5959

6060
public static final Map<UUID, LivingEntity> crystalDeathData = new HashMap<>(); // <EndCrystal UUID, Causing Entity instance>

DeathMessagesModern/src/main/java/dev/mrshawn/deathmessages/utils/Util.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,6 @@
4141

4242
public class Util {
4343

44-
public static final ConsoleCommandSender CONSOLE = Bukkit.getServer().getConsoleSender();
45-
public static final TextReplacementConfig PREFIX = TextReplacementConfig.builder()
46-
.matchLiteral("%prefix%")
47-
.replacement(convertFromLegacy(Messages.getInstance().getConfig().getString("Prefix")))
48-
.build();
49-
5044
private static final Pattern BUNGEE_RGB_PATTERN = Pattern.compile("(?<!&)(#[0-9a-fA-F]{6})"); // Match bungee RGB color code only, use Negative Lookbehind to avoid matching code begin with &
5145
public static final Pattern STRIP_COLOR_PATTERN = Pattern.compile("(?i)" + "§" + "[0-9A-FK-ORX]");
5246
public static final Pattern DM_PERM_PATTERN = Pattern.compile("PERMISSION\\[(.*?)]");
@@ -55,6 +49,12 @@ public class Util {
5549
public static final Pattern DM_HOVER_EVENT_PATTERN = Pattern.compile("\\[(.*?)]"); // Match all string between [ and ], e.g. aaa[123]bbb -> [123]
5650
public static final Pattern PAPI_PLACEHOLDER_PATTERN = Pattern.compile("%([^%]+)%");
5751

52+
public static final ConsoleCommandSender CONSOLE = Bukkit.getServer().getConsoleSender();
53+
public static final TextReplacementConfig PREFIX = TextReplacementConfig.builder()
54+
.matchLiteral("%prefix%")
55+
.replacement(convertFromLegacy(Messages.getInstance().getConfig().getString("Prefix")))
56+
.build();
57+
5858
public static Pattern[] customWeaponNamePatterns;
5959

6060
public static final Map<UUID, LivingEntity> crystalDeathData = new HashMap<>(); // <EndCrystal UUID, Causing Entity instance>

0 commit comments

Comments
 (0)