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