Guest User

ItemAdvancedFrame

a guest
Jan 22nd, 2015
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. public class ItemAdvancedFrame extends ItemHangingEntity {
  2.  
  3. public ItemAdvancedFrame(Class clazz) {
  4. super(clazz);
  5. }
  6.  
  7. public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_)
  8. {
  9. if (p_77648_7_ == 0)
  10. {
  11. return false;
  12. }
  13. else if (p_77648_7_ == 1)
  14. {
  15. return false;
  16. }
  17. else
  18. {
  19. int i1 = Direction.facingToDirection[p_77648_7_];
  20. EntityHanging entityhanging = new EntityAdvancedFrame(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, i1);
  21.  
  22. if (!p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_))
  23. {
  24. return false;
  25. }
  26. else
  27. {
  28. if (entityhanging != null && entityhanging.onValidSurface())
  29. {
  30. if (!p_77648_3_.isRemote)
  31. {
  32. p_77648_3_.spawnEntityInWorld(entityhanging);
  33. }
  34.  
  35. --p_77648_1_.stackSize;
  36. }
  37.  
  38. return true;
  39. }
  40. }
  41. }
  42.  
  43.  
  44. }
Advertisement
Add Comment
Please, Sign In to add comment