@@ -22,7 +22,7 @@
|
||||
- Map<Recipes<?>, Builder<MinecraftKey, IRecipe<?>>> map1 = Maps.newHashMap();
|
||||
+ // CraftBukkit start - SPIGOT-5667 make sure all types are populated and mutable
|
||||
+ Map<Recipes<?>, Object2ObjectLinkedOpenHashMap<MinecraftKey, IRecipe<?>>> map1 = Maps.newHashMap();
|
||||
+ for (Recipes<?> recipeType : IRegistry.RECIPE_TYPE) {
|
||||
+ for (Recipes<?> recipeType : BuiltInRegistries.RECIPE_TYPE) {
|
||||
+ map1.put(recipeType, new Object2ObjectLinkedOpenHashMap<>());
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
@@ -153,7 +153,7 @@
|
||||
+ public void clearRecipes() {
|
||||
+ this.recipes = Maps.newHashMap();
|
||||
+
|
||||
+ for (Recipes<?> recipeType : IRegistry.RECIPE_TYPE) {
|
||||
+ for (Recipes<?> recipeType : BuiltInRegistries.RECIPE_TYPE) {
|
||||
+ this.recipes.put(recipeType, new Object2ObjectLinkedOpenHashMap<>());
|
||||
+ }
|
||||
+
|
||||
|
||||
@@ -14,19 +14,22 @@
|
||||
+
|
||||
public class FurnaceRecipe extends RecipeCooking {
|
||||
|
||||
public FurnaceRecipe(MinecraftKey minecraftkey, String s, RecipeItemStack recipeitemstack, ItemStack itemstack, float f, int i) {
|
||||
@@ -19,4 +27,14 @@
|
||||
public FurnaceRecipe(MinecraftKey minecraftkey, String s, CookingBookCategory cookingbookcategory, RecipeItemStack recipeitemstack, ItemStack itemstack, float f, int i) {
|
||||
@@ -19,4 +27,17 @@
|
||||
public RecipeSerializer<?> getSerializer() {
|
||||
return RecipeSerializer.SMELTING_RECIPE;
|
||||
}
|
||||
+
|
||||
+ // CraftBukkit start
|
||||
+ @Override
|
||||
+ public Recipe toBukkitRecipe() {
|
||||
+ CraftItemStack result = CraftItemStack.asCraftMirror(this.result);
|
||||
+
|
||||
+ CraftFurnaceRecipe recipe = new CraftFurnaceRecipe(CraftNamespacedKey.fromMinecraft(this.id), result, CraftRecipe.toBukkit(this.ingredient), this.experience, this.cookingTime);
|
||||
+ recipe.setGroup(this.group);
|
||||
+ recipe.setCategory(CraftRecipe.getCategory(this.category()));
|
||||
+
|
||||
+ return recipe;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/world/item/crafting/IRecipeComplex.java
|
||||
+++ b/net/minecraft/world/item/crafting/IRecipeComplex.java
|
||||
@@ -25,4 +25,11 @@
|
||||
public ItemStack getResultItem() {
|
||||
return ItemStack.EMPTY;
|
||||
@@ -32,4 +32,11 @@
|
||||
public CraftingBookCategory category() {
|
||||
return this.category;
|
||||
}
|
||||
+
|
||||
+ // CraftBukkit start
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
+
|
||||
public class RecipeBlasting extends RecipeCooking {
|
||||
|
||||
public RecipeBlasting(MinecraftKey minecraftkey, String s, RecipeItemStack recipeitemstack, ItemStack itemstack, float f, int i) {
|
||||
@@ -19,4 +27,16 @@
|
||||
public RecipeBlasting(MinecraftKey minecraftkey, String s, CookingBookCategory cookingbookcategory, RecipeItemStack recipeitemstack, ItemStack itemstack, float f, int i) {
|
||||
@@ -19,4 +27,17 @@
|
||||
public RecipeSerializer<?> getSerializer() {
|
||||
return RecipeSerializer.BLASTING_RECIPE;
|
||||
}
|
||||
@@ -27,6 +27,7 @@
|
||||
+
|
||||
+ CraftBlastingRecipe recipe = new CraftBlastingRecipe(CraftNamespacedKey.fromMinecraft(this.id), result, CraftRecipe.toBukkit(this.ingredient), this.experience, this.cookingTime);
|
||||
+ recipe.setGroup(this.group);
|
||||
+ recipe.setCategory(CraftRecipe.getCategory(this.category()));
|
||||
+
|
||||
+ return recipe;
|
||||
+ }
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
+
|
||||
public class RecipeCampfire extends RecipeCooking {
|
||||
|
||||
public RecipeCampfire(MinecraftKey minecraftkey, String s, RecipeItemStack recipeitemstack, ItemStack itemstack, float f, int i) {
|
||||
@@ -19,4 +27,16 @@
|
||||
public RecipeCampfire(MinecraftKey minecraftkey, String s, CookingBookCategory cookingbookcategory, RecipeItemStack recipeitemstack, ItemStack itemstack, float f, int i) {
|
||||
@@ -19,4 +27,17 @@
|
||||
public RecipeSerializer<?> getSerializer() {
|
||||
return RecipeSerializer.CAMPFIRE_COOKING_RECIPE;
|
||||
}
|
||||
@@ -27,6 +27,7 @@
|
||||
+
|
||||
+ CraftCampfireRecipe recipe = new CraftCampfireRecipe(CraftNamespacedKey.fromMinecraft(this.id), result, CraftRecipe.toBukkit(this.ingredient), this.experience, this.cookingTime);
|
||||
+ recipe.setGroup(this.group);
|
||||
+ recipe.setCategory(CraftRecipe.getCategory(this.category()));
|
||||
+
|
||||
+ return recipe;
|
||||
+ }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/item/crafting/RecipeItemStack.java
|
||||
+++ b/net/minecraft/world/item/crafting/RecipeItemStack.java
|
||||
@@ -37,6 +37,7 @@
|
||||
@@ -38,6 +38,7 @@
|
||||
public ItemStack[] itemStacks;
|
||||
@Nullable
|
||||
private IntList stackingIds;
|
||||
@@ -8,19 +8,19 @@
|
||||
|
||||
public RecipeItemStack(Stream<? extends RecipeItemStack.Provider> stream) {
|
||||
this.values = (RecipeItemStack.Provider[]) stream.toArray((i) -> {
|
||||
@@ -74,6 +75,15 @@
|
||||
for (int j = 0; j < i; ++j) {
|
||||
ItemStack itemstack1 = aitemstack[j];
|
||||
@@ -69,6 +70,15 @@
|
||||
for (int j = 0; j < i; ++j) {
|
||||
ItemStack itemstack1 = aitemstack[j];
|
||||
|
||||
+ // CraftBukkit start
|
||||
+ if (exact) {
|
||||
+ if (itemstack1.getItem() == itemstack.getItem() && ItemStack.tagMatches(itemstack, itemstack1)) {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ continue;
|
||||
+ // CraftBukkit start
|
||||
+ if (exact) {
|
||||
+ if (itemstack1.getItem() == itemstack.getItem() && ItemStack.tagMatches(itemstack, itemstack1)) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
if (itemstack1.is(itemstack.getItem())) {
|
||||
return true;
|
||||
}
|
||||
+
|
||||
+ continue;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
if (itemstack1.is(itemstack.getItem())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
+
|
||||
public class RecipeSmoking extends RecipeCooking {
|
||||
|
||||
public RecipeSmoking(MinecraftKey minecraftkey, String s, RecipeItemStack recipeitemstack, ItemStack itemstack, float f, int i) {
|
||||
@@ -19,4 +27,16 @@
|
||||
public RecipeSmoking(MinecraftKey minecraftkey, String s, CookingBookCategory cookingbookcategory, RecipeItemStack recipeitemstack, ItemStack itemstack, float f, int i) {
|
||||
@@ -19,4 +27,17 @@
|
||||
public RecipeSerializer<?> getSerializer() {
|
||||
return RecipeSerializer.SMOKING_RECIPE;
|
||||
}
|
||||
@@ -27,6 +27,7 @@
|
||||
+
|
||||
+ CraftSmokingRecipe recipe = new CraftSmokingRecipe(CraftNamespacedKey.fromMinecraft(this.id), result, CraftRecipe.toBukkit(this.ingredient), this.experience, this.cookingTime);
|
||||
+ recipe.setGroup(this.group);
|
||||
+ recipe.setCategory(CraftRecipe.getCategory(this.category()));
|
||||
+
|
||||
+ return recipe;
|
||||
+ }
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
public class ShapedRecipes implements RecipeCrafting {
|
||||
|
||||
final int width;
|
||||
@@ -41,6 +48,66 @@
|
||||
@@ -43,6 +50,67 @@
|
||||
this.result = itemstack;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
+ CraftItemStack result = CraftItemStack.asCraftMirror(this.result);
|
||||
+ CraftShapedRecipe recipe = new CraftShapedRecipe(result, this);
|
||||
+ recipe.setGroup(this.group);
|
||||
+ recipe.setCategory(CraftRecipe.getCategory(this.category()));
|
||||
+
|
||||
+ switch (this.height) {
|
||||
+ case 1:
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
public class ShapelessRecipes implements RecipeCrafting {
|
||||
|
||||
private final MinecraftKey id;
|
||||
@@ -28,6 +34,20 @@
|
||||
@@ -30,6 +36,21 @@
|
||||
this.ingredients = nonnulllist;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
+ CraftItemStack result = CraftItemStack.asCraftMirror(this.result);
|
||||
+ CraftShapelessRecipe recipe = new CraftShapelessRecipe(result, this);
|
||||
+ recipe.setGroup(this.group);
|
||||
+ recipe.setCategory(CraftRecipe.getCategory(this.category()));
|
||||
+
|
||||
+ for (RecipeItemStack list : this.ingredients) {
|
||||
+ recipe.addIngredient(CraftRecipe.toBukkit(list));
|
||||
|
||||
Reference in New Issue
Block a user