2025-11-24 22:52:51 +03:00

39 lines
1.1 KiB
Java

/*
* Decompiled with CFR 0.152.
*/
package net.minecraft.client.resources;
import com.mojang.blaze3d.platform.NativeImage;
import java.io.IOException;
import java.io.InputStream;
import net.minecraft.resources.Identifier;
import net.minecraft.server.packs.resources.ResourceManager;
public class LegacyStuffWrapper {
@Deprecated
public static int[] getPixels(ResourceManager resourceManager, Identifier location) throws IOException {
try (InputStream resource = resourceManager.open(location);){
NativeImage image = NativeImage.read(resource);
try {
int[] nArray = image.makePixelArray();
if (image != null) {
image.close();
}
return nArray;
}
catch (Throwable throwable) {
if (image != null) {
try {
image.close();
}
catch (Throwable throwable2) {
throwable.addSuppressed(throwable2);
}
}
throw throwable;
}
}
}
}