Toast No render
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package cloudburst.rejects.mixin;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import net.minecraft.client.toast.Toast;
|
||||
import net.minecraft.client.toast.ToastManager;
|
||||
|
||||
import cloudburst.rejects.modules.Rendering;
|
||||
import minegame159.meteorclient.systems.modules.Modules;
|
||||
|
||||
@Mixin(ToastManager.class)
|
||||
public class ToastManagerMixin {
|
||||
@Inject(method="add", at = @At("HEAD"), cancellable = true)
|
||||
public void preventAdd(Toast toast, CallbackInfo ci) {
|
||||
if (Modules.get().get(Rendering.class).disableToasts()) ci.cancel();
|
||||
}
|
||||
}
|
||||
@@ -78,6 +78,13 @@ public class Rendering extends Module {
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> disableToasts = sgFun.add(new BoolSetting.Builder()
|
||||
.name("disable-toasts")
|
||||
.description("Disable toasts (e.g. advancements)")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
private ShaderEffect shader = null;
|
||||
|
||||
@@ -127,4 +134,9 @@ public class Rendering extends Module {
|
||||
if (!this.isActive()) return false;
|
||||
return deadmau5Ears.get();
|
||||
}
|
||||
|
||||
public boolean disableToasts() {
|
||||
if (!this.isActive()) return false;
|
||||
return disableToasts.get();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
"Deadmau5FeatureRendererMixin",
|
||||
"StructureVoidBlockMixin",
|
||||
"LivingEntityRendererMixin",
|
||||
"GameRendererMixin"
|
||||
"GameRendererMixin",
|
||||
"ToastManagerMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
|
||||
Reference in New Issue
Block a user