Search in sources :

Example 6 with BedBlock

use of net.minecraft.block.BedBlock in project minecolonies by ldtteam.

the class BuildingHospital method registerBlockPosition.

@Override
public void registerBlockPosition(@NotNull final BlockState blockState, @NotNull final BlockPos pos, @NotNull final World world) {
    super.registerBlockPosition(blockState, pos, world);
    BlockPos registrationPosition = pos;
    if (blockState.getBlock() instanceof BedBlock) {
        if (blockState.getValue(BedBlock.PART) == BedPart.FOOT) {
            registrationPosition = registrationPosition.relative(blockState.getValue(BedBlock.FACING));
        }
        if (!bedMap.containsKey(registrationPosition)) {
            bedMap.put(registrationPosition, 0);
        }
    }
}
Also used : BedBlock(net.minecraft.block.BedBlock) BlockPos(net.minecraft.util.math.BlockPos)

Aggregations

BedBlock (net.minecraft.block.BedBlock)6 BlockPos (net.minecraft.util.math.BlockPos)6 EventHandler (mathax.client.eventbus.EventHandler)2 EventHandler (meteordevelopment.orbit.EventHandler)2 PlayerInteractBlockC2SPacket (net.minecraft.network.packet.c2s.play.PlayerInteractBlockC2SPacket)2 SlabBlock (net.minecraft.block.SlabBlock)1 Entity (net.minecraft.entity.Entity)1 EndCrystalEntity (net.minecraft.entity.decoration.EndCrystalEntity)1