Search in sources :

Example 11 with GenericChunk

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

the class ForgeMapChunkCache method getLoadedChunk.

// Load generic chunk from existing and already loaded chunk
protected GenericChunk getLoadedChunk(DynmapChunk chunk) {
    GenericChunk gc = null;
    IChunk ch = cps.getChunk(chunk.x, chunk.z, ChunkStatus.FULL, false);
    if (ch != null) {
        CompoundNBT nbt = ChunkSerializer.write(w, ch);
        if (nbt != null) {
            gc = parseChunkFromNBT(new NBT.NBTCompound(nbt));
        }
    }
    return gc;
}
Also used : CompoundNBT(net.minecraft.nbt.CompoundNBT) GenericChunk(org.dynmap.common.chunk.GenericChunk) IChunk(net.minecraft.world.chunk.IChunk)

Example 12 with GenericChunk

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

the class ForgeMapChunkCache method loadChunk.

// Load generic chunk from unloaded chunk
protected GenericChunk loadChunk(DynmapChunk chunk) {
    GenericChunk gc = null;
    CompoundTag nbt = readChunk(chunk.x, chunk.z);
    // If read was good
    if (nbt != null) {
        gc = parseChunkFromNBT(new NBT.NBTCompound(nbt));
    }
    return gc;
}
Also used : GenericChunk(org.dynmap.common.chunk.GenericChunk) CompoundTag(net.minecraft.nbt.CompoundTag)

Example 13 with GenericChunk

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

the class FabricMapChunkCache method loadChunk.

// Load generic chunk from unloaded chunk
protected GenericChunk loadChunk(DynmapChunk chunk) {
    GenericChunk gc = null;
    NbtCompound nbt = readChunk(chunk.x, chunk.z);
    // If read was good
    if (nbt != null) {
        gc = parseChunkFromNBT(new NBT.NBTCompound(nbt));
    }
    return gc;
}
Also used : GenericChunk(org.dynmap.common.chunk.GenericChunk)

Example 14 with GenericChunk

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

the class ForgeMapChunkCache method loadChunk.

// Load generic chunk from unloaded chunk
protected GenericChunk loadChunk(DynmapChunk chunk) {
    GenericChunk gc = null;
    CompoundTag nbt = readChunk(chunk.x, chunk.z);
    // If read was good
    if (nbt != null) {
        gc = parseChunkFromNBT(new NBT.NBTCompound(nbt));
    }
    return gc;
}
Also used : GenericChunk(org.dynmap.common.chunk.GenericChunk) CompoundTag(net.minecraft.nbt.CompoundTag)

Example 15 with GenericChunk

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

the class ForgeMapChunkCache method getLoadedChunk.

// Load generic chunk from existing and already loaded chunk
protected GenericChunk getLoadedChunk(DynmapChunk chunk) {
    GenericChunk gc = null;
    ChunkAccess ch = cps.getChunk(chunk.x, chunk.z, ChunkStatus.FULL, false);
    if (ch != null) {
        CompoundTag nbt = ChunkSerializer.write(w, ch);
        if (nbt != null) {
            gc = parseChunkFromNBT(new NBT.NBTCompound(nbt));
        }
    }
    return gc;
}
Also used : ChunkAccess(net.minecraft.world.level.chunk.ChunkAccess) GenericChunk(org.dynmap.common.chunk.GenericChunk) CompoundTag(net.minecraft.nbt.CompoundTag)

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