Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 20:40:08 +01:00
Fix unbound shaped recipe ingredients
Dieser Commit ist enthalten in:
Ursprung
4c219e2a12
Commit
dc69d2b3db
@ -1,5 +1,6 @@
|
|||||||
package org.bukkit.craftbukkit.inventory;
|
package org.bukkit.craftbukkit.inventory;
|
||||||
|
|
||||||
|
import net.minecraft.server.RecipeItemStack;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.Recipe;
|
import org.bukkit.inventory.Recipe;
|
||||||
import org.bukkit.inventory.RecipeChoice;
|
import org.bukkit.inventory.RecipeChoice;
|
||||||
@ -9,8 +10,10 @@ public interface CraftRecipe extends Recipe {
|
|||||||
void addToCraftingManager();
|
void addToCraftingManager();
|
||||||
|
|
||||||
default net.minecraft.server.RecipeItemStack toNMS(RecipeChoice bukkit) {
|
default net.minecraft.server.RecipeItemStack toNMS(RecipeChoice bukkit) {
|
||||||
if (bukkit instanceof RecipeChoice.MaterialChoice) {
|
if (bukkit == null) {
|
||||||
return new net.minecraft.server.RecipeItemStack(((RecipeChoice.MaterialChoice) bukkit).getChoices().stream().map((mat) -> new net.minecraft.server.RecipeItemStack.StackProvider(CraftItemStack.asNMSCopy(new ItemStack(mat)))));
|
return RecipeItemStack.a;
|
||||||
|
} else if (bukkit instanceof RecipeChoice.MaterialChoice) {
|
||||||
|
return new RecipeItemStack(((RecipeChoice.MaterialChoice) bukkit).getChoices().stream().map((mat) -> new net.minecraft.server.RecipeItemStack.StackProvider(CraftItemStack.asNMSCopy(new ItemStack(mat)))));
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalArgumentException("Unknown recipe stack instance " + bukkit);
|
throw new IllegalArgumentException("Unknown recipe stack instance " + bukkit);
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren