Search in sources :

Example 21 with BlockPosition

use of net.minecraft.server.v1_8_R2.BlockPosition 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_9_R1.World w = ((CraftWorld) b.getWorld()).getHandle();
    net.minecraft.server.v1_9_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_9_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_9_R1.IBlockData) BlockPosition(net.minecraft.server.v1_9_R1.BlockPosition) CraftWorld(org.bukkit.craftbukkit.v1_9_R1.CraftWorld)

Aggregations

Location (org.bukkit.Location)8 CompoundTagBuilder (net.aufdemrand.denizen.nms.util.jnbt.CompoundTagBuilder)4 BlockPosition (net.minecraft.server.v1_8_R3.BlockPosition)4 BlockPosition (net.minecraft.server.v1_10_R1.BlockPosition)3 BlockPosition (net.minecraft.server.v1_11_R1.BlockPosition)3 BlockPosition (net.minecraft.server.v1_9_R2.BlockPosition)3 BlockPosition (net.minecraft.server.v1_12_R1.BlockPosition)2 BlockPosition (net.minecraft.server.v1_8_R1.BlockPosition)2 BlockPosition (net.minecraft.server.v1_8_R2.BlockPosition)2 BlockPosition (net.minecraft.server.v1_9_R1.BlockPosition)2 CraftWorld (org.bukkit.craftbukkit.v1_10_R1.CraftWorld)2 CraftWorld (org.bukkit.craftbukkit.v1_11_R1.CraftWorld)2 CraftWorld (org.bukkit.craftbukkit.v1_12_R1.CraftWorld)2 CraftWorld (org.bukkit.craftbukkit.v1_8_R1.CraftWorld)2 CraftWorld (org.bukkit.craftbukkit.v1_8_R2.CraftWorld)2 CraftWorld (org.bukkit.craftbukkit.v1_8_R3.CraftWorld)2 CraftWorld (org.bukkit.craftbukkit.v1_9_R1.CraftWorld)2 CraftWorld (org.bukkit.craftbukkit.v1_9_R2.CraftWorld)2 IBlockData (net.minecraft.server.v1_10_R1.IBlockData)1 TileEntity (net.minecraft.server.v1_10_R1.TileEntity)1