LegacyStuffWrapper .java

net.minecraft.client.resources.LegacyStuffWrapper (class, 23 lines): members: getPixels. imports: NativeImage, ResourceManager, Identifier, EnvType.

net.minecraft.client.resourcesclass23 linesclient680 B

API Surface (1)

int[] getPixels(final ResourceManager resourceManager, final Identifier location)

Code Graph: Dependencies (3)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

LegacyStuffWrapper.java23 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.client.resources;
2
3
import com.mojang.blaze3d.platform.NativeImage;
4
import java.io.IOException;
5
import java.io.InputStream;
6
import net.fabricmc.api.EnvType;
7
import net.fabricmc.api.Environment;
8
import net.minecraft.resources.Identifier;
9
import net.minecraft.server.packs.resources.ResourceManager;
10
11
@Environment(EnvType.CLIENT)
12
public class LegacyStuffWrapper {
13
	@Deprecated
14
	public static int[] getPixels(final ResourceManager resourceManager, final Identifier location) throws IOException {
15
		try (
16
			InputStream resource = resourceManager.open(location);
17
			NativeImage image = NativeImage.read(resource);
18
		) {
19
			return image.makePixelArray();
20
		}
21
	}
22
}
23

Decompiled Minecraft 26.3 source of LegacyStuffWrapper (net/minecraft/client/resources/LegacyStuffWrapper.java) with Mojang official mappings, stored verbatim on the site.