diff options
-rw-r--r-- | build.gradle | 4 | ||||
-rw-r--r-- | gradle.properties | 11 | ||||
-rw-r--r-- | src/main/java/de/hype/bbsentials/client/BBsentials.java | 1 | ||||
-rw-r--r-- | src/main/java/de/hype/bbsentials/client/BBsentialsConfigScreemFactory.java | 453 |
4 files changed, 238 insertions, 231 deletions
diff --git a/build.gradle b/build.gradle index 195778e..49c5e5c 100644 --- a/build.gradle +++ b/build.gradle @@ -22,11 +22,11 @@ dependencies { minecraft "com.mojang:minecraft:${project.minecraft_version}" mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" - modImplementation 'com.terraformersmc:modmenu:7.2.2' + modImplementation 'com.terraformersmc:modmenu:8.0.0' //https://maven.terraformersmc.com/releases/com/terraformersmc/modmenu/7.2.2/modmenu-7.2.2.pom // Fabric API. This is technically optional, but you probably want it anyway. modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" - modApi("me.shedaniel.cloth:cloth-config-fabric:11.1.106") { + modApi("me.shedaniel.cloth:cloth-config-fabric:12.0.109") { exclude(group: "net.fabricmc.fabric-api") } } diff --git a/gradle.properties b/gradle.properties index 3e324c3..1d84847 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,14 +2,13 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://modmuss50.me/fabric.html -minecraft_version=1.20.1 -yarn_mappings=1.20.1+build.2 -loader_version=0.14.21 +minecraft_version=1.20.2 +yarn_mappings=1.20.2+build.1 +loader_version=0.14.22 #Fabric api -fabric_version=0.83.1+1.20.1 +fabric_version=0.89.2+1.20.2 # Mod Properties mod_version=1.0 maven_group=de.hype archives_base_name=bbsentials -#Other -discord="discord.gg"
\ No newline at end of file +#Other
\ No newline at end of file diff --git a/src/main/java/de/hype/bbsentials/client/BBsentials.java b/src/main/java/de/hype/bbsentials/client/BBsentials.java index 275091e..ee7c6b1 100644 --- a/src/main/java/de/hype/bbsentials/client/BBsentials.java +++ b/src/main/java/de/hype/bbsentials/client/BBsentials.java @@ -84,6 +84,7 @@ public class BBsentials implements ClientModInitializer { /** * Runs the mod initializer on the client environment. */ + @Override public void onInitializeClient() { ClientPlayConnectionEvents.JOIN.register((a, b, c) -> { diff --git a/src/main/java/de/hype/bbsentials/client/BBsentialsConfigScreemFactory.java b/src/main/java/de/hype/bbsentials/client/BBsentialsConfigScreemFactory.java index 2ecc2e5..17fc3f1 100644 --- a/src/main/java/de/hype/bbsentials/client/BBsentialsConfigScreemFactory.java +++ b/src/main/java/de/hype/bbsentials/client/BBsentialsConfigScreemFactory.java @@ -4,6 +4,8 @@ import de.hype.bbsentials.constants.enviromentShared.Islands; import me.shedaniel.clothconfig2.api.ConfigBuilder; import me.shedaniel.clothconfig2.api.ConfigCategory; import me.shedaniel.clothconfig2.api.ConfigEntryBuilder; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.screen.NoticeScreen; import net.minecraft.client.gui.screen.Screen; import net.minecraft.text.Text; @@ -13,252 +15,257 @@ import static de.hype.bbsentials.client.BBsentials.config; public class BBsentialsConfigScreemFactory { public static Screen create(Screen parent) { - ConfigBuilder builder = ConfigBuilder.create() - .setParentScreen(parent) - .setTitle(Text.of("BBsentials Config")); - builder.setSavingRunnable(BBsentials.getConfig()::save); - ConfigEntryBuilder entryBuilder = builder.entryBuilder(); - ConfigCategory server = builder.getOrCreateCategory(Text.of("Server")); - if (config.getUsername().equalsIgnoreCase("Hype_the_Time")) { - server.addEntry(entryBuilder.startTextField(Text.of("Server URL"), config.getBBServerURL().replaceAll(".", "*")) - .setDefaultValue("localhost") - .setTooltip(Text.of("Place the Server URL of the BBsentials Server here")) + if (BBsentials.config == null) { + return new NoticeScreen(() -> MinecraftClient.getInstance().setScreen(parent), Text.of("BBsentials"), Text.of("You need to login to a Server for the Config to be loaded.")); + } + else { + ConfigBuilder builder = ConfigBuilder.create() + .setParentScreen(parent) + .setTitle(Text.of("BBsentials Config")); + builder.setSavingRunnable(BBsentials.getConfig()::save); + ConfigEntryBuilder entryBuilder = builder.entryBuilder(); + ConfigCategory server = builder.getOrCreateCategory(Text.of("Server")); + if (config.getUsername().equalsIgnoreCase("Hype_the_Time")) { + server.addEntry(entryBuilder.startTextField(Text.of("Server URL"), config.getBBServerURL().replaceAll(".", "*")) + .setDefaultValue("localhost") + .setTooltip(Text.of("Place the Server URL of the BBsentials Server here")) + .setSaveConsumer((newValue) -> { + if (newValue.replace("*", "").trim().isEmpty()) { + return; + } + else { + config.bbServerURL = newValue; + } + }) + .build()); + } + else { + server.addEntry(entryBuilder.startTextField(Text.of("Server URL"), config.getBBServerURL()) + .setDefaultValue("localhost") + .setTooltip(Text.of("Place the Server URL of the BBsentials Server here")) + .setSaveConsumer(newValue -> config.bbServerURL = newValue) + .build()); + } + + server.addEntry(entryBuilder.startStrField(Text.of("BBsentials API key"), config.apiKey.replaceAll(".", "*")) + .setDefaultValue("unset") + .setTooltip(Text.of("Put you API Key here (the one generated in the Discord! with /link). §cThe Text is visually censored. Not saved unless you changed it.")) .setSaveConsumer((newValue) -> { if (newValue.replace("*", "").trim().isEmpty()) { return; } else { - config.bbServerURL = newValue; + config.apiKey = newValue; } }) .build()); - } - else { - server.addEntry(entryBuilder.startTextField(Text.of("Server URL"), config.getBBServerURL()) - .setDefaultValue("localhost") - .setTooltip(Text.of("Place the Server URL of the BBsentials Server here")) - .setSaveConsumer(newValue -> config.bbServerURL = newValue) - .build()); - } - - server.addEntry(entryBuilder.startStrField(Text.of("BBsentials API key"), config.apiKey.replaceAll(".", "*")) - .setDefaultValue("unset") - .setTooltip(Text.of("Put you API Key here (the one generated in the Discord! with /link). §cThe Text is visually censored. Not saved unless you changed it.")) - .setSaveConsumer((newValue) -> { - if (newValue.replace("*", "").trim().isEmpty()) { - return; - } - else { - config.apiKey = newValue; - } - }) - .build()); - server.addEntry(entryBuilder.startBooleanToggle(Text.of("Connect to Test Server"), config.connectToBeta) - .setDefaultValue(false) - .setTooltip(Text.of("Makes you connect to the Test Server instead of the Main Server. Keep in mind that all announces may be tests and the main announces are not transferred over to here!")) // Optional: Shown when the user hover over this option - .setSaveConsumer(newValue -> config.connectToBeta = newValue) - .build()); - server.addEntry(entryBuilder.startBooleanToggle(Text.of("Override Bingo Time"), config.overrideBingoTime) - .setDefaultValue(false) - .setTooltip(Text.of("Override the Bingo Time and connect always to the Server. (Bingo time is 14 days cause Extreme Bingo)")) - .setSaveConsumer(newValue -> config.overrideBingoTime = newValue) - .build()); - //Visual - ConfigCategory visual = builder.getOrCreateCategory(Text.of("Visual")); - visual.addEntry(entryBuilder.startBooleanToggle(Text.of("Show Bingo Chat"), config.showBingoChat) - .setDefaultValue(true) - .setTooltip(Text.of("Select if you want the Bingo Chat to be show")) - .setSaveConsumer(newValue -> config.showBingoChat = newValue) - .build()); - visual.addEntry(entryBuilder.startBooleanToggle(Text.of("Show Splash Status Updates"), config.showSplashStatusUpdates) - .setDefaultValue(true) - .setTooltip(Text.of("Select if you want to see Splash Staus updates. Keep in mind that this will only send you status updates for the Splashes which you were shown.\nThose hidden due too too high Splash Time will still remain invisible")) - .setSaveConsumer(newValue -> config.showSplashStatusUpdates = newValue) - .build()); - //Notifications - ConfigCategory notifications = builder.getOrCreateCategory(Text.of("Notifications")); - notifications.addEntry(entryBuilder.startBooleanToggle(Text.of("Do Desktop Notifications"), config.doDesktopNotifications) - .setDefaultValue(true) - .setTooltip(Text.of("Select if you want BBsentials to automatically accept reparties")) - .setSaveConsumer(newValue -> config.doDesktopNotifications = newValue) - .build()); - notifications.addEntry(entryBuilder.startStrField(Text.of("Nickname"), config.nickname) - .setDefaultValue("") - .setTooltip(Text.of("Nickname. you will get send desktop notifications if a message contains one")) - .setSaveConsumer(newValue -> config.nickname = newValue) - .build()); - notifications.addEntry(entryBuilder.startStringDropdownMenu(Text.of("Notification on"), config.NotifForPartyMessagesType) // Start the StringDropdownMenu entry - .setSelections(List.of("all", "nick", "none")) - .setTooltip(Text.of("When do you want to receive Desktop Notifications? on all party, party messages containing nickname or no party messages")) - .setDefaultValue("all") - .setSuggestionMode(false) - .setSaveConsumer(newValue -> config.NotifForPartyMessagesType = newValue) - .build()); - //other - ConfigCategory other = builder.getOrCreateCategory(Text.of("Other")); - other.addEntry(entryBuilder.startBooleanToggle(Text.of("Gamma Override"), config.doGammaOverride) - .setDefaultValue(true) - .setTooltip(Text.of("Select if you want BBsentials to enable full bright")) - .setSaveConsumer(newValue -> config.doGammaOverride = newValue) - .build()); - other.addEntry(entryBuilder.startBooleanToggle(Text.of("Accept Reparties"), config.acceptReparty) - .setDefaultValue(true) - .setTooltip(Text.of("Select if you want BBsentials to automatically accept reparties")) - .setSaveConsumer(newValue -> config.showBingoChat = newValue) - .build()); - other.addEntry(entryBuilder.startBooleanToggle(Text.of("Accept auto invite"), config.allowBBinviteMe) - .setDefaultValue(true) - .setTooltip(Text.of("Do you want that whenever someone sends you a msg ending with 'bb:party me' to send them a party invite automatically?")) - .setSaveConsumer(newValue -> config.allowBBinviteMe = newValue) - .build()); - ConfigCategory chChestItems = builder.getOrCreateCategory(Text.of("Ch Chest Items")); - { - chChestItems.addEntry(entryBuilder.startBooleanToggle(Text.of("All Chest Items"), config.toDisplayConfig.allChChestItem) - .setDefaultValue(true) - .setTooltip(Text.of("Select to receive notifications when an any Item is found")) - .setSaveConsumer(newValue -> config.toDisplayConfig.allChChestItem = newValue) - .build()); - - chChestItems.addEntry(entryBuilder.startBooleanToggle(Text.of("ALL Robo Parts "), config.toDisplayConfig.allRoboPart) - .setDefaultValue(false) - .setTooltip(Text.of("Select to receive notifications when an allRoboPartCustomChChestItem is found")) - .setSaveConsumer(newValue -> config.toDisplayConfig.allRoboPart = newValue) - .build()); - chChestItems.addEntry(entryBuilder.startBooleanToggle(Text.of("Custom (Other) Items"), config.toDisplayConfig.customChChestItem) - .setDefaultValue(false) - .setTooltip(Text.of("Select to receive notifications when any not already defined Item is found")) - .setSaveConsumer(newValue -> config.toDisplayConfig.customChChestItem = newValue) - .build()); - chChestItems.addEntry(entryBuilder.startBooleanToggle(Text.of("Prehistoric Egg"), config.toDisplayConfig.prehistoricEgg) - .setDefaultValue(false) - .setTooltip(Text.of("Select to receive notifications when a Prehistoric Egg is found")) - .setSaveConsumer(newValue -> config.toDisplayConfig.prehistoricEgg = newValue) - .build()); - - chChestItems.addEntry(entryBuilder.startBooleanToggle(Text.of("Pickonimbus 2000"), config.toDisplayConfig.pickonimbus2000) - .setDefaultValue(false) - .setTooltip(Text.of("Select to receive notifications when a Pickonimbus 2000 is found")) - .setSaveConsumer(newValue -> config.toDisplayConfig.pickonimbus2000 = newValue) - .build()); - - chChestItems.addEntry(entryBuilder.startBooleanToggle(Text.of("Control Switch"), config.toDisplayConfig.controlSwitch) - .setDefaultValue(false) - .setTooltip(Text.of("Select to receive notifications when a Control Switch is found")) - .setSaveConsumer(newValue -> config.toDisplayConfig.controlSwitch = newValue) - .build()); - - chChestItems.addEntry(entryBuilder.startBooleanToggle(Text.of("Electron Transmitter"), config.toDisplayConfig.electronTransmitter) - .setDefaultValue(false) - .setTooltip(Text.of("Select to receive notifications when an Electron Transmitter is found")) - .setSaveConsumer(newValue -> config.toDisplayConfig.electronTransmitter = newValue) - .build()); - - chChestItems.addEntry(entryBuilder.startBooleanToggle(Text.of("FTX 3070"), config.toDisplayConfig.ftx3070) - .setDefaultValue(false) - .setTooltip(Text.of("Select to receive notifications when a FTX 3070 is found")) - .setSaveConsumer(newValue -> config.toDisplayConfig.ftx3070 = newValue) - .build()); - - chChestItems.addEntry(entryBuilder.startBooleanToggle(Text.of("Robotron Reflector"), config.toDisplayConfig.robotronReflector) - .setDefaultValue(false) - .setTooltip(Text.of("Select to receive notifications when a Robotron Reflector is found")) - .setSaveConsumer(newValue -> config.toDisplayConfig.robotronReflector = newValue) - .build()); - - chChestItems.addEntry(entryBuilder.startBooleanToggle(Text.of("Superlite Motor"), config.toDisplayConfig.superliteMotor) - .setDefaultValue(false) - .setTooltip(Text.of("Select to receive notifications when a Superlite Motor is found")) - .setSaveConsumer(newValue -> config.toDisplayConfig.superliteMotor = newValue) - .build()); - - chChestItems.addEntry(entryBuilder.startBooleanToggle(Text.of("Synthetic Heart"), config.toDisplayConfig.syntheticHeart) + server.addEntry(entryBuilder.startBooleanToggle(Text.of("Connect to Test Server"), config.connectToBeta) .setDefaultValue(false) - .setTooltip(Text.of("Select to receive notifications when a Synthetic Heart is found")) - .setSaveConsumer(newValue -> config.toDisplayConfig.syntheticHeart = newValue) + .setTooltip(Text.of("Makes you connect to the Test Server instead of the Main Server. Keep in mind that all announces may be tests and the main announces are not transferred over to here!")) // Optional: Shown when the user hover over this option + .setSaveConsumer(newValue -> config.connectToBeta = newValue) .build()); - - chChestItems.addEntry(entryBuilder.startBooleanToggle(Text.of("Flawless Gemstone"), config.toDisplayConfig.flawlessGemstone) + server.addEntry(entryBuilder.startBooleanToggle(Text.of("Override Bingo Time"), config.overrideBingoTime) .setDefaultValue(false) - .setTooltip(Text.of("Select to receive notifications when any Flawless Gemstone is found")) - .setSaveConsumer(newValue -> config.toDisplayConfig.flawlessGemstone = newValue) + .setTooltip(Text.of("Override the Bingo Time and connect always to the Server. (Bingo time is 14 days cause Extreme Bingo)")) + .setSaveConsumer(newValue -> config.overrideBingoTime = newValue) .build()); - chChestItems.addEntry(entryBuilder.startBooleanToggle(Text.of("Jungle Heart"), config.toDisplayConfig.jungleHeart) - .setDefaultValue(false) - .setTooltip(Text.of("Select to receive notifications when a JungleHeart is found")) - .setSaveConsumer(newValue -> config.toDisplayConfig.jungleHeart = newValue) - .build()); - }//CHChestItems - ConfigCategory miningEvents = builder.getOrCreateCategory(Text.of("Mining Events")); - { - miningEvents.addEntry(entryBuilder.startBooleanToggle(Text.of("All Events"), config.toDisplayConfig.allEvents) + //Visual + ConfigCategory visual = builder.getOrCreateCategory(Text.of("Visual")); + visual.addEntry(entryBuilder.startBooleanToggle(Text.of("Show Bingo Chat"), config.showBingoChat) .setDefaultValue(true) - .setTooltip(Text.of("Get updated for any Mining Event")) - .setSaveConsumer(newValue -> config.toDisplayConfig.allEvents = newValue) + .setTooltip(Text.of("Select if you want the Bingo Chat to be show")) + .setSaveConsumer(newValue -> config.showBingoChat = newValue) .build()); - miningEvents.addEntry(entryBuilder.startBooleanToggle(Text.of("§cBlock Crystal Hollow Events"), config.toDisplayConfig.blockChEvents) - .setDefaultValue(false) - .setTooltip(Text.of("Block getting Crystal Hollow Events. Maybe if you haven't accessed Crystal Hollows yet ")) - .setSaveConsumer(newValue -> config.toDisplayConfig.blockChEvents = newValue) + visual.addEntry(entryBuilder.startBooleanToggle(Text.of("Show Splash Status Updates"), config.showSplashStatusUpdates) + .setDefaultValue(true) + .setTooltip(Text.of("Select if you want to see Splash Staus updates. Keep in mind that this will only send you status updates for the Splashes which you were shown.\nThose hidden due too too high Splash Time will still remain invisible")) + .setSaveConsumer(newValue -> config.showSplashStatusUpdates = newValue) .build()); - miningEvents.addEntry(entryBuilder.startStringDropdownMenu(Text.of("Gone with the Wind"), config.toDisplayConfig.goneWithTheWind) // Start the StringDropdownMenu entry - .setSelections(List.of("both", Islands.DWARVEN_MINES.getDisplayName(), Islands.CRYSTAL_HOLLOWS.getDisplayName(), "none")) - .setTooltip(Text.of("Get notified when a Gone with the Wind happens in the specified Island")) - .setDefaultValue("none") - .setSuggestionMode(false) - .setSaveConsumer(newValue -> config.toDisplayConfig.goneWithTheWind = newValue) + //Notifications + ConfigCategory notifications = builder.getOrCreateCategory(Text.of("Notifications")); + notifications.addEntry(entryBuilder.startBooleanToggle(Text.of("Do Desktop Notifications"), config.doDesktopNotifications) + .setDefaultValue(true) + .setTooltip(Text.of("Select if you want BBsentials to automatically accept reparties")) + .setSaveConsumer(newValue -> config.doDesktopNotifications = newValue) .build()); - miningEvents.addEntry(entryBuilder.startStringDropdownMenu(Text.of("Better Together"), config.toDisplayConfig.betterTogether) // Start the StringDropdownMenu entry - .setSelections(List.of("both", Islands.DWARVEN_MINES.getDisplayName(), Islands.CRYSTAL_HOLLOWS.getDisplayName(), "none")) - .setTooltip(Text.of("Get notified when a Better Together happens in the specified Island")) - .setDefaultValue("none") - .setSuggestionMode(false) - .setSaveConsumer(newValue -> config.toDisplayConfig.betterTogether = newValue) + notifications.addEntry(entryBuilder.startStrField(Text.of("Nickname"), config.nickname) + .setDefaultValue("") + .setTooltip(Text.of("Nickname. you will get send desktop notifications if a message contains one")) + .setSaveConsumer(newValue -> config.nickname = newValue) .build()); - miningEvents.addEntry(entryBuilder.startStringDropdownMenu(Text.of("Double Powder"), config.toDisplayConfig.doublePowder) // Start the StringDropdownMenu entry - .setSelections(List.of("both", Islands.DWARVEN_MINES.getDisplayName(), Islands.CRYSTAL_HOLLOWS.getDisplayName(), "none")) - .setTooltip(Text.of("Get notified when a Double Powder happens in the specified Island")) - .setDefaultValue("none") + notifications.addEntry(entryBuilder.startStringDropdownMenu(Text.of("Notification on"), config.NotifForPartyMessagesType) // Start the StringDropdownMenu entry + .setSelections(List.of("all", "nick", "none")) + .setTooltip(Text.of("When do you want to receive Desktop Notifications? on all party, party messages containing nickname or no party messages")) + .setDefaultValue("all") .setSuggestionMode(false) - .setSaveConsumer(newValue -> config.toDisplayConfig.doublePowder = newValue) - .build()); - miningEvents.addEntry(entryBuilder.startBooleanToggle(Text.of("Mithril Gourmand"), config.toDisplayConfig.mithrilGourmand) - .setDefaultValue(false) - .setTooltip(Text.of("Get notified when a Mithril Gourmand happens")) - .setSaveConsumer(newValue -> config.toDisplayConfig.mithrilGourmand = newValue) - .build()); - miningEvents.addEntry(entryBuilder.startBooleanToggle(Text.of("Raffle"), config.toDisplayConfig.raffle) - .setDefaultValue(false) - .setTooltip(Text.of("Get notified when a Raffle happens")) - .setSaveConsumer(newValue -> config.toDisplayConfig.raffle = newValue) - .build()); - miningEvents.addEntry(entryBuilder.startBooleanToggle(Text.of("Goblin Raid"), config.toDisplayConfig.goblinRaid) - .setDefaultValue(false) - .setTooltip(Text.of("Get notified when a Goblin Raid happens")) - .setSaveConsumer(newValue -> config.toDisplayConfig.goblinRaid = newValue) + .setSaveConsumer(newValue -> config.NotifForPartyMessagesType = newValue) .build()); - } //Mining Events - if (config.hasBBRoles("dev")){ - ConfigCategory dev = builder.getOrCreateCategory(Text.of("§3Developing")); - dev.addEntry(entryBuilder.startBooleanToggle(Text.of("Dev Mode"), config.devMode) - .setDefaultValue(false) - .setTooltip(Text.of("Dev Mode")) - .setSaveConsumer(newValue -> config.devMode = newValue) + //other + ConfigCategory other = builder.getOrCreateCategory(Text.of("Other")); + other.addEntry(entryBuilder.startBooleanToggle(Text.of("Gamma Override"), config.doGammaOverride) + .setDefaultValue(true) + .setTooltip(Text.of("Select if you want BBsentials to enable full bright")) + .setSaveConsumer(newValue -> config.doGammaOverride = newValue) .build()); - dev.addEntry(entryBuilder.startBooleanToggle(Text.of("Detailed Dev Mode"), config.detailedDevMode) - .setDefaultValue(false) - .setTooltip(Text.of("Detailed Dev Mode")) - .setSaveConsumer(newValue -> config.detailedDevMode = newValue) + other.addEntry(entryBuilder.startBooleanToggle(Text.of("Accept Reparties"), config.acceptReparty) + .setDefaultValue(true) + .setTooltip(Text.of("Select if you want BBsentials to automatically accept reparties")) + .setSaveConsumer(newValue -> config.showBingoChat = newValue) .build()); - } - if (config.hasBBRoles("splasher")){ - ConfigCategory dev = builder.getOrCreateCategory(Text.of("§dSplashes")); - dev.addEntry(entryBuilder.startBooleanToggle(Text.of("Auto Update Statuses"), config.autoSplashStatusUpdates) + other.addEntry(entryBuilder.startBooleanToggle(Text.of("Accept auto invite"), config.allowBBinviteMe) .setDefaultValue(true) - .setTooltip(Text.of("Automatically updates the Status of the Splash by sending packets to the Server")) - .setSaveConsumer(newValue -> config.autoSplashStatusUpdates = newValue) + .setTooltip(Text.of("Do you want that whenever someone sends you a msg ending with 'bb:party me' to send them a party invite automatically?")) + .setSaveConsumer(newValue -> config.allowBBinviteMe = newValue) .build()); - } + ConfigCategory chChestItems = builder.getOrCreateCategory(Text.of("Ch Chest Items")); + { + chChestItems.addEntry(entryBuilder.startBooleanToggle(Text.of("All Chest Items"), config.toDisplayConfig.allChChestItem) + .setDefaultValue(true) + .setTooltip(Text.of("Select to receive notifications when an any Item is found")) + .setSaveConsumer(newValue -> config.toDisplayConfig.allChChestItem = newValue) + .build()); + + chChestItems.addEntry(entryBuilder.startBooleanToggle(Text.of("ALL Robo Parts "), config.toDisplayConfig.allRoboPart) + .setDefaultValue(false) + .setTooltip(Text.of("Select to receive notifications when an allRoboPartCustomChChestItem is found")) + .setSaveConsumer(newValue -> config.toDisplayConfig.allRoboPart = newValue) + .build()); + chChestItems.addEntry(entryBuilder.startBooleanToggle(Text.of("Custom (Other) Items"), config.toDisplayConfig.customChChestItem) + .setDefaultValue(false) + .setTooltip(Text.of("Select to receive notifications when any not already defined Item is found")) + .setSaveConsumer(newValue -> config.toDisplayConfig.customChChestItem = newValue) + .build()); + chChestItems.addEntry(entryBuilder.startBooleanToggle(Text.of("Prehistoric Egg"), config.toDisplayConfig.prehistoricEgg) + .setDefaultValue(false) + .setTooltip(Text.of("Select to receive notifications when a Prehistoric Egg is found")) + .setSaveConsumer(newValue -> config.toDisplayConfig.prehistoricEgg = newValue) + .build()); + + chChestItems.addEntry(entryBuilder.startBooleanToggle(Text.of("Pickonimbus 2000"), config.toDisplayConfig.pickonimbus2000) + .setDefaultValue(false) + .setTooltip(Text.of("Select to receive notifications when a Pickonimbus 2000 is found")) + .setSaveConsumer(newValue -> config.toDisplayConfig.pickonimbus2000 = newValue) + .build()); - return builder.build(); + chChestItems.addEntry(entryBuilder.startBooleanToggle(Text.of("Control Switch"), config.toDisplayConfig.controlSwitch) + .setDefaultValue(false) + .setTooltip(Text.of("Select to receive notifications when a Control Switch is found")) + .setSaveConsumer(newValue -> config.toDisplayConfig.controlSwitch = newValue) + .build()); + + chChestItems.addEntry(entryBuilder.startBooleanToggle(Text.of("Electron Transmitter"), config.toDisplayConfig.electronTransmitter) + .setDefaultValue(false) + .setTooltip(Text.of("Select to receive notifications when an Electron Transmitter is found")) + .setSaveConsumer(newValue -> config.toDisplayConfig.electronTransmitter = newValue) + .build()); + + chChestItems.addEntry(entryBuilder.startBooleanToggle(Text.of("FTX 3070"), config.toDisplayConfig.ftx3070) + .setDefaultValue(false) + .setTooltip(Text.of("Select to receive notifications when a FTX 3070 is found")) + .setSaveConsumer(newValue -> config.toDisplayConfig.ftx3070 = newValue) + .build()); + + chChestItems.addEntry(entryBuilder.startBooleanToggle(Text.of("Robotron Reflector"), config.toDisplayConfig.robotronReflector) + .setDefaultValue(false) + .setTooltip(Text.of("Select to receive notifications when a Robotron Reflector is found")) + .setSaveConsumer(newValue -> config.toDisplayConfig.robotronReflector = newValue) + .build()); + + chChestItems.addEntry(entryBuilder.startBooleanToggle(Text.of("Superlite Motor"), config.toDisplayConfig.superliteMotor) + .setDefaultValue(false) + .setTooltip(Text.of("Select to receive notifications when a Superlite Motor is found")) + .setSaveConsumer(newValue -> config.toDisplayConfig.superliteMotor = newValue) + .build()); + + chChestItems.addEntry(entryBuilder.startBooleanToggle(Text.of("Synthetic Heart"), config.toDisplayConfig.syntheticHeart) + .setDefaultValue(false) + .setTooltip(Text.of("Select to receive notifications when a Synthetic Heart is found")) + .setSaveConsumer(newValue -> config.toDisplayConfig.syntheticHeart = newValue) + .build()); + + chChestItems.addEntry(entryBuilder.startBooleanToggle(Text.of("Flawless Gemstone"), config.toDisplayConfig.flawlessGemstone) + .setDefaultValue(false) + .setTooltip(Text.of("Select to receive notifications when any Flawless Gemstone is found")) + .setSaveConsumer(newValue -> config.toDisplayConfig.flawlessGemstone = newValue) + .build()); + chChestItems.addEntry(entryBuilder.startBooleanToggle(Text.of("Jungle Heart"), config.toDisplayConfig.jungleHeart) + .setDefaultValue(false) + .setTooltip(Text.of("Select to receive notifications when a JungleHeart is found")) + .setSaveConsumer(newValue -> config.toDisplayConfig.jungleHeart = newValue) + .build()); + }//CHChestItems + ConfigCategory miningEvents = builder.getOrCreateCategory(Text.of("Mining Events")); + { + miningEvents.addEntry(entryBuilder.startBooleanToggle(Text.of("All Events"), config.toDisplayConfig.allEvents) + .setDefaultValue(true) + .setTooltip(Text.of("Get updated for any Mining Event")) + .setSaveConsumer(newValue -> config.toDisplayConfig.allEvents = newValue) + .build()); + miningEvents.addEntry(entryBuilder.startBooleanToggle(Text.of("§cBlock Crystal Hollow Events"), config.toDisplayConfig.blockChEvents) + .setDefaultValue(false) + .setTooltip(Text.of("Block getting Crystal Hollow Events. Maybe if you haven't accessed Crystal Hollows yet ")) + .setSaveConsumer(newValue -> config.toDisplayConfig.blockChEvents = newValue) + .build()); + miningEvents.addEntry(entryBuilder.startStringDropdownMenu(Text.of("Gone with the Wind"), config.toDisplayConfig.goneWithTheWind) // Start the StringDropdownMenu entry + .setSelections(List.of("both", Islands.DWARVEN_MINES.getDisplayName(), Islands.CRYSTAL_HOLLOWS.getDisplayName(), "none")) + .setTooltip(Text.of("Get notified when a Gone with the Wind happens in the specified Island")) + .setDefaultValue("none") + .setSuggestionMode(false) + .setSaveConsumer(newValue -> config.toDisplayConfig.goneWithTheWind = newValue) + .build()); + miningEvents.addEntry(entryBuilder.startStringDropdownMenu(Text.of("Better Together"), config.toDisplayConfig.betterTogether) // Start the StringDropdownMenu entry + .setSelections(List.of("both", Islands.DWARVEN_MINES.getDisplayName(), Islands.CRYSTAL_HOLLOWS.getDisplayName(), "none")) + .setTooltip(Text.of("Get notified when a Better Together happens in the specified Island")) + .setDefaultValue("none") + .setSuggestionMode(false) + .setSaveConsumer(newValue -> config.toDisplayConfig.betterTogether = newValue) + .build()); + miningEvents.addEntry(entryBuilder.startStringDropdownMenu(Text.of("Double Powder"), config.toDisplayConfig.doublePowder) // Start the StringDropdownMenu entry + .setSelections(List.of("both", Islands.DWARVEN_MINES.getDisplayName(), Islands.CRYSTAL_HOLLOWS.getDisplayName(), "none")) + .setTooltip(Text.of("Get notified when a Double Powder happens in the specified Island")) + .setDefaultValue("none") + .setSuggestionMode(false) + .setSaveConsumer(newValue -> config.toDisplayConfig.doublePowder = newValue) + .build()); + miningEvents.addEntry(entryBuilder.startBooleanToggle(Text.of("Mithril Gourmand"), config.toDisplayConfig.mithrilGourmand) + .setDefaultValue(false) + .setTooltip(Text.of("Get notified when a Mithril Gourmand happens")) + .setSaveConsumer(newValue -> config.toDisplayConfig.mithrilGourmand = newValue) + .build()); + miningEvents.addEntry(entryBuilder.startBooleanToggle(Text.of("Raffle"), config.toDisplayConfig.raffle) + .setDefaultValue(false) + .setTooltip(Text.of("Get notified when a Raffle happens")) + .setSaveConsumer(newValue -> config.toDisplayConfig.raffle = newValue) + .build()); + miningEvents.addEntry(entryBuilder.startBooleanToggle(Text.of("Goblin Raid"), config.toDisplayConfig.goblinRaid) + .setDefaultValue(false) + .setTooltip(Text.of("Get notified when a Goblin Raid happens")) + .setSaveConsumer(newValue -> config.toDisplayConfig.goblinRaid = newValue) + .build()); + } //Mining Events + if (config.hasBBRoles("dev")) { + ConfigCategory dev = builder.getOrCreateCategory(Text.of("§3Developing")); + dev.addEntry(entryBuilder.startBooleanToggle(Text.of("Dev Mode"), config.devMode) + .setDefaultValue(false) + .setTooltip(Text.of("Dev Mode")) + .setSaveConsumer(newValue -> config.devMode = newValue) + .build()); + dev.addEntry(entryBuilder.startBooleanToggle(Text.of("Detailed Dev Mode"), config.detailedDevMode) + .setDefaultValue(false) + .setTooltip(Text.of("Detailed Dev Mode")) + .setSaveConsumer(newValue -> config.detailedDevMode = newValue) + .build()); + } + if (config.hasBBRoles("splasher")) { + ConfigCategory dev = builder.getOrCreateCategory(Text.of("§dSplashes")); + dev.addEntry(entryBuilder.startBooleanToggle(Text.of("Auto Update Statuses"), config.autoSplashStatusUpdates) + .setDefaultValue(true) + .setTooltip(Text.of("Automatically updates the Status of the Splash by sending packets to the Server")) + .setSaveConsumer(newValue -> config.autoSplashStatusUpdates = newValue) + .build()); + } + + return builder.build(); + } } } |