geforkt von Mirrors/Paper
Map old wildcard recipe data to new 1.5 value. Fixes BUKKIT-3849
By: Travis Watkins <amaranth@ubuntu.com>
Dieser Commit ist enthalten in:
Ursprung
d347286b22
Commit
0dc86a08f3
@ -96,6 +96,12 @@ public class ShapedRecipe implements Recipe {
|
||||
*/
|
||||
public ShapedRecipe setIngredient(char key, Material ingredient, int raw) {
|
||||
Validate.isTrue(ingredients.containsKey(key), "Symbol does not appear in the shape:", key);
|
||||
|
||||
// -1 is the old wildcard, map to Short.MAX_VALUE as the new one
|
||||
if (raw == -1) {
|
||||
raw = Short.MAX_VALUE;
|
||||
}
|
||||
|
||||
ingredients.put(key, new ItemStack(ingredient, 1, (short) raw));
|
||||
return this;
|
||||
}
|
||||
|
@ -97,6 +97,11 @@ public class ShapelessRecipe implements Recipe {
|
||||
public ShapelessRecipe addIngredient(int count, Material ingredient, int rawdata) {
|
||||
Validate.isTrue(ingredients.size() + count <= 9, "Shapeless recipes cannot have more than 9 ingredients");
|
||||
|
||||
// -1 is the old wildcard, map to Short.MAX_VALUE as the new one
|
||||
if (rawdata == -1) {
|
||||
rawdata = Short.MAX_VALUE;
|
||||
}
|
||||
|
||||
while (count-- > 0) {
|
||||
ingredients.add(new ItemStack(ingredient, 1, (short) rawdata));
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren