I would call this `didOptifineDetection`, the way it's named now makes
me think if it's true then optifine is present when it actually means
we've just done the check. Also the variable can be private.
++ public static void tryOptifineWarning() {+ if (!optifineDetected) {+ try {+ Class.forName("optifine.Installer");+ Minecraft.getInstance().player.sendSystemMessage(Component.translatable("botaniamisc.optifine_warning"));+ optifineDetected = true;+ } catch (ClassNotFoundException ignored) {}+ }+ }+ public static void onDrawScreenPost(PoseStack ms, float partialTicks) {
Minecraft mc = Minecraft.getInstance();
if (mc.options.hideGui) {
@@ -102,6 +115,7 @@ public static void onDrawScreenPost(PoseStack ms, float partialTicks) {
if (PlayerHelper.hasAnyHeldItem(mc.player)) {
if (PlayerHelper.hasHeldItemClass(mc.player, WandOfTheForestItem.class)) {
+ tryOptifineWarning(); var hud = ClientXplatAbstractions.INSTANCE.findWandHud(mc.level, bpos, state, tile);
if (hud != null) {
profiler.push("wandItem");
diff --git a/Xplat/src/main/resources/assets/botania/lang/en_us.json b/Xplat/src/main/resources/assets/botania/lang/en_us.json
index 23d656095..cdf7968c6 100644
--- a/Xplat/src/main/resources/assets/botania/lang/en_us.json+++ b/Xplat/src/main/resources/assets/botania/lang/en_us.json
@@ -28,6 +28,7 @@
"botaniamisc.filter2": "Pickup any items",
"botaniamisc.retainer.retain_all": "Retain original number of items requested",
"botaniamisc.retainer.retain_missing": "Retain number of missing items",
+ "botaniamisc.optifine_warning": "§4[WARNING]§r <Botania>: Optifine detected. Please be aware that Optifine causes a lot of issues with botania, and you might experience issues such as mana not moving between flowers and spreaders, and no information being displayed when you hold a wand and look at a mana pool or spreader. We recommend Sodium as an alternative Optifine's performance improvements.",
"botaniamisc.creativePool0": "Creative Mana Pool, has infinite Mana",
"botaniamisc.creativePool1": "Worthy of an Egoist",
diff --git a/web/changelog.md b/web/changelog.md
index 7151d06ad..78f4e5e63 100644
--- a/web/changelog.md+++ b/web/changelog.md
@@ -25,6 +25,7 @@ and start a new "Upcoming" section.
* Add: All wand HUDs now have backgrounds for better readability, along with some other changes on some HUDs. Their design is not finalized, let us know on discord/reddit/irc/email if you have suggestions for how they can be better!
* Add: Bound flowers now show the type of spreader/pool they're bound to in the tooltip, instead of a generic spreader/pool
* Add: Rannuncarpus can now add blocks onto existing blocks like candles and sea pickles, which accept multiple placements of itself in the same block space
+* Add: The game now warns you if you hold a wand of the forest with Optifine installed, as it breaks the entire mod. We recommend Sodium instead if you need a performance boost* Change: Instead of always cooling down for 5 minutes, thermalilies now have a random cooldown between 20 seconds and 5 minutes. For automation, you can read how long the cooldown is with a comparator
* Change: Entropinnyum's "unethical TNT" detection was changed, it's now more accurate and shouldn't cause any false positives
* Change: Flower pouches now render missing flowers transparently, and render a "1" next to stacks with one item
--
2.39.2 (Apple Git-143)