|
18 | 18 | public static final ResourceLocation BASE_ATTACK_DAMAGE_ID = ResourceLocation.withDefaultNamespace("base_attack_damage");
|
19 | 19 | public static final ResourceLocation BASE_ATTACK_SPEED_ID = ResourceLocation.withDefaultNamespace("base_attack_speed");
|
20 | 20 | public static final int DEFAULT_MAX_STACK_SIZE = 64;
|
21 |
| -@@ -110,7 +_,7 @@ |
| 21 | +@@ -110,12 +_,13 @@ |
22 | 22 | this.components = p_41383_.buildAndValidateComponents(Component.translatable(this.descriptionId), p_41383_.effectiveModel());
|
23 | 23 | this.craftingRemainingItem = p_41383_.craftingRemainingItem;
|
24 | 24 | this.requiredFeatures = p_41383_.requiredFeatures;
|
|
27 | 27 | String s = this.getClass().getSimpleName();
|
28 | 28 | if (!s.endsWith("Item")) {
|
29 | 29 | LOGGER.error("Item classes should end with Item and {} doesn't.", s);
|
| 30 | + } |
| 31 | + } |
| 32 | ++ this.canCombineRepair = p_41383_.canCombineRepair; |
| 33 | + } |
| 34 | + |
| 35 | + @Deprecated |
30 | 36 | @@ -127,6 +_,15 @@
|
31 | 37 | return this.components;
|
32 | 38 | }
|
|
76 | 82 | public final ItemStack getCraftingRemainder() {
|
77 | 83 | return this.craftingRemainingItem == null ? ItemStack.EMPTY : new ItemStack(this.craftingRemainingItem);
|
78 | 84 | }
|
79 |
| -@@ -302,7 +_,12 @@ |
| 85 | +@@ -302,7 +_,14 @@ |
80 | 86 | }
|
81 | 87 |
|
82 | 88 | public boolean useOnRelease(ItemStack p_41464_) {
|
83 | 89 | - return false;
|
84 | 90 | + return p_41464_.getItem() == Items.CROSSBOW;
|
85 | 91 | + }
|
86 | 92 | +
|
| 93 | ++ protected final boolean canCombineRepair; |
| 94 | ++ |
87 | 95 | + @Override
|
88 |
| -+ public boolean isRepairable(ItemStack stack) { |
89 |
| -+ return stack.has(DataComponents.REPAIRABLE) && isDamageable(stack); |
| 96 | ++ public boolean isCombineRepairable(ItemStack stack) { |
| 97 | ++ return canCombineRepair && isDamageable(stack); |
90 | 98 | }
|
91 | 99 |
|
92 | 100 | public ItemStack getDefaultInstance() {
|
|
99 | 107 | private static final DependantName<Item, String> BLOCK_DESCRIPTION_ID = p_371954_ -> Util.makeDescriptionId("block", p_371954_.location());
|
100 | 108 | private static final DependantName<Item, String> ITEM_DESCRIPTION_ID = p_371511_ -> Util.makeDescriptionId("item", p_371511_.location());
|
101 | 109 | private final DataComponentMap.Builder components = DataComponentMap.builder().addAll(DataComponents.COMMON_ITEM_COMPONENTS);
|
| 110 | +@@ -337,6 +_,12 @@ |
| 111 | + private ResourceKey<Item> id; |
| 112 | + private DependantName<Item, String> descriptionId = ITEM_DESCRIPTION_ID; |
| 113 | + private DependantName<Item, ResourceLocation> model = ResourceKey::location; |
| 114 | ++ private boolean canCombineRepair = true; |
| 115 | ++ |
| 116 | ++ public Item.Properties setNoCombineRepair() { |
| 117 | ++ canCombineRepair = false; |
| 118 | ++ return this; |
| 119 | ++ } |
| 120 | + |
| 121 | + public Item.Properties food(FoodProperties p_41490_) { |
| 122 | + return this.food(p_41490_, Consumables.DEFAULT_FOOD); |
102 | 123 | @@ -437,6 +_,7 @@
|
103 | 124 | }
|
104 | 125 |
|
|
0 commit comments