diff --git a/common/src/main/kotlin/com/cobblemon/mod/common/CobblemonNetwork.kt b/common/src/main/kotlin/com/cobblemon/mod/common/CobblemonNetwork.kt index 343399c23d..efd49a4ac0 100644 --- a/common/src/main/kotlin/com/cobblemon/mod/common/CobblemonNetwork.kt +++ b/common/src/main/kotlin/com/cobblemon/mod/common/CobblemonNetwork.kt @@ -313,7 +313,6 @@ object CobblemonNetwork { list.add(PacketRegisterInfo(MarkingsUpdatePacket.ID, MarkingsUpdatePacket::decode, PokemonUpdatePacketHandler())) list.add(PacketRegisterInfo(RideBoostsUpdatePacket.ID, RideBoostsUpdatePacket::decode, PokemonUpdatePacketHandler())) list.add(PacketRegisterInfo(RideStaminaUpdatePacket.ID, RideStaminaUpdatePacket::decode, PokemonUpdatePacketHandler())) - list.add(PacketRegisterInfo(IgnoredRenderableFeaturesUpdatePacket.ID, IgnoredRenderableFeaturesUpdatePacket::decode, PokemonUpdatePacketHandler())) // Evolution start list.add(PacketRegisterInfo(AddEvolutionPacket.ID, AddEvolutionPacket::decode, PokemonUpdatePacketHandler())) diff --git a/common/src/main/kotlin/com/cobblemon/mod/common/client/gui/summary/widgets/screens/stats/StatWidget.kt b/common/src/main/kotlin/com/cobblemon/mod/common/client/gui/summary/widgets/screens/stats/StatWidget.kt index f4310f98ac..f70cd3e12d 100644 --- a/common/src/main/kotlin/com/cobblemon/mod/common/client/gui/summary/widgets/screens/stats/StatWidget.kt +++ b/common/src/main/kotlin/com/cobblemon/mod/common/client/gui/summary/widgets/screens/stats/StatWidget.kt @@ -260,13 +260,8 @@ class StatWidget( val barPosX = x + 9F var drawY = y + 15F - val featuresList: MutableList = renderableFeatures.filter { - !pokemon.ignoredRenderableFeatures.contains(it.name) - }.toMutableList() - - featuresList.addAll(0, universalFeatures.filter { - !pokemon.ignoredRenderableFeatures.contains(it.name) - }) + val featuresList: MutableList = renderableFeatures.toMutableList() + featuresList.addAll(0, universalFeatures) val pageFeatures = featuresList.subList( otherStatsPageIndex * OTHER_STAT_BARS_PER_PAGE, diff --git a/common/src/main/kotlin/com/cobblemon/mod/common/net/messages/client/pokemon/update/IgnoredRenderableFeaturesUpdatePacket.kt b/common/src/main/kotlin/com/cobblemon/mod/common/net/messages/client/pokemon/update/IgnoredRenderableFeaturesUpdatePacket.kt deleted file mode 100644 index 532086dac1..0000000000 --- a/common/src/main/kotlin/com/cobblemon/mod/common/net/messages/client/pokemon/update/IgnoredRenderableFeaturesUpdatePacket.kt +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2023 Cobblemon Contributors - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -package com.cobblemon.mod.common.net.messages.client.pokemon.update - -import com.cobblemon.mod.common.pokemon.Pokemon -import com.cobblemon.mod.common.util.cobblemonResource -import com.cobblemon.mod.common.util.readString -import com.cobblemon.mod.common.util.writeString -import io.netty.buffer.ByteBuf -import net.minecraft.network.RegistryFriendlyByteBuf - -class IgnoredRenderableFeaturesUpdatePacket(pokemon: () -> Pokemon?, value: Set): SingleUpdatePacket, IgnoredRenderableFeaturesUpdatePacket>(pokemon, value) { - override val id = ID - override fun encodeValue(buffer: RegistryFriendlyByteBuf) { - buffer.writeCollection(this.value) { pb, value -> pb.writeString(value) } - } - - override fun set(pokemon: Pokemon, value: Set) { - pokemon.ignoredRenderableFeatures = value - } - - companion object { - val ID = cobblemonResource("ignored_renderable_features_update") - fun decode(buffer: RegistryFriendlyByteBuf): IgnoredRenderableFeaturesUpdatePacket { - val pokemon = decodePokemon(buffer) - val ignoredRenderableFeatures = buffer.readList(ByteBuf::readString).toSet() - return IgnoredRenderableFeaturesUpdatePacket(pokemon, ignoredRenderableFeatures) - } - } - -} \ No newline at end of file diff --git a/common/src/main/kotlin/com/cobblemon/mod/common/pokemon/Pokemon.kt b/common/src/main/kotlin/com/cobblemon/mod/common/pokemon/Pokemon.kt index e2dd68c14b..ba8dca30da 100644 --- a/common/src/main/kotlin/com/cobblemon/mod/common/pokemon/Pokemon.kt +++ b/common/src/main/kotlin/com/cobblemon/mod/common/pokemon/Pokemon.kt @@ -579,16 +579,6 @@ open class Pokemon : ShowdownIdentifiable { onChange(MarkingsUpdatePacket({ this }, value)) } - - /** - * A set of features to be ignored when drawing the OTHER screen in the summary UI. - */ - var ignoredRenderableFeatures = setOf() - set(value) { - field = value - onChange(IgnoredRenderableFeaturesUpdatePacket({ this }, value)) - } - fun asRenderablePokemon() = RenderablePokemon(species, aspects, if (heldItemVisible) heldItem else ItemStack.EMPTY) /** @@ -1420,7 +1410,6 @@ open class Pokemon : ShowdownIdentifiable { this.potentialMarks.clear() this.potentialMarks += other.marks this.markings = other.markings - this.ignoredRenderableFeatures = other.ignoredRenderableFeatures this.updateAspects() this.refreshOriginalTrainer() this.initialize() diff --git a/common/src/main/kotlin/com/cobblemon/mod/common/util/DataKeys.kt b/common/src/main/kotlin/com/cobblemon/mod/common/util/DataKeys.kt index 7c07e03ded..1d8ebcae64 100644 --- a/common/src/main/kotlin/com/cobblemon/mod/common/util/DataKeys.kt +++ b/common/src/main/kotlin/com/cobblemon/mod/common/util/DataKeys.kt @@ -61,7 +61,6 @@ object DataKeys { const val POKEMON_MARKINGS = "Markings" const val POKEMON_RIDE_BOOSTS = "RideBoosts" const val POKEMON_RIDE_STAMINA = "RideStamina" - const val POKEMON_IGNORED_RENDERABLE_FEATURES = "IgnoredRenderableFeatures" const val POKEMON_STATE = "State" const val POKEMON_STATE_TYPE = "StateType" diff --git a/common/src/main/kotlin/com/cobblemon/mod/common/util/codec/internal/PokemonP3.kt b/common/src/main/kotlin/com/cobblemon/mod/common/util/codec/internal/PokemonP3.kt index e8b266c96c..f3b8f83604 100644 --- a/common/src/main/kotlin/com/cobblemon/mod/common/util/codec/internal/PokemonP3.kt +++ b/common/src/main/kotlin/com/cobblemon/mod/common/util/codec/internal/PokemonP3.kt @@ -43,7 +43,6 @@ internal data class PokemonP3( val rideBoosts: Map, val rideStamina: Float, val currentFullness: Int, - val ignoredRenderableFeatures: Set, val interactionCooldowns: Map ) : Partial { @@ -81,7 +80,6 @@ internal data class PokemonP3( this.rideBoosts.let { other.setRideBoosts(it.mapKeys { RidingStat.valueOf(it.key) }) } other.rideStamina = this.rideStamina other.currentFullness = this.currentFullness - other.ignoredRenderableFeatures = this.ignoredRenderableFeatures other.interactionCooldowns = this.interactionCooldowns.toMutableMap() return other } @@ -103,9 +101,8 @@ internal data class PokemonP3( Codec.unboundedMap(Codec.STRING, Codec.FLOAT).optionalFieldOf(DataKeys.POKEMON_RIDE_BOOSTS, emptyMap()).forGetter(PokemonP3::rideBoosts), Codec.FLOAT.optionalFieldOf(DataKeys.POKEMON_RIDE_STAMINA, 1F).forGetter(PokemonP3::rideStamina), Codec.intRange(0, 100).optionalFieldOf(DataKeys.POKEMON_FULLNESS, 0).forGetter(PokemonP3::currentFullness), - Codec.list(Codec.STRING).optionalFieldOf(DataKeys.POKEMON_IGNORED_RENDERABLE_FEATURES, emptyList()).forGetter { it.ignoredRenderableFeatures.toMutableList() }, Codec.unboundedMap(ResourceLocation.CODEC, Codec.INT).optionalFieldOf(DataKeys.POKEMON_INTERACTION_COOLDOWN, emptyMap()).forGetter(PokemonP3::interactionCooldowns) - ).apply(instance) { originalTrainerType, originalTrainer, forcedAspects, features, heldItemVisible, canDropHeldItem, cosmeticItem, activeMark, marks, potentialMarks, markings, rideBoosts, rideStamina, currentFullness, ignoredRenderableFeatures, interactionCooldown -> PokemonP3(originalTrainerType, originalTrainer, forcedAspects.toSet(), features, heldItemVisible, canDropHeldItem, cosmeticItem.orElse(ItemStack.EMPTY), activeMark, marks.toMutableSet(), potentialMarks.toMutableSet(), markings, rideBoosts, rideStamina, currentFullness, ignoredRenderableFeatures.toSet(), interactionCooldown) } + ).apply(instance) { originalTrainerType, originalTrainer, forcedAspects, features, heldItemVisible, canDropHeldItem, cosmeticItem, activeMark, marks, potentialMarks, markings, rideBoosts, rideStamina, currentFullness, interactionCooldown -> PokemonP3(originalTrainerType, originalTrainer, forcedAspects.toSet(), features, heldItemVisible, canDropHeldItem, cosmeticItem.orElse(ItemStack.EMPTY), activeMark, marks.toMutableSet(), potentialMarks.toMutableSet(), markings, rideBoosts, rideStamina, currentFullness, interactionCooldown) } } internal fun from(pokemon: Pokemon): PokemonP3 = PokemonP3( @@ -127,7 +124,6 @@ internal data class PokemonP3( pokemon.getRideBoosts().mapKeys { it.key.name }, pokemon.rideStamina, pokemon.currentFullness, - pokemon.ignoredRenderableFeatures, pokemon.interactionCooldowns ) }