Fixed Bug in TextureAtlasMixin
This commit is contained in:
parent
cb7d8cf53d
commit
c7117fa180
1 changed files with 5 additions and 6 deletions
|
@ -17,6 +17,7 @@ import ru.bclib.BCLib;
|
||||||
import ru.bclib.client.render.EmissiveTextureInfo;
|
import ru.bclib.client.render.EmissiveTextureInfo;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
@Mixin(TextureAtlas.class)
|
@Mixin(TextureAtlas.class)
|
||||||
|
@ -54,16 +55,14 @@ public class TextureAtlasMixin {
|
||||||
NativeImage emission = null;
|
NativeImage emission = null;
|
||||||
try {
|
try {
|
||||||
ResourceLocation spriteLocation = new ResourceLocation(
|
ResourceLocation spriteLocation = new ResourceLocation(
|
||||||
location.getNamespace(),
|
location.getNamespace(),
|
||||||
"textures/" + location.getPath() + ".png"
|
"textures/" + location.getPath() + ".png"
|
||||||
);
|
);
|
||||||
Resource resource = resourceManager.getResource(spriteLocation).orElse(null);
|
Resource resource = resourceManager.getResource(spriteLocation).orElse(null);
|
||||||
sprite = NativeImage.read(resource.open());
|
sprite = NativeImage.read( resource.open());
|
||||||
sprite.close();
|
|
||||||
|
|
||||||
resource = emissiveRes.get();
|
resource = emissiveRes.get();
|
||||||
emission = NativeImage.read(resource.open());
|
emission = NativeImage.read( resource.open());
|
||||||
emission.close();
|
|
||||||
}
|
}
|
||||||
catch (IOException e) {
|
catch (IOException e) {
|
||||||
BCLib.LOGGER.warning(e.getMessage());
|
BCLib.LOGGER.warning(e.getMessage());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue