mirror of
https://gitlab.com/cable-mc/cobblemon.git
synced 2026-10-20 22:26:24 -04:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8b5231d6f0 | ||
|
|
e01bc2eeab | ||
|
|
f6f3070b8e | ||
|
|
0f2301e668 |
@@ -797,6 +797,7 @@
|
||||
- Fixed Magnitude battle messages.
|
||||
- Moves that are disabled or out of PP now show transparently in the battle GUI instead of being hidden completely.
|
||||
- Statuses like sleep and frozen no longer last forever if it was carried over from a previous battle.
|
||||
- Fixed a formatting error that affected Pokemon nicknames when the storage type is JSON.
|
||||
|
||||
### Localization
|
||||
- Added species, ability, and move translations for `ko_ko`, `jp_jp`, `fr_fr`, `es_es`, `it_it`, and `zh_cn`.
|
||||
|
||||
@@ -146,6 +146,8 @@ class PokemonEntity(
|
||||
|
||||
var tethering: PokemonPastureBlockEntity.Tethering? = null
|
||||
|
||||
var queuedToDespawn = false
|
||||
|
||||
/**
|
||||
* The amount of steps this entity has traveled.
|
||||
*/
|
||||
@@ -266,6 +268,9 @@ class PokemonEntity(
|
||||
super.tick()
|
||||
// We will be handling idle logic ourselves thank you
|
||||
this.setDespawnCounter(0)
|
||||
if (queuedToDespawn) {
|
||||
return remove(RemovalReason.DISCARDED)
|
||||
}
|
||||
entityProperties.forEach { it.checkForUpdate() }
|
||||
delegate.tick(this)
|
||||
ticksLived++
|
||||
@@ -994,18 +999,17 @@ class PokemonEntity(
|
||||
return
|
||||
}
|
||||
|
||||
if(this.ownerUuid == player.uuid && tethering == null) {
|
||||
if (player.isDisconnected) {
|
||||
this.remove(RemovalReason.DISCARDED)
|
||||
return
|
||||
}
|
||||
|
||||
val chunkPos = ChunkPos(BlockPos(x.toInt(), y.toInt(), z.toInt()))
|
||||
(world as ServerWorld).chunkManager
|
||||
.addTicket(ChunkTicketType.POST_TELEPORT, chunkPos, 0, id)
|
||||
this.goalSelector.tick()
|
||||
if(distanceTo(player.blockPos) > 100) pokemon.recall()
|
||||
if (this.ownerUuid == player.uuid && tethering == null) {
|
||||
queuedToDespawn = true
|
||||
return
|
||||
}
|
||||
//
|
||||
// val chunkPos = ChunkPos(BlockPos(x.toInt(), y.toInt(), z.toInt()))
|
||||
// (world as ServerWorld).chunkManager
|
||||
// .addTicket(ChunkTicketType.POST_TELEPORT, chunkPos, 0, id)
|
||||
// this.goalSelector.tick()
|
||||
// if(distanceTo(player.blockPos) > 100) pokemon.recall()
|
||||
// }
|
||||
}
|
||||
|
||||
override fun canBeLeashedBy(player: PlayerEntity): Boolean {
|
||||
|
||||
@@ -753,7 +753,7 @@ open class Pokemon : ShowdownIdentifiable {
|
||||
json.addProperty(DataKeys.POKEMON_LAST_SAVED_VERSION, Cobblemon.VERSION)
|
||||
json.addProperty(DataKeys.POKEMON_UUID, uuid.toString())
|
||||
json.addProperty(DataKeys.POKEMON_SPECIES_IDENTIFIER, species.resourceIdentifier.toString())
|
||||
nickname?.let { json.addProperty(DataKeys.POKEMON_NICKNAME, Text.Serializer.toJson(it)) }
|
||||
nickname?.let { json.add(DataKeys.POKEMON_NICKNAME, Text.Serializer.toJsonTree(it)) }
|
||||
json.addProperty(DataKeys.POKEMON_FORM_ID, form.formOnlyShowdownId())
|
||||
json.addProperty(DataKeys.POKEMON_EXPERIENCE, experience)
|
||||
json.addProperty(DataKeys.POKEMON_LEVEL, level)
|
||||
@@ -803,7 +803,7 @@ open class Pokemon : ShowdownIdentifiable {
|
||||
} catch (e: InvalidIdentifierException) {
|
||||
throw IllegalStateException("Failed to deserialize a species identifier")
|
||||
}
|
||||
nickname = json.get(DataKeys.POKEMON_NICKNAME)?.asString?.takeIf { it.isNotBlank() }?.let { Text.Serializer.fromJson(it) }
|
||||
nickname = json.get(DataKeys.POKEMON_NICKNAME)?.let { Text.Serializer.fromJson(it) }
|
||||
form = species.forms.find { it.formOnlyShowdownId() == json.get(DataKeys.POKEMON_FORM_ID).asString } ?: species.standardForm
|
||||
level = json.get(DataKeys.POKEMON_LEVEL).asInt
|
||||
experience = json.get(DataKeys.POKEMON_EXPERIENCE).asInt.takeIf { experienceGroup.getLevel(it) == level } ?: experienceGroup.getExperience(level)
|
||||
|
||||
Reference in New Issue
Block a user