Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void initGui() {
- // mc is the minecraft instance initilized within one of my gui's superclasses (GuiScreen).
- // I've replaced a few Minecraft.getMinecraft()s with it, and it seems to make no difference (correct me otherwise).
- int[] imagePixelData = new int[2048];
- GameProfile game = new GameProfile(null, mc.getSession().getUsername());
- Map profmap = mc.func_152342_ad().func_152788_a(game);
- ResourceLocation tex;
- if (profmap.containsKey(Type.SKIN)) {
- tex = mc.func_152342_ad().func_152792_a((MinecraftProfileTexture) profmap.get(Type.SKIN),Type.SKIN);
- } else {
- tex = new ResourceLocation("textures/entity/steve.png"); //this location is within my mod file, works fine
- }
- try {
- imagePixelData = TextureUtil.readImageData(mc.getResourceManager(),tex);
- } catch (IOException e) {
- e.printStackTrace();
- }
- //code handling imagePixelData goes here
- }
Advertisement
Add Comment
Please, Sign In to add comment