Search in sources :

Example 6 with GenericChunk

use of org.dynmap.common.chunk.GenericChunk in project dynmap by webbukkit.

the class MapChunkCache115 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 {
        nbt = cw.getHandle().getChunkProvider().playerChunkMap.read(cc);
    } catch (IOException iox) {
    }
    if (nbt != null) {
        gc = parseChunkFromNBT(new NBT.NBTCompound(nbt));
    }
    return gc;
}
Also used : ChunkCoordIntPair(net.minecraft.server.v1_15_R1.ChunkCoordIntPair) GenericChunk(org.dynmap.common.chunk.GenericChunk) NBTTagCompound(net.minecraft.server.v1_15_R1.NBTTagCompound) IOException(java.io.IOException) CraftWorld(org.bukkit.craftbukkit.v1_15_R1.CraftWorld)

Example 7 with GenericChunk

use of org.dynmap.common.chunk.GenericChunk in project dynmap by webbukkit.

the class MapChunkCache116_2 method getLoadedChunk.

// Load generic chunk from existing and already loaded chunk
protected GenericChunk getLoadedChunk(DynmapChunk chunk) {
    CraftWorld cw = (CraftWorld) w;
    NBTTagCompound nbt = null;
    GenericChunk gc = null;
    if (cw.isChunkLoaded(chunk.x, chunk.z)) {
        Chunk c = cw.getHandle().getChunkAt(chunk.x, chunk.z);
        if ((c != null) && c.loaded) {
            nbt = ChunkRegionLoader.saveChunk(cw.getHandle(), c);
        }
        if (nbt != null) {
            gc = parseChunkFromNBT(new NBT.NBTCompound(nbt));
        }
    }
    return gc;
}
Also used : GenericChunk(org.dynmap.common.chunk.GenericChunk) NBTTagCompound(net.minecraft.server.v1_16_R2.NBTTagCompound) GenericChunk(org.dynmap.common.chunk.GenericChunk) DynmapChunk(org.dynmap.DynmapChunk) Chunk(net.minecraft.server.v1_16_R2.Chunk) CraftWorld(org.bukkit.craftbukkit.v1_16_R2.CraftWorld)

Example 8 with GenericChunk

use of org.dynmap.common.chunk.GenericChunk in project dynmap by webbukkit.

the class MapChunkCache116_3 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 {
        nbt = cw.getHandle().getChunkProvider().playerChunkMap.read(cc);
    } catch (IOException iox) {
    }
    if (nbt != null) {
        gc = parseChunkFromNBT(new NBT.NBTCompound(nbt));
    }
    return gc;
}
Also used : ChunkCoordIntPair(net.minecraft.server.v1_16_R2.ChunkCoordIntPair) GenericChunk(org.dynmap.common.chunk.GenericChunk) NBTTagCompound(net.minecraft.server.v1_16_R2.NBTTagCompound) IOException(java.io.IOException) CraftWorld(org.bukkit.craftbukkit.v1_16_R2.CraftWorld)

Example 9 with GenericChunk

use of org.dynmap.common.chunk.GenericChunk in project dynmap by webbukkit.

the class MapChunkCache116 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 {
        nbt = cw.getHandle().getChunkProvider().playerChunkMap.read(cc);
    } catch (IOException iox) {
    }
    if (nbt != null) {
        gc = parseChunkFromNBT(new NBT.NBTCompound(nbt));
    }
    return gc;
}
Also used : ChunkCoordIntPair(net.minecraft.server.v1_16_R1.ChunkCoordIntPair) GenericChunk(org.dynmap.common.chunk.GenericChunk) NBTTagCompound(net.minecraft.server.v1_16_R1.NBTTagCompound) IOException(java.io.IOException) CraftWorld(org.bukkit.craftbukkit.v1_16_R1.CraftWorld)

Example 10 with GenericChunk

use of org.dynmap.common.chunk.GenericChunk in project dynmap by webbukkit.

the class MapChunkCache114_1 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 {
        nbt = cw.getHandle().getChunkProvider().playerChunkMap.read(cc);
    } catch (IOException iox) {
    }
    if (nbt != null) {
        gc = parseChunkFromNBT(new NBT.NBTCompound(nbt));
    }
    return gc;
}
Also used : ChunkCoordIntPair(net.minecraft.server.v1_14_R1.ChunkCoordIntPair) GenericChunk(org.dynmap.common.chunk.GenericChunk) NBTTagCompound(net.minecraft.server.v1_14_R1.NBTTagCompound) IOException(java.io.IOException) CraftWorld(org.bukkit.craftbukkit.v1_14_R1.CraftWorld)

Aggregations

GenericChunk (org.dynmap.common.chunk.GenericChunk)32 IOException (java.io.IOException)9 DynmapChunk (org.dynmap.DynmapChunk)9 CompoundTag (net.minecraft.nbt.CompoundTag)6 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)6 NBTTagCompound (net.minecraft.server.v1_16_R2.NBTTagCompound)4 CraftWorld (org.bukkit.craftbukkit.v1_16_R2.CraftWorld)4 ChunkCoordIntPair (net.minecraft.world.level.ChunkCoordIntPair)3 Chunk (net.minecraft.world.level.chunk.Chunk)3 ChunkAccess (net.minecraft.world.level.chunk.ChunkAccess)3 CompoundNBT (net.minecraft.nbt.CompoundNBT)2 NBTTagCompound (net.minecraft.server.v1_14_R1.NBTTagCompound)2 NBTTagCompound (net.minecraft.server.v1_15_R1.NBTTagCompound)2 NBTTagCompound (net.minecraft.server.v1_16_R1.NBTTagCompound)2 Chunk (net.minecraft.server.v1_16_R2.Chunk)2 ChunkCoordIntPair (net.minecraft.server.v1_16_R2.ChunkCoordIntPair)2 CraftWorld (org.bukkit.craftbukkit.v1_14_R1.CraftWorld)2 CraftWorld (org.bukkit.craftbukkit.v1_15_R1.CraftWorld)2 CraftWorld (org.bukkit.craftbukkit.v1_16_R1.CraftWorld)2 CraftWorld (org.bukkit.craftbukkit.v1_16_R3.CraftWorld)2