-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix compatibility with optifine D6 (#205)
- Loading branch information
1 parent
58a33ba
commit 00d9db9
Showing
3 changed files
with
86 additions
and
3 deletions.
There are no files selected for viewing
82 changes: 82 additions & 0 deletions
82
...a/com/falsepattern/falsetweaks/mixin/mixins/client/cc/of/ChunkCacheOF_NonShaderMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/* | ||
* This file is part of FalseTweaks. | ||
* | ||
* Copyright (C) 2022-2024 FalsePattern | ||
* All Rights Reserved | ||
* | ||
* The above copyright notice and this permission notice shall be included | ||
* in all copies or substantial portions of the Software. | ||
* | ||
* FalseTweaks is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* FalseTweaks is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with FalseTweaks. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.falsepattern.falsetweaks.mixin.mixins.client.cc.of; | ||
|
||
import com.falsepattern.falsetweaks.modules.dynlights.DynamicLightsDrivers; | ||
import org.spongepowered.asm.mixin.Dynamic; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
import net.minecraft.block.Block; | ||
import net.minecraft.world.ChunkCache; | ||
import net.minecraft.world.IBlockAccess; | ||
import net.minecraft.world.World; | ||
|
||
@Mixin(targets = "ChunkCacheOF", | ||
remap = false) | ||
public abstract class ChunkCacheOF_NonShaderMixin extends ChunkCache { | ||
public ChunkCacheOF_NonShaderMixin(World p_i1964_1_, int p_i1964_2_, int p_i1964_3_, int p_i1964_4_, int p_i1964_5_, int p_i1964_6_, int p_i1964_7_, int p_i1964_8_) { | ||
super(p_i1964_1_, p_i1964_2_, p_i1964_3_, p_i1964_4_, p_i1964_5_, p_i1964_6_, p_i1964_7_, p_i1964_8_); | ||
} | ||
|
||
@Dynamic | ||
@Redirect(method = "getLightBrightnessForSkyBlocks", | ||
at = @At(value = "INVOKE", | ||
target = "LConfig;isDynamicLights()Z"), | ||
require = 2) | ||
private boolean ftDynamicLights() { | ||
return DynamicLightsDrivers.frontend.enabled(); | ||
} | ||
|
||
@Dynamic | ||
@Redirect(method = "getLightBrightnessForSkyBlocks", | ||
at = @At(value = "INVOKE", | ||
target = "LDynamicLights;getCombinedLight(IIII)I"), | ||
require = 2) | ||
private int ftCombinedLights(int x, int y, int z, int combinedLight) { | ||
return DynamicLightsDrivers.frontend.forWorldMesh().getCombinedLight(x, y, z, combinedLight); | ||
} | ||
|
||
@Dynamic | ||
@Redirect(method = "getLightBrightnessForSkyBlocks", | ||
at = @At(value = "INVOKE", | ||
target = "Lnet/minecraft/world/IBlockAccess;getLightBrightnessForSkyBlocks(IIII)I", | ||
remap = true), | ||
require = 2) | ||
private int brightnessFromSuper(IBlockAccess instance, int x, int y, int z, int lightValue) { | ||
return super.getLightBrightnessForSkyBlocks(x, y, z, lightValue); | ||
} | ||
|
||
@Dynamic | ||
@Redirect(method = "func_147439_a", | ||
at = @At(value = "INVOKE", | ||
target = "Lnet/minecraft/world/IBlockAccess;getBlock(III)Lnet/minecraft/block/Block;", | ||
remap = true), | ||
remap = true, | ||
require = 2) | ||
private Block blockFromSuper(IBlockAccess instance, int x, int y, int z) { | ||
return super.getBlock(x, y, z); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters