Search in sources :

Example 16 with DynmapChunk

use of org.dynmap.DynmapChunk in project dynmap by webbukkit.

the class MapChunkCache116_3 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 17 with DynmapChunk

use of org.dynmap.DynmapChunk in project dynmap by webbukkit.

the class MapChunkCache116_4 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) GenericChunk(org.dynmap.common.chunk.GenericChunk) DynmapChunk(org.dynmap.DynmapChunk) CraftWorld(org.bukkit.craftbukkit.v1_16_R3.CraftWorld)

Example 18 with DynmapChunk

use of org.dynmap.DynmapChunk in project dynmap by webbukkit.

the class MapChunkCache116 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_R1.NBTTagCompound) GenericChunk(org.dynmap.common.chunk.GenericChunk) Chunk(net.minecraft.server.v1_16_R1.Chunk) DynmapChunk(org.dynmap.DynmapChunk) CraftWorld(org.bukkit.craftbukkit.v1_16_R1.CraftWorld)

Example 19 with DynmapChunk

use of org.dynmap.DynmapChunk in project dynmap by webbukkit.

the class MapChunkCache115 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_15_R1.NBTTagCompound) GenericChunk(org.dynmap.common.chunk.GenericChunk) Chunk(net.minecraft.server.v1_15_R1.Chunk) DynmapChunk(org.dynmap.DynmapChunk) CraftWorld(org.bukkit.craftbukkit.v1_15_R1.CraftWorld)

Example 20 with DynmapChunk

use of org.dynmap.DynmapChunk in project dynmap by webbukkit.

the class MapChunkCache117 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.h) {
            // 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.nbt.NBTTagCompound) GenericChunk(org.dynmap.common.chunk.GenericChunk) Chunk(net.minecraft.world.level.chunk.Chunk) DynmapChunk(org.dynmap.DynmapChunk) CraftWorld(org.bukkit.craftbukkit.v1_17_R1.CraftWorld)

Aggregations

DynmapChunk (org.dynmap.DynmapChunk)25 GenericChunk (org.dynmap.common.chunk.GenericChunk)9 DynIntHashMap (org.dynmap.utils.DynIntHashMap)7 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)5 CompoundNBT (net.minecraft.nbt.CompoundNBT)4 ArrayList (java.util.ArrayList)3 Chunk (net.minecraft.world.level.chunk.Chunk)3 Chunk (net.minecraft.server.v1_16_R2.Chunk)2 NBTTagCompound (net.minecraft.server.v1_16_R2.NBTTagCompound)2 AbstractChunkProvider (net.minecraft.world.chunk.AbstractChunkProvider)2 ServerChunkProvider (net.minecraft.world.server.ServerChunkProvider)2 ServerWorld (net.minecraft.world.server.ServerWorld)2 CraftWorld (org.bukkit.craftbukkit.v1_16_R2.CraftWorld)2 SnapshotRec (org.dynmap.forge_1_12_2.SnapshotCache.SnapshotRec)2 SnapshotRec (org.dynmap.forge_1_14_4.SnapshotCache.SnapshotRec)2 SnapshotRec (org.dynmap.forge_1_15_2.SnapshotCache.SnapshotRec)2 BufferedOutputStream (java.io.BufferedOutputStream)1 FileOutputStream (java.io.FileOutputStream)1 IOException (java.io.IOException)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1