|
| 1 | +/* |
| 2 | + * This file is part of FalseTweaks. |
| 3 | + * |
| 4 | + * Copyright (C) 2022-2024 FalsePattern |
| 5 | + * All Rights Reserved |
| 6 | + * |
| 7 | + * The above copyright notice and this permission notice shall be included |
| 8 | + * in all copies or substantial portions of the Software. |
| 9 | + * |
| 10 | + * FalseTweaks is free software: you can redistribute it and/or modify |
| 11 | + * it under the terms of the GNU Lesser General Public License as published by |
| 12 | + * the Free Software Foundation, either version 3 of the License, or |
| 13 | + * (at your option) any later version. |
| 14 | + * |
| 15 | + * FalseTweaks is distributed in the hope that it will be useful, |
| 16 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | + * GNU Lesser General Public License for more details. |
| 19 | + * |
| 20 | + * You should have received a copy of the GNU Lesser General Public License |
| 21 | + * along with FalseTweaks. If not, see <https://www.gnu.org/licenses/>. |
| 22 | + */ |
| 23 | + |
| 24 | +package com.falsepattern.falsetweaks.mixin.mixins.client.threadedupdates.thermalexpansion; |
| 25 | + |
| 26 | +import cofh.thermalexpansion.block.device.BlockDevice; |
| 27 | +import com.falsepattern.falsetweaks.modules.threadedupdates.interop.ThermalExpansionCompat; |
| 28 | +import org.objectweb.asm.Opcodes; |
| 29 | +import org.spongepowered.asm.mixin.Mixin; |
| 30 | +import org.spongepowered.asm.mixin.injection.At; |
| 31 | +import org.spongepowered.asm.mixin.injection.Redirect; |
| 32 | + |
| 33 | +@Mixin(value = BlockDevice.class) |
| 34 | +public abstract class BlockDeviceMixin { |
| 35 | + @Redirect(method = "canRenderInPass", |
| 36 | + at = @At(value = "FIELD", |
| 37 | + opcode = Opcodes.PUTSTATIC, |
| 38 | + target = "Lcofh/core/block/BlockCoFHBase;renderPass:I", |
| 39 | + remap = false), |
| 40 | + remap = false, |
| 41 | + require = 1) |
| 42 | + private void redirectSetRenderPass(int pass) { |
| 43 | + ThermalExpansionCompat.setCofhBlockRenderPass(pass); |
| 44 | + } |
| 45 | + |
| 46 | + @Redirect(method = "getIcon(Lnet/minecraft/world/IBlockAccess;IIII)Lnet/minecraft/util/IIcon;", |
| 47 | + at = @At(value = "FIELD", |
| 48 | + opcode = Opcodes.GETSTATIC, |
| 49 | + target = "Lcofh/core/block/BlockCoFHBase;renderPass:I", |
| 50 | + remap = false), |
| 51 | + require = 1) |
| 52 | + private int redirectGetRenderPass() { |
| 53 | + return ThermalExpansionCompat.getCofhBlockRenderPass(); |
| 54 | + } |
| 55 | +} |
0 commit comments