Skip to content

Commit

Permalink
chore: consistent property field naming
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreSchwang committed Dec 6, 2024
1 parent 24fecf3 commit 32e43e4
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ public class SnowSimulator implements LayerFunction {
public static final BooleanProperty SNOWY = (BooleanProperty) (Property<?>) BlockTypes.GRASS_BLOCK.getProperty("snowy");
private static final EnumProperty PROPERTY_SLAB = (EnumProperty) (Property<?>) BlockTypes.OAK_SLAB.getProperty("type");
private static final EnumProperty PROPERTY_STAIR = (EnumProperty) (Property<?>) BlockTypes.OAK_STAIRS.getProperty("half");
private static final EnumProperty TRAPDOOR = (EnumProperty) (Property<?>) BlockTypes.OAK_TRAPDOOR.getProperty("half");
private static final BooleanProperty TRAPDOOR_OPEN = (BooleanProperty) (Property<?>) BlockTypes.OAK_TRAPDOOR.getProperty(
"open");
private static final EnumProperty PROPERTY_TRAPDOOR = (EnumProperty) (Property<?>) BlockTypes.OAK_TRAPDOOR.getProperty("half");
private static final BooleanProperty PROPERTY_TRAPDOOR_OPEN = (BooleanProperty) (Property<?>) BlockTypes.OAK_TRAPDOOR.getProperty("open");

private static final BlockState ICE = BlockTypes.ICE.getDefaultState();
private static final BlockState SNOW = BlockTypes.SNOW.getDefaultState();
Expand Down Expand Up @@ -179,12 +178,12 @@ private boolean shouldSnow(BlockState blockState, BlockState above) {
return PROPERTY_VALUE_TOP.equals(blockState.getState(PROPERTY_SLAB));
}
// if block is a trapdoor, the trapdoor must NOT be open
if (type.hasProperty(TRAPDOOR_OPEN) && blockState.getState(TRAPDOOR_OPEN)) {
if (type.hasProperty(PROPERTY_TRAPDOOR_OPEN) && blockState.getState(PROPERTY_TRAPDOOR_OPEN)) {
return false;
}
// if block is a closed trapdoor, the trapdoor must be aligned at the top part of the block
if (type.hasProperty(TRAPDOOR)) {
return PROPERTY_VALUE_TOP.equals(blockState.getState(TRAPDOOR));
if (type.hasProperty(PROPERTY_TRAPDOOR)) {
return PROPERTY_VALUE_TOP.equals(blockState.getState(PROPERTY_TRAPDOOR));
}
// if block is a stair, it must be "bottom" (upside-down)
if (type.hasProperty(PROPERTY_STAIR)) {
Expand Down

0 comments on commit 32e43e4

Please sign in to comment.