Skip to content

Commit

Permalink
TagUtilTest
Browse files Browse the repository at this point in the history
  • Loading branch information
apple502j committed Aug 29, 2024
1 parent effc557 commit 195d375
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,16 @@ public void onInitialize() {
}

ServerLifecycleEvents.SERVER_STARTED.register(server -> {
if (!TagUtil.isIn(server.getRegistryManager(), ConventionalEnchantmentTags.INCREASE_BLOCK_DROPS, server.getRegistryManager().get(RegistryKeys.ENCHANTMENT).get(Enchantments.FORTUNE))) {
if (!TagUtil.isIn(server.getRegistryManager(), ConventionalEnchantmentTags.INCREASE_BLOCK_DROPS, server.getRegistryManager().getOrThrow(RegistryKeys.ENCHANTMENT).get(Enchantments.FORTUNE))) {
throw new AssertionError("Failed to find fortune in c:increase_block_drops!");
}

if (TagUtil.isIn(ConventionalBiomeTags.IS_OVERWORLD, server.getRegistryManager().get(RegistryKeys.BIOME).get(BiomeKeys.BADLANDS))) {
if (TagUtil.isIn(ConventionalBiomeTags.IS_OVERWORLD, server.getRegistryManager().getOrThrow(RegistryKeys.BIOME).get(BiomeKeys.BADLANDS))) {
throw new AssertionError("Found a dynamic entry in a static registry?!");
}

// If this fails, the tag is missing a biome or the util is broken
if (!TagUtil.isIn(server.getRegistryManager(), ConventionalBiomeTags.IS_OVERWORLD, server.getRegistryManager().get(RegistryKeys.BIOME).get(BiomeKeys.BADLANDS))) {
if (!TagUtil.isIn(server.getRegistryManager(), ConventionalBiomeTags.IS_OVERWORLD, server.getRegistryManager().getOrThrow(RegistryKeys.BIOME).get(BiomeKeys.BADLANDS))) {
throw new AssertionError("Failed to find an overworld biome (%s) in c:in_overworld!".formatted(BiomeKeys.BADLANDS));
}

Expand Down

0 comments on commit 195d375

Please sign in to comment.