use of net.minecraft.block.BlockHorizontal in project minecolonies by Minecolonies.
the class EntityCitizen method getRenderOffsetX.
public float getRenderOffsetX() {
if (!isAsleep()) {
return 0;
}
final IBlockState state = this.world.isBlockLoaded(getBedLocation()) ? this.world.getBlockState(getBedLocation()) : null;
final boolean isBed = state != null && state.getBlock().isBed(state, this.world, getBedLocation(), this);
final EnumFacing enumfacing = isBed && state.getBlock() instanceof BlockHorizontal ? state.getValue(BlockHorizontal.FACING) : null;
if (enumfacing == null) {
return 0;
}
return SLEEPING_RENDER_OFFSET * (float) enumfacing.getFrontOffsetX();
}
use of net.minecraft.block.BlockHorizontal in project minecolonies by Minecolonies.
the class EntityCitizen method getRenderOffsetZ.
public float getRenderOffsetZ() {
if (!isAsleep()) {
return 0;
}
final IBlockState state = this.world.isBlockLoaded(getBedLocation()) ? this.world.getBlockState(getBedLocation()) : null;
final boolean isBed = state != null && state.getBlock().isBed(state, this.world, getBedLocation(), this);
final EnumFacing enumfacing = isBed && state.getBlock() instanceof BlockHorizontal ? state.getValue(BlockHorizontal.FACING) : null;
if (enumfacing == null) {
return 0;
}
return SLEEPING_RENDER_OFFSET * (float) enumfacing.getFrontOffsetZ();
}
Aggregations