Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Boolean isOnGuildRegion(World w, int x, int z)
- {
- boolean a = false;
- for(Guild g : GuildUtils.guilds.values())
- {
- if(g.getSector().equals(LocalData.sector))
- {
- Location loc1 = new Location(w, g.getCenterX()-(g.getSize()/2), g.getCenterY(), g.getCenterZ()-(g.getSize()/2));
- Location loc2 = new Location(w, g.getCenterX()+(g.getSize()/2), g.getCenterY(), g.getCenterZ()-(g.getSize()/2));
- Location loc3 = new Location(w, g.getCenterX()-(g.getSize()/2), g.getCenterY(), g.getCenterZ()+(g.getSize()/2));
- Location loc4 = new Location(w, g.getCenterX()+(g.getSize()/2), g.getCenterY(), g.getCenterZ()+(g.getSize()/2));
- if(z>loc1.getBlockZ() && x>loc1.getBlockX()
- && z>loc2.getBlockZ() && x<loc2.getBlockX()
- && z<loc3.getBlockZ() && x>loc3.getBlockX()
- && z<loc4.getBlockZ() && x<loc4.getBlockX())
- {
- return true;
- }
- }
- }
- return a;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement