mirror of
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
synced 2025-08-31 06:01:26 +00:00
SPIGOT-4842: Dummy recipes should not give AIR as result type
This commit is contained in:
parent
d352c12654
commit
4e74934cd0
4 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue