Fixed AO shadows on hive blocks and clouds

This commit is contained in:
Sollace 2020-06-02 17:29:04 +02:00
parent 73182d71fc
commit 511f5c0cd9
3 changed files with 16 additions and 1 deletions

View file

@ -50,6 +50,11 @@ public class HiveWallBlock extends FallingBlock {
);
}
@Override
public boolean hasEmissiveLighting(BlockState state) {
return true;
}
@Override
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
builder.add(STATE).add(AXIS);

View file

@ -32,10 +32,15 @@ public class CloudBlock extends Block implements Gas {
}
@Override
public GasState getGasState(BlockState blockState) {
public GasState getGasState(BlockState state) {
return variant;
}
@Override
public float getAmbientOcclusionLightLevel(BlockState state, BlockView view, BlockPos pos) {
return getGasState(state).isTranslucent() ? 0.9F : 0.5F;
}
@Override
public boolean canSuffocate(BlockState state, BlockView view, BlockPos pos) {
return !getGasState(state).isTranslucent();

View file

@ -23,6 +23,11 @@ public class CloudSlabBlock extends SmartSlabBlock implements Gas {
return ((Gas)modelState.getBlock()).getGasState(blockState);
}
@Override
public float getAmbientOcclusionLightLevel(BlockState state, BlockView view, BlockPos pos) {
return getGasState(state).isTranslucent() ? 1 : 0.9F;
}
@Override
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, EntityContext context) {
if (getGasState(state).canPlace((CloudInteractionContext)context)) {