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

项目:BedwarsRel    文件:Game.java   
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);
  }
}
项目:modules-extra    文件:LogListener.java   
/**
 * 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;
}
项目:BetterShards    文件:BetterShardsListener.java   
private Block getRealFace(Block block) {
    if (((Bed) block.getState().getData()).isHeadOfBed())
        block = block.getRelative(((Bed) block.getState().getData()).getFacing().getOppositeFace());
    return block;
}
项目:BedrockAPI    文件:Bed.java   
public Bed() {
}
项目:BedrockAPI    文件:Bed.java   
public Bed(BlockFace direction) {
}
项目:BedrockAPI    文件:Bed.java   
@Deprecated public Bed(int type) {
}
项目:BedrockAPI    文件:Bed.java   
public Bed(Material type) {
}
项目:BedrockAPI    文件:Bed.java   
@Deprecated public Bed(int type, byte data) {
}
项目:BedrockAPI    文件:Bed.java   
@Deprecated public Bed(Material type, byte data) {
}
项目:BedrockAPI    文件:Bed.java   
public Bed clone() {
    return null;
}