Skip to content

Commit

Permalink
Logic: Add support for TALL_GRASS block
Browse files Browse the repository at this point in the history
  • Loading branch information
ishikyoo committed Oct 1, 2024
1 parent 407acfc commit 3d70207
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/main/java/com/ishikyoo/leavesly/Leavesly.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ boolean isPlantBlock(Block block) {
return true;
else if (block == Blocks.FERN)
return true;
else if (block == Blocks.TALL_GRASS)
return true;
return false;
}
boolean isValidBlock(Block block) {
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/com/ishikyoo/leavesly/LeaveslyClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public class LeaveslyClient implements ClientModInitializer {
static final double VINE_MASK = 0.66666666666;
static final double SHORT_GRASS_MASK = 0.72156862745;
static final double FERN_MASK = 0.64705882352;
static final double TALL_GRASS_MASK = 0.67450980392;

static final int SPRUCE_LEAVES_COLOR = FoliageColors.getSpruceColor();
static final int BIRTH_LEAVES_COLOR = FoliageColors.getBirchColor();
Expand Down Expand Up @@ -80,6 +81,8 @@ private int getFoliageColor(Block block, BlockRenderView world, BlockPos positio
return getMaskedColor(BiomeColors.getGrassColor(world, position), SHORT_GRASS_MASK);
} else if (block == Blocks.FERN) {
return getMaskedColor(BiomeColors.getGrassColor(world, position), FERN_MASK);
} else if (block == Blocks.TALL_GRASS) {
return getMaskedColor(BiomeColors.getGrassColor(world, position), TALL_GRASS_MASK);
}
return 0;
}
Expand Down Expand Up @@ -116,7 +119,8 @@ public void onInitializeClient() {
Blocks.CHERRY_LEAVES,
Blocks.VINE,
Blocks.SHORT_GRASS,
Blocks.FERN
Blocks.FERN,
Blocks.TALL_GRASS
);
instance = this;
}
Expand Down

0 comments on commit 3d70207

Please sign in to comment.