Item.opEquals

Deep comparation of 2 instantiated items. Compare ids, metas, custom names and enchantments.

  1. bool opEquals(Object o)
    class Item
    override
    bool
    opEquals
    (
    Object o
    )
  2. bool opEquals(item_t item)
  3. bool opEquals(item_t[] items)

Examples

Item a = new Items.Beetroot();
Item b = a.dup;
assert(a == b);

a.customName = "beetroot";
assert(a != b);

b.customName = "beetroot";
a.enchant(Enchantments.protection, "IV");
b.enchant(Enchantments.protection, "IV");
assert(a == b);

Meta