Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. public static void infinitesHandler(Player player) {
  2. ArrayList<CPet> activatablePets = CPetUtil.getActivatablePets(player, null);
  3.  
  4. for (CPet cPet : Core.getCustomPetHandler().getPets()) {
  5.  
  6. String id = player.getName() + "+" + cPet.getcName();
  7.  
  8. if (activeInfinites.containsKey(id)) {
  9.  
  10. boolean isInInventory = false;
  11.  
  12. for (CPet aPet : activatablePets) {
  13. if (cPet.getcName().equals(aPet.getcName())) {
  14. isInInventory = true;
  15. }
  16. }
  17. if (isInInventory == false) {
  18. player.removePotionEffect(activeInfinites.get(id));
  19. activeInfinites.remove(id);
  20. }
  21. }
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement