cn.nukkit.blockentity.BlockEntityBed Java Examples

The following examples show how to use cn.nukkit.blockentity.BlockEntityBed. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BlockBed.java    From Jupiter with GNU General Public License v3.0 5 votes vote down vote up
public DyeColor getDyeColor() {
    BlockEntity blockEntity = this.level.getBlockEntity(this);

    if (blockEntity instanceof BlockEntityBed) {
        return ((BlockEntityBed) blockEntity).getDyeColor();
    }
    return DyeColor.WHITE;
}
 
Example #2
Source File: BlockBed.java    From Nukkit with GNU General Public License v3.0 5 votes vote down vote up
public DyeColor getDyeColor() {
    if (this.level != null) {
        BlockEntity blockEntity = this.level.getBlockEntity(this);

        if (blockEntity instanceof BlockEntityBed) {
            return ((BlockEntityBed) blockEntity).getDyeColor();
        }
    }

    return DyeColor.WHITE;
}
 
Example #3
Source File: BlockBed.java    From Nukkit with GNU General Public License v3.0 5 votes vote down vote up
public DyeColor getDyeColor() {
    if (this.level != null) {
        BlockEntity blockEntity = this.level.getBlockEntity(this);

        if (blockEntity instanceof BlockEntityBed) {
            return ((BlockEntityBed) blockEntity).getDyeColor();
        }
    }

    return DyeColor.WHITE;
}
 
Example #4
Source File: BlockBed.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
private void createBlockEntity(Vector3 pos, int color) {
    CompoundTag nbt = BlockEntity.getDefaultCompound(pos, BlockEntity.BED);
    nbt.putByte("color", color);

    new BlockEntityBed(this.level.getChunk(pos.getFloorX() >> 4, pos.getFloorZ() >> 4), nbt);
}