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

Remove hard coding on AbstractSkeleton.canFireProjectileWeapon #1587

Open
wants to merge 3 commits into
base: 1.21.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
Expand Up @@ -24,3 +24,12 @@
double d0 = p_32141_.getX() - this.getX();
double d1 = p_32141_.getY(0.3333333333333333) - abstractarrow.getY();
double d2 = p_32141_.getZ() - this.getZ();
@@ -200,7 +_,7 @@

@Override
public boolean canFireProjectileWeapon(ProjectileWeaponItem p_32144_) {
- return p_32144_ == Items.BOW;
+ return p_32144_.builtInRegistryHolder().is(net.neoforged.neoforge.common.Tags.Items.SKELETON_USABLE_BOWS);
}

@Override
1 change: 1 addition & 0 deletions src/generated/resources/assets/c/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@
"tag.item.c.tools.spear": "Spears",
"tag.item.c.villager_job_sites": "Villager Job Sites",
"tag.item.neoforge.enchanting_fuels": "Enchanting Fuels",
"tag.item.neoforge.skeleton_usable_bows": "Skeleton Usable Bows",
"tag.worldgen.biome.c.hidden_from_locator_selection": "Hidden From Locator's Selection",
"tag.worldgen.biome.c.is_aquatic": "Aquatic",
"tag.worldgen.biome.c.is_aquatic_icy": "Aquatic Icy",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"minecraft:bow"
]
}
5 changes: 5 additions & 0 deletions src/main/java/net/neoforged/neoforge/common/Tags.java
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,11 @@ public static class Items {
* This tag defaults to {@link net.minecraft.world.item.Items#LAPIS_LAZULI} when not present in any datapacks, including forge client on vanilla server
*/
public static final TagKey<Item> ENCHANTING_FUELS = neoforgeTag("enchanting_fuels");
/**
* Controls what bows can be used by {@link net.minecraft.world.entity.monster.AbstractSkeleton}
* This tag defaults to {@link net.minecraft.world.item.Items#BOW} when not present in any datapacks, including forge client on vanilla server
*/
public static final TagKey<Item> SKELETON_USABLE_BOWS = neoforgeTag("skeleton_usable_bows");

// `c` tags for common conventions
public static final TagKey<Item> BARRELS = tag("barrels");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ public void addTags(HolderLookup.Provider lookupProvider) {
tag(Tags.Items.SEEDS_MELON).add(Items.MELON_SEEDS);
tag(Tags.Items.SEEDS_PUMPKIN).add(Items.PUMPKIN_SEEDS);
tag(Tags.Items.SEEDS_WHEAT).add(Items.WHEAT_SEEDS);
tag(Tags.Items.SKELETON_USABLE_BOWS).add(Items.BOW);
tag(Tags.Items.SLIMEBALLS).add(Items.SLIME_BALL); // Deprecated
tag(Tags.Items.SLIME_BALLS).add(Items.SLIME_BALL).addOptionalTag(Tags.Items.SLIMEBALLS);
tag(Tags.Items.SHULKER_BOXES)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ protected void addTranslations() {
add(Tags.Items.SEEDS_MELON, "Melon Seeds");
add(Tags.Items.SEEDS_PUMPKIN, "Pumpkin Seeds");
add(Tags.Items.SEEDS_WHEAT, "Wheat Seeds");
add(Tags.Items.SKELETON_USABLE_BOWS, "Skeleton Usable Bows");
add(Tags.Items.SHULKER_BOXES, "Shulker Boxes");
add(Tags.Items.SLIME_BALLS, "Slimeballs");
add(Tags.Items.SLIMEBALLS, "Slimeballs");
Expand Down