Guest User

Untitled

a guest
Nov 3rd, 2014
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.87 KB | None | 0 0
  1. public void initGui() {
  2.     // mc is the minecraft instance initilized within one of my gui's superclasses (GuiScreen).
  3.     // I've replaced a few Minecraft.getMinecraft()s with it, and it seems to make no difference (correct me otherwise).
  4.     int[] imagePixelData = new int[2048];
  5.     GameProfile game = new GameProfile(null, mc.getSession().getUsername());
  6.     Map profmap = mc.func_152342_ad().func_152788_a(game);
  7.     ResourceLocation tex;
  8.     if (profmap.containsKey(Type.SKIN)) {
  9.         tex = mc.func_152342_ad().func_152792_a((MinecraftProfileTexture) profmap.get(Type.SKIN),Type.SKIN);
  10.     } else {
  11.         tex = new ResourceLocation("textures/entity/steve.png"); //this location is within my mod file, works fine
  12.     }
  13.     try {
  14.         imagePixelData = TextureUtil.readImageData(mc.getResourceManager(),tex);
  15.     } catch (IOException e) {
  16.         e.printStackTrace();
  17.     }
  18.     //code handling imagePixelData goes here
  19. }
Advertisement
Add Comment
Please, Sign In to add comment