diff --git a/lophine-server/src/main/java/com/logisticscraft/occlusionculling/util/MathUtilities.java b/lophine-server/src/main/java/com/logisticscraft/occlusionculling/util/MathUtilities.java index f044e72..2ee633b 100644 --- a/lophine-server/src/main/java/com/logisticscraft/occlusionculling/util/MathUtilities.java +++ b/lophine-server/src/main/java/com/logisticscraft/occlusionculling/util/MathUtilities.java @@ -21,5 +21,4 @@ public final class MathUtilities { int i = (int) d; return d > (double) i ? i + 1 : i; } - } \ No newline at end of file diff --git a/lophine-server/src/main/java/fun/bm/lophine/config/modules/experiment/GlobalEntitiesCounter.java b/lophine-server/src/main/java/fun/bm/lophine/config/modules/experiment/GlobalEntitiesCounter.java index 3ef0d4d..50d3172 100644 --- a/lophine-server/src/main/java/fun/bm/lophine/config/modules/experiment/GlobalEntitiesCounter.java +++ b/lophine-server/src/main/java/fun/bm/lophine/config/modules/experiment/GlobalEntitiesCounter.java @@ -6,7 +6,6 @@ import me.earthme.luminol.config.ConfigsInstance; import me.earthme.luminol.config.IConfigModule; import me.earthme.luminol.config.flags.ConfigClassInfo; import me.earthme.luminol.config.flags.ConfigInfo; -import me.earthme.luminol.config.flags.DoNotLoad; import me.earthme.luminol.config.flags.HotReloadUnsupported; import me.earthme.luminol.enums.EnumConfigCategory; @@ -16,46 +15,15 @@ public class GlobalEntitiesCounter implements IConfigModule { @ConfigInfo(name = "version") public static GlobalEntitiesCounterType type = GlobalEntitiesCounterType.DISABLED; - @DoNotLoad - private static boolean enabled; - @DoNotLoad - private static boolean async; - @DoNotLoad - private static boolean defaultModule; - public static boolean isEnabled() { - return enabled; + return type.isEnabled(); } public static boolean isAsync() { - return async; + return type.isAsync(); } public static boolean isDefaultModule() { - return defaultModule; - } - - @Override - public void beforeFinalLoad() { - ConfigsInstance configsInstance = ConfigManager.getConfigs("lophine"); - try { - Boolean enabled0 = configsInstance.getConfigOrigin("experiment.global_entities_counter.enabled"); - Boolean async0 = configsInstance.getConfigOrigin("experiment.global_entities_counter.async"); - if (enabled0 != null) { - if (enabled0) { - if (async0 != null && async0) { - type = GlobalEntitiesCounterType.DEFAULT_ASYNC; - } else { - type = GlobalEntitiesCounterType.DEFAULT_SYNC; - } - } - } - configsInstance.removeConfig("experiment.global_entities_counter.enabled"); - configsInstance.removeConfig("experiment.global_entities_counter.async"); - } catch (Exception ignored) { - } - enabled = type != GlobalEntitiesCounterType.DISABLED; - async = type == GlobalEntitiesCounterType.DEFAULT_ASYNC; - defaultModule = type == GlobalEntitiesCounterType.DEFAULT_SYNC || type == GlobalEntitiesCounterType.DEFAULT_ASYNC; + return type.isDefaultModule(); } } diff --git a/lophine-server/src/main/java/fun/bm/lophine/enums/GlobalEntitiesCounterType.java b/lophine-server/src/main/java/fun/bm/lophine/enums/GlobalEntitiesCounterType.java index f0bc54f..ec0c99b 100644 --- a/lophine-server/src/main/java/fun/bm/lophine/enums/GlobalEntitiesCounterType.java +++ b/lophine-server/src/main/java/fun/bm/lophine/enums/GlobalEntitiesCounterType.java @@ -1,8 +1,30 @@ package fun.bm.lophine.enums; public enum GlobalEntitiesCounterType { - DISABLED, - DEFAULT_SYNC, - DEFAULT_ASYNC, - PRECISE + DISABLED(false, false, false), + DEFAULT_SYNC(true, false, true), + DEFAULT_ASYNC(true, true, true), + PRECISE(true, false, false); + + private boolean enabled; + private boolean async; + private boolean defaultModule; + + private GlobalEntitiesCounterType(boolean enabled, boolean async, boolean defaultModule) { + this.enabled = enabled; + this.async = async; + this.defaultModule = defaultModule; + } + + public boolean isEnabled() { + return enabled; + } + + public boolean isAsync() { + return async; + } + + public boolean isDefaultModule() { + return defaultModule; + } } diff --git a/lophine-server/src/main/java/gg/pufferfish/pufferfish/sentry/PufferfishSentryAppender.java b/lophine-server/src/main/java/gg/pufferfish/pufferfish/sentry/PufferfishSentryAppender.java index 74080d1..eea65be 100644 --- a/lophine-server/src/main/java/gg/pufferfish/pufferfish/sentry/PufferfishSentryAppender.java +++ b/lophine-server/src/main/java/gg/pufferfish/pufferfish/sentry/PufferfishSentryAppender.java @@ -23,7 +23,6 @@ import io.sentry.Breadcrumb; import io.sentry.Sentry; import io.sentry.SentryEvent; import io.sentry.SentryLevel; -import io.sentry.protocol.Message; import io.sentry.protocol.User; import me.earthme.luminol.config.modules.misc.SentryConfig; import org.apache.logging.log4j.Level; @@ -67,9 +66,6 @@ public class PufferfishSentryAppender extends AbstractAppender { private void logException(LogEvent e) { SentryEvent event = new SentryEvent(e.getThrown()); - Message sentryMessage = new Message(); - sentryMessage.setMessage(e.getMessage().getFormattedMessage()); - event.setThrowable(e.getThrown()); event.setLevel(getLevel(e.getLevel())); event.setLogger(e.getLoggerName()); diff --git a/lophine-server/src/main/java/gg/pufferfish/pufferfish/sentry/SentryManager.java b/lophine-server/src/main/java/gg/pufferfish/pufferfish/sentry/SentryManager.java index a96be98..8e3f85a 100644 --- a/lophine-server/src/main/java/gg/pufferfish/pufferfish/sentry/SentryManager.java +++ b/lophine-server/src/main/java/gg/pufferfish/pufferfish/sentry/SentryManager.java @@ -26,10 +26,6 @@ public class SentryManager { private static final Logger logger = LogManager.getLogger(SentryManager.class); - private SentryManager() { - - } - private static boolean initialized = false; public static synchronized void init(Level logLevel) {