#Mxin help

21 messages · Page 1 of 1 (latest)

upbeat jungle
#

I don't really know why you want to, but wrapop it, and just don't call it.

steel canyon
upbeat jungle
#

that wouldn't involve outright removing the gamma option

steel canyon
#

i think thats what verifys the option is within an acceptable range idk

upbeat jungle
#

just take a look at how other mods do it

#

there's tons of them

steel canyon
#

thats what ive been doing. i got this idea from one

#

but the mixin doesnt work for me cause one of the arguments has private access

upbeat jungle
#

access doesn't really affect mixins

steel canyon
#

it highlights it red and wont compile

upbeat jungle
#

you're doing something wrong then

#

you can send the mixin here

#

but also I'm still not convinced that this is the right way to go about it either lol

steel canyon
#

idk you may be right. here is is though

package com.nunyabiz_.client.mixins.tools.fullbright;

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import net.minecraft.client.option.GameOptions;
import net.minecraft.client.option.SimpleOption;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

@Mixin({GameOptions.class})
public class MixinGameOptions<T> {
    @WrapOperation(method = {"acceptProfiledOptions"}, at = {@At(value = "INVOKE", target = "Lnet/minecraft/client/option/GameOptions$OptionVisitor;accept(Ljava/lang/String;Lnet/minecraft/client/option/SimpleOption;)V")})
    private void doNotVisitGamma(GameOptions.OptionVisitor instance, String key, SimpleOption<T> option, Operation<Void> original) {
        if (!key.equals("gamma"))
            original.call(new Object[] { instance, key, option });
    }
}

#

thats from the mod

#

GameOptions.OptionVisitor has private access

upbeat jungle
#

ah, I see

#

ok this clearly isn't a very well written mod since it injects into every single one and checks the string

#

rather than only the one they need

steel canyon
#

yeah idk this is just one that i found.

#

i should probably find another cause this one has multiple mixins. idk if this will work i just wanna try.