Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.21.1] Make Neoforge's Needs Netherite Tool block tag be added to vanilla's incorrect block tags #1658

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 by default, 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 by default, Gold is in the lowest "tier".
TelepathicGrunt marked this conversation as resolved.
Show resolved Hide resolved
*/
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