norender and rendering improvements
This commit is contained in:
@@ -67,6 +67,7 @@
|
||||
### Modifications
|
||||
- NoRender
|
||||
- `noCommandSuggestions` (Taken from an [unmerged PR](https://github.com/MeteorDevelopment/meteor-client/pull/1347))
|
||||
- `disableToasts`
|
||||
- Flight
|
||||
- `stopMomentum`
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package anticope.rejects.mixin;
|
||||
|
||||
import net.minecraft.client.model.ModelPart;
|
||||
import net.minecraft.client.render.VertexConsumer;
|
||||
import net.minecraft.client.render.block.entity.ChestBlockEntityRenderer;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
|
||||
import anticope.rejects.modules.Rendering;
|
||||
import meteordevelopment.meteorclient.systems.modules.Modules;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(ChestBlockEntityRenderer.class)
|
||||
public class ChestBlockEntityRendererMixin {
|
||||
@Shadow private boolean christmas;
|
||||
|
||||
@Inject(method = "render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;Lnet/minecraft/client/model/ModelPart;Lnet/minecraft/client/model/ModelPart;Lnet/minecraft/client/model/ModelPart;FII)V", at = @At("HEAD"), cancellable = true)
|
||||
public void render1(MatrixStack matrices, VertexConsumer vertices, ModelPart lid, ModelPart latch, ModelPart base, float openFactor, int light, int overlay, CallbackInfo ci) {
|
||||
Rendering rendering = Modules.get().get(Rendering.class);
|
||||
if (rendering != null)
|
||||
this.christmas = rendering.chistmas();
|
||||
}
|
||||
|
||||
@Inject(method = "render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;Lnet/minecraft/client/model/ModelPart;Lnet/minecraft/client/model/ModelPart;Lnet/minecraft/client/model/ModelPart;FII)V", at = @At("RETURN"))
|
||||
public void render2(MatrixStack matrices, VertexConsumer vertices, ModelPart lid, ModelPart latch, ModelPart base, float openFactor, int light, int overlay, CallbackInfo ci) {
|
||||
Rendering rendering = Modules.get().get(Rendering.class);
|
||||
if (rendering != null)
|
||||
this.christmas = rendering.chistmas();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package anticope.rejects.mixin;
|
||||
|
||||
import anticope.rejects.modules.Rendering;
|
||||
import anticope.rejects.modules.modifier.NoRenderModifier;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
@@ -9,12 +10,10 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import net.minecraft.client.toast.Toast;
|
||||
import net.minecraft.client.toast.ToastManager;
|
||||
|
||||
import meteordevelopment.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();
|
||||
if (NoRenderModifier.disableToasts()) ci.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,9 +79,9 @@ public class Rendering extends Module {
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> disableToasts = sgFun.add(new BoolSetting.Builder()
|
||||
.name("disable-toasts")
|
||||
.description("Disable toasts (e.g. advancements)")
|
||||
private final Setting<Boolean> christmas = sgFun.add(new BoolSetting.Builder()
|
||||
.name("chrismas")
|
||||
.description("Chistmas chest anytime")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
@@ -89,7 +89,7 @@ public class Rendering extends Module {
|
||||
private ShaderEffect shader = null;
|
||||
|
||||
public Rendering() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "Rendering", "Various Render Tweaks");
|
||||
super(MeteorRejectsAddon.CATEGORY, "rendering", "Various Render Tweaks");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -135,8 +135,8 @@ public class Rendering extends Module {
|
||||
return deadmau5Ears.get();
|
||||
}
|
||||
|
||||
public boolean disableToasts() {
|
||||
public boolean chistmas() {
|
||||
if (!this.isActive()) return false;
|
||||
return disableToasts.get();
|
||||
return christmas.get();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,11 +11,16 @@ public class NoRenderModifier {
|
||||
static SettingGroup sgOverlay;
|
||||
|
||||
public static Setting<Boolean> noCommandSuggestions;
|
||||
public static Setting<Boolean> disableToasts;
|
||||
|
||||
public static boolean noCommandSuggestions() {
|
||||
return Modules.get().get(NoRender.class).isActive() && noCommandSuggestions.get();
|
||||
}
|
||||
|
||||
public static boolean disableToasts() {
|
||||
return Modules.get().get(NoRender.class).isActive() && disableToasts.get();
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
sgOverlay = ((NoRenderAccessor) Modules.get().get(NoRender.class)).getSgOverlay();
|
||||
noCommandSuggestions = sgOverlay.add(new BoolSetting.Builder()
|
||||
@@ -24,5 +29,11 @@ public class NoRenderModifier {
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
disableToasts = sgOverlay.add(new BoolSetting.Builder()
|
||||
.name("disable-toasts")
|
||||
.description("Disable toasts (e.g. advancements)")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
"package": "anticope.rejects.mixin",
|
||||
"compatibilityLevel": "JAVA_16",
|
||||
"client": [
|
||||
"ChestBlockEntityRendererMixin",
|
||||
"ClientPlayNetworkHandlerMixin",
|
||||
"CommandSuggestorMixin",
|
||||
"CustomPayloadS2CPacketMixin",
|
||||
|
||||
Reference in New Issue
Block a user