Updated Upstream (Bukkit/CraftBukkit/Spigot)
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Please note that this build includes changes to meet upstreams requirements for nullability annotations. While we aim for a level of accuracy, these might not be 100% correct, if there are any issues, please speak to us on discord, or open an issue on the tracker to discuss. Bukkit Changes: 9a6a1de3 Remove nullability annotations from enum constructors 3f0591ea SPIGOT-2540: Add nullability annotations to entire Bukkit API CraftBukkit Changes: 8d8475fc SPIGOT-4666: Force parameter in HumanEntity#sleep 8b1588e2 Fix ExplosionPrimeEvent#setFire not working with EnderCrystals 39a287b7 Don't ignore newlines in PlayerListHeader/Footer Spigot Changes: cf694d87 Add nullability annotations
This commit is contained in:
parent
2b722719b3
commit
a7ba5db3de
260 changed files with 2328 additions and 2021 deletions
|
@ -6,7 +6,7 @@ Subject: [PATCH] Add ItemStack Recipe API helper methods
|
|||
Allows using ExactChoice Recipes with easier methodss
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/inventory/ShapedRecipe.java b/src/main/java/org/bukkit/inventory/ShapedRecipe.java
|
||||
index 80af6cf5..3eae5a55 100644
|
||||
index 64a43f426..76b2dd7cb 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ShapedRecipe.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ShapedRecipe.java
|
||||
@@ -0,0 +0,0 @@ public class ShapedRecipe implements Recipe, Keyed {
|
||||
|
@ -14,7 +14,8 @@ index 80af6cf5..3eae5a55 100644
|
|||
}
|
||||
|
||||
+ // Paper start
|
||||
+ public ShapedRecipe setIngredient(char key, ItemStack item) {
|
||||
+ @NotNull
|
||||
+ public ShapedRecipe setIngredient(char key, @NotNull ItemStack item) {
|
||||
+ return setIngredient(key, new RecipeChoice.ExactChoice(item));
|
||||
+ }
|
||||
+ // Paper end
|
||||
|
@ -23,7 +24,7 @@ index 80af6cf5..3eae5a55 100644
|
|||
* Get a copy of the ingredients map.
|
||||
*
|
||||
diff --git a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
|
||||
index 7347e746..4de38b33 100644
|
||||
index 46a398e88..818bf2936 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
|
||||
@@ -0,0 +0,0 @@ public class ShapelessRecipe implements Recipe, Keyed {
|
||||
|
@ -31,20 +32,27 @@ index 7347e746..4de38b33 100644
|
|||
}
|
||||
|
||||
+ // Paper start
|
||||
+ public ShapelessRecipe addIngredient(ItemStack item) {
|
||||
+ @NotNull
|
||||
+ public ShapelessRecipe addIngredient(@NotNull ItemStack item) {
|
||||
+ return addIngredient(1, item);
|
||||
+ }
|
||||
+ public ShapelessRecipe addIngredient(int count, ItemStack item) {
|
||||
+
|
||||
+ @NotNull
|
||||
+ public ShapelessRecipe addIngredient(int count, @NotNull ItemStack item) {
|
||||
+ Validate.isTrue(ingredients.size() + count <= 9, "Shapeless recipes cannot have more than 9 ingredients");
|
||||
+ while (count-- > 0) {
|
||||
+ ingredients.add(new RecipeChoice.ExactChoice(item));
|
||||
+ }
|
||||
+ return this;
|
||||
+ }
|
||||
+ public ShapelessRecipe removeIngredient(ItemStack item) {
|
||||
+
|
||||
+ @NotNull
|
||||
+ public ShapelessRecipe removeIngredient(@NotNull ItemStack item) {
|
||||
+ return removeIngredient(1, item);
|
||||
+ }
|
||||
+ public ShapelessRecipe removeIngredient(int count, ItemStack item) {
|
||||
+
|
||||
+ @NotNull
|
||||
+ public ShapelessRecipe removeIngredient(int count, @NotNull ItemStack item) {
|
||||
+ Iterator<RecipeChoice> iterator = ingredients.iterator();
|
||||
+ while (count > 0 && iterator.hasNext()) {
|
||||
+ ItemStack stack = iterator.next().getItemStack();
|
||||
|
@ -57,7 +65,7 @@ index 7347e746..4de38b33 100644
|
|||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
public ShapelessRecipe addIngredient(RecipeChoice ingredient) {
|
||||
Validate.isTrue(ingredients.size() + 1 <= 9, "Shapeless recipes cannot have more than 9 ingredients");
|
||||
|
||||
/**
|
||||
* Removes an ingredient from the list.
|
||||
*
|
||||
--
|
Loading…
Add table
Add a link
Reference in a new issue