-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
26cf4c7
commit bdb473a
Showing
3 changed files
with
52 additions
and
2 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
50 changes: 50 additions & 0 deletions
50
src/main/java/com/gtnewhorizons/angelica/mixins/early/renderer/MixinSimpleTexture.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,50 @@ | ||
package com.gtnewhorizons.angelica.mixins.early.renderer; | ||
|
||
import java.awt.image.BufferedImage; | ||
|
||
import net.minecraft.client.renderer.texture.AbstractTexture; | ||
import net.minecraft.client.renderer.texture.SimpleTexture; | ||
import net.minecraft.client.resources.IResourceManager; | ||
import net.minecraft.util.ResourceLocation; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
import com.gtnewhorizons.angelica.client.ShadersTex; | ||
|
||
@Mixin(value = SimpleTexture.class) | ||
public class MixinSimpleTexture extends AbstractTexture { | ||
|
||
private IResourceManager passedResourceManager; | ||
@Shadow | ||
protected ResourceLocation textureLocation; | ||
|
||
@Inject(method = "loadTexture(Lnet/minecraft/client/resources/IResourceManager;)V", at = @At("HEAD")) | ||
private void getResourceManager(IResourceManager p_110551_1_, CallbackInfo cbi) { | ||
passedResourceManager = p_110551_1_; | ||
} | ||
|
||
@Redirect( | ||
method = "loadTexture(Lnet/minecraft/client/resources/IResourceManager;)V", | ||
at = @At( | ||
value = "INVOKE", | ||
target = "Lnet/minecraft/client/renderer/texture/TextureUtil;uploadTextureImageAllocate(ILjava/awt/image/BufferedImage;ZZ)I", | ||
remap = false)) | ||
private int angelica$loadTexture(int textureID, BufferedImage bufferedImage, boolean flag, boolean flag1) { | ||
|
||
ShadersTex.loadSimpleTexture( | ||
textureID, | ||
bufferedImage, | ||
flag, | ||
flag1, | ||
passedResourceManager, | ||
this.textureLocation, | ||
ShadersTex.getMultiTexID(this)); | ||
return 0; | ||
} | ||
|
||
} |
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