Skip to content

Commit

Permalink
Datagen the ore tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrbysco committed Oct 9, 2023
1 parent 538dac8 commit 361e88d
Show file tree
Hide file tree
Showing 20 changed files with 81 additions and 47 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
// 1.20.1 2023-07-20T22:42:40.0863623 Tags for minecraft:block mod id forcecraft
// 1.20.1 2023-10-09T13:18:06.8991362 Tags for minecraft:block mod id forcecraft
6682e317fdf17b7ed16b01be6244689ba18716a1 data/forcecraft/tags/blocks/needs_force_tool.json
5ec6a48a81a06d202f30aee8ebfbbb9b9564386b data/forge/tags/blocks/ores.json
f002772c304bb8350635523d7d3bb1c4fdb5796a data/forge/tags/blocks/ores/power.json
b73848b6920747aedc21ffb8aed7e3aa8d325f04 data/forge/tags/blocks/ores_in_ground/deepslate.json
5b2618b88b5b044099742e91e0a5e3ed254d91cf data/forge/tags/blocks/ores_in_ground/stone.json
d24fa89133e2e0d0fed52aec4122ab12ef2313f8 data/minecraft/tags/blocks/mineable/pickaxe.json
bbb8aafb9fe8b2ac991b03b55e4a2bee3318a1da data/minecraft/tags/blocks/needs_diamond_tool.json
f002772c304bb8350635523d7d3bb1c4fdb5796a data/minecraft/tags/blocks/needs_iron_tool.json
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
// 1.20.1 2023-07-20T22:42:40.0883623 Tags for minecraft:item mod id forcecraft
// 1.20.1 2023-10-09T13:18:06.9011402 Tags for minecraft:item mod id forcecraft
5ec6a48a81a06d202f30aee8ebfbbb9b9564386b data/forge/tags/items/ores.json
f002772c304bb8350635523d7d3bb1c4fdb5796a data/forge/tags/items/ores/power.json
b73848b6920747aedc21ffb8aed7e3aa8d325f04 data/forge/tags/items/ores_in_ground/deepslate.json
5b2618b88b5b044099742e91e0a5e3ed254d91cf data/forge/tags/items/ores_in_ground/stone.json
5 changes: 5 additions & 0 deletions src/generated/resources/data/forge/tags/blocks/ores.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"#forge:ores/power"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"values": [
"forcecraft:power_ore",
"forcecraft:deepslate_power_ore"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"forcecraft:deepslate_power_ore"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"forcecraft:power_ore"
]
}
5 changes: 5 additions & 0 deletions src/generated/resources/data/forge/tags/items/ores.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"#forge:ores/power"
]
}
6 changes: 6 additions & 0 deletions src/generated/resources/data/forge/tags/items/ores/power.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"values": [
"forcecraft:power_ore",
"forcecraft:deepslate_power_ore"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"forcecraft:deepslate_power_ore"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"forcecraft:power_ore"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ public ForceBlockTags(PackOutput output, CompletableFuture<HolderLookup.Provider
super(output, lookupProvider, Reference.MOD_ID, existingFileHelper);
}

public static final TagKey<Block> RELOCATION_NOT_SUPPORTED = forgeTag("relocation_not_supported");
public static final TagKey<Block> NON_MOVABLE = optionalTag("create", "non_movable");
public static final TagKey<Block> ORES_IN_GROUND_DEEPSLATE = forgeTag("ores_in_ground/deepslate");
public static final TagKey<Block> ORES_IN_GROUND_STONE = forgeTag("ores_in_ground/stone");
public static final TagKey<Block> ORES = forgeTag("ores");
public static final TagKey<Block> ORES_POWER = forgeTag("ores/power");

private static TagKey<Block> forgeTag(String name) {
return BlockTags.create(new ResourceLocation("forge", name));
Expand Down Expand Up @@ -71,5 +73,11 @@ protected void addTags(HolderLookup.Provider provider) {
);

this.tag(BlockTags.NEEDS_IRON_TOOL).add(POWER_ORE.get(), DEEPSLATE_POWER_ORE.get());

this.tag(ORES_IN_GROUND_DEEPSLATE).add(DEEPSLATE_POWER_ORE.get());
this.tag(ORES_IN_GROUND_STONE).add(POWER_ORE.get());
this.tag(ORES_POWER).add(POWER_ORE.get(), DEEPSLATE_POWER_ORE.get());
this.tag(ORES).addTag(ORES_POWER);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,37 @@
import net.minecraft.data.PackOutput;
import net.minecraft.data.tags.ItemTagsProvider;
import net.minecraft.data.tags.TagsProvider;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.ItemTags;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
import net.minecraftforge.common.data.ExistingFileHelper;

import java.util.concurrent.CompletableFuture;

import static com.mrbysco.forcecraft.registry.ForceRegistry.*;

public class ForceItemTags extends ItemTagsProvider {
public ForceItemTags(PackOutput output, CompletableFuture<HolderLookup.Provider> lookupProvider,
TagsProvider<Block> blockTagProvider, ExistingFileHelper existingFileHelper) {
super(output, lookupProvider, blockTagProvider.contentsGetter(), Reference.MOD_ID, existingFileHelper);
}

public static final TagKey<Item> ORES_IN_GROUND_DEEPSLATE = forgeTag("ores_in_ground/deepslate");
public static final TagKey<Item> ORES_IN_GROUND_STONE = forgeTag("ores_in_ground/stone");
public static final TagKey<Item> ORES = forgeTag("ores");
public static final TagKey<Item> ORES_POWER = forgeTag("ores/power");

private static TagKey<Item> forgeTag(String name) {
return ItemTags.create(new ResourceLocation("forge", name));
}

@Override
protected void addTags(HolderLookup.Provider provider) {

this.tag(ORES_IN_GROUND_DEEPSLATE).add(DEEPSLATE_POWER_ORE_ITEM.get());
this.tag(ORES_IN_GROUND_STONE).add(POWER_ORE_ITEM.get());
this.tag(ORES_POWER).add(POWER_ORE_ITEM.get(), DEEPSLATE_POWER_ORE_ITEM.get());
this.tag(ORES).addTag(ORES_POWER);
}
}
5 changes: 0 additions & 5 deletions src/main/resources/data/forge/tags/blocks/ores.json

This file was deleted.

6 changes: 0 additions & 6 deletions src/main/resources/data/forge/tags/blocks/ores/power.json

This file was deleted.

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions src/main/resources/data/forge/tags/items/ores.json

This file was deleted.

6 changes: 0 additions & 6 deletions src/main/resources/data/forge/tags/items/ores/power.json

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 361e88d

Please sign in to comment.