本文整理汇总了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);
}
}
示例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;
}
示例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;
}
示例4: Bed
import org.bukkit.material.Bed; //导入依赖的package包/类
public Bed() {
}
示例5: clone
import org.bukkit.material.Bed; //导入依赖的package包/类
public Bed clone() {
return null;
}