fix: ensure restricted worlds setting formats correctly, close #664

This commit is contained in:
William committed 2024-10-27 13:45:31 +00:00
1 parent ab7237faac
commit 3b8abe1b8a
1 file changed
+3 -3
@@ -335,10 +335,10 @@ public final class Settings {
public boolean isWorldRtpRestricted(@NotNull World world) { public boolean isWorldRtpRestricted(@NotNull World world) {
final String name = world.getName(); final String name = world.getName();
final String filteredName = name.startsWith("minecraft:") ? name.substring(10) : name; final String formattedName = name.replace("minecraft:", "");
return restrictedWorlds.stream() return restrictedWorlds.stream()
.map(n -> n.startsWith("minecraft:") ? n.substring(10) : n) .map(n -> n.replace("minecraft:", ""))
.anyMatch(n -> n.equalsIgnoreCase(filteredName)); .anyMatch(n -> n.equalsIgnoreCase(formattedName));
} }
@Comment("Whether or not RTP should perform cross-server.") @Comment("Whether or not RTP should perform cross-server.")