Search in sources :

Example 1 with LightEmissionProperty

use of org.spongepowered.api.data.property.block.LightEmissionProperty in project SpongeForge by SpongePowered.

the class ForgeLightEmissionPropertyStore method getFor.

@Override
public Optional<LightEmissionProperty> getFor(Location<World> location) {
    net.minecraft.world.World world = (net.minecraft.world.World) location.getExtent();
    Block block = (Block) location.getBlockType();
    final BlockState blockState = location.getBlock();
    return Optional.of(new LightEmissionProperty(block.getLightValue(BlockUtil.toNative(blockState), world, VecHelper.toBlockPos(location))));
}
Also used : BlockState(org.spongepowered.api.block.BlockState) LightEmissionProperty(org.spongepowered.api.data.property.block.LightEmissionProperty) Block(net.minecraft.block.Block) World(org.spongepowered.api.world.World)

Aggregations

Block (net.minecraft.block.Block)1 BlockState (org.spongepowered.api.block.BlockState)1 LightEmissionProperty (org.spongepowered.api.data.property.block.LightEmissionProperty)1 World (org.spongepowered.api.world.World)1