mirror of
https://gitlab.com/cable-mc/cobblemon.git
synced 2026-10-20 14:16:26 -04:00
Fixed NPCs getting their own TM progress file. Closes #2059
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
|
||||
### Fixes
|
||||
- Fixed the `stat_compare` and `stat_equal` evolution requirements crashing the server when given `special_attack` or `special_defence`, and made them treat any non-permanent stat as a failed requirement instead of crashing
|
||||
- Fixed NPCs getting their own TM progress file.
|
||||
|
||||
### Developer
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ class PokedexManager(
|
||||
}
|
||||
|
||||
// Java interop isn't great lol
|
||||
@Deprecated("Use encounter(PokedexEntityData) instead")
|
||||
@Deprecated("Use obtain(Pokemon) instead")
|
||||
fun catch(pokemon: Pokemon) {
|
||||
obtain(pokemon)
|
||||
}
|
||||
|
||||
@@ -17,10 +17,10 @@ import com.cobblemon.mod.common.api.storage.factory.PokemonStoreFactory
|
||||
import com.cobblemon.mod.common.pokemon.Pokemon
|
||||
import com.cobblemon.mod.common.util.DataKeys
|
||||
import com.google.gson.JsonObject
|
||||
import java.util.UUID
|
||||
import net.minecraft.core.RegistryAccess
|
||||
import net.minecraft.nbt.CompoundTag
|
||||
import net.minecraft.server.level.ServerPlayer
|
||||
import java.util.UUID
|
||||
|
||||
/**
|
||||
* The base class for all stores of [Pokemon]. A store specifies the kind of coordinate it needs to be given
|
||||
@@ -77,7 +77,6 @@ abstract class PokemonStore<T : StorePosition> : Iterable<Pokemon> {
|
||||
remove(pokemon)
|
||||
val position = getFirstAvailablePosition() ?: return false // Couldn't fit, shrug emoji
|
||||
set(position, pokemon)
|
||||
Cobblemon.playerDataManager.getTMData(uuid)?.syncTMsFromPokemon(pokemon)
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,8 @@ object PokedexHandler : EventHandler {
|
||||
}
|
||||
|
||||
fun onPokemonGained(event: PokemonGainedEvent) {
|
||||
Cobblemon.playerDataManager.getPokedexData(event.playerId).catch(event.pokemon)
|
||||
Cobblemon.playerDataManager.getPokedexData(event.playerId).obtain(event.pokemon)
|
||||
Cobblemon.playerDataManager.getTMData(event.playerId).syncTMsFromPokemon(event.pokemon)
|
||||
}
|
||||
|
||||
fun onPokemonSeen(event: PokemonSeenEvent) {
|
||||
@@ -34,7 +35,7 @@ object PokedexHandler : EventHandler {
|
||||
|
||||
fun onPokemonAspectsChanged(event: PokemonAspectsChangedEvent) {
|
||||
if (event.ownerId != null) {
|
||||
Cobblemon.playerDataManager.getPokedexData(event.ownerId).catch(event.pokemon)
|
||||
Cobblemon.playerDataManager.getPokedexData(event.ownerId).obtain(event.pokemon)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user