Inventory .getName() vs .getTitle()?

Discussion in 'Spigot Plugin Help' started by Big_Bad_E, Jun 7, 2018.

  1. I am currently trying to use InventoryClickEvent and can't think of a way to check to make sure the inventory being clicked is my inventory, so I was scrolling through the methods and saw these.

    I tried outprinting them to console, but they were the exact same thing.

    So, whats the point of a duplicate method? Or is there something i'm missing?
     
  2. Choco

    Moderator

    Looking at source, they both return the same thing. nms.Inventory.getName(). My best guess would be for the sake of legacy code and backwards compatibility.
     
  3. Makes sense, I didn't think they would change it for no reason and have a duplicate but whatever :)