Guest User

Untitled

a guest
Jan 22nd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. package net.minecraft.src;
  2.  
  3. public class GuiBuying extends GuiScreen {
  4.  
  5. public GuiBuying() {
  6. }
  7.  
  8. public void initGui() {
  9. controlList.clear();
  10. controlList.add(new GuiButton(0, 135, 60, 70, 20, (new StringBuilder()).append("Red Apple").toString()));
  11. }
  12. protected void actionPerformed(GuiButton guibutton, EntityPlayer entityplayer, World world, int i, int j, int k)
  13. {
  14. if(guibutton.id == 0)
  15. {
  16.  
  17. if(entityplayer.inventory.consumeInventoryItem(Item.appleRed.shiftedIndex)){
  18. world.entityJoinedWorld(new EntityItem(world, entityplayer.posX, entityplayer.posZ, entityplayer.posY, new ItemStack(Item.appleRed)));
  19. }
  20.  
  21. }
  22. }
  23. public boolean doesGuiPauseGame()
  24. {
  25. return false;
  26. }
  27. public void onGuiClosed()
  28. {
  29. }
  30. public void drawScreen(int i, int j, float f)
  31. {
  32. drawDefaultBackground();
  33. int k = (width - 176) / 2;
  34. int l = (height - 166) / 2;
  35. drawCenteredString(fontRenderer, "What do you want?", width / 2, 45, 0xffffff);
  36. super.drawScreen(i, j, f);
  37. }
  38. }
Add Comment
Please, Sign In to add comment