Fixes #977
This commit is contained in:
parent
02f2572cf5
commit
a89bdae93b
@ -582,6 +582,9 @@ public class SchematicCommands extends MethodCommands {
|
|||||||
color = "&6";
|
color = "&6";
|
||||||
} else {
|
} else {
|
||||||
color = "&a";
|
color = "&a";
|
||||||
|
System.out.println("Name " + name + " | " + name.lastIndexOf('.'));
|
||||||
|
if (name.indexOf('.') != -1) name = name.substring(0, name.lastIndexOf('.'));
|
||||||
|
System.out.println(" -> " + name);
|
||||||
}
|
}
|
||||||
} else if (uriStr.startsWith("http://") || uriStr.startsWith("https://")) {
|
} else if (uriStr.startsWith("http://") || uriStr.startsWith("https://")) {
|
||||||
// url
|
// url
|
||||||
@ -594,17 +597,17 @@ public class SchematicCommands extends MethodCommands {
|
|||||||
|
|
||||||
if (msg.supportsInteraction()) {
|
if (msg.supportsInteraction()) {
|
||||||
if (loaded) {
|
if (loaded) {
|
||||||
msg.text("&7[&c-&7]").command(unload + " " + relFilePath).tooltip("Unload this schematic");
|
msg.text("&7[&c-&7]").command(unload + " " + relFilePath).tooltip("Unload");
|
||||||
} else {
|
} else {
|
||||||
msg.text("&7[&a+&7]").command(loadMulti + " " + relFilePath).tooltip("(WIP) Append this to your clipboard");
|
msg.text("&7[&a+&7]").command(loadMulti + " " + relFilePath).tooltip("Add to clipboard");
|
||||||
}
|
}
|
||||||
if (hasShow) msg.text("&7[&3O&7]").cmdTip(showCmd + " " + args.getJoinedStrings(0) + " " + relFilePath);
|
if (!isDir) msg.text("&7[&cX&7]").suggest("/" + delete + " " + relFilePath).tooltip("Delete");
|
||||||
if (!isDir) msg.text("&7[&cX&7]").suggestTip("/" + delete + " " + relFilePath);
|
else if (hasShow) msg.text("&7[&3O&7]").command(showCmd + " " + args.getJoinedStrings(0) + " " + relFilePath).tooltip("Show");
|
||||||
msg.text(color + relFilePath);
|
msg.text(color + name);
|
||||||
if (isDir) {
|
if (isDir) {
|
||||||
msg.cmdTip(list + " " + args.getJoinedStrings(0) + " " + relFilePath);
|
msg.command(list + " " + args.getJoinedStrings(0) + " " + relFilePath).tooltip("Load");
|
||||||
} else {
|
} else {
|
||||||
msg.cmdTip(loadSingle + " " + relFilePath);
|
msg.command(loadSingle + " " + relFilePath).tooltip("Load");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
msg.text(color).text(name);
|
msg.text(color).text(name);
|
||||||
|
@ -632,6 +632,7 @@ public class UtilityCommands extends MethodCommands {
|
|||||||
public static void list(File dir, Actor actor, CommandContext args, @Range(min = 0) int page, int perPage, String formatName, boolean playerFolder, RunnableVal3<Message, URI, String> eachMsg) {
|
public static void list(File dir, Actor actor, CommandContext args, @Range(min = 0) int page, int perPage, String formatName, boolean playerFolder, RunnableVal3<Message, URI, String> eachMsg) {
|
||||||
AtomicInteger pageInt = new AtomicInteger(page);
|
AtomicInteger pageInt = new AtomicInteger(page);
|
||||||
List<File> fileList = new ArrayList<>();
|
List<File> fileList = new ArrayList<>();
|
||||||
|
if (perPage == -1) perPage = actor instanceof Player ? 12 : 20; // More pages for console
|
||||||
page = getFiles(dir, actor, args, page, perPage, formatName, playerFolder, file -> fileList.add(file));
|
page = getFiles(dir, actor, args, page, perPage, formatName, playerFolder, file -> fileList.add(file));
|
||||||
|
|
||||||
if (fileList.isEmpty()) {
|
if (fileList.isEmpty()) {
|
||||||
@ -639,7 +640,6 @@ public class UtilityCommands extends MethodCommands {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (perPage == -1) perPage = actor instanceof Player ? 12 : 20; // More pages for console
|
|
||||||
int pageCount = (fileList.size() + perPage - 1) / perPage;
|
int pageCount = (fileList.size() + perPage - 1) / perPage;
|
||||||
if (page < 1) {
|
if (page < 1) {
|
||||||
BBC.SCHEMATIC_PAGE.send(actor, ">0");
|
BBC.SCHEMATIC_PAGE.send(actor, ">0");
|
||||||
|
Loading…
Reference in New Issue
Block a user