Advertisement
Gamebuster

ItemButton.class

Nov 23rd, 2016
444
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.71 KB | None | 0 0
  1.     //TODO: temporary inner class, remove later [TEST]
  2.     private final class ItemButton extends GuiButton{
  3.         private ItemStack item;
  4.        
  5.         public ItemButton(int buttonId, int x, int y, String buttonText, ItemStack i) {
  6.             super(buttonId, x, y, 16, 16, buttonText);
  7.             item = new ItemStack(i.getItem(), 1, i.getMetadata());
  8.         }
  9.        
  10.         @Override
  11.         public void drawButton(Minecraft mc, int mouseX, int mouseY){
  12.             if (item != null && item.getItem() != null){
  13.                 drawItem();
  14.             }
  15.         }
  16.        
  17.         private void drawItem(){
  18.             itemRender.renderItemOverlayIntoGUI(fontRendererObj, item, this.xPosition, this.yPosition, "This is a particularly interesting test.");
  19.         }
  20.        
  21.         public ItemStack getItemStack(){
  22.             return item;
  23.         }
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement