Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a12f1c80e7 |
No files matched your search
+6
-206
@@ -7,18 +7,18 @@
|
||||
- Added Lure Ball functionality, increasing the catch rate of Pokémon that were caught on a fishing rod.
|
||||
- Added Repeat Ball functionality, increasing the catch rate of Pokémon that are already registered as caught in a player's Pokédex.
|
||||
- Added property chaining support for duplicate CustomPokemonPropertyType elements.
|
||||
- Added flat level battling with options to set all Pokemon to level 50, 100, or 5 for the duration of a battle. No experience or EVs are granted for a flat battle.
|
||||
- Added `aspect` and `unaspect` PokemonProperty arguments (which also includes commands such as `/pokemonedit`, `/spawnpokemon`, and `/givepokemon`) to allow forcing or un-forcing an aspect on a Pokémon.
|
||||
- Added `type` alternatively `elemental_type` PokemonProperty argument, this is only used for filtering and is not applied to Pokémon. Example `type=fire` would be true for Charmander but false for Squirtle.
|
||||
- Added support for Double Battles, Triple Battles, and Multi-battles.
|
||||
- CriticalCaptures and Pokédex progress capture multiplier now work with the Pokédex.
|
||||
- Added extra visuals to early berry growth stages.
|
||||
- Hidden Power now displays its effective typing.
|
||||
- Moves impacted by the abilities Pixelate, Refrigerate, Aerilate, Galvanize, and Normalize now display as their altered typing.
|
||||
- Added Polished Tumblestone and Tumblestone Brick block sets from Tumblestone, Black Tumblestone, and Sky Tumblestone.
|
||||
- Added Metronome, Protective Pads, Punching Glove, Room Service, Scope Lens, Shed Shell, Terrain Extender, Throat Spray, Utility Umbrella, Wide Lens, and Zoom Lens held items
|
||||
- Added particles for moves: Watersport, Mud Sport, and Psychic.
|
||||
- Added Fire, Water, Thunder, Leaf, Ice, Sun, Moon, Shiny, Dawn, and Dusk Stone storage blocks.
|
||||
- Added Eject Pack, Metronome, Protective Pads, Punching Glove, Room Service, Scope Lens, Shed Shell, Terrain Extender, Throat Spray, Utility Umbrella, Wide Lens, and Zoom Lens held items
|
||||
- Moves can now be benched without specifying a replacement move, allowing for empty move slots.
|
||||
- Moves learned via Sketch now persist after battle.
|
||||
- Added `stonjourner_henge_ruins`, `luna_henge_ruins`, and `sol_henge_ruins` structures.
|
||||
- Added a `battleInvulnerability` gamerule to make players invulnerable to any damage during a battle.
|
||||
- Added a `mobTargetInBattle` gamerule to exclude players from being targeted by mobs during a battle.
|
||||
@@ -31,17 +31,8 @@
|
||||
- `/freezepokemon` command to pause a Pokémon's animation at a specific point in time.
|
||||
- Added `no_ai` and `freeze_frame` options to the `/spawnpokemon` command.
|
||||
- Added shiny Pokémon particles with sound effects.
|
||||
- Added animation for trading.
|
||||
- Added shiny Pokémon effects.
|
||||
- Added effects for the burn status effect.
|
||||
- Added effects for the moves: Psychic, Water Sport, and Mud Sport.
|
||||
- Added a new universal locator called "top".
|
||||
|
||||
### Pokémon Added
|
||||
#### Gen 1
|
||||
- Alola Bias Cubone
|
||||
- Alolan Marowak
|
||||
|
||||
#### Gen 2
|
||||
- Ledyba
|
||||
- Ledian
|
||||
@@ -49,39 +40,13 @@
|
||||
- Sunflora
|
||||
- Wobbuffet
|
||||
- Girafarig
|
||||
- Corsola
|
||||
- Remoraid
|
||||
- Octillery
|
||||
- Mantine
|
||||
- Smeargle
|
||||
- Remoraid
|
||||
- Octillery
|
||||
- Mantine
|
||||
- Corsola
|
||||
|
||||
#### Gen 3
|
||||
- Slakoth
|
||||
- Vigoroth
|
||||
- Slaking
|
||||
- Corphish
|
||||
- Crawdaunt
|
||||
- Feebas
|
||||
- Milotic
|
||||
- Wynaut
|
||||
- Absol
|
||||
- Spheal
|
||||
- Sealeo
|
||||
- Walrein
|
||||
- Bagon
|
||||
- Shelgon
|
||||
- Salamence
|
||||
|
||||
#### Gen 4
|
||||
- Shellos [East Sea form]
|
||||
- Gastrodon [East Sea form]
|
||||
- Finneon
|
||||
- Lumineon
|
||||
- Mantyke
|
||||
- Feebas
|
||||
- Milotic
|
||||
- Spheal
|
||||
@@ -100,28 +65,12 @@
|
||||
#### Gen 5
|
||||
- Purrloin
|
||||
- Liepard
|
||||
- Scraggy
|
||||
- Scrafty
|
||||
|
||||
#### Gen 6
|
||||
- Clauncher
|
||||
- Clawitzer
|
||||
|
||||
#### Gen 7
|
||||
- Pikipek
|
||||
- Trumbeak
|
||||
- Toucannon
|
||||
- Mareanie
|
||||
- Toxapex
|
||||
- Sandygast
|
||||
- Palossand
|
||||
- Bruxish
|
||||
|
||||
#### Gen 8
|
||||
- Cramorant
|
||||
- Hatenna
|
||||
- Hattrem
|
||||
- Hatterene
|
||||
- Bruxish
|
||||
- Mareanie
|
||||
- Toxapex
|
||||
@@ -131,156 +80,16 @@
|
||||
- Pincurchin
|
||||
|
||||
#### Gen 9
|
||||
- Wattrel
|
||||
- Kilowattrel
|
||||
- Wiglett
|
||||
- Wugtrio
|
||||
- Flamigo
|
||||
- Veluza
|
||||
- Farigiraf
|
||||
- Klawf
|
||||
- Finizen
|
||||
- Palafin
|
||||
- Wiglett
|
||||
- Wugtrio
|
||||
- Flamigo
|
||||
|
||||
#### Unique Forms
|
||||
- Magikarp Jump Variants
|
||||
- Gyarados Jump Variants
|
||||
|
||||
### Added cries to the following Pokémon
|
||||
- Sandshrew, Sandslash
|
||||
- Magnemite, Magneton, Magnezone
|
||||
- Gastly, Haunter, Gengar
|
||||
- Rhyhorn, Rhydon, Rhyperior
|
||||
- Happiny, Chansey
|
||||
- Horsea, Seadra, Kingdra
|
||||
- Magby, Magmar, Magmortar
|
||||
- Porygon, Porygon2, Porygon-Z
|
||||
- Sentret, Furret
|
||||
- Misdreavus, Mismagius
|
||||
- Corsola
|
||||
- Mantyke, Mantine
|
||||
- Girafarig, Farigiraf
|
||||
- Wynaut, Wobbuffet
|
||||
- Lunatone
|
||||
- Solrock
|
||||
- Corphish, Crawdaunt
|
||||
- Feebas, Milotic
|
||||
- Kecleon
|
||||
- Absol
|
||||
- Spheal, Sealeo, Walrein
|
||||
- Relicanth
|
||||
- Bagon, Shelgon, Salamence
|
||||
- Munchlax
|
||||
- Finneon, Lumineon
|
||||
- Purrloin, Liepard
|
||||
- Timburr, Gurdurr, Conkeldurr
|
||||
- Joltik, Galvantula
|
||||
- Elgyem, Beheeyem
|
||||
- Golett, Golurk
|
||||
- Deino, Zweilous, Hydreigon
|
||||
- Flabébé, Floette, Florges
|
||||
- Clauncher, Clawitzer
|
||||
- Mareanie, Toxapex
|
||||
- Wimpod, Golisopod
|
||||
- Bruxish
|
||||
- Hatenna, Hattrem, Hatterene
|
||||
- Pincurchin
|
||||
- Klawf
|
||||
- Finizen, Palafin [Zero], Palafin [Hero]
|
||||
- Dondozo
|
||||
|
||||
### Added shoulder mounts for the following Pokémon
|
||||
- Weedle
|
||||
- Caterpie
|
||||
- Spearow
|
||||
- Mew
|
||||
- Murkrow
|
||||
- Smoochum
|
||||
- Larvitar
|
||||
- Tailow
|
||||
- Plusle
|
||||
- Minun
|
||||
- Beldum
|
||||
- Starly
|
||||
- Buneary
|
||||
- Combee
|
||||
- Pachirisu
|
||||
- Pidove
|
||||
- Petilil, Hisui Bias Petilil
|
||||
- Zorua, Hisui Bias Zorua
|
||||
- Elgyem
|
||||
- Fletchling
|
||||
- Skrelp
|
||||
- Klefki
|
||||
- Fomantis
|
||||
- Morelull
|
||||
- Dreepy
|
||||
- Shroodle
|
||||
- Tatsugiri
|
||||
- Glimmet
|
||||
- Gimmighoul [Roaming]
|
||||
|
||||
### Animation updates for the following Pokémon
|
||||
- Bellsprout, Weepinbel, Victreebel
|
||||
- Shellder, Cloyster
|
||||
- Porygon, Porygon2, Porygon-Z
|
||||
- Furret
|
||||
- Swinub, Piloswine, Mamoswine
|
||||
- Skarmory
|
||||
- Spinda
|
||||
- Torkoal
|
||||
- Nincada, Ninjask
|
||||
- Lunatone
|
||||
- Solrock
|
||||
- Buneary, Lopunny
|
||||
- Alomomola
|
||||
- Dreepy, Drakloak
|
||||
- Kleavor
|
||||
|
||||
### Model updates for the following Pokémon
|
||||
- Bulbasaur, Ivysaur, Venusaur
|
||||
- Charmander, Charmeleon, Charizard
|
||||
- Kakuna, Beedrill
|
||||
- Porygon, Porygon2, Porygon-Z
|
||||
- Igglybuff, Jigglypuff, Wigglytuff
|
||||
- Poliwhirl, Poliwrath
|
||||
- Bellsprout, Weepinbell, Victreebel
|
||||
- Shellder, Cloyster
|
||||
- Gastly, Haunter
|
||||
- Onix
|
||||
- Krabby, Kingler
|
||||
- Rhyhorn, Rhydon, Rhyperior
|
||||
- Horsea, Seadra, Kingdra
|
||||
- Goldeen, Seaking
|
||||
- Magby, Magmar, Magmortar
|
||||
- Magikarp, Gyarados
|
||||
- Munchlax, Snorlax
|
||||
- Swinub, Piloswine, Mamoswine
|
||||
- Mudkip, Marshtomp, Swampert
|
||||
- Baltoy, Claydol
|
||||
- Carvanha
|
||||
- Relicanth
|
||||
- Prinplup, Empoleon
|
||||
- Gible, Gabite, Garchomp
|
||||
- Riolu, Lucario
|
||||
- Snivy, Servine, Serperior
|
||||
- Tepig, Pignite, Emboar
|
||||
- Krookodile
|
||||
- Dwebble, Crustle
|
||||
- Joltik, Galvantula
|
||||
- Klink, Klang, Klinglang
|
||||
- Golett, Golurk
|
||||
- Fennekin, Braixen, Delphox
|
||||
- Phantump, Trevenant
|
||||
- Litten, Torracat, Incineroar
|
||||
- Popplio, Brionne, Primarina
|
||||
- Lurantis
|
||||
- Scorbunny, Cinderace
|
||||
- Quaxly
|
||||
- Tatsugiri
|
||||
|
||||
### Changes
|
||||
- Buffed Dusk Ball catch multipliers: Increased multiplier to 3.5 (from 3.0) in light level 0. Increased multiplier to 3.0 (from 1.5) in light levels 1-7.
|
||||
@@ -288,7 +97,9 @@
|
||||
- Adjusted some berry balance values like yield and growth times.
|
||||
- Adjusted volumes of sounds made by Display Cases, Berry Bushes, Energy Root, Medicinal Leek, Vivichoke, Mints, Revival Herbs and Gilded Chests.
|
||||
- Changes to mulch buffs/durations.
|
||||
- Dreepy is now shoulder mountable.
|
||||
- Updated potion sprites.
|
||||
- Weedle, Caterpie, Spearow, Smoochum, Mew, Murkrow, Larvitar, Taillow, Plusle, Minun, Beldum, Starly, Buneary, Combee, Pachirisu, Pidove, Petilil, Hisui Bias Petilil, Zorua, Hisuian Zorua, Elgyem, Fletchling, Skrelp, Klefki, Fomantis, Morelull, Dreepy, Shroodle, Tatsugiri, Glimmet, and Roaming Gimmighoul are now shoulder mountable.
|
||||
- Link Cable recipe has been redesigned.
|
||||
- Updated sounds for Medicinal Leeks, Big Roots, Energy Roots and Revival Herbs.
|
||||
- Updated UI sounds for clicking and evolving Pokémon.
|
||||
@@ -306,20 +117,11 @@
|
||||
- Updated dialogue GUI assets with proper assets.
|
||||
- Updated party switching interface when in battle.
|
||||
- Relic coin pouches can now be waterlogged.
|
||||
- Pokémon name and level labels are now only visible when crouching by default. Set the `displayEntityLabelsWhenCrouchingOnly` config to `false` to always have them displayed.
|
||||
- Pokemon Name (and level) labels are now only visible when crouching by default, set the `displayEntityLabelsWhenCrouchingOnly` to `false` to always them even when not crouching
|
||||
- The "Press R to start battle prompt" will now disappear after a player's first battle has been won.
|
||||
- The default number of digits for the Pokédex number in the summary has been increased, from 3 to 4.
|
||||
- The pasture block model's screen is now off by default.
|
||||
- The Poké Balls creative tab is now named Utility Items as it also encompasses Poké Rod and Pokédex items.
|
||||
- Moves can now be benched without specifying a replacement move, allowing for empty move slots.
|
||||
- Moves learned via Sketch now persist after battle.
|
||||
- Updated potion sprites
|
||||
- Removed the interchangeable evolution results for the first stage Hisuian starters to prevent confusion. The method still exists for stage 2 to 3, but stage 1 to 2 was not distinguishable enough for many users.
|
||||
- Hidden Power now displays its effective typing.
|
||||
- Updated particles for moves: Confusion, Protect, Sand Attack, and Quick Attack.
|
||||
- Updated particles for status effects: Paralysis, Poison, and Sleep.
|
||||
- Updated particles on Gastly.
|
||||
- Revamped stat buff and de-buff particles.
|
||||
|
||||
### Fixes
|
||||
- Scaled down Amaura's fetus model to avoid clipping through the tank while animating.
|
||||
@@ -375,7 +177,6 @@
|
||||
- Fixed Slowking's battle idle.
|
||||
- Fixed Grafaiai's walk speed to prevent model sliding.
|
||||
- Fixed Alolan Exeggutor's tail not showing in the party UI. It will now also stand in front of all Pokémon in the party menu :)
|
||||
- Fixed Timburr duplicating its log while fainting.
|
||||
- Fixed reviving items throwing an exception when used in battle.
|
||||
- Fixed messages for Focus Sash, Confusion, Mummy, Ice Face, Own Tempo, and Revive.
|
||||
- Improve error handling when loading spawn-sets to ensure invalid configurations don't crash the server.
|
||||
@@ -392,7 +193,6 @@
|
||||
- Fixed village generation caps not applying for berry farms. You were not meant to see more than two berry farms per village!
|
||||
- Fixed the Ice Face ability activation being displayed incorrectly in a battle.
|
||||
- Fixed edge case of F1 and R locking you in battle with no R functionality (requiring ESC to get out).
|
||||
- Fixed Poké Ball render orientation in battle interface when capturing.
|
||||
|
||||
### Developer
|
||||
- `SpawnCause` is now an implementation of `SpawningInfluence`.
|
||||
|
||||
@@ -97,7 +97,6 @@ import com.cobblemon.mod.common.pokemon.properties.HiddenAbilityPropertyType
|
||||
import com.cobblemon.mod.common.pokemon.properties.NoAIProperty
|
||||
import com.cobblemon.mod.common.pokemon.properties.UnaspectPropertyType
|
||||
import com.cobblemon.mod.common.pokemon.properties.UncatchableProperty
|
||||
import com.cobblemon.mod.common.pokemon.properties.BattleCloneProperty
|
||||
import com.cobblemon.mod.common.pokemon.properties.tags.PokemonFlagProperty
|
||||
import com.cobblemon.mod.common.pokemon.stat.CobblemonStatProvider
|
||||
import com.cobblemon.mod.common.starter.CobblemonStarterHandler
|
||||
@@ -274,7 +273,6 @@ object Cobblemon {
|
||||
FlagSpeciesFeatureProvider(keys = listOf(DataKeys.HAS_BEEN_SHEARED), default = false))
|
||||
|
||||
CustomPokemonProperty.register(UncatchableProperty)
|
||||
CustomPokemonProperty.register(BattleCloneProperty)
|
||||
CustomPokemonProperty.register(PokemonFlagProperty)
|
||||
CustomPokemonProperty.register(HiddenAbilityPropertyType)
|
||||
CustomPokemonProperty.register(AspectPropertyType)
|
||||
|
||||
@@ -51,7 +51,13 @@ import com.cobblemon.mod.common.client.net.storage.pc.OpenPCHandler
|
||||
import com.cobblemon.mod.common.client.net.storage.pc.SetPCBoxPokemonHandler
|
||||
import com.cobblemon.mod.common.client.net.storage.pc.SetPCPokemonHandler
|
||||
import com.cobblemon.mod.common.client.net.toast.ToastPacketHandler
|
||||
import com.cobblemon.mod.common.client.net.trade.*
|
||||
import com.cobblemon.mod.common.client.net.trade.TradeAcceptanceChangedHandler
|
||||
import com.cobblemon.mod.common.client.net.trade.TradeCancelledHandler
|
||||
import com.cobblemon.mod.common.client.net.trade.TradeCompletedHandler
|
||||
import com.cobblemon.mod.common.client.net.trade.TradeOfferExpiredHandler
|
||||
import com.cobblemon.mod.common.client.net.trade.TradeOfferNotificationHandler
|
||||
import com.cobblemon.mod.common.client.net.trade.TradeStartedHandler
|
||||
import com.cobblemon.mod.common.client.net.trade.TradeUpdatedHandler
|
||||
import com.cobblemon.mod.common.net.PacketRegisterInfo
|
||||
import com.cobblemon.mod.common.net.messages.client.PlayerInteractOptionsPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.animation.PlayPosableAnimationPacket
|
||||
@@ -94,6 +100,13 @@ import com.cobblemon.mod.common.net.messages.client.storage.party.SetPartyPokemo
|
||||
import com.cobblemon.mod.common.net.messages.client.storage.party.SetPartyReferencePacket
|
||||
import com.cobblemon.mod.common.net.messages.client.storage.pc.*
|
||||
import com.cobblemon.mod.common.net.messages.client.toast.ToastPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.trade.TradeAcceptanceChangedPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.trade.TradeCancelledPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.trade.TradeCompletedPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.trade.TradeOfferExpiredPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.trade.TradeOfferNotificationPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.trade.TradeStartedPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.trade.TradeUpdatedPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.ui.InteractPokemonUIPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.ui.PokedexUIPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.ui.SummaryUIPacket
|
||||
@@ -128,6 +141,11 @@ import com.cobblemon.mod.common.net.messages.server.storage.pc.MovePartyPokemonT
|
||||
import com.cobblemon.mod.common.net.messages.server.storage.pc.ReleasePCPokemonPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.storage.pc.SwapPCPokemonPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.storage.pc.UnlinkPlayerFromPCPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.trade.AcceptTradeRequestPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.trade.CancelTradePacket
|
||||
import com.cobblemon.mod.common.net.messages.server.trade.ChangeTradeAcceptancePacket
|
||||
import com.cobblemon.mod.common.net.messages.server.trade.OfferTradePacket
|
||||
import com.cobblemon.mod.common.net.messages.server.trade.UpdateTradeOfferPacket
|
||||
import com.cobblemon.mod.common.net.serverhandling.*
|
||||
import com.cobblemon.mod.common.net.serverhandling.battle.BattleSelectActionsHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.battle.RemoveSpectatorHandler
|
||||
@@ -162,13 +180,15 @@ import com.cobblemon.mod.common.net.serverhandling.storage.pc.MovePartyPokemonTo
|
||||
import com.cobblemon.mod.common.net.serverhandling.storage.pc.ReleasePartyPokemonHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.storage.pc.SwapPCPokemonHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.storage.pc.UnlinkPlayerFromPCHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.trade.AcceptTradeRequestHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.trade.CancelTradeHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.trade.ChangeTradeAcceptanceHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.trade.OfferTradeHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.trade.UpdateTradeOfferHandler
|
||||
import com.cobblemon.mod.common.net.messages.client.pokedex.ServerConfirmedRegisterPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.trade.*
|
||||
import com.cobblemon.mod.common.net.messages.server.pokedex.scanner.FinishScanningPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.trade.*
|
||||
import com.cobblemon.mod.common.net.serverhandling.pokedex.scanner.FinishScanningHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.pokedex.scanner.StartScanningHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.trade.*
|
||||
import com.cobblemon.mod.common.util.server
|
||||
import net.minecraft.server.level.ServerPlayer
|
||||
|
||||
@@ -277,7 +297,6 @@ object CobblemonNetwork {
|
||||
list.add(PacketRegisterInfo(BattleChallengeExpiredPacket.ID, BattleChallengeExpiredPacket::decode, BattleChallengeExpiredHandler))
|
||||
list.add(PacketRegisterInfo(BattleReplacePokemonPacket.ID, BattleReplacePokemonPacket::decode, BattleReplacePokemonHandler))
|
||||
list.add(PacketRegisterInfo(BattleTransformPokemonPacket.ID, BattleTransformPokemonPacket::decode, BattleTransformPokemonHandler))
|
||||
list.add(PacketRegisterInfo(BattleAppendTargetedEntityPacket.ID, BattleAppendTargetedEntityPacket::decode, BattleSetTargetedEntityHandler))
|
||||
|
||||
// MultiBattleTeam Packets
|
||||
list.add(PacketRegisterInfo(TeamRequestNotificationPacket.ID, TeamRequestNotificationPacket::decode, TeamRequestNotificationHandler))
|
||||
@@ -322,7 +341,6 @@ object CobblemonNetwork {
|
||||
|
||||
// Trade packets
|
||||
list.add(PacketRegisterInfo(TradeAcceptanceChangedPacket.ID, TradeAcceptanceChangedPacket::decode, TradeAcceptanceChangedHandler))
|
||||
list.add(PacketRegisterInfo(TradeProcessStartedPacket.ID, TradeProcessStartedPacket::decode, TradeProcessStartedHandler))
|
||||
list.add(PacketRegisterInfo(TradeCancelledPacket.ID, TradeCancelledPacket::decode, TradeCancelledHandler))
|
||||
list.add(PacketRegisterInfo(TradeCompletedPacket.ID, TradeCompletedPacket::decode, TradeCompletedHandler))
|
||||
list.add(PacketRegisterInfo(TradeUpdatedPacket.ID, TradeUpdatedPacket::decode, TradeUpdatedHandler))
|
||||
@@ -410,7 +428,6 @@ object CobblemonNetwork {
|
||||
list.add(PacketRegisterInfo(AcceptTradeRequestPacket.ID, AcceptTradeRequestPacket::decode, AcceptTradeRequestHandler))
|
||||
list.add(PacketRegisterInfo(CancelTradePacket.ID, CancelTradePacket::decode, CancelTradeHandler))
|
||||
list.add(PacketRegisterInfo(ChangeTradeAcceptancePacket.ID, ChangeTradeAcceptancePacket::decode, ChangeTradeAcceptanceHandler))
|
||||
list.add(PacketRegisterInfo(PerformTradePacket.ID, PerformTradePacket::decode, PerformTradeHandler))
|
||||
list.add(PacketRegisterInfo(OfferTradePacket.ID, OfferTradePacket::decode, OfferTradeHandler))
|
||||
list.add(PacketRegisterInfo(UpdateTradeOfferPacket.ID, UpdateTradeOfferPacket::decode, UpdateTradeOfferHandler))
|
||||
|
||||
|
||||
@@ -25,8 +25,6 @@ object CobblemonSounds : PlatformRegistry<Registry<SoundEvent>, ResourceKey<Regi
|
||||
|
||||
@JvmField
|
||||
val GUI_CLICK = this.create("gui.click")
|
||||
@JvmField
|
||||
val GUI_TRADE = this.create("gui.trade")
|
||||
|
||||
@JvmField
|
||||
val PC_ON = this.create("pc.on")
|
||||
|
||||
@@ -25,7 +25,6 @@ import com.cobblemon.mod.common.api.events.battles.BattleFledEvent
|
||||
import com.cobblemon.mod.common.api.moves.Moves
|
||||
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asMoLangValue
|
||||
import com.cobblemon.mod.common.api.net.NetworkPacket
|
||||
import com.cobblemon.mod.common.api.storage.party.PlayerPartyStore
|
||||
import com.cobblemon.mod.common.api.tags.CobblemonItemTags
|
||||
import com.cobblemon.mod.common.api.text.red
|
||||
import com.cobblemon.mod.common.api.text.yellow
|
||||
@@ -84,8 +83,6 @@ open class PokemonBattle(
|
||||
|
||||
val onEndHandlers: MutableList<(PokemonBattle) -> Unit> = mutableListOf()
|
||||
|
||||
val battlePartyStores = mutableListOf<PlayerPartyStore>()
|
||||
|
||||
init {
|
||||
side1.battle = this
|
||||
side2.battle = this
|
||||
@@ -374,13 +371,6 @@ open class PokemonBattle(
|
||||
|
||||
}
|
||||
|
||||
fun dispatchWaitingToFront(delaySeconds: Float = 1F, dispatcher: () -> Unit) {
|
||||
dispatches.addFirst(BattleDispatch {
|
||||
dispatcher()
|
||||
WaitDispatch(delaySeconds)
|
||||
})
|
||||
}
|
||||
|
||||
fun dispatchGo(dispatcher: () -> Unit) {
|
||||
dispatch {
|
||||
dispatcher()
|
||||
|
||||
@@ -32,9 +32,6 @@ import com.cobblemon.mod.common.api.storage.party.PartyStore
|
||||
import com.cobblemon.mod.common.api.text.text
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.wavefunction.WaveFunctions
|
||||
import com.cobblemon.mod.common.entity.npc.NPCEntity
|
||||
import com.cobblemon.mod.common.entity.pokemon.PokemonBehaviourFlag
|
||||
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
|
||||
import com.cobblemon.mod.common.entity.pokemon.ai.PokemonMoveControl
|
||||
import com.cobblemon.mod.common.net.messages.client.effect.RunPosableMoLangPacket
|
||||
import com.cobblemon.mod.common.pokemon.Pokemon
|
||||
import com.cobblemon.mod.common.util.*
|
||||
@@ -56,7 +53,6 @@ import net.minecraft.server.level.ServerPlayer
|
||||
import net.minecraft.tags.TagKey
|
||||
import net.minecraft.world.damagesource.DamageSource
|
||||
import net.minecraft.world.damagesource.DamageTypes
|
||||
import net.minecraft.world.entity.Entity
|
||||
import net.minecraft.world.entity.LivingEntity
|
||||
import net.minecraft.world.entity.player.Player
|
||||
import net.minecraft.world.level.Level
|
||||
@@ -196,7 +192,6 @@ object MoLangFunctions {
|
||||
map.put("is_in_water") { _ -> DoubleValue(entity.isUnderWater) }
|
||||
map.put("is_touching_water_or_rain") { _ -> DoubleValue(entity.isInWaterRainOrBubble) }
|
||||
map.put("is_touching_water") { _ -> DoubleValue(entity.isInWater) }
|
||||
map.put("is_underwater") { DoubleValue(entity.getIsSubmerged()) }
|
||||
map.put("is_in_lava") { _ -> DoubleValue(entity.isInLava) }
|
||||
map.put("is_on_fire") { _ -> DoubleValue(entity.isOnFire) }
|
||||
map.put("is_invisible") { _ -> DoubleValue(entity.isInvisible) }
|
||||
@@ -213,18 +208,10 @@ object MoLangFunctions {
|
||||
map.put("velocity_x") { _ -> DoubleValue(entity.deltaMovement.x) }
|
||||
map.put("velocity_y") { _ -> DoubleValue(entity.deltaMovement.y) }
|
||||
map.put("velocity_z") { _ -> DoubleValue(entity.deltaMovement.z) }
|
||||
map.put("width") { DoubleValue(entity.boundingBox.xsize) }
|
||||
map.put("height") { DoubleValue(entity.boundingBox.ysize) }
|
||||
map.put("entity_size") { DoubleValue(entity.boundingBox.run { if (xsize > ysize) xsize else ysize }) }
|
||||
map.put("entity_width") { DoubleValue(entity.boundingBox.xsize) }
|
||||
map.put("entity_height") { DoubleValue(entity.boundingBox.ysize) }
|
||||
|
||||
map.put("horizontal_velocity") { _ -> DoubleValue(entity.deltaMovement.horizontalDistance()) }
|
||||
map.put("vertical_velocity") { DoubleValue(entity.deltaMovement.y) }
|
||||
map.put("is_on_ground") { _ -> DoubleValue(entity.onGround()) }
|
||||
map.put("world") { _ -> entity.level().worldRegistry.wrapAsHolder(entity.level()).asWorldMoLangValue() }
|
||||
map.put("biome") { _ -> entity.level().getBiome(entity.blockPosition()).asBiomeMoLangValue() }
|
||||
map.put("is_passenger") { DoubleValue(entity.isPassenger) }
|
||||
map.put("is_healer_in_use") { params ->
|
||||
val pos = params.get<ArrayStruct>(0).asBlockPos()
|
||||
val healer = entity.level().getBlockEntity(pos, CobblemonBlockEntities.HEALING_MACHINE).orElse(null) ?: return@put DoubleValue.ONE
|
||||
@@ -332,28 +319,6 @@ object MoLangFunctions {
|
||||
}
|
||||
)
|
||||
|
||||
val pokemonFunctions = mutableListOf<(Pokemon) -> HashMap<String, java.util.function.Function<MoParams, Any>>>(
|
||||
{ pokemon ->
|
||||
val map = hashMapOf<String, java.util.function.Function<MoParams, Any>>()
|
||||
map.put("is_wild") { DoubleValue(pokemon.isWild()) }
|
||||
map.put("is_shiny") { DoubleValue(pokemon.shiny) }
|
||||
map.put("form") { StringValue(pokemon.form.name) }
|
||||
map.put("weight") { DoubleValue(pokemon.species.weight.toDouble()) }
|
||||
map
|
||||
}
|
||||
)
|
||||
|
||||
val pokemonEntityFunctions = mutableListOf<(PokemonEntity) -> HashMap<String, java.util.function.Function<MoParams, Any>>>(
|
||||
{ pokemonEntity ->
|
||||
val map = hashMapOf<String, java.util.function.Function<MoParams, Any>>()
|
||||
map.put("in_battle") { DoubleValue(pokemonEntity.isBattling) }
|
||||
map.put("is_moving") { DoubleValue((pokemonEntity.moveControl as? PokemonMoveControl)?.hasWanted() == true) }
|
||||
map.put("is_flying") { DoubleValue(pokemonEntity.getBehaviourFlag(PokemonBehaviourFlag.FLYING)) }
|
||||
map.put("has_aspect") { DoubleValue(it.getString(0) in pokemonEntity.aspects) }
|
||||
map
|
||||
}
|
||||
)
|
||||
|
||||
val partyFunctions = mutableListOf<(PartyStore) -> HashMap<String, java.util.function.Function<MoParams, Any>>>(
|
||||
{ party ->
|
||||
val map = hashMapOf<String, java.util.function.Function<MoParams, Any>>()
|
||||
@@ -423,30 +388,6 @@ object MoLangFunctions {
|
||||
return this
|
||||
}
|
||||
|
||||
fun QueryStruct.addEntityFunctions(entity: LivingEntity): QueryStruct {
|
||||
val addedFunctions = entityFunctions
|
||||
.flatMap { it.invoke(entity).entries }
|
||||
.associate { it.key to it.value }
|
||||
functions.putAll(addedFunctions)
|
||||
return this
|
||||
}
|
||||
|
||||
fun QueryStruct.addPokemonFunctions(pokemon: Pokemon): QueryStruct {
|
||||
val addedFunctions = pokemonFunctions
|
||||
.flatMap { it.invoke(pokemon).entries }
|
||||
.associate { it.key to it.value }
|
||||
functions.putAll(addedFunctions)
|
||||
return this
|
||||
}
|
||||
|
||||
fun QueryStruct.addPokemonEntityFunctions(pokemonEntity: PokemonEntity): QueryStruct {
|
||||
val addedFunctions = pokemonEntityFunctions
|
||||
.flatMap { it.invoke(pokemonEntity).entries }
|
||||
.associate { it.key to it.value }
|
||||
functions.putAll(addedFunctions)
|
||||
return this
|
||||
}
|
||||
|
||||
fun <T : QueryStruct> T.addFunctions(functions: Map<String, java.util.function.Function<MoParams, Any>>): T {
|
||||
this.functions.putAll(functions)
|
||||
return this
|
||||
|
||||
@@ -35,14 +35,6 @@ class BenchedMoves : Iterable<BenchedMove> {
|
||||
emit = previousEmit
|
||||
}
|
||||
|
||||
fun copyFrom(other: BenchedMoves) {
|
||||
doWithoutEmitting {
|
||||
clear()
|
||||
other.forEach { add(it) }
|
||||
}
|
||||
update()
|
||||
}
|
||||
|
||||
fun doThenEmit(action: () -> Unit) {
|
||||
doWithoutEmitting(action)
|
||||
update()
|
||||
|
||||
@@ -13,7 +13,6 @@ import com.cobblemon.mod.common.CobblemonSounds
|
||||
import com.cobblemon.mod.common.api.battles.model.PokemonBattle
|
||||
import com.cobblemon.mod.common.api.battles.model.actor.BattleActor
|
||||
import com.cobblemon.mod.common.api.storage.party.PartyStore
|
||||
import com.cobblemon.mod.common.api.storage.party.PlayerPartyStore
|
||||
import com.cobblemon.mod.common.battles.actor.PlayerBattleActor
|
||||
import com.cobblemon.mod.common.battles.actor.PokemonBattleActor
|
||||
import com.cobblemon.mod.common.battles.pokemon.BattlePokemon
|
||||
@@ -33,6 +32,7 @@ import net.minecraft.network.chat.MutableComponent
|
||||
import net.minecraft.server.level.ServerPlayer
|
||||
import net.minecraft.world.entity.Entity
|
||||
import net.minecraft.world.phys.Vec3
|
||||
import java.util.*
|
||||
import kotlin.collections.HashMap
|
||||
import kotlin.collections.Iterable
|
||||
import kotlin.collections.MutableSet
|
||||
@@ -61,30 +61,8 @@ object BattleBuilder {
|
||||
healFirst: Boolean = false,
|
||||
partyAccessor: (ServerPlayer) -> PartyStore = { it.party() }
|
||||
): BattleStartResult {
|
||||
|
||||
val adjustLevel = battleFormat.adjustLevel
|
||||
val team1 = partyAccessor(player1).toBattleTeam(clone = cloneParties || adjustLevel > 0, healPokemon = healFirst, leadingPokemonPlayer1).sortedBy { it.health <= 0 }
|
||||
val team2 = partyAccessor(player2).toBattleTeam(clone = cloneParties || adjustLevel > 0, healPokemon = healFirst, leadingPokemonPlayer2).sortedBy { it.health <= 0 }
|
||||
|
||||
val battlePartyStores = mutableListOf<PlayerPartyStore>()
|
||||
|
||||
if (adjustLevel > 0) {
|
||||
val tempStoreP1 = PlayerPartyStore(player1.uuid)
|
||||
team1.forEachIndexed { index, it ->
|
||||
it.effectedPokemon.level = adjustLevel
|
||||
it.effectedPokemon.heal()
|
||||
tempStoreP1.set(index, it.effectedPokemon)
|
||||
}
|
||||
battlePartyStores.add(tempStoreP1)
|
||||
|
||||
val tempStoreP2 = PlayerPartyStore(player2.uuid)
|
||||
team2.forEachIndexed { index, it ->
|
||||
it.effectedPokemon.level = adjustLevel
|
||||
it.effectedPokemon.heal()
|
||||
tempStoreP2.set(index, it.effectedPokemon)
|
||||
}
|
||||
battlePartyStores.add(tempStoreP2)
|
||||
}
|
||||
val team1 = partyAccessor(player1).toBattleTeam(clone = cloneParties, healPokemon = healFirst, leadingPokemonPlayer1).sortedBy { it.health <= 0 }
|
||||
val team2 = partyAccessor(player2).toBattleTeam(clone = cloneParties, healPokemon = healFirst, leadingPokemonPlayer2).sortedBy { it.health <= 0 }
|
||||
|
||||
val player1Actor = PlayerBattleActor(player1.uuid, team1)
|
||||
val player2Actor = PlayerBattleActor(player2.uuid, team2)
|
||||
@@ -114,7 +92,6 @@ object BattleBuilder {
|
||||
).ifSuccessful {
|
||||
player1Actor.battleTheme = player2.getBattleTheme()
|
||||
player2Actor.battleTheme = player1.getBattleTheme()
|
||||
it.battlePartyStores.addAll(battlePartyStores)
|
||||
result = SuccessfulBattleStart(it)
|
||||
}
|
||||
result
|
||||
@@ -141,20 +118,6 @@ object BattleBuilder {
|
||||
}
|
||||
val playerActors = teams.mapIndexed { index, team -> PlayerBattleActor(players[index].uuid, team)}.toMutableList()
|
||||
|
||||
val adjustLevel = battleFormat.adjustLevel
|
||||
val battlePartyStores = mutableListOf<PlayerPartyStore>()
|
||||
|
||||
if (adjustLevel > 0) {
|
||||
teams.forEachIndexed { index, battleTeam ->
|
||||
battleTeam.forEach { battlePokemon ->
|
||||
battlePokemon.effectedPokemon.level = adjustLevel
|
||||
battlePokemon.effectedPokemon.heal()
|
||||
val tempStore = PlayerPartyStore(players[index].uuid)
|
||||
battlePartyStores.add(tempStore)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val errors = ErroredBattleStart()
|
||||
|
||||
if (players.size != BattleRegistry.MAX_TEAM_MEMBER_COUNT * 2) {
|
||||
@@ -207,8 +170,6 @@ object BattleBuilder {
|
||||
|
||||
playerActors[2].battleTheme = players[0].getBattleTheme()
|
||||
playerActors[3].battleTheme = players[0].getBattleTheme()
|
||||
|
||||
it.battlePartyStores.addAll(battlePartyStores)
|
||||
}
|
||||
errors
|
||||
} else {
|
||||
|
||||
@@ -24,9 +24,8 @@ import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
data class BattleFormat(
|
||||
val mod: String = "cobblemon",
|
||||
val battleType: BattleType = BattleTypes.SINGLES,
|
||||
var ruleSet: Set<String> = setOf(),
|
||||
val gen: Int = 9,
|
||||
var adjustLevel: Int = -1, // Stop gap rule before a more general system for rules enforced by Cobblemon is implemented.
|
||||
val ruleSet: Set<String> = setOf(),
|
||||
val gen: Int = 9
|
||||
) {
|
||||
companion object {
|
||||
val GEN_9_SINGLES = BattleFormat(
|
||||
@@ -50,8 +49,8 @@ data class BattleFormat(
|
||||
)
|
||||
|
||||
val GEN_9_ROYAL = BattleFormat(
|
||||
battleType = BattleTypes.ROYAL,
|
||||
ruleSet = mutableSetOf(BattleRules.OBTAINABLE, BattleRules.PAST, BattleRules.UNOBTAINABLE)
|
||||
battleType = BattleTypes.ROYAL,
|
||||
ruleSet = mutableSetOf(BattleRules.OBTAINABLE, BattleRules.PAST, BattleRules.UNOBTAINABLE)
|
||||
)
|
||||
|
||||
fun loadFromBuffer(buffer: RegistryFriendlyByteBuf): BattleFormat {
|
||||
@@ -59,12 +58,10 @@ data class BattleFormat(
|
||||
val battleType = BattleType.loadFromBuffer(buffer)
|
||||
val ruleSet = mutableSetOf<String>()
|
||||
repeat(times = buffer.readSizedInt(IntSize.U_BYTE)) { ruleSet.add(buffer.readString()) }
|
||||
val adjustLevel = buffer.readSizedInt(IntSize.INT)
|
||||
return BattleFormat(
|
||||
mod = mod,
|
||||
battleType = battleType,
|
||||
ruleSet = ruleSet,
|
||||
adjustLevel = adjustLevel
|
||||
ruleSet = ruleSet
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -74,7 +71,6 @@ data class BattleFormat(
|
||||
battleType.saveToBuffer(buffer)
|
||||
buffer.writeSizedInt(IntSize.U_BYTE, ruleSet.size)
|
||||
ruleSet.forEach(buffer::writeString)
|
||||
buffer.writeSizedInt(IntSize.INT, adjustLevel)
|
||||
return buffer
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ class InitializeInstruction(val instructionSet: InstructionSet, val message: Bat
|
||||
pokemon.entity?.let {
|
||||
// If a Pokémon entity is being recalled with an animation,
|
||||
// wrap up the animation and recall the Pokémon immediately.
|
||||
if (it.beamMode == 3 && battle.battlePartyStores.isEmpty()) {
|
||||
if (it.beamMode == 3) {
|
||||
pokemon.effectedPokemon.recall()
|
||||
}
|
||||
// If already on the field, initialize for the BattleInitializePacket
|
||||
|
||||
-28
@@ -9,16 +9,11 @@
|
||||
package com.cobblemon.mod.common.battles.interpreter.instructions
|
||||
|
||||
import com.bedrockk.molang.runtime.MoLangRuntime
|
||||
import com.bedrockk.molang.runtime.struct.QueryStruct
|
||||
import com.bedrockk.molang.runtime.value.DoubleValue
|
||||
import com.bedrockk.molang.runtime.value.StringValue
|
||||
import com.cobblemon.mod.common.CobblemonNetwork.sendPacket
|
||||
import com.cobblemon.mod.common.api.battles.interpreter.BattleMessage
|
||||
import com.cobblemon.mod.common.api.battles.interpreter.Effect
|
||||
import com.cobblemon.mod.common.api.battles.model.PokemonBattle
|
||||
import com.cobblemon.mod.common.api.molang.MoLangFunctions.addEntityFunctions
|
||||
import com.cobblemon.mod.common.api.molang.MoLangFunctions.addPokemonEntityFunctions
|
||||
import com.cobblemon.mod.common.api.molang.MoLangFunctions.addPokemonFunctions
|
||||
import com.cobblemon.mod.common.api.molang.MoLangFunctions.addStandardFunctions
|
||||
import com.cobblemon.mod.common.api.moves.Moves
|
||||
import com.cobblemon.mod.common.api.moves.animations.ActionEffectContext
|
||||
@@ -31,14 +26,9 @@ import com.cobblemon.mod.common.battles.dispatch.InstructionSet
|
||||
import com.cobblemon.mod.common.battles.dispatch.InterpreterInstruction
|
||||
import com.cobblemon.mod.common.battles.dispatch.UntilDispatch
|
||||
import com.cobblemon.mod.common.battles.pokemon.BattlePokemon
|
||||
import com.cobblemon.mod.common.net.messages.client.battle.BattleAppendTargetedEntityPacket
|
||||
import com.cobblemon.mod.common.pokemon.evolution.progress.UseMoveEvolutionProgress
|
||||
import com.cobblemon.mod.common.util.battleLang
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import net.minecraft.server.level.ServerLevel
|
||||
import net.minecraft.server.level.ServerPlayer
|
||||
import net.minecraft.world.entity.ai.targeting.TargetingConditions
|
||||
import net.minecraft.world.phys.AABB
|
||||
import java.util.concurrent.CompletableFuture
|
||||
|
||||
/**
|
||||
@@ -107,13 +97,6 @@ class MoveInstruction(
|
||||
val runtime = MoLangRuntime().also {
|
||||
battle.addQueryFunctions(it.environment.query).addStandardFunctions()
|
||||
}
|
||||
userPokemon.effectedPokemon.entity?.let {
|
||||
val queryStruct = QueryStruct(hashMapOf())
|
||||
queryStruct.addEntityFunctions(it)
|
||||
queryStruct.addPokemonEntityFunctions(it)
|
||||
queryStruct.addPokemonFunctions(it.pokemon)
|
||||
runtime.environment.variable.setDirectly("user", queryStruct)
|
||||
}
|
||||
|
||||
actionEffect ?: return@dispatch GO
|
||||
val context = ActionEffectContext(
|
||||
@@ -147,17 +130,6 @@ class MoveInstruction(
|
||||
runtime.environment.query.addFunction("move") { move.struct }
|
||||
runtime.environment.query.addFunction("instruction_id") { StringValue(cobblemonResource("move").toString()) }
|
||||
|
||||
if (userPokemon.entity != null && targetPokemon?.entity != null) {
|
||||
//Not the most elegant solution, maybe we should just make the targeted entity a piece of SyncedData
|
||||
val serverLevel = userPokemon.entity!!.level() as? ServerLevel
|
||||
serverLevel?.getNearbyPlayers(
|
||||
TargetingConditions.forNonCombat(),
|
||||
userPokemon.entity!!,
|
||||
AABB.ofSize(userPokemon.entity!!.position(), 128.0, 128.0, 128.0)
|
||||
)?.mapNotNull { it as? ServerPlayer }?.forEach { it.sendPacket(BattleAppendTargetedEntityPacket(userPokemon.entity!!.id, targetPokemon.entity!!.id)) }
|
||||
|
||||
battle.sendUpdate(BattleAppendTargetedEntityPacket(userPokemon.entity!!.id, targetPokemon.entity!!.id))
|
||||
}
|
||||
this.future = actionEffect.run(context)
|
||||
holds = context.holds // Reference so future things can check on this action effect's holds
|
||||
future.thenApply { holds.clear() }
|
||||
|
||||
-24
@@ -25,8 +25,6 @@ import com.cobblemon.mod.common.net.serverhandling.storage.SendOutPokemonHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.storage.SendOutPokemonHandler.SEND_OUT_STAGGER_BASE_DURATION
|
||||
import com.cobblemon.mod.common.net.serverhandling.storage.SendOutPokemonHandler.SEND_OUT_STAGGER_RANDOM_MAX_DURATION
|
||||
import com.cobblemon.mod.common.util.battleLang
|
||||
import com.cobblemon.mod.common.util.getPlayer
|
||||
import com.cobblemon.mod.common.util.party
|
||||
import com.cobblemon.mod.common.util.swap
|
||||
import java.util.concurrent.CompletableFuture
|
||||
import kotlin.random.Random
|
||||
@@ -91,28 +89,6 @@ class SwitchInstruction(val instructionSet: InstructionSet, val battleActor: Bat
|
||||
}
|
||||
GO
|
||||
}
|
||||
|
||||
val futureSwitches = instructionSet.getSubsequentInstructions(this).filterIsInstance<SwitchInstruction>()
|
||||
if (futureSwitches.isEmpty()) {
|
||||
if (battle.format.adjustLevel > 0) {
|
||||
// means battle is using clone teams, recall the "real" pokemon before the sendouts occur
|
||||
var waitOnRecall = false
|
||||
battle.actors.forEach { it ->
|
||||
val playerUUIDS = it.getPlayerUUIDs()
|
||||
playerUUIDS.forEach { uuid ->
|
||||
uuid.getPlayer()?.party()?.forEach { pokemon ->
|
||||
if (pokemon.entity != null) {
|
||||
waitOnRecall = true
|
||||
pokemon.entity!!.recallWithAnimation()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (waitOnRecall) {
|
||||
battle.dispatchWaitingToFront(SEND_OUT_DURATION) { }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
battle.dispatchInsert {
|
||||
|
||||
@@ -22,8 +22,6 @@ import com.cobblemon.mod.common.net.messages.client.battle.BattleUpdateTeamPokem
|
||||
import com.cobblemon.mod.common.pokemon.IVs
|
||||
import com.cobblemon.mod.common.pokemon.Nature
|
||||
import com.cobblemon.mod.common.pokemon.Pokemon
|
||||
import com.cobblemon.mod.common.pokemon.properties.BattleCloneProperty
|
||||
import com.cobblemon.mod.common.pokemon.properties.UncatchableProperty
|
||||
import com.cobblemon.mod.common.util.battleLang
|
||||
import java.util.UUID
|
||||
import net.minecraft.network.chat.MutableComponent
|
||||
@@ -35,16 +33,11 @@ open class BattlePokemon(
|
||||
) {
|
||||
lateinit var actor: BattleActor
|
||||
companion object {
|
||||
fun safeCopyOf(pokemon: Pokemon): BattlePokemon {
|
||||
val effectedPokemon = pokemon.clone()
|
||||
BattleCloneProperty.isBattleClone().apply(effectedPokemon)
|
||||
UncatchableProperty.uncatchable().apply(effectedPokemon)
|
||||
return BattlePokemon(
|
||||
originalPokemon = pokemon,
|
||||
effectedPokemon = effectedPokemon,
|
||||
postBattleEntityOperation = { it.recallWithAnimation() }
|
||||
)
|
||||
}
|
||||
fun safeCopyOf(pokemon: Pokemon): BattlePokemon = BattlePokemon(
|
||||
originalPokemon = pokemon,
|
||||
effectedPokemon = pokemon.clone(),
|
||||
postBattleEntityOperation = { entity -> entity.discard() }
|
||||
)
|
||||
|
||||
fun playerOwned(pokemon: Pokemon): BattlePokemon = BattlePokemon(
|
||||
originalPokemon = pokemon,
|
||||
|
||||
@@ -23,7 +23,6 @@ import net.minecraft.world.level.LevelReader
|
||||
import net.minecraft.world.level.block.Block
|
||||
import net.minecraft.world.level.block.Blocks
|
||||
import net.minecraft.world.level.block.CropBlock
|
||||
import net.minecraft.world.level.block.FarmBlock
|
||||
import net.minecraft.world.level.block.state.BlockState
|
||||
import net.minecraft.world.level.block.state.StateDefinition
|
||||
import net.minecraft.world.level.block.state.properties.BooleanProperty
|
||||
@@ -99,61 +98,12 @@ class RevivalHerbBlock(settings: Properties) : CropBlock(settings), Mulchable {
|
||||
if (world.getRawBrightness(pos, 0) < 9 || this.isMaxAge(state)) {
|
||||
return
|
||||
}
|
||||
val currentMoisture = getMoistureAmount(this, world, pos)
|
||||
val currentMoisture = getGrowthSpeed(this, world, pos)
|
||||
if (random.nextInt((25F / currentMoisture).toInt() + 1) == 0) {
|
||||
this.growCrops(world, pos, state, false)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is a copy pasta of [CropBlock.getGrowthSpeed]. Why? Because neoforge changes the signature of this
|
||||
* vanilla method, breaking us at runtime. To prevent this, we simply avoid using the vanilla method and create our own,
|
||||
* while not ideal, it works....
|
||||
*/
|
||||
fun getMoistureAmount(block: Block, level: BlockGetter, pos: BlockPos): Float {
|
||||
var growthSpeed = 1.0F
|
||||
var ground = pos.below()
|
||||
|
||||
for(x in -1..1) {
|
||||
for(z in -1..1) {
|
||||
var nearbyFarmLandBoost = 0.0F
|
||||
var blockState = level.getBlockState(ground.offset(x, 0, z))
|
||||
if (blockState.`is`(Blocks.FARMLAND)) {
|
||||
nearbyFarmLandBoost = 1.0F
|
||||
if (blockState.getValue(FarmBlock.MOISTURE) > 0) {
|
||||
nearbyFarmLandBoost = 3.0F
|
||||
}
|
||||
}
|
||||
|
||||
if (x != 0 || z != 0) {
|
||||
nearbyFarmLandBoost /= 4.0F
|
||||
}
|
||||
|
||||
growthSpeed += nearbyFarmLandBoost
|
||||
}
|
||||
}
|
||||
|
||||
var north = pos.north()
|
||||
var south = pos.south()
|
||||
var west = pos.west()
|
||||
var east = pos.east()
|
||||
var sameBlockDirectNeighborXAxis = level.getBlockState(west).`is`(block) || level.getBlockState(east).`is`(block)
|
||||
var sameBlockDirectNeighborZAxis = level.getBlockState(north).`is`(block) || level.getBlockState(south).`is`(block)
|
||||
if (sameBlockDirectNeighborZAxis && sameBlockDirectNeighborXAxis) {
|
||||
growthSpeed /= 2.0F
|
||||
} else {
|
||||
var sameBlockDiagonallyPresent = level.getBlockState(west.north()).`is`(block) ||
|
||||
level.getBlockState(east.north()).`is`(block) ||
|
||||
level.getBlockState(east.south()).`is`(block) ||
|
||||
level.getBlockState(west.south()).`is`(block)
|
||||
if (sameBlockDiagonallyPresent) {
|
||||
growthSpeed /= 2.0F
|
||||
}
|
||||
}
|
||||
|
||||
return growthSpeed
|
||||
}
|
||||
|
||||
override fun growCrops(world: Level, pos: BlockPos, state: BlockState) {
|
||||
this.growCrops(world, pos, state, true)
|
||||
}
|
||||
|
||||
+2
-4
@@ -14,7 +14,6 @@ import com.bedrockk.molang.runtime.value.StringValue
|
||||
import com.cobblemon.mod.common.Cobblemon
|
||||
import com.cobblemon.mod.common.CobblemonSounds
|
||||
import com.cobblemon.mod.common.api.entity.PokemonSideDelegate
|
||||
import com.cobblemon.mod.common.api.molang.MoLangFunctions.addEntityFunctions
|
||||
import com.cobblemon.mod.common.api.molang.MoLangFunctions.addFunctions
|
||||
import com.cobblemon.mod.common.api.pokemon.PokemonSpecies
|
||||
import com.cobblemon.mod.common.api.scheduling.ScheduledTask
|
||||
@@ -46,6 +45,8 @@ import net.minecraft.world.InteractionHand
|
||||
import net.minecraft.world.entity.Entity
|
||||
import net.minecraft.world.entity.player.Player
|
||||
import net.minecraft.world.phys.Vec3
|
||||
import java.util.UUID
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
class PokemonClientDelegate : PosableState(), PokemonSideDelegate {
|
||||
companion object {
|
||||
@@ -93,8 +94,6 @@ class PokemonClientDelegate : PosableState(), PokemonSideDelegate {
|
||||
private var scaleAnimTask: ScheduledTask? = null
|
||||
private var cryAnimation: ActiveAnimation? = null
|
||||
|
||||
var targetedEntityId: Int? = null
|
||||
|
||||
override fun onSyncedDataUpdated(data: EntityDataAccessor<*>) {
|
||||
super.onSyncedDataUpdated(data)
|
||||
if (this::currentEntity.isInitialized) {
|
||||
@@ -340,7 +339,6 @@ class PokemonClientDelegate : PosableState(), PokemonSideDelegate {
|
||||
struct.addFunctions(functions.functions)
|
||||
struct.addFunctions(ClientMoLangFunctions.clientFunctions)
|
||||
runtime.environment.query = struct
|
||||
addEnemyFunctions(struct)
|
||||
}
|
||||
|
||||
override fun initialize(entity: PokemonEntity) {
|
||||
|
||||
@@ -312,7 +312,6 @@ class BattleOverlay : Gui(Minecraft.getInstance()), Schedulable {
|
||||
drawPokeBall(
|
||||
state = ballState,
|
||||
matrixStack = matrixStack,
|
||||
reversed = reversed,
|
||||
partialTicks = partialTicks
|
||||
)
|
||||
} else {
|
||||
|
||||
+12
-88
@@ -36,8 +36,6 @@ class BattleConfigureGUI(
|
||||
private val backgroundResource = cobblemonResource("textures/gui/interact/request/battle_request.png")
|
||||
private val battleArrowsResource = cobblemonResource("textures/gui/interact/request/battle_request_arrows.png")
|
||||
private var requestButton: BattleRequestButton? = null
|
||||
var autoLevelNavButtonLeft: BattleRequestNavigationButton? = null
|
||||
var autoLevelNavButtonRight: BattleRequestNavigationButton? = null
|
||||
|
||||
val battleRequestMap = mutableMapOf(
|
||||
Pair(
|
||||
@@ -142,8 +140,6 @@ class BattleConfigureGUI(
|
||||
),
|
||||
)
|
||||
|
||||
val levelRulesetOption = mutableListOf(-1, 50, 100, 5)
|
||||
|
||||
fun sendBattleRequest(battleFormat: BattleFormat, packet: PlayerInteractOptionsPacket) {
|
||||
BattleChallengePacket(packet.numericTargetId, packet.selectedPokemonId, battleFormat).sendToServer()
|
||||
}
|
||||
@@ -177,16 +173,6 @@ class BattleConfigureGUI(
|
||||
else 0
|
||||
}
|
||||
|
||||
private var levelRulesetOptionIndex = 0
|
||||
set(value) {
|
||||
// If value is within min and max
|
||||
field = if (value > 0 && value < levelRulesetOption.count()) value
|
||||
// If value is less than zero, wrap around to end
|
||||
else if (value < 0) levelRulesetOption.count() - 1
|
||||
// Else it's greater than max, wrap around to start
|
||||
else 0
|
||||
}
|
||||
|
||||
private var targetName = Component.literal("Target Name").bold()
|
||||
private var hasRequest = false
|
||||
private var ticksPassed = 0F
|
||||
@@ -196,16 +182,13 @@ class BattleConfigureGUI(
|
||||
|
||||
|
||||
override fun init() {
|
||||
|
||||
val challenge = activeRequest
|
||||
targetName = Minecraft.getInstance().player?.level()?.getPlayerByUUID(packet.targetId)?.name?.plainCopy()?.bold() ?: targetName
|
||||
hasRequest = challenge != null || activeTeamRequest != null
|
||||
if (activeTeamRequest != null) {
|
||||
options = listOf(PlayerInteractOptionsPacket.Options.TEAM_REQUEST)
|
||||
} else if (challenge != null) {
|
||||
options = packet.options.keys.filter { packet.options[it] === PlayerInteractOptionsPacket.OptionStatus.AVAILABLE && battleRequestMap[it]?.battleFormat?.battleType?.name == challenge.battleFormat?.battleType?.name }
|
||||
val level = challenge.battleFormat?.adjustLevel ?: -1
|
||||
levelRulesetOptionIndex = maxOf(0, levelRulesetOption.indexOf(level))
|
||||
options = packet.options.keys.filter { packet.options[it] === PlayerInteractOptionsPacket.OptionStatus.AVAILABLE && battleRequestMap[it]?.battleFormat?.battleType?.name == challenge.battleFormat?.battleType?.name }
|
||||
} else {
|
||||
options = packet.options.keys.filter { packet.options[it] === PlayerInteractOptionsPacket.OptionStatus.AVAILABLE && battleRequestMap.containsKey(it) }.toList()
|
||||
}
|
||||
@@ -245,24 +228,21 @@ class BattleConfigureGUI(
|
||||
) {
|
||||
//TODO: add additional battle rules, otherwise this call feels pretty silly
|
||||
battleRequestMap[options[currentPage]]?.onRequest?.let { it1 ->
|
||||
val battleFormat = battleRequestMap[options[currentPage]]?.battleFormat ?: BattleFormat.GEN_9_SINGLES
|
||||
val level = levelRulesetOption[levelRulesetOptionIndex]
|
||||
battleFormat.adjustLevel = level
|
||||
it1(packet, battleFormat)
|
||||
}
|
||||
it1(packet, battleRequestMap[options[currentPage]]?.battleFormat ?: BattleFormat.GEN_9_SINGLES) }
|
||||
closeGUI()
|
||||
}
|
||||
requestButton?.let {
|
||||
this.addRenderableWidget(it)
|
||||
this.addRenderableWidget(
|
||||
it
|
||||
)
|
||||
}
|
||||
|
||||
// BattleFormat Selection buttons
|
||||
// Selection buttons
|
||||
this.addRenderableWidget(
|
||||
BattleRequestNavigationButton(
|
||||
pX = x + 2,
|
||||
pY = y + 30,
|
||||
clickHeight = BattleRequestNavigationButton.HEIGHT * 6,
|
||||
forward = false
|
||||
pX = x + 2,
|
||||
pY = y + 30,
|
||||
forward = false
|
||||
) { currentPage = (currentPage - 1) % options.count()
|
||||
updateRequestButtonText()
|
||||
}
|
||||
@@ -270,33 +250,13 @@ class BattleConfigureGUI(
|
||||
|
||||
this.addRenderableWidget(
|
||||
BattleRequestNavigationButton(
|
||||
pX = x + 106,
|
||||
pY = y + 30,
|
||||
clickHeight = BattleRequestNavigationButton.HEIGHT * 6,
|
||||
forward = true
|
||||
pX = x + 106,
|
||||
pY = y + 30,
|
||||
forward = true
|
||||
) { currentPage = (currentPage + 1) % options.count()
|
||||
updateRequestButtonText()
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
if (battleRequestMap[options[currentPage]]?.option != PlayerInteractOptionsPacket.Options.TEAM_REQUEST) {
|
||||
|
||||
// Level Selection buttons
|
||||
autoLevelNavButtonLeft = BattleRequestNavigationButton(
|
||||
pX = x + 15,
|
||||
pY = y + 75,
|
||||
forward = false
|
||||
) { levelRulesetOptionIndex -= 1 }
|
||||
this.addRenderableWidget(autoLevelNavButtonLeft)
|
||||
|
||||
autoLevelNavButtonRight = BattleRequestNavigationButton(
|
||||
pX = x + 93,
|
||||
pY = y + 75,
|
||||
forward = true
|
||||
) {levelRulesetOptionIndex += 1 }
|
||||
this.addRenderableWidget(autoLevelNavButtonRight)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -368,42 +328,6 @@ class BattleConfigureGUI(
|
||||
shadow = true
|
||||
)
|
||||
|
||||
if (battleRequestMap[options[currentPage]]?.option != PlayerInteractOptionsPacket.Options.TEAM_REQUEST) {
|
||||
// Level Rule Display Text
|
||||
drawScaledText(
|
||||
context = context,
|
||||
font = CobblemonResources.DEFAULT_LARGE,
|
||||
text = if (levelRulesetOption[levelRulesetOptionIndex] < 0) lang("challenge.rule.anything_goes").bold()
|
||||
else lang("challenge.rule.level", levelRulesetOption[levelRulesetOptionIndex]).bold(),
|
||||
x = x + 55,
|
||||
y = y + 75,
|
||||
centered = true,
|
||||
shadow = true
|
||||
)
|
||||
|
||||
autoLevelNavButtonLeft.let {
|
||||
if (it != null) {
|
||||
it.active = true
|
||||
}
|
||||
}
|
||||
autoLevelNavButtonRight.let {
|
||||
if (it != null) {
|
||||
it.active = true
|
||||
}
|
||||
}
|
||||
} else {
|
||||
autoLevelNavButtonLeft.let {
|
||||
if (it != null) {
|
||||
it.active = false
|
||||
}
|
||||
}
|
||||
autoLevelNavButtonRight.let {
|
||||
if (it != null) {
|
||||
it.active = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Opponent display name
|
||||
drawScaledText(
|
||||
context = context,
|
||||
|
||||
+7
-10
@@ -19,28 +19,25 @@ import net.minecraft.network.chat.Component
|
||||
|
||||
class BattleRequestNavigationButton(
|
||||
pX: Int, pY: Int,
|
||||
private val clickHeight: Float = HEIGHT,
|
||||
private val forward: Boolean,
|
||||
onPress: OnPress
|
||||
): Button(pX, pY, (WIDTH * SCALE).toInt(), (clickHeight * SCALE).toInt(), Component.literal("Navigation"), onPress, DEFAULT_NARRATION) {
|
||||
): Button(pX, pY, (WIDTH * SCALE).toInt(), (CLICK_HEIGHT * SCALE).toInt(), Component.literal("Navigation"), onPress, DEFAULT_NARRATION) {
|
||||
|
||||
companion object {
|
||||
const val WIDTH = 9F
|
||||
const val HEIGHT = 16F
|
||||
const val SCALE = 0.5F
|
||||
private const val WIDTH = 9F
|
||||
private const val HEIGHT = 16F
|
||||
private const val CLICK_HEIGHT = HEIGHT * 6
|
||||
private const val SCALE = 0.5F
|
||||
private val forwardButtonResource = cobblemonResource("textures/gui/interact/request/arrow_right.png")
|
||||
private val backwardsButtonResource = cobblemonResource("textures/gui/interact/request/arrow_left.png")
|
||||
}
|
||||
|
||||
override fun renderWidget(context: GuiGraphics, pMouseX: Int, pMouseY: Int, pPartialTicks: Float) {
|
||||
if (!isActive) {
|
||||
return
|
||||
}
|
||||
val hovered = (isHovered(pMouseX.toDouble(), pMouseY.toDouble()))
|
||||
blitk(
|
||||
matrixStack = context.pose(),
|
||||
x = x / SCALE,
|
||||
y = (y + (clickHeight - HEIGHT) / 4) / SCALE,
|
||||
y = (y + (CLICK_HEIGHT - HEIGHT) / 4) / SCALE,
|
||||
texture = if (forward) forwardButtonResource else backwardsButtonResource,
|
||||
width = WIDTH,
|
||||
height = HEIGHT,
|
||||
@@ -54,5 +51,5 @@ class BattleRequestNavigationButton(
|
||||
soundManager.play(SimpleSoundInstance.forUI(CobblemonSounds.PC_CLICK, 1.0F))
|
||||
}
|
||||
|
||||
fun isHovered(mouseX: Double, mouseY: Double) = mouseX.toFloat() in (x.toFloat()..(x.toFloat() + (WIDTH * SCALE))) && mouseY.toFloat() in ((y.toFloat())..(y.toFloat() + (clickHeight * SCALE)))
|
||||
fun isHovered(mouseX: Double, mouseY: Double) = mouseX.toFloat() in (x.toFloat()..(x.toFloat() + (WIDTH * SCALE))) && mouseY.toFloat() in ((y.toFloat())..(y.toFloat() + (CLICK_HEIGHT * SCALE)))
|
||||
}
|
||||
@@ -314,26 +314,26 @@ class Summary private constructor(party: Collection<Pokemon?>, private val edita
|
||||
when (screen) {
|
||||
INFO -> {
|
||||
mainScreen = InfoWidget(
|
||||
pX = x + 77,
|
||||
pY = y + 12,
|
||||
pokemon = this.selectedPokemon
|
||||
pX = x + 77,
|
||||
pY = y + 12,
|
||||
pokemon = this.selectedPokemon
|
||||
)
|
||||
}
|
||||
|
||||
MOVES -> {
|
||||
mainScreen = MovesWidget(
|
||||
pX = x + 77,
|
||||
pY = y + 12,
|
||||
summary = this
|
||||
pX = x + 77,
|
||||
pY = y + 12,
|
||||
summary = this
|
||||
)
|
||||
}
|
||||
|
||||
STATS -> {
|
||||
mainScreen = StatWidget(
|
||||
pX = x + 77,
|
||||
pY = y + 12,
|
||||
pokemon = this.selectedPokemon,
|
||||
tabIndex = subIndex
|
||||
pX = x + 77,
|
||||
pY = y + 12,
|
||||
pokemon = this.selectedPokemon,
|
||||
tabIndex = subIndex
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -365,16 +365,19 @@ class Summary private constructor(party: Collection<Pokemon?>, private val edita
|
||||
val movesWidget = mainScreen
|
||||
if (movesWidget is MovesWidget) {
|
||||
sideScreen = MoveSwapScreen(
|
||||
x + 216,
|
||||
y + 24,
|
||||
movesWidget = movesWidget,
|
||||
replacedMove = move
|
||||
x + 216,
|
||||
y + 24,
|
||||
movesWidget = movesWidget,
|
||||
replacedMove = move
|
||||
).also { switchPane ->
|
||||
val pokemon = selectedPokemon
|
||||
var moveSlotList = pokemon.relearnableMoves.map { template ->
|
||||
val benched = pokemon.benchedMoves.find { it.moveTemplate == template }
|
||||
MoveSwapScreen.MoveSlot(switchPane, template, benched?.ppRaisedStages ?: 0, pokemon)
|
||||
}
|
||||
var moveSlotList = (pokemon.allAccessibleMoves
|
||||
.filter { template -> pokemon.moveSet.none { it.template == template } }
|
||||
.map { template ->
|
||||
val benched = pokemon.benchedMoves.find { it.moveTemplate == template }
|
||||
MoveSwapScreen.MoveSlot(switchPane, template, benched?.ppRaisedStages
|
||||
?: 0, pokemon)
|
||||
})
|
||||
if (pokemon.moveSet.getMoves().size > 1 && move != null) {
|
||||
// Adds the "Forget" slot
|
||||
moveSlotList += MoveSwapScreen.MoveSlot(switchPane, null, 0, pokemon)
|
||||
|
||||
+3
-3
@@ -111,9 +111,9 @@ class MoveSlotWidget(
|
||||
|
||||
var movePPText = Component.literal("${move.currentPp}/${move.maxPp}").bold()
|
||||
|
||||
if (move.currentPp <= Mth.floor(move.maxPp / 2F)) {
|
||||
movePPText = if (move.currentPp == 0) movePPText.red() else movePPText.gold()
|
||||
}
|
||||
if (move.currentPp <= Mth.floor(move.maxPp / 2F)) {
|
||||
movePPText = if (move.currentPp == 0) movePPText.red() else movePPText.gold()
|
||||
}
|
||||
|
||||
drawScaledText(
|
||||
context = context,
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ class MovesWidget(
|
||||
|
||||
private var index = -1
|
||||
private val moves = (
|
||||
if (summary.selectedPokemon.relearnableMoves.count() > 0)
|
||||
if (summary.selectedPokemon.benchedMoves.count() > 0)
|
||||
summary.selectedPokemon.moveSet.getMovesWithNulls()
|
||||
else summary.selectedPokemon.moveSet
|
||||
).map { move ->
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ class SwapMoveButton(
|
||||
val selected = if (swapScreen is MoveSwapScreen) swapScreen.replacedMove?.template == move else false
|
||||
blitk(
|
||||
matrixStack = context.pose(),
|
||||
texture = if (move == null) addMoveButtonResource else switchMoveButtonResource,
|
||||
texture = if(move == null) addMoveButtonResource else switchMoveButtonResource,
|
||||
x = (pX + OFFSET_X) / SCALE,
|
||||
y = (pY + OFFSET_Y) / SCALE,
|
||||
width = WIDTH,
|
||||
|
||||
@@ -22,7 +22,7 @@ class ModelWidget(
|
||||
pX: Int, pY: Int,
|
||||
pWidth: Int, pHeight: Int,
|
||||
var pokemon: RenderablePokemon,
|
||||
var baseScale: Float = 2.7F,
|
||||
val baseScale: Float = 2.7F,
|
||||
var rotationY: Float = 35F,
|
||||
var offsetY: Double = 0.0
|
||||
): SoundlessWidget(pX, pY, pWidth, pHeight, Component.literal("Trade - ModelWidget")) {
|
||||
|
||||
@@ -60,7 +60,13 @@ open class PartySlot(
|
||||
}
|
||||
|
||||
if (pokemon != null) {
|
||||
// context.enableScissor(x - 2, y + 2, x + SIZE + 4, y + SIZE + 4)
|
||||
context.enableScissor(
|
||||
x - 2,
|
||||
y + 2,
|
||||
x + SIZE + 4,
|
||||
y + SIZE + 4
|
||||
)
|
||||
|
||||
// Render Pokémon
|
||||
matrices.pushPose()
|
||||
matrices.translate(x + (SIZE / 2.0), y + 1.0, 0.0)
|
||||
@@ -75,7 +81,7 @@ open class PartySlot(
|
||||
)
|
||||
matrices.popPose()
|
||||
|
||||
// context.disableScissor()
|
||||
context.disableScissor()
|
||||
|
||||
// Ensure elements are not hidden behind Pokémon render
|
||||
matrices.pushPose()
|
||||
|
||||
@@ -36,7 +36,7 @@ class TradeButton(
|
||||
}
|
||||
|
||||
override fun renderWidget(context: GuiGraphics, mouseX: Int, mouseY: Int, delta: Float) {
|
||||
val enabled = parent.offeredPokemon != null && parent.opposingOfferedPokemon != null && parent.protectiveTicks <= 0 && !parent.tradeProcessing
|
||||
val enabled = parent.offeredPokemon != null && parent.opposingOfferedPokemon != null && parent.protectiveTicks <= 0
|
||||
val active = parent.trade.acceptedOppositeOffer && !parent.trade.oppositeAcceptedMyOffer.get()
|
||||
|
||||
val texture = if (!enabled) buttonDisabledResource
|
||||
@@ -52,13 +52,14 @@ class TradeButton(
|
||||
textureHeight = HEIGHT * 2
|
||||
)
|
||||
|
||||
|
||||
val label = if (active) ".".repeat(parent.readyProgress).text() else lang("ui.trade")
|
||||
drawScaledText(
|
||||
context = context,
|
||||
font = CobblemonResources.DEFAULT_LARGE,
|
||||
text = label.bold(),
|
||||
x = x + (WIDTH / 2),
|
||||
y = y + (if (active) 1 else 3),
|
||||
y = y + 2.5,
|
||||
centered = true,
|
||||
shadow = true
|
||||
)
|
||||
|
||||
@@ -21,10 +21,11 @@ import com.cobblemon.mod.common.client.gui.TypeIcon
|
||||
import com.cobblemon.mod.common.client.gui.summary.Summary
|
||||
import com.cobblemon.mod.common.client.gui.summary.widgets.common.reformatNatureTextIfMinted
|
||||
import com.cobblemon.mod.common.client.render.drawScaledText
|
||||
import com.cobblemon.mod.common.client.render.drawScaledTextJustifiedRight
|
||||
import com.cobblemon.mod.common.client.trade.ClientTrade
|
||||
import com.cobblemon.mod.common.net.messages.client.trade.TradeStartedPacket.TradeablePokemon
|
||||
import com.cobblemon.mod.common.net.messages.server.trade.*
|
||||
import com.cobblemon.mod.common.net.messages.server.trade.CancelTradePacket
|
||||
import com.cobblemon.mod.common.net.messages.server.trade.ChangeTradeAcceptancePacket
|
||||
import com.cobblemon.mod.common.net.messages.server.trade.UpdateTradeOfferPacket
|
||||
import com.cobblemon.mod.common.pokemon.Gender
|
||||
import com.cobblemon.mod.common.pokemon.Pokemon
|
||||
import com.cobblemon.mod.common.util.asTranslated
|
||||
@@ -35,7 +36,6 @@ import net.minecraft.client.Minecraft
|
||||
import net.minecraft.client.gui.GuiGraphics
|
||||
import net.minecraft.client.gui.screens.Screen
|
||||
import net.minecraft.client.resources.sounds.SimpleSoundInstance
|
||||
import net.minecraft.client.resources.sounds.SoundInstance
|
||||
import net.minecraft.network.chat.MutableComponent
|
||||
import net.minecraft.sounds.SoundEvent
|
||||
import java.util.*
|
||||
@@ -61,25 +61,12 @@ class TradeGUI(
|
||||
const val BASE_BACKGROUND_HEIGHT = 85
|
||||
const val PARTY_SLOT_PADDING = 4
|
||||
const val PORTRAIT_SIZE = 78
|
||||
const val PORTRAIT_SCALE = 2F
|
||||
const val PORTRAIT_SCALE_MULTIPLIER = 0.4F
|
||||
const val PORTRAIT_MODEL_OFFSET_Y = -8.0
|
||||
const val TYPE_SPACER_WIDTH = 134
|
||||
const val TYPE_SPACER_HEIGHT = 12
|
||||
const val TRADE_READY_WIDTH = 28
|
||||
const val TRADE_READY_HEIGHT = 6
|
||||
const val TRADE_READY_TOP_HEIGHT = 5
|
||||
const val READY_PROGRESS_LIMIT = 6
|
||||
const val TRADE_ANIMATION_WIDTH = 114
|
||||
const val TRADE_ANIMATION_HEIGHT = 133
|
||||
const val TRADE_ANIMATION_ARROWS_WIDTH = 69
|
||||
const val TRADE_ANIMATION_FRAMES = 13
|
||||
const val TRADE_ANIMATION_ARROWS_FRAMES = 18
|
||||
const val MODEL_SCALE_BUFFER_FRAMES = 3
|
||||
const val REVERSE_ANIMATION_TICK = TRADE_ANIMATION_FRAMES + MODEL_SCALE_BUFFER_FRAMES + TRADE_ANIMATION_ARROWS_FRAMES
|
||||
const val MAX_TRADE_PROGRESS = REVERSE_ANIMATION_TICK + TRADE_ANIMATION_FRAMES + MODEL_SCALE_BUFFER_FRAMES
|
||||
const val CRY_BUFFER = 7
|
||||
|
||||
const val SCALE = 0.5F
|
||||
|
||||
private val baseResource = cobblemonResource("textures/gui/trade/trade_base.png")
|
||||
@@ -91,8 +78,6 @@ class TradeGUI(
|
||||
private val tradeReadyTopResource = cobblemonResource("textures/gui/trade/trade_ready_top.png")
|
||||
private val opposingTradeReadyResource = cobblemonResource("textures/gui/trade/trade_ready_opposing.png")
|
||||
private val opposingTradeReadyTopResource = cobblemonResource("textures/gui/trade/trade_ready_top_opposing.png")
|
||||
private val tradeAnimationResource = cobblemonResource("textures/gui/trade/trade_animation.png")
|
||||
private val tradeAnimationArrowsResource = cobblemonResource("textures/gui/trade/trade_animation_arrows.png")
|
||||
}
|
||||
|
||||
private var offeredPokemonModel: ModelWidget? = null
|
||||
@@ -102,20 +87,15 @@ class TradeGUI(
|
||||
var opposingOfferedPokemon: Pokemon? = null
|
||||
|
||||
var ticksElapsed = 0
|
||||
var protectiveTicks = 0
|
||||
var selectPointerOffsetY = 0
|
||||
var readyProgress = 0
|
||||
var tradeAnimationProgress = 0
|
||||
var selectPointerOffsetIncrement = false
|
||||
var tradeProcessing = false
|
||||
var isTradeInitiator = false
|
||||
|
||||
var tradeSoundInstance: SoundInstance? = null
|
||||
var protectiveTicks = 0
|
||||
|
||||
init {
|
||||
trade.cancelEmitter.subscribe {
|
||||
cancelTradeSound()
|
||||
super.onClose()
|
||||
// Maybe a sound
|
||||
}
|
||||
|
||||
trade.completedEmitter.subscribe {
|
||||
@@ -126,36 +106,30 @@ class TradeGUI(
|
||||
CobblemonNetwork.sendToServer(CancelTradePacket())
|
||||
return@subscribe onClose()
|
||||
}
|
||||
val tradedSlot = party.indexOf(myTradedPokemon)
|
||||
val opposingTradedSlot = traderParty.indexOf(theirTradedPokemon)
|
||||
party[tradedSlot] = theirTradedPokemon
|
||||
traderParty[opposingTradedSlot] = myTradedPokemon
|
||||
|
||||
val i1 = party.indexOf(myTradedPokemon)
|
||||
val i2 = traderParty.indexOf(theirTradedPokemon)
|
||||
party[i1] = theirTradedPokemon
|
||||
traderParty[i2] = myTradedPokemon
|
||||
offeredPokemon = null
|
||||
opposingOfferedPokemon = null
|
||||
ticksElapsed = 0
|
||||
readyProgress = 0
|
||||
trade.oppositeAcceptedMyOffer.set(false)
|
||||
CobblemonNetwork.sendToServer(UpdateTradeOfferPacket(Pair(theirTradedPokemon.pokemonId, PartyPosition(tradedSlot))))
|
||||
|
||||
setOfferedPokemon(pokemon = null, isOpposing = true)
|
||||
setOfferedPokemon(pokemon = null, isOpposing = false)
|
||||
rebuildWidgets()
|
||||
// Make a sound maybe
|
||||
}
|
||||
|
||||
trade.oppositeOffer.subscribe { newOffer: Pokemon? ->
|
||||
setOfferedPokemon(pokemon = newOffer, isOpposing = true)
|
||||
}
|
||||
|
||||
trade.myOffer.subscribe { myOffer: Pokemon? ->
|
||||
setOfferedPokemon(pokemon = myOffer)
|
||||
}
|
||||
|
||||
trade.oppositeAcceptedMyOffer.subscribe {
|
||||
ticksElapsed = 0
|
||||
readyProgress = 0
|
||||
}
|
||||
|
||||
trade.tradeProcessing.subscribe {
|
||||
val (processStatus, isInitiator) = it
|
||||
tradeProcessing = processStatus
|
||||
isTradeInitiator = isInitiator
|
||||
tradeAnimationProgress = 0
|
||||
}
|
||||
}
|
||||
|
||||
override fun init() {
|
||||
@@ -178,11 +152,17 @@ class TradeGUI(
|
||||
y = y + 119,
|
||||
parent = this,
|
||||
onPress = {
|
||||
if (offeredPokemon != null && opposingOfferedPokemon != null && protectiveTicks <= 0 && !tradeProcessing) {
|
||||
if (offeredPokemon != null && opposingOfferedPokemon != null && protectiveTicks <= 0) {
|
||||
ticksElapsed = 0
|
||||
readyProgress = 0
|
||||
CobblemonNetwork.sendToServer(ChangeTradeAcceptancePacket(opposingOfferedPokemon!!.uuid, !trade.acceptedOppositeOffer))
|
||||
playSound(CobblemonSounds.GUI_CLICK)
|
||||
if (trade.acceptedOppositeOffer) {
|
||||
// trade.acceptedOppositeOffer = false;
|
||||
readyProgress = 0
|
||||
CobblemonNetwork.sendToServer(ChangeTradeAcceptancePacket(opposingOfferedPokemon!!.uuid, false))
|
||||
} else {
|
||||
// trade.acceptedOppositeOffer = true;
|
||||
readyProgress = 0
|
||||
CobblemonNetwork.sendToServer(ChangeTradeAcceptancePacket(opposingOfferedPokemon!!.uuid, true))
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
@@ -210,10 +190,9 @@ class TradeGUI(
|
||||
pokemon = pokemon,
|
||||
parent = this,
|
||||
onPress = {
|
||||
if (!trade.acceptedOppositeOffer && !tradeProcessing) {
|
||||
if (!trade.acceptedOppositeOffer) {
|
||||
val pk = if (offeredPokemon?.uuid == pokemon?.pokemonId) null else pokemon
|
||||
CobblemonNetwork.sendToServer(UpdateTradeOfferPacket(pk?.let { it.pokemonId to PartyPosition(partyIndex) }))
|
||||
playSound(CobblemonSounds.GUI_CLICK)
|
||||
}
|
||||
}
|
||||
).also { widget -> addRenderableWidget(widget) }
|
||||
@@ -265,59 +244,16 @@ class TradeGUI(
|
||||
height = BASE_BACKGROUND_HEIGHT
|
||||
)
|
||||
|
||||
if (
|
||||
(tradeAnimationProgress in MODEL_SCALE_BUFFER_FRAMES until(TRADE_ANIMATION_FRAMES + MODEL_SCALE_BUFFER_FRAMES)) ||
|
||||
(tradeAnimationProgress in (REVERSE_ANIMATION_TICK..(REVERSE_ANIMATION_TICK + TRADE_ANIMATION_FRAMES)).drop(1))
|
||||
) {
|
||||
val frameOffset = (
|
||||
if (tradeAnimationProgress > REVERSE_ANIMATION_TICK)
|
||||
(REVERSE_ANIMATION_TICK + TRADE_ANIMATION_FRAMES - tradeAnimationProgress)
|
||||
else (tradeAnimationProgress - MODEL_SCALE_BUFFER_FRAMES)
|
||||
) * TRADE_ANIMATION_HEIGHT
|
||||
blitk(
|
||||
matrixStack = matrices,
|
||||
texture = tradeAnimationResource,
|
||||
x = (x + 80.5) / SCALE,
|
||||
y = (y + 31) / SCALE,
|
||||
width = TRADE_ANIMATION_WIDTH,
|
||||
height = TRADE_ANIMATION_HEIGHT,
|
||||
vOffset = frameOffset,
|
||||
textureHeight = TRADE_ANIMATION_HEIGHT * TRADE_ANIMATION_FRAMES,
|
||||
scale = SCALE
|
||||
)
|
||||
|
||||
blitk(
|
||||
matrixStack = matrices,
|
||||
texture = tradeAnimationResource,
|
||||
x = (x + 155.5) / SCALE,
|
||||
y = (y + 31) / SCALE,
|
||||
width = TRADE_ANIMATION_WIDTH,
|
||||
height = TRADE_ANIMATION_HEIGHT,
|
||||
vOffset = frameOffset,
|
||||
textureHeight = TRADE_ANIMATION_HEIGHT * TRADE_ANIMATION_FRAMES,
|
||||
scale = SCALE
|
||||
)
|
||||
}
|
||||
|
||||
// Render Model Portraits
|
||||
var scale = PORTRAIT_SCALE
|
||||
var scaleOffsetY = PORTRAIT_MODEL_OFFSET_Y
|
||||
if (tradeProcessing) {
|
||||
val scaleInterval = if (tradeAnimationProgress > REVERSE_ANIMATION_TICK) (MAX_TRADE_PROGRESS - tradeAnimationProgress) else tradeAnimationProgress
|
||||
scale = (PORTRAIT_SCALE - (scaleInterval * PORTRAIT_SCALE_MULTIPLIER)).coerceIn(0F, PORTRAIT_SCALE)
|
||||
scaleOffsetY = (45.0 - (45.0 / PORTRAIT_SCALE) * scale) + PORTRAIT_MODEL_OFFSET_Y
|
||||
}
|
||||
if (scale > 0F) {
|
||||
context.enableScissor(backgroundX, backgroundY, backgroundX + BASE_BACKGROUND_WIDTH, backgroundY + BASE_BACKGROUND_HEIGHT)
|
||||
offeredPokemonModel?.baseScale = scale
|
||||
offeredPokemonModel?.offsetY = scaleOffsetY
|
||||
offeredPokemonModel?.render(context, mouseX, mouseY, delta)
|
||||
|
||||
opposingOfferedPokemonModel?.baseScale = scale
|
||||
opposingOfferedPokemonModel?.offsetY = scaleOffsetY
|
||||
opposingOfferedPokemonModel?.render(context, mouseX, mouseY, delta)
|
||||
context.disableScissor()
|
||||
}
|
||||
context.enableScissor(
|
||||
backgroundX,
|
||||
backgroundY,
|
||||
backgroundX + BASE_BACKGROUND_WIDTH,
|
||||
backgroundY + BASE_BACKGROUND_HEIGHT
|
||||
)
|
||||
offeredPokemonModel?.render(context, mouseX, mouseY, delta)
|
||||
opposingOfferedPokemonModel?.render(context, mouseX, mouseY, delta)
|
||||
context.disableScissor()
|
||||
|
||||
// Render Base Resource
|
||||
blitk(
|
||||
@@ -345,18 +281,16 @@ class TradeGUI(
|
||||
textureHeight = TRADE_READY_HEIGHT * READY_PROGRESS_LIMIT
|
||||
)
|
||||
|
||||
if (!tradeProcessing) {
|
||||
blitk(
|
||||
matrixStack = matrices,
|
||||
texture = tradeReadyTopResource,
|
||||
x = x + 112,
|
||||
y = y + 2,
|
||||
width = TRADE_READY_WIDTH,
|
||||
height = TRADE_READY_TOP_HEIGHT,
|
||||
vOffset = TRADE_READY_TOP_HEIGHT * readyProgress,
|
||||
textureHeight = TRADE_READY_TOP_HEIGHT * READY_PROGRESS_LIMIT
|
||||
)
|
||||
}
|
||||
blitk(
|
||||
matrixStack = matrices,
|
||||
texture = tradeReadyTopResource,
|
||||
x = x + 112,
|
||||
y = y + 2,
|
||||
width = TRADE_READY_WIDTH,
|
||||
height = TRADE_READY_TOP_HEIGHT,
|
||||
vOffset = TRADE_READY_TOP_HEIGHT * readyProgress,
|
||||
textureHeight = TRADE_READY_TOP_HEIGHT * READY_PROGRESS_LIMIT
|
||||
)
|
||||
}
|
||||
|
||||
if (trade.oppositeAcceptedMyOffer.get()) {
|
||||
@@ -371,31 +305,15 @@ class TradeGUI(
|
||||
textureHeight = TRADE_READY_HEIGHT * READY_PROGRESS_LIMIT
|
||||
)
|
||||
|
||||
if (!tradeProcessing) {
|
||||
blitk(
|
||||
matrixStack = matrices,
|
||||
texture = opposingTradeReadyTopResource,
|
||||
x = x + 153,
|
||||
y = y + 2,
|
||||
width = TRADE_READY_WIDTH,
|
||||
height = TRADE_READY_TOP_HEIGHT,
|
||||
vOffset = TRADE_READY_TOP_HEIGHT * readyProgress,
|
||||
textureHeight = TRADE_READY_TOP_HEIGHT * READY_PROGRESS_LIMIT
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// Trade animation arrows
|
||||
if (tradeAnimationProgress >= (TRADE_ANIMATION_FRAMES + MODEL_SCALE_BUFFER_FRAMES) && tradeAnimationProgress < REVERSE_ANIMATION_TICK) {
|
||||
blitk(
|
||||
matrixStack = matrices,
|
||||
texture = tradeAnimationArrowsResource,
|
||||
x = x + 112,
|
||||
texture = opposingTradeReadyTopResource,
|
||||
x = x + 153,
|
||||
y = y + 2,
|
||||
width = TRADE_ANIMATION_ARROWS_WIDTH,
|
||||
width = TRADE_READY_WIDTH,
|
||||
height = TRADE_READY_TOP_HEIGHT,
|
||||
vOffset = (((tradeAnimationProgress - MODEL_SCALE_BUFFER_FRAMES) % TRADE_ANIMATION_ARROWS_FRAMES) - MODEL_SCALE_BUFFER_FRAMES) * TRADE_READY_TOP_HEIGHT,
|
||||
textureHeight = TRADE_READY_TOP_HEIGHT * TRADE_ANIMATION_ARROWS_FRAMES
|
||||
vOffset = TRADE_READY_TOP_HEIGHT * readyProgress,
|
||||
textureHeight = TRADE_READY_TOP_HEIGHT * READY_PROGRESS_LIMIT
|
||||
)
|
||||
}
|
||||
|
||||
@@ -404,17 +322,19 @@ class TradeGUI(
|
||||
context = context,
|
||||
font = CobblemonResources.DEFAULT_LARGE,
|
||||
text = Minecraft.getInstance().user.name.text().bold(),
|
||||
x = x + 13,
|
||||
x = x + 57,
|
||||
y = y - 10.5,
|
||||
centered = true,
|
||||
shadow = true
|
||||
)
|
||||
|
||||
drawScaledTextJustifiedRight(
|
||||
drawScaledText(
|
||||
context = context,
|
||||
font = CobblemonResources.DEFAULT_LARGE,
|
||||
text = traderName.bold(),
|
||||
x = x + 280,
|
||||
x = x + 237,
|
||||
y = y - 10.5,
|
||||
centered = true,
|
||||
shadow = true
|
||||
)
|
||||
|
||||
@@ -439,15 +359,14 @@ class TradeGUI(
|
||||
override fun keyPressed(keyCode: Int, scanCode: Int, modifiers: Int): Boolean {
|
||||
if (minecraft?.options?.keyInventory?.matches(keyCode, scanCode) == true) {
|
||||
CancelTradePacket().sendToServer()
|
||||
cancelTradeSound()
|
||||
Minecraft.getInstance().setScreen(null)
|
||||
return true
|
||||
}
|
||||
|
||||
when (keyCode) {
|
||||
InputConstants.KEY_ESCAPE -> {
|
||||
// playSound(CobblemonSounds.PC_OFF)
|
||||
CancelTradePacket().sendToServer()
|
||||
cancelTradeSound()
|
||||
}
|
||||
}
|
||||
return super.keyPressed(keyCode, scanCode, modifiers)
|
||||
@@ -455,35 +374,8 @@ class TradeGUI(
|
||||
|
||||
override fun tick() {
|
||||
ticksElapsed++
|
||||
if (protectiveTicks > 0) protectiveTicks--
|
||||
if (tradeProcessing) {
|
||||
if (tradeAnimationProgress == 0) tradeSoundInstance = playSound(CobblemonSounds.GUI_TRADE)
|
||||
|
||||
tradeAnimationProgress++
|
||||
|
||||
if (offeredPokemon != null && opposingOfferedPokemon != null
|
||||
&& tradeAnimationProgress == REVERSE_ANIMATION_TICK
|
||||
&& isTradeInitiator
|
||||
) {
|
||||
CobblemonNetwork.sendToServer(PerformTradePacket(opposingOfferedPokemon!!.uuid))
|
||||
}
|
||||
|
||||
if (tradeAnimationProgress == (MAX_TRADE_PROGRESS + CRY_BUFFER)) {
|
||||
if (offeredPokemonModel !== null && opposingOfferedPokemonModel !== null) {
|
||||
offeredPokemonModel!!.state.activeAnimations.clear()
|
||||
offeredPokemonModel!!.state.addFirstAnimation(setOf("cry"))
|
||||
opposingOfferedPokemonModel!!.state.activeAnimations.clear()
|
||||
opposingOfferedPokemonModel!!.state.addFirstAnimation(setOf("cry"))
|
||||
}
|
||||
}
|
||||
|
||||
if (tradeAnimationProgress > (MAX_TRADE_PROGRESS + CRY_BUFFER)) {
|
||||
trade.tradeProcessing.set(Pair(false, false))
|
||||
ticksElapsed = 0
|
||||
readyProgress = 0
|
||||
tradeAnimationProgress = 0
|
||||
tradeSoundInstance = null
|
||||
}
|
||||
if (protectiveTicks > 0) {
|
||||
protectiveTicks--
|
||||
}
|
||||
|
||||
// Calculate select pointer offset
|
||||
@@ -496,7 +388,6 @@ class TradeGUI(
|
||||
|
||||
override fun onClose() {
|
||||
CobblemonNetwork.sendToServer(CancelTradePacket())
|
||||
cancelTradeSound()
|
||||
super.onClose()
|
||||
}
|
||||
|
||||
@@ -512,39 +403,33 @@ class TradeGUI(
|
||||
if (isOpposing) {
|
||||
opposingOfferedPokemon = pokemon
|
||||
opposingOfferedPokemonModel = if (pokemon != null) ModelWidget(
|
||||
pX = x + 145,
|
||||
pX = x + 147,
|
||||
pY = y + 30,
|
||||
pWidth = PORTRAIT_SIZE,
|
||||
pHeight = PORTRAIT_SIZE,
|
||||
pokemon = pokemon.asRenderablePokemon(),
|
||||
baseScale = PORTRAIT_SCALE,
|
||||
baseScale = 2F,
|
||||
rotationY = 35F,
|
||||
offsetY = PORTRAIT_MODEL_OFFSET_Y
|
||||
offsetY = -10.0
|
||||
) else null
|
||||
trade.acceptedOppositeOffer = false
|
||||
} else {
|
||||
offeredPokemon = pokemon
|
||||
offeredPokemonModel = if (pokemon != null) ModelWidget(
|
||||
pX = x + 70,
|
||||
pX = x + 68,
|
||||
pY = y + 30,
|
||||
pWidth = PORTRAIT_SIZE,
|
||||
pHeight = PORTRAIT_SIZE,
|
||||
pokemon = pokemon.asRenderablePokemon(),
|
||||
baseScale = PORTRAIT_SCALE,
|
||||
baseScale = 2F,
|
||||
rotationY = 325F,
|
||||
offsetY = PORTRAIT_MODEL_OFFSET_Y
|
||||
offsetY = -10.0
|
||||
) else null
|
||||
}
|
||||
}
|
||||
|
||||
private fun playSound(soundEvent: SoundEvent): SoundInstance {
|
||||
val soundInstance = SimpleSoundInstance.forUI(soundEvent, 1.0F)
|
||||
Minecraft.getInstance().soundManager.play(soundInstance)
|
||||
return soundInstance
|
||||
}
|
||||
|
||||
private fun cancelTradeSound() {
|
||||
if (tradeSoundInstance !== null) Minecraft.getInstance().soundManager.stop(tradeSoundInstance)
|
||||
private fun playSound(soundEvent: SoundEvent) {
|
||||
Minecraft.getInstance().soundManager.play(SimpleSoundInstance.forUI(soundEvent, 1.0F))
|
||||
}
|
||||
|
||||
private fun renderPokemonInfo(pokemon: Pokemon?, isOpposing: Boolean, context: GuiGraphics, x: Int, y: Int, mouseX: Int, mouseY: Int) {
|
||||
@@ -621,7 +506,7 @@ class TradeGUI(
|
||||
blitk(
|
||||
matrixStack = matrices,
|
||||
texture = Summary.iconShinyResource,
|
||||
x = (x + (if (isOpposing) 213.5 else 71.5)) / SCALE,
|
||||
x = (x + (if (isOpposing) 214.5 else 71.5)) / SCALE,
|
||||
y = (y + 33.5) / SCALE,
|
||||
width = 16,
|
||||
height = 16,
|
||||
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
package com.cobblemon.mod.common.client.net.battle
|
||||
|
||||
import com.cobblemon.mod.common.api.net.ClientNetworkPacketHandler
|
||||
import com.cobblemon.mod.common.client.entity.PokemonClientDelegate
|
||||
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
|
||||
import com.cobblemon.mod.common.net.messages.client.battle.BattleAppendTargetedEntityPacket
|
||||
import net.minecraft.client.Minecraft
|
||||
|
||||
object BattleSetTargetedEntityHandler : ClientNetworkPacketHandler<BattleAppendTargetedEntityPacket> {
|
||||
override fun handle(packet: BattleAppendTargetedEntityPacket, client: Minecraft) {
|
||||
val sourceEntity = Minecraft.getInstance().level?.getEntity(packet.sourceEntityId)
|
||||
val sourcePokemon = sourceEntity as? PokemonEntity
|
||||
if (sourcePokemon != null) {
|
||||
(sourcePokemon.delegate as PokemonClientDelegate).targetedEntityId = packet.targetedEntityId
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+3
-50
@@ -16,10 +16,12 @@ import com.cobblemon.mod.common.client.particle.BedrockParticleOptionsRepository
|
||||
import com.cobblemon.mod.common.client.particle.ParticleStorm
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.PosableState
|
||||
import com.cobblemon.mod.common.entity.PosableEntity
|
||||
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
|
||||
import com.cobblemon.mod.common.net.messages.client.effect.SpawnSnowstormEntityParticlePacket
|
||||
import com.cobblemon.mod.common.pokemon.Pokemon
|
||||
import net.minecraft.client.Minecraft
|
||||
import net.minecraft.world.entity.Entity
|
||||
import kotlin.math.pow
|
||||
import kotlin.text.get
|
||||
|
||||
object SpawnSnowstormEntityParticleHandler : ClientNetworkPacketHandler<SpawnSnowstormEntityParticlePacket> {
|
||||
override fun handle(packet: SpawnSnowstormEntityParticlePacket, client: Minecraft) {
|
||||
@@ -33,55 +35,6 @@ object SpawnSnowstormEntityParticleHandler : ClientNetworkPacketHandler<SpawnSno
|
||||
|
||||
val particleRuntime = MoLangRuntime().setup().setupClient()
|
||||
particleRuntime.environment.query.addFunction("entity") { state.runtime.environment.query }
|
||||
particleRuntime.environment.query.addFunction("point_on_curve") {
|
||||
//All this just finds a curve that goes through the given points + 0, 0
|
||||
//And calcs where we are on it at t
|
||||
val t = it.getDouble(0)
|
||||
val x1 = it.getDouble(1)
|
||||
val y1 = it.getDouble(2)
|
||||
val x2 = it.getDouble(3)
|
||||
val y2 = it.getDouble(4)
|
||||
|
||||
val a0 = 0.0
|
||||
val a1 = x1.pow(2)
|
||||
val a2 = x2.pow(2)
|
||||
val b0 = 0.0
|
||||
val b1 = x1
|
||||
val b2 = x2
|
||||
val c0 = 1.0
|
||||
val c1 = 1.0
|
||||
val c2 = 1.0
|
||||
val d0 = 0.0
|
||||
val d1 = y1
|
||||
val d2 = y2
|
||||
|
||||
val matrix = arrayOf(
|
||||
arrayOf(a2, b2, c2, d2),
|
||||
arrayOf(a1, b1, c1, d1),
|
||||
arrayOf(a0, b0, c0, d0)
|
||||
)
|
||||
|
||||
for (i in 0 until 3) {
|
||||
var pivot = matrix[i][i]
|
||||
if (pivot != 0.0) {
|
||||
for (j in 0 until 4) {
|
||||
matrix[i][j] /= pivot
|
||||
}
|
||||
}
|
||||
|
||||
// Make other elements in the current column 0
|
||||
for (k in 0 until 3) {
|
||||
if (k != i) {
|
||||
val factor = matrix[k][i]
|
||||
for (j in 0 until 4) {
|
||||
matrix[k][j] -= factor * matrix[i][j]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return@addFunction matrix[0][3] * t.pow(2) + matrix[1][3] * t + matrix[2][3]
|
||||
}
|
||||
|
||||
val storm = ParticleStorm(
|
||||
effect = effect,
|
||||
|
||||
-21
@@ -1,21 +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.client.net.trade
|
||||
|
||||
import com.cobblemon.mod.common.api.net.ClientNetworkPacketHandler
|
||||
import com.cobblemon.mod.common.client.CobblemonClient
|
||||
import com.cobblemon.mod.common.net.messages.client.trade.TradeProcessStartedPacket
|
||||
import net.minecraft.client.Minecraft
|
||||
|
||||
object TradeProcessStartedHandler : ClientNetworkPacketHandler<TradeProcessStartedPacket> {
|
||||
override fun handle(packet: TradeProcessStartedPacket, client: Minecraft) {
|
||||
val trade = CobblemonClient.trade ?: return
|
||||
trade.tradeProcessing.emit(Pair(true, packet.isTradeInitiator))
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,6 @@ import com.cobblemon.mod.common.api.snowstorm.BedrockParticleOptions
|
||||
import com.cobblemon.mod.common.api.snowstorm.ParticleEmitterAction
|
||||
import com.cobblemon.mod.common.client.render.MatrixWrapper
|
||||
import com.cobblemon.mod.common.client.render.SnowstormParticle
|
||||
import com.cobblemon.mod.common.entity.AttackingEntity
|
||||
import com.cobblemon.mod.common.entity.PosableEntity
|
||||
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
|
||||
import com.cobblemon.mod.common.particle.SnowstormParticleOptions
|
||||
@@ -63,9 +62,6 @@ class ParticleStorm(
|
||||
}
|
||||
if (entity is PosableEntity) {
|
||||
runtime.environment.query.addFunction("entity") { entity.struct }
|
||||
if (entity is AttackingEntity) {
|
||||
addAttackingFunctions()
|
||||
}
|
||||
} else if (entity is Player) {
|
||||
runtime.environment.query.addFunction("entity") { entity.asMoLangValue() }
|
||||
}
|
||||
@@ -80,33 +76,6 @@ class ParticleStorm(
|
||||
Minecraft.getInstance().particleEngine.add(this)
|
||||
}
|
||||
|
||||
fun addAttackingFunctions(attackingEntity: AttackingEntity) {
|
||||
attackingEntity as Entity
|
||||
runtime.environment.query.addFunction("target_deltax") {
|
||||
val targetedEntity = getEntityById(attackingEntity.getAttackingEntityId())?: return@addFunction 1.0
|
||||
matrixWrapper.transformWorldToParticle(attackingEntity.position()).x - matrixWrapper.transformWorldToParticle(targetedEntity.position()).x
|
||||
}
|
||||
runtime.environment.query.addFunction("target_deltay") {
|
||||
val targetedEntity = getEntityById(attackingEntity.getAttackingEntityId())?: return@addFunction 1.0
|
||||
matrixWrapper.transformWorldToParticle(attackingEntity.position()).y - matrixWrapper.transformWorldToParticle(targetedEntity.position()).y
|
||||
}
|
||||
runtime.environment.query.addFunction("target_deltaz") {
|
||||
val targetedEntity = getEntityById(attackingEntity.getAttackingEntityId())?: return@addFunction 1.0
|
||||
matrixWrapper.transformWorldToParticle(attackingEntity.position()).z - matrixWrapper.transformWorldToParticle(targetedEntity.position()).z
|
||||
}
|
||||
runtime.environment.query.addFunction("target_distance") {
|
||||
val targetedEntity = getEntityById(attackingEntity.getAttackingEntityId())?: return@addFunction 2.0
|
||||
targetedEntity.position().distanceTo(attackingEntity.position())
|
||||
}
|
||||
}
|
||||
|
||||
private fun getEntityById(entityId: Int?): Entity? {
|
||||
if (entityId != null) {
|
||||
Minecraft.getInstance().level?.getEntity(entityId)
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
fun getX() = x
|
||||
fun getY() = y
|
||||
fun getZ() = z
|
||||
|
||||
@@ -33,5 +33,4 @@ class MatrixWrapper {
|
||||
|
||||
fun getOrigin() = position.add(matrix.getOrigin())
|
||||
fun transformPosition(position: Vec3) = this.position.add(matrix.transformPosition(position))
|
||||
fun transformWorldToParticle(position: Vec3) = Matrix4f(matrix).invertAffine().transformPosition(position.subtract(this.position))
|
||||
}
|
||||
-6
@@ -96,12 +96,6 @@ class LocatorAccess(
|
||||
state.getOrPut("middle") { MatrixWrapper() }.updateMatrix(matrixStack.last().pose())
|
||||
matrixStack.popPose()
|
||||
|
||||
// If we have the entity, put in a "top" locator for top center of hitbox.
|
||||
matrixStack.pushPose()
|
||||
matrixStack.translate(0.0, -entity.boundingBox.ysize, 0.0)
|
||||
matrixStack.scale(-1F, -1F, 1F)
|
||||
state.getOrPut("top") { MatrixWrapper() }.updateMatrix(matrixStack.last().pose())
|
||||
matrixStack.popPose()
|
||||
}
|
||||
|
||||
for ((name, locator) in locators) {
|
||||
|
||||
+7
@@ -17,6 +17,7 @@ import com.cobblemon.mod.common.util.isDusk
|
||||
import com.cobblemon.mod.common.util.isStandingOnRedSand
|
||||
import com.cobblemon.mod.common.util.isStandingOnSand
|
||||
import com.cobblemon.mod.common.util.isStandingOnSandOrRedSand
|
||||
import com.cobblemon.mod.common.util.isWild
|
||||
import com.google.gson.JsonDeserializationContext
|
||||
import com.google.gson.JsonDeserializer
|
||||
import com.google.gson.JsonElement
|
||||
@@ -72,6 +73,12 @@ class PoseAdapter(
|
||||
if (mustBeDusk != null) {
|
||||
conditionsList.add { mustBeDusk == it.getEntity()?.isDusk() }
|
||||
}
|
||||
val mustBeWild = json.get("isWild")?.asBoolean
|
||||
if (mustBeWild != null) {
|
||||
conditionsList.add {
|
||||
mustBeWild == it.getEntity()?.isWild()
|
||||
}
|
||||
}
|
||||
|
||||
conditionsList.addAll(poseConditionReader(json))
|
||||
|
||||
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* 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.client.render.models.blockbench.pokemon.gen1
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.animation.BimanualSwingAnimation
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.animation.BipedWalkAnimation
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BimanualFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BipedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.MOVING_POSES
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.STATIONARY_POSES
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.UI_POSES
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
class AlakazamModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame, BipedFrame, BimanualFrame {
|
||||
override val rootPart = root.registerChildWithAllChildren("alakazam")
|
||||
override val head = getPart("head")
|
||||
|
||||
override val leftArm = getPart("left_shoulder")
|
||||
override val rightArm = getPart("right_shoulder")
|
||||
override val leftLeg = getPart("left_upper_leg")
|
||||
override val rightLeg = getPart("right_upper_leg")
|
||||
|
||||
override var portraitScale = 1.75F
|
||||
override var portraitTranslation = Vec3(-0.25, 0.85, 0.0)
|
||||
|
||||
override var profileScale = 0.73F
|
||||
override var profileTranslation = Vec3(0.0, 0.65, 0.0)
|
||||
|
||||
lateinit var sleep: Pose
|
||||
lateinit var standing: Pose
|
||||
lateinit var walk: Pose
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("alakazam", "blink")}
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
poseTypes = STATIONARY_POSES + UI_POSES,
|
||||
transformTicks = 10,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
singleBoneLook() ,
|
||||
bedrock("alakazam", "ground_idle")
|
||||
)
|
||||
)
|
||||
|
||||
walk = registerPose(
|
||||
poseName = "walk",
|
||||
poseTypes = MOVING_POSES,
|
||||
transformTicks = 10,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("alakazam", "ground_idle"),
|
||||
BipedWalkAnimation(this, periodMultiplier = 0.6F, amplitudeMultiplier = 0.9F),
|
||||
BimanualSwingAnimation(this, swingPeriodMultiplier = 0.6F, amplitudeMultiplier = 0.9F)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
// override fun getFaintAnimation(
|
||||
// pokemonEntity: PokemonEntity,
|
||||
// state: PosableState<PokemonEntity>
|
||||
// ) = if (state.isPosedIn(standing, walk)) bedrockStateful("alakazam", "faint") else null
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* 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.client.render.models.blockbench.pokemon.gen1
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.MOVING_POSES
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.STATIONARY_POSES
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.UI_POSES
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
class BellsproutModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame {
|
||||
override val rootPart = root.registerChildWithAllChildren("bellsprout")
|
||||
override val head = getPart("head")
|
||||
|
||||
override var portraitScale = 2.0F
|
||||
override var portraitTranslation = Vec3(-0.1, 0.41, 0.0)
|
||||
|
||||
override var profileScale = 0.75F
|
||||
override var profileTranslation = Vec3(0.0, 0.64, 0.0)
|
||||
|
||||
lateinit var standing: Pose
|
||||
lateinit var walk: Pose
|
||||
|
||||
override fun registerPoses() {
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
poseTypes = STATIONARY_POSES + UI_POSES,
|
||||
transformTicks = 10,
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("bellsprout", "ground_idle")
|
||||
)
|
||||
)
|
||||
|
||||
walk = registerPose(
|
||||
poseName = "walk",
|
||||
poseTypes = MOVING_POSES,
|
||||
transformTicks = 10,
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("bellsprout", "ground_idle")
|
||||
//bedrock("bellsprout", "ground_walk")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
// override fun getFaintAnimation(
|
||||
// pokemonEntity: PokemonEntity,
|
||||
// state: PosableState<PokemonEntity>
|
||||
// ) = if (state.isPosedIn(standing, walk)) bedrockStateful("bellsprout", "faint") else null
|
||||
}
|
||||
-3
@@ -10,7 +10,6 @@ package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen1
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.animation.BipedWalkAnimation
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BipedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.MOVING_POSES
|
||||
@@ -34,8 +33,6 @@ class GengarModel(root: ModelPart) : PokemonPosableModel(root), BipedFrame {
|
||||
lateinit var standing: Pose
|
||||
lateinit var walk: Pose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("gengar", "cry") }
|
||||
|
||||
override fun registerPoses() {
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* 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.client.render.models.blockbench.pokemon.gen1
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.animation.BimanualSwingAnimation
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.animation.BipedWalkAnimation
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BimanualFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BipedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.MOVING_POSES
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.STATIONARY_POSES
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.UI_POSES
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
class MagmarModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame, BipedFrame, BimanualFrame {
|
||||
override val rootPart = root.registerChildWithAllChildren("magmar")
|
||||
override val head = getPart("head")
|
||||
|
||||
override val leftArm = getPart("leftarm")
|
||||
override val rightArm = getPart("rightarm")
|
||||
override val leftLeg = getPart("leftleg")
|
||||
override val rightLeg = getPart("rightleg")
|
||||
|
||||
override var portraitScale = 2.8F
|
||||
override var portraitTranslation = Vec3(-0.1, 0.3, 0.0)
|
||||
|
||||
override var profileScale = 0.8F
|
||||
override var profileTranslation = Vec3(0.0, 0.58, 0.0)
|
||||
|
||||
lateinit var standing: Pose
|
||||
lateinit var walk: Pose
|
||||
|
||||
override fun registerPoses() {
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
poseTypes = STATIONARY_POSES + UI_POSES,
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("magmar", "ground_idle")
|
||||
)
|
||||
)
|
||||
|
||||
walk = registerPose(
|
||||
poseName = "walk",
|
||||
poseTypes = MOVING_POSES,
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("magmar", "ground_idle"),
|
||||
BipedWalkAnimation(this, periodMultiplier = 0.6F, amplitudeMultiplier = 0.9F),
|
||||
BimanualSwingAnimation(this, swingPeriodMultiplier = 0.6F, amplitudeMultiplier = 0.9F)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
// override fun getFaintAnimation(
|
||||
// pokemonEntity: PokemonEntity,
|
||||
// state: PosableState<PokemonEntity>
|
||||
// ) = if (state.isPosedIn(standing, walk)) bedrockStateful("magmar", "faint") else null
|
||||
}
|
||||
-3
@@ -10,7 +10,6 @@ package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen1
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.PosableState
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
@@ -29,8 +28,6 @@ class MagnemiteModel(root: ModelPart) : PokemonPosableModel(root) {
|
||||
lateinit var walk: Pose
|
||||
lateinit var sleep: Pose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("magnemite", "cry") }
|
||||
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("magnemite", "blink") }
|
||||
|
||||
-3
@@ -9,7 +9,6 @@
|
||||
package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen1
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.PosableState
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
@@ -29,8 +28,6 @@ class MagnetonModel(root: ModelPart) : PokemonPosableModel(root) {
|
||||
lateinit var walk: Pose
|
||||
lateinit var sleep: Pose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("magneton", "cry") }
|
||||
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("magneton", "blink") }
|
||||
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
/*
|
||||
* 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.client.render.models.blockbench.pokemon.gen1
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.PosableState
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.MOVING_POSES
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.STATIONARY_POSES
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.UI_POSES
|
||||
import com.cobblemon.mod.common.util.isBattling
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
class OnixModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame {
|
||||
override val rootPart = root.registerChildWithAllChildren("onix")
|
||||
override val head = getPart("head")
|
||||
|
||||
override var portraitScale = 1.1F
|
||||
override var portraitTranslation = Vec3(-0.2, 1.4, 0.0)
|
||||
|
||||
override var profileScale = 0.55F
|
||||
override var profileTranslation = Vec3(-0.1, 0.9, 0.0)
|
||||
|
||||
lateinit var standing: Pose
|
||||
lateinit var walk: Pose
|
||||
lateinit var ui: Pose
|
||||
lateinit var sleep: Pose
|
||||
lateinit var battleidle: Pose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("onix", "cry") }
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("onix", "blink") }
|
||||
ui = registerPose(
|
||||
poseName = "ui",
|
||||
poseTypes = UI_POSES,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
bedrock("onix", "summary_idle")
|
||||
)
|
||||
)
|
||||
|
||||
sleep = registerPose(
|
||||
poseType = PoseType.SLEEP,
|
||||
transformTicks = 0,
|
||||
animations = arrayOf(
|
||||
bedrock("onix", "sleep"),
|
||||
bedrock("onix", "slow_boulder_rotation")
|
||||
)
|
||||
)
|
||||
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
poseTypes = STATIONARY_POSES,
|
||||
transformTicks = 1,
|
||||
condition = { !it.isBattling },
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("onix", "ground_idle"),
|
||||
bedrock("onix", "boulder_rotation")
|
||||
)
|
||||
)
|
||||
|
||||
walk = registerPose(
|
||||
poseName = "walk",
|
||||
poseTypes = MOVING_POSES,
|
||||
transformTicks = 1,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("onix", "ground_walk"),
|
||||
bedrock("onix", "boulder_rotation")
|
||||
)
|
||||
)
|
||||
|
||||
battleidle = registerPose(
|
||||
poseName = "battle_idle",
|
||||
poseTypes = PoseType.STATIONARY_POSES,
|
||||
transformTicks = 10,
|
||||
quirks = arrayOf(blink),
|
||||
condition = { it.isBattling },
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("onix", "battle_idle"),
|
||||
bedrock("onix", "boulder_rotation")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
override fun getFaintAnimation(state: PosableState) = bedrockStateful("onix", "faint")
|
||||
}
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* 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.client.render.models.blockbench.pokemon.gen1
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.UI_POSES
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
class PoliwhirlModel(root: ModelPart) : PokemonPosableModel(root) {
|
||||
override val rootPart = root.registerChildWithAllChildren("poliwhirl")
|
||||
|
||||
override var portraitScale = 1.4F
|
||||
override var portraitTranslation = Vec3(-0.1, 0.2, 0.0)
|
||||
|
||||
override var profileScale = 0.8F
|
||||
override var profileTranslation = Vec3(0.0, 0.5, 0.0)
|
||||
|
||||
lateinit var sleep: Pose
|
||||
lateinit var standing: Pose
|
||||
lateinit var float: Pose
|
||||
lateinit var swim: Pose
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("poliwhirl", "blink")}
|
||||
|
||||
sleep = registerPose(
|
||||
poseType = PoseType.SLEEP,
|
||||
animations = arrayOf(bedrock("poliwhirl", "sleep"))
|
||||
)
|
||||
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
poseTypes = PoseType.STANDING_POSES + UI_POSES,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
bedrock("poliwhirl", "ground_idle")
|
||||
)
|
||||
)
|
||||
|
||||
float = registerPose(
|
||||
poseName = "float",
|
||||
poseType = PoseType.FLOAT,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
bedrock("poliwhirl", "water_idle")
|
||||
)
|
||||
)
|
||||
|
||||
swim = registerPose(
|
||||
poseName = "swim",
|
||||
poseType = PoseType.SWIM,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
bedrock("poliwhirl", "water_swim")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
// override fun getFaintAnimation(
|
||||
// pokemonEntity: PokemonEntity,
|
||||
// state: PosableState<PokemonEntity>
|
||||
// ) = if (state.isPosedIn(standing, walk)) bedrockStateful("poliwhirl", "faint") else null
|
||||
}
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* 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.client.render.models.blockbench.pokemon.gen1
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.UI_POSES
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
class PoliwrathModel(root: ModelPart) : PokemonPosableModel(root) {
|
||||
override val rootPart = root.registerChildWithAllChildren("poliwrath")
|
||||
|
||||
override var portraitScale = 1.3F
|
||||
override var portraitTranslation = Vec3(-0.1, 0.36, 0.0)
|
||||
|
||||
override var profileScale = 0.85F
|
||||
override var profileTranslation = Vec3(0.0, 0.42, 0.0)
|
||||
|
||||
lateinit var sleep: Pose
|
||||
lateinit var standing: Pose
|
||||
lateinit var float: Pose
|
||||
lateinit var swim: Pose
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("poliwrath", "blink")}
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
poseTypes = PoseType.STANDING_POSES + UI_POSES,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
bedrock("poliwrath", "ground_idle")
|
||||
)
|
||||
)
|
||||
|
||||
sleep = registerPose(
|
||||
poseType = PoseType.SLEEP,
|
||||
animations = arrayOf(bedrock("poliwrath", "sleep"))
|
||||
)
|
||||
|
||||
float = registerPose(
|
||||
poseName = "float",
|
||||
poseType = PoseType.FLOAT,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
bedrock("poliwrath", "water_idle")
|
||||
)
|
||||
)
|
||||
|
||||
swim = registerPose(
|
||||
poseName = "swim",
|
||||
poseType = PoseType.SWIM,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
bedrock("poliwrath", "water_swim")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
// override fun getFaintAnimation(
|
||||
// pokemonEntity: PokemonEntity,
|
||||
// state: PosableState<PokemonEntity>
|
||||
// ) = if (state.isPosedIn(standing, walk)) bedrockStateful("poliwrath", "faint") else null
|
||||
}
|
||||
-3
@@ -10,7 +10,6 @@ package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen1
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.PosableState
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
@@ -34,8 +33,6 @@ class SandshrewModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame {
|
||||
lateinit var standing: Pose
|
||||
lateinit var walk: Pose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("sandshrew", "cry") }
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("sandshrew", "blink")}
|
||||
standing = registerPose(
|
||||
|
||||
-3
@@ -9,7 +9,6 @@
|
||||
package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen1
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
@@ -33,8 +32,6 @@ class SandslashModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame {
|
||||
lateinit var standing: Pose
|
||||
lateinit var walk: Pose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("sandslash", "cry") }
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("sandslash", "blink")}
|
||||
standing = registerPose(
|
||||
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* 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.client.render.models.blockbench.pokemon.gen1
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.MOVING_POSES
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.STATIONARY_POSES
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.UI_POSES
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
class VictreebelModel(root: ModelPart) : PokemonPosableModel(root) {
|
||||
override val rootPart = root.registerChildWithAllChildren("victreebel")
|
||||
|
||||
override var portraitScale = 2.0F
|
||||
override var portraitTranslation = Vec3(-0.1, -0.2, 0.0)
|
||||
|
||||
override var profileScale = 0.92F
|
||||
override var profileTranslation = Vec3(0.0, 0.35, 0.0)
|
||||
|
||||
lateinit var standing: Pose
|
||||
lateinit var walk: Pose
|
||||
|
||||
override fun registerPoses() {
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
poseTypes = STATIONARY_POSES + UI_POSES,
|
||||
transformTicks = 10,
|
||||
animations = arrayOf(
|
||||
bedrock("victreebel", "ground_idle")
|
||||
)
|
||||
)
|
||||
|
||||
walk = registerPose(
|
||||
poseName = "walk",
|
||||
poseTypes = MOVING_POSES,
|
||||
transformTicks = 10,
|
||||
animations = arrayOf(
|
||||
bedrock("victreebel", "ground_idle")
|
||||
//bedrock("victreebel", "ground_walk")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
// override fun getFaintAnimation(
|
||||
// pokemonEntity: PokemonEntity,
|
||||
// state: PosableState<PokemonEntity>
|
||||
// ) = if (state.isPosedIn(standing, walk)) bedrockStateful("victreebel", "faint") else null
|
||||
}
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* 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.client.render.models.blockbench.pokemon.gen1
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.MOVING_POSES
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.STATIONARY_POSES
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.UI_POSES
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
class WeepinbellModel(root: ModelPart) : PokemonPosableModel(root) {
|
||||
override val rootPart = root.registerChildWithAllChildren("weepinbell")
|
||||
|
||||
override var portraitScale = 1.73F
|
||||
override var portraitTranslation = Vec3(0.0, -1.0, 0.0)
|
||||
|
||||
override var profileScale = 1.1F
|
||||
override var profileTranslation = Vec3(0.0, 0.2, 0.0)
|
||||
|
||||
lateinit var standing: Pose
|
||||
lateinit var walk: Pose
|
||||
|
||||
override fun registerPoses() {
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
poseTypes = STATIONARY_POSES + UI_POSES,
|
||||
animations = arrayOf(
|
||||
bedrock("weepinbell", "ground_idle")
|
||||
)
|
||||
)
|
||||
|
||||
walk = registerPose(
|
||||
poseName = "walk",
|
||||
poseTypes = MOVING_POSES,
|
||||
animations = arrayOf(
|
||||
bedrock("weepinbell", "ground_idle")
|
||||
//bedrock("weepinbell", "ground_walk")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
// override fun getFaintAnimation(
|
||||
// pokemonEntity: PokemonEntity,
|
||||
// state: PosableState<PokemonEntity>
|
||||
// ) = if (state.isPosedIn(standing, walk)) bedrockStateful("weepinbell", "faint") else null
|
||||
}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* 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.client.render.models.blockbench.pokemon.gen2
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.animation.QuadrupedWalkAnimation
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.QuadrupedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.CobblemonPose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
class FurretModel (root: ModelPart) : PokemonPosableModel(root), QuadrupedFrame {
|
||||
override val rootPart = root.registerChildWithAllChildren("furret")
|
||||
|
||||
override val foreLeftLeg = getPart("arm_left")
|
||||
override val foreRightLeg = getPart("arm_right")
|
||||
override val hindLeftLeg = getPart("leg_left")
|
||||
override val hindRightLeg = getPart("leg_right")
|
||||
|
||||
override var portraitScale = 2.1F
|
||||
override var portraitTranslation = Vec3(-0.6, 0.2, 0.0)
|
||||
|
||||
override var profileScale = 0.82F
|
||||
override var profileTranslation = Vec3(0.0, 0.54, 0.0)
|
||||
|
||||
lateinit var standing: CobblemonPose
|
||||
lateinit var walk: CobblemonPose
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("furret", "blink") }
|
||||
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
poseTypes = PoseType.STATIONARY_POSES + PoseType.UI_POSES,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
bedrock("furret", "ground_idle")
|
||||
)
|
||||
)
|
||||
|
||||
walk = registerPose(
|
||||
poseName = "walk",
|
||||
poseTypes = PoseType.MOVING_POSES,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
QuadrupedWalkAnimation(this, periodMultiplier = 0.6F, amplitudeMultiplier = 0.9F),
|
||||
bedrock("furret", "pose")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
// override fun getFaintAnimation(
|
||||
// pokemonEntity: PokemonEntity,
|
||||
// state: PosableState<PokemonEntity>
|
||||
// ) = if (state.isPosedIn(standing, walk)) bedrockStateful("furret", "faint") else null
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* 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.client.render.models.blockbench.pokemon.gen2
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.animation.BimanualSwingAnimation
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.animation.BipedWalkAnimation
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BimanualFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BipedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.MOVING_POSES
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.STATIONARY_POSES
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.UI_POSES
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
class MagbyModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame, BipedFrame, BimanualFrame {
|
||||
override val rootPart = root.registerChildWithAllChildren("magby")
|
||||
override val head = getPart("head")
|
||||
|
||||
override val leftArm = getPart("lefthand")
|
||||
override val rightArm = getPart("righthand")
|
||||
override val leftLeg = getPart("leftleg")
|
||||
override val rightLeg = getPart("rightleg")
|
||||
|
||||
override var portraitScale = 2.4F
|
||||
override var portraitTranslation = Vec3(-0.05, -0.45, 0.0)
|
||||
|
||||
override var profileScale = 0.78F
|
||||
override var profileTranslation = Vec3(-0.03, 0.61, 0.0)
|
||||
|
||||
lateinit var standing: Pose
|
||||
lateinit var walk: Pose
|
||||
|
||||
override fun registerPoses() {
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
poseTypes = STATIONARY_POSES + UI_POSES,
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("magby", "ground_idle")
|
||||
)
|
||||
)
|
||||
|
||||
walk = registerPose(
|
||||
poseName = "walk",
|
||||
poseTypes = MOVING_POSES,
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("magby", "ground_idle"),
|
||||
BipedWalkAnimation(this, periodMultiplier = 0.6F, amplitudeMultiplier = 0.9F),
|
||||
BimanualSwingAnimation(this, swingPeriodMultiplier = 0.6F, amplitudeMultiplier = 0.9F)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
// override fun getFaintAnimation(
|
||||
// pokemonEntity: PokemonEntity,
|
||||
// state: PosableState<PokemonEntity>
|
||||
// ) = if (state.isPosedIn(standing, walk)) bedrockStateful("magby", "faint") else null
|
||||
}
|
||||
-3
@@ -9,7 +9,6 @@
|
||||
package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen2
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
@@ -29,8 +28,6 @@ class MisdreavusModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame
|
||||
lateinit var standing: Pose
|
||||
lateinit var walk: Pose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("misdreavus", "cry") }
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("misdreavus", "blink") }
|
||||
standing = registerPose(
|
||||
|
||||
-3
@@ -12,7 +12,6 @@ import com.cobblemon.mod.common.client.render.models.blockbench.animation.Bimanu
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.animation.BipedWalkAnimation
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BimanualFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BipedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.CobblemonPose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
@@ -36,8 +35,6 @@ class SentretModel (root: ModelPart) : PokemonPosableModel(root), BipedFrame, Bi
|
||||
lateinit var standing: CobblemonPose
|
||||
lateinit var walk: CobblemonPose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("sentret", "cry") }
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("sentret", "blink") }
|
||||
|
||||
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
* 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.client.render.models.blockbench.pokemon.gen2
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.animation.BipedWalkAnimation
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BiWingedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BipedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.CobblemonPose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
import com.cobblemon.mod.common.util.isBattling
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
class SkarmoryModel (root: ModelPart) : PokemonPosableModel(root), BipedFrame, BiWingedFrame, HeadedFrame {
|
||||
override val rootPart = root.registerChildWithAllChildren("skarmory")
|
||||
override val head = getPart("lower_neck")
|
||||
|
||||
override val leftLeg = getPart("left_thigh")
|
||||
override val rightLeg = getPart("right_thigh")
|
||||
|
||||
override val leftWing = getPart("left_wing")
|
||||
override val rightWing = getPart("right_wing")
|
||||
|
||||
override var portraitScale = 2.49F
|
||||
override var portraitTranslation = Vec3(-1.05, 1.1, 0.0)
|
||||
|
||||
override var profileScale = 0.69F
|
||||
override var profileTranslation = Vec3(0.0, 0.7, 0.0)
|
||||
|
||||
lateinit var standing: CobblemonPose
|
||||
lateinit var walk: CobblemonPose
|
||||
lateinit var sleeping: CobblemonPose
|
||||
lateinit var hovering: CobblemonPose
|
||||
lateinit var flying: CobblemonPose
|
||||
lateinit var battleidle: CobblemonPose
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("skarmory", "blink") }
|
||||
|
||||
sleeping = registerPose(
|
||||
poseName = "sleeping",
|
||||
poseType = PoseType.SLEEP,
|
||||
animations = arrayOf(
|
||||
bedrock("skarmory", "sleep")
|
||||
)
|
||||
)
|
||||
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
poseTypes = PoseType.STATIONARY_POSES - PoseType.HOVER + PoseType.UI_POSES,
|
||||
condition = { !it.isBattling },
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("skarmory", "ground_idle")
|
||||
)
|
||||
)
|
||||
|
||||
walk = registerPose(
|
||||
poseName = "walk",
|
||||
poseTypes = PoseType.MOVING_POSES - PoseType.FLY,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("skarmory", "ground_idle"),
|
||||
BipedWalkAnimation(this,0.6F, 1F)
|
||||
)
|
||||
)
|
||||
|
||||
hovering = registerPose(
|
||||
poseName = "hovering",
|
||||
poseType = PoseType.HOVER,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
bedrock("skarmory", "air_idle")
|
||||
)
|
||||
)
|
||||
|
||||
flying = registerPose(
|
||||
poseName = "flying",
|
||||
poseType = PoseType.FLY,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
bedrock("skarmory", "air_idle")
|
||||
)
|
||||
)
|
||||
|
||||
battleidle = registerPose(
|
||||
poseName = "battleidle",
|
||||
poseTypes = PoseType.STATIONARY_POSES,
|
||||
condition = { it.isBattling },
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
bedrock("skarmory", "battle_idle")
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
+1
-2
@@ -9,7 +9,6 @@
|
||||
package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen2
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.animation.BipedWalkAnimation
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BipedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
@@ -35,7 +34,7 @@ class SmeargleModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame, B
|
||||
lateinit var standing: Pose
|
||||
lateinit var walk: Pose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("smeargle", "cry") }
|
||||
//override val cryAnimation = CryProvider { _, _ -> bedrockStateful("smeargle", "cry") }
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("smeargle", "blink") }
|
||||
|
||||
-3
@@ -10,7 +10,6 @@ package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen2
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.QuadrupedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
@@ -36,8 +35,6 @@ class StantlerModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame,
|
||||
lateinit var standing: Pose
|
||||
lateinit var walk: Pose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("stantler", "cry") }
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("stantler", "blink") }
|
||||
|
||||
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* 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.client.render.models.blockbench.pokemon.gen3
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.CobblemonPose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
class LunatoneModel (root: ModelPart) : PokemonPosableModel(root) {
|
||||
override val rootPart = root.registerChildWithAllChildren("lunatone")
|
||||
|
||||
override var portraitScale = 1.05F
|
||||
override var portraitTranslation = Vec3(0.23, 0.53, 0.0)
|
||||
|
||||
override var profileScale = 0.73F
|
||||
override var profileTranslation = Vec3(0.05, 0.68, 0.0)
|
||||
|
||||
lateinit var sleep: CobblemonPose
|
||||
lateinit var standing: CobblemonPose
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("lunatone", "blink") }
|
||||
sleep = registerPose(
|
||||
poseType = PoseType.SLEEP,
|
||||
animations = arrayOf(bedrock("lunatone", "sleep"))
|
||||
)
|
||||
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
poseTypes = PoseType.ALL_POSES - PoseType.SLEEP,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
bedrock("lunatone", "ground_idle")
|
||||
)
|
||||
)
|
||||
}
|
||||
// override fun getFaintAnimation(
|
||||
// pokemonEntity: PokemonEntity,
|
||||
// state: PosableState<PokemonEntity>
|
||||
// ) = if (state.isPosedIn(sleep)) bedrockStateful("lunatone", "faint") else null
|
||||
}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* 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.client.render.models.blockbench.pokemon.gen3
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.PosableState
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.QuadrupedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
class NincadaModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame, QuadrupedFrame {
|
||||
override val rootPart = root.registerChildWithAllChildren("nincada")
|
||||
override val head = getPart("head")
|
||||
override val foreLeftLeg= getPart("leg_front_left")
|
||||
override val foreRightLeg = getPart("leg_front_right")
|
||||
override val hindLeftLeg = getPart("leg_back_left")
|
||||
override val hindRightLeg = getPart("leg_back_right")
|
||||
|
||||
override var portraitScale = 2.0F
|
||||
override var portraitTranslation = Vec3(-0.26, -1.0, 0.0)
|
||||
override var profileScale = 0.7F
|
||||
override var profileTranslation = Vec3(0.0, 0.6, 0.0)
|
||||
|
||||
lateinit var sleep: Pose
|
||||
lateinit var standing: Pose
|
||||
lateinit var walk: Pose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("nincada", "cry") }
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("nincada", "blink") }
|
||||
val flutter = quirk { bedrockStateful("nincada", "quirk_wingflutter") }
|
||||
|
||||
sleep = registerPose(
|
||||
poseType = PoseType.SLEEP,
|
||||
transformTicks = 10,
|
||||
animations = arrayOf(bedrock("nincada", "sleep"))
|
||||
)
|
||||
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
poseTypes = setOf(PoseType.NONE, PoseType.STAND, PoseType.PORTRAIT, PoseType.PROFILE),
|
||||
transformTicks = 10,
|
||||
quirks = arrayOf(blink, flutter),
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("nincada", "ground_idle")
|
||||
)
|
||||
)
|
||||
|
||||
walk = registerPose(
|
||||
poseName = "walking",
|
||||
poseTypes = setOf(PoseType.SWIM, PoseType.WALK),
|
||||
transformTicks = 10,
|
||||
quirks = arrayOf(blink, flutter),
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("nincada", "ground_walk")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
override fun getFaintAnimation(state: PosableState) = if (state.isPosedIn(standing, walk)) bedrockStateful("nincada", "faint") else null
|
||||
}
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* 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.client.render.models.blockbench.pokemon.gen3
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.PosableState
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
class NinjaskModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame {
|
||||
override val rootPart = root.registerChildWithAllChildren("ninjask")
|
||||
|
||||
override val head = getPart("head")
|
||||
|
||||
override var portraitScale = 1.8F
|
||||
override var portraitTranslation = Vec3(-0.2, -0.4, 0.0)
|
||||
|
||||
override var profileScale = 0.9F
|
||||
override var profileTranslation = Vec3(0.0, 0.3, 0.0)
|
||||
|
||||
lateinit var sleep: Pose
|
||||
lateinit var stand: Pose
|
||||
lateinit var walk: Pose
|
||||
lateinit var hover: Pose
|
||||
lateinit var fly: Pose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("ninjask", "cry") }
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("ninjask", "blink") }
|
||||
val barrelRoll = quirk { bedrockStateful("ninjask", "run_quirk") }
|
||||
|
||||
sleep = registerPose(
|
||||
poseType = PoseType.SLEEP,
|
||||
animations = arrayOf(bedrock("ninjask", "sleep"))
|
||||
)
|
||||
|
||||
stand = registerPose(
|
||||
poseName = "standing",
|
||||
poseTypes = PoseType.UI_POSES + PoseType.STATIONARY_POSES - PoseType.HOVER,
|
||||
transformTicks = 10,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("ninjask", "ground_idle")
|
||||
)
|
||||
)
|
||||
|
||||
hover = registerPose(
|
||||
poseName = "hover",
|
||||
poseType = PoseType.HOVER,
|
||||
transformTicks = 10,
|
||||
quirks = arrayOf(blink, barrelRoll),
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("ninjask", "air_idle")
|
||||
)
|
||||
)
|
||||
|
||||
fly = registerPose(
|
||||
poseName = "fly",
|
||||
poseType = PoseType.FLY,
|
||||
transformTicks = 10,
|
||||
quirks = arrayOf(blink, barrelRoll),
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("ninjask", "air_fly")
|
||||
)
|
||||
)
|
||||
|
||||
walk = registerPose(
|
||||
poseName = "walking",
|
||||
poseTypes = PoseType.MOVING_POSES - PoseType.FLY,
|
||||
transformTicks = 10,
|
||||
quirks = arrayOf(blink, barrelRoll),
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("ninjask", "ground_walk")
|
||||
)
|
||||
)
|
||||
}
|
||||
override fun getFaintAnimation(state: PosableState) = bedrockStateful("ninjask", "faint")
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* 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.client.render.models.blockbench.pokemon.gen3
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.CobblemonPose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
class SolrockModel (root: ModelPart) : PokemonPosableModel(root) {
|
||||
override val rootPart = root.registerChildWithAllChildren("solrock")
|
||||
|
||||
override var portraitScale = 1.6F
|
||||
override var portraitTranslation = Vec3(-0.08, 0.31, 0.0)
|
||||
|
||||
override var profileScale = 0.8F
|
||||
override var profileTranslation = Vec3(0.0, 0.74, 0.0)
|
||||
|
||||
lateinit var sleep: CobblemonPose
|
||||
lateinit var standing: CobblemonPose
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("solrock", "blink") }
|
||||
sleep = registerPose(
|
||||
poseType = PoseType.SLEEP,
|
||||
animations = arrayOf(bedrock("solrock", "sleep"))
|
||||
)
|
||||
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
poseTypes = PoseType.ALL_POSES - PoseType.SLEEP,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
bedrock("solrock", "ground_idle")
|
||||
)
|
||||
)
|
||||
}
|
||||
// override fun getFaintAnimation(
|
||||
// pokemonEntity: PokemonEntity,
|
||||
// state: PosableState<PokemonEntity>
|
||||
// ) = if (state.isPosedIn(sleep)) bedrockStateful("solrock", "faint") else null
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* 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.client.render.models.blockbench.pokemon.gen3
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.animation.BipedWalkAnimation
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BipedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
class SpindaModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame, BipedFrame {
|
||||
override val rootPart = root.registerChildWithAllChildren("spinda")
|
||||
override val head = getPart("head")
|
||||
|
||||
override val leftLeg = getPart("leg_left")
|
||||
override val rightLeg = getPart("leg_right")
|
||||
|
||||
override var portraitScale = 1.9F
|
||||
override var portraitTranslation = Vec3(-0.5, -0.1, 0.0)
|
||||
|
||||
override var profileScale = 0.76F
|
||||
override var profileTranslation = Vec3(0.0, 0.6, 0.0)
|
||||
|
||||
lateinit var standing: Pose
|
||||
lateinit var walk: Pose
|
||||
|
||||
override fun registerPoses() {
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
poseTypes = PoseType.STATIONARY_POSES + PoseType.UI_POSES,
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("spinda", "ground_idle")
|
||||
)
|
||||
)
|
||||
|
||||
walk = registerPose(
|
||||
poseName = "walk",
|
||||
poseTypes = PoseType.MOVING_POSES,
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("spinda", "ground_idle"),
|
||||
BipedWalkAnimation(this, periodMultiplier = 0.7F)
|
||||
//bedrock("spinda", "ground_walk")
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* 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.client.render.models.blockbench.pokemon.gen3
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.animation.QuadrupedWalkAnimation
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.QuadrupedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.CobblemonPose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
import com.cobblemon.mod.common.util.isBattling
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
class TorkoalModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame, QuadrupedFrame {
|
||||
override val rootPart = root.registerChildWithAllChildren("torkoal")
|
||||
override val head = getPart("neck")
|
||||
|
||||
override val foreLeftLeg= getPart("leg_front_left")
|
||||
override val foreRightLeg = getPart("leg_front_right")
|
||||
override val hindLeftLeg = getPart("leg_back_left")
|
||||
override val hindRightLeg = getPart("leg_back_right")
|
||||
|
||||
override var portraitScale = 2.5F
|
||||
override var portraitTranslation = Vec3(-1.3, -0.5, 0.0)
|
||||
|
||||
override var profileScale = 0.8F
|
||||
override var profileTranslation = Vec3(0.0, 0.43, 0.0)
|
||||
|
||||
lateinit var standing: CobblemonPose
|
||||
lateinit var walk: CobblemonPose
|
||||
lateinit var battleidle: CobblemonPose
|
||||
|
||||
override fun registerPoses() {
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
poseTypes = PoseType.STATIONARY_POSES + PoseType.UI_POSES,
|
||||
condition = { !it.isBattling },
|
||||
transformTicks = 10,
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("torkoal", "ground_idle")
|
||||
)
|
||||
)
|
||||
|
||||
walk = registerPose(
|
||||
poseName = "walk",
|
||||
poseTypes = PoseType.MOVING_POSES,
|
||||
transformTicks = 10,
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("torkoal", "ground_idle"),
|
||||
QuadrupedWalkAnimation(this, periodMultiplier = 0.7F, amplitudeMultiplier = 0.7F)
|
||||
)
|
||||
)
|
||||
|
||||
battleidle = registerPose(
|
||||
poseName = "battleidle",
|
||||
poseTypes = PoseType.STATIONARY_POSES,
|
||||
condition = { it.isBattling },
|
||||
transformTicks = 10,
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("torkoal", "battle_idle")
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
-3
@@ -10,7 +10,6 @@ package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen4
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.PosableState
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BipedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.CobblemonPose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
@@ -37,8 +36,6 @@ class HappinyModel(root: ModelPart) : PokemonPosableModel(root), BipedFrame {
|
||||
lateinit var sleep: CobblemonPose
|
||||
lateinit var battle_idle: CobblemonPose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("happiny", "cry") }
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("happiny", "blink") }
|
||||
val hairQuirk = quirk { bedrockStateful("happiny", "hairshake_quirk") }
|
||||
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* 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.client.render.models.blockbench.pokemon.gen4
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.animation.BimanualSwingAnimation
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.animation.BipedWalkAnimation
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BimanualFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BipedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.CobblemonPose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
import com.cobblemon.mod.common.util.isBattling
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
class LucarioModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame, BipedFrame, BimanualFrame {
|
||||
override val rootPart = root.registerChildWithAllChildren("lucario")
|
||||
override val head = getPart("head")
|
||||
|
||||
override val leftArm = getPart("arm_left")
|
||||
override val rightArm = getPart("arm_right")
|
||||
override val leftLeg = getPart("leg_left")
|
||||
override val rightLeg = getPart("leg_right")
|
||||
|
||||
override var portraitScale = 2.2F
|
||||
override var portraitTranslation = Vec3(-0.2, 2.2, 0.0)
|
||||
|
||||
override var profileScale = 0.6F
|
||||
override var profileTranslation = Vec3(0.0, 0.83, 0.0)
|
||||
|
||||
lateinit var standing: CobblemonPose
|
||||
lateinit var walk: CobblemonPose
|
||||
lateinit var battleIdle: CobblemonPose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("lucario", "cry") }
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("lucario", "blink") }
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
poseTypes = PoseType.STATIONARY_POSES + PoseType.UI_POSES,
|
||||
condition = { !it.isBattling },
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("lucario", "ground_idle")
|
||||
)
|
||||
)
|
||||
|
||||
walk = registerPose(
|
||||
poseName = "walk",
|
||||
poseTypes = PoseType.MOVING_POSES,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("lucario", "ground_idle"),
|
||||
BimanualSwingAnimation(this),
|
||||
BipedWalkAnimation(this)
|
||||
)
|
||||
)
|
||||
|
||||
battleIdle = registerPose(
|
||||
poseName = "battle_idle",
|
||||
poseTypes = PoseType.STATIONARY_POSES,
|
||||
condition = { it.isBattling },
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("lucario", "ground_idle"),
|
||||
bedrock("lucario", "battle_idle_aura_left"),
|
||||
bedrock("lucario", "battle_idle_aura_right")
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* 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.client.render.models.blockbench.pokemon.gen4
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.animation.BimanualSwingAnimation
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.animation.BipedWalkAnimation
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BimanualFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BipedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.MOVING_POSES
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.STATIONARY_POSES
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.UI_POSES
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
class MagmortarModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame, BipedFrame, BimanualFrame {
|
||||
override val rootPart = root.registerChildWithAllChildren("magmortar")
|
||||
override val head = getPart("head")
|
||||
|
||||
override val leftArm = getPart("leftarm")
|
||||
override val rightArm = getPart("rightarm")
|
||||
override val leftLeg = getPart("leftleg")
|
||||
override val rightLeg = getPart("rightleg")
|
||||
|
||||
override var portraitScale = 2.2F
|
||||
override var portraitTranslation = Vec3(-0.35, 1.2, 0.0)
|
||||
|
||||
override var profileScale = 0.65F
|
||||
override var profileTranslation = Vec3(0.0, 0.73, 0.0)
|
||||
|
||||
lateinit var standing: Pose
|
||||
lateinit var walk: Pose
|
||||
|
||||
override fun registerPoses() {
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
poseTypes = STATIONARY_POSES + UI_POSES,
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("magmortar", "ground_idle")
|
||||
)
|
||||
)
|
||||
|
||||
walk = registerPose(
|
||||
poseName = "walk",
|
||||
poseTypes = MOVING_POSES,
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("magmortar", "ground_idle"),
|
||||
BipedWalkAnimation(this, periodMultiplier = 0.6F, amplitudeMultiplier = 0.9F),
|
||||
BimanualSwingAnimation(this, swingPeriodMultiplier = 0.6F, amplitudeMultiplier = 0.9F)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
// override fun getFaintAnimation(
|
||||
// pokemonEntity: PokemonEntity,
|
||||
// state: PosableState<PokemonEntity>
|
||||
// ) = if (state.isPosedIn(standing, walk)) bedrockStateful("magmortar", "faint") else null
|
||||
}
|
||||
-3
@@ -8,7 +8,6 @@
|
||||
|
||||
package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen4
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
@@ -28,8 +27,6 @@ class MagnezoneModel(root: ModelPart) : PokemonPosableModel(root) {
|
||||
lateinit var walk: Pose
|
||||
lateinit var sleep: Pose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("magnezone", "cry") }
|
||||
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("magnezone", "blink") }
|
||||
|
||||
-3
@@ -10,7 +10,6 @@ package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen4
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
@@ -29,8 +28,6 @@ class MismagiusModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame
|
||||
lateinit var standing: Pose
|
||||
lateinit var walk: Pose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("mismagius", "cry") }
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("mismagius", "blink") }
|
||||
standing = registerPose(
|
||||
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* 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.client.render.models.blockbench.pokemon.gen4
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.animation.BimanualSwingAnimation
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.animation.BipedWalkAnimation
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BimanualFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BipedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
class RioluModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame, BipedFrame, BimanualFrame {
|
||||
override val rootPart = root.registerChildWithAllChildren("riolu")
|
||||
override val head = getPart("head")
|
||||
|
||||
override val leftArm = getPart("arm_left")
|
||||
override val rightArm = getPart("arm_right")
|
||||
override val leftLeg = getPart("leg_left")
|
||||
override val rightLeg = getPart("leg_right")
|
||||
|
||||
override var portraitScale = 2.8F
|
||||
override var portraitTranslation = Vec3(0.0, -0.3, 0.0)
|
||||
|
||||
override var profileScale = 0.85F
|
||||
override var profileTranslation = Vec3(0.0, 0.5, 0.0)
|
||||
|
||||
lateinit var standing: Pose
|
||||
lateinit var walk: Pose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("riolu", "cry") }
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("riolu", "blink") }
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
poseTypes = PoseType.STATIONARY_POSES + PoseType.UI_POSES,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("riolu", "ground_idle")
|
||||
)
|
||||
)
|
||||
|
||||
walk = registerPose(
|
||||
poseName = "walk",
|
||||
poseTypes = PoseType.MOVING_POSES,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("riolu", "ground_idle"),
|
||||
BipedWalkAnimation(this),
|
||||
BimanualSwingAnimation(this)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
-3
@@ -11,7 +11,6 @@ package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen5
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BimanualFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BipedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
@@ -36,8 +35,6 @@ class BeheeyemModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame,
|
||||
lateinit var standing: Pose
|
||||
lateinit var walk: Pose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("beheeyem", "cry") }
|
||||
|
||||
override fun registerPoses() {
|
||||
sleep = registerPose(
|
||||
poseType = PoseType.SLEEP,
|
||||
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* 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.client.render.models.blockbench.pokemon.gen5
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.MOVING_POSES
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.STATIONARY_POSES
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.UI_POSES
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
class CrustleModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame {
|
||||
override val rootPart = root.registerChildWithAllChildren("crustle")
|
||||
override val head = getPart("head")
|
||||
|
||||
override var portraitScale = 4.0F
|
||||
override var portraitTranslation = Vec3(-0.55, -4.0, 0.0)
|
||||
|
||||
override var profileScale = 1.0F
|
||||
override var profileTranslation = Vec3(0.0, 0.1, 0.0)
|
||||
|
||||
lateinit var standing: Pose
|
||||
lateinit var walk: Pose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("crustle", "cry") }
|
||||
|
||||
override fun registerPoses() {
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
poseTypes = STATIONARY_POSES + UI_POSES,
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("crustle", "ground_idle")
|
||||
)
|
||||
)
|
||||
|
||||
walk = registerPose(
|
||||
poseName = "walk",
|
||||
poseTypes = MOVING_POSES,
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("crustle", "ground_idle")
|
||||
//bedrock("crustle", "ground_walk")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
// override fun getFaintAnimation(
|
||||
// pokemonEntity: PokemonEntity,
|
||||
// state: PosableState<PokemonEntity>
|
||||
// ) = if (state.isPosedIn(standing, walk)) bedrockStateful("crustle", "faint") else null
|
||||
}
|
||||
+1
-2
@@ -11,7 +11,6 @@ package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen5
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.animation.QuadrupedWalkAnimation
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.QuadrupedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.CobblemonPose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
@@ -36,7 +35,7 @@ class DeinoModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame, Qua
|
||||
lateinit var standing: CobblemonPose
|
||||
lateinit var walk: CobblemonPose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("deino", "cry") }
|
||||
// override val cryAnimation = CryProvider { bedrockStateful("deino", "cry") }
|
||||
|
||||
override fun registerPoses() {
|
||||
standing = registerPose(
|
||||
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* 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.client.render.models.blockbench.pokemon.gen5
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.MOVING_POSES
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.STATIONARY_POSES
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.UI_POSES
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
class DwebbleModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame {
|
||||
override val rootPart = root.registerChildWithAllChildren("dwebble")
|
||||
override val head = getPart("head")
|
||||
|
||||
override var portraitScale = 2.6F
|
||||
override var portraitTranslation = Vec3(-0.2, -1.9, 0.0)
|
||||
|
||||
override var profileScale = 1.0F
|
||||
override var profileTranslation = Vec3(0.0, 0.2, 0.0)
|
||||
|
||||
lateinit var standing: Pose
|
||||
lateinit var walk: Pose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("dwebble", "cry") }
|
||||
|
||||
override fun registerPoses() {
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
poseTypes = STATIONARY_POSES + UI_POSES,
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("dwebble", "ground_idle")
|
||||
)
|
||||
)
|
||||
|
||||
walk = registerPose(
|
||||
poseName = "walk",
|
||||
poseTypes = MOVING_POSES,
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("dwebble", "ground_idle")
|
||||
//bedrock("dwebble", "ground_walk")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
// override fun getFaintAnimation(
|
||||
// pokemonEntity: PokemonEntity,
|
||||
// state: PosableState<PokemonEntity>
|
||||
// ) = if (state.isPosedIn(standing, walk)) bedrockStateful("dwebble", "faint") else null
|
||||
}
|
||||
-3
@@ -13,7 +13,6 @@ import com.cobblemon.mod.common.client.render.models.blockbench.createTransforma
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BimanualFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BipedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.ModelPartTransformation
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
|
||||
@@ -43,8 +42,6 @@ class ElgyemModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame, Bi
|
||||
lateinit var shoulderLeft: Pose
|
||||
lateinit var shoulderRight: Pose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("elgyem", "cry") }
|
||||
|
||||
val shoulderOffset = 5.6
|
||||
|
||||
override fun registerPoses() {
|
||||
|
||||
+1
-2
@@ -10,7 +10,6 @@ package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen5
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BiWingedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.CobblemonPose
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.ModelPartTransformation
|
||||
@@ -34,7 +33,7 @@ class HydreigonModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame
|
||||
lateinit var standing: CobblemonPose
|
||||
lateinit var walk: CobblemonPose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("hydreigon", "cry") }
|
||||
// override val cryAnimation = CryProvider { bedrockStateful("hydreigon", "cry") }
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("hydreigon", "blink") }
|
||||
|
||||
+1
-2
@@ -12,7 +12,6 @@ import com.cobblemon.mod.common.client.render.models.blockbench.animation.Quadru
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.animation.SingleBoneLookAnimation
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.QuadrupedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.CobblemonPose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
@@ -42,7 +41,7 @@ class ZweilousModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame,
|
||||
lateinit var standing: CobblemonPose
|
||||
lateinit var walk: CobblemonPose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("zweilous", "cry") }
|
||||
// override val cryAnimation = CryProvider { bedrockStateful("zweilous", "cry") }
|
||||
|
||||
override fun registerPoses() {
|
||||
|
||||
|
||||
-3
@@ -10,7 +10,6 @@ package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen6
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.createTransformation
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.CobblemonPose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
@@ -32,8 +31,6 @@ class FlabebeModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame {
|
||||
lateinit var shoulderLeft: CobblemonPose
|
||||
lateinit var shoulderRight: CobblemonPose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("flabebe", "cry") }
|
||||
|
||||
val shoulderOffset = 10.5
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("flabebe", "blink") }
|
||||
|
||||
-4
@@ -9,7 +9,6 @@
|
||||
package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen6
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.CobblemonPose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
@@ -28,9 +27,6 @@ class FloetteModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame {
|
||||
|
||||
lateinit var standing: CobblemonPose
|
||||
lateinit var walk: CobblemonPose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("floette", "cry") }
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("floette", "blink") }
|
||||
|
||||
|
||||
-4
@@ -9,7 +9,6 @@
|
||||
package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen6
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.pose.CobblemonPose
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
@@ -28,9 +27,6 @@ class FlorgesModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame {
|
||||
|
||||
lateinit var standing: CobblemonPose
|
||||
lateinit var walk: CobblemonPose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("florges", "cry") }
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("florges", "blink") }
|
||||
|
||||
|
||||
+22
@@ -74,9 +74,11 @@ object PokemonModelRepository : VaryingModelRepository<PokemonPosableModel>() {
|
||||
inbuilt("machop", ::MachopModel)
|
||||
inbuilt("machoke", ::MachokeModel)
|
||||
inbuilt("machamp", ::MachampModel)
|
||||
inbuilt("alakazam", ::AlakazamModel)
|
||||
inbuilt("arbok", ::ArbokModel)
|
||||
inbuilt("arcanine", ::ArcanineModel)
|
||||
inbuilt("articuno", ::ArticunoModel)
|
||||
inbuilt("bellsprout", ::BellsproutModel)
|
||||
inbuilt("chansey", ::ChanseyModel)
|
||||
inbuilt("crobat", ::CrobatModel)
|
||||
inbuilt("cubone", ::CuboneModel)
|
||||
@@ -116,6 +118,7 @@ object PokemonModelRepository : VaryingModelRepository<PokemonPosableModel>() {
|
||||
inbuilt("koffing", ::KoffingModel)
|
||||
inbuilt("krabby", ::KrabbyModel)
|
||||
inbuilt("lickitung", ::LickitungModel)
|
||||
inbuilt("magmar", ::MagmarModel)
|
||||
inbuilt("magnemite", ::MagnemiteModel)
|
||||
inbuilt("magneton", ::MagnetonModel)
|
||||
inbuilt("marowak", ::MarowakModel)
|
||||
@@ -134,10 +137,13 @@ object PokemonModelRepository : VaryingModelRepository<PokemonPosableModel>() {
|
||||
inbuilt("ninetales", ::NinetalesModel)
|
||||
inbuilt("omanyte", ::OmanyteModel)
|
||||
inbuilt("omastar", ::OmastarModel)
|
||||
inbuilt("onix", ::OnixModel)
|
||||
inbuilt("persian", ::PersianModel)
|
||||
inbuilt("pikachu", ::PikachuModel)
|
||||
inbuilt("pinsir", ::PinsirModel)
|
||||
inbuilt("poliwag", ::PoliwagModel)
|
||||
inbuilt("poliwhirl", ::PoliwhirlModel)
|
||||
inbuilt("poliwrath", ::PoliwrathModel)
|
||||
inbuilt("politoed", ::PolitoedModel)
|
||||
inbuilt("ponyta", ::PonytaModel)
|
||||
inbuilt("psyduck", ::PsyduckModel)
|
||||
@@ -161,10 +167,13 @@ object PokemonModelRepository : VaryingModelRepository<PokemonPosableModel>() {
|
||||
inbuilt("vaporeon", ::VaporeonModel)
|
||||
inbuilt("venomoth", ::VenomothModel)
|
||||
inbuilt("venonat", ::VenonatModel)
|
||||
inbuilt("victreebel", ::VictreebelModel)
|
||||
inbuilt("vulpix", ::VulpixModel)
|
||||
inbuilt("weepinbell", ::WeepinbellModel)
|
||||
inbuilt("weezing", ::WeezingModel)
|
||||
inbuilt("zapdos", ::ZapdosModel)
|
||||
inbuilt("elekid", ::ElekidModel)
|
||||
inbuilt("magby", ::MagbyModel)
|
||||
inbuilt("pichu", ::PichuModel)
|
||||
inbuilt("smoochum", ::SmoochumModel)
|
||||
inbuilt("tyrogue", ::TyrogueModel)
|
||||
@@ -174,6 +183,7 @@ object PokemonModelRepository : VaryingModelRepository<PokemonPosableModel>() {
|
||||
inbuilt("happiny", ::HappinyModel)
|
||||
inbuilt("leafeon", ::LeafeonModel)
|
||||
inbuilt("lickilicky", ::LickilickyModel)
|
||||
inbuilt("magmortar", ::MagmortarModel)
|
||||
inbuilt("magnezone", ::MagnezoneModel)
|
||||
inbuilt("mimejr", ::MimejrModel)
|
||||
inbuilt("scizor", ::ScizorModel)
|
||||
@@ -204,6 +214,8 @@ object PokemonModelRepository : VaryingModelRepository<PokemonPosableModel>() {
|
||||
inbuilt("piplup", ::PiplupModel)
|
||||
inbuilt("yanmega", ::YanmegaModel)
|
||||
inbuilt("basculin", ::BasculinModel)
|
||||
inbuilt("crustle", ::CrustleModel)
|
||||
inbuilt("dwebble", ::DwebbleModel)
|
||||
inbuilt("emolga", ::EmolgaModel)
|
||||
inbuilt("maractus", ::MaractusModel)
|
||||
inbuilt("bounsweet", ::BounsweetModel)
|
||||
@@ -244,6 +256,8 @@ object PokemonModelRepository : VaryingModelRepository<PokemonPosableModel>() {
|
||||
inbuilt("klinklang", :: KlinklangModel)
|
||||
inbuilt("morelull", :: MorelullModel)
|
||||
inbuilt("shiinotic", :: ShiinoticModel)
|
||||
inbuilt("riolu", :: RioluModel)
|
||||
inbuilt("lucario", :: LucarioModel)
|
||||
inbuilt("treecko", :: TreeckoModel)
|
||||
inbuilt("grovyle", :: GrovyleModel)
|
||||
inbuilt("sceptile", :: SceptileModel)
|
||||
@@ -288,6 +302,7 @@ object PokemonModelRepository : VaryingModelRepository<PokemonPosableModel>() {
|
||||
inbuilt("popplio", :: PopplioModel)
|
||||
inbuilt("brionne", :: BrionneModel)
|
||||
inbuilt("primarina", ::PrimarinaModel)
|
||||
inbuilt("spinda", ::SpindaModel)
|
||||
inbuilt("seedot", ::SeedotModel)
|
||||
inbuilt("nuzleaf", ::NuzleafModel)
|
||||
inbuilt("shiftry", ::ShiftryModel)
|
||||
@@ -300,6 +315,7 @@ object PokemonModelRepository : VaryingModelRepository<PokemonPosableModel>() {
|
||||
inbuilt("walkingwake", ::WalkingwakeModel)
|
||||
inbuilt("ironleaves", ::IronleavesModel)
|
||||
inbuilt("miltank", ::MiltankModel)
|
||||
inbuilt("torkoal", ::TorkoalModel)
|
||||
inbuilt("froakie", ::FroakieModel)
|
||||
inbuilt("frogadier", ::FrogadierModel)
|
||||
inbuilt("greninja", ::GreninjaModel)
|
||||
@@ -487,6 +503,8 @@ object PokemonModelRepository : VaryingModelRepository<PokemonPosableModel>() {
|
||||
inbuilt("crabominable", ::CrabominableModel)
|
||||
inbuilt("wimpod", ::WimpodModel)
|
||||
inbuilt("golisopod", ::GolisopodModel)
|
||||
inbuilt("nincada", ::NincadaModel)
|
||||
inbuilt("ninjask", ::NinjaskModel)
|
||||
inbuilt("shedinja", ::ShedinjaModel)
|
||||
inbuilt("ralts", ::RaltsModel)
|
||||
inbuilt("kirlia", ::KirliaModel)
|
||||
@@ -551,6 +569,7 @@ object PokemonModelRepository : VaryingModelRepository<PokemonPosableModel>() {
|
||||
inbuilt("voltorb_hisuian", ::VoltorbHisuianModel)
|
||||
inbuilt("electrode_hisuian", ::ElectrodeHisuianModel)
|
||||
inbuilt("sentret", ::SentretModel)
|
||||
inbuilt("furret", ::FurretModel)
|
||||
inbuilt("qwilfish", ::QwilfishModel)
|
||||
inbuilt("qwilfish_hisuian", ::QwilfishHisuianModel)
|
||||
inbuilt("overqwil", ::OverqwilModel)
|
||||
@@ -571,6 +590,8 @@ object PokemonModelRepository : VaryingModelRepository<PokemonPosableModel>() {
|
||||
inbuilt("budew", ::BudewModel)
|
||||
inbuilt("roselia", ::RoseliaModel)
|
||||
inbuilt("roserade", ::RoseradeModel)
|
||||
inbuilt("solrock", ::SolrockModel)
|
||||
inbuilt("lunatone", ::LunatoneModel)
|
||||
inbuilt("woobat", ::WoobatModel)
|
||||
inbuilt("swoobat", ::SwoobatModel)
|
||||
inbuilt("sandile", ::SandileModel)
|
||||
@@ -607,6 +628,7 @@ object PokemonModelRepository : VaryingModelRepository<PokemonPosableModel>() {
|
||||
inbuilt("goodra", ::GoodraModel)
|
||||
inbuilt("goodra_hisuian", ::GoodraHisuianModel)
|
||||
inbuilt("heracross", ::HeracrossModel)
|
||||
inbuilt("skarmory", ::SkarmoryModel)
|
||||
inbuilt("salandit", ::SalanditModel)
|
||||
inbuilt("salazzle", ::SalazzleModel)
|
||||
inbuilt("jangmo-o", ::JangmoOModel)
|
||||
|
||||
+4
-14
@@ -27,26 +27,16 @@ object FishingRodTooltipGenerator : TooltipGenerator() {
|
||||
|
||||
// Add the description of the Poke Ball used in the rod
|
||||
ball.item.description.let {
|
||||
val bobberDescription = Component.translatable(
|
||||
"cobblemon.pokerod.bobber",
|
||||
it.copy().gray()
|
||||
)
|
||||
val bobberDescription = Component.literal("Bobber: ").append(it.copy().gray())
|
||||
resultLines.add(bobberDescription)
|
||||
}
|
||||
|
||||
val client = Minecraft.getInstance()
|
||||
val itemRegistry = client.level?.registryAccess()?.registryOrThrow(Registries.ITEM)
|
||||
itemRegistry?.let { registry ->
|
||||
FishingBaits.getFromRodItemStack(stack)?.toItemStack(registry)?.item?.description
|
||||
?.let { // maybe this can be simplified to not use the FishingBaits to get the stack and just use PokerodItem to get the stack since we have it already
|
||||
val baitDescription =
|
||||
Component.translatable(
|
||||
"cobblemon.pokerod.bait",
|
||||
it.copy().gray(),
|
||||
PokerodItem.getBaitStackOnRod(stack).count
|
||||
)
|
||||
resultLines.add(baitDescription)
|
||||
}
|
||||
FishingBaits.getFromRodItemStack(stack)?.toItemStack(registry)?.item?.description?.copy()?.gray()?.let { // maybe this can be simplified to not use the FishingBaits to get the stack and just use PokerodItem to get the stack since we have it already
|
||||
resultLines.add(Component.literal("Bait: ").append(it).append(" x${PokerodItem.getBaitStackOnRod(stack).count}"))
|
||||
}
|
||||
}
|
||||
|
||||
return resultLines
|
||||
|
||||
@@ -16,7 +16,6 @@ import java.util.UUID
|
||||
class ClientTrade {
|
||||
var myOffer = SettableObservable<Pokemon?>(null)
|
||||
var oppositeOffer = SettableObservable<Pokemon?>(null)
|
||||
var tradeProcessing = SettableObservable(Pair(false, false))
|
||||
var oppositeAcceptedMyOffer = SettableObservable(false)
|
||||
var acceptedOppositeOffer = false
|
||||
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
package com.cobblemon.mod.common.entity
|
||||
|
||||
interface AttackingEntity {
|
||||
fun getAttackingEntityId(): Int?
|
||||
}
|
||||
@@ -34,7 +34,7 @@ class NPCBattleActor(
|
||||
) : AIBattleActor(
|
||||
gameId = npc.uuid,
|
||||
pokemonList = party.toBattleTeam(),
|
||||
battleAI = RandomBattleAI()
|
||||
battleAI = StrongBattleAI(skill)
|
||||
), EntityBackedBattleActor<NPCEntity> {
|
||||
override val entity = npc
|
||||
override val type = ActorType.NPC
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
package com.cobblemon.mod.common.entity.pokemon
|
||||
|
||||
import com.bedrockk.molang.runtime.struct.QueryStruct
|
||||
import com.bedrockk.molang.runtime.value.DoubleValue
|
||||
import com.bedrockk.molang.runtime.value.StringValue
|
||||
import com.cobblemon.mod.common.*
|
||||
import com.cobblemon.mod.common.CobblemonNetwork.sendPacket
|
||||
import com.cobblemon.mod.common.api.drop.DropTable
|
||||
@@ -20,9 +22,6 @@ import com.cobblemon.mod.common.api.events.entity.PokemonEntitySaveEvent
|
||||
import com.cobblemon.mod.common.api.events.entity.PokemonEntitySaveToWorldEvent
|
||||
import com.cobblemon.mod.common.api.events.pokemon.ShoulderMountEvent
|
||||
import com.cobblemon.mod.common.api.interaction.PokemonEntityInteraction
|
||||
import com.cobblemon.mod.common.api.molang.MoLangFunctions.addEntityFunctions
|
||||
import com.cobblemon.mod.common.api.molang.MoLangFunctions.addPokemonEntityFunctions
|
||||
import com.cobblemon.mod.common.api.molang.MoLangFunctions.addPokemonFunctions
|
||||
import com.cobblemon.mod.common.api.molang.MoLangFunctions.addStandardFunctions
|
||||
import com.cobblemon.mod.common.api.net.serializers.PoseTypeDataSerializer
|
||||
import com.cobblemon.mod.common.api.net.serializers.StringSetDataSerializer
|
||||
@@ -45,7 +44,6 @@ import com.cobblemon.mod.common.battles.BattleBuilder
|
||||
import com.cobblemon.mod.common.battles.BattleRegistry
|
||||
import com.cobblemon.mod.common.block.entity.PokemonPastureBlockEntity
|
||||
import com.cobblemon.mod.common.client.entity.PokemonClientDelegate
|
||||
import com.cobblemon.mod.common.entity.AttackingEntity
|
||||
import com.cobblemon.mod.common.entity.PosableEntity
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
import com.cobblemon.mod.common.entity.generic.GenericBedrockEntity
|
||||
@@ -132,7 +130,7 @@ open class PokemonEntity(
|
||||
world: Level,
|
||||
pokemon: Pokemon = Pokemon().apply { isClient = world.isClientSide },
|
||||
type: EntityType<out PokemonEntity> = CobblemonEntities.POKEMON,
|
||||
) : ShoulderRidingEntity(type, world), PosableEntity, Shearable, Schedulable, ScannableEntity, AttackingEntity {
|
||||
) : ShoulderRidingEntity(type, world), PosableEntity, Shearable, Schedulable, ScannableEntity {
|
||||
companion object {
|
||||
@JvmStatic val SPECIES = SynchedEntityData.defineId(PokemonEntity::class.java, EntityDataSerializers.STRING)
|
||||
@JvmStatic val NICKNAME = SynchedEntityData.defineId(PokemonEntity::class.java, EntityDataSerializers.COMPONENT)
|
||||
@@ -255,10 +253,25 @@ open class PokemonEntity(
|
||||
|
||||
override val struct: QueryStruct = QueryStruct(hashMapOf())
|
||||
.addStandardFunctions()
|
||||
.addEntityFunctions(this)
|
||||
.addPokemonFunctions(pokemon)
|
||||
.addPokemonEntityFunctions(this)
|
||||
|
||||
.addFunction("uuid") { StringValue(uuid.toString()) }
|
||||
.addFunction("in_battle") { DoubleValue(isBattling) }
|
||||
.addFunction("is_wild") { DoubleValue(pokemon.isWild()) }
|
||||
.addFunction("is_shiny") { DoubleValue(pokemon.shiny) }
|
||||
.addFunction("form") { StringValue(pokemon.form.name) }
|
||||
.addFunction("width") { DoubleValue(boundingBox.xsize) }
|
||||
.addFunction("height") { DoubleValue(boundingBox.ysize) }
|
||||
.addFunction("horizontal_velocity") { DoubleValue(deltaMovement.horizontalDistance()) }
|
||||
.addFunction("vertical_velocity") { DoubleValue(deltaMovement.y) }
|
||||
.addFunction("weight") { DoubleValue(pokemon.species.weight.toDouble()) }
|
||||
.addFunction("is_moving") { DoubleValue((moveControl as? PokemonMoveControl)?.hasWanted() == true) }
|
||||
.addFunction("is_underwater") { DoubleValue(getIsSubmerged()) }
|
||||
.addFunction("is_flying") { DoubleValue(getBehaviourFlag(PokemonBehaviourFlag.FLYING)) }
|
||||
.addFunction("is_passenger") { DoubleValue(isPassenger()) }
|
||||
.addFunction("entity_width") { DoubleValue(boundingBox.xsize) }
|
||||
.addFunction("entity_height") { DoubleValue(boundingBox.ysize) }
|
||||
.addFunction("entity_size") { DoubleValue(boundingBox.run { if (xsize > ysize) xsize else ysize }) }
|
||||
.addFunction("entity_radius") { DoubleValue(boundingBox.run { if (xsize > ysize) xsize else ysize } / 2) }
|
||||
.addFunction("has_aspect") { DoubleValue(it.getString(0) in aspects) }
|
||||
|
||||
init {
|
||||
delegate.initialize(this)
|
||||
@@ -350,12 +363,6 @@ open class PokemonEntity(
|
||||
|
||||
override fun tick() {
|
||||
super.tick()
|
||||
|
||||
if (!this.isBattling && this.beamMode == 0 && this.isBattleClone()) {
|
||||
discard()
|
||||
return
|
||||
}
|
||||
|
||||
// We will be handling idle logic ourselves thank you
|
||||
this.setNoActionTime(0)
|
||||
if (queuedToDespawn) {
|
||||
@@ -461,13 +468,6 @@ open class PokemonEntity(
|
||||
*/
|
||||
fun isUncatchable() = pokemon.isUncatchable()
|
||||
|
||||
/**
|
||||
* A utility method that checks if this Pokémon has the [UncatchableProperty.uncatchable] property.
|
||||
*
|
||||
* @return If the Pokémon is uncatchable.
|
||||
*/
|
||||
fun isBattleClone() = pokemon.isBattleClone()
|
||||
|
||||
fun recallWithAnimation(): CompletableFuture<Pokemon> {
|
||||
val owner = owner ?: pokemon.getOwnerEntity()
|
||||
val future = CompletableFuture<Pokemon>()
|
||||
@@ -732,9 +732,6 @@ open class PokemonEntity(
|
||||
}
|
||||
|
||||
override fun mobInteract(player: Player, hand: InteractionHand): InteractionResult {
|
||||
if (!this.isBattling && this.isBattleClone()) {
|
||||
return InteractionResult.FAIL
|
||||
}
|
||||
val itemStack = player.getItemInHand(hand)
|
||||
val colorFeatureType = SpeciesFeatures.getFeaturesFor(pokemon.species)
|
||||
.find { it is ChoiceSpeciesFeatureProvider && DataKeys.CAN_BE_COLORED in it.keys }
|
||||
@@ -1430,13 +1427,4 @@ open class PokemonEntity(
|
||||
override fun resolveEntityScan(): LivingEntity {
|
||||
return this
|
||||
}
|
||||
|
||||
override fun getAttackingEntityId(): Int? {
|
||||
if (pokemon.isClient) {
|
||||
return (delegate as PokemonClientDelegate).targetedEntityId
|
||||
}
|
||||
else {
|
||||
TODO("Currently there is nothing that needs to know this on the server")
|
||||
}
|
||||
}
|
||||
}
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
package com.cobblemon.mod.common.net.messages.client.battle
|
||||
|
||||
import com.cobblemon.mod.common.api.net.NetworkPacket
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
|
||||
class BattleAppendTargetedEntityPacket(val sourceEntityId: Int, val targetedEntityId: Int) : NetworkPacket<BattleAppendTargetedEntityPacket> {
|
||||
override val id = ID
|
||||
override fun encode(buffer: RegistryFriendlyByteBuf) {
|
||||
buffer.writeVarInt(sourceEntityId)
|
||||
buffer.writeVarInt(targetedEntityId)
|
||||
}
|
||||
|
||||
companion object {
|
||||
val ID = cobblemonResource("battle_append_targeted")
|
||||
fun decode(buffer: RegistryFriendlyByteBuf) = BattleAppendTargetedEntityPacket(buffer.readVarInt(), buffer.readVarInt())
|
||||
}
|
||||
|
||||
}
|
||||
+4
-1
@@ -20,7 +20,10 @@ class BenchedMovesUpdatePacket(pokemon: () -> Pokemon, value: BenchedMoves): Sin
|
||||
}
|
||||
|
||||
override fun set(pokemon: Pokemon, value: BenchedMoves) {
|
||||
pokemon.benchedMoves.copyFrom(value)
|
||||
pokemon.benchedMoves.doThenEmit {
|
||||
pokemon.benchedMoves.clear()
|
||||
pokemon.benchedMoves.addAll(value)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
-30
@@ -1,30 +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.trade
|
||||
|
||||
import com.cobblemon.mod.common.api.net.NetworkPacket
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
|
||||
/**
|
||||
* Packet sent to the client when the trade has started.
|
||||
*
|
||||
* Handled by [com.cobblemon.mod.common.client.net.trade.TradeProcessStartedHandler]
|
||||
*/
|
||||
class TradeProcessStartedPacket(val isTradeInitiator: Boolean) : NetworkPacket<TradeProcessStartedPacket> {
|
||||
companion object {
|
||||
val ID = cobblemonResource("trade_process_started")
|
||||
fun decode(buffer: RegistryFriendlyByteBuf) = TradeProcessStartedPacket(buffer.readBoolean())
|
||||
}
|
||||
|
||||
override val id = ID
|
||||
override fun encode(buffer: RegistryFriendlyByteBuf) {
|
||||
buffer.writeBoolean(isTradeInitiator)
|
||||
}
|
||||
}
|
||||
-28
@@ -1,28 +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.server.trade
|
||||
|
||||
import com.cobblemon.mod.common.api.net.NetworkPacket
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import com.cobblemon.mod.common.util.readUUID
|
||||
import com.cobblemon.mod.common.util.writeUUID
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
import java.util.UUID
|
||||
|
||||
class PerformTradePacket(val pokemonOfferId: UUID) : NetworkPacket<PerformTradePacket> {
|
||||
companion object {
|
||||
val ID = cobblemonResource("perform_trade")
|
||||
fun decode(buffer: RegistryFriendlyByteBuf) = PerformTradePacket(buffer.readUUID())
|
||||
}
|
||||
|
||||
override val id = ID
|
||||
override fun encode(buffer: RegistryFriendlyByteBuf) {
|
||||
buffer.writeUUID(pokemonOfferId)
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -48,7 +48,8 @@ object RequestInteractionsHandler : ServerNetworkPacketHandler<RequestPlayerInte
|
||||
val isTargetBattling = BattleRegistry.getBattleByParticipatingPlayerId(packet.targetId) != null
|
||||
if (isTargetBattling and Cobblemon.config.allowSpectating && squaredDistance <= Cobblemon.config.battleSpectateMaxDistance.pow(2)) {
|
||||
options[PlayerInteractOptionsPacket.Options.SPECTATE_BATTLE] = PlayerInteractOptionsPacket.OptionStatus.AVAILABLE
|
||||
} else if (squaredDistance <= Cobblemon.config.BattlePvPMaxDistance.pow(2)) {
|
||||
}
|
||||
else if (squaredDistance <= Cobblemon.config.BattlePvPMaxDistance.pow(2)) {
|
||||
// LOS and distance checks passed, now check parties and add appropriate options
|
||||
val playerPartyCount = player.party().count { pokemon -> !pokemon.isFainted() }
|
||||
val targetPartyCount = (targetPlayerEntity as ServerPlayer).party().count { pokemon -> !pokemon.isFainted() }
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ import net.minecraft.server.level.ServerPlayer
|
||||
object InteractPokemonHandler : ServerNetworkPacketHandler<InteractPokemonPacket> {
|
||||
override fun handle(packet: InteractPokemonPacket, server: MinecraftServer, player: ServerPlayer) {
|
||||
val pokemonEntity = player.serverLevel().getEntity(packet.pokemonID)
|
||||
if (pokemonEntity is PokemonEntity && !pokemonEntity.isBattleClone()) {
|
||||
if (pokemonEntity is PokemonEntity) {
|
||||
if (packet.mountShoulder) {
|
||||
if (!pokemonEntity.canSitOnShoulder() || player.party().none { it == pokemonEntity.pokemon }) {
|
||||
return
|
||||
|
||||
-27
@@ -1,27 +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.serverhandling.trade
|
||||
|
||||
import com.cobblemon.mod.common.CobblemonNetwork.sendPacket
|
||||
import com.cobblemon.mod.common.api.net.ServerNetworkPacketHandler
|
||||
import com.cobblemon.mod.common.net.messages.client.trade.TradeCancelledPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.trade.PerformTradePacket
|
||||
import com.cobblemon.mod.common.trade.TradeManager
|
||||
import net.minecraft.server.MinecraftServer
|
||||
import net.minecraft.server.level.ServerPlayer
|
||||
|
||||
object PerformTradeHandler : ServerNetworkPacketHandler<PerformTradePacket> {
|
||||
override fun handle(packet: PerformTradePacket, server: MinecraftServer, player: ServerPlayer) {
|
||||
val trade = TradeManager.getActiveTrade(player.uuid) ?: return player.sendPacket(TradeCancelledPacket())
|
||||
val tradeParticipant = trade.getTradeParticipant(player.uuid)
|
||||
if (trade.getOpposingOffer(tradeParticipant).pokemon?.uuid == packet.pokemonOfferId) {
|
||||
trade.performTrade(tradeParticipant)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -75,7 +75,6 @@ import com.cobblemon.mod.common.pokemon.evolution.progress.DamageTakenEvolutionP
|
||||
import com.cobblemon.mod.common.pokemon.evolution.progress.RecoilEvolutionProgress
|
||||
import com.cobblemon.mod.common.pokemon.feature.SeasonFeatureHandler
|
||||
import com.cobblemon.mod.common.pokemon.feature.StashHandler
|
||||
import com.cobblemon.mod.common.pokemon.properties.BattleCloneProperty
|
||||
import com.cobblemon.mod.common.pokemon.properties.UncatchableProperty
|
||||
import com.cobblemon.mod.common.pokemon.status.PersistentStatus
|
||||
import com.cobblemon.mod.common.pokemon.status.PersistentStatusContainer
|
||||
@@ -248,23 +247,22 @@ open class Pokemon : ShowdownIdentifiable {
|
||||
}
|
||||
this.healTimer = Cobblemon.config.healTimer
|
||||
}
|
||||
|
||||
var gender = Gender.GENDERLESS
|
||||
set(value) {
|
||||
if (!isClient && value !in species.possibleGenders) {
|
||||
return
|
||||
}
|
||||
field = value
|
||||
updateAspects()
|
||||
_gender.emit(value)
|
||||
if (!isClient) {
|
||||
checkGender()
|
||||
}
|
||||
if (field == value) {
|
||||
updateAspects()
|
||||
_gender.emit(value)
|
||||
}
|
||||
}
|
||||
|
||||
var status: PersistentStatusContainer? = null
|
||||
set(value) {
|
||||
field = value
|
||||
this._status.emit(value?.status)
|
||||
}
|
||||
|
||||
var experience = 0
|
||||
internal set(value) {
|
||||
field = value
|
||||
@@ -822,13 +820,6 @@ open class Pokemon : ShowdownIdentifiable {
|
||||
*/
|
||||
fun isUncatchable() = UncatchableProperty.uncatchable().matches(this)
|
||||
|
||||
/**
|
||||
* A utility method that checks if this Pokémon has the [BattleCloneProperty.isBattleClone] property.
|
||||
*
|
||||
* @return If the Pokémon is a battle clone.
|
||||
*/
|
||||
fun isBattleClone() = BattleCloneProperty.isBattleClone().matches(this)
|
||||
|
||||
/**
|
||||
* Returns a copy of the held item.
|
||||
* In order to change the [ItemStack] use [swapHeldItem].
|
||||
@@ -940,7 +931,7 @@ open class Pokemon : ShowdownIdentifiable {
|
||||
this.currentHealth = other.currentHealth
|
||||
this.gender = other.gender
|
||||
this.moveSet.copyFrom(other.moveSet)
|
||||
this.benchedMoves.copyFrom(other.benchedMoves)
|
||||
this.benchedMoves = other.benchedMoves
|
||||
this.scaleModifier = other.scaleModifier
|
||||
this.shiny = other.shiny
|
||||
this.state = other.state
|
||||
@@ -1118,9 +1109,6 @@ open class Pokemon : ShowdownIdentifiable {
|
||||
val allAccessibleMoves: Set<MoveTemplate>
|
||||
get() = form.moves.getLevelUpMovesUpTo(level) + benchedMoves.map { it.moveTemplate } + form.moves.evolutionMoves
|
||||
|
||||
val relearnableMoves: Iterable<MoveTemplate>
|
||||
get() = allAccessibleMoves.filter { accessibleMove -> moveSet.none { it.template == accessibleMove } }
|
||||
|
||||
fun updateAspects() {
|
||||
aspects = emptySet()
|
||||
/*
|
||||
|
||||
@@ -111,19 +111,6 @@ class Species : ClientDataSynchronizer<Species>, ShowdownIdentifiable {
|
||||
var labels = hashSetOf<String>()
|
||||
private set
|
||||
|
||||
val possibleGenders: Set<Gender>
|
||||
get() = forms.flatMap {
|
||||
if (it.maleRatio == -1F) {
|
||||
setOf(Gender.GENDERLESS)
|
||||
} else if (it.maleRatio == 0F) {
|
||||
setOf(Gender.FEMALE)
|
||||
} else if (it.maleRatio == 1F) {
|
||||
setOf(Gender.MALE)
|
||||
} else {
|
||||
setOf(Gender.FEMALE)
|
||||
}
|
||||
}.toSet()
|
||||
|
||||
/**
|
||||
* Contains the evolutions of this species.
|
||||
* If you're trying to find out the possible evolutions of a Pokémon you should always work with their [FormData].
|
||||
|
||||
-33
@@ -1,33 +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.pokemon.properties
|
||||
|
||||
import com.cobblemon.mod.common.api.properties.CustomPokemonPropertyType
|
||||
|
||||
/**
|
||||
* A type of [CustomPokemonPropertyType] handling a [FlagProperty] which, when
|
||||
* present, indicates that the Pokémon is a battle clone and should not
|
||||
* persist outside the context of a battle.
|
||||
*
|
||||
*/
|
||||
object BattleCloneProperty : CustomPokemonPropertyType<FlagProperty> {
|
||||
override val keys = setOf("battleClone")
|
||||
override val needsKey = true
|
||||
|
||||
override fun fromString(value: String?) =
|
||||
when {
|
||||
value == null || value.lowercase() in listOf("true", "yes") -> isBattleClone()
|
||||
value.lowercase() in listOf("false", "no") -> { FlagProperty(keys.first(), false) }
|
||||
else -> null
|
||||
}
|
||||
|
||||
fun isBattleClone() = FlagProperty(keys.first(), false)
|
||||
|
||||
override fun examples() = setOf("yes", "no")
|
||||
}
|
||||
@@ -35,25 +35,20 @@ class ActiveTrade(val player1: TradeParticipant, val player2: TradeParticipant)
|
||||
}
|
||||
|
||||
if (offer.accepted && getOffer(tradeParticipant).accepted) {
|
||||
//performTrade
|
||||
player1.startTradeProcess(this, tradeParticipant == player1)
|
||||
player2.startTradeProcess(this, tradeParticipant == player2)
|
||||
performTrade()
|
||||
}
|
||||
}
|
||||
|
||||
fun getOppositePlayer(tradeParticipant: TradeParticipant) = if (tradeParticipant == player1) player2 else player1
|
||||
|
||||
fun performTrade(tradeParticipant: TradeParticipant) {
|
||||
val offer = getOpposingOffer(tradeParticipant)
|
||||
if (offer.accepted && getOffer(tradeParticipant).accepted) {
|
||||
TradeManager.performTrade(
|
||||
player1 = player1,
|
||||
player2 = player2,
|
||||
pokemon1 = player1Offer.pokemon!!,
|
||||
pokemon2 = player2Offer.pokemon!!
|
||||
)
|
||||
completeTrade()
|
||||
}
|
||||
fun performTrade() {
|
||||
TradeManager.performTrade(
|
||||
player1 = player1,
|
||||
player2 = player2,
|
||||
pokemon1 = player1Offer.pokemon!!,
|
||||
pokemon2 = player2Offer.pokemon!!
|
||||
)
|
||||
completeTrade()
|
||||
}
|
||||
|
||||
fun cancelTrade() {
|
||||
|
||||
@@ -11,7 +11,10 @@ package com.cobblemon.mod.common.trade
|
||||
import com.cobblemon.mod.common.CobblemonNetwork.sendPacket
|
||||
import com.cobblemon.mod.common.api.storage.party.PartyStore
|
||||
import com.cobblemon.mod.common.api.text.text
|
||||
import com.cobblemon.mod.common.net.messages.client.trade.*
|
||||
import com.cobblemon.mod.common.net.messages.client.trade.TradeAcceptanceChangedPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.trade.TradeCancelledPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.trade.TradeCompletedPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.trade.TradeUpdatedPacket
|
||||
import com.cobblemon.mod.common.pokemon.Pokemon
|
||||
import com.cobblemon.mod.common.util.party
|
||||
import java.util.UUID
|
||||
@@ -46,15 +49,6 @@ interface TradeParticipant {
|
||||
*/
|
||||
fun changeTradeAcceptance(trade: ActiveTrade, pokemonId: UUID, acceptance: Boolean)
|
||||
|
||||
/**
|
||||
* Notifies the participant that the trade process has begun.
|
||||
*
|
||||
* @param isTradeInitiator Indicates if the user is the one who accepted last.
|
||||
* Used by the UI to complete the trade after the process/animation is done.
|
||||
* Only 1 user should handle sending the completion to the server to prevent conflicts.
|
||||
*/
|
||||
fun startTradeProcess(trade: ActiveTrade, isTradeInitiator: Boolean)
|
||||
|
||||
/** Notifies the participant that the trade has been cancelled. */
|
||||
fun cancelTrade(trade: ActiveTrade)
|
||||
|
||||
@@ -81,10 +75,6 @@ class PlayerTradeParticipant(val player: ServerPlayer): TradeParticipant {
|
||||
player.sendPacket(TradeAcceptanceChangedPacket(pokemonId, acceptance))
|
||||
}
|
||||
|
||||
override fun startTradeProcess(trade: ActiveTrade, isTradeInitiator: Boolean) {
|
||||
player.sendPacket(TradeProcessStartedPacket(isTradeInitiator))
|
||||
}
|
||||
|
||||
override fun cancelTrade(trade: ActiveTrade) {
|
||||
player.sendPacket(TradeCancelledPacket())
|
||||
}
|
||||
@@ -113,10 +103,6 @@ class DummyTradeParticipant(val pokemonList: MutableList<Pokemon>) : TradePartic
|
||||
// Don't need to do any notifying.
|
||||
}
|
||||
|
||||
override fun startTradeProcess(trade: ActiveTrade, isTradeInitiator: Boolean) {
|
||||
// React, maybe. Change code and hotswap.
|
||||
}
|
||||
|
||||
override fun changeTradeAcceptance(trade: ActiveTrade, pokemonId: UUID, acceptance: Boolean) {
|
||||
// React, maybe. Change code and hotswap.
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
package com.cobblemon.mod.common.util
|
||||
|
||||
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
|
||||
import com.google.common.collect.ImmutableMap
|
||||
import com.mojang.serialization.Dynamic
|
||||
import com.mojang.serialization.DynamicOps
|
||||
@@ -208,6 +209,11 @@ fun Entity.isDusk(): Boolean {
|
||||
return time in 12000..13000
|
||||
}
|
||||
|
||||
fun Entity.isWild(): Boolean {
|
||||
if (this !is PokemonEntity) return false
|
||||
return this.ownerUUID == null
|
||||
}
|
||||
|
||||
fun Entity.isStandingOnSand(): Boolean {
|
||||
val sandDepth = 2 // Define the depth you want to check
|
||||
for (a in 1..sandDepth) {
|
||||
|
||||
+1
-10
@@ -11,13 +11,11 @@ package com.cobblemon.mod.common.util.adapters
|
||||
import com.google.gson.JsonDeserializationContext
|
||||
import com.google.gson.JsonDeserializer
|
||||
import com.google.gson.JsonElement
|
||||
import com.google.gson.JsonSerializationContext
|
||||
import com.google.gson.JsonSerializer
|
||||
import com.mojang.serialization.Codec
|
||||
import com.mojang.serialization.JsonOps
|
||||
import java.lang.reflect.Type
|
||||
|
||||
class CodecBackedAdapter<T>(val codec: Codec<T>) : JsonDeserializer<T>, JsonSerializer<T> {
|
||||
class CodecBackedAdapter<T>(val codec: Codec<T>) : JsonDeserializer<T> {
|
||||
override fun deserialize(
|
||||
jElement: JsonElement,
|
||||
typeOfT: Type,
|
||||
@@ -26,11 +24,4 @@ class CodecBackedAdapter<T>(val codec: Codec<T>) : JsonDeserializer<T>, JsonSeri
|
||||
return JsonOps.INSTANCE.withDecoder(codec).apply(jElement).result().get().first as T
|
||||
}
|
||||
|
||||
override fun serialize(
|
||||
src: T,
|
||||
typeOfSrc: Type?,
|
||||
context: JsonSerializationContext?
|
||||
): JsonElement {
|
||||
return JsonOps.INSTANCE.withEncoder(codec).apply(src).result().get()
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -64,7 +64,7 @@ internal class ClientPokemonP1(
|
||||
other.currentHealth = this.currentHealth
|
||||
other.gender = this.gender
|
||||
other.moveSet.copyFrom(this.moveSet)
|
||||
other.benchedMoves.copyFrom(this.benchedMoves)
|
||||
other.benchedMoves = this.benchedMoves
|
||||
other.scaleModifier = this.scaleModifier
|
||||
this.features.forEach { featureNbt ->
|
||||
val featureId = featureNbt.getString(FEATURE_ID)
|
||||
|
||||
@@ -58,7 +58,7 @@ internal class PokemonP1(
|
||||
other.currentHealth = this.currentHealth
|
||||
other.gender = this.gender
|
||||
other.moveSet.copyFrom(this.moveSet)
|
||||
other.benchedMoves.copyFrom(this.benchedMoves)
|
||||
other.benchedMoves = this.benchedMoves
|
||||
other.scaleModifier = this.scaleModifier
|
||||
other.shiny = this.shiny
|
||||
return other
|
||||
|
||||
-29
@@ -1,29 +0,0 @@
|
||||
{
|
||||
"format_version": "1.8.0",
|
||||
"animations": {
|
||||
"animation.psychic.target": {
|
||||
"animation_length": 1.70833,
|
||||
"bones": {
|
||||
"root_part": {
|
||||
"rotation": {
|
||||
"0.0": [0, 0, 0],
|
||||
"0.5": [0, "math.sin(q.anim_time*90*5-90)*5", 0],
|
||||
"0.9583": [0, "math.sin(q.anim_time*90*12-90)*5", 0],
|
||||
"1.0833": [0, 0, 0]
|
||||
},
|
||||
"scale": {
|
||||
"0.0": [1, 1, 1],
|
||||
"0.5": ["1+math.sin(q.anim_time*90*7-135)*0.15", "1+math.sin(q.anim_time*90*7)*0.15", 1],
|
||||
"0.9583": ["1+math.sin(q.anim_time*90*7-135)*0.15", "1+math.sin(q.anim_time*90*7)*0.15", 1],
|
||||
"1.0833": [
|
||||
"1.2+math.sin(q.anim_time*90*7-135)*0.2+math.sin(q.anim_time*90*350)*0.4",
|
||||
"1.2+math.sin(q.anim_time*90*7)*0.2+math.sin(q.anim_time*90*350)*0.25",
|
||||
1.2
|
||||
],
|
||||
"1.3333": [1, 1, 1]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-67
@@ -1,67 +0,0 @@
|
||||
{
|
||||
"format_version": "1.10.0",
|
||||
"particle_effect": {
|
||||
"description": {
|
||||
"identifier": "cobblemon:burn_actor",
|
||||
"basic_render_parameters": {
|
||||
"material": "particles_blend",
|
||||
"texture": "textures/particles/large-flame"
|
||||
}
|
||||
},
|
||||
"curves": {
|
||||
"variable.burnflicker": {
|
||||
"type": "linear",
|
||||
"input": "v.particle_age",
|
||||
"horizontal_range": "v.particle_lifetime",
|
||||
"nodes": [0, 0.79, 1, 0.97, 0.88, 0.71, 0.5, 0.25, -0.05]
|
||||
}
|
||||
},
|
||||
"components": {
|
||||
"minecraft:emitter_rate_steady": {
|
||||
"spawn_rate": "90*(q.entity_radius*1.2)",
|
||||
"max_particles": 120
|
||||
},
|
||||
"minecraft:emitter_lifetime_once": {
|
||||
"active_time": 0.2
|
||||
},
|
||||
"minecraft:emitter_shape_sphere": {
|
||||
"radius": "(q.entity_radius*(0.95+v.emitter_age))/math.clamp(q.entity_scale*1.1-0.1,1,2)",
|
||||
"surface_only": true,
|
||||
"direction": ["math.random(-1.5,1.5)*0.4", "math.random(1,2)", "math.random(-1.5,1.5)*0.4"]
|
||||
},
|
||||
"minecraft:particle_lifetime_expression": {
|
||||
"max_lifetime": "math.random(0.3,0.5)"
|
||||
},
|
||||
"minecraft:particle_initial_speed": "math.random(3.75,4.75)*1",
|
||||
"minecraft:particle_motion_dynamic": {
|
||||
"linear_drag_coefficient": 4
|
||||
},
|
||||
"minecraft:particle_appearance_billboard": {
|
||||
"size": ["0.1*v.burnflicker+(v.particle_random_2*0.1)", "0.15*v.burnflicker+(v.particle_random_2*0.1)"],
|
||||
"facing_camera_mode": "rotate_xyz",
|
||||
"uv": {
|
||||
"texture_width": 56,
|
||||
"texture_height": 10,
|
||||
"flipbook": {
|
||||
"base_UV": [0, 0],
|
||||
"size_UV": [8, 10],
|
||||
"step_UV": [8, 0],
|
||||
"frames_per_second": 10,
|
||||
"max_frame": 7,
|
||||
"stretch_to_lifetime": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"minecraft:particle_appearance_tinting": {
|
||||
"color": {
|
||||
"interpolant": "v.particle_age / v.particle_lifetime",
|
||||
"gradient": {
|
||||
"0.0": "#FFFFFFFF",
|
||||
"0.63": "#ffffffff",
|
||||
"1.0": "#00B23000"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-58
@@ -1,58 +0,0 @@
|
||||
{
|
||||
"format_version": "1.10.0",
|
||||
"particle_effect": {
|
||||
"description": {
|
||||
"identifier": "cobblemon:burn_actorresidual",
|
||||
"basic_render_parameters": {
|
||||
"material": "particles_alpha",
|
||||
"texture": "textures/particles/ember"
|
||||
}
|
||||
},
|
||||
"components": {
|
||||
"minecraft:emitter_rate_steady": {
|
||||
"spawn_rate": 40,
|
||||
"max_particles": 20
|
||||
},
|
||||
"minecraft:emitter_lifetime_once": {
|
||||
"active_time": 0.5
|
||||
},
|
||||
"minecraft:emitter_shape_sphere": {
|
||||
"radius": "(q.entity_radius*(0.95+v.emitter_age))/math.clamp(q.entity_scale*1.1-0.1,1,2)",
|
||||
"surface_only": true,
|
||||
"direction": ["math.random(-1.5,1.5)", "math.random(0,2)", "math.random(-1.5,1.5)"]
|
||||
},
|
||||
"minecraft:particle_lifetime_expression": {
|
||||
"max_lifetime": 0.25
|
||||
},
|
||||
"minecraft:particle_initial_speed": "math.random(2.75,4.75)*0.45",
|
||||
"minecraft:particle_motion_dynamic": {
|
||||
"linear_acceleration": [0, 6, 0],
|
||||
"linear_drag_coefficient": 2
|
||||
},
|
||||
"minecraft:particle_appearance_billboard": {
|
||||
"size": [0.12, 0.12],
|
||||
"facing_camera_mode": "rotate_xyz",
|
||||
"uv": {
|
||||
"texture_width": 25,
|
||||
"texture_height": 5,
|
||||
"flipbook": {
|
||||
"base_UV": [0, 0],
|
||||
"size_UV": [5, 5],
|
||||
"step_UV": [5, 0],
|
||||
"frames_per_second": 20,
|
||||
"max_frame": 5
|
||||
}
|
||||
}
|
||||
},
|
||||
"minecraft:particle_appearance_tinting": {
|
||||
"color": {
|
||||
"interpolant": "v.particle_age / v.particle_lifetime",
|
||||
"gradient": {
|
||||
"0.0": "#FFFFC8B3",
|
||||
"1.0": "#FFB23000"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loaded 100 of 927 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user