Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Essentials/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ dependencies {
}
}

test {
testLogging.showStandardStreams = true
}

shadowJar {
dependencies {
include (dependency('io.papermc:paperlib'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,12 +226,12 @@ public static String formatString(final IUser user, final String permBase, Strin
final EnumSet<ChatColor> strip = EnumSet.complementOf(supported);

final boolean rgb = user.isAuthorized(permBase + ".rgb");
if (!supported.isEmpty() || rgb) {
message = replaceColor(message, supported, rgb);
}
if (!strip.isEmpty()) {
message = stripColor(message, strip);
}
if (!supported.isEmpty() || rgb) {
message = replaceColor(message, supported, rgb);
}
return message;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public static BukkitVersion fromString(final String string) {
if (!Bukkit.getName().equals("Essentials Fake Server")) {
throw new IllegalArgumentException(string + " is not in valid version format. e.g. 1.8.8-R0.1");
}
matcher = VERSION_PATTERN.matcher(v1_14_R01.toString());
matcher = VERSION_PATTERN.matcher(v1_16_1_R01.toString());
Preconditions.checkArgument(matcher.matches(), string + " is not in valid version format. e.g. 1.8.8-R0.1");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ public void testFormatCase() {
checkFormatPerms("§aT§Aest", "§aT§Aest", "color");
}

@Test
public void testFormatHexColors() {
checkFormatPerms("&#ffffff", "&#ffffff");
checkFormatPerms("&#ffffff", "§x§f§f§f§f§f§f", "color", "rgb");
checkFormatPerms("&#ff0000test", "§x§f§f§0§0§0§0test", "rgb");
checkFormatPerms("&#ff0000test", "§x§f§f§0§0§0§0test", "rgb", "color");
checkFormatPerms("&#ff0000test", "§x§f§f§0§0§0§0test", "rgb", "white");
checkFormatPerms("&#ff0000test", "§x§f§f§0§0§0§0test", "rgb", "black");
checkFormatPerms("&#ff0000test", "§x§f§f§0§0§0§0test", "rgb", "black", "white");
}

@Test
public void testFormatCategoryPerms() {
checkFormatPerms("Test", "Test");
Expand Down