Java 类org.bukkit.material.Torch 实例源码

项目:autoprogram-plugin    文件:ProgParser.java   
private void placeBlock(Block worldBlock, BlockDef block)
{
    if (block.face == null && block.metadata == 0)
    {
        worldBlock.setType(block.material);
    }
    else
    {
        //I would prefer to do this without depreciated method and the weird torch hack,
        //but the bukkit/spigot API seems to be buggy. If I set the block type with setType and then
        //set the direction, attachable blocks will for some reason pop off, even if I
        //tell setType to disable physics updates.
        if (block.face != null)
        {
            Torch torch = new Torch();
            torch.setFacingDirection(block.face);
            worldBlock.setTypeIdAndData(block.material.getId(), torch.getData(), true);
        }
        else
        {
            worldBlock.setTypeIdAndData(block.material.getId(), block.metadata, true);
        }
    }
}
项目:Gorm    文件:Castle.java   
public void addLightToWall(int x, int y, int z,BlockFace dir) {
    World w = Castle.getInstance().getWorld();
    Block b = w.getBlockAt(x, y, z);

    // a hack. Creating a torch will cause it
    // to drop, unless there's something under it.
    // Even when it's attached to a wall.
    // Madness.

    Block bunder = w.getBlockAt(x, y-1, z);
    if(canOverwrite(bunder) && canOverwrite(b)){
        bunder.setType(Material.DIRT);

        Torch t = new Torch(Material.TORCH);
        t.setFacingDirection(dir);
        b.setType(Material.TORCH);
        b.setData(t.getData());

        bunder.setType(Material.AIR);
    }
}
项目:BedrockAPI    文件:Torch.java   
public Torch() {
}
项目:BedrockAPI    文件:Torch.java   
@Deprecated public Torch(int type) {
}
项目:BedrockAPI    文件:Torch.java   
public Torch(Material type) {
}
项目:BedrockAPI    文件:Torch.java   
@Deprecated public Torch(int type, byte data) {
}
项目:BedrockAPI    文件:Torch.java   
@Deprecated public Torch(Material type, byte data) {
}
项目:BedrockAPI    文件:Torch.java   
public Torch clone() {
    return null;
}