Advertisement
fiveriverflow

handleConsumables

Oct 11th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.37 KB | None | 0 0
  1. public static void handleConsumable(Player player, int id, int slot) {
  2.         Optional<Consumable> consumable = Consumable.get(id);
  3.         if (!consumable.isPresent())
  4.             return;
  5.         /*
  6.          * TODO: Reset Combat, skilling...
  7.          * TODO: Animation
  8.          * TODO: GFX
  9.          */
  10.         consumable.get().onConsumption();
  11.         player.getInventory().set(slot, consumable.get().replacement(id), true);
  12.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement