예제 #1
0
 @Override
 protected void drawSlotInventory(Slot slot) {
   if (shouldDrawLid(slot)) {
     if (lidXSize != 16) {
       super.drawSlotInventory(slot);
     }
     int x = slot.xDisplayPosition;
     int y = slot.yDisplayPosition;
     Rendering.drawColoredRect(
         x, y, lidXSize, 16, 0xff000000, 101); // zlevel 101 to go above the itemstacks
   } else {
     super.drawSlotInventory(slot);
   }
 }
예제 #2
0
 @Override
 public void updateScreen() {
   super.updateScreen();
   boolean isClosed = container.inventory().isLidClosed();
   if (isClosed != wasClosed) {
     wasClosed = isClosed;
     lidMovement = isClosed ? 1 : -1;
   }
   lidXSize = MathHelper.clamp_int(lidXSize + lidMovement, 0, 16);
 }
예제 #3
0
 @SuppressWarnings("unchecked")
 @Override
 public void initGui() {
   super.initGui();
   if (container.inventory().hasLid()) {
     buttonList.add(new GuiButton(ContainerCamera.BUTTON_TOGGLE_LID, 10, 10, 80, 20, "ToggleLid"));
   }
   if (container.inventory().getType() == CameraType.FILM) {
     buttonList.add(new GuiButton(ContainerCamera.BUTTON_REWIND_FILM, 10, 40, 80, 20, "Rewind"));
   }
 }