Beispiel #1
0
        private void updateDoorForPlayers(Door door)
        {
            int      id         = door.isDoorOpen() ? door.getClosedDoorId() : door.getOpenDoorId();
            Location loc        = door.isDoorOpen() ? door.getClosedDoorLocation() : door.getOpenDoorLocation();
            int      direction  = door.isDoorOpen() ? door.getClosedDirection() : door.getOpenDirection();
            Location loc1       = door.isDoorOpen() ? door.getOpenDoorLocation() : door.getClosedDoorLocation();
            int      direction1 = door.isDoorOpen() ? door.getOpenDirection() : door.getClosedDirection();

            foreach (Player p in Server.getPlayerList())
            {
                if (p != null)
                {
                    if (p.getLocation().withinDistance(door.getDoorLocation(), 60))
                    {
                        p.getPackets().removeObject(loc1, direction1, 0);
                        p.getPackets().createObject(id, loc, direction, 0);
                    }
                }
            }
            door.setDoorOpen(!door.isDoorOpen());
            door.setLastChangeTime(Environment.TickCount);
        }
Beispiel #2
0
 public void changeDoor(Player p, Door door)
 {
     p.setFaceLocation(door.getDoorLocation());
     updateDoorForPlayers(door);
 }
Beispiel #3
0
 public void changeDoor(Player p, Door door)
 {
     p.setFaceLocation(door.getDoorLocation());
     updateDoorForPlayers(door);
 }
Beispiel #4
0
 private void updateDoorForPlayers(Door door)
 {
     int id = door.isDoorOpen() ? door.getClosedDoorId() : door.getOpenDoorId();
     Location loc = door.isDoorOpen() ? door.getClosedDoorLocation() : door.getOpenDoorLocation();
     int direction = door.isDoorOpen() ? door.getClosedDirection() : door.getOpenDirection();
     Location loc1 = door.isDoorOpen() ? door.getOpenDoorLocation() : door.getClosedDoorLocation();
     int direction1 = door.isDoorOpen() ? door.getOpenDirection() : door.getClosedDirection();
     foreach (Player p in Server.getPlayerList())
     {
         if (p != null)
         {
             if (p.getLocation().withinDistance(door.getDoorLocation(), 60))
             {
                 p.getPackets().removeObject(loc1, direction1, 0);
                 p.getPackets().createObject(id, loc, direction, 0);
             }
         }
     }
     door.setDoorOpen(!door.isDoorOpen());
     door.setLastChangeTime(Environment.TickCount);
 }