Regions.

Discussion in 'Spigot Plugin Development' started by matheus9171, Jul 9, 2015.

  1. Ok, how i can make a check to not lag the server Like world guard when a player enter a region like.

    I can save the cass on a arrayList and loop´to get the right one like;
    Exaple:



    ArrayList<AreaLayout> areas.

    and the class areaLayout:
    public static class ....

    String areaName;
    Location botton;
    Location top;


    Now i want to check if a player gets in on move, like

    @EventHandler
    public void onMove(PlayerMoveEvent e){

    Player p .....

    for(ArenaLayout al : arenas)
    {
    //do the checks (This is the correct method to do? or have any other one that will have less lag?)
    }


    }
     
  2. One way to make it so it would cause less lag would be to see if the to location isn't the same as the from location (Don't forget pitch and yaw are included in the location)
     
  3. Aready using it, i'm using when the player change the block..