Skip to content

Commit df0250c

Browse files
committed
Small improvement for troubleshoot command
1 parent 150b91a commit df0250c

3 files changed

Lines changed: 22 additions & 13 deletions

File tree

common/src/main/java/de/bluecolored/bluemap/common/commands/TextFormat.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ public class TextFormat {
8383

8484
public static final String DISCORD_LINK = "https://discord.gg/zmkyJa3";
8585
public static final String WIKI_LINK = "https://bluemap.bluecolored.de/wiki/";
86+
public static final String WIKI_LINK_RENDER_MASKS = "https://bluemap.bluecolored.de/wiki/customization/Masks.html";
8687

8788
public static Component paragraph(TextColor color, Component title, Component content) {
8889
return lines(

common/src/main/java/de/bluecolored/bluemap/common/commands/checks/TileInsideBoundsCheck.java

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import lombok.Getter;
3232
import lombok.RequiredArgsConstructor;
3333
import net.kyori.adventure.text.Component;
34+
import net.kyori.adventure.text.event.ClickEvent;
3435

3536
import static de.bluecolored.bluemap.common.commands.TextFormat.*;
3637
import static net.kyori.adventure.text.Component.empty;
@@ -58,14 +59,23 @@ public Component getFailureDescription() {
5859
),
5960
empty(),
6061
format("""
61-
make sure to set %, %, % and %
62-
in % correctly
62+
if you expect this part of the map to be rendered
63+
make sure your %
64+
in % is correct
6365
""".strip(),
64-
text("min-x").color(HIGHLIGHT_COLOR),
65-
text("min-z").color(HIGHLIGHT_COLOR),
66-
text("max-x").color(HIGHLIGHT_COLOR),
67-
text("max-z").color(HIGHLIGHT_COLOR),
66+
text("render-mask").color(HIGHLIGHT_COLOR),
6867
formatConfigFilePath("maps/" + map.getId()).color(HIGHLIGHT_COLOR)
68+
).color(BASE_COLOR),
69+
empty(),
70+
format("""
71+
more info about the % setting can
72+
be found %
73+
""".strip(),
74+
text("render-mask").color(HIGHLIGHT_COLOR),
75+
text("in the wiki")
76+
.hoverEvent(text(WIKI_LINK_RENDER_MASKS))
77+
.clickEvent(ClickEvent.openUrl(WIKI_LINK_RENDER_MASKS))
78+
.color(HIGHLIGHT_COLOR)
6979
).color(BASE_COLOR)
7080
);
7181
}

common/src/main/java/de/bluecolored/bluemap/common/commands/commands/TroubleshootCommand.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ private void troubleshoot(BmMap[] maps, @Nullable Vector2i position) throws Chec
112112
for (BmMap map : maps) {
113113
new TileIsUpdatedCheck(plugin, map, position).test();
114114
}
115+
116+
// check map boundaries
117+
for (BmMap map : maps) {
118+
new TileInsideBoundsCheck(plugin, map, position).test();
119+
}
115120
}
116121

117122
// check maps are updated
@@ -123,13 +128,6 @@ private void troubleshoot(BmMap[] maps, @Nullable Vector2i position) throws Chec
123128
for (BmMap map : maps) {
124129
new MapIsNotFrozenCheck(plugin, map).test();
125130
}
126-
127-
if (position != null) {
128-
// check map-boundaries
129-
for (BmMap map : maps) {
130-
new TileInsideBoundsCheck(plugin, map, position).test();
131-
}
132-
}
133131
}
134132

135133
private void troubleshootTileAt(BmMap map, Vector2i position) throws Check.CheckFailedException {

0 commit comments

Comments
 (0)