use of net.minecraft.server.v1_9_R1.ChunkSection in project TheAPI by TheDevTec.
the class v1_15_R1 method getBlock.
@Override
public Object getBlock(Object chunk, int x, int y, int z) {
net.minecraft.server.v1_15_R1.Chunk c = (net.minecraft.server.v1_15_R1.Chunk) chunk;
ChunkSection sc = c.getSections()[y >> 4];
if (sc == null)
return Blocks.AIR.getBlockData();
return sc.getBlocks().a(x & 15, y & 15, z & 15);
}
use of net.minecraft.server.v1_9_R1.ChunkSection in project TheAPI by TheDevTec.
the class v1_16_R1 method getBlock.
@Override
public Object getBlock(Object chunk, int x, int y, int z) {
net.minecraft.server.v1_16_R1.Chunk c = (net.minecraft.server.v1_16_R1.Chunk) chunk;
ChunkSection sc = c.getSections()[y >> 4];
if (sc == null)
return Blocks.AIR.getBlockData();
return sc.getBlocks().a(x & 15, y & 15, z & 15);
}
use of net.minecraft.server.v1_9_R1.ChunkSection in project TheAPI by TheDevTec.
the class v1_16_R1 method setBlock.
@Override
public void setBlock(Object chunk, int x, int y, int z, Object IblockData, int data) {
net.minecraft.server.v1_16_R1.Chunk c = (net.minecraft.server.v1_16_R1.Chunk) chunk;
ChunkSection sc = c.getSections()[y >> 4];
if (sc == null) {
c.getSections()[y >> 4] = sc = new ChunkSection(y >> 4 << 4);
}
BlockPosition pos = new BlockPosition(x, y, z);
// REMOVE TILE ENTITY
c.tileEntities.remove(pos);
sc.getBlocks().b(x & 15, y & 15, z & 15, (IBlockData) IblockData);
// ADD TILE ENTITY
if (IblockData instanceof ITileEntity) {
TileEntity ent = ((ITileEntity) IblockData).createTile(c);
c.tileEntities.put(pos, ent);
Object packet = ent.getUpdatePacket();
Bukkit.getOnlinePlayers().forEach(player -> BukkitLoader.getPacketHandler().send(player, packet));
}
}
use of net.minecraft.server.v1_9_R1.ChunkSection in project TheAPI by TheDevTec.
the class v1_13_R2 method getBlock.
@Override
public Object getBlock(Object chunk, int x, int y, int z) {
net.minecraft.server.v1_13_R2.Chunk c = (net.minecraft.server.v1_13_R2.Chunk) chunk;
ChunkSection sc = c.getSections()[y >> 4];
if (sc == null)
return Blocks.AIR.getBlockData();
return sc.getBlocks().a(x & 15, y & 15, z & 15);
}
use of net.minecraft.server.v1_9_R1.ChunkSection in project TheAPI by TheDevTec.
the class v1_12_R1 method getBlock.
@Override
public Object getBlock(Object chunk, int x, int y, int z) {
net.minecraft.server.v1_12_R1.Chunk c = (net.minecraft.server.v1_12_R1.Chunk) chunk;
ChunkSection sc = c.getSections()[y >> 4];
if (sc == null)
return Blocks.AIR.getBlockData();
return sc.getBlocks().a(x & 15, y & 15, z & 15);
}
Aggregations