Skip to content

Commit

Permalink
Improve NO_PLANTS predicate filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Niels-NTG committed Jun 5, 2023
1 parent 0cee41c commit cbca544
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# GDMC-HTTP 1.3.0 (Minecraft 1.19.2)
# GDMC-HTTP 1.3.2 (Minecraft 1.19.2)

- NEW: Add `GET /heightmap` to get heightmap data of a given [type](https://minecraft.fandom.com/wiki/Heightmap) of the currently set build area. Thanks to [cmoyates](https://github.com/cmoyates)!
- NEW: Add custom heightmap types `MOTION_BLOCKING_NO_PLANTS` and `OCEAN_FLOOR_NO_PLANTS`.
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
id 'net.minecraftforge.gradle' version '5.1.+'
}

version = '1.3.1'
version = '1.3.2'
group = 'com.nilsgawlik.gdmchttp' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'gdmchttp'

Expand Down
13 changes: 9 additions & 4 deletions docs/Endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -897,20 +897,25 @@ Returns the [heightmap](https://minecraft.fandom.com/wiki/Heightmap) of the set

In addition to the build-in height map types of `WORLD_SURFACE`, `OCEAN_FLOOR`, `MOTION_BLOCKING` and `MOTION_BLOCKING_NO_LEAVES`, this mod also includes the following custom height maps:
- `MOTION_BLOCKING_NO_PLANTS`
- Same as `MOTION_BLOCKING_NO_LEAVES`, except it also excludes the following blocks
- All logs
- Same as `MOTION_BLOCKING`, except it also excludes the following blocks
- Logs
- Leaves
- Bee nests
- Mangrove roots
- Giant mushroom blocks
- All types of pumpkin blocks
- Pumpkin blocks
- Melon blocks
- Moss blocks
- Nether wart blocks
- Cactus blocks
- Farmland
- Coral blocks
- Sponges
- Bamboo plants
- Cobwebs
- Sculk
- `OCEAN_FLOOR_NO_PLANTS`
- Same as `OCEAN_FLOOR`, except it also excludes the following blocks:
- Leaves
- Everything listed for `MOTION_BLOCKING_NO_PLANTS`

## Request headers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,17 @@ private static int getIndex(int p_64266_, int p_64267_) {
}

private static final Predicate<BlockState> NO_PLANTS = blockState ->
!blockState.is(BlockTags.LEAVES) && !blockState.is(BlockTags.LOGS) && !blockState.is(Blocks.BEE_NEST) && !blockState.is(Blocks.MANGROVE_ROOTS) &&
!blockState.is(BlockTags.LEAVES) && !blockState.is(BlockTags.LOGS) && !blockState.is(Blocks.BEE_NEST) && !blockState.is(Blocks.MANGROVE_ROOTS) && !blockState.is(Blocks.MUDDY_MANGROVE_ROOTS) &&
!blockState.is(Blocks.BROWN_MUSHROOM_BLOCK) && !blockState.is(Blocks.RED_MUSHROOM_BLOCK) && !blockState.is(Blocks.MUSHROOM_STEM) &&
!blockState.is(Blocks.PUMPKIN) && !blockState.is(Blocks.CARVED_PUMPKIN) && !blockState.is(Blocks.JACK_O_LANTERN) &&
!blockState.is(Blocks.PUMPKIN) &&
!blockState.is(Blocks.MELON) &&
!blockState.is(Blocks.MOSS_BLOCK) &&
!blockState.is(Blocks.MOSS_BLOCK) && !blockState.is(Blocks.NETHER_WART_BLOCK) &&
!blockState.is(Blocks.CACTUS) &&
!blockState.is(Blocks.FARMLAND) &&
!blockState.is(BlockTags.CORAL_BLOCKS) && !blockState.is(Blocks.SPONGE) && !blockState.is(Blocks.WET_SPONGE)
!blockState.is(BlockTags.CORAL_BLOCKS) && !blockState.is(Blocks.SPONGE) && !blockState.is(Blocks.WET_SPONGE) &&
!blockState.is(Blocks.BAMBOO) &&
!blockState.is(Blocks.COBWEB) &&
!blockState.is(Blocks.SCULK)
;

public enum Types implements StringRepresentable {
Expand Down

0 comments on commit cbca544

Please sign in to comment.