Search in sources :

Example 16 with IBlockData

use of net.minecraft.server.v1_11_R1.IBlockData in project askyblock by tastybento.

the class NMSHandler method setBlockSuperFast.

@Override
public void setBlockSuperFast(Block b, int blockId, byte data, boolean applyPhysics) {
    net.minecraft.server.v1_8_R1.World w = ((CraftWorld) b.getWorld()).getHandle();
    net.minecraft.server.v1_8_R1.Chunk chunk = w.getChunkAt(b.getX() >> 4, b.getZ() >> 4);
    BlockPosition bp = new BlockPosition(b.getX(), b.getY(), b.getZ());
    int combined = blockId + (data << 12);
    IBlockData ibd = net.minecraft.server.v1_8_R1.Block.getByCombinedId(combined);
    chunk.a(bp, ibd);
    if (applyPhysics) {
        net.minecraft.server.v1_8_R1.Block block = chunk.getType(bp);
        w.update(bp, block);
    }
}
Also used : IBlockData(net.minecraft.server.v1_8_R1.IBlockData) BlockPosition(net.minecraft.server.v1_8_R1.BlockPosition) CraftWorld(org.bukkit.craftbukkit.v1_8_R1.CraftWorld)

Example 17 with IBlockData

use of net.minecraft.server.v1_11_R1.IBlockData in project askyblock by tastybento.

the class NMSHandler method setBlockSuperFast.

@Override
public void setBlockSuperFast(Block b, int blockId, byte data, boolean applyPhysics) {
    net.minecraft.server.v1_12_R1.World w = ((CraftWorld) b.getWorld()).getHandle();
    net.minecraft.server.v1_12_R1.Chunk chunk = w.getChunkAt(b.getX() >> 4, b.getZ() >> 4);
    BlockPosition bp = new BlockPosition(b.getX(), b.getY(), b.getZ());
    int combined = blockId + (data << 12);
    IBlockData ibd = net.minecraft.server.v1_12_R1.Block.getByCombinedId(combined);
    if (applyPhysics) {
        w.setTypeAndData(bp, ibd, 3);
    } else {
        w.setTypeAndData(bp, ibd, 2);
    }
    chunk.a(bp, ibd);
}
Also used : IBlockData(net.minecraft.server.v1_12_R1.IBlockData) BlockPosition(net.minecraft.server.v1_12_R1.BlockPosition) CraftWorld(org.bukkit.craftbukkit.v1_12_R1.CraftWorld)

Example 18 with IBlockData

use of net.minecraft.server.v1_11_R1.IBlockData in project askyblock by tastybento.

the class NMSHandler method setBlockSuperFast.

@Override
public void setBlockSuperFast(Block b, int blockId, byte data, boolean applyPhysics) {
    net.minecraft.server.v1_8_R2.World w = ((CraftWorld) b.getWorld()).getHandle();
    net.minecraft.server.v1_8_R2.Chunk chunk = w.getChunkAt(b.getX() >> 4, b.getZ() >> 4);
    BlockPosition bp = new BlockPosition(b.getX(), b.getY(), b.getZ());
    int combined = blockId + (data << 12);
    IBlockData ibd = net.minecraft.server.v1_8_R2.Block.getByCombinedId(combined);
    chunk.a(bp, ibd);
    if (applyPhysics) {
        net.minecraft.server.v1_8_R2.Block block = chunk.getType(bp);
        w.update(bp, block);
    }
}
Also used : IBlockData(net.minecraft.server.v1_8_R2.IBlockData) BlockPosition(net.minecraft.server.v1_8_R2.BlockPosition) CraftWorld(org.bukkit.craftbukkit.v1_8_R2.CraftWorld)

Example 19 with IBlockData

use of net.minecraft.server.v1_11_R1.IBlockData in project askyblock by tastybento.

the class NMSHandler method setBlockSuperFast.

@Override
public void setBlockSuperFast(Block b, int blockId, byte data, boolean applyPhysics) {
    net.minecraft.server.v1_9_R2.World w = ((CraftWorld) b.getWorld()).getHandle();
    net.minecraft.server.v1_9_R2.Chunk chunk = w.getChunkAt(b.getX() >> 4, b.getZ() >> 4);
    BlockPosition bp = new BlockPosition(b.getX(), b.getY(), b.getZ());
    int combined = blockId + (data << 12);
    IBlockData ibd = net.minecraft.server.v1_9_R2.Block.getByCombinedId(combined);
    if (applyPhysics) {
        w.setTypeAndData(bp, ibd, 3);
    } else {
        w.setTypeAndData(bp, ibd, 2);
    }
    chunk.a(bp, ibd);
}
Also used : IBlockData(net.minecraft.server.v1_9_R2.IBlockData) BlockPosition(net.minecraft.server.v1_9_R2.BlockPosition) CraftWorld(org.bukkit.craftbukkit.v1_9_R2.CraftWorld)

Example 20 with IBlockData

use of net.minecraft.server.v1_11_R1.IBlockData in project acidisland by tastybento.

the class NMSHandler method setBlockSuperFast.

@Override
public void setBlockSuperFast(Block b, int blockId, byte data, boolean applyPhysics) {
    net.minecraft.server.v1_11_R1.World w = ((CraftWorld) b.getWorld()).getHandle();
    net.minecraft.server.v1_11_R1.Chunk chunk = w.getChunkAt(b.getX() >> 4, b.getZ() >> 4);
    BlockPosition bp = new BlockPosition(b.getX(), b.getY(), b.getZ());
    int combined = blockId + (data << 12);
    IBlockData ibd = net.minecraft.server.v1_11_R1.Block.getByCombinedId(combined);
    if (applyPhysics) {
        w.setTypeAndData(bp, ibd, 3);
    } else {
        w.setTypeAndData(bp, ibd, 2);
    }
    chunk.a(bp, ibd);
}
Also used : IBlockData(net.minecraft.server.v1_11_R1.IBlockData) BlockPosition(net.minecraft.server.v1_11_R1.BlockPosition) CraftWorld(org.bukkit.craftbukkit.v1_11_R1.CraftWorld)

Aggregations

BlockPosition (net.minecraft.server.v1_10_R1.BlockPosition)5 IBlockData (net.minecraft.server.v1_10_R1.IBlockData)5 BlockPosition (net.minecraft.server.v1_11_R1.BlockPosition)5 IBlockData (net.minecraft.server.v1_11_R1.IBlockData)5 NPC (net.citizensnpcs.api.npc.NPC)4 NPCHolder (net.citizensnpcs.npc.ai.NPCHolder)4 BlockPosition (net.minecraft.server.v1_12_R1.BlockPosition)4 IBlockData (net.minecraft.server.v1_12_R1.IBlockData)4 BlockPosition (net.minecraft.server.v1_8_R3.BlockPosition)3 IBlockData (net.minecraft.server.v1_8_R3.IBlockData)3 Block (net.minecraft.server.v1_10_R1.Block)2 Block (net.minecraft.server.v1_11_R1.Block)2 BlockPosition (net.minecraft.server.v1_8_R1.BlockPosition)2 IBlockData (net.minecraft.server.v1_8_R1.IBlockData)2 BlockPosition (net.minecraft.server.v1_8_R2.BlockPosition)2 IBlockData (net.minecraft.server.v1_8_R2.IBlockData)2 BlockPosition (net.minecraft.server.v1_9_R1.BlockPosition)2 IBlockData (net.minecraft.server.v1_9_R1.IBlockData)2 BlockPosition (net.minecraft.server.v1_9_R2.BlockPosition)2 CraftWorld (org.bukkit.craftbukkit.v1_10_R1.CraftWorld)2