1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-01-03 14:58:34 +01:00

Lets keep loading in plugin when some none essential files fail to load

This commit is contained in:
Zrips 2023-08-29 15:18:05 +03:00
parent 6051c78d21
commit 14b7e837d8
3 changed files with 29 additions and 9 deletions

View File

@ -273,11 +273,24 @@ public class GeneralConfigManager {
// Load locale // Load locale
Jobs.getLanguageManager().load(); Jobs.getLanguageManager().load();
// title settings // title settings
try {
Jobs.getTitleManager().load(); Jobs.getTitleManager().load();
} catch (Throwable e) {
e.printStackTrace();
}
// restricted areas // restricted areas
try {
Jobs.getRestrictedAreaManager().load(); Jobs.getRestrictedAreaManager().load();
} catch (Throwable e) {
e.printStackTrace();
}
// restricted blocks // restricted blocks
try {
Jobs.getRestrictedBlockManager().load(); Jobs.getRestrictedBlockManager().load();
} catch (Throwable e) {
e.printStackTrace();
}
// Item/Block/mobs name list // Item/Block/mobs name list
Jobs.getNameTranslatorManager().load(); Jobs.getNameTranslatorManager().load();
// signs information // signs information

View File

@ -3,6 +3,7 @@ package com.gamingmesh.jobs.stuff;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import java.net.URL; import java.net.URL;
import java.net.URLClassLoader; import java.net.URLClassLoader;
import java.text.DecimalFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.HashMap; import java.util.HashMap;
@ -63,6 +64,12 @@ public final class Util {
return blocks; return blocks;
} }
private final static DecimalFormat dcf = new DecimalFormat("##.##");
public static String format2Decimals(double number) {
return dcf.format(number);
}
public static String getRealType(Entity entity) { public static String getRealType(Entity entity) {
if (Version.isCurrentEqualOrHigher(Version.v1_11_R1)) { if (Version.isCurrentEqualOrHigher(Version.v1_11_R1)) {
return entity.getType().name(); return entity.getType().name();