summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/ItemStack.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/minecraft/server/ItemStack.java')
-rw-r--r--src/main/java/net/minecraft/server/ItemStack.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
index 9c88f416..b19f5b08 100644
--- a/src/main/java/net/minecraft/server/ItemStack.java
+++ b/src/main/java/net/minecraft/server/ItemStack.java
@@ -39,6 +39,18 @@ public final class ItemStack {
this.setData(k); // CraftBukkit
}
+ // CraftBukkit - used to create a new ItemStack, specifying the enchantments at time of creation.
+ public ItemStack(int id, int count, int data, NBTTagList enchantments) {
+ this(id, count, data);
+ // taken from .addEnchantment
+ if (this.tag == null) {
+ this.setTag(new NBTTagCompound());
+ }
+
+ this.tag.set("ench", enchantments); // modify this part to use passed in enchantments list
+ }
+ // CraftBukkit end
+
public static ItemStack a(NBTTagCompound nbttagcompound) {
ItemStack itemstack = new ItemStack();