Advertisement
Guest User

Untitled

a guest
Jul 25th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. public ItemStack onItemRightClick(ItemStack is, World world, EntityPlayer ep)
  2. {
  3.  
  4. if(util.getString(is, "Type", "null") == "Teleport"){
  5.  
  6. if(ep.isSneaking()){
  7.  
  8. util.setDouble(is, "X", ep.posX);
  9. util.setDouble(is, "Y", ep.posY);
  10. util.setDouble(is, "Z", ep.posZ);
  11.  
  12. util.setInt(is, "Dim", ep.dimension);
  13.  
  14. util.setBoolean(is, "HasCoords", true);
  15. }
  16. else if(util.getBoolean(is, "HasCoords", false)){
  17.  
  18. if(ep.dimension != util.getInt(is, "Dim", 0)){
  19. ep.travelToDimension(util.getInt(is, "Dim", 0));
  20. }
  21.  
  22. ep.setPosition(util.getDouble(is, "X", 0), util.getDouble(is, "Y", 0), util.getDouble(is, "Z", 0));
  23.  
  24. }
  25.  
  26. }
  27.  
  28. return is;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement