summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-11-03 21:04:33 +1100
committermd_5 <git@md-5.net>2018-11-03 21:04:33 +1100
commitf0398e444e43a9c63249e668eb85f5fecbb4b6db (patch)
treef6e90e715de2b19419e371ba5ff6556fc017368a /src
parent96c461b3a528611ab4d4e22d71c63e10f9a1d034 (diff)
downloadcraftbukkit-f0398e444e43a9c63249e668eb85f5fecbb4b6db.tar
craftbukkit-f0398e444e43a9c63249e668eb85f5fecbb4b6db.tar.gz
craftbukkit-f0398e444e43a9c63249e668eb85f5fecbb4b6db.tar.lz
craftbukkit-f0398e444e43a9c63249e668eb85f5fecbb4b6db.tar.xz
craftbukkit-f0398e444e43a9c63249e668eb85f5fecbb4b6db.zip
SPIGOT-4438: Add choice API to furnace recipes
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/inventory/CraftFurnaceRecipe.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftFurnaceRecipe.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftFurnaceRecipe.java
index a3c3f6e3..4ae2fafb 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftFurnaceRecipe.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftFurnaceRecipe.java
@@ -1,24 +1,22 @@
package org.bukkit.craftbukkit.inventory;
-import java.util.stream.Stream;
import net.minecraft.server.MinecraftServer;
-import net.minecraft.server.RecipeItemStack;
-
import org.bukkit.NamespacedKey;
import org.bukkit.craftbukkit.util.CraftNamespacedKey;
import org.bukkit.inventory.FurnaceRecipe;
import org.bukkit.inventory.ItemStack;
+import org.bukkit.inventory.RecipeChoice;
public class CraftFurnaceRecipe extends FurnaceRecipe implements CraftRecipe {
- public CraftFurnaceRecipe(NamespacedKey key, ItemStack result, ItemStack source, float experience, int cookingTime) {
- super(key, result, source.getType(), source.getDurability(), experience, cookingTime);
+ public CraftFurnaceRecipe(NamespacedKey key, ItemStack result, RecipeChoice source, float experience, int cookingTime) {
+ super(key, result, source, experience, cookingTime);
}
public static CraftFurnaceRecipe fromBukkitRecipe(FurnaceRecipe recipe) {
if (recipe instanceof CraftFurnaceRecipe) {
return (CraftFurnaceRecipe) recipe;
}
- CraftFurnaceRecipe ret = new CraftFurnaceRecipe(recipe.getKey(), recipe.getResult(), recipe.getInput(), recipe.getExperience(), recipe.getCookingTime());
+ CraftFurnaceRecipe ret = new CraftFurnaceRecipe(recipe.getKey(), recipe.getResult(), recipe.getInputChoice(), recipe.getExperience(), recipe.getCookingTime());
ret.setGroup(recipe.getGroup());
return ret;
}
@@ -26,8 +24,7 @@ public class CraftFurnaceRecipe extends FurnaceRecipe implements CraftRecipe {
@Override
public void addToCraftingManager() {
ItemStack result = this.getResult();
- RecipeItemStack input = new RecipeItemStack(Stream.of(new RecipeItemStack.StackProvider(CraftItemStack.asNMSCopy(this.getInput()))));
- MinecraftServer.getServer().getCraftingManager().a(new net.minecraft.server.FurnaceRecipe(CraftNamespacedKey.toMinecraft(this.getKey()), this.getGroup(), input, CraftItemStack.asNMSCopy(result), getExperience(), getCookingTime()));
+ MinecraftServer.getServer().getCraftingManager().a(new net.minecraft.server.FurnaceRecipe(CraftNamespacedKey.toMinecraft(this.getKey()), this.getGroup(), toNMS(this.getInputChoice()), CraftItemStack.asNMSCopy(result), getExperience(), getCookingTime()));
}
}