Skip to content

Commit

Permalink
RegionsUnexplored(COMMON): Add tag to planks from other wood mods
Browse files Browse the repository at this point in the history
  • Loading branch information
Xelbayria committed Nov 14, 2024
1 parent 776f99b commit d804a99
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
import java.io.InputStream;
import java.util.Map;

import static net.mehvahdjukaar.every_compat.common_classes.TagUtility.createAndAddCustomTags;

// SUPPORT: v0.5.5+
public class RegionsUnexploredModule extends SimpleModule {
public final SimpleEntrySet<WoodType, Block> branchs;
Expand Down Expand Up @@ -117,6 +119,10 @@ public void addDynamicServerResources(ServerDynamicResourcesHandler handler, Res
SimpleTagBuilder tagBuilder = SimpleTagBuilder.of(modRes("branches_can_survive_on"));
tagBuilder.add(Utils.getID(wood.log));
handler.dynamicPack.addTag(tagBuilder, Registries.BLOCK);

//Tagging the planks as ingredient to get painted_planks
createAndAddCustomTags(new ResourceLocation("planks"), handler, wood.planks);
createAndAddCustomTags(new ResourceLocation("c:planks"), handler, wood.planks);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
import java.util.Objects;
import java.util.function.Function;

import static net.mehvahdjukaar.every_compat.common_classes.TagUtility.createAndAddCustomTags;

// SUPPORT: v0.5.5+
public class RegionsUnexploredModule extends SimpleModule {
public final SimpleEntrySet<WoodType, Block> branchs;
Expand Down Expand Up @@ -127,6 +129,21 @@ public void onModSetup() {
branchs.blocks.forEach((woodType, block) -> ComposterBlock.COMPOSTABLES.put(block, 0.3F));
}

@Override
// Tags
public void addDynamicServerResources(ServerDynamicResourcesHandler handler, ResourceManager manager) {
super.addDynamicServerResources(handler, manager);

for (WoodType woodType : WoodTypeRegistry.getTypes()) {
if (woodType.isVanilla() || woodType.getNamespace().equals("regions_unexplored")) continue;

//Tagging the planks as ingredient to get painted_planks
createAndAddCustomTags(new ResourceLocation("planks"), handler, woodType.planks);
createAndAddCustomTags(new ResourceLocation("forge:planks"), handler, woodType.planks);
}

}

@Override
// Textures & Models
public void addDynamicClientResources(ClientDynamicResourcesHandler handler, ResourceManager manager) {
Expand Down

0 comments on commit d804a99

Please sign in to comment.