Skip to content

Commit d590e05

Browse files
committed
fix: Crash with optifine (again)
1 parent e8981e5 commit d590e05

File tree

2 files changed

+22
-17
lines changed

2 files changed

+22
-17
lines changed

src/main/java/com/falsepattern/falsetweaks/mixin/mixins/client/cc/of/ChunkCacheOF_NonShaderMixin.java

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
import net.minecraft.world.IBlockAccess;
3434
import net.minecraft.world.World;
3535

36-
@Mixin(targets = "ChunkCacheOF")
36+
@Mixin(targets = "ChunkCacheOF",
37+
remap = false)
3738
public abstract class ChunkCacheOF_NonShaderMixin extends ChunkCache {
3839
public ChunkCacheOF_NonShaderMixin(World p_i1964_1_,
3940
int p_i1964_2_,
@@ -47,40 +48,41 @@ public ChunkCacheOF_NonShaderMixin(World p_i1964_1_,
4748
}
4849

4950
@Dynamic
50-
@Redirect(method = "getLightBrightnessForSkyBlocks",
51+
@Redirect(method = {"getLightBrightnessForSkyBlocks", "func_72802_i"},
5152
at = @At(value = "INVOKE",
52-
target = "LConfig;isDynamicLights()Z",
53-
remap = false),
53+
target = "LConfig;isDynamicLights()Z"),
5454
expect = 0,
5555
require = 0)
5656
private boolean ftDynamicLights() {
5757
return DynamicLightsDrivers.frontend.enabled();
5858
}
5959

6060
@Dynamic
61-
@Redirect(method = "getLightBrightnessForSkyBlocks",
61+
@Redirect(method = {"getLightBrightnessForSkyBlocks", "func_72802_i"},
6262
at = @At(value = "INVOKE",
63-
target = "LDynamicLights;getCombinedLight(IIII)I",
64-
remap = false),
63+
target = "LDynamicLights;getCombinedLight(IIII)I"),
6564
expect = 0,
6665
require = 0)
6766
private int ftCombinedLights(int x, int y, int z, int combinedLight) {
6867
return DynamicLightsDrivers.frontend.getCombinedLight(x, y, z, combinedLight);
6968
}
7069

7170
@Dynamic
72-
@Redirect(method = "getLightBrightnessForSkyBlocks",
71+
@Redirect(method = {"getLightBrightnessForSkyBlocks", "func_72802_i"},
7372
at = @At(value = "INVOKE",
74-
target = "Lnet/minecraft/world/IBlockAccess;getLightBrightnessForSkyBlocks(IIII)I"),
73+
target = "Lnet/minecraft/world/IBlockAccess;getLightBrightnessForSkyBlocks(IIII)I",
74+
remap = true),
7575
expect = 0,
7676
require = 0)
7777
private int brightnessFromSuper(IBlockAccess instance, int x, int y, int z, int lightValue) {
7878
return super.getLightBrightnessForSkyBlocks(x, y, z, lightValue);
7979
}
8080

81-
@Redirect(method = "getBlock",
81+
@Dynamic
82+
@Redirect(method = {"getBlock", "func_147439_a"},
8283
at = @At(value = "INVOKE",
83-
target = "Lnet/minecraft/world/IBlockAccess;getBlock(III)Lnet/minecraft/block/Block;"),
84+
target = "Lnet/minecraft/world/IBlockAccess;getBlock(III)Lnet/minecraft/block/Block;",
85+
remap = true),
8486
expect = 0,
8587
require = 0)
8688
private Block blockFromSuper(IBlockAccess instance, int x, int y, int z) {

src/main/java/com/falsepattern/falsetweaks/mixin/mixins/client/cc/of/ChunkCacheOF_ShaderMixin.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
package com.falsepattern.falsetweaks.mixin.mixins.client.cc.of;
2424

2525
import com.falsepattern.falsetweaks.modules.dynlights.DynamicLightsDrivers;
26+
import org.spongepowered.asm.mixin.Dynamic;
2627
import org.spongepowered.asm.mixin.Mixin;
2728
import org.spongepowered.asm.mixin.injection.At;
2829
import org.spongepowered.asm.mixin.injection.Redirect;
@@ -32,7 +33,8 @@
3233
import net.minecraft.world.IBlockAccess;
3334
import net.minecraft.world.World;
3435

35-
@Mixin(targets = "ChunkCacheOF")
36+
@Mixin(targets = "ChunkCacheOF",
37+
remap = false)
3638
public abstract class ChunkCacheOF_ShaderMixin extends ChunkCache {
3739
public ChunkCacheOF_ShaderMixin(World p_i1964_1_,
3840
int p_i1964_2_,
@@ -48,7 +50,6 @@ public ChunkCacheOF_ShaderMixin(World p_i1964_1_,
4850
@Redirect(method = "getLightBrightnessForSkyBlocksRaw",
4951
at = @At(value = "INVOKE",
5052
target = "LConfig;isDynamicLights()Z"),
51-
remap = false,
5253
expect = 0,
5354
require = 0)
5455
private boolean ftDynamicLights() {
@@ -58,7 +59,6 @@ private boolean ftDynamicLights() {
5859
@Redirect(method = "getLightBrightnessForSkyBlocksRaw",
5960
at = @At(value = "INVOKE",
6061
target = "LDynamicLights;getCombinedLight(IIII)I"),
61-
remap = false,
6262
expect = 0,
6363
require = 0)
6464
private int ftCombinedLights(int x, int y, int z, int combinedLight) {
@@ -67,16 +67,19 @@ private int ftCombinedLights(int x, int y, int z, int combinedLight) {
6767

6868
@Redirect(method = "getLightBrightnessForSkyBlocksRaw",
6969
at = @At(value = "INVOKE",
70-
target = "Lnet/minecraft/world/IBlockAccess;getLightBrightnessForSkyBlocks(IIII)I"),
70+
target = "Lnet/minecraft/world/IBlockAccess;getLightBrightnessForSkyBlocks(IIII)I",
71+
remap = true),
7172
expect = 0,
7273
require = 0)
7374
private int brightnessFromSuper(IBlockAccess instance, int x, int y, int z, int lightValue) {
7475
return super.getLightBrightnessForSkyBlocks(x, y, z, lightValue);
7576
}
7677

77-
@Redirect(method = "getBlock",
78+
@Dynamic
79+
@Redirect(method = {"getBlock", "func_147439_a"},
7880
at = @At(value = "INVOKE",
79-
target = "Lnet/minecraft/world/IBlockAccess;getBlock(III)Lnet/minecraft/block/Block;"),
81+
target = "Lnet/minecraft/world/IBlockAccess;getBlock(III)Lnet/minecraft/block/Block;",
82+
remap = true),
8083
expect = 0,
8184
require = 0)
8285
private Block blockFromSuper(IBlockAccess instance, int x, int y, int z) {

0 commit comments

Comments
 (0)