diff options
author | HacktheTime <l4bg0jb7@duck.com> | 2023-12-15 19:06:11 +0100 |
---|---|---|
committer | HacktheTime <l4bg0jb7@duck.com> | 2023-12-15 19:06:11 +0100 |
commit | 2a22b024361e195819337b736e57a68742029a5a (patch) | |
tree | 2c37c7f89f6f4ccbc3dc8ec80765451ea235c36f /fabric | |
parent | 595bb1aca851f8ab4eb216fadbd0e15f7831e4f5 (diff) | |
download | BBsentials-2a22b024361e195819337b736e57a68742029a5a.tar.gz BBsentials-2a22b024361e195819337b736e57a68742029a5a.tar.bz2 BBsentials-2a22b024361e195819337b736e57a68742029a5a.zip |
added toggles for the Splash Overlay.
Diffstat (limited to 'fabric')
-rw-r--r-- | fabric/src/main/java/de/hype/bbsentials/fabric/BBsentialsConfigScreemFactory.java | 21 | ||||
-rw-r--r-- | fabric/src/main/java/de/hype/bbsentials/fabric/MCUtils.java | 30 |
2 files changed, 35 insertions, 16 deletions
diff --git a/fabric/src/main/java/de/hype/bbsentials/fabric/BBsentialsConfigScreemFactory.java b/fabric/src/main/java/de/hype/bbsentials/fabric/BBsentialsConfigScreemFactory.java index 3154377..4579c69 100644 --- a/fabric/src/main/java/de/hype/bbsentials/fabric/BBsentialsConfigScreemFactory.java +++ b/fabric/src/main/java/de/hype/bbsentials/fabric/BBsentialsConfigScreemFactory.java @@ -322,12 +322,27 @@ public class BBsentialsConfigScreemFactory { .build()); } if (BBsentials.config.hasBBRoles("splasher")) { - ConfigCategory dev = builder.getOrCreateCategory(Text.of("§dSplashes")); - dev.addEntry(entryBuilder.startBooleanToggle(Text.of("Auto Update Statuses"), BBsentials.config.autoSplashStatusUpdates) + ConfigCategory splasher = builder.getOrCreateCategory(Text.of("§dSplashes")); + BooleanListEntry updateSplashStatus = entryBuilder.startBooleanToggle(Text.of("Auto Update Statuses"), BBsentials.config.autoSplashStatusUpdates) .setDefaultValue(true) .setTooltip(Text.of("Automatically updates the Status of the Splash by sending packets to the Server")) .setSaveConsumer(newValue -> BBsentials.config.autoSplashStatusUpdates = newValue) - .build()); + .build(); + splasher.addEntry(updateSplashStatus); + BooleanListEntry showLeecherHud = entryBuilder.startBooleanToggle(Text.of("Do not show Splash Leecher Overlay"), BBsentials.config.autoSplashStatusUpdates) + .setDefaultValue(true) + .setTooltip(Text.of("Optional disabler for the Splash Leecher Overlay. Is normally automatically enabled when you announce a splash.\nAutomatically gets disabled when its marked done.")) + .setSaveConsumer(newValue -> BBsentials.config.autoSplashStatusUpdates = newValue) + .setRequirement(updateSplashStatus::getValue) + .build(); + splasher.addEntry(showLeecherHud); + entryBuilder.startBooleanToggle(Text.of("Show Music Pants Users"), BBsentials.config.autoSplashStatusUpdates) + .setDefaultValue(true) + .setTooltip(Text.of("Displays a small red note in front of the username if they wear music pants. Displays everybody with it not just non Bingos")) + .setRequirement(showLeecherHud::getValue) + .setSaveConsumer(newValue -> BBsentials.config.autoSplashStatusUpdates = newValue) + .build(); + } return builder.build(); } diff --git a/fabric/src/main/java/de/hype/bbsentials/fabric/MCUtils.java b/fabric/src/main/java/de/hype/bbsentials/fabric/MCUtils.java index 2b2b229..c45a468 100644 --- a/fabric/src/main/java/de/hype/bbsentials/fabric/MCUtils.java +++ b/fabric/src/main/java/de/hype/bbsentials/fabric/MCUtils.java @@ -142,22 +142,26 @@ public class MCUtils implements de.hype.bbsentials.common.mclibraries.MCUtils { List<PlayerEntity> musicPants = new ArrayList<>(); List<Text> toDisplay = new ArrayList<>(); toDisplay.add(Text.of("§6Total: " + allParticipiants.size() + " | Bingos: " + (allParticipiants.size() - splashLeechers.size()) + " | Leechers: " + splashLeechers.size())); + boolean doPants = BBsentials.config.showMusicPants; for (PlayerEntity participiant : allParticipiants) { - boolean hasPants = false; - for (ItemStack armorItem : participiant.getArmorItems()) { - try { - if (armorItem.getNbt().get("ExtraAttributes").asString().contains("MUSIC_PANTS")) { - musicPants.add(participiant); - hasPants = true; + if (doPants) { + + boolean hasPants = false; + for (ItemStack armorItem : participiant.getArmorItems()) { + try { + if (armorItem.getNbt().get("ExtraAttributes").asString().contains("MUSIC_PANTS")) { + musicPants.add(participiant); + hasPants = true; + } + } catch (Exception ignored) { + continue; } - } catch (Exception ignored) { - continue; } - } - if (hasPants) { - String pantsAddition = Text.Serializer.toJson(Text.of("§4[♪]§ ")); - String normal = Text.Serializer.toJson(participiant.getDisplayName()); - toDisplay.add(Text.Serializer.fromJson("[" + pantsAddition + "," + normal + "]")); + if (hasPants) { + String pantsAddition = Text.Serializer.toJson(Text.of("§4[♪]§ ")); + String normal = Text.Serializer.toJson(participiant.getDisplayName()); + toDisplay.add(Text.Serializer.fromJson("[" + pantsAddition + "," + normal + "]")); + } } } toDisplay.addAll(splashLeechers.stream().map(PlayerEntity::getDisplayName).toList()); |