|
| 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.MobSpawnerBlockEntity; |
| 22 | +import net.minecraft.client.render.VertexConsumerProvider; |
| 23 | +import net.minecraft.client.render.block.entity.MobSpawnerBlockEntityRenderer; |
| 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(MobSpawnerBlockEntityRenderer.class) |
| 32 | +public class MobSpawnerBlockEntityRendererMixin { |
| 33 | + @Inject(method = "render(Lnet/minecraft/block/entity/MobSpawnerBlockEntity;FLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;IILnet/minecraft/util/math/Vec3d;)V", at = @At("HEAD"), cancellable = true) |
| 34 | + private void injectRender(MobSpawnerBlockEntity mobSpawnerBlockEntity, float f, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i, int j, Vec3d vec3d, CallbackInfo ci) { |
| 35 | + if (NoRender.INSTANCE.isEnabled() && NoRender.getNoSpawnerMob()) ci.cancel(); |
| 36 | + } |
| 37 | +} |
0 commit comments