Rewrote pet management
Fixed being unable to remove pets Removed redundant pet messaging
This commit is contained in:
@@ -866,6 +866,21 @@ public class Container {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all instances of an item, and returns them.
|
||||
* @author Player Name
|
||||
* @param item the item.
|
||||
* @return a list of all items that were found (can be length 0).
|
||||
*/
|
||||
public ArrayList<Item> getAll(Item item){
|
||||
ArrayList<Item> ret = new ArrayList<Item>();
|
||||
for(Item i : items){
|
||||
if(i == null) continue;
|
||||
if(item.getId() == i.getId()) ret.add(i);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the next free slot.
|
||||
*
|
||||
|
||||
@@ -279,12 +279,11 @@ class PlayerSaver (val player: Player){
|
||||
detail.put("petId",it.key.toString())
|
||||
detail.put("hunger",it.value.hunger.toString())
|
||||
detail.put("growth",it.value.growth.toString())
|
||||
detail.put("stage",it.value.stage.toString())
|
||||
petDetails.add(detail)
|
||||
}
|
||||
familiarManager.put("petDetails",petDetails)
|
||||
if(player.familiarManager.hasPet()){
|
||||
familiarManager.put("currentPet",(player.familiarManager.familiar as Pet).pet.babyItemId.toString())
|
||||
familiarManager.put("currentPet",(player.familiarManager.familiar as Pet).getItemIdHash().toString())
|
||||
} else if (player.familiarManager.hasFamiliar()){
|
||||
val familiar = JSONObject()
|
||||
familiar.put("originalId",player.familiarManager.familiar.originalId.toString())
|
||||
|
||||
Reference in New Issue
Block a user