mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 20:16:41 +00:00
Another selective merge
This commit is contained in:
@ -6,63 +6,60 @@ import com.boydti.fawe.object.FaweQueue;
|
||||
import com.boydti.fawe.regions.FaweMaskManager;
|
||||
import com.boydti.fawe.util.TaskManager;
|
||||
import com.boydti.fawe.util.cui.CUI;
|
||||
import com.boydti.fawe.util.gui.FormBuilder;
|
||||
import com.boydti.fawe.util.image.ImageViewer;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Collection;
|
||||
import java.util.UUID;
|
||||
|
||||
public interface IFawe {
|
||||
public void debug(final String s);
|
||||
void debug(final String s);
|
||||
|
||||
public File getDirectory();
|
||||
File getDirectory();
|
||||
|
||||
public void setupCommand(final String label, final FaweCommand cmd);
|
||||
void setupCommand(final String label, final FaweCommand cmd);
|
||||
|
||||
public FawePlayer wrap(final Object obj);
|
||||
FawePlayer wrap(final Object obj);
|
||||
|
||||
public void setupVault();
|
||||
void setupVault();
|
||||
|
||||
public TaskManager getTaskManager();
|
||||
TaskManager getTaskManager();
|
||||
|
||||
public FaweQueue getNewQueue(World world, boolean fast);
|
||||
FaweQueue getNewQueue(World world, boolean fast);
|
||||
|
||||
public FaweQueue getNewQueue(String world, boolean fast);
|
||||
FaweQueue getNewQueue(String world, boolean fast);
|
||||
|
||||
public String getWorldName(World world);
|
||||
String getWorldName(World world);
|
||||
|
||||
public Collection<FaweMaskManager> getMaskManagers();
|
||||
Collection<FaweMaskManager> getMaskManagers();
|
||||
|
||||
public void startMetrics();
|
||||
void startMetrics();
|
||||
|
||||
default CUI getCUI(FawePlayer player) { return null; }
|
||||
|
||||
default ImageViewer getImageViewer(FawePlayer player) { return null; }
|
||||
|
||||
public default void registerPacketListener() {}
|
||||
default void registerPacketListener() {}
|
||||
|
||||
default int getPlayerCount() {
|
||||
return Fawe.get().getCachedPlayers().size();
|
||||
}
|
||||
|
||||
public String getPlatformVersion();
|
||||
String getPlatformVersion();
|
||||
|
||||
public boolean isOnlineMode();
|
||||
boolean isOnlineMode();
|
||||
|
||||
public String getPlatform();
|
||||
String getPlatform();
|
||||
|
||||
public UUID getUUID(String name);
|
||||
UUID getUUID(String name);
|
||||
|
||||
public String getName(UUID uuid);
|
||||
String getName(UUID uuid);
|
||||
|
||||
public Object getBlocksHubApi();
|
||||
Object getBlocksHubApi();
|
||||
|
||||
public default String getDebugInfo() {
|
||||
default String getDebugInfo() {
|
||||
return "";
|
||||
}
|
||||
|
||||
public default FormBuilder getFormBuilder() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -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