Package org.bukkit

Examples of org.bukkit.Chunk.load()


                chunkDelays.put(chunkString, System.currentTimeMillis() + length.getMillis());
            else
                chunkDelays.put(chunkString, (long) 0);
            dB.echoDebug(scriptEntry, "...added chunk "+chunk.getX() + ", "+ chunk.getZ() + " with a delay of " + length.getSeconds() + " seconds.");
            if(!chunk.isLoaded())
                chunk.load();
            break;
        case REMOVE:
            if(chunkDelays.containsKey(chunkString)) {
                chunkDelays.remove(chunkString);
                dB.echoDebug(scriptEntry, "...allowing unloading of chunk "+chunk.getX() + ", "+ chunk.getZ());
View Full Code Here


    int izLoc = Location.locToBlock(zLoc);

    // Make sure the chunk we're checking in is actually loaded
    Chunk tChunk = loc.getWorld().getChunkAt(CoordXZ.blockToChunk(ixLoc), CoordXZ.blockToChunk(izLoc));
    if (!tChunk.isLoaded())
      tChunk.load();

    yLoc = getSafeY(loc.getWorld(), ixLoc, Location.locToBlock(yLoc), izLoc, flying);
    if (yLoc == -1)
      return null;
View Full Code Here

        for (int z = coords[2]; z <= coords[5]; z++) {
          Block block = world.getBlockAt(x, y, z);

          // load chunk if needed
          Chunk here = block.getChunk();
          if (!here.isLoaded()) here.load();

          // set type
          block.setTypeId(blockType.getId(), false);

          // add to list of changed chunks
View Full Code Here

        for (int z = 0; z < blockData[0][0].length; z++) {
          Block block = this.world.getBlockAt(this.coords[0] + x, this.coords[1] + y, this.coords[2] + z);

          // load chunk if needed
          Chunk here = block.getChunk();
          if (!here.isLoaded()) here.load();

          //if (blockData[x][y][z].getTypeId() != block.getTypeId() || blockData[x][y][z].getData() != block.getData()) {
          //  System.out.println(block);
            block.setTypeIdAndData(blockData[x][y][z].getTypeId(), blockData[x][y][z].getData(), false);
          //}
View Full Code Here

          if (this.region.contains(coords[0] + x, coords[1] + y, coords[2] + z)) { // only restore, if within the region
            Block block = this.world.getBlockAt(coords[0] + x, coords[1] + y, coords[2] + z);

            // load chunk if needed
            Chunk here = block.getChunk();
            if (!here.isLoaded()) here.load();
           
            //if (blockData[x][y][z].getTypeId() != block.getTypeId() || blockData[x][y][z].getData() != block.getData()) {
            //  System.out.println(block);
              block.setTypeIdAndData(blockData[x][y][z].getTypeId(), blockData[x][y][z].getData(), false);
            //}
View Full Code Here

    if(c == null)
      return;

    if(!c.isLoaded() && inForce)
    {
      if(!c.load())
        return;
    }

    this.spawn(inLocation);
  }
View Full Code Here

            if (currentTime > resident.getTeleportRequestTime() + (TownySettings.getTeleportWarmupTime() * 1000)) {
                resident.clearTeleportRequest();
                try {
                  // Make sure the chunk we teleport to is loaded.
                    Chunk chunk = resident.getTeleportDestination().getSpawn().getWorld().getChunkAt(resident.getTeleportDestination().getSpawn().getBlock());
                  if (!chunk.isLoaded()) chunk.load();
                    TownyUniverse.getPlayer(resident).teleport(resident.getTeleportDestination().getSpawn());
                } catch (TownyException ignore) { }
                teleportQueue.poll();
            } else {
                break;
View Full Code Here

                            User user = plugin.getEssentials().getUser(player);
                           
                            if (!user.isJailed()) {
                             
                                Teleport teleport = user.getTeleport();
                                if (!chunk.isLoaded()) chunk.load();
                                // Cause an essentials exception if in cooldown.
                                teleport.cooldown(true);
                                teleport.teleport(town.getSpawn(),null);
                            }
                        } catch (Exception e) {
View Full Code Here

               
                // If an Admin or Essentials teleport isn't being used, use our own.
                if(isTownyAdmin) {
                  if (player.getVehicle() != null)
                    player.getVehicle().eject();
                  if (!chunk.isLoaded()) chunk.load();
                    player.teleport(town.getSpawn());
                    return;
                }
               
                if (!UsingESS) {
View Full Code Here

                        plugin.getTownyUniverse().requestTeleport(player, town, travelCost);
                    } else {
                      // Don't use teleport warmup
                      if (player.getVehicle() != null)
                        player.getVehicle().eject();
                      if (!chunk.isLoaded()) chunk.load();
                        player.teleport(town.getSpawn());
                    }
                }
            } catch (TownyException e) {
                TownyMessaging.sendErrorMsg(player, e.getMessage());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.