mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 05:06:44 +01:00
Load configs before accessing them (fixes #3099)
This commit is contained in:
parent
f2e6fd9692
commit
56920fe833
@ -134,8 +134,8 @@ public class PlotSquared {
|
|||||||
private final UUIDPipeline backgroundUUIDPipeline =
|
private final UUIDPipeline backgroundUUIDPipeline =
|
||||||
new UUIDPipeline(Executors.newSingleThreadExecutor());
|
new UUIDPipeline(Executors.newSingleThreadExecutor());
|
||||||
// Localization
|
// Localization
|
||||||
private final CaptionLoader captionLoader;
|
|
||||||
private final Map<String, CaptionMap> captionMaps = new HashMap<>();
|
private final Map<String, CaptionMap> captionMaps = new HashMap<>();
|
||||||
|
private CaptionLoader captionLoader;
|
||||||
public HashMap<String, HashMap<PlotId, Plot>> plots_tmp;
|
public HashMap<String, HashMap<PlotId, Plot>> plots_tmp;
|
||||||
// WorldEdit instance
|
// WorldEdit instance
|
||||||
private WorldEdit worldedit;
|
private WorldEdit worldedit;
|
||||||
@ -180,15 +180,20 @@ public class PlotSquared {
|
|||||||
//
|
//
|
||||||
ConfigurationSerialization.registerClass(BlockBucket.class, "BlockBucket");
|
ConfigurationSerialization.registerClass(BlockBucket.class, "BlockBucket");
|
||||||
|
|
||||||
|
// load configs before reading from settings
|
||||||
|
if (!setupConfigs()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.captionLoader = CaptionLoader.of(
|
this.captionLoader = CaptionLoader.of(
|
||||||
Locale.ENGLISH,
|
Locale.ENGLISH,
|
||||||
CaptionLoader.patternExtractor(Pattern.compile("messages_(.*)\\.json")),
|
CaptionLoader.patternExtractor(Pattern.compile("messages_(.*)\\.json")),
|
||||||
DefaultCaptionProvider.forClassLoaderFormatString(
|
DefaultCaptionProvider.forClassLoaderFormatString(
|
||||||
this.getClass().getClassLoader(),
|
this.getClass().getClassLoader(),
|
||||||
"lang/messages_%s.json"
|
"lang/messages_%s.json" // the path in our jar file
|
||||||
),
|
),
|
||||||
TranslatableCaption.DEFAULT_NAMESPACE
|
TranslatableCaption.DEFAULT_NAMESPACE
|
||||||
); // the path in our jar file
|
);
|
||||||
// Load caption map
|
// Load caption map
|
||||||
try {
|
try {
|
||||||
this.loadCaptionMap();
|
this.loadCaptionMap();
|
||||||
@ -217,10 +222,6 @@ public class PlotSquared {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!setupConfigs()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.worldedit = WorldEdit.getInstance();
|
this.worldedit = WorldEdit.getInstance();
|
||||||
|
|
||||||
// Create Event utility class
|
// Create Event utility class
|
||||||
|
Loading…
Reference in New Issue
Block a user