use of org.spongepowered.api.data.property.block.GroundLuminanceProperty in project SpongeCommon by SpongePowered.
the class GroundLuminancePropertyStore method getFor.
@Override
public Optional<GroundLuminanceProperty> getFor(PropertyHolder propertyHolder) {
if (propertyHolder instanceof Location && ((Location<?>) propertyHolder).getExtent() instanceof Chunk) {
final Chunk chunk = (Chunk) ((Location<?>) propertyHolder).getExtent();
final float light = chunk.getLightFor(EnumSkyBlock.BLOCK, ((IMixinLocation) propertyHolder).getBlockPos());
return Optional.of(new GroundLuminanceProperty(light));
}
return super.getFor(propertyHolder);
}
use of org.spongepowered.api.data.property.block.GroundLuminanceProperty in project SpongeCommon by SpongePowered.
the class GroundLuminancePropertyStore method getFor.
@Override
public Optional<GroundLuminanceProperty> getFor(Location<World> location) {
final net.minecraft.world.World world = (net.minecraft.world.World) location.getExtent();
final float light = world.getLightFor(EnumSkyBlock.BLOCK, ((IMixinLocation) (Object) location).getBlockPos());
return Optional.of(new GroundLuminanceProperty(light));
}
Aggregations