From 25ff18e64942da591ebc42b2ab307a1e736412d5 Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Thu, 29 Jun 2023 13:54:01 +0800 Subject: [PATCH] Remove Effigy waypoints updating every frame --- .../java/me/xmrvizzy/skyblocker/config/SkyblockerConfig.java | 3 +++ .../me/xmrvizzy/skyblocker/skyblock/rift/EffigyWaypoints.java | 3 +-- .../java/me/xmrvizzy/skyblocker/skyblock/rift/TheRift.java | 3 ++- src/main/resources/assets/skyblocker/lang/en_us.json | 2 ++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/me/xmrvizzy/skyblocker/config/SkyblockerConfig.java b/src/main/java/me/xmrvizzy/skyblocker/config/SkyblockerConfig.java index 0cacdd8c72..4b1398e0f5 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/config/SkyblockerConfig.java +++ b/src/main/java/me/xmrvizzy/skyblocker/config/SkyblockerConfig.java @@ -379,6 +379,9 @@ public static class Slayer { public static class VampireSlayer { public boolean enableEffigyWaypoints = true; public boolean compactEffigyWaypoints; + @ConfigEntry.BoundedDiscrete(min = 1, max = 10) + @ConfigEntry.Gui.Tooltip() + public int effigyUpdateFrequency = 5; public boolean enableHolyIceIndicator = true; public int holyIceIndicatorTickDelay = 10; @ConfigEntry.BoundedDiscrete(min = 1, max = 10) diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/rift/EffigyWaypoints.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/rift/EffigyWaypoints.java index bc49104b8d..0d44900ad1 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/rift/EffigyWaypoints.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/rift/EffigyWaypoints.java @@ -62,8 +62,7 @@ public static void updateEffigies() { } public static void render(WorldRenderContext context) { - if (SkyblockerConfig.get().slayer.vampireSlayer.enableEffigyWaypoints && (Utils.getLocation().contains("Stillgore Château"))) { - updateEffigies(); + if (SkyblockerConfig.get().slayer.vampireSlayer.enableEffigyWaypoints && Utils.getLocation().contains("Stillgore Château")) { for (BlockPos effigy : unBrokenEffigies) { float[] colorComponents = DyeColor.RED.getColorComponents(); if (SkyblockerConfig.get().slayer.vampireSlayer.compactEffigyWaypoints) { diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/rift/TheRift.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/rift/TheRift.java index 4e68353285..91b727e24e 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/rift/TheRift.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/rift/TheRift.java @@ -13,7 +13,8 @@ public class TheRift { public static void init() { WorldRenderEvents.AFTER_TRANSLUCENT.register(MirrorverseWaypoints::render); WorldRenderEvents.AFTER_TRANSLUCENT.register(EffigyWaypoints::render); - SkyblockerMod.getInstance().scheduler.scheduleCyclic(StakeIndicator::updateStake, SkyblockerConfig.get().slayer.vampireSlayer.steakStakeUpdateFrequency); + SkyblockerMod.getInstance().scheduler.scheduleCyclic(EffigyWaypoints::updateEffigies, SkyblockerConfig.get().slayer.vampireSlayer.effigyUpdateFrequency); SkyblockerMod.getInstance().scheduler.scheduleCyclic(TwinClawsIndicator::updateIce, SkyblockerConfig.get().slayer.vampireSlayer.holyIceUpdateFrequency); + SkyblockerMod.getInstance().scheduler.scheduleCyclic(StakeIndicator::updateStake, SkyblockerConfig.get().slayer.vampireSlayer.steakStakeUpdateFrequency); } } diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index e83c8ddd0b..e41f5c95b9 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -224,6 +224,8 @@ "text.autoconfig.skyblocker.option.slayer.vampireSlayer": "Vampire Slayer", "text.autoconfig.skyblocker.option.slayer.vampireSlayer.enableEffigyWaypoints": "Enable Effigy Waypoints", "text.autoconfig.skyblocker.option.slayer.vampireSlayer.compactEffigyWaypoints": "Compact Effigy Waypoints", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.effigyUpdateFrequency": "Holy Ice Indicator Update Frequency (Ticks)", + "text.autoconfig.skyblocker.option.slayer.vampireSlayer.effigyUpdateFrequency.@Tooltip": "The lower the value, the more frequent the updates, which may cause lag.", "text.autoconfig.skyblocker.option.slayer.vampireSlayer.enableHolyIceIndicator": "Enable Holy Ice Indicator", "text.autoconfig.skyblocker.option.slayer.vampireSlayer.holyIceIndicatorTickDelay": "Holy Ice Indicator Delay (Ticks)", "text.autoconfig.skyblocker.option.slayer.vampireSlayer.holyIceUpdateFrequency": "Holy Ice Indicator Update Frequency (Ticks)",