Skip to content

Commit bffda8d

Browse files
committed
fix ChunkCacheOF mixin mappings
1 parent f15d2ea commit bffda8d

2 files changed

Lines changed: 64 additions & 18 deletions

File tree

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

Lines changed: 43 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ public ChunkCacheOF_NonShaderMixin(World p_i1964_1_, int p_i1964_2_, int p_i1964
4444
@Dynamic
4545
@Redirect(method = "getLightBrightnessForSkyBlocks",
4646
at = @At(value = "INVOKE",
47-
target = "LConfig;isDynamicLights()Z"),
47+
target = "LConfig;isDynamicLights()Z",
48+
remap = false),
4849
require = 2)
4950
private boolean ftDynamicLights() {
5051
return DynamicLightsDrivers.frontend.enabled();
@@ -54,29 +55,61 @@ private boolean ftDynamicLights() {
5455
@Redirect(method = "getLightBrightnessForSkyBlocks",
5556
at = @At(value = "INVOKE",
5657
target = "LDynamicLights;getCombinedLight(IIII)I"),
57-
require = 2)
58-
private int ftCombinedLights(int x, int y, int z, int combinedLight) {
58+
expect = 0,
59+
require = 0)
60+
private int ftCombinedLightsDev(int x, int y, int z, int combinedLight) {
61+
return DynamicLightsDrivers.frontend.forWorldMesh().getCombinedLight(x, y, z, combinedLight);
62+
}
63+
64+
@Dynamic
65+
@Redirect(method = "func_72802_i",
66+
at = @At(value = "INVOKE",
67+
target = "LDynamicLights;getCombinedLight(IIII)I"),
68+
expect = 0,
69+
require = 0)
70+
private int ftCombinedLightsObf(int x, int y, int z, int combinedLight) {
5971
return DynamicLightsDrivers.frontend.forWorldMesh().getCombinedLight(x, y, z, combinedLight);
6072
}
6173

6274
@Dynamic
6375
@Redirect(method = "getLightBrightnessForSkyBlocks",
6476
at = @At(value = "INVOKE",
65-
target = "Lnet/minecraft/world/IBlockAccess;getLightBrightnessForSkyBlocks(IIII)I",
66-
remap = true),
67-
require = 2)
68-
private int brightnessFromSuper(IBlockAccess instance, int x, int y, int z, int lightValue) {
77+
target = "Lnet/minecraft/world/IBlockAccess;getLightBrightnessForSkyBlocks(IIII)I"),
78+
expect = 0,
79+
require = 0)
80+
private int brightnessFromSuperDev(IBlockAccess instance, int x, int y, int z, int lightValue) {
81+
return super.getLightBrightnessForSkyBlocks(x, y, z, lightValue);
82+
}
83+
84+
@Dynamic
85+
@Redirect(method = "func_72802_i",
86+
at = @At(value = "INVOKE",
87+
target = "Lnet/minecraft/world/IBlockAccess;getLightBrightnessForSkyBlocks(IIII)I"),
88+
expect = 0,
89+
require = 0)
90+
private int brightnessFromSuperObf(IBlockAccess instance, int x, int y, int z, int lightValue) {
6991
return super.getLightBrightnessForSkyBlocks(x, y, z, lightValue);
7092
}
7193

94+
@Dynamic
95+
@Redirect(method = "getBlock",
96+
at = @At(value = "INVOKE",
97+
target = "Lnet/minecraft/world/IBlockAccess;getBlock(III)Lnet/minecraft/block/Block;",
98+
remap = true),
99+
expect = 0,
100+
require = 0)
101+
private Block blockFromSuperDev(IBlockAccess instance, int x, int y, int z) {
102+
return super.getBlock(x, y, z);
103+
}
104+
72105
@Dynamic
73106
@Redirect(method = "func_147439_a",
74107
at = @At(value = "INVOKE",
75108
target = "Lnet/minecraft/world/IBlockAccess;getBlock(III)Lnet/minecraft/block/Block;",
76109
remap = true),
77-
remap = true,
78-
require = 2)
79-
private Block blockFromSuper(IBlockAccess instance, int x, int y, int z) {
110+
expect = 0,
111+
require = 0)
112+
private Block blockFromSuperObf(IBlockAccess instance, int x, int y, int z) {
80113
return super.getBlock(x, y, z);
81114
}
82115
}

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

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,18 @@ public ChunkCacheOF_ShaderMixin(World p_i1964_1_, int p_i1964_2_, int p_i1964_3_
4444
@Redirect(method = "getLightBrightnessForSkyBlocksRaw",
4545
at = @At(value = "INVOKE",
4646
target = "LConfig;isDynamicLights()Z"),
47-
require = 1)
47+
expect = 0,
48+
require = 0)
4849
private boolean ftDynamicLights() {
4950
return DynamicLightsDrivers.frontend.enabled();
5051
}
5152

5253
@Redirect(method = "getLightBrightnessForSkyBlocksRaw",
5354
at = @At(value = "INVOKE",
5455
target = "LDynamicLights;getCombinedLight(IIII)I"),
55-
require = 1)
56+
remap = false,
57+
expect = 0,
58+
require = 0)
5659
private int ftCombinedLights(int x, int y, int z, int combinedLight) {
5760
return DynamicLightsDrivers.frontend.forWorldMesh().getCombinedLight(x, y, z, combinedLight);
5861
}
@@ -61,19 +64,29 @@ private int ftCombinedLights(int x, int y, int z, int combinedLight) {
6164
at = @At(value = "INVOKE",
6265
target = "Lnet/minecraft/world/IBlockAccess;getLightBrightnessForSkyBlocks(IIII)I",
6366
remap = true),
64-
require = 1)
67+
expect = 0,
68+
require = 0)
6569
private int brightnessFromSuper(IBlockAccess instance, int x, int y, int z, int lightValue) {
6670
return super.getLightBrightnessForSkyBlocks(x, y, z, lightValue);
6771
}
6872

73+
@Dynamic
74+
@Redirect(method = "getBlock",
75+
at = @At(value = "INVOKE",
76+
target = "Lnet/minecraft/world/IBlockAccess;getBlock(III)Lnet/minecraft/block/Block;"),
77+
expect = 0,
78+
require = 0)
79+
private Block blockFromSuperDev(IBlockAccess instance, int x, int y, int z) {
80+
return super.getBlock(x, y, z);
81+
}
82+
6983
@Dynamic
7084
@Redirect(method = "func_147439_a",
7185
at = @At(value = "INVOKE",
72-
target = "Lnet/minecraft/world/IBlockAccess;getBlock(III)Lnet/minecraft/block/Block;",
73-
remap = true),
74-
remap = true,
75-
require = 3)
76-
private Block blockFromSuper(IBlockAccess instance, int x, int y, int z) {
86+
target = "Lnet/minecraft/world/IBlockAccess;getBlock(III)Lnet/minecraft/block/Block;"),
87+
expect = 0,
88+
require = 0)
89+
private Block blockFromSuperObf(IBlockAccess instance, int x, int y, int z) {
7790
return super.getBlock(x, y, z);
7891
}
7992
}

0 commit comments

Comments
 (0)