Search in sources :

Example 1 with ChunkCoordIntPair

use of net.minecraft.world.level.ChunkCoordIntPair in project dynmap by webbukkit.

the class MapChunkCache118 method loadChunk.

// Load generic chunk from unloaded chunk
protected GenericChunk loadChunk(DynmapChunk chunk) {
    CraftWorld cw = (CraftWorld) w;
    NBTTagCompound nbt = null;
    ChunkCoordIntPair cc = new ChunkCoordIntPair(chunk.x, chunk.z);
    GenericChunk gc = null;
    try {
        // playerChunkMap
        nbt = cw.getHandle().k().a.f(cc);
    } catch (IOException iox) {
    }
    if (nbt != null) {
        gc = parseChunkFromNBT(new NBT.NBTCompound(nbt));
    }
    return gc;
}
Also used : ChunkCoordIntPair(net.minecraft.world.level.ChunkCoordIntPair) GenericChunk(org.dynmap.common.chunk.GenericChunk) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) IOException(java.io.IOException) CraftWorld(org.bukkit.craftbukkit.v1_18_R1.CraftWorld)

Example 2 with ChunkCoordIntPair

use of net.minecraft.world.level.ChunkCoordIntPair in project dynmap by webbukkit.

the class MapChunkCache118_2 method loadChunk.

// Load generic chunk from unloaded chunk
protected GenericChunk loadChunk(DynmapChunk chunk) {
    CraftWorld cw = (CraftWorld) w;
    NBTTagCompound nbt = null;
    ChunkCoordIntPair cc = new ChunkCoordIntPair(chunk.x, chunk.z);
    GenericChunk gc = null;
    try {
        // playerChunkMap
        nbt = cw.getHandle().k().a.f(cc);
    } catch (IOException iox) {
    }
    if (nbt != null) {
        gc = parseChunkFromNBT(new NBT.NBTCompound(nbt));
    }
    return gc;
}
Also used : ChunkCoordIntPair(net.minecraft.world.level.ChunkCoordIntPair) GenericChunk(org.dynmap.common.chunk.GenericChunk) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) IOException(java.io.IOException) CraftWorld(org.bukkit.craftbukkit.v1_18_R2.CraftWorld)

Example 3 with ChunkCoordIntPair

use of net.minecraft.world.level.ChunkCoordIntPair in project dynmap by webbukkit.

the class MapChunkCache117 method loadChunk.

// Load generic chunk from unloaded chunk
protected GenericChunk loadChunk(DynmapChunk chunk) {
    CraftWorld cw = (CraftWorld) w;
    NBTTagCompound nbt = null;
    ChunkCoordIntPair cc = new ChunkCoordIntPair(chunk.x, chunk.z);
    GenericChunk gc = null;
    try {
        // playerChunkMap
        nbt = cw.getHandle().getChunkProvider().a.read(cc);
    } catch (IOException iox) {
    }
    if (nbt != null) {
        gc = parseChunkFromNBT(new NBT.NBTCompound(nbt));
    }
    return gc;
}
Also used : ChunkCoordIntPair(net.minecraft.world.level.ChunkCoordIntPair) GenericChunk(org.dynmap.common.chunk.GenericChunk) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) IOException(java.io.IOException) CraftWorld(org.bukkit.craftbukkit.v1_17_R1.CraftWorld)

Aggregations

IOException (java.io.IOException)3 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)3 ChunkCoordIntPair (net.minecraft.world.level.ChunkCoordIntPair)3 GenericChunk (org.dynmap.common.chunk.GenericChunk)3 CraftWorld (org.bukkit.craftbukkit.v1_17_R1.CraftWorld)1 CraftWorld (org.bukkit.craftbukkit.v1_18_R1.CraftWorld)1 CraftWorld (org.bukkit.craftbukkit.v1_18_R2.CraftWorld)1