Search in sources :

Example 21 with ParallelChunk

use of thpmc.vanilla_source.api.world.parallel.ParallelChunk in project VanillaSource by TheHollowPlanetMC.

the class ImplParallelWorld method removeBlockLight.

@Override
public void removeBlockLight(int blockX, int blockY, int blockZ) {
    int chunkX = blockX >> 4;
    int chunkZ = blockZ >> 4;
    long coord = ChunkUtil.getCoordinateKey(chunkX, chunkZ);
    ParallelChunk parallelChunk = chunkMap.get(coord);
    if (parallelChunk == null)
        return;
    parallelChunk.removeBlockLight(blockX, blockY, blockZ);
}
Also used : ParallelChunk(thpmc.vanilla_source.api.world.parallel.ParallelChunk)

Example 22 with ParallelChunk

use of thpmc.vanilla_source.api.world.parallel.ParallelChunk in project VanillaSource by TheHollowPlanetMC.

the class ImplParallelWorld method getBlockLightLevel.

@Override
public int getBlockLightLevel(int blockX, int blockY, int blockZ) {
    int chunkX = blockX >> 4;
    int chunkZ = blockZ >> 4;
    long coord = ChunkUtil.getCoordinateKey(chunkX, chunkZ);
    ParallelChunk parallelChunk = chunkMap.get(coord);
    if (parallelChunk == null)
        return 0;
    return parallelChunk.getBlockLightLevel(blockX, blockY, blockZ);
}
Also used : ParallelChunk(thpmc.vanilla_source.api.world.parallel.ParallelChunk)

Example 23 with ParallelChunk

use of thpmc.vanilla_source.api.world.parallel.ParallelChunk in project VanillaSource by TheHollowPlanetMC.

the class ImplParallelWorld method removeSkyLight.

@Override
public void removeSkyLight(int blockX, int blockY, int blockZ) {
    int chunkX = blockX >> 4;
    int chunkZ = blockZ >> 4;
    long coord = ChunkUtil.getCoordinateKey(chunkX, chunkZ);
    ParallelChunk parallelChunk = chunkMap.get(coord);
    if (parallelChunk == null)
        return;
    parallelChunk.removeSkyLight(blockX, blockY, blockZ);
}
Also used : ParallelChunk(thpmc.vanilla_source.api.world.parallel.ParallelChunk)

Example 24 with ParallelChunk

use of thpmc.vanilla_source.api.world.parallel.ParallelChunk in project VanillaSource by TheHollowPlanetMC.

the class ImplParallelWorld method getNMSBlockData.

@Override
@Nullable
public Object getNMSBlockData(int blockX, int blockY, int blockZ) {
    int chunkX = blockX >> 4;
    int chunkZ = blockZ >> 4;
    long coord = ChunkUtil.getCoordinateKey(chunkX, chunkZ);
    ParallelChunk parallelChunk = chunkMap.get(coord);
    if (parallelChunk == null)
        return null;
    return parallelChunk.getNMSBlockData(blockX, blockY, blockZ);
}
Also used : ParallelChunk(thpmc.vanilla_source.api.world.parallel.ParallelChunk) Nullable(org.jetbrains.annotations.Nullable)

Example 25 with ParallelChunk

use of thpmc.vanilla_source.api.world.parallel.ParallelChunk in project VanillaSource by TheHollowPlanetMC.

the class ImplParallelWorld method getType.

@Override
@Nullable
public Material getType(int blockX, int blockY, int blockZ) {
    int chunkX = blockX >> 4;
    int chunkZ = blockZ >> 4;
    long coord = ChunkUtil.getCoordinateKey(chunkX, chunkZ);
    ParallelChunk parallelChunk = chunkMap.get(coord);
    if (parallelChunk == null)
        return null;
    return parallelChunk.getType(blockX, blockY, blockZ);
}
Also used : ParallelChunk(thpmc.vanilla_source.api.world.parallel.ParallelChunk) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

ParallelChunk (thpmc.vanilla_source.api.world.parallel.ParallelChunk)26 ParallelWorld (thpmc.vanilla_source.api.world.parallel.ParallelWorld)10 ParallelUniverse (thpmc.vanilla_source.api.world.parallel.ParallelUniverse)6 SectionTypeArray (thpmc.vanilla_source.util.SectionTypeArray)6 Nullable (org.jetbrains.annotations.Nullable)5 SectionLevelArray (thpmc.vanilla_source.util.SectionLevelArray)5 World (org.bukkit.World)4 BlockData (org.bukkit.block.data.BlockData)3 java.util (java.util)2 List (java.util.List)2 Bukkit (org.bukkit.Bukkit)2 ChunkSnapshot (org.bukkit.ChunkSnapshot)2 CraftWorld (org.bukkit.craftbukkit.v1_15_R1.CraftWorld)2 CraftBlockData (org.bukkit.craftbukkit.v1_15_R1.block.data.CraftBlockData)2 CraftWorld (org.bukkit.craftbukkit.v1_16_R3.CraftWorld)2 Player (org.bukkit.entity.Player)2 BlockPosition3i (thpmc.vanilla_source.util.BlockPosition3i)2 net.minecraft.server.v1_15_R1 (net.minecraft.server.v1_15_R1)1 BlockPosition (net.minecraft.server.v1_15_R1.BlockPosition)1 ChunkCoordIntPair (net.minecraft.server.v1_15_R1.ChunkCoordIntPair)1