Skip to content

Commit e812a6c

Browse files
committed
Merge remote-tracking branch 'NeoLambda/1.21.5' into 1.21.5
2 parents ae63cf9 + aa230d0 commit e812a6c

28 files changed

+809
-59
lines changed

src/main/java/com/lambda/mixin/entity/EntityMixin.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
import com.lambda.event.events.EntityEvent;
2323
import com.lambda.event.events.PlayerEvent;
2424
import com.lambda.interaction.request.rotating.RotationManager;
25+
import com.lambda.module.modules.render.NoRender;
2526
import com.lambda.util.math.Vec2d;
27+
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
2628
import net.minecraft.entity.Entity;
2729
import net.minecraft.entity.MovementType;
2830
import net.minecraft.entity.data.TrackedData;
@@ -130,4 +132,14 @@ public void onTrackedDataSet(TrackedData<?> data, CallbackInfo ci) {
130132
Entity entity = (Entity) (Object) this;
131133
EventFlow.post(new EntityEvent.Update(entity, data));
132134
}
135+
136+
@ModifyExpressionValue(method = "isInvisible", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;getFlag(I)Z"))
137+
private boolean modifyGetFlagInvisible(boolean original) {
138+
return (NoRender.INSTANCE.isDisabled() || !NoRender.getNoInvisibility()) && original;
139+
}
140+
141+
@ModifyExpressionValue(method = "isGlowing", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;getFlag(I)Z"))
142+
private boolean modifyGetFlagGlowing(boolean original) {
143+
return (NoRender.INSTANCE.isDisabled() || !NoRender.getNoGlow()) && original;
144+
}
133145
}

src/main/java/com/lambda/mixin/network/ClientPlayNetworkHandlerMixin.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,4 @@ public boolean onServerMetadata(ClientPlayNetworkHandler clientPlayNetworkHandle
103103
void injectVelocity(ExplosionS2CPacket packet, CallbackInfo ci) {
104104
if (Velocity.getExplosion() && Velocity.INSTANCE.isEnabled()) ci.cancel();
105105
}
106-
107-
/**
108-
* Cancels the world particle if {@link NoRender#getNoExplosion()} is true
109-
*/
110-
@Inject(method = "onExplosion(Lnet/minecraft/network/packet/s2c/play/ExplosionS2CPacket;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/world/ClientWorld;addParticleClient(Lnet/minecraft/particle/ParticleEffect;DDDDDD)V"), cancellable = true)
111-
void injectParticles(ExplosionS2CPacket packet, CallbackInfo ci) {
112-
if (NoRender.getNoExplosion() && NoRender.INSTANCE.isEnabled()) ci.cancel();
113-
}
114-
}
106+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright 2025 Lambda
3+
*
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
package com.lambda.mixin.render;
19+
20+
import com.lambda.module.modules.render.NoRender;
21+
import net.minecraft.block.entity.SignText;
22+
import net.minecraft.client.render.VertexConsumerProvider;
23+
import net.minecraft.client.render.block.entity.AbstractSignBlockEntityRenderer;
24+
import net.minecraft.client.util.math.MatrixStack;
25+
import net.minecraft.util.math.BlockPos;
26+
import org.spongepowered.asm.mixin.Mixin;
27+
import org.spongepowered.asm.mixin.injection.At;
28+
import org.spongepowered.asm.mixin.injection.Inject;
29+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
30+
31+
@Mixin(AbstractSignBlockEntityRenderer.class)
32+
public class AbstractSignBlockEntityRendererMixin {
33+
@Inject(method = "renderText", at = @At("HEAD"), cancellable = true)
34+
private void injectRenderText(BlockPos pos, SignText text, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int textLineHeight, int maxTextWidth, boolean front, CallbackInfo ci) {
35+
if (NoRender.INSTANCE.isEnabled() && NoRender.getNoSignText()) ci.cancel();
36+
}
37+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright 2025 Lambda
3+
*
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
package com.lambda.mixin.render;
19+
20+
import com.lambda.module.modules.render.NoRender;
21+
import net.minecraft.client.render.VertexConsumerProvider;
22+
import net.minecraft.client.render.entity.feature.ArmorFeatureRenderer;
23+
import net.minecraft.client.render.entity.state.BipedEntityRenderState;
24+
import net.minecraft.client.util.math.MatrixStack;
25+
import org.spongepowered.asm.mixin.Mixin;
26+
import org.spongepowered.asm.mixin.injection.At;
27+
import org.spongepowered.asm.mixin.injection.Inject;
28+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
29+
30+
@Mixin(ArmorFeatureRenderer.class)
31+
public class ArmorFeatureRendererMixin {
32+
@Inject(method = "render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;ILnet/minecraft/client/render/entity/state/BipedEntityRenderState;FF)V", at = @At("HEAD"), cancellable = true)
33+
private void injectRender(MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i, BipedEntityRenderState bipedEntityRenderState, float f, float g, CallbackInfo ci) {
34+
if (NoRender.INSTANCE.isEnabled() && NoRender.getNoArmor()) ci.cancel();
35+
}
36+
}

src/main/java/com/lambda/mixin/render/BackgroundRendererMixin.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,23 @@
1717

1818
package com.lambda.mixin.render;
1919

20+
import com.lambda.module.modules.render.NoRender;
2021
import com.lambda.module.modules.render.WorldColors;
2122
import net.minecraft.client.render.BackgroundRenderer;
23+
import net.minecraft.entity.Entity;
24+
import net.minecraft.entity.LivingEntity;
2225
import net.minecraft.util.math.Vec3d;
2326
import net.minecraft.world.biome.Biome;
27+
import org.spongepowered.asm.mixin.Final;
2428
import org.spongepowered.asm.mixin.Mixin;
29+
import org.spongepowered.asm.mixin.Shadow;
2530
import org.spongepowered.asm.mixin.injection.At;
31+
import org.spongepowered.asm.mixin.injection.Inject;
2632
import org.spongepowered.asm.mixin.injection.Redirect;
33+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
34+
35+
import java.util.List;
36+
import java.util.stream.Stream;
2737

2838
/**
2939
* <pre>{@code
@@ -39,6 +49,8 @@
3949
// FixMe: This crashes the game
4050
@Mixin(BackgroundRenderer.class)
4151
public class BackgroundRendererMixin {
52+
@Shadow @Final private static List<BackgroundRenderer.StatusEffectFogModifier> FOG_MODIFIERS;
53+
4254
@Redirect(method = "getFogColor", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/Vec3d;getX()D"))
4355
private static double redirectRed(Vec3d baseColor) {
4456
return WorldColors.fogOfWarColor(baseColor).getX();
@@ -59,4 +71,15 @@ private static int redirectWaterFogColor(Biome biome) {
5971
return WorldColors.waterFogColor(biome.getWaterFogColor());
6072
}
6173

74+
@Inject(method = "getFogModifier(Lnet/minecraft/entity/Entity;F)Lnet/minecraft/client/render/BackgroundRenderer$StatusEffectFogModifier;", at = @At("HEAD"), cancellable = true)
75+
private static void injectFogModifier(Entity entity, float tickProgress, CallbackInfoReturnable<BackgroundRenderer.StatusEffectFogModifier> cir){
76+
if (entity instanceof LivingEntity livingEntity) {
77+
Stream<BackgroundRenderer.StatusEffectFogModifier> modifiers = FOG_MODIFIERS
78+
.stream()
79+
.filter((modifier) ->
80+
modifier.shouldApply(livingEntity, tickProgress) && NoRender.shouldAcceptFog(modifier)
81+
);
82+
cir.setReturnValue(modifiers.findFirst().orElse(null));
83+
}
84+
}
6285
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright 2025 Lambda
3+
*
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
package com.lambda.mixin.render;
19+
20+
import com.lambda.module.modules.render.NoRender;
21+
import net.minecraft.block.entity.BlockEntity;
22+
import net.minecraft.client.render.VertexConsumerProvider;
23+
import net.minecraft.client.render.block.entity.BeaconBlockEntityRenderer;
24+
import net.minecraft.client.util.math.MatrixStack;
25+
import net.minecraft.util.math.Vec3d;
26+
import org.spongepowered.asm.mixin.Mixin;
27+
import org.spongepowered.asm.mixin.injection.At;
28+
import org.spongepowered.asm.mixin.injection.Inject;
29+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
30+
31+
@Mixin(BeaconBlockEntityRenderer.class)
32+
public class BeaconBlockEntityRendererMixin {
33+
@Inject(method = "render", at = @At("HEAD"), cancellable = true)
34+
private void injectRender(BlockEntity entity, float tickProgress, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay, Vec3d cameraPos, CallbackInfo ci) {
35+
if (NoRender.INSTANCE.isEnabled() && NoRender.getNoBeaconBeams()) ci.cancel();
36+
}
37+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Copyright 2025 Lambda
3+
*
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
package com.lambda.mixin.render;
19+
20+
import com.lambda.module.modules.render.NoRender;
21+
import net.minecraft.block.entity.BlockEntity;
22+
import net.minecraft.client.render.VertexConsumerProvider;
23+
import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
24+
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
25+
import net.minecraft.client.util.math.MatrixStack;
26+
import net.minecraft.util.math.Vec3d;
27+
import org.spongepowered.asm.mixin.Mixin;
28+
import org.spongepowered.asm.mixin.injection.At;
29+
import org.spongepowered.asm.mixin.injection.Inject;
30+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
31+
32+
@Mixin(BlockEntityRenderDispatcher.class)
33+
public class BlockEntityRenderDispatcherMixin {
34+
@Inject(method = "render(Lnet/minecraft/client/render/block/entity/BlockEntityRenderer;Lnet/minecraft/block/entity/BlockEntity;FLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;Lnet/minecraft/util/math/Vec3d;)V", at = @At("HEAD"), cancellable = true)
35+
private static void injectRender(BlockEntityRenderer<BlockEntity> renderer, BlockEntity blockEntity, float tickProgress, MatrixStack matrices, VertexConsumerProvider vertexConsumers, Vec3d cameraPos, CallbackInfo ci) {
36+
if (NoRender.shouldOmitBlockEntity(blockEntity)) ci.cancel();
37+
}
38+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright 2025 Lambda
3+
*
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
package com.lambda.mixin.render;
19+
20+
import com.lambda.module.modules.render.NoRender;
21+
import net.minecraft.client.gui.DrawContext;
22+
import net.minecraft.client.gui.hud.BossBarHud;
23+
import org.spongepowered.asm.mixin.Mixin;
24+
import org.spongepowered.asm.mixin.injection.At;
25+
import org.spongepowered.asm.mixin.injection.Inject;
26+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
27+
28+
@Mixin(BossBarHud.class)
29+
public class BossBarHudMixin {
30+
@Inject(method = "render", at = @At("HEAD"), cancellable = true)
31+
private void injectRender(DrawContext context, CallbackInfo ci) {
32+
if (NoRender.INSTANCE.isEnabled() && NoRender.getNoBossBar()) ci.cancel();
33+
}
34+
}

src/main/java/com/lambda/mixin/render/CameraMixin.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
import com.lambda.module.modules.player.Freecam;
2222
import com.lambda.module.modules.render.CameraTweaks;
2323
import com.lambda.module.modules.render.FreeLook;
24+
import com.lambda.module.modules.render.NoRender;
25+
import net.minecraft.block.enums.CameraSubmersionType;
2426
import net.minecraft.client.render.Camera;
2527
import net.minecraft.entity.Entity;
2628
import net.minecraft.world.BlockView;
@@ -145,4 +147,9 @@ private void onUpdateSetRotationArgs(Args args) {
145147
args.set(1, FreeLook.INSTANCE.getCamera().getPitchF());
146148
}
147149
}
150+
151+
@Inject(method = "getSubmersionType", at = @At("HEAD"), cancellable = true)
152+
private void injectGetSubmersionType(CallbackInfoReturnable<CameraSubmersionType> cir) {
153+
if (NoRender.INSTANCE.isEnabled() && NoRender.getNoFluidOverlay()) cir.setReturnValue(CameraSubmersionType.NONE);
154+
}
148155
}

src/main/java/com/lambda/mixin/render/ElytraFeatureRendererMixin.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,18 @@
1717

1818
package com.lambda.mixin.render;
1919

20+
import com.lambda.module.modules.render.NoRender;
2021
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
22+
import net.minecraft.client.render.VertexConsumerProvider;
2123
import net.minecraft.client.render.entity.feature.ElytraFeatureRenderer;
2224
import net.minecraft.client.render.entity.state.BipedEntityRenderState;
25+
import net.minecraft.client.util.math.MatrixStack;
2326
import net.minecraft.entity.LivingEntity;
2427
import net.minecraft.util.Identifier;
2528
import org.spongepowered.asm.mixin.Mixin;
2629
import org.spongepowered.asm.mixin.injection.At;
30+
import org.spongepowered.asm.mixin.injection.Inject;
31+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
2732

2833
@Mixin(ElytraFeatureRenderer.class)
2934
public class ElytraFeatureRendererMixin<T extends LivingEntity> {
@@ -40,4 +45,9 @@ private static Identifier getTexture(Identifier original, BipedEntityRenderState
4045

4146
return original;
4247
}
48+
49+
@Inject(method = "render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;ILnet/minecraft/client/render/entity/state/BipedEntityRenderState;FF)V", at = @At("HEAD"), cancellable = true)
50+
private void injectRender(MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i, BipedEntityRenderState bipedEntityRenderState, float f, float g, CallbackInfo ci) {
51+
if (NoRender.INSTANCE.isEnabled()&& NoRender.getNoElytra()) ci.cancel();
52+
}
4353
}

0 commit comments

Comments
 (0)