Skip to content

Commit

Permalink
[1.21.1] Make Neoforge's Needs Netherite Tool block tag be added to v…
Browse files Browse the repository at this point in the history
…anilla's incorrect block tags (#1658)
  • Loading branch information
TelepathicGrunt authored Nov 11, 2024
1 parent ef8bc0e commit b296685
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"#neoforge:needs_netherite_tool"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"#neoforge:needs_netherite_tool"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"#neoforge:needs_netherite_tool"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"#neoforge:needs_netherite_tool"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"#neoforge:needs_netherite_tool"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"values": []
}
20 changes: 20 additions & 0 deletions src/main/java/net/neoforged/neoforge/common/Tags.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,28 @@ public static class Blocks {
* This is patched into the following method: {@link net.minecraft.world.entity.monster.EnderMan.EndermanLeaveBlockGoal#canPlaceBlock(Level, BlockPos, BlockState, BlockState, BlockState, BlockPos)}
*/
public static final TagKey<Block> ENDERMAN_PLACE_ON_BLACKLIST = neoforgeTag("enderman_place_on_blacklist");

/**
* For denoting blocks that need tools that are Wood or higher to mine.
* By default, this is not added to any Minecraft tag since Wood is in the lowest "tier".
*/
public static final TagKey<Block> NEEDS_WOOD_TOOL = neoforgeTag("needs_wood_tool");

/**
* For denoting blocks that need tools that are Gold or higher to mine.
* By default, this is not added to any Minecraft tag since Gold is in the lowest "tier".
*/
public static final TagKey<Block> NEEDS_GOLD_TOOL = neoforgeTag("needs_gold_tool");

/**
* For denoting blocks that need tools that are Netherite or higher to mine.
* Blocks in this tag gets added to the following Minecraft tags:
* {@link BlockTags#INCORRECT_FOR_WOODEN_TOOL}
* {@link BlockTags#INCORRECT_FOR_STONE_TOOL}
* {@link BlockTags#INCORRECT_FOR_IRON_TOOL}
* {@link BlockTags#INCORRECT_FOR_GOLD_TOOL}
* {@link BlockTags#INCORRECT_FOR_DIAMOND_TOOL}
*/
public static final TagKey<Block> NEEDS_NETHERITE_TOOL = neoforgeTag("needs_netherite_tool");

// `c` tags for common conventions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,14 @@ public void addTags(HolderLookup.Provider p_256380_) {

tag(Tags.Blocks.VILLAGER_FARMLANDS).add(Blocks.FARMLAND);

// Make our Needs Netherite Tool tag be functional.
tag(Tags.Blocks.NEEDS_NETHERITE_TOOL);
tag(BlockTags.INCORRECT_FOR_WOODEN_TOOL).addTag(Tags.Blocks.NEEDS_NETHERITE_TOOL);
tag(BlockTags.INCORRECT_FOR_STONE_TOOL).addTag(Tags.Blocks.NEEDS_NETHERITE_TOOL);
tag(BlockTags.INCORRECT_FOR_IRON_TOOL).addTag(Tags.Blocks.NEEDS_NETHERITE_TOOL);
tag(BlockTags.INCORRECT_FOR_GOLD_TOOL).addTag(Tags.Blocks.NEEDS_NETHERITE_TOOL);
tag(BlockTags.INCORRECT_FOR_DIAMOND_TOOL).addTag(Tags.Blocks.NEEDS_NETHERITE_TOOL);

// Backwards compat with pre-1.21 tags. Done after so optional tag is last for better readability.
// TODO: Remove backwards compat tag entries in 1.22
tagWithOptionalLegacy(Tags.Blocks.BARRELS);
Expand Down

0 comments on commit b296685

Please sign in to comment.