Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void PlayerMove(PlayerMoveEvent event){
- Player player = event.getPlayer();
- Location loc = player.getLocation();
- Integer x = loc.getBlockX();
- Integer z = loc.getBlockZ();
- for(int i = 0; i < storage.regions.size();) {
- Region reg = storage.getRegion( i );
- int x1 = reg.loc1.getBlockX();
- int z1 = reg.loc1.getBlockZ();
- int x2 = reg.loc2.getBlockX();
- int z2 = reg.loc2.getBlockZ();
- if (x>x1 && x < x2 && z > z1 && z < z2){
- player.sendMessage(reg.name);
- }
- i ++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement