Skip to content

Commit 254ce30

Browse files
committed
fix: broken optifine chunkcache remappings
1 parent d4d6eeb commit 254ce30

File tree

2 files changed

+13
-58
lines changed

2 files changed

+13
-58
lines changed

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

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

36-
@Mixin(targets = "ChunkCacheOF",
37-
remap = false)
36+
@Mixin(targets = "ChunkCacheOF")
3837
public abstract class ChunkCacheOF_NonShaderMixin extends ChunkCache {
3938
public ChunkCacheOF_NonShaderMixin(World p_i1964_1_,
4039
int p_i1964_2_,
@@ -52,28 +51,20 @@ public ChunkCacheOF_NonShaderMixin(World p_i1964_1_,
5251
at = @At(value = "INVOKE",
5352
target = "LConfig;isDynamicLights()Z",
5453
remap = false),
55-
require = 2)
54+
expect = 0,
55+
require = 0)
5656
private boolean ftDynamicLights() {
5757
return DynamicLightsDrivers.frontend.enabled();
5858
}
5959

6060
@Dynamic
6161
@Redirect(method = "getLightBrightnessForSkyBlocks",
6262
at = @At(value = "INVOKE",
63-
target = "LDynamicLights;getCombinedLight(IIII)I"),
64-
expect = 0,
65-
require = 0)
66-
private int ftCombinedLightsDev(int x, int y, int z, int combinedLight) {
67-
return DynamicLightsDrivers.frontend.getCombinedLight(x, y, z, combinedLight);
68-
}
69-
70-
@Dynamic
71-
@Redirect(method = "func_72802_i",
72-
at = @At(value = "INVOKE",
73-
target = "LDynamicLights;getCombinedLight(IIII)I"),
63+
target = "LDynamicLights;getCombinedLight(IIII)I",
64+
remap = false),
7465
expect = 0,
7566
require = 0)
76-
private int ftCombinedLightsObf(int x, int y, int z, int combinedLight) {
67+
private int ftCombinedLights(int x, int y, int z, int combinedLight) {
7768
return DynamicLightsDrivers.frontend.getCombinedLight(x, y, z, combinedLight);
7869
}
7970

@@ -83,39 +74,16 @@ private int ftCombinedLightsObf(int x, int y, int z, int combinedLight) {
8374
target = "Lnet/minecraft/world/IBlockAccess;getLightBrightnessForSkyBlocks(IIII)I"),
8475
expect = 0,
8576
require = 0)
86-
private int brightnessFromSuperDev(IBlockAccess instance, int x, int y, int z, int lightValue) {
87-
return super.getLightBrightnessForSkyBlocks(x, y, z, lightValue);
88-
}
89-
90-
@Dynamic
91-
@Redirect(method = "func_72802_i",
92-
at = @At(value = "INVOKE",
93-
target = "Lnet/minecraft/world/IBlockAccess;getLightBrightnessForSkyBlocks(IIII)I"),
94-
expect = 0,
95-
require = 0)
96-
private int brightnessFromSuperObf(IBlockAccess instance, int x, int y, int z, int lightValue) {
77+
private int brightnessFromSuper(IBlockAccess instance, int x, int y, int z, int lightValue) {
9778
return super.getLightBrightnessForSkyBlocks(x, y, z, lightValue);
9879
}
9980

100-
@Dynamic
10181
@Redirect(method = "getBlock",
10282
at = @At(value = "INVOKE",
103-
target = "Lnet/minecraft/world/IBlockAccess;getBlock(III)Lnet/minecraft/block/Block;",
104-
remap = true),
105-
expect = 0,
106-
require = 0)
107-
private Block blockFromSuperDev(IBlockAccess instance, int x, int y, int z) {
108-
return super.getBlock(x, y, z);
109-
}
110-
111-
@Dynamic
112-
@Redirect(method = "func_147439_a",
113-
at = @At(value = "INVOKE",
114-
target = "Lnet/minecraft/world/IBlockAccess;getBlock(III)Lnet/minecraft/block/Block;",
115-
remap = true),
83+
target = "Lnet/minecraft/world/IBlockAccess;getBlock(III)Lnet/minecraft/block/Block;"),
11684
expect = 0,
11785
require = 0)
118-
private Block blockFromSuperObf(IBlockAccess instance, int x, int y, int z) {
86+
private Block blockFromSuper(IBlockAccess instance, int x, int y, int z) {
11987
return super.getBlock(x, y, z);
12088
}
12189
}

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

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
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;
2726
import org.spongepowered.asm.mixin.Mixin;
2827
import org.spongepowered.asm.mixin.injection.At;
2928
import org.spongepowered.asm.mixin.injection.Redirect;
@@ -33,8 +32,7 @@
3332
import net.minecraft.world.IBlockAccess;
3433
import net.minecraft.world.World;
3534

36-
@Mixin(targets = "ChunkCacheOF",
37-
remap = false)
35+
@Mixin(targets = "ChunkCacheOF")
3836
public abstract class ChunkCacheOF_ShaderMixin extends ChunkCache {
3937
public ChunkCacheOF_ShaderMixin(World p_i1964_1_,
4038
int p_i1964_2_,
@@ -50,6 +48,7 @@ public ChunkCacheOF_ShaderMixin(World p_i1964_1_,
5048
@Redirect(method = "getLightBrightnessForSkyBlocksRaw",
5149
at = @At(value = "INVOKE",
5250
target = "LConfig;isDynamicLights()Z"),
51+
remap = false,
5352
expect = 0,
5453
require = 0)
5554
private boolean ftDynamicLights() {
@@ -68,31 +67,19 @@ private int ftCombinedLights(int x, int y, int z, int combinedLight) {
6867

6968
@Redirect(method = "getLightBrightnessForSkyBlocksRaw",
7069
at = @At(value = "INVOKE",
71-
target = "Lnet/minecraft/world/IBlockAccess;getLightBrightnessForSkyBlocks(IIII)I",
72-
remap = true),
70+
target = "Lnet/minecraft/world/IBlockAccess;getLightBrightnessForSkyBlocks(IIII)I"),
7371
expect = 0,
7472
require = 0)
7573
private int brightnessFromSuper(IBlockAccess instance, int x, int y, int z, int lightValue) {
7674
return super.getLightBrightnessForSkyBlocks(x, y, z, lightValue);
7775
}
7876

79-
@Dynamic
8077
@Redirect(method = "getBlock",
8178
at = @At(value = "INVOKE",
8279
target = "Lnet/minecraft/world/IBlockAccess;getBlock(III)Lnet/minecraft/block/Block;"),
8380
expect = 0,
8481
require = 0)
85-
private Block blockFromSuperDev(IBlockAccess instance, int x, int y, int z) {
86-
return super.getBlock(x, y, z);
87-
}
88-
89-
@Dynamic
90-
@Redirect(method = "func_147439_a",
91-
at = @At(value = "INVOKE",
92-
target = "Lnet/minecraft/world/IBlockAccess;getBlock(III)Lnet/minecraft/block/Block;"),
93-
expect = 0,
94-
require = 0)
95-
private Block blockFromSuperObf(IBlockAccess instance, int x, int y, int z) {
82+
private Block blockFromSuper(IBlockAccess instance, int x, int y, int z) {
9683
return super.getBlock(x, y, z);
9784
}
9885
}

0 commit comments

Comments
 (0)