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:
Ursprung
191b0147cd
Commit
04ff31073b
@ -42,6 +42,7 @@ public abstract class CookingRecipe<T extends CookingRecipe> implements Recipe,
|
|||||||
* @param cookingTime The cooking time (in ticks)
|
* @param cookingTime The cooking time (in ticks)
|
||||||
*/
|
*/
|
||||||
public CookingRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull RecipeChoice input, float experience, int cookingTime) {
|
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.key = key;
|
||||||
this.output = new ItemStack(result);
|
this.output = new ItemStack(result);
|
||||||
this.ingredient = input;
|
this.ingredient = input;
|
||||||
|
@ -23,6 +23,7 @@ public class ShapedRecipe implements Recipe, Keyed {
|
|||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public ShapedRecipe(@NotNull ItemStack result) {
|
public ShapedRecipe(@NotNull ItemStack result) {
|
||||||
|
Preconditions.checkArgument(result.getType() != Material.AIR, "Recipe must have non-AIR result.");
|
||||||
this.key = NamespacedKey.randomKey();
|
this.key = NamespacedKey.randomKey();
|
||||||
this.output = new ItemStack(result);
|
this.output = new ItemStack(result);
|
||||||
}
|
}
|
||||||
@ -41,6 +42,7 @@ public class ShapedRecipe implements Recipe, Keyed {
|
|||||||
*/
|
*/
|
||||||
public ShapedRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result) {
|
public ShapedRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result) {
|
||||||
Preconditions.checkArgument(key != null, "key");
|
Preconditions.checkArgument(key != null, "key");
|
||||||
|
Preconditions.checkArgument(result.getType() != Material.AIR, "Recipe must have non-AIR result.");
|
||||||
|
|
||||||
this.key = key;
|
this.key = key;
|
||||||
this.output = new ItemStack(result);
|
this.output = new ItemStack(result);
|
||||||
|
@ -24,6 +24,7 @@ public class ShapelessRecipe implements Recipe, Keyed {
|
|||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public ShapelessRecipe(@NotNull ItemStack result) {
|
public ShapelessRecipe(@NotNull ItemStack result) {
|
||||||
|
Preconditions.checkArgument(result.getType() != Material.AIR, "Recipe must have non-AIR result.");
|
||||||
this.key = NamespacedKey.randomKey();
|
this.key = NamespacedKey.randomKey();
|
||||||
this.output = new ItemStack(result);
|
this.output = new ItemStack(result);
|
||||||
}
|
}
|
||||||
@ -43,6 +44,7 @@ public class ShapelessRecipe implements Recipe, Keyed {
|
|||||||
* @see ShapelessRecipe#addIngredient(int,Material,int)
|
* @see ShapelessRecipe#addIngredient(int,Material,int)
|
||||||
*/
|
*/
|
||||||
public ShapelessRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result) {
|
public ShapelessRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result) {
|
||||||
|
Preconditions.checkArgument(result.getType() != Material.AIR, "Recipe must have non-AIR result.");
|
||||||
this.key = key;
|
this.key = key;
|
||||||
this.output = new ItemStack(result);
|
this.output = new ItemStack(result);
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@ public class StonecuttingRecipe implements Recipe, Keyed {
|
|||||||
* @param input The input choices.
|
* @param input The input choices.
|
||||||
*/
|
*/
|
||||||
public StonecuttingRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull RecipeChoice input) {
|
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.key = key;
|
||||||
this.output = new ItemStack(result);
|
this.output = new ItemStack(result);
|
||||||
this.ingredient = input;
|
this.ingredient = input;
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren