Skip to content

Commit

Permalink
Added biome condition
Browse files Browse the repository at this point in the history
  • Loading branch information
apace100 committed Feb 15, 2021
1 parent bb71a5d commit 630b1f3
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ public static void register() {
.add("comparison", SerializableDataType.COMPARISON)
.add("compare_to", SerializableDataType.FLOAT),
(data, player) -> ((Comparison)data.get("comparison")).compare(player.getHealth() / player.getMaxHealth(), data.getFloat("compare_to"))));
register(new ConditionFactory<>(Origins.identifier("biome"), new SerializableData()
.add("biome", SerializableDataType.IDENTIFIER),
(data, player) -> player.world.getRegistryManager().get(Registry.BIOME_KEY).getId(player.world.getBiome(player.getBlockPos())).equals(data.getId("biome"))));
}

private static void register(ConditionFactory<PlayerEntity> conditionFactory) {
Expand Down

0 comments on commit 630b1f3

Please sign in to comment.