package com.thebrokenrail.energonrelics.block; import com.thebrokenrail.energonrelics.block.entity.EnergonLightBlockEntity; import com.thebrokenrail.energonrelics.api.block.energy.EnergyBlock; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Material; import net.minecraft.block.entity.BlockEntity; import net.minecraft.block.entity.BlockEntityType; import net.minecraft.sound.BlockSoundGroup; import net.minecraft.state.StateManager; import net.minecraft.state.property.BooleanProperty; import net.minecraft.state.property.Properties; import java.util.function.Function; public class EnergonLightBlock extends EnergyBlock { public static final BooleanProperty POWERED = Properties.POWERED; public EnergonLightBlock() { super(FabricBlockSettings.of(Material.REDSTONE_LAMP).sounds(BlockSoundGroup.GLASS).nonOpaque().lightLevel(state -> state.get(POWERED) ? 15 : 0).strength(0.3f)); setDefaultState(getDefaultState().with(POWERED, false)); } @Override protected void appendProperties(StateManager.Builder builder) { super.appendProperties(builder); builder.add(POWERED); } @Override protected Function, BlockEntity> getFactory() { return EnergonLightBlockEntity::new; } }