当前位置: 首页>>代码示例>>Java>>正文


Java Bed类代码示例

本文整理汇总了Java中org.bukkit.material.Bed的典型用法代码示例。如果您正苦于以下问题:Java Bed类的具体用法?Java Bed怎么用?Java Bed使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Bed类属于org.bukkit.material包,在下文中一共展示了Bed类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: dropTargetBlock

import org.bukkit.material.Bed; //导入依赖的package包/类
private void dropTargetBlock(Block targetBlock) {
  if (targetBlock.getType().equals(Material.BED_BLOCK)) {
    Block bedHead;
    Block bedFeet;
    Bed bedBlock = (Bed) targetBlock.getState().getData();

    if (!bedBlock.isHeadOfBed()) {
      bedFeet = targetBlock;
      bedHead = Utils.getBedNeighbor(bedFeet);
    } else {
      bedHead = targetBlock;
      bedFeet = Utils.getBedNeighbor(bedHead);
    }

    if (!BedwarsRel.getInstance().getCurrentVersion().startsWith("v1_12")) {
      bedFeet.setType(Material.AIR);
    } else {
      bedHead.setType(Material.AIR);
    }
  } else {
    targetBlock.setType(Material.AIR);
  }
}
 
开发者ID:BedwarsRel,项目名称:BedwarsRel,代码行数:24,代码来源:Game.java

示例2: adjustBlockForDoubleBlocks

import org.bukkit.material.Bed; //导入依赖的package包/类
/**
 * Only the bottom half of doors and the feet of a bed is logged!
 *
 * @param blockState the blockstate to adjust
 *
 * @return the adjusted blockstate
 */
public static BlockState adjustBlockForDoubleBlocks(BlockState blockState)
{
    if (blockState.getType() == Material.WOODEN_DOOR || blockState.getType() == Material.IRON_DOOR_BLOCK)
    {
        if (blockState.getRawData() == 8 || blockState.getRawData() == 9)
        {
            if (blockState.getRawData() == 9)
            {
                blockState = blockState.getBlock().getRelative(BlockFace.DOWN).getState();
                blockState.setRawData((byte)(blockState.getRawData() + 8));
                return blockState;
            }
            return blockState.getBlock().getRelative(BlockFace.DOWN).getState();
        }
        else
        {
            if (blockState.getBlock().getRelative(BlockFace.UP).getState().getRawData() == 9)
            {
                blockState.setRawData((byte)(blockState.getRawData() + 8));
            }
        }
    }
    else if (blockState.getData() instanceof Bed)
    {
        Bed bed = (Bed)blockState.getData();
        if (bed.isHeadOfBed())
        {
            return blockState.getBlock().getRelative(bed.getFacing().getOppositeFace()).getState();
        }
    }
    return blockState;
}
 
开发者ID:CubeEngine,项目名称:modules-extra,代码行数:40,代码来源:LogListener.java

示例3: getRealFace

import org.bukkit.material.Bed; //导入依赖的package包/类
private Block getRealFace(Block block) {
	if (((Bed) block.getState().getData()).isHeadOfBed())
		block = block.getRelative(((Bed) block.getState().getData()).getFacing().getOppositeFace());
	return block;
}
 
开发者ID:Civcraft,项目名称:BetterShards,代码行数:6,代码来源:BetterShardsListener.java

示例4: Bed

import org.bukkit.material.Bed; //导入依赖的package包/类
public Bed() {
}
 
开发者ID:deathcap,项目名称:BedrockAPI,代码行数:3,代码来源:Bed.java

示例5: clone

import org.bukkit.material.Bed; //导入依赖的package包/类
public Bed clone() {
	return null;
}
 
开发者ID:deathcap,项目名称:BedrockAPI,代码行数:4,代码来源:Bed.java


注:本文中的org.bukkit.material.Bed类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。