Skip to content

Commit

Permalink
Fixed flawlessFrames does not work after the first enabling
Browse files Browse the repository at this point in the history
nobody knows how was this code written
resolved #70
  • Loading branch information
Fallen-Breath committed Jul 26, 2024
1 parent 5341b5e commit 0720ed5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ public static void initConfigs()
OF_SANTA_HAT.setValueChangeCallback(OptifinePlayerExtraModelOverrider::onConfigValueChanged);
OF_WITCH_HAT.setValueChangeCallback(OptifinePlayerExtraModelOverrider::onConfigValueChanged);
PARTICLE_LIMIT.setValueChangeCallback(ParticleLimitHelper::onConfigValueChanged);
FLAWLESS_FRAMES.setValueChangeCallback(config -> FlawlessFramesHandler.setEnabled(config.getBooleanValue()));
FLAWLESS_FRAMES.setValueChangeCallback(FlawlessFramesHandler::onConfigValueChanged);

// debugs
TWEAKERMORE_DEBUG_MODE.setValueChangeCallback(redrawConfigGui);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
package me.fallenbreath.tweakermore.impl.mc_tweaks.flawlessFrames;

import com.google.common.collect.ImmutableList;
import fi.dy.masa.malilib.config.options.ConfigBoolean;
import me.fallenbreath.tweakermore.TweakerMoreMod;
import me.fallenbreath.tweakermore.config.TweakerMoreConfigs;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.WorldRenderer;

Expand Down Expand Up @@ -77,14 +77,12 @@ private static void uninstallHook()
{
TweakerMoreMod.LOGGER.error("Failed to invoke method uninstall of replay flawless rendering hook {}", hook, e);
}
hook = null;
}

public static void setEnabled(boolean enabled)
public static void onConfigValueChanged(ConfigBoolean config)
{
if (!TweakerMoreConfigs.FLAWLESS_FRAMES.getTweakerMoreOption().isEnabled())
{
return;
}
boolean enabled = config.getBooleanValue();
if (hook == null && enabled)
{
installHook();
Expand Down

0 comments on commit 0720ed5

Please sign in to comment.