forked from IrisShaders/Iris
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request IrisShaders#1096 from IMS212/trunk-loader012
Update to Fabric Loader 0.12.12, use Mixin 0.8.4
- Loading branch information
Showing
4 changed files
with
18 additions
and
34 deletions.
There are no files selected for viewing
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
29 changes: 5 additions & 24 deletions
29
src/main/java/net/coderbot/iris/mixin/texunits/MixinBufferVertexConsumer.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 |
---|---|---|
@@ -1,42 +1,23 @@ | ||
package net.coderbot.iris.mixin.texunits; | ||
|
||
import com.mojang.blaze3d.vertex.BufferVertexConsumer; | ||
import com.mojang.blaze3d.vertex.VertexConsumer; | ||
import net.coderbot.iris.texunits.TextureUnit; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Overwrite; | ||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.api.Environment; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.Constant; | ||
import org.spongepowered.asm.mixin.injection.ModifyConstant; | ||
|
||
@Mixin(BufferVertexConsumer.class) | ||
@Environment(EnvType.CLIENT) | ||
public interface MixinBufferVertexConsumer { | ||
// Note: the below code doesn't work due to https://github.com/FabricMC/Mixin/issues/34 | ||
/*@ModifyConstant(method = "overlay(II)Lnet/minecraft/client/render/VertexConsumer;", constant = @Constant(intValue = 1), require = 1) | ||
@ModifyConstant(method = "overlayCoords", constant = @Constant(intValue = 1), require = 1) | ||
default int iris$fixOverlayIndex(int index) { | ||
return TextureUnit.OVERLAY.getSamplerId(); | ||
} | ||
|
||
@ModifyConstant(method = "light(II)Lnet/minecraft/client/render/VertexConsumer;", constant = @Constant(intValue = 2), require = 1) | ||
@ModifyConstant(method = "uv2", constant = @Constant(intValue = 2), require = 1) | ||
default int iris$fixLightIndex(int index) { | ||
return TextureUnit.LIGHTMAP.getSamplerId(); | ||
}*/ | ||
|
||
/** | ||
* @reason FabricMC Mixin does not support injections into interfaces | ||
* @author coderbot16 | ||
*/ | ||
@Overwrite | ||
default VertexConsumer overlayCoords(int u, int v) { | ||
return ((BufferVertexConsumer) this).uvShort((short) u, (short) v, TextureUnit.OVERLAY.getSamplerId()); | ||
} | ||
|
||
/** | ||
* @reason FabricMC Mixin does not support injections into interfaces | ||
* @author coderbot16 | ||
*/ | ||
@Overwrite | ||
default VertexConsumer uv2(int u, int v) { | ||
return ((BufferVertexConsumer) this).uvShort((short) u, (short) v, TextureUnit.LIGHTMAP.getSamplerId()); | ||
} | ||
} |
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