mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
When custom files are found, use the base files for default values.
This commit is contained in:
parent
87fb9f6d0e
commit
9a01bf9ab2
@ -106,7 +106,7 @@ public class BiomeCommands {
|
||||
})
|
||||
.collect(Collectors.toList()));
|
||||
return paginationBox.create(page);
|
||||
}, null);
|
||||
}, (Component) null);
|
||||
}
|
||||
|
||||
@Command(
|
||||
|
@ -51,6 +51,7 @@ import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import com.sk89q.worldedit.regions.CylinderRegion;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldedit.util.formatting.component.SubtleFormat;
|
||||
import com.sk89q.worldedit.util.formatting.text.Component;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.format.TextColor;
|
||||
@ -491,7 +492,7 @@ public class UtilityCommands {
|
||||
new double[]{}, WorldEdit.getInstance().getSessionManager().get(actor).getTimeout());
|
||||
String formatted = Double.isNaN(result) ? "NaN" : formatForLocale(actor.getLocale()).format(result);
|
||||
return SubtleFormat.wrap(input + " = ").append(TextComponent.of(formatted, TextColor.LIGHT_PURPLE));
|
||||
}, null);
|
||||
}, (Component) null);
|
||||
}
|
||||
|
||||
@Command(
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.regions;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.sk89q.worldedit.IncompleteRegionException;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
@ -158,7 +159,9 @@ public interface RegionSelector {
|
||||
* @return a list of lines describing the region
|
||||
*/
|
||||
@Deprecated
|
||||
List<String> getInformationLines();
|
||||
default List<String> getInformationLines() {
|
||||
return Lists.newArrayList();
|
||||
};
|
||||
|
||||
/**
|
||||
* Get lines of information about the selection.
|
||||
|
@ -85,20 +85,26 @@ public class TranslationManager {
|
||||
}
|
||||
|
||||
private Optional<Map<String, String>> loadTranslationFile(String filename) {
|
||||
Map<String, String> baseTranslations;
|
||||
|
||||
try {
|
||||
baseTranslations = parseTranslationFile(ResourceLoader.getResourceRoot("lang/" + filename));
|
||||
} catch (IOException e) {
|
||||
// Seem to be missing base. If the user has provided a file use that.
|
||||
baseTranslations = new HashMap<>();
|
||||
}
|
||||
|
||||
File localFile = worldEdit.getWorkingDirectoryFile("lang/" + filename);
|
||||
if (localFile.exists()) {
|
||||
try {
|
||||
return Optional.of(parseTranslationFile(localFile));
|
||||
baseTranslations.putAll(parseTranslationFile(localFile));
|
||||
} catch (IOException e) {
|
||||
return Optional.empty();
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
return Optional.of(parseTranslationFile(ResourceLoader.getResourceRoot("lang/" + filename)));
|
||||
} catch (IOException e) {
|
||||
return Optional.empty();
|
||||
// Failed to parse custom language file. Worth printing.
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
return baseTranslations.size() == 0 ? Optional.empty() : Optional.of(baseTranslations);
|
||||
}
|
||||
|
||||
private boolean tryLoadTranslations(Locale locale) {
|
||||
|
Loading…
Reference in New Issue
Block a user