ForgePatch/forge/patches/minecraft_server/net/minecraft/src/Enchantment.java.patch

20 lines
704 B
Diff
Raw Normal View History

--- ../src_base/minecraft_server/net/minecraft/src/Enchantment.java 0000-00-00 00:00:00.000000000 -0000
+++ ../src_work/minecraft_server/net/minecraft/src/Enchantment.java 0000-00-00 00:00:00.000000000 -0000
2012-01-15 19:16:08 +00:00
@@ -91,6 +91,16 @@
return this;
}
2012-01-15 19:16:08 +00:00
+ /**
+ * Called to determine if this enchantment can be applied to a ItemStack
+ * @param item The ItemStack that the enchantment might be put on
+ * @return True if the item is valid, false otherwise
+ */
2012-01-15 19:16:08 +00:00
+ public boolean canEnchantItem(ItemStack item)
+ {
+ return type.canEnchantItem(item.getItem());
+ }
+
2012-01-15 19:16:08 +00:00
static
{
looting = new EnchantmentLootBonus(21, 2, EnumEnchantmentType.weapon);