From e9f4eb57041e564c486677462d68c85e68cb5217 Mon Sep 17 00:00:00 2001 From: Elenterius Date: Sat, 28 Oct 2023 21:50:11 +0200 Subject: [PATCH] fix: fix Wide Flesh Doors incompatibility with Quark's double door feature Closes: #108 --- .../datagen/tags/ModBlockTagsProvider.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/datagen/java/com/github/elenterius/biomancy/datagen/tags/ModBlockTagsProvider.java b/src/datagen/java/com/github/elenterius/biomancy/datagen/tags/ModBlockTagsProvider.java index 9b7dc9c9f..f6fb5a2a7 100644 --- a/src/datagen/java/com/github/elenterius/biomancy/datagen/tags/ModBlockTagsProvider.java +++ b/src/datagen/java/com/github/elenterius/biomancy/datagen/tags/ModBlockTagsProvider.java @@ -1,5 +1,7 @@ package com.github.elenterius.biomancy.datagen.tags; +import com.github.elenterius.biomancy.block.FleshDoorBlock; +import com.github.elenterius.biomancy.block.FullFleshDoorBlock; import com.github.elenterius.biomancy.init.ModBlockMaterials; import com.github.elenterius.biomancy.init.ModBlocks; import com.github.elenterius.biomancy.init.tags.ModBlockTags; @@ -17,6 +19,7 @@ import org.apache.commons.lang3.StringUtils; import javax.annotation.Nullable; +import java.util.function.Predicate; import static com.github.elenterius.biomancy.BiomancyMod.MOD_ID; @@ -39,6 +42,7 @@ public String getName() { protected void addTags() { addFleshyBlocksToHoeTag(); addCreateTags(); + addQuarkTags(); //CONVERTABLE_TO_PRIMAL_FLESH //CONVERTABLE_TO_MALIGNANT_FLESH @@ -110,4 +114,15 @@ private void addCreateTags() { ); } + /** + * Quark Tags + */ + private void addQuarkTags() { + String modId = "quark"; + TagKey noDoubleDoor = tagKey(modId, "non_double_door"); + TagAppender tag = tag(noDoubleDoor); + + Predicate predicate = block -> block instanceof FleshDoorBlock || block instanceof FullFleshDoorBlock; + ModBlocks.BLOCKS.getEntries().stream().map(RegistryObject::get).filter(predicate).forEach(tag::add); + } }