use of com.almuradev.content.type.block.type.horizontal.state.HorizontalBlockStateDefinition in project Almura by AlmuraDev.
the class HorizontalBlockImpl method getLightValue.
@Deprecated
@Override
public int getLightValue(final IBlockState state) {
if (state != null && this.states != null) {
final HorizontalBlockStateDefinition definition = this.definition(state);
int lightValue = PrimitiveOptionals.mapToInt(definition.lightEmission, value -> (int) (15f * value)).orElseGet(() -> super.getLightValue(state));
// System.out.println("getLightValue (state) = " + lightValue);
return lightValue;
} else {
// System.out.println("getLightValue (fallback) = 0");
return 0;
}
}
use of com.almuradev.content.type.block.type.horizontal.state.HorizontalBlockStateDefinition in project Almura by AlmuraDev.
the class HorizontalBlockImpl method getCollisionBoundingBox.
@Deprecated
@Nullable
@Override
public AxisAlignedBB getCollisionBoundingBox(final IBlockState state, final IBlockAccess world, final BlockPos pos) {
final EnumFacing facing = state.getValue(FACING);
final HorizontalBlockStateDefinition definition = this.definition(facing);
if (definition.nullCollisionBox) {
return null;
}
final AxisAlignedBB collisionBox = definition.collisionBox(facing);
return collisionBox != null ? collisionBox : super.getCollisionBoundingBox(state, world, pos);
}
use of com.almuradev.content.type.block.type.horizontal.state.HorizontalBlockStateDefinition in project Almura by AlmuraDev.
the class HorizontalBlockImpl method getExplosionResistance.
@Override
public float getExplosionResistance(final World world, final BlockPos pos, @Nullable final Entity exploder, final Explosion explosion) {
final IBlockState state = world.getBlockState(pos);
final HorizontalBlockStateDefinition definition = this.definition(state);
return definition.resistance.isPresent() ? (float) definition.resistance.getAsDouble() : super.getExplosionResistance(exploder);
}
use of com.almuradev.content.type.block.type.horizontal.state.HorizontalBlockStateDefinition in project Almura by AlmuraDev.
the class HorizontalBlockImpl method getLightOpacity.
@Deprecated
@Override
public int getLightOpacity(final IBlockState state) {
final HorizontalBlockStateDefinition definition = this.definition(state);
int lightOpacity = definition.lightOpacity.orElseGet(() -> super.getLightOpacity(state));
// System.out.println("getLightOpacity = " + lightOpacity);
return lightOpacity;
}
Aggregations