|
| 1 | +/* |
| 2 | + * Copyright © 2021-2022 moehreag <[email protected]> & Contributors |
| 3 | + * |
| 4 | + * This file is part of AxolotlClient. |
| 5 | + * |
| 6 | + * This program is free software; you can redistribute it and/or |
| 7 | + * modify it under the terms of the GNU Lesser General Public |
| 8 | + * License as published by the Free Software Foundation; either |
| 9 | + * version 3 of the License, or (at your option) any later version. |
| 10 | + * |
| 11 | + * This program is distributed in the hope that it will be useful, |
| 12 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | + * Lesser General Public License for more details. |
| 15 | + * |
| 16 | + * You should have received a copy of the GNU Lesser General Public License |
| 17 | + * along with this program; if not, write to the Free Software Foundation, |
| 18 | + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 19 | + * |
| 20 | + * For more information, see the LICENSE file. |
| 21 | + */ |
| 22 | + |
| 23 | +package io.github.axolotlclient.mixin; |
| 24 | + |
| 25 | +import io.github.axolotlclient.modules.renderOptions.BeaconBeam; |
| 26 | +import net.minecraft.block.entity.BeaconBlockEntity; |
| 27 | +import net.minecraft.client.render.block.entity.BeaconBlockEntityRenderer; |
| 28 | +import org.spongepowered.asm.mixin.Mixin; |
| 29 | +import org.spongepowered.asm.mixin.injection.At; |
| 30 | +import org.spongepowered.asm.mixin.injection.Inject; |
| 31 | +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; |
| 32 | + |
| 33 | +@Mixin(BeaconBlockEntityRenderer.class) |
| 34 | +public abstract class BeaconBlockEntityRendererMixin { |
| 35 | + |
| 36 | + @Inject(method = "render(Lnet/minecraft/block/entity/BeaconBlockEntity;DDDFI)V", at = @At("HEAD"), cancellable = true) |
| 37 | + private void cancelBeamRendering(BeaconBlockEntity beaconBlockEntity, double d, double e, double f, float g, int i, CallbackInfo ci) { |
| 38 | + if(!BeaconBeam.getInstance().showBeam()) { |
| 39 | + ci.cancel(); |
| 40 | + } |
| 41 | + } |
| 42 | +} |
0 commit comments