Misc fixes.

Closes a few old youtrack issues which I don't remember because I had
like 30 tabs open, and a few other issues which I found while testing
some of those.
This commit is contained in:
wizjany 2019-05-05 14:25:43 -04:00
parent bc8e477b1c
commit ceff17c4f7
5 changed files with 7 additions and 6 deletions

View File

@ -59,7 +59,7 @@ public void load() {
Map<String, Set<String>> userGroupPermissions = new HashMap<>();
List<String> groupKeys = config.getStringList("permissions.groups", null);
List<String> groupKeys = config.getKeys("permissions.groups");
if (groupKeys != null) {
for (String key : groupKeys) {
@ -77,7 +77,7 @@ public void load() {
}
}
List<String> userKeys = config.getStringList("permissions.users", null);
List<String> userKeys = config.getKeys("permissions.users");
if (userKeys != null) {
for (String key : userKeys) {
@ -150,7 +150,7 @@ public String[] getGroups(String player) {
return new String[0];
}
return groups.toArray(new String[groups.size()]);
return groups.toArray(new String[0]);
}
@Override

View File

@ -85,9 +85,9 @@ public boolean apply(BlockVector3 position, int depth) throws WorldEditException
if (depth == 0) {
if (function.apply(position)) {
affected++;
return true;
}
}
return false;
}

View File

@ -61,7 +61,7 @@ public WorldEditExceptionConverter(WorldEdit worldEdit) {
}
private CommandException newCommandException(String message, Throwable cause) {
return new CommandException(TextComponent.of(message), cause, ImmutableList.of());
return new CommandException(TextComponent.of(String.valueOf(message)), cause, ImmutableList.of());
}
@ExceptionMatch

View File

@ -261,6 +261,7 @@ public synchronized void remove(SessionOwner owner) {
*/
public synchronized void unload() {
clear();
timer.cancel();
}
/**

View File

@ -46,7 +46,7 @@ public SchematicPaginationBox(String rootDir, File[] files, String pageCommand)
@Override
public Component getComponent(int number) {
checkArgument(number < files.length - 1 && number >= 0);
checkArgument(number < files.length && number >= 0);
File file = files[number];
Multimap<String, ClipboardFormat> exts = ClipboardFormats.getFileExtensionMap();
String format = exts.get(Files.getFileExtension(file.getName()))