Skip to content

Commit

Permalink
Remove hard coding on AbstractSkeleton.canFireProjectileWeapon
Browse files Browse the repository at this point in the history
  • Loading branch information
ZestyBlaze committed Oct 10, 2024
1 parent b88c1e1 commit d3d26b1
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 0 deletions.
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_.getDefaultInstance().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

0 comments on commit d3d26b1

Please sign in to comment.