1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-12-31 21:37:57 +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
Jobs.getLanguageManager().load();
// title settings
try {
Jobs.getTitleManager().load();
} catch (Throwable e) {
e.printStackTrace();
}
// restricted areas
try {
Jobs.getRestrictedAreaManager().load();
} catch (Throwable e) {
e.printStackTrace();
}
// restricted blocks
try {
Jobs.getRestrictedBlockManager().load();
} catch (Throwable e) {
e.printStackTrace();
}
// Item/Block/mobs name list
Jobs.getNameTranslatorManager().load();
// signs information

View File

@ -3,6 +3,7 @@ package com.gamingmesh.jobs.stuff;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLClassLoader;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
@ -63,6 +64,12 @@ public final class Util {
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) {
if (Version.isCurrentEqualOrHigher(Version.v1_11_R1)) {
return entity.getType().name();