Fixes #665 & Fix download button not being clickable

This commit is contained in:
Jesse Boyd 2017-08-02 23:38:37 +10:00
parent 5f05b5a58a
commit 12fd9b0d62
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
3 changed files with 5 additions and 9 deletions

View File

@ -31,7 +31,6 @@ import com.boydti.fawe.object.io.FastByteArrayOutputStream;
import com.boydti.fawe.object.schematic.Schematic; import com.boydti.fawe.object.schematic.Schematic;
import com.boydti.fawe.util.ImgurUtility; import com.boydti.fawe.util.ImgurUtility;
import com.boydti.fawe.util.MaskTraverser; import com.boydti.fawe.util.MaskTraverser;
import com.boydti.fawe.util.chat.Message;
import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.Command;
import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandContext;
import com.sk89q.minecraft.util.commands.CommandException; import com.sk89q.minecraft.util.commands.CommandException;
@ -316,7 +315,7 @@ public class ClipboardCommands extends MethodCommands {
if (url == null) { if (url == null) {
BBC.GENERATING_LINK_FAILED.send(player); BBC.GENERATING_LINK_FAILED.send(player);
} else { } else {
new Message(BBC.DOWNLOAD_LINK, url).link(url.getPath()).send(player); BBC.DOWNLOAD_LINK.send(player, url.getPath());
} }
} }

View File

@ -817,8 +817,6 @@ public class UtilityCommands extends MethodCommands {
} }
} catch (NumberFormatException ignored) { } catch (NumberFormatException ignored) {
} }
String baseCommand = (prefix.equals("/") ? Commands.getAlias(UtilityCommands.class, "/help") : prefix);
if (effectiveLength > 0) baseCommand += " " + args.getString(0, effectiveLength - 1);
boolean isRootLevel = true; boolean isRootLevel = true;
List<String> visited = new ArrayList<String>(); List<String> visited = new ArrayList<String>();
@ -966,7 +964,7 @@ public class UtilityCommands extends MethodCommands {
msg.newline(); msg.newline();
} }
msg.text(BBC.HELP_FOOTER).link("https://git.io/vSKE5").newline(); msg.text(BBC.HELP_FOOTER).link("https://git.io/vSKE5").newline();
msg.paginate(baseCommand, 0, 1); msg.paginate((prefix.equals("/") ? Commands.getAlias(UtilityCommands.class, "/help") : prefix), 0, 1);
msg.send(actor); msg.send(actor);
return; return;
} }
@ -989,7 +987,6 @@ public class UtilityCommands extends MethodCommands {
int end = Math.min(offset + perPage, aliases.size()); int end = Math.min(offset + perPage, aliases.size());
List<CommandMapping> subAliases = aliases.subList(offset, end); List<CommandMapping> subAliases = aliases.subList(offset, end);
List<String> subPrefixes = prefixes.subList(offset, end); List<String> subPrefixes = prefixes.subList(offset, end);
boolean first = true; boolean first = true;
// Add each command // Add each command
for (int i = 0; i < subAliases.size(); i++) { for (int i = 0; i < subAliases.size(); i++) {
@ -1006,7 +1003,7 @@ public class UtilityCommands extends MethodCommands {
String s2 = mapping.getDescription().getDescription(); String s2 = mapping.getDescription().getDescription();
if (c.testPermission(locals)) { if (c.testPermission(locals)) {
msg.text(BBC.HELP_ITEM_ALLOWED, s1, s2); msg.text(BBC.HELP_ITEM_ALLOWED, s1, s2);
String helpCmd = baseCommand + " " + mapping.getPrimaryAlias(); String helpCmd = (prefix.equals("/") ? Commands.getAlias(UtilityCommands.class, "/help") + " " : "") + s1;
msg.cmdTip(helpCmd); msg.cmdTip(helpCmd);
msg.newline(); msg.newline();
} else { } else {
@ -1016,6 +1013,8 @@ public class UtilityCommands extends MethodCommands {
if (args.argsLength() == 0) { if (args.argsLength() == 0) {
msg.text(BBC.HELP_FOOTER).newline(); msg.text(BBC.HELP_FOOTER).newline();
} }
String baseCommand = (prefix.equals("/") ? Commands.getAlias(UtilityCommands.class, "/help") : prefix);
if (effectiveLength > 0) baseCommand += " " + args.getString(0, effectiveLength - 1);
msg.paginate(baseCommand, page + 1, pageTotal); msg.paginate(baseCommand, page + 1, pageTotal);
} }
msg.send(actor); msg.send(actor);

View File

@ -192,14 +192,12 @@ public class BrushTool implements DoubleActionTraceTool, ScrollTool, MovableTool
public void setPrimary(BrushSettings primary) { public void setPrimary(BrushSettings primary) {
checkNotNull(primary); checkNotNull(primary);
if (this.secondary.getBrush() == null) this.secondary = primary;
this.primary = primary; this.primary = primary;
this.context = primary; this.context = primary;
} }
public void setSecondary(BrushSettings secondary) { public void setSecondary(BrushSettings secondary) {
checkNotNull(secondary); checkNotNull(secondary);
if (this.primary.getBrush() == null) this.primary = secondary;
this.secondary = secondary; this.secondary = secondary;
this.context = secondary; this.context = secondary;
} }