@@ -29,19 +29,14 @@ public static DecomposerRecipe add(DecomposerRecipe recipe)
29
29
{
30
30
return null ;
31
31
}
32
- recipes .put (getKey (recipe .input ), recipe );
32
+ recipes .put (MapKey . getKey (recipe .input ), recipe );
33
33
} else if (recipe instanceof DecomposerFluidRecipe && ((DecomposerFluidRecipe ) recipe ).inputFluid != null )
34
34
{
35
- recipes .put (getKey (((DecomposerFluidRecipe ) recipe ).inputFluid ), recipe );
35
+ recipes .put (MapKey . getKey (((DecomposerFluidRecipe ) recipe ).inputFluid ), recipe );
36
36
}
37
37
return recipe ;
38
38
}
39
39
40
- public static DecomposerRecipe get (String string )
41
- {
42
- return recipes .get (string );
43
- }
44
-
45
40
public static DecomposerRecipe remove (String string )
46
41
{
47
42
if (recipes .containsKey (string ))
@@ -53,9 +48,10 @@ public static DecomposerRecipe remove(String string)
53
48
54
49
public static DecomposerRecipe remove (ItemStack itemStack )
55
50
{
56
- if (recipes .containsKey (getKey (itemStack )))
51
+ MapKey key = MapKey .getKey (itemStack );
52
+ if (key !=null &&recipes .containsKey (key ))
57
53
{
58
- return recipes .remove (getKey ( itemStack ) );
54
+ return recipes .remove (key );
59
55
}
60
56
return null ;
61
57
}
@@ -65,24 +61,16 @@ public static DecomposerRecipe remove(MapKey key)
65
61
return recipes .remove (key );
66
62
}
67
63
68
- public static MapKey getKey (ItemStack itemStack )
69
- {
70
- return new MapKey (itemStack );
71
- }
72
-
73
- public static MapKey getKey (FluidStack fluidStack )
64
+ public static DecomposerRecipe get (ItemStack itemStack )
74
65
{
75
- return new MapKey (fluidStack );
66
+ if (itemStack ==null || itemStack .getItem ()==null ) return null ;
67
+ return get (MapKey .getKey (itemStack ));
76
68
}
77
69
78
- public static DecomposerRecipe get (ItemStack item )
70
+ public static DecomposerRecipe get (FluidStack fluidStack )
79
71
{
80
- return get (getKey (item ));
81
- }
82
-
83
- public static DecomposerRecipe get (FluidStack item )
84
- {
85
- return get (getKey (item ));
72
+ if (fluidStack ==null ) return null ;
73
+ return get (MapKey .getKey (fluidStack ));
86
74
}
87
75
88
76
public static DecomposerRecipe get (MapKey key )
@@ -157,13 +145,6 @@ public ArrayList<PotionChemical> getOutput()
157
145
return result ;
158
146
}
159
147
160
- public static PotionChemical getPotionKey (PotionChemical potion )
161
- {
162
- PotionChemical key = potion .copy ();
163
- key .amount = 1 ;
164
- return key ;
165
- }
166
-
167
148
public ArrayList <PotionChemical > getOutputRaw ()
168
149
{
169
150
ArrayList <PotionChemical > result = new ArrayList <PotionChemical >();
0 commit comments