/** * Gets the chunk at the represented location * * @return Chunk at the represented location */ public Chunk getChunk() { return world.getChunkAt(this); }
private void setType(Block block, int type, int data) { World world = block.getWorld(); int x = block.getX(); int y = block.getY(); int z = block.getZ(); GlowChunk chunk = (GlowChunk) world.getChunkAt(block); chunk.setType(x & 0xf, z & 0xf, y, type); chunk.setMetaData(x & 0xf, z & 0xf, y, data); } }
for (int x = cx - 8; x <= cx + 8 && !placed; x++) { for (int z = cz - 8; z <= cz + 8 && !placed; z++) { if (!world.getChunkAt(x, z).isLoaded() && !world.getChunkAt(x, z).load(true)) { continue;
/** * Gets or loads the chunk at the coordinates of this IntVector2 on the * world specified * * @param world to get a chunk of * @return chunk at the world */ public Chunk toChunk(World world) { return world.getChunkAt(x, z); }
public static void loadChunks(org.bukkit.World world, final int xmid, final int zmid, final int radius) { for (int cx = xmid - radius; cx <= xmid + radius; cx++) { for (int cz = zmid - radius; cz <= zmid + radius; cz++) { world.getChunkAt(cx, cz); } } }
/** * Gets the chunk at the represented location * * @return Chunk at the represented location */ public Chunk getChunk() { return world.getChunkAt(this); }
/** * {@inheritDoc} */ @Override public Chunk getChunk() { if ((this.worldRef != null) && (this.worldRef.get() != null)) return this.worldRef.get().getChunkAt(this); return null; }
tileData = new DynIntHashMap(); Chunk c = w.getChunkAt(chunk.x, chunk.z); /* Get the chunk */
@Override protected ChunkSnapshot getChunkObject(int x, int z) { return world.getChunkAt(x, z).getChunkSnapshot(false, false, false); }
public Chunk getChunk() { return Bukkit.getWorld(worldName).getChunkAt(x, z); }
public Chunk getChunk(World world, int x, int z) { if (lastChunk != null && lastChunk.getX() == x && lastChunk.getZ() == z) { return lastChunk; } return lastChunk = world.getChunkAt(x, z); } }
@Override public MCChunk getChunkAt(MCBlock b) { return new BukkitMCChunk(w.getChunkAt(((BukkitMCBlock) b).__Block())); }
@Override public MCChunk getChunkAt(MCLocation l) { return new BukkitMCChunk(w.getChunkAt(((BukkitMCLocation) l).asLocation())); }
private List<Chunk> getChunks(Chunk c, SCHEMATIC s) { List<Chunk> chinks = new ArrayList<>(); chinks.add(c); if (!s.getConsoleSize().equals(ConsoleSize.SMALL)) { chinks.add(c.getWorld().getChunkAt(c.getX() + 1, c.getZ())); chinks.add(c.getWorld().getChunkAt(c.getX(), c.getZ() + 1)); chinks.add(c.getWorld().getChunkAt(c.getX() + 1, c.getZ() + 1)); } return chinks; } }
private List<Chunk> getChunks(Chunk c, SCHEMATIC s) { List<Chunk> chinks = new ArrayList<>(); chinks.add(c); if (!s.getConsoleSize().equals(ConsoleSize.SMALL)) { chinks.add(c.getWorld().getChunkAt(c.getX() + 1, c.getZ())); chinks.add(c.getWorld().getChunkAt(c.getX(), c.getZ() + 1)); chinks.add(c.getWorld().getChunkAt(c.getX() + 1, c.getZ() + 1)); } return chinks; } }
private Chunk getChunk(String str) { String[] split = str.split(":"); World cw = plugin.getServer().getWorld(split[0]); int cx = TARDISNumberParsers.parseInt(split[1]); int cz = TARDISNumberParsers.parseInt(split[2]); return cw.getChunkAt(cx, cz); }
private Chunk getChunk(String str) { String[] split = str.split(":"); World cw = plugin.getServer().getWorld(split[0]); int cx = TARDISNumberParsers.parseInt(split[1]); int cz = TARDISNumberParsers.parseInt(split[2]); return cw.getChunkAt(cx, cz); }
private int getChunkX(boolean min, Chunk c) { int cx = c.getX(); int cz = c.getZ(); if (min) { return c.getWorld().getChunkAt(cx - 4, cz).getBlock(0, 64, 0).getX(); } else { return c.getWorld().getChunkAt(cx + 4, cz).getBlock(0, 64, 0).getX(); } }
private int getChunkZ(boolean min, Chunk c) { int cx = c.getX(); int cz = c.getZ(); if (min) { return c.getWorld().getChunkAt(cx, cz - 4).getBlock(0, 64, 0).getZ(); } else { return c.getWorld().getChunkAt(cx, cz + 4).getBlock(0, 64, 0).getZ(); } }
public static boolean checkForRegionsInChunk(FLocation floc) { Chunk chunk = floc.getWorld().getChunkAt((int) floc.getX(), (int) floc.getZ()); return checkForRegionsInChunk(chunk); }