Search in sources :

Example 1 with BlockDispenser

use of net.minecraft.block.BlockDispenser in project Magma by magmafoundation.

the class CraftDispenser method dispense.

@Override
public boolean dispense() {
    Block block = getBlock();
    if (block.getType() == Material.DISPENSER) {
        CraftWorld world = (CraftWorld) this.getWorld();
        BlockDispenser dispense = (BlockDispenser) Blocks.DISPENSER;
        dispense.dispense(world.getHandle(), new BlockPos(getX(), getY(), getZ()));
        return true;
    } else {
        return false;
    }
}
Also used : Block(org.bukkit.block.Block) BlockPos(net.minecraft.util.math.BlockPos) CraftWorld(org.bukkit.craftbukkit.v1_12_R1.CraftWorld) BlockDispenser(net.minecraft.block.BlockDispenser)

Example 2 with BlockDispenser

use of net.minecraft.block.BlockDispenser in project CumServerPro by MCUmbrella.

the class CraftDispenser method dispense.

@Override
public boolean dispense() {
    Block block = getBlock();
    if (block.getType() == Material.DISPENSER) {
        CraftWorld world = (CraftWorld) this.getWorld();
        BlockDispenser dispense = (BlockDispenser) Blocks.DISPENSER;
        dispense.dispense(world.getHandle(), new BlockPos(getX(), getY(), getZ()));
        return true;
    } else {
        return false;
    }
}
Also used : Block(org.bukkit.block.Block) BlockPos(net.minecraft.util.math.BlockPos) CraftWorld(org.bukkit.craftbukkit.CraftWorld) BlockDispenser(net.minecraft.block.BlockDispenser)

Aggregations

BlockDispenser (net.minecraft.block.BlockDispenser)2 BlockPos (net.minecraft.util.math.BlockPos)2 Block (org.bukkit.block.Block)2 CraftWorld (org.bukkit.craftbukkit.CraftWorld)1 CraftWorld (org.bukkit.craftbukkit.v1_12_R1.CraftWorld)1