mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-15 01:08:35 +00:00
Another selective merge
This commit is contained in:
@ -55,7 +55,7 @@ public class Message {
|
||||
return text(caption.format(args));
|
||||
}
|
||||
|
||||
public Message text(Object text) {
|
||||
public Message text(java.io.Serializable text) {
|
||||
Fawe.get().getChatManager().text(this, BBC.color(Objects.toString(text)));
|
||||
return this;
|
||||
}
|
||||
|
@ -17,7 +17,6 @@ import com.sk89q.worldedit.util.command.binding.Range;
|
||||
import com.sk89q.worldedit.util.command.parametric.ParameterData;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@ -58,7 +57,7 @@ public class UsageMessage extends Message {
|
||||
String prefix = !commandString.isEmpty() ? commandString + " " : "";
|
||||
|
||||
List<CommandMapping> list = new ArrayList<>(dispatcher.getCommands());
|
||||
Collections.sort(list, new PrimaryAliasComparator(CommandManager.COMMAND_CLEAN_PATTERN));
|
||||
list.sort(new PrimaryAliasComparator(CommandManager.COMMAND_CLEAN_PATTERN));
|
||||
|
||||
for (CommandMapping mapping : list) {
|
||||
boolean perm = locals == null || mapping.getCallable().testPermission(locals);
|
||||
@ -110,7 +109,6 @@ public class UsageMessage extends Message {
|
||||
|
||||
StringBuilder tooltip = new StringBuilder();
|
||||
String command = null;
|
||||
String webpage = null;
|
||||
|
||||
tooltip.append("Name: " + param.getName());
|
||||
if (param instanceof ParameterData) {
|
||||
@ -129,23 +127,21 @@ public class UsageMessage extends Message {
|
||||
if (type instanceof Class) {
|
||||
Link link = (Link) ((Class) type).getAnnotation(Link.class);
|
||||
if (link != null) {
|
||||
if (link.value().startsWith("http")) webpage = link.value();
|
||||
else command = Commands.getAlias(link.clazz(), link.value());
|
||||
command = Commands.getAlias(link.clazz(), link.value());
|
||||
}
|
||||
}
|
||||
}
|
||||
tooltip.append("\nOptional: " + (param.isOptional() || param.isValueFlag()));
|
||||
if (param.getDefaultValue() != null && param.getDefaultValue().length >= 0) {
|
||||
if (param.getDefaultValue() != null) {
|
||||
tooltip.append("\nDefault: " + param.getDefaultValue()[0]);
|
||||
} else if (argStr.contains("=")) {
|
||||
tooltip.append("\nDefault: " + argStr.split("[=|\\]|>]")[1]);
|
||||
}
|
||||
if (command != null || webpage != null) {
|
||||
if (command != null) {
|
||||
tooltip.append("\nClick for more info");
|
||||
}
|
||||
tooltip(tooltip.toString());
|
||||
if (command != null) command(command);
|
||||
if (webpage != null) link(webpage);
|
||||
}
|
||||
|
||||
newline();
|
||||
|
@ -1,31 +0,0 @@
|
||||
package com.boydti.fawe.util.gui;
|
||||
|
||||
import com.boydti.fawe.object.FawePlayer;
|
||||
import java.net.URL;
|
||||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public interface FormBuilder<T> {
|
||||
FormBuilder setTitle(String text);
|
||||
|
||||
FormBuilder setIcon(URL icon);
|
||||
|
||||
FormBuilder addButton(String text, @Nullable URL image);
|
||||
|
||||
FormBuilder addDropdown(String text, int def, String... options);
|
||||
|
||||
FormBuilder addInput(String text, String placeholder, String def);
|
||||
|
||||
FormBuilder addLabel(String text);
|
||||
|
||||
FormBuilder addSlider(String text, double min, double max, int step, double def);
|
||||
|
||||
FormBuilder addStepSlider(String text, int def, String... options);
|
||||
|
||||
FormBuilder addToggle(String text, boolean def);
|
||||
|
||||
FormBuilder setResponder(Consumer<Map<Integer, Object>> handler);
|
||||
|
||||
void display(FawePlayer<T> fp);
|
||||
}
|
Reference in New Issue
Block a user