mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-24 11:38:29 +01:00
Use createNMSItemStack on CraftingManager recipe registration. Fixes BUKKIT-602
This commit is contained in:
parent
1c28c946fa
commit
7076ef9de6
@ -24,11 +24,7 @@ public class CraftFurnaceRecipe extends FurnaceRecipe implements CraftRecipe {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void addToCraftingManager() {
|
public void addToCraftingManager() {
|
||||||
ItemStack result = this.getResult();
|
|
||||||
MaterialData input = this.getInput();
|
MaterialData input = this.getInput();
|
||||||
int id = result.getTypeId();
|
FurnaceRecipes.getInstance().registerRecipe(input.getItemTypeId(), CraftItemStack.createNMSItemStack(this.getResult()));
|
||||||
int amount = result.getAmount();
|
|
||||||
int dmg = result.getDurability();
|
|
||||||
FurnaceRecipes.getInstance().registerRecipe(input.getItemTypeId(), new net.minecraft.server.ItemStack(id, amount, dmg));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,9 +46,6 @@ public class CraftShapedRecipe extends ShapedRecipe implements CraftRecipe {
|
|||||||
data[i] = new net.minecraft.server.ItemStack(id, 1, dmg);
|
data[i] = new net.minecraft.server.ItemStack(id, 1, dmg);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
int id = this.getResult().getTypeId();
|
CraftingManager.getInstance().registerShapedRecipe(CraftItemStack.createNMSItemStack(this.getResult()), data);
|
||||||
int amount = this.getResult().getAmount();
|
|
||||||
short durability = this.getResult().getDurability();
|
|
||||||
CraftingManager.getInstance().registerShapedRecipe(new net.minecraft.server.ItemStack(id, amount, durability), data);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,9 +34,6 @@ public class CraftShapelessRecipe extends ShapelessRecipe implements CraftRecipe
|
|||||||
data[i] = new net.minecraft.server.ItemStack(id, 1, dmg);
|
data[i] = new net.minecraft.server.ItemStack(id, 1, dmg);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
int id = this.getResult().getTypeId();
|
CraftingManager.getInstance().registerShapelessRecipe(CraftItemStack.createNMSItemStack(this.getResult()), data);
|
||||||
int amount = this.getResult().getAmount();
|
|
||||||
short durability = this.getResult().getDurability();
|
|
||||||
CraftingManager.getInstance().registerShapelessRecipe(new net.minecraft.server.ItemStack(id, amount, durability), data);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user