Skip to content

Commit

Permalink
feat: make Membranes valid windmill sails for Create
Browse files Browse the repository at this point in the history
  • Loading branch information
Elenterius committed Feb 11, 2024
1 parent 8cb5caa commit d74859b
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.github.elenterius.biomancy.block.FleshDoorBlock;
import com.github.elenterius.biomancy.block.FullFleshDoorBlock;
import com.github.elenterius.biomancy.block.MembraneBlock;
import com.github.elenterius.biomancy.init.ModBlockMaterials;
import com.github.elenterius.biomancy.init.ModBlocks;
import com.github.elenterius.biomancy.init.tags.ModBlockTags;
Expand Down Expand Up @@ -121,11 +122,16 @@ private void addCreateTags() {
String modId = "create";

//Blocks which should be able to move on contraptions, but would otherwise be ignored due to their empty collision shape
TagKey<Block> movableEmptyCollider = tagKey(modId, "movable_empty_collider");
tag(movableEmptyCollider).add(
//Example: Cobweb
tag(tagKey(modId, "movable_empty_collider")).add(
ModBlocks.FLESH_DOOR.get(),
ModBlocks.FLESH_IRIS_DOOR.get()
);

//Blocks which can count toward a functional windmill structure
//Example: Wool
TagAppender<Block> windmillSailsTag = tag(tagKey(modId, "windmill_sails"));
ModBlocks.BLOCKS.getEntries().stream().map(RegistryObject::get).filter(MembraneBlock.class::isInstance).forEach(windmillSailsTag::add);
}

/**
Expand All @@ -134,9 +140,8 @@ private void addCreateTags() {
private void addQuarkTags() {
String modId = "quark";

TagKey<Block> noDoubleDoor = tagKey(modId, "non_double_door");
TagAppender<Block> tag = tag(noDoubleDoor);
TagAppender<Block> nonDoubleDoorTag = tag(tagKey(modId, "non_double_door"));
Predicate<Block> predicate = block -> block instanceof FleshDoorBlock || block instanceof FullFleshDoorBlock;
ModBlocks.BLOCKS.getEntries().stream().map(RegistryObject::get).filter(predicate).forEach(tag::add);
ModBlocks.BLOCKS.getEntries().stream().map(RegistryObject::get).filter(predicate).forEach(nonDoubleDoorTag::add);
}
}

0 comments on commit d74859b

Please sign in to comment.