-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
Showing
8 changed files
with
484 additions
and
145 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ | |
"1.21-fabric", | ||
"1.21.3-forge", | ||
"1.21.3-neoforge", | ||
"1.21.3-fabric" | ||
"1.21.3-fabric", | ||
"1.21.4-fabric" | ||
] | ||
} |
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
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
70 changes: 40 additions & 30 deletions
70
src/main/java/dev/tr7zw/skinlayers/mixin/HttpTextureMixin.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,36 +1,46 @@ | ||
package dev.tr7zw.skinlayers.mixin; | ||
|
||
import java.io.File; | ||
import java.io.FileInputStream; | ||
import java.io.FileNotFoundException; | ||
import java.io.InputStream; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
|
||
import com.mojang.blaze3d.platform.NativeImage; | ||
|
||
import dev.tr7zw.skinlayers.accessor.HttpTextureAccessor; | ||
import net.minecraft.client.renderer.texture.AbstractTexture; | ||
import net.minecraft.client.renderer.texture.HttpTexture; | ||
|
||
@Mixin(HttpTexture.class) | ||
public abstract class HttpTextureMixin extends AbstractTexture implements HttpTextureAccessor { | ||
|
||
@Shadow | ||
private File file; | ||
|
||
@Override | ||
public NativeImage getImage() throws FileNotFoundException { | ||
if (this.file != null && this.file.isFile()) { | ||
FileInputStream fileInputStream = new FileInputStream(this.file); | ||
NativeImage nativeImage = load(fileInputStream); | ||
return nativeImage; | ||
} | ||
return null; | ||
} | ||
|
||
@Shadow | ||
public abstract NativeImage load(InputStream inputStream); | ||
import net.minecraft.client.Minecraft; | ||
|
||
//#if MC >= 12104 | ||
@Mixin(Minecraft.class) | ||
public abstract class HttpTextureMixin { | ||
// Not a thing in 1.21.4+ | ||
} | ||
//#else | ||
//$$import java.io.File; | ||
//$$import java.io.FileInputStream; | ||
//$$import java.io.FileNotFoundException; | ||
//$$import java.io.InputStream; | ||
//$$ | ||
//$$import org.spongepowered.asm.mixin.Shadow; | ||
//$$ | ||
//$$import com.mojang.blaze3d.platform.NativeImage; | ||
//$$ | ||
//$$import dev.tr7zw.skinlayers.accessor.HttpTextureAccessor; | ||
//$$import net.minecraft.client.renderer.texture.AbstractTexture; | ||
//$$import net.minecraft.client.renderer.texture.HttpTexture; | ||
//$$ | ||
//$$@Mixin(HttpTexture.class) | ||
//$$public abstract class HttpTextureMixin extends AbstractTexture implements HttpTextureAccessor { | ||
//$$ | ||
//$$ @Shadow | ||
//$$ private File file; | ||
//$$ | ||
//$$ @Override | ||
//$$ public NativeImage getImage() throws FileNotFoundException { | ||
//$$ if (this.file != null && this.file.isFile()) { | ||
//$$ FileInputStream fileInputStream = new FileInputStream(this.file); | ||
//$$ NativeImage nativeImage = load(fileInputStream); | ||
//$$ return nativeImage; | ||
//$$ } | ||
//$$ return null; | ||
//$$ } | ||
//$$ | ||
//$$ @Shadow | ||
//$$ public abstract NativeImage load(InputStream inputStream); | ||
//$$ | ||
//$$} | ||
//#endif |
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 +1 @@ | ||
1.21.3-fabric | ||
1.21.4-fabric |