Package org.bukkit

Examples of org.bukkit.Chunk


     *
     * @param event The event to watch
     */
    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
    public void onChunkUnload(ChunkUnloadEvent event) {
        Chunk chunk = event.getChunk();

        mcMMO.getPlaceStore().chunkUnloaded(chunk.getX(), chunk.getZ(), event.getWorld());
    }
View Full Code Here


        SkillUtils.sendSkillMessage(player, ability.getAbilityPlayerOff(player));
        new AbilityCooldownTask(mcMMOPlayer, ability).runTaskLaterAsynchronously(mcMMO.p, PerksUtils.handleCooldownPerks(player, ability.getCooldown()) * Misc.TICK_CONVERSION_FACTOR);
    }

    private void resendChunkRadiusAt(Player player, int radius) {
        Chunk chunk = player.getLocation().getChunk();
        World world = player.getWorld();

        int chunkX = chunk.getX();
        int chunkZ = chunk.getZ();

        for (int x = chunkX - radius; x < chunkX + radius; x++) {
            for (int z = chunkZ - radius; z < chunkZ + radius; z++) {
                world.refreshChunk(x, z);
            }
View Full Code Here

        playerLoc2.remove(player.getName());
    }

    public void selectChunk(Player player)
    {
        Chunk chunk = player.getWorld().getChunkAt(player.getLocation());
        int xcoord = chunk.getX() * 16;
        int zcoord = chunk.getZ() * 16;
        int ycoord = MIN_HEIGHT;
        int xmax = xcoord + 15;
        int zmax = zcoord + 15;
        int ymax = MAX_HEIGHT;
        this.playerLoc1.put(player.getName(), new Location(player.getWorld(), xcoord, ycoord, zcoord));
View Full Code Here

  public static List<Protection> getProtectionsInChunk(PS chunkPs)
  {
    List<Protection> ret = new ArrayList<Protection>();
   
    // Get the chunk
    Chunk chunk = null;
    try
    {
      chunk = chunkPs.asBukkitChunk(true);
    }
    catch (Exception e)
    {
      return ret;
    }
   
    for (BlockState blockState : chunk.getTileEntities())
    {
      // TODO: Can something else be protected by LWC? Or is it really only chests?
      // TODO: How about we run through each block in the chunk just to be on the safe side?
      if (blockState.getType() != Material.CHEST) continue;
      Block block = blockState.getBlock();
View Full Code Here

     * physics and storage purposes.
     * @param entity The entity.
     * @param newLocation The new location.
     */
    void move(GlowEntity entity, Location newLocation) {
        Chunk prevChunk = entity.location.getChunk();
        Chunk newChunk = newLocation.getChunk();
        if (prevChunk != newChunk) {
            ((GlowChunk) prevChunk).getRawEntities().remove(entity);
            ((GlowChunk) newChunk).getRawEntities().add(entity);
        }
    }
View Full Code Here

        return;
      }
      if (!cw.getHandle().chunkProviderServer.isChunkLoaded(chunkX, chunkZ)) {
        return;
      }
      Chunk c = player.getWorld().getChunkAt(chunkX, chunkZ);
      if (c instanceof SpoutChunk) {
        SpoutChunk chunk = (SpoutChunk)c;
        player.sendPacket(new PacketCustomBlockChunkOverride(chunk.getCustomBlockIds(), chunk.getCustomBlockData(), chunkX, chunkZ));
      }
    }
View Full Code Here

    int ixLoc = Location.locToBlock(xLoc);
    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

        } else {
         
          // find ourselves
          World world = player.getWorld();
          Location location = player.getLocation();
          Chunk chunk = world.getChunkAt(location);
          int areaX1 = chunk.getX() * SupportChunk.chunksBlockWidth;
          int areaX2 = areaX1 + widthX * SupportChunk.chunksBlockWidth;
          int groundY = location.getBlockY();
          int areaZ1 = chunk.getZ() * SupportChunk.chunksBlockWidth;
          int areaZ2 = areaZ1 + widthZ * SupportChunk.chunksBlockWidth;
         
          // place markers
          for (int x = 0; x <= widthX; x++) {
            int markerX = areaX1 + x * SupportChunk.chunksBlockWidth;
 
View Full Code Here

      if (player.hasPermission("cityinfo.command")) {

        // find ourselves
        World world = player.getWorld();
        Location location = player.getLocation();
        Chunk chunk = world.getChunkAt(location);

        // get API instance
        CityWorldAPI api = new CityWorldAPI(plugin);
        // fetch full info hash
        HashMap<String, String> info = api.getFullInfo(chunk);
View Full Code Here

        } else {
         
          // find ourselves
          World world = player.getWorld();
          Location location = player.getLocation();
          Chunk chunk = world.getChunkAt(location);
          int chunkX = chunk.getX();
          int chunkZ = chunk.getZ();
         
          // iterate through the chunks
          if (regening) {
            for (int x = chunkX - radius; x <= chunkX + radius; x++) {
              for (int z = chunkZ - radius; z <= chunkZ + radius; z++) {
View Full Code Here

TOP

Related Classes of org.bukkit.Chunk

Copyright © 2018 www.massapicom. 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.