Skip to content

Commit dae4318

Browse files
committed
no world border and no enchanting table book
1 parent 2b4e528 commit dae4318

File tree

3 files changed

+72
-0
lines changed

3 files changed

+72
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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 com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
22+
import net.minecraft.client.render.VertexConsumer;
23+
import net.minecraft.client.render.block.entity.EnchantingTableBlockEntityRenderer;
24+
import net.minecraft.client.render.entity.model.BookModel;
25+
import net.minecraft.client.util.math.MatrixStack;
26+
import org.spongepowered.asm.mixin.Mixin;
27+
import org.spongepowered.asm.mixin.injection.At;
28+
29+
@Mixin(EnchantingTableBlockEntityRenderer.class)
30+
public class EnchantingTableBlockEntityRendererMixin {
31+
@WrapWithCondition(method = "render(Lnet/minecraft/block/entity/EnchantingTableBlockEntity;FLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;IILnet/minecraft/util/math/Vec3d;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/entity/model/BookModel;render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;II)V"))
32+
private boolean wrapRender(BookModel instance, MatrixStack matrixStack, VertexConsumer vertexConsumer, int i, int j) {
33+
return NoRender.INSTANCE.isDisabled() || !NoRender.getNoEnchantingTableBook();
34+
}
35+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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.WorldBorderRendering;
22+
import net.minecraft.util.math.Vec3d;
23+
import net.minecraft.world.border.WorldBorder;
24+
import org.spongepowered.asm.mixin.Mixin;
25+
import org.spongepowered.asm.mixin.injection.At;
26+
import org.spongepowered.asm.mixin.injection.Inject;
27+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
28+
29+
@Mixin(WorldBorderRendering.class)
30+
public class WorldBorderRenderingMixin {
31+
@Inject(method = "render", at = @At("HEAD"), cancellable = true)
32+
private void injectRender(WorldBorder border, Vec3d cameraPos, double viewDistanceBlocks, double farPlaneDistance, CallbackInfo ci) {
33+
if (NoRender.INSTANCE.isEnabled() && NoRender.getNoWorldBorder()) ci.cancel();
34+
}
35+
}

src/main/resources/lambda.mixins.common.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"render.DebugHudMixin",
4040
"render.DebugRendererMixin",
4141
"render.ElytraFeatureRendererMixin",
42+
"render.EnchantingTableBlockEntityRendererMixin",
4243
"render.EntityRendererMixin",
4344
"render.GameRendererMixin",
4445
"render.GlStateManagerMixin",
@@ -55,6 +56,7 @@
5556
"render.SplashOverlayMixin",
5657
"render.SplashOverlayMixin$LogoTextureMixin",
5758
"render.TooltipComponentMixin",
59+
"render.WorldBorderRenderingMixin",
5860
"render.WorldRendererMixin",
5961
"world.BlockCollisionSpliteratorMixin",
6062
"world.ClientChunkManagerMixin",

0 commit comments

Comments
 (0)