L2EtcItem.java 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * This program is free software: you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation, either version 3 of the License, or (at your option) any later
  5. * version.
  6. *
  7. * This program is distributed in the hope that it will be useful, but WITHOUT
  8. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  10. * details.
  11. *
  12. * You should have received a copy of the GNU General Public License along with
  13. * this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. package net.sf.l2j.gameserver.templates;
  16. /**
  17. * This class is dedicated to the management of EtcItem.
  18. *
  19. * @version $Revision: 1.2.2.1.2.3 $ $Date: 2005/03/27 15:30:10 $
  20. */
  21. public final class L2EtcItem extends L2Item
  22. {
  23. /**
  24. * Constructor for EtcItem.
  25. * @see L2Item constructor
  26. * @param type : L2EtcItemType designating the type of object Etc
  27. * @param set : StatsSet designating the set of couples (key,value) for description of the Etc
  28. */
  29. public L2EtcItem(L2EtcItemType type, StatsSet set)
  30. {
  31. super(type, set);
  32. }
  33. /**
  34. * Returns the type of Etc Item
  35. * @return L2EtcItemType
  36. */
  37. @Override
  38. public L2EtcItemType getItemType()
  39. {
  40. return (L2EtcItemType)super._type;
  41. }
  42. /**
  43. * Returns if the item is consumable
  44. * @return boolean
  45. */
  46. @Override
  47. public final boolean isConsumable()
  48. {
  49. return ((getItemType() == L2EtcItemType.SHOT) || (getItemType() == L2EtcItemType.POTION)); // || (type == L2EtcItemType.SCROLL));
  50. }
  51. /**
  52. * Returns the ID of the Etc item after applying the mask.
  53. * @return int : ID of the EtcItem
  54. */
  55. @Override
  56. public int getItemMask()
  57. {
  58. return getItemType().mask();
  59. }
  60. }