13
0
geforkt von Mirrors/Paper

SPIGOT-4842: Dummy recipes should not give AIR as result type

By: md_5 <git@md-5.net>
Dieser Commit ist enthalten in:
Bukkit/Spigot 2019-05-03 17:40:15 +10:00
Ursprung 191b0147cd
Commit 04ff31073b
4 geänderte Dateien mit 6 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -42,6 +42,7 @@ public abstract class CookingRecipe<T extends CookingRecipe> implements Recipe,
* @param cookingTime The cooking time (in ticks)
*/
public CookingRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull RecipeChoice input, float experience, int cookingTime) {
Preconditions.checkArgument(result.getType() != Material.AIR, "Recipe must have non-AIR result.");
this.key = key;
this.output = new ItemStack(result);
this.ingredient = input;

Datei anzeigen

@ -23,6 +23,7 @@ public class ShapedRecipe implements Recipe, Keyed {
@Deprecated
public ShapedRecipe(@NotNull ItemStack result) {
Preconditions.checkArgument(result.getType() != Material.AIR, "Recipe must have non-AIR result.");
this.key = NamespacedKey.randomKey();
this.output = new ItemStack(result);
}
@ -41,6 +42,7 @@ public class ShapedRecipe implements Recipe, Keyed {
*/
public ShapedRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result) {
Preconditions.checkArgument(key != null, "key");
Preconditions.checkArgument(result.getType() != Material.AIR, "Recipe must have non-AIR result.");
this.key = key;
this.output = new ItemStack(result);

Datei anzeigen

@ -24,6 +24,7 @@ public class ShapelessRecipe implements Recipe, Keyed {
@Deprecated
public ShapelessRecipe(@NotNull ItemStack result) {
Preconditions.checkArgument(result.getType() != Material.AIR, "Recipe must have non-AIR result.");
this.key = NamespacedKey.randomKey();
this.output = new ItemStack(result);
}
@ -43,6 +44,7 @@ public class ShapelessRecipe implements Recipe, Keyed {
* @see ShapelessRecipe#addIngredient(int,Material,int)
*/
public ShapelessRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result) {
Preconditions.checkArgument(result.getType() != Material.AIR, "Recipe must have non-AIR result.");
this.key = key;
this.output = new ItemStack(result);
}

Datei anzeigen

@ -35,6 +35,7 @@ public class StonecuttingRecipe implements Recipe, Keyed {
* @param input The input choices.
*/
public StonecuttingRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull RecipeChoice input) {
Preconditions.checkArgument(result.getType() != Material.AIR, "Recipe must have non-AIR result.");
this.key = key;
this.output = new ItemStack(result);
this.ingredient = input;