Пример #1
0
 @Override
 protected void keyTyped(char par1, int par2) {
   super.keyTyped(par1, par2);
   if (par2 > 2 && nbt.getBoolean("canDisplay")) {
     PacketSenders.sendKeyEvent(par1, par2, tile);
   }
 }
Пример #2
0
 @Override
 protected void mouseMovedOrUp(int par1, int par2, int par3) {
   if (!nbt.getBoolean("canDisplay")) return;
   par1 = applyXOffset(par1);
   par2 = applyYOffset(par2);
   if (isMouseDown) {
     if (par3 == mouseButton) {
       isMouseDown = false;
       PacketSenders.mouseEventUp(tile);
     }
   }
 }
Пример #3
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);
 }
Пример #4
0
 @Override
 protected void mouseClicked(int par1, int par2, int par3) {
   if (!nbt.getBoolean("canDisplay")) return;
   par1 = applyXOffset(par1);
   par2 = applyYOffset(par2);
   if (par1 > -1 & par2 > -1 & par1 < mon.getWidth() + 1 & par2 < mon.getHeight() + 1) {
     isMouseDown = true;
     mouseButton = par3;
     mlx = par1;
     mx = par1;
     mly = par2;
     my = par2;
     PacketSenders.mouseEvent(par1, par2, par3, tile);
   }
 }