Skip to content
Permalink
Browse files

Update docs links to point to enginehub.

Also don't allow block-place/block-break setting from flag helper.
  • Loading branch information...
wizjany committed Aug 7, 2019
1 parent f165ae3 commit bbed280f62877393119bf9526f3f837fc13e1b9c
@@ -43,4 +43,4 @@ Links
* [IRC channel](https://webchat.esper.net/?join=sk89q) (#sk89q on irc.esper.net)
* [Issue tracker](https://dev.enginehub.org/issues/WORLDGUARD)
* [Continuous integration](http://builds.enginehub.org) [![Build Status](https://ci.enginehub.org/app/rest/builds/buildType:bt11,branch:master/statusIcon.svg)](http://ci.enginehub.org/viewType.html?buildTypeId=bt11&guest=1)
* [End-user documentation](https://worldguard.readthedocs.io/en/latest/)
* [End-user documentation](https://worldguard.enginehub.org/en/latest/)
@@ -42,7 +42,7 @@
###############################################################################
#
# For more information, see:
# https://worldguard.readthedocs.io/en/latest/blacklist/
# https://worldguard.enginehub.org/en/latest/blacklist/
#
###############################################################################
#
@@ -76,6 +76,7 @@
.collect(Collectors.toList());
private static final int SIZE = FLAGS.size() == Flags.INBUILT_FLAGS.size() ? FLAGS.size() : FLAGS.size() + 1;
private static final int PAD_PX_SIZE = 180;
private static final Set<Flag<?>> DANGER_ZONE = ImmutableSet.of(Flags.BUILD, Flags.PASSTHROUGH, Flags.BLOCK_PLACE, Flags.BLOCK_BREAK);

private final World world;
private final ProtectedRegion region;
@@ -200,7 +201,13 @@ private void appendFlagValue(TextComponent.Builder builder, Flag<?> flag) {
if (maySet) {
if (isExplicitSet) {
hoverTexts.add(TextComponent.of("Click to unset", TextColor.GOLD));
} else if (flag != Flags.BUILD && flag != Flags.PASSTHROUGH) {
} else if (DANGER_ZONE.contains(flag)) {
hoverTexts.add(TextComponent.of("Setting this flag may have unintended consequences.", TextColor.RED)
.append(TextComponent.newline())
.append(TextComponent.of("Please read the documentation and set this flag manually if you really intend to.")
.append(TextComponent.newline())
.append(TextComponent.of("(Hint: You do not need to set this to protect the region!)"))));
} else {
hoverTexts.add(TextComponent.of("Click to set", TextColor.GOLD));
}
}
@@ -221,7 +228,7 @@ private void appendFlagValue(TextComponent.Builder builder, Flag<?> flag) {
HoverEvent.of(HoverEvent.Action.SHOW_TEXT, hoverBuilder.build()));
}

if (maySet && (isExplicitSet || flag != Flags.BUILD && flag != Flags.PASSTHROUGH)) {
if (maySet && (isExplicitSet || !DANGER_ZONE.contains(flag))) {
builder.append(choiceComponent.clickEvent(ClickEvent.of(ClickEvent.Action.RUN_COMMAND,
makeCommand(flag, isExplicitSet ? "" : choice))));
} else {
@@ -539,10 +539,10 @@ public void flag(CommandContext args, Actor sender) throws CommandException {
.append(TextComponent.of("Only set this flag if you are sure you know what you are doing. See ")
.append(TextComponent.of("[this documentation page]", TextColor.AQUA)
.clickEvent(ClickEvent.of(ClickEvent.Action.OPEN_URL,
"https://worldguard.readthedocs.io/en/latest/regions/flags/#protection-related")))
"https://worldguard.enginehub.org/en/latest/regions/flags/#protection-related")))
.append(TextComponent.of(" for more info."))));
if (!sender.isPlayer()) {
sender.printRaw("https://worldguard.readthedocs.io/en/latest/regions/flags/#protection-related");
sender.printRaw("https://worldguard.enginehub.org/en/latest/regions/flags/#protection-related");
}
} else if (foundFlag == Flags.PASSTHROUGH) {
sender.print(TextComponent.empty().append(TextComponent.of("WARNING:", TextColor.RED, Sets.newHashSet(TextDecoration.BOLD)))
@@ -551,10 +551,10 @@ public void flag(CommandContext args, Actor sender) throws CommandException {
.append(TextComponent.of("It overrides build checks. If you're unsure what this means, see ")
.append(TextComponent.of("[this documentation page]", TextColor.AQUA)
.clickEvent(ClickEvent.of(ClickEvent.Action.OPEN_URL,
"https://worldguard.readthedocs.io/en/latest/regions/flags/#overrides")))
"https://worldguard.enginehub.org/en/latest/regions/flags/#overrides")))
.append(TextComponent.of(" for more info."))));
if (!sender.isPlayer()) {
sender.printRaw("https://worldguard.readthedocs.io/en/latest/regions/flags/#overrides");
sender.printRaw("https://worldguard.enginehub.org/en/latest/regions/flags/#overrides");
}
}
}

0 comments on commit bbed280

Please sign in to comment.
You can’t perform that action at this time.