mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-13 11:18:23 +01:00
SPIGOT-4842: Dummy recipes should not give AIR as result type
By: md_5 <git@md-5.net>
This commit is contained in:
parent
191b0147cd
commit
04ff31073b
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