aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhackthetime <l4bg0jb7@duck.com>2023-11-16 11:24:20 +0100
committerhackthetime <l4bg0jb7@duck.com>2023-11-16 11:24:20 +0100
commitca8c9a40cbd393ddc1559382fb29a7f3a7c3a646 (patch)
tree78dd4d4083879075c3661b2ee224b3bdd1ca2d56
parentce208c31079689527a489eab2b54765591a8507f (diff)
downloadBBsentials-ca8c9a40cbd393ddc1559382fb29a7f3a7c3a646.tar.gz
BBsentials-ca8c9a40cbd393ddc1559382fb29a7f3a7c3a646.tar.bz2
BBsentials-ca8c9a40cbd393ddc1559382fb29a7f3a7c3a646.zip
working on moulconfig. re-added debug thread instead of using execution service because it slowly but surely takes all threads.
-rw-r--r--common/src/main/java/de/hype/bbsentials/common/client/BBsentials.java8
-rw-r--r--common/src/main/java/de/hype/bbsentials/common/client/DebugThread.java6
-rw-r--r--forge/src/main/java/de/hype/bbsentials/forge/client/MoulConfig.java8
-rw-r--r--forge/src/main/java/de/hype/bbsentials/forge/client/categories/FirstCategory.java54
4 files changed, 69 insertions, 7 deletions
diff --git a/common/src/main/java/de/hype/bbsentials/common/client/BBsentials.java b/common/src/main/java/de/hype/bbsentials/common/client/BBsentials.java
index 262ed8d..fbb7824 100644
--- a/common/src/main/java/de/hype/bbsentials/common/client/BBsentials.java
+++ b/common/src/main/java/de/hype/bbsentials/common/client/BBsentials.java
@@ -7,7 +7,6 @@ import de.hype.bbsentials.common.mclibraries.EnvironmentCore;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
public class BBsentials {
public static Config config;
@@ -18,6 +17,7 @@ public class BBsentials {
public static SplashStatusUpdateListener splashStatusUpdateListener;
public static Thread bbthread;
public static Chat chat = new Chat();
+ public static Thread debugThread;
public static Config getConfig() {
return config;
@@ -70,7 +70,11 @@ public class BBsentials {
public static void init() {
config = Config.load();
- executionService.scheduleAtFixedRate(EnvironmentCore.debug, 0, 20, TimeUnit.SECONDS);
+ debugThread = new Thread(
+ EnvironmentCore.debug
+ );
+ debugThread.start();
+ debugThread.setName("Debug Thread");
if (Config.isBingoTime() || config.overrideBingoTime()) {
connectToBBserver();
}
diff --git a/common/src/main/java/de/hype/bbsentials/common/client/DebugThread.java b/common/src/main/java/de/hype/bbsentials/common/client/DebugThread.java
index 74a7757..239df11 100644
--- a/common/src/main/java/de/hype/bbsentials/common/client/DebugThread.java
+++ b/common/src/main/java/de/hype/bbsentials/common/client/DebugThread.java
@@ -8,7 +8,13 @@ public interface DebugThread extends Runnable {
@Override
default void run() {
+ while (true) {
loop();
+ try {
+ Thread.sleep(20000);
+ } catch (InterruptedException e) {
+ }
+ }
//place a breakpoint for only this thread here.
}
diff --git a/forge/src/main/java/de/hype/bbsentials/forge/client/MoulConfig.java b/forge/src/main/java/de/hype/bbsentials/forge/client/MoulConfig.java
index 24bca8a..93ecd99 100644
--- a/forge/src/main/java/de/hype/bbsentials/forge/client/MoulConfig.java
+++ b/forge/src/main/java/de/hype/bbsentials/forge/client/MoulConfig.java
@@ -1,6 +1,7 @@
package de.hype.bbsentials.forge.client;
import com.google.gson.annotations.Expose;
+import de.hype.bbsentials.forge.client.categories.FirstCategory;
import io.github.moulberry.moulconfig.Config;
import io.github.moulberry.moulconfig.annotations.Category;
import io.github.moulberry.moulconfig.annotations.ConfigEditorDropdown;
@@ -11,20 +12,17 @@ import io.github.moulberry.moulconfig.processor.BuiltinMoulConfigGuis;
import io.github.moulberry.moulconfig.processor.ConfigProcessorDriver;
import io.github.moulberry.moulconfig.processor.MoulConfigProcessor;
import net.minecraft.client.Minecraft;
+import net.minecraftforge.common.config.ConfigCategory;
import static de.hype.bbsentials.common.client.BBsentials.config;
public class MoulConfig extends Config {
- @Expose
- @ConfigOption(name = "test", desc = "dropdown test")
- @ConfigEditorDropdown(values = {"hi", "test"})
- public String test;
MoulConfigEditor<MoulConfig> editor;
MoulConfigProcessor<MoulConfig> processor;
@Expose
@Category(name = "First Category", desc = "This is the first category.")
- MoulConfig main = this;
+ public FirstCategory firstCategory = new FirstCategory();
public MoulConfig() {
processor = new MoulConfigProcessor<>(this);
diff --git a/forge/src/main/java/de/hype/bbsentials/forge/client/categories/FirstCategory.java b/forge/src/main/java/de/hype/bbsentials/forge/client/categories/FirstCategory.java
new file mode 100644
index 0000000..05aa511
--- /dev/null
+++ b/forge/src/main/java/de/hype/bbsentials/forge/client/categories/FirstCategory.java
@@ -0,0 +1,54 @@
+package de.hype.bbsentials.forge.client.categories;
+
+import com.google.gson.annotations.Expose;
+import io.github.moulberry.moulconfig.annotations.*;
+
+import java.awt.*;
+
+public class FirstCategory {
+ @Expose
+ @ConfigOption(name = "ConfigEditorDropdown", desc = "ConfigEditorDropdown")
+ @ConfigEditorDropdown(values = {"hi", "test"})
+ public String test;
+
+ @Expose
+ @ConfigOption(name = "First Toggle", desc = "Enable this toggle to activate a feature.")
+ @ConfigEditorBoolean
+ public boolean firstToggle = false;
+
+ @Expose
+ @ConfigOption(name = "Color Editor", desc = "Color Editor")
+ @ConfigEditorColour
+ public Color color = Color.RED;
+
+ @Expose
+ @ConfigOption(name = "ConfigEditorInfoText", desc = "Info Text Sample")
+ @ConfigEditorInfoText(infoTitle = "ยง6Info Text Sample")
+ public String text = "";
+
+ @Expose
+ @ConfigOption(name = "Text Example", desc = "Text Sample")
+ @ConfigEditorText
+ public String textSample = "";
+
+ @Expose
+ @ConfigOption(name = "Slider Example", desc = "Slider Sample")
+ @ConfigEditorSlider(minStep = 10, maxValue = 100, minValue = 0)
+ public int i = 0;
+
+// @Expose
+// @ConfigOption(name = "Keybinding Example", desc = "Keybinding Sample")
+// @ConfigEditorKeybind(defaultKey = 12)
+// public ConfigEditorKeybind keybind = new KeyBinding("Craft",12,"");
+//
+// @Expose
+// @ConfigOption(name = "Button Example", desc = "Button Sample")
+// @ConfigEditorButton
+// public ConfigEditorButton button = new ConfigEditorButton();
+// @Expose
+// @ConfigOption(name = "Draggable List Example", desc = "Draggable List Sample")
+// @ConfigEditorDraggableList
+// public ConfigEditorDraggableList draggableList = new ConfigEditorDraggableList();
+
+
+}