Search in sources :

Example 11 with BlockPosition

use of net.minecraft.server.v1_13_R2.BlockPosition in project acidisland by tastybento.

the class NMSHandler method setFlowerPotBlock.

/* (non-Javadoc)
     * @see com.wasteofplastic.askyblock.nms.NMSAbstraction#setBlock(org.bukkit.block.Block, org.bukkit.inventory.ItemStack)
     * Credis: Mister_Frans (THANK YOU VERY MUCH !)
     */
@Override
public void setFlowerPotBlock(Block block, ItemStack itemStack) {
    Location loc = block.getLocation();
    CraftWorld cw = (CraftWorld) block.getWorld();
    BlockPosition bp = new BlockPosition(loc.getX(), loc.getY(), loc.getZ());
    TileEntityFlowerPot te = (TileEntityFlowerPot) cw.getHandle().getTileEntity(bp);
    // Bukkit.getLogger().info("Debug: flowerpot materialdata = " + (new ItemStack(potItem, 1,(short) potItemData).toString()));
    net.minecraft.server.v1_8_R2.ItemStack cis = CraftItemStack.asNMSCopy(itemStack);
    te.a(cis.getItem(), cis.getData());
    te.update();
}
Also used : BlockPosition(net.minecraft.server.v1_8_R2.BlockPosition) TileEntityFlowerPot(net.minecraft.server.v1_8_R2.TileEntityFlowerPot) CraftWorld(org.bukkit.craftbukkit.v1_8_R2.CraftWorld) Location(org.bukkit.Location)

Example 12 with BlockPosition

use of net.minecraft.server.v1_13_R2.BlockPosition in project acidisland by tastybento.

the class NMSHandler method setFlowerPotBlock.

/* (non-Javadoc)
     * @see com.wasteofplastic.askyblock.nms.NMSAbstraction#setBlock(org.bukkit.block.Block, org.bukkit.inventory.ItemStack)
     * Credis: Mister_Frans (THANK YOU VERY MUCH !)
     */
@Override
public void setFlowerPotBlock(Block block, ItemStack itemStack) {
    Location loc = block.getLocation();
    CraftWorld cw = (CraftWorld) block.getWorld();
    BlockPosition bp = new BlockPosition(loc.getX(), loc.getY(), loc.getZ());
    TileEntityFlowerPot te = (TileEntityFlowerPot) cw.getHandle().getTileEntity(bp);
    // Bukkit.getLogger().info("Debug: flowerpot materialdata = " + (new ItemStack(potItem, 1,(short) potItemData).toString()));
    net.minecraft.server.v1_9_R1.ItemStack cis = CraftItemStack.asNMSCopy(itemStack);
    te.a(cis.getItem(), cis.getData());
    te.update();
}
Also used : BlockPosition(net.minecraft.server.v1_9_R1.BlockPosition) TileEntityFlowerPot(net.minecraft.server.v1_9_R1.TileEntityFlowerPot) CraftWorld(org.bukkit.craftbukkit.v1_9_R1.CraftWorld) Location(org.bukkit.Location)

Example 13 with BlockPosition

use of net.minecraft.server.v1_13_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_10_R1.World w = ((CraftWorld) b.getWorld()).getHandle();
    net.minecraft.server.v1_10_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_10_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_10_R1.IBlockData) BlockPosition(net.minecraft.server.v1_10_R1.BlockPosition) CraftWorld(org.bukkit.craftbukkit.v1_10_R1.CraftWorld)

Example 14 with BlockPosition

use of net.minecraft.server.v1_13_R2.BlockPosition in project acidisland by tastybento.

the class NMSHandler method setFlowerPotBlock.

/* (non-Javadoc)
     * @see com.wasteofplastic.askyblock.nms.NMSAbstraction#setBlock(org.bukkit.block.Block, org.bukkit.inventory.ItemStack)
     * Credis: Mister_Frans (THANK YOU VERY MUCH !)
     */
@Override
public void setFlowerPotBlock(Block block, ItemStack itemStack) {
    Location loc = block.getLocation();
    CraftWorld cw = (CraftWorld) block.getWorld();
    BlockPosition bp = new BlockPosition(loc.getX(), loc.getY(), loc.getZ());
    TileEntityFlowerPot te = (TileEntityFlowerPot) cw.getHandle().getTileEntity(bp);
    // Bukkit.getLogger().info("Debug: flowerpot materialdata = " + (new ItemStack(potItem, 1,(short) potItemData).toString()));
    net.minecraft.server.v1_10_R1.ItemStack cis = CraftItemStack.asNMSCopy(itemStack);
    te.a(cis.getItem(), cis.getData());
    te.update();
}
Also used : BlockPosition(net.minecraft.server.v1_10_R1.BlockPosition) TileEntityFlowerPot(net.minecraft.server.v1_10_R1.TileEntityFlowerPot) CraftWorld(org.bukkit.craftbukkit.v1_10_R1.CraftWorld) Location(org.bukkit.Location)

Example 15 with BlockPosition

use of net.minecraft.server.v1_13_R2.BlockPosition in project acidisland by tastybento.

the class NMSHandler method setFlowerPotBlock.

/* (non-Javadoc)
     * @see com.wasteofplastic.askyblock.nms.NMSAbstraction#setBlock(org.bukkit.block.Block, org.bukkit.inventory.ItemStack)
     */
@Override
public void setFlowerPotBlock(final Block block, final ItemStack itemStack) {
    if (block.getType().equals(Material.FLOWER_POT)) {
        Location loc = block.getLocation();
        CraftWorld cw = (CraftWorld) block.getWorld();
        BlockPosition bp = new BlockPosition(loc.getX(), loc.getY(), loc.getZ());
        TileEntityFlowerPot te = (TileEntityFlowerPot) cw.getHandle().getTileEntity(bp);
        // Bukkit.getLogger().info("Debug: flowerpot materialdata = " + (new ItemStack(potItem, 1,(short) potItemData).toString()));
        net.minecraft.server.v1_12_R1.ItemStack cis = CraftItemStack.asNMSCopy(itemStack);
        te.setContents(cis);
        te.update();
    }
}
Also used : BlockPosition(net.minecraft.server.v1_12_R1.BlockPosition) TileEntityFlowerPot(net.minecraft.server.v1_12_R1.TileEntityFlowerPot) CraftWorld(org.bukkit.craftbukkit.v1_12_R1.CraftWorld) Location(org.bukkit.Location)

Aggregations

BlockPosition (net.minecraft.server.v1_12_R1.BlockPosition)35 BlockPosition (net.minecraft.server.v1_16_R3.BlockPosition)34 BlockPosition (net.minecraft.server.v1_8_R3.BlockPosition)32 Location (org.bukkit.Location)31 BlockPosition (net.minecraft.server.v1_10_R1.BlockPosition)28 BlockPosition (net.minecraft.server.v1_11_R1.BlockPosition)28 BlockPosition (net.minecraft.server.v1_15_R1.BlockPosition)23 ArrayList (java.util.ArrayList)22 BlockPosition (net.minecraft.server.v1_14_R1.BlockPosition)21 List (java.util.List)19 CraftWorld (org.bukkit.craftbukkit.v1_12_R1.CraftWorld)18 Map (java.util.Map)17 CraftWorld (org.bukkit.craftbukkit.v1_8_R3.CraftWorld)17 CraftWorld (org.bukkit.craftbukkit.v1_16_R3.CraftWorld)16 Iterator (java.util.Iterator)14 HashMap (java.util.HashMap)12 ComplexCollisionBox (cc.funkemunky.api.utils.world.types.ComplexCollisionBox)9 SimpleCollisionBox (cc.funkemunky.api.utils.world.types.SimpleCollisionBox)9 IBlockData (net.minecraft.server.v1_16_R3.IBlockData)9 BlockPosition (net.minecraft.server.v1_13_R2.BlockPosition)8