diff --git a/src/main/java/com/pokegoapi/api/inventory/Inventories.java b/src/main/java/com/pokegoapi/api/inventory/Inventories.java index ab41960f..2918dee2 100644 --- a/src/main/java/com/pokegoapi/api/inventory/Inventories.java +++ b/src/main/java/com/pokegoapi/api/inventory/Inventories.java @@ -125,7 +125,7 @@ public void updateInventories(boolean forceUpdate) throws LoginFailedException, // pokebank if (itemData.getPokemonData().getPokemonId() != PokemonId.MISSINGNO) { - pokebank.addPokemon(new Pokemon(inventoryItem.getInventoryItemData().getPokemonData())); + pokebank.addPokemon(new Pokemon(api, inventoryItem.getInventoryItemData().getPokemonData())); } // items diff --git a/src/main/java/com/pokegoapi/api/pokemon/Pokemon.java b/src/main/java/com/pokegoapi/api/pokemon/Pokemon.java index b9591eef..fcc4f457 100644 --- a/src/main/java/com/pokegoapi/api/pokemon/Pokemon.java +++ b/src/main/java/com/pokegoapi/api/pokemon/Pokemon.java @@ -44,14 +44,14 @@ public class Pokemon { private static final String TAG = Pokemon.class.getSimpleName(); - @Setter - PokemonGo pgo; + private final PokemonGo pgo; private PokemonData proto; // API METHODS // // DELEGATE METHODS BELOW // - public Pokemon(PokemonData proto) { + public Pokemon(PokemonGo api, PokemonData proto) { + this.pgo = api; this.proto = proto; }