Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. public static Boolean isOnGuildRegion(World w, int x, int z)
  2. {
  3. boolean a = false;
  4. for(Guild g : GuildUtils.guilds.values())
  5. {
  6. if(g.getSector().equals(LocalData.sector))
  7. {
  8. Location loc1 = new Location(w, g.getCenterX()-(g.getSize()/2), g.getCenterY(), g.getCenterZ()-(g.getSize()/2));
  9. Location loc2 = new Location(w, g.getCenterX()+(g.getSize()/2), g.getCenterY(), g.getCenterZ()-(g.getSize()/2));
  10. Location loc3 = new Location(w, g.getCenterX()-(g.getSize()/2), g.getCenterY(), g.getCenterZ()+(g.getSize()/2));
  11. Location loc4 = new Location(w, g.getCenterX()+(g.getSize()/2), g.getCenterY(), g.getCenterZ()+(g.getSize()/2));
  12.  
  13. if(z>loc1.getBlockZ() && x>loc1.getBlockX()
  14. && z>loc2.getBlockZ() && x<loc2.getBlockX()
  15. && z<loc3.getBlockZ() && x>loc3.getBlockX()
  16. && z<loc4.getBlockZ() && x<loc4.getBlockX())
  17. {
  18. return true;
  19. }
  20. }
  21. }
  22. return a;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement