예제 #1
0
 @Override
 public void drawScreen(int x, int y, float par3) {
   x = applyXOffset(x);
   y = applyYOffset(y);
   if (nbt.getBoolean("canDisplay")) {
     int wheel = Mouse.getDWheel();
     if (wheel != 0) {
       PacketSenders.GPUEvent(x, y, tile, wheel);
     }
     if (isMouseDown) {
       if (x > -1 & y > -1 & x < mon.getWidth() + 1 & y < mon.getHeight() + 1) {
         mx = x;
         my = y;
         if (mlx != mx | mly != my) {
           PacketSenders.mouseEventMove(mx, my, tile);
         }
         mlx = mx;
         mly = my;
       } else {
         mouseMovedOrUp(unapplyXOffset(x) / 2, unapplyYOffset(y) / 2, mouseButton);
       }
     }
   }
   drawWorldBackground(0);
   synchronized (tex) {
     try {
       if (tex.renderLock) {
         tex.wait(1L);
       }
     } catch (InterruptedException e) {
       e.printStackTrace();
     }
   }
   TextureUtil.uploadTexture(
       TabletRenderer.dyntex.getGlTextureId(), tex.rgbCache, 16 * 32, 9 * 32);
   drawTexturedModalRect(unapplyXOffset(0), unapplyYOffset(0), tex.getWidth(), tex.getHeight());
   GL11.glDisable(GL11.GL_TEXTURE_2D);
 }
예제 #2
0
 public int unapplyYOffset(int y) {
   return y + ((height / 4) - tex.getHeight() / 4) * 2;
 }