4
4
import net .minecraft .inventory .Inventory ;
5
5
import net .minecraft .item .ItemStack ;
6
6
import net .minecraft .network .PacketByteBuf ;
7
- import net .minecraft .recipe .Ingredient ;
8
- import net .minecraft .recipe .RecipeSerializer ;
9
- import net .minecraft .recipe .ShapedRecipe ;
10
- import net .minecraft .recipe .SmithingRecipe ;
7
+ import net .minecraft .recipe .*;
11
8
import net .minecraft .registry .DynamicRegistryManager ;
12
9
import net .minecraft .util .Identifier ;
13
10
import net .minecraft .util .JsonHelper ;
14
11
import net .minecraft .world .World ;
15
12
import nourl .mythicmetals .registry .RegisterRecipeSerializers ;
16
13
17
- public class DrillUpgradeSmithingRecipe implements SmithingRecipe {
14
+ public class DrillUpgradeSmithingRecipe extends LegacySmithingRecipe implements SmithingRecipe {
18
15
final Ingredient base ;
19
16
final Ingredient addition ;
20
- final Ingredient template ;
17
+ // final Ingredient template;
21
18
final ItemStack result ;
22
19
final Identifier id ;
23
20
24
- public DrillUpgradeSmithingRecipe (Ingredient base , Ingredient addition , Ingredient template , ItemStack result , Identifier id ) {
21
+ public DrillUpgradeSmithingRecipe (Ingredient base , Ingredient addition , ItemStack result , Identifier id ) {
22
+ super (id , base , addition , result );
25
23
this .base = base ;
26
24
this .addition = addition ;
27
- this .template = template ;
25
+ // this.template = template;
28
26
this .result = result ;
29
27
this .id = id ;
30
28
}
@@ -82,7 +80,8 @@ public RecipeSerializer<?> getSerializer() {
82
80
83
81
@ Override
84
82
public boolean testTemplate (ItemStack stack ) {
85
- return this .template .test (stack );
83
+ return false ;
84
+ //return this.template.test(stack);
86
85
}
87
86
88
87
@ Override
@@ -97,19 +96,19 @@ public boolean testAddition(ItemStack stack) {
97
96
98
97
public static class Serializer implements RecipeSerializer <DrillUpgradeSmithingRecipe > {
99
98
public DrillUpgradeSmithingRecipe read (Identifier identifier , JsonObject jsonObject ) {
100
- Ingredient ingredient = Ingredient .fromJson (JsonHelper .getObject (jsonObject , "base" ));
101
- Ingredient ingredient2 = Ingredient .fromJson (JsonHelper .getObject (jsonObject , "addition" ));
102
- Ingredient ingredient3 = Ingredient .fromJson (JsonHelper .getObject (jsonObject , "addition " ));
99
+ Ingredient base = Ingredient .fromJson (JsonHelper .getObject (jsonObject , "base" ));
100
+ Ingredient addition = Ingredient .fromJson (JsonHelper .getObject (jsonObject , "addition" ));
101
+ // Ingredient template = Ingredient.fromJson(JsonHelper.getObject(jsonObject, "template "));
103
102
ItemStack itemStack = ShapedRecipe .outputFromJson (JsonHelper .getObject (jsonObject , "result" ));
104
- return new DrillUpgradeSmithingRecipe (ingredient , ingredient2 , ingredient3 , itemStack , identifier );
103
+ return new DrillUpgradeSmithingRecipe (base , addition , itemStack , identifier );
105
104
}
106
105
107
106
public DrillUpgradeSmithingRecipe read (Identifier identifier , PacketByteBuf packetByteBuf ) {
108
- Ingredient ingredient = Ingredient .fromPacket (packetByteBuf );
109
- Ingredient ingredient2 = Ingredient .fromPacket (packetByteBuf );
110
- Ingredient ingredient3 = Ingredient .fromPacket (packetByteBuf );
107
+ Ingredient base = Ingredient .fromPacket (packetByteBuf );
108
+ Ingredient addition = Ingredient .fromPacket (packetByteBuf );
109
+ // Ingredient template = Ingredient.fromPacket(packetByteBuf);
111
110
ItemStack itemStack = packetByteBuf .readItemStack ();
112
- return new DrillUpgradeSmithingRecipe (ingredient , ingredient2 , ingredient3 , itemStack , identifier );
111
+ return new DrillUpgradeSmithingRecipe (base , addition , itemStack , identifier );
113
112
}
114
113
115
114
public void write (PacketByteBuf packetByteBuf , DrillUpgradeSmithingRecipe smithingRecipe ) {
0 commit comments