Tiph-Studios / DysonSphereProject

A mod for Minecraft
Apache License 2.0
0 stars 0 forks source link

Solar panel doesn't block sunlight #34

Open zhouzhouthezhou opened 11 months ago

zhouzhouthezhou commented 11 months ago

make it do

zhouzhouthezhou commented 11 months ago

289324849-790b7762-02cc-4db6-8e66-a8003a97fe83

cmpashak commented 10 months ago

Saw this in another mod might help idk - in their block impl of BaseEntityBlock

private boolean canLightPass(BlockState state){ return !(state.getValue(TOP_MODULE).canLightPass() || state.getValue(CENTER_MODULE).canLightPass() ||state.getValue(BOTTOM_MODULE).canLightPass()); }

@Override
public boolean propagatesSkylightDown(@NotNull BlockState state, @NotNull BlockGetter world, @NotNull BlockPos pos) {
    return this.canLightPass(state);
}

@SuppressWarnings("deprecation")
@Override
public float getShadeBrightness(@NotNull BlockState state, @NotNull BlockGetter world, @NotNull BlockPos pos) {
    return this.canLightPass(state) ? 0.95F : 1.0F;
}
cmpashak commented 10 months ago

@PJWahlgren ^