Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04d95b3f80 | ||
|
|
a505bad554 | ||
|
|
e27e5a1d92 | ||
|
|
5e0357101d | ||
|
|
5420f7419f | ||
|
|
43ed2d3c7d | ||
|
|
93500f59ed | ||
|
|
08912fd53f | ||
|
|
92c8fc0afc | ||
|
|
fae6bdb782 | ||
|
|
bba0100542 | ||
|
|
f9b66de742 | ||
|
|
3d0f1c826a | ||
|
|
2a59add285 | ||
|
|
0b83128aa0 | ||
|
|
e2b04ff770 | ||
|
|
4dabe50d43 | ||
|
|
3dd0795b88 | ||
|
|
70f1a8207f | ||
|
|
3ac18cce6e | ||
|
|
aa0a0672d0 | ||
|
|
ec2958400b | ||
|
|
fcb6bea78b | ||
|
|
5a76a39b77 | ||
|
|
b5a4acfb7a | ||
|
|
1248230e67 | ||
|
|
096db6cdcd | ||
|
|
72e416b9c7 | ||
|
|
9e8e80965b | ||
|
|
2325b436b1 | ||
|
|
57421a2884 | ||
|
|
4fdd3eba8e | ||
|
|
e6efe800c0 | ||
|
|
95aa99e18c | ||
|
|
270484e745 | ||
|
|
719addf633 | ||
|
|
31e386871f | ||
|
|
bfd7e596d0 | ||
|
|
643545d54c | ||
|
|
fcb017f980 | ||
|
|
dd52da7c42 | ||
|
|
ff45def0e8 | ||
|
|
f078584e56 | ||
|
|
a11382b5a1 | ||
|
|
d1b8094539 | ||
|
|
b8d79af911 | ||
|
|
155b4b2182 | ||
|
|
690ed845b2 | ||
|
|
a7198fd324 | ||
|
|
bc69ce91f3 | ||
|
|
1de1d8cdc3 | ||
|
|
1f8171dd94 | ||
|
|
087bf75500 | ||
|
|
bac435ba7b | ||
|
|
74a6106eb6 | ||
|
|
5ec993ad3c | ||
|
|
73a03d90da | ||
|
|
e6fda6137e | ||
|
|
afae39acc8 | ||
|
|
37264aff0f | ||
|
|
2b60e6de77 | ||
|
|
4f29e7457c | ||
|
|
04a6ab31f4 | ||
|
|
a2cdc847dd | ||
|
|
0bca678f56 | ||
|
|
067c3607aa | ||
|
|
823c1f6444 | ||
|
|
bfc00635cd | ||
|
|
b2e5b85ac5 | ||
|
|
2c27476954 | ||
|
|
aab78d84fc | ||
|
|
cb632c2a65 | ||
|
|
8d219f1338 | ||
|
|
1e6a4ed984 | ||
|
|
64240c31fc | ||
|
|
d2222c3858 | ||
|
|
c7f31c3e14 | ||
|
|
740e846b2d | ||
|
|
246d00aa3f | ||
|
|
06f9d60595 | ||
|
|
b3ed47fbca | ||
|
|
3a6ad70b76 | ||
|
|
8120270bf8 | ||
|
|
d54439ce14 | ||
|
|
32ee4bb72a | ||
|
|
e7d2a46cc0 | ||
|
|
3ee94ec076 | ||
|
|
589293abc4 | ||
|
|
279865cc7c | ||
|
|
70fe1682b0 | ||
|
|
9058bde326 | ||
|
|
bf425efd40 | ||
|
|
cebff87656 | ||
|
|
d24fb13877 | ||
|
|
1d82df464a | ||
|
|
2a1d1e4474 |
@@ -1,137 +1,51 @@
|
||||
# Changelog
|
||||
## [1.7.2 (January 25th, 2026)](#1-7-2)
|
||||
## [1.7.4 (MONTH Xth, 2026)](#1-7-4)
|
||||
|
||||
### Additions
|
||||
- Added Saccharine wood furniture for Adorn.
|
||||
- Added the Partner Mark, which party Pokémon have a very small chance to earn as the player walks, provided they have enough friendship.
|
||||
- Added decorative block models for existing items: Potion, Super Potion, Hyper Potion, Max Potion, Full Restore, Antidote, Awakening, Burn Heal, Ice Heal, Paralyze Heal, Full Heal, Ether, Elixir, Max Ether, Max Elixir, X Accuracy, X Attack, X Defence, X Special Attack, X Special Defence, X Speed, Dire Hit, Guard Spec, Weakness Policy, Blunder Policy, Cleanse Tag, and Spell Tag.
|
||||
- Added decorative sign blocks called Plaques.
|
||||
- Added ride style labels to ride stats in Pokédex, as well as ride style icons in the summary GUI.
|
||||
- Added more seasonings for sinister tea:
|
||||
- Mental Herb - Mental Restoration I for 10 seconds, which staves off Insomnia.
|
||||
- White Herb - Removes negative effects.
|
||||
- Milk, Moomoo Milk - Removes effects.
|
||||
- Added dispenser support for:
|
||||
- Applying a Honey Bottle to Saccharine Logs.
|
||||
- Washing honey off of Saccharine Slathered Logs.
|
||||
- Applying and removing honey on Saccharine Leaves.
|
||||
- Added riding statistics: `Distance by Pokémon on Land`, `Distance by Pokémon in Air` and `Distance by Pokémon in Liquid`.
|
||||
- Party Overlay Exp Gained Animation will now display the amount of EXP the Pokémon gained
|
||||
- Added a toast to notify players of how they can scroll through their party. Did you know you can hold R and scroll instead of using arrow keys??!
|
||||
- Added new layer property that makes a layer scroll in a direction. "scrolling": {"speedU": 0.1, "speedV": 0.1}
|
||||
- Added missing crops to Botany Pots integration
|
||||
|
||||
### New rideable Pokémon
|
||||
- Honchkrow
|
||||
- Mantine
|
||||
|
||||
### Pokémon Added
|
||||
|
||||
#### Gen 5
|
||||
- Throh
|
||||
- Sawk
|
||||
|
||||
#### Gen 6
|
||||
- Litleo
|
||||
- Pyroar
|
||||
- Spritzee
|
||||
- Aromatisse
|
||||
- Swirlix
|
||||
- Slurpuff
|
||||
|
||||
### Model updates for the following Pokémon
|
||||
- Falinks
|
||||
- Cottonee
|
||||
- Whimsicott
|
||||
- Ferroseed
|
||||
- Ferrothorn
|
||||
- Chingling
|
||||
- Chimecho
|
||||
|
||||
### Animation updates for the following Pokémon
|
||||
- Mantine (ride animations)
|
||||
- Flygon (ride jump animation)
|
||||
- Honchkrow (ride animations)
|
||||
- Croagunk
|
||||
- Toxicroak
|
||||
|
||||
### Changes
|
||||
- Added a new config option, `Enable In-Flight Dismounting` (default: off), which lets you dismount while riding a Pokémon in the air. This is the textbook definition of caveat emptor.
|
||||
- Ride sounds have been separated into stereo for passengers and mono for other players. Riding will now sound more spacious.
|
||||
- Battle AI now uses a smarter threshold for switching, reducing unnecessary switches.
|
||||
- AI will always use the most damaging move when at low HP and when it is not switching, improving endgame decision-making.
|
||||
- Items given from interacting with Saccharine Leaves are placed in the active hotbar slot if possible.
|
||||
- Added `label` as an alternate key to the `tag` property.
|
||||
- Restructured Botany Pots integration folder structure
|
||||
- Decrease default pastured mon wander radius to 32.
|
||||
- Factor in the weight of pokemon when calculating pushing forces between hitboxes.
|
||||
- Remade the Starter Selection Screen with new assets
|
||||
- Refactored berry trees to be less impactful on TPS (more performant)
|
||||
|
||||
### Fixes
|
||||
- Fixed crashing when viewing another player in spectator mode. Some said this was reason to release this update a month ago. They were probably right.
|
||||
- Fixed crashing when sending a Pokémon out after editing its form.
|
||||
- Fixed all Pokémon being saved to chunks and never despawning even when they should be.
|
||||
- Fixed Poké Snacks crashing if there was no available spawn.
|
||||
- Fixed Poké Snack / Bait effects so that EV Yield, Type, and Egg Group filters now all apply together when weighting spawns. And you thought you were going crazy.
|
||||
- Fixed Furfrou not being trimmable on NeoForge specifically.
|
||||
- Fixed honey from Saccharine Leaves being harvestable at less than the max age.
|
||||
- Fixed possible error on world generation when Combee are placed in naturally generated bee nests.
|
||||
- Fixed Galarian Weezing crashing the world if it decides to blink the wrong way. The same could happen to you!
|
||||
- Fixed Galarian Mr. Mime incorrectly being rideable. Some would argue that regular Mr. Mime shouldn't be rideable, but that would make them wrong.
|
||||
- Fixed missing apricorn textures for Adorn blocks.
|
||||
- Fixed Apricorn block model rotation for counters/sinks/cupboards/drawers to match that of most recent version of Adorn.
|
||||
- Fixed item interaction sometimes not working properly when playing on servers.
|
||||
- Fixed Mint Leaves not being usable for filling the Resurrection Machine.
|
||||
- Fixed Super Potion recipes incorrectly using Hondew Berry instead of Aguav Berry. They look similar, to be fair.
|
||||
- Fixed Wishiwashi not schooling properly.
|
||||
- Fixed battle item duplication issue. How did it work? Wouldn't you like to know, weather boy.
|
||||
- Fixed the ordering of Aprijuice's riding stat boosts so they always have the same order.
|
||||
- Fixed the movesets of certain Pokémon being incorrectly sanitized upon reload, causing some forms to keep losing moves.
|
||||
- Fixed selected leading Pokémon in battle not being used when levels are set.
|
||||
- Fixed the bottom half of pasture blocks having an incorrect hit-box when facing north or south.
|
||||
- Fixed gimmicks not being usable in double and triple battles.
|
||||
- Fixed gimmick buttons showing when already used in the same turn in double and triple battles.
|
||||
- Fixed mochi items consuming two items at a time.
|
||||
- Fixed Fresh Start Mochi's EV reset not syncing health changes properly.
|
||||
- Fixed Pokémon spawn influences not being specific to regional forms.
|
||||
- Fixed memory leak from battles not being cleaned up after ending.
|
||||
- Fixed orientation not getting reset after crashing while flying and getting back on the Pokémon.
|
||||
- Fixed shiny Pokémon not respecting the `silent` flag on spawn.
|
||||
- Fixed 'Plain' prefix not being applied to all low-quality Aprijuice.
|
||||
- Fixed Pokémon interactions not playing sound effects when the volume was not specified.
|
||||
- Fixed Pokémon interaction cooldowns taking longer than intended when the Pokémon was in the player’s party.
|
||||
- Fixed Pokémon interactions occasionally crashing the game when spamming an interaction with a 0 cooldown.
|
||||
- Fixed Pokémon fullness decreasing more than intended when the Pokémon was pastured.
|
||||
- Fixed Scraggy line, Milcery line, and Morpeko spawning on unnatural blocks.
|
||||
- Fixed invulnerability-bypassed damage being resisted by invulnerable NPC entities.
|
||||
- Fixed Fabric network packets not being handled immediately, fixing incompatibilities with Supplementaries, Prometheus, Sleep Tight, and others.
|
||||
- Fixed killer not being set early enough on a wild Pokémon entity from `WinInstruction`.
|
||||
- Fixed requirements such as `biomeCondition` crashing the game when used to define Pokémon interactions.
|
||||
- Fixed an issue that prevented registering custom dispenser behaviours (no longer overrides vanilla behaviour).
|
||||
- Fixed an issue navigation that prevented Combee from pathing into and out of Saccharine Leaves.
|
||||
- Added Saccharine Boats and Saccharine Boat with Chests to relevant boat tags.
|
||||
- Fixed Soothe Bell not being properly tagged as a held item.
|
||||
- Fixed `/calculateseatpositions` expecting a locator format that even we don't use. It needs an underscore after "seat".
|
||||
- Fixed the `run_script` Molang function to not fail if the environment's context is null.
|
||||
- Fixed the Molang functions `date_local_time`, `date_of`, `date_is_after` to use the correct date format.
|
||||
- Fixes https://gitlab.com/cable-mc/cobblemon/-/issues/1943
|
||||
- Fix occasional crash on retrieving revived fossils
|
||||
- Fixed a compatibility issue with World Game Rules which caused some log spam in specific cases.
|
||||
- Fixed improper validation of Pokémon when performing a trade.
|
||||
- Fixed issue where particle like beam can disappear when you don't see the beginning of the beam or you look away
|
||||
- Fixes https://gitlab.com/cable-mc/cobblemon/-/issues/1943
|
||||
- Fix occasional crash on retrieving revived fossils
|
||||
- Fix brushing not working on Neoforge
|
||||
- [Various Submarine Ride Fixes](https://gitlab.com/cable-mc/cobblemon/-/merge_requests/2157)
|
||||
- Fix Pastured mons despawning and running away.
|
||||
- Fix Apricorn trees crashing when other mods bonemeal it
|
||||
- [Various UFO Ride Improvements](https://gitlab.com/cable-mc/cobblemon/-/merge_requests/2156)
|
||||
- Fixed NeoForge brewing stand unexpectedly crashing users when shift clicking items within it's menu
|
||||
- Fixed NPCs switching pokemon very often during battles
|
||||
|
||||
### Developer
|
||||
- Changed the `owner` parameter in the `OwnerQueryRequirement` interface from `ServerPlayer` to `Player`. This method is now also called on the client to verify whether a Pokémon interaction succeeded, so make sure to update your implementations to handle both server and client contexts.
|
||||
- Added the `pnx` to the `BattleFaintedEvent` and `FormeChangeEvent`.
|
||||
- Added register methods for custom instructions to `ShowdownInterpreter`.
|
||||
- Changed callback operations in `BattlePokemon` to allow multiple callbacks and be mutable.
|
||||
- Added `display_name`, `description`, and `max_pp` functions to the `MoveTemplate` struct.
|
||||
- Changed the implementations of `AIBattleActor` to be open classes to allow extension.
|
||||
- Changed the resource location of Poké Ball icons in the GUI to use the balls namespace instead of Cobblemon's, allowing mods to properly use their own namespace for these textures.
|
||||
- Added `PokeSnackSpawnerFactory` which allows influence registration on PokeSnack encounters
|
||||
- Added `FishingSpawnerFactory` which allows influence registration on fishing encounters
|
||||
|
||||
### Molang & Datapacks
|
||||
- Ride sounds can now be set as exclusive to passengers.
|
||||
- Ride sounds no longer play when submerged unless specified with a new setting.
|
||||
- Exception handling has been added to `run_molang`, resolving some crashes caused by malformed MoLang expressions.
|
||||
- Added the `create_itemstack`, `has_inventory_space`, `set_inventory_slot`, and `give_item` MoLang functions for item and inventory utility.
|
||||
- Added the `get_move_from_id` MoLang function for general move info queries without requiring a Moveset object to access.
|
||||
- Added support for optional message variants in battle activate instructions for more context-specific battle text.
|
||||
- Example: `this.add('-activate', pokemon, 'ability: example', '[msg]message1');` will parse to lang key `cobblemon.battle.activate.example.message1`.
|
||||
- q.item.is_enchanted()
|
||||
- q.item.has_enchantment(minecraft:sharpness, 3)
|
||||
- Added `has_chosen_starter` & `get_starter_uuid` as available Molang functions
|
||||
|
||||
### Localization
|
||||
- Updated translations for:
|
||||
- French
|
||||
- Canadian French
|
||||
- Simplified Chinese
|
||||
- Ukrainian
|
||||
- Brazilian Portuguese
|
||||
- Spanish
|
||||
- Korean
|
||||
- Japanese
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
# Changelog
|
||||
## [1.7.2 (January 25th, 2026)](#1-7-2)
|
||||
|
||||
### Additions
|
||||
- Added Saccharine wood furniture for Adorn.
|
||||
- Added the Partner Mark, which party Pokémon have a very small chance to earn as the player walks, provided they have enough friendship.
|
||||
- Added decorative block models for existing items: Potion, Super Potion, Hyper Potion, Max Potion, Full Restore, Antidote, Awakening, Burn Heal, Ice Heal, Paralyze Heal, Full Heal, Ether, Elixir, Max Ether, Max Elixir, X Accuracy, X Attack, X Defence, X Special Attack, X Special Defence, X Speed, Dire Hit, Guard Spec, Weakness Policy, Blunder Policy, Cleanse Tag, and Spell Tag.
|
||||
- Added decorative sign blocks called Plaques.
|
||||
- Added ride style labels to ride stats in Pokédex, as well as ride style icons in the summary GUI.
|
||||
- Added more seasonings for sinister tea:
|
||||
- Mental Herb - Mental Restoration I for 10 seconds, which staves off Insomnia.
|
||||
- White Herb - Removes negative effects.
|
||||
- Milk, Moomoo Milk - Removes effects.
|
||||
- Added dispenser support for:
|
||||
- Applying a Honey Bottle to Saccharine Logs.
|
||||
- Washing honey off of Saccharine Slathered Logs.
|
||||
- Applying and removing honey on Saccharine Leaves.
|
||||
- Added riding statistics: `Distance by Pokémon on Land`, `Distance by Pokémon in Air` and `Distance by Pokémon in Liquid`.
|
||||
|
||||
### New rideable Pokémon
|
||||
- Honchkrow
|
||||
- Mantine
|
||||
|
||||
### Pokémon Added
|
||||
|
||||
#### Gen 5
|
||||
- Throh
|
||||
- Sawk
|
||||
|
||||
#### Gen 6
|
||||
- Litleo
|
||||
- Pyroar
|
||||
- Spritzee
|
||||
- Aromatisse
|
||||
- Swirlix
|
||||
- Slurpuff
|
||||
|
||||
### Model updates for the following Pokémon
|
||||
- Falinks
|
||||
- Cottonee
|
||||
- Whimsicott
|
||||
- Ferroseed
|
||||
- Ferrothorn
|
||||
- Chingling
|
||||
- Chimecho
|
||||
|
||||
### Animation updates for the following Pokémon
|
||||
- Mantine (ride animations)
|
||||
- Flygon (ride jump animation)
|
||||
- Honchkrow (ride animations)
|
||||
- Croagunk
|
||||
- Toxicroak
|
||||
|
||||
### Changes
|
||||
- Added a new config option, `Enable In-Flight Dismounting` (default: off), which lets you dismount while riding a Pokémon in the air. This is the textbook definition of caveat emptor.
|
||||
- Ride sounds have been separated into stereo for passengers and mono for other players. Riding will now sound more spacious.
|
||||
- Battle AI now uses a smarter threshold for switching, reducing unnecessary switches.
|
||||
- AI will always use the most damaging move when at low HP and when it is not switching, improving endgame decision-making.
|
||||
- Items given from interacting with Saccharine Leaves are placed in the active hotbar slot if possible.
|
||||
- Added `label` as an alternate key to the `tag` property.
|
||||
|
||||
### Fixes
|
||||
- Fixed crashing when viewing another player in spectator mode. Some said this was reason to release this update a month ago. They were probably right.
|
||||
- Fixed crashing when sending a Pokémon out after editing its form.
|
||||
- Fixed all Pokémon being saved to chunks and never despawning even when they should be.
|
||||
- Fixed Poké Snacks crashing if there was no available spawn.
|
||||
- Fixed Poké Snack / Bait effects so that EV Yield, Type, and Egg Group filters now all apply together when weighting spawns. And you thought you were going crazy.
|
||||
- Fixed Furfrou not being trimmable on NeoForge specifically.
|
||||
- Fixed honey from Saccharine Leaves being harvestable at less than the max age.
|
||||
- Fixed possible error on world generation when Combee are placed in naturally generated bee nests.
|
||||
- Fixed Galarian Weezing crashing the world if it decides to blink the wrong way. The same could happen to you!
|
||||
- Fixed Galarian Mr. Mime incorrectly being rideable. Some would argue that regular Mr. Mime shouldn't be rideable, but that would make them wrong.
|
||||
- Fixed missing apricorn textures for Adorn blocks.
|
||||
- Fixed Apricorn block model rotation for counters/sinks/cupboards/drawers to match that of most recent version of Adorn.
|
||||
- Fixed item interaction sometimes not working properly when playing on servers.
|
||||
- Fixed Mint Leaves not being usable for filling the Resurrection Machine.
|
||||
- Fixed Super Potion recipes incorrectly using Hondew Berry instead of Aguav Berry. They look similar, to be fair.
|
||||
- Fixed Wishiwashi not schooling properly.
|
||||
- Fixed battle item duplication issue. How did it work? Wouldn't you like to know, weather boy.
|
||||
- Fixed the ordering of Aprijuice's riding stat boosts so they always have the same order.
|
||||
- Fixed the movesets of certain Pokémon being incorrectly sanitized upon reload, causing some forms to keep losing moves.
|
||||
- Fixed selected leading Pokémon in battle not being used when levels are set.
|
||||
- Fixed the bottom half of pasture blocks having an incorrect hit-box when facing north or south.
|
||||
- Fixed gimmicks not being usable in double and triple battles.
|
||||
- Fixed gimmick buttons showing when already used in the same turn in double and triple battles.
|
||||
- Fixed mochi items consuming two items at a time.
|
||||
- Fixed Fresh Start Mochi's EV reset not syncing health changes properly.
|
||||
- Fixed Pokémon spawn influences not being specific to regional forms.
|
||||
- Fixed memory leak from battles not being cleaned up after ending.
|
||||
- Fixed orientation not getting reset after crashing while flying and getting back on the Pokémon.
|
||||
- Fixed shiny Pokémon not respecting the `silent` flag on spawn.
|
||||
- Fixed 'Plain' prefix not being applied to all low-quality Aprijuice.
|
||||
- Fixed Pokémon interactions not playing sound effects when the volume was not specified.
|
||||
- Fixed Pokémon interaction cooldowns taking longer than intended when the Pokémon was in the player’s party.
|
||||
- Fixed Pokémon interactions occasionally crashing the game when spamming an interaction with a 0 cooldown.
|
||||
- Fixed Pokémon fullness decreasing more than intended when the Pokémon was pastured.
|
||||
- Fixed Scraggy line, Milcery line, and Morpeko spawning on unnatural blocks.
|
||||
- Fixed invulnerability-bypassed damage being resisted by invulnerable NPC entities.
|
||||
- Fixed Fabric network packets not being handled immediately, fixing incompatibilities with Supplementaries, Prometheus, Sleep Tight, and others.
|
||||
- Fixed killer not being set early enough on a wild Pokémon entity from `WinInstruction`.
|
||||
- Fixed requirements such as `biomeCondition` crashing the game when used to define Pokémon interactions.
|
||||
- Fixed an issue that prevented registering custom dispenser behaviours (no longer overrides vanilla behaviour).
|
||||
- Fixed an issue navigation that prevented Combee from pathing into and out of Saccharine Leaves.
|
||||
- Added Saccharine Boats and Saccharine Boat with Chests to relevant boat tags.
|
||||
- Fixed Soothe Bell not being properly tagged as a held item.
|
||||
- Fixed `/calculateseatpositions` expecting a locator format that even we don't use. It needs an underscore after "seat".
|
||||
- Fixed the `run_script` Molang function to not fail if the environment's context is null.
|
||||
- Fixed the Molang functions `date_local_time`, `date_of`, `date_is_after` to use the correct date format.
|
||||
|
||||
### Developer
|
||||
- Changed the `owner` parameter in the `OwnerQueryRequirement` interface from `ServerPlayer` to `Player`. This method is now also called on the client to verify whether a Pokémon interaction succeeded, so make sure to update your implementations to handle both server and client contexts.
|
||||
- Added the `pnx` to the `BattleFaintedEvent` and `FormeChangeEvent`.
|
||||
- Added register methods for custom instructions to `ShowdownInterpreter`.
|
||||
- Changed callback operations in `BattlePokemon` to allow multiple callbacks and be mutable.
|
||||
- Added `display_name`, `description`, and `max_pp` functions to the `MoveTemplate` struct.
|
||||
- Changed the implementations of `AIBattleActor` to be open classes to allow extension.
|
||||
- Changed the resource location of Poké Ball icons in the GUI to use the balls namespace instead of Cobblemon's, allowing mods to properly use their own namespace for these textures.
|
||||
|
||||
### Molang & Datapacks
|
||||
- Ride sounds can now be set as exclusive to passengers.
|
||||
- Ride sounds no longer play when submerged unless specified with a new setting.
|
||||
- Exception handling has been added to `run_molang`, resolving some crashes caused by malformed MoLang expressions.
|
||||
- Added the `create_itemstack`, `has_inventory_space`, `set_inventory_slot`, and `give_item` MoLang functions for item and inventory utility.
|
||||
- Added the `get_move_from_id` MoLang function for general move info queries without requiring a Moveset object to access.
|
||||
- Added support for optional message variants in battle activate instructions for more context-specific battle text.
|
||||
- Example: `this.add('-activate', pokemon, 'ability: example', '[msg]message1');` will parse to lang key `cobblemon.battle.activate.example.message1`.
|
||||
|
||||
### Localization
|
||||
- Updated translations for:
|
||||
- French
|
||||
- Canadian French
|
||||
- Simplified Chinese
|
||||
- Ukrainian
|
||||
- Brazilian Portuguese
|
||||
- Spanish
|
||||
- Korean
|
||||
- Japanese
|
||||
@@ -0,0 +1,22 @@
|
||||
# Changelog
|
||||
## [1.7.3 (January 31st, 2026)](#1-7-3)
|
||||
|
||||
### Fixes
|
||||
- Fixed mounted Pokémon not playing sounds.
|
||||
- Fixed players failing to join servers randomly.
|
||||
- Fixed some Pokémon having no stamina for flying.
|
||||
- Fixed `/pctake` not respecting the actual size of the PC.
|
||||
### Developer
|
||||
- Poké Ball GUI textures now respect the ball's namespace, enabling proper texture loading for custom balls from other mods.
|
||||
|
||||
### Molang & Datapacks
|
||||
- Added a `chance` requirement type for Pokémon interactions.
|
||||
|
||||
### Localization
|
||||
- Updated translations for:
|
||||
- French
|
||||
- Canadian French
|
||||
- Korean
|
||||
- Portuguese
|
||||
- Simplified Chinese
|
||||
- Spanish
|
||||
@@ -15,6 +15,8 @@ import com.cobblemon.mod.common.api.events.CobblemonEvents;
|
||||
import com.cobblemon.mod.common.api.events.item.LeftoversCreatedEvent;
|
||||
import com.cobblemon.mod.common.api.orientation.OrientationController;
|
||||
import com.cobblemon.mod.common.api.pokemon.PokemonSpecies;
|
||||
import com.cobblemon.mod.common.api.riding.RidingStyle;
|
||||
import com.cobblemon.mod.common.api.riding.behaviour.types.air.HoverBehaviour;
|
||||
import com.cobblemon.mod.common.api.storage.party.PartyStore;
|
||||
import com.cobblemon.mod.common.api.storage.party.PlayerPartyStore;
|
||||
import com.cobblemon.mod.common.api.tags.CobblemonItemTags;
|
||||
@@ -59,6 +61,7 @@ import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@@ -169,6 +172,32 @@ public abstract class PlayerMixin extends LivingEntity implements ScannableEntit
|
||||
}
|
||||
}
|
||||
|
||||
@Redirect(
|
||||
method = "getDestroySpeed",
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/entity/player/Player;onGround()Z"
|
||||
)
|
||||
)
|
||||
private boolean cobblemon$considerHoverOnGround(Player player) {
|
||||
// If riding a Hover Mount, return true to bypass the 5x slowdown
|
||||
if (player.getVehicle() instanceof PokemonEntity vehicle) {
|
||||
|
||||
var ridingController = vehicle.getRidingController();
|
||||
if (ridingController == null) player.onGround();
|
||||
|
||||
var activeContext = ridingController.getContext();
|
||||
if (activeContext == null) player.onGround();
|
||||
|
||||
if (activeContext.getStyle() == RidingStyle.AIR &&
|
||||
activeContext.getBehaviour().equals(HoverBehaviour.Companion.getKEY())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// Otherwise, return the actual value
|
||||
return player.onGround();
|
||||
}
|
||||
|
||||
@Inject(
|
||||
method = "eat",
|
||||
at = @At(
|
||||
|
||||
@@ -35,6 +35,7 @@ import org.spongepowered.asm.mixin.Unique;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import com.cobblemon.mod.common.client.gui.party.PartyTutorialToasts;
|
||||
|
||||
import static com.google.common.primitives.Floats.min;
|
||||
import static net.minecraft.util.Mth.lerp;
|
||||
@@ -85,11 +86,13 @@ public abstract class MouseHandlerMixin {
|
||||
CobblemonClient.INSTANCE.getStorage().shiftSelected(false);
|
||||
ci.cancel();
|
||||
PartySendBinding.INSTANCE.actioned();
|
||||
PartyTutorialToasts.INSTANCE.onHoldKeyScrollSwitchedSlot();
|
||||
} else if (i < 0) {
|
||||
accumulatedScrollY -= i;
|
||||
CobblemonClient.INSTANCE.getStorage().shiftSelected(true);
|
||||
ci.cancel();
|
||||
PartySendBinding.INSTANCE.actioned();
|
||||
PartyTutorialToasts.INSTANCE.onHoldKeyScrollSwitchedSlot();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -310,7 +313,7 @@ public abstract class MouseHandlerMixin {
|
||||
var playerRotater = (RidePassenger)player;
|
||||
playerRotater.cobblemon$setRideXRot(playerRotater.cobblemon$getRideXRot() + f);
|
||||
playerRotater.cobblemon$setRideYRot(playerRotater.cobblemon$getRideYRot() + g);
|
||||
playerRotater.cobblemon$setRideXRot(Mth.clamp(playerRotater.cobblemon$getRideXRot(), -90.0F, 90.0F));
|
||||
playerRotater.cobblemon$setRideXRot(Mth.clamp(playerRotater.cobblemon$getRideXRot(), -89.0F, 89.0F));
|
||||
playerRotater.cobblemon$setRideYRot(Mth.clamp(playerRotater.cobblemon$getRideYRot(), -105.0F, 105.0F));
|
||||
if (player.getVehicle() != null) {
|
||||
player.getVehicle().onPassengerTurned(player);
|
||||
|
||||
@@ -14,9 +14,14 @@ import com.cobblemon.mod.common.entity.pokemon.PokemonEntity;
|
||||
import com.cobblemon.mod.common.pokemon.Pokemon;
|
||||
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
|
||||
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
|
||||
import com.llamalad7.mixinextras.sugar.Local;
|
||||
import com.llamalad7.mixinextras.sugar.Share;
|
||||
import com.llamalad7.mixinextras.sugar.ref.LocalBooleanRef;
|
||||
import com.llamalad7.mixinextras.sugar.ref.LocalFloatRef;
|
||||
import net.minecraft.client.player.LocalPlayer;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.level.Level;
|
||||
@@ -89,4 +94,61 @@ public abstract class EntityMixin {
|
||||
cir.setReturnValue(customEyePos);
|
||||
}
|
||||
|
||||
|
||||
@WrapOperation(
|
||||
method = "push(Lnet/minecraft/world/entity/Entity;)V",
|
||||
at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/Entity;push(DDD)V", ordinal = 0)
|
||||
)
|
||||
public void cobblemon$customPusherLogic(Entity pusher, double x, double y, double z,
|
||||
Operation<Void> original,
|
||||
@Local(argsOnly = true) Entity pushee,
|
||||
@Local(name = "e") double e, @Local(name = "d") double d,
|
||||
@Share("pusherIsPlayerOrPokemon") LocalBooleanRef pusherIsPlayerOrPokemon,
|
||||
@Share("pusheeIsPlayerOrPokemon") LocalBooleanRef pusheeIsPlayerOrPokemon,
|
||||
@Share("pusheeReceivedForce")LocalFloatRef pusheeReceivedForce) {
|
||||
pusherIsPlayerOrPokemon.set(pusher instanceof PokemonEntity || pusher instanceof Player);
|
||||
pusheeIsPlayerOrPokemon.set(pushee instanceof PokemonEntity || pushee instanceof Player);
|
||||
|
||||
if (!pusheeIsPlayerOrPokemon.get() || !pusherIsPlayerOrPokemon.get()) {
|
||||
original.call(pusher, x, y, z);
|
||||
return;
|
||||
}
|
||||
|
||||
/**********************************************
|
||||
* Custom portion of the code:
|
||||
* Handle collisions with weight in mind. Use
|
||||
* the weight value of pokemon to determine
|
||||
* which side gets what portion of the total
|
||||
* force.
|
||||
*********************************************/
|
||||
// Weights in hectograms
|
||||
// Check to see if the pusher or pushee is a player. 200ish pounds. Steve's like a 6'6 miner
|
||||
var pusherWeight = pusher instanceof PokemonEntity pusherPokemon ? pusherPokemon.getPokemon().getSpecies().getWeight() : 900F;
|
||||
var pusheeWeight = pushee instanceof PokemonEntity pusheePokemon ? pusheePokemon.getPokemon().getSpecies().getWeight() : 900F;
|
||||
|
||||
// Calculate the portion of force received for both entities. Bigger receives less from the
|
||||
// collision than the smaller one.
|
||||
var totalWeight = pusherWeight + pusheeWeight;
|
||||
var pusherReceivedForce = pusheeWeight / totalWeight * 2F;
|
||||
pusheeReceivedForce.set((pusherWeight / totalWeight) * 2F);
|
||||
|
||||
original.call(pusher, -d * pusherReceivedForce, 0.0, -e * pusherReceivedForce);
|
||||
}
|
||||
|
||||
@WrapOperation(
|
||||
method = "push(Lnet/minecraft/world/entity/Entity;)V",
|
||||
at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/Entity;push(DDD)V", ordinal = 1)
|
||||
)
|
||||
public void cobblemon$customPusheeLogic(Entity pusher, double x, double y, double z, Operation<Void> original,
|
||||
@Local(name = "e") double e, @Local(name = "d") double d,
|
||||
@Share("pusherIsPlayerOrPokemon") LocalBooleanRef pusherIsPlayerOrPokemon,
|
||||
@Share("pusheeIsPlayerOrPokemon") LocalBooleanRef pusheeIsPlayerOrPokemon,
|
||||
@Share("pusheeReceivedForce")LocalFloatRef pusheeReceivedForce) {
|
||||
if (!pusheeIsPlayerOrPokemon.get() || !pusherIsPlayerOrPokemon.get()) {
|
||||
original.call(pusher, x, y, z);
|
||||
return;
|
||||
}
|
||||
|
||||
original.call(pusher, d * pusheeReceivedForce.get(), 0.0, e * pusheeReceivedForce.get());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,11 @@ import com.cobblemon.mod.common.api.storage.player.adapter.PlayerDataMongoBacken
|
||||
import com.cobblemon.mod.common.api.storage.player.factory.CachedPlayerDataStoreFactory
|
||||
import com.cobblemon.mod.common.api.tags.CobblemonEntityTypeTags
|
||||
import com.cobblemon.mod.common.api.tags.CobblemonItemTags
|
||||
import com.cobblemon.mod.common.battles.*
|
||||
import com.cobblemon.mod.common.battles.BagItems
|
||||
import com.cobblemon.mod.common.battles.BattleFormat
|
||||
import com.cobblemon.mod.common.battles.BattleRegistry
|
||||
import com.cobblemon.mod.common.battles.BattleSide
|
||||
import com.cobblemon.mod.common.battles.ShowdownThread
|
||||
import com.cobblemon.mod.common.battles.actor.PokemonBattleActor
|
||||
import com.cobblemon.mod.common.battles.pokemon.BattlePokemon
|
||||
import com.cobblemon.mod.common.block.dispenser.DispenserBehaviorRegistry
|
||||
@@ -76,7 +80,12 @@ import com.cobblemon.mod.common.config.LastChangedVersion
|
||||
import com.cobblemon.mod.common.config.constraint.IntConstraint
|
||||
import com.cobblemon.mod.common.config.starter.StarterConfig
|
||||
import com.cobblemon.mod.common.data.CobblemonDataProvider
|
||||
import com.cobblemon.mod.common.events.*
|
||||
import com.cobblemon.mod.common.events.AdvancementHandler
|
||||
import com.cobblemon.mod.common.events.CallbackHandler
|
||||
import com.cobblemon.mod.common.events.EntityCallbackHandler
|
||||
import com.cobblemon.mod.common.events.PokedexHandler
|
||||
import com.cobblemon.mod.common.events.ServerTickHandler
|
||||
import com.cobblemon.mod.common.events.StatHandler
|
||||
import com.cobblemon.mod.common.net.messages.client.settings.ServerSettingsPacket
|
||||
import com.cobblemon.mod.common.permission.LaxPermissionValidator
|
||||
import com.cobblemon.mod.common.platform.events.PlatformEvents
|
||||
@@ -90,11 +99,23 @@ import com.cobblemon.mod.common.pokemon.feature.SlowpokeTailRegrowthSpeciesFeatu
|
||||
import com.cobblemon.mod.common.pokemon.feature.SlowpokeTailRegrowthSpeciesFeatureProvider
|
||||
import com.cobblemon.mod.common.pokemon.feature.TagSeasonResolver
|
||||
import com.cobblemon.mod.common.pokemon.helditem.CobblemonHeldItemManager
|
||||
import com.cobblemon.mod.common.pokemon.properties.*
|
||||
import com.cobblemon.mod.common.pokemon.properties.AspectPropertyType
|
||||
import com.cobblemon.mod.common.pokemon.properties.BattleCloneProperty
|
||||
import com.cobblemon.mod.common.pokemon.properties.FreezeFrameProperty
|
||||
import com.cobblemon.mod.common.pokemon.properties.HiddenAbilityPropertyType
|
||||
import com.cobblemon.mod.common.pokemon.properties.LabelProperty
|
||||
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.stat.CobblemonStatProvider
|
||||
import com.cobblemon.mod.common.starter.CobblemonStarterHandler
|
||||
import com.cobblemon.mod.common.util.*
|
||||
import com.cobblemon.mod.common.util.DataKeys
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import com.cobblemon.mod.common.util.ifDedicatedServer
|
||||
import com.cobblemon.mod.common.util.isLaterVersion
|
||||
import com.cobblemon.mod.common.util.party
|
||||
import com.cobblemon.mod.common.util.requestWallpapers
|
||||
import com.cobblemon.mod.common.util.server
|
||||
import com.cobblemon.mod.common.world.feature.CobblemonPlacedFeatures
|
||||
import com.cobblemon.mod.common.world.feature.ore.CobblemonOrePlacedFeatures
|
||||
import com.cobblemon.mod.common.world.gamerules.CobblemonGameRules
|
||||
@@ -102,6 +123,17 @@ import com.mongodb.ConnectionString
|
||||
import com.mongodb.MongoClientSettings
|
||||
import com.mongodb.client.MongoClient
|
||||
import com.mongodb.client.MongoClients
|
||||
import java.io.File
|
||||
import java.io.FileReader
|
||||
import java.io.FileWriter
|
||||
import java.io.PrintWriter
|
||||
import java.util.UUID
|
||||
import java.util.concurrent.TimeUnit
|
||||
import kotlin.math.roundToInt
|
||||
import kotlin.properties.Delegates
|
||||
import kotlin.reflect.full.memberProperties
|
||||
import kotlin.reflect.jvm.isAccessible
|
||||
import kotlin.reflect.jvm.javaField
|
||||
import net.minecraft.client.Minecraft
|
||||
import net.minecraft.commands.synchronization.SingletonArgumentInfo
|
||||
import net.minecraft.resources.ResourceKey
|
||||
@@ -114,17 +146,6 @@ import net.minecraft.world.level.Level
|
||||
import net.minecraft.world.level.storage.LevelResource
|
||||
import org.apache.logging.log4j.LogManager
|
||||
import org.apache.logging.log4j.Logger
|
||||
import java.io.File
|
||||
import java.io.FileReader
|
||||
import java.io.FileWriter
|
||||
import java.io.PrintWriter
|
||||
import java.util.*
|
||||
import java.util.concurrent.TimeUnit
|
||||
import kotlin.math.roundToInt
|
||||
import kotlin.properties.Delegates
|
||||
import kotlin.reflect.full.memberProperties
|
||||
import kotlin.reflect.jvm.isAccessible
|
||||
import kotlin.reflect.jvm.javaField
|
||||
|
||||
object Cobblemon {
|
||||
const val MODID = CobblemonBuildDetails.MOD_ID
|
||||
@@ -165,7 +186,7 @@ object Cobblemon {
|
||||
val statistics: CobblemonStats = CobblemonStats
|
||||
|
||||
@JvmStatic
|
||||
val builtinPacks = listOf<CobblemonPack>(
|
||||
val builtinPacks = listOf(
|
||||
CobblemonPack(id = "adorncompatibility", name = "Adorn Compatibility", packType = PackType.CLIENT_RESOURCES, activationBehaviour = ResourcePackActivationBehaviour.ALWAYS_ENABLED, neededMods = setOf("adorn")),
|
||||
CobblemonPack(id = "gyaradosjump", name = "Gyarados Jump Patterns", packType = PackType.CLIENT_RESOURCES, activationBehaviour = ResourcePackActivationBehaviour.DEFAULT_ENABLED),
|
||||
CobblemonPack(id = "regionbiasforms", name = "Region Bias Forms", packType = PackType.CLIENT_RESOURCES, activationBehaviour = ResourcePackActivationBehaviour.DEFAULT_ENABLED),
|
||||
@@ -451,7 +472,7 @@ object Cobblemon {
|
||||
server()?.getLevel(dimension)
|
||||
} else {
|
||||
val mc = Minecraft.getInstance()
|
||||
return mc.singleplayerServer?.getLevel(dimension) ?: mc.level
|
||||
mc.singleplayerServer?.getLevel(dimension) ?: mc.level
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,12 +21,15 @@ import com.cobblemon.mod.common.client.net.callback.partymove.OpenPartyMoveCallb
|
||||
import com.cobblemon.mod.common.client.net.cooking.ToggleCookingPotLidHandler
|
||||
import com.cobblemon.mod.common.client.net.data.CobblemonMechanicsSyncHandler
|
||||
import com.cobblemon.mod.common.client.net.data.DataRegistrySyncPacketHandler
|
||||
import com.cobblemon.mod.common.client.net.data.PokemonInteractionsSyncHandler
|
||||
import com.cobblemon.mod.common.client.net.data.RideSettingsSyncHandler
|
||||
import com.cobblemon.mod.common.client.net.debug.OpenRidingStatsDebugGUIHandler
|
||||
import com.cobblemon.mod.common.client.net.dialogue.DialogueClosedHandler
|
||||
import com.cobblemon.mod.common.client.net.dialogue.DialogueOpenedHandler
|
||||
import com.cobblemon.mod.common.client.net.effect.*
|
||||
import com.cobblemon.mod.common.client.net.effect.PokeSnackBlockParticlesHandler
|
||||
import com.cobblemon.mod.common.client.net.effect.RunPosableMoLangHandler
|
||||
import com.cobblemon.mod.common.client.net.effect.SaccharineLogBlockParticlesHandler
|
||||
import com.cobblemon.mod.common.client.net.effect.SpawnSnowstormEntityParticleHandler
|
||||
import com.cobblemon.mod.common.client.net.effect.SpawnSnowstormParticleHandler
|
||||
import com.cobblemon.mod.common.client.net.gui.ExpGainedDataPacketHandler
|
||||
import com.cobblemon.mod.common.client.net.gui.InteractPokemonUIPacketHandler
|
||||
import com.cobblemon.mod.common.client.net.gui.PokedexUIPacketHandler
|
||||
@@ -34,7 +37,11 @@ import com.cobblemon.mod.common.client.net.gui.SummaryUIPacketHandler
|
||||
import com.cobblemon.mod.common.client.net.npc.CloseNPCEditorHandler
|
||||
import com.cobblemon.mod.common.client.net.npc.OpenNPCEditorHandler
|
||||
import com.cobblemon.mod.common.client.net.orientation.ClientboundUpdateOrientationHandler
|
||||
import com.cobblemon.mod.common.client.net.pasture.*
|
||||
import com.cobblemon.mod.common.client.net.pasture.ClosePastureHandler
|
||||
import com.cobblemon.mod.common.client.net.pasture.OpenPastureHandler
|
||||
import com.cobblemon.mod.common.client.net.pasture.PokemonPasturedHandler
|
||||
import com.cobblemon.mod.common.client.net.pasture.PokemonUnpasturedHandler
|
||||
import com.cobblemon.mod.common.client.net.pasture.UpdatePastureConflictFlagHandler
|
||||
import com.cobblemon.mod.common.client.net.pokedex.ServerConfirmedRegisterHandler
|
||||
import com.cobblemon.mod.common.client.net.pokemon.update.ClientboundUpdateRidingStateHandler
|
||||
import com.cobblemon.mod.common.client.net.pokemon.update.PokemonUpdatePacketHandler
|
||||
@@ -52,7 +59,14 @@ import com.cobblemon.mod.common.client.net.storage.party.SetPartyPokemonHandler
|
||||
import com.cobblemon.mod.common.client.net.storage.party.SetPartyReferenceHandler
|
||||
import com.cobblemon.mod.common.client.net.storage.pc.*
|
||||
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.TradeProcessStartedHandler
|
||||
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.CalculateSeatPositionsPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.OpenBehaviourEditorPacket
|
||||
@@ -69,12 +83,20 @@ import com.cobblemon.mod.common.net.messages.client.data.*
|
||||
import com.cobblemon.mod.common.net.messages.client.debug.RequestOpenRidingStatsDebugGUIPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.dialogue.DialogueClosedPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.dialogue.DialogueOpenedPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.effect.*
|
||||
import com.cobblemon.mod.common.net.messages.client.effect.PokeSnackBlockParticlesPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.effect.RunPosableMoLangPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.effect.SaccharineLogBlockParticlesPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.effect.SpawnSnowstormEntityParticlePacket
|
||||
import com.cobblemon.mod.common.net.messages.client.effect.SpawnSnowstormParticlePacket
|
||||
import com.cobblemon.mod.common.net.messages.client.npc.CloseNPCEditorPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.npc.OpenNPCEditorPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.orientation.ClientboundUpdateDriverInputPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.orientation.ClientboundUpdateOrientationPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.pasture.*
|
||||
import com.cobblemon.mod.common.net.messages.client.pasture.ClosePasturePacket
|
||||
import com.cobblemon.mod.common.net.messages.client.pasture.OpenPasturePacket
|
||||
import com.cobblemon.mod.common.net.messages.client.pasture.PokemonPasturedPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.pasture.PokemonUnpasturedPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.pasture.UpdatePastureConflictFlagPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.pokedex.ServerConfirmedRegisterPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.pokemon.update.*
|
||||
import com.cobblemon.mod.common.net.messages.client.pokemon.update.evolution.AddEvolutionPacket
|
||||
@@ -94,19 +116,37 @@ import com.cobblemon.mod.common.net.messages.client.storage.party.InitializePart
|
||||
import com.cobblemon.mod.common.net.messages.client.storage.party.MoveClientPartyPokemonPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.storage.party.SetPartyPokemonPacket
|
||||
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.storage.pc.ClosePCPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.storage.pc.InitializePCPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.storage.pc.MoveClientPCPokemonPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.storage.pc.OpenPCPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.storage.pc.RenamePCBoxPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.storage.pc.SetPCBoxPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.storage.pc.SetPCPokemonPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.storage.pc.wallpaper.ChangePCBoxWallpaperPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.storage.pc.wallpaper.RequestPCBoxWallpapersPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.storage.pc.wallpaper.SetPCBoxWallpapersPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.storage.pc.wallpaper.UnlockPCBoxWallpaperPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.toast.ToastPacket
|
||||
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.TradeOfferExpiredPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.trade.TradeOfferNotificationPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.trade.TradeProcessStartedPacket
|
||||
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.ExpGainedDataPacket
|
||||
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
|
||||
import com.cobblemon.mod.common.net.messages.server.*
|
||||
import com.cobblemon.mod.common.net.messages.server.battle.*
|
||||
import com.cobblemon.mod.common.net.messages.server.battle.BattleSelectActionsPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.battle.BattleTeamLeavePacket
|
||||
import com.cobblemon.mod.common.net.messages.server.battle.BattleTeamRequestPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.battle.BattleTeamResponsePacket
|
||||
import com.cobblemon.mod.common.net.messages.server.battle.RemoveSpectatorPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.battle.SpectateBattlePacket
|
||||
import com.cobblemon.mod.common.net.messages.server.behaviour.DamageOnCollisionPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.behaviour.SetEntityBehaviourPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.block.AdjustBlockEntityViewerCountPacket
|
||||
@@ -131,7 +171,11 @@ import com.cobblemon.mod.common.net.messages.server.pasture.UnpasturePokemonPack
|
||||
import com.cobblemon.mod.common.net.messages.server.pokedex.scanner.FinishScanningPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.pokedex.scanner.StartScanningPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.pokemon.interact.InteractPokemonPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.pokemon.update.*
|
||||
import com.cobblemon.mod.common.net.messages.server.pokemon.update.ServerboundUpdateRidingStatePacket
|
||||
import com.cobblemon.mod.common.net.messages.server.pokemon.update.SetActiveMarkPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.pokemon.update.SetItemHiddenPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.pokemon.update.SetMarkingsPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.pokemon.update.SetNicknamePacket
|
||||
import com.cobblemon.mod.common.net.messages.server.pokemon.update.evolution.AcceptEvolutionPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.riding.DismountPokemonPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.riding.ServerboundUpdateDriverInputPacket
|
||||
@@ -139,14 +183,25 @@ import com.cobblemon.mod.common.net.messages.server.riding.ServerboundUpdateRide
|
||||
import com.cobblemon.mod.common.net.messages.server.starter.RequestStarterScreenPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.storage.SwapPCPartyPokemonPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.storage.party.MovePartyPokemonPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.storage.party.PartyTutorialPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.storage.party.ReleasePartyPokemonPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.storage.party.SwapPartyPokemonPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.storage.pc.*
|
||||
import com.cobblemon.mod.common.net.messages.server.trade.*
|
||||
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.PerformTradePacket
|
||||
import com.cobblemon.mod.common.net.messages.server.trade.UpdateTradeOfferPacket
|
||||
import com.cobblemon.mod.common.net.serverhandling.ChallengeHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.ChallengeResponseHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.RequestInteractionsHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.battle.*
|
||||
import com.cobblemon.mod.common.net.serverhandling.battle.BattleSelectActionsHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.battle.RemoveSpectatorHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.battle.SpectateBattleHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.battle.TeamLeaveHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.battle.TeamRequestHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.battle.TeamRequestResponseHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.behaviour.DamageOnCollisionPacketHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.behaviour.SetEntityBehaviourHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.block.AdjustBlockEntityViewerCountHandler
|
||||
@@ -165,6 +220,7 @@ import com.cobblemon.mod.common.net.serverhandling.dialogue.InputToDialogueHandl
|
||||
import com.cobblemon.mod.common.net.serverhandling.evolution.AcceptEvolutionHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.npc.SaveNPCHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.orientation.ServerboundUpdateOrientationHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.storage.party.PartyTutorialPacketHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.pasture.PasturePokemonHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.pasture.SetPastureConflictHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.pasture.UnpastureAllPokemonHandler
|
||||
@@ -172,7 +228,11 @@ import com.cobblemon.mod.common.net.serverhandling.pasture.UnpasturePokemonHandl
|
||||
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.pokemon.interact.InteractPokemonHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.pokemon.update.*
|
||||
import com.cobblemon.mod.common.net.serverhandling.pokemon.update.ServerboundUpdateRidingStateHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.pokemon.update.SetActiveMarkHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.pokemon.update.SetItemHiddenHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.pokemon.update.SetMarkingsHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.pokemon.update.SetNicknameHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.riding.DismountPokemonPacketHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.riding.DriverInputPacketHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.riding.ServerboundUpdateRiderRotationHandler
|
||||
@@ -186,7 +246,12 @@ import com.cobblemon.mod.common.net.serverhandling.storage.party.MovePartyPokemo
|
||||
import com.cobblemon.mod.common.net.serverhandling.storage.party.ReleasePCPokemonHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.storage.party.SwapPartyPokemonHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.storage.pc.*
|
||||
import com.cobblemon.mod.common.net.serverhandling.trade.*
|
||||
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.PerformTradeHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.trade.UpdateTradeOfferHandler
|
||||
import com.cobblemon.mod.common.util.server
|
||||
import net.minecraft.server.level.ServerPlayer
|
||||
|
||||
@@ -332,7 +397,7 @@ object CobblemonNetwork {
|
||||
// Data registries
|
||||
list.add(PacketRegisterInfo(AbilityRegistrySyncPacket.ID, AbilityRegistrySyncPacket::decode, DataRegistrySyncPacketHandler()))
|
||||
list.add(PacketRegisterInfo(CobblemonMechanicsSyncPacket.ID, CobblemonMechanicsSyncPacket::decode, CobblemonMechanicsSyncHandler))
|
||||
list.add(PacketRegisterInfo(PokemonInteractionsSyncPacket.ID, PokemonInteractionsSyncPacket::decode, PokemonInteractionsSyncHandler))
|
||||
list.add(PacketRegisterInfo(PokemonInteractionsSyncPacket.ID, PokemonInteractionsSyncPacket::decode, DataRegistrySyncPacketHandler()))
|
||||
list.add(PacketRegisterInfo(MovesRegistrySyncPacket.ID, MovesRegistrySyncPacket::decode, DataRegistrySyncPacketHandler()))
|
||||
list.add(PacketRegisterInfo(BerryRegistrySyncPacket.ID, BerryRegistrySyncPacket::decode, DataRegistrySyncPacketHandler()))
|
||||
list.add(PacketRegisterInfo(SpeciesRegistrySyncPacket.ID, SpeciesRegistrySyncPacket::decode, DataRegistrySyncPacketHandler()))
|
||||
@@ -460,7 +525,7 @@ object CobblemonNetwork {
|
||||
list.add(PacketRegisterInfo(ReleasePCPokemonPacket.ID, ReleasePCPokemonPacket::decode, ReleasePCPokemonHandler))
|
||||
list.add(PacketRegisterInfo(UnlinkPlayerFromPCPacket.ID, UnlinkPlayerFromPCPacket::decode, UnlinkPlayerFromPCHandler))
|
||||
|
||||
list.add(PacketRegisterInfo(RequestRenamePCBoxPacket.Companion.ID, RequestRenamePCBoxPacket.Companion::decode, RequestRenamePCBoxHandler))
|
||||
list.add(PacketRegisterInfo(RequestRenamePCBoxPacket.ID, RequestRenamePCBoxPacket::decode, RequestRenamePCBoxHandler))
|
||||
list.add(PacketRegisterInfo(PCBoxWallpapersPacket.ID, PCBoxWallpapersPacket::decode, PCBoxWallpapersHandler))
|
||||
list.add(PacketRegisterInfo(RequestChangePCBoxWallpaperPacket.ID, RequestChangePCBoxWallpaperPacket::decode, RequestChangePCBoxWallpaperHandler))
|
||||
list.add(PacketRegisterInfo(MarkPCBoxWallpapersSeenPacket.ID, MarkPCBoxWallpapersSeenPacket::decode, MarkPCBoxWallpapersSeenHandler))
|
||||
@@ -518,6 +583,9 @@ object CobblemonNetwork {
|
||||
list.add(PacketRegisterInfo(PartyPokemonMoveSelectedPacket.ID, PartyPokemonMoveSelectedPacket::decode, PartyPokemonMoveSelectedHandler))
|
||||
list.add(PacketRegisterInfo(PartyMoveSelectCancelledPacket.ID, PartyMoveSelectCancelledPacket::decode, PartyMoveSelectCancelledHandler))
|
||||
|
||||
//Party move tutorial toasts packets
|
||||
list.add(PacketRegisterInfo(PartyTutorialPacket.ID, PartyTutorialPacket::decode, PartyTutorialPacketHandler))
|
||||
|
||||
// Dialogue packets
|
||||
list.add(PacketRegisterInfo(EscapeDialoguePacket.ID, EscapeDialoguePacket::decode, EscapeDialogueHandler))
|
||||
list.add(PacketRegisterInfo(InputToDialoguePacket.ID, InputToDialoguePacket::decode, InputToDialogueHandler))
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.cobblemon.mod.common.api.molang.MoLangFunctions.asMostSpecificMoLangV
|
||||
import com.cobblemon.mod.common.entity.OmniPathingEntity
|
||||
import com.cobblemon.mod.common.entity.ai.CobblemonRandomSurfacePos
|
||||
import com.cobblemon.mod.common.entity.ai.CobblemonWalkTarget
|
||||
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
|
||||
import com.cobblemon.mod.common.util.asExpression
|
||||
import com.cobblemon.mod.common.util.mainThreadRuntime
|
||||
import com.cobblemon.mod.common.util.resolveFloat
|
||||
@@ -184,6 +185,12 @@ class WanderTaskConfig : SingleTaskConfig {
|
||||
|
||||
if (targetVec == null) continue
|
||||
|
||||
// Ignore pathing targets outside of the pasture zone if the pokemon is pastured.
|
||||
val tethering = (entity as? PokemonEntity)?.tethering
|
||||
if (tethering?.canRoamTo(BlockPos.containing(targetVec)) == false) {
|
||||
continue
|
||||
}
|
||||
|
||||
pos = applyHeightConstraints(
|
||||
pos = BlockPos.containing(targetVec),
|
||||
minimumHeight = minimumHeight,
|
||||
|
||||
@@ -59,40 +59,32 @@ object PokemonInteractions : JsonDataRegistry<PokemonInteractionSet> {
|
||||
.setPrettyPrinting()
|
||||
.create()
|
||||
|
||||
val speciesInteractions = mutableListOf<PokemonInteractionSet>()
|
||||
val generalInteractions = mutableListOf<PokemonInteractionSet>()
|
||||
val interactions = mutableListOf<PokemonInteractionSet>()
|
||||
|
||||
override fun sync(player: ServerPlayer) {
|
||||
PokemonInteractionsSyncPacket(
|
||||
speciesInteractions,
|
||||
generalInteractions,
|
||||
).sendToPlayer(player)
|
||||
PokemonInteractionsSyncPacket(interactions).sendToPlayer(player)
|
||||
}
|
||||
|
||||
override fun reload(data: Map<ResourceLocation, PokemonInteractionSet>) {
|
||||
speciesInteractions.clear()
|
||||
generalInteractions.clear()
|
||||
val split = data.entries.partition { it.value.requirements.any { requirement -> requirement is PokemonPropertiesRequirement && requirement.target.species != null } }
|
||||
speciesInteractions.addAll(split.first.map {it.value})
|
||||
generalInteractions.addAll(split.second.map {it.value})
|
||||
Cobblemon.LOGGER.info("Loaded {} Pokémon interaction sets", data.size)
|
||||
interactions.clear()
|
||||
val split = data.entries
|
||||
.partition {
|
||||
it.value.requirements.any { requirement -> requirement is PokemonPropertiesRequirement && requirement.target.species != null }
|
||||
}
|
||||
|
||||
// Put the species specific interactions first as they take priority
|
||||
interactions.addAll(split.first.map {it.value})
|
||||
interactions.addAll(split.second.map {it.value})
|
||||
|
||||
Cobblemon.LOGGER.info("Loaded {} Pokémon interaction sets", interactions.size)
|
||||
}
|
||||
|
||||
fun findInteraction(pokemon: PokemonEntity): PokemonInteraction? {
|
||||
val setCheck: (PokemonInteractionSet) -> Boolean = { it.requirements.all { req -> req.check(pokemon.pokemon) }}
|
||||
val interactionCheck: (PokemonInteraction) -> Boolean = { it.requirements.all { req -> req.check(pokemon.pokemon) } && !pokemon.pokemon.isOnInteractionCooldown(it.grouping) }
|
||||
// species-specific interactions take priority
|
||||
val validInteractions = speciesInteractions
|
||||
return interactions
|
||||
.filter(setCheck)
|
||||
.flatMap { it.interactions }
|
||||
.filter(interactionCheck)
|
||||
.toMutableList()
|
||||
if (validInteractions.isEmpty()) { // if all species-specific interactions are absent/on cooldown, fallback to more generic ones
|
||||
validInteractions.addAll(generalInteractions.filter(setCheck).flatMap { it.interactions }
|
||||
.filter(interactionCheck)
|
||||
)
|
||||
}
|
||||
|
||||
return validInteractions.randomOrNull()
|
||||
.firstOrNull(interactionCheck)
|
||||
}
|
||||
}
|
||||
@@ -43,17 +43,9 @@ data class PokemonInteractionSet(
|
||||
|
||||
companion object {
|
||||
fun decode(buffer: FriendlyByteBuf): PokemonInteractionSet {
|
||||
val requirements = buffer.readList { it ->
|
||||
CobblemonRequirementAdapter.decode(it)
|
||||
}
|
||||
val interactions = buffer.readList { it ->
|
||||
PokemonInteraction.decode(it)
|
||||
}
|
||||
|
||||
return PokemonInteractionSet(
|
||||
requirements,
|
||||
interactions,
|
||||
)
|
||||
val requirements = buffer.readList(CobblemonRequirementAdapter::decode)
|
||||
val interactions = buffer.readList(PokemonInteraction::decode)
|
||||
return PokemonInteractionSet(requirements, interactions)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,6 +145,7 @@ import net.minecraft.world.entity.item.ItemEntity
|
||||
import net.minecraft.world.entity.monster.Monster
|
||||
import net.minecraft.world.entity.player.Player
|
||||
import net.minecraft.world.item.ItemStack
|
||||
import net.minecraft.world.item.enchantment.EnchantmentHelper
|
||||
import net.minecraft.world.level.ClipContext
|
||||
import net.minecraft.world.level.GameType
|
||||
import net.minecraft.world.level.Level
|
||||
@@ -871,6 +872,8 @@ object MoLangFunctions {
|
||||
|
||||
DoubleValue(value)
|
||||
}
|
||||
map.put("get_starter_uuid") { _ -> Cobblemon.playerDataManager.getGenericData(player).starterUUID?.let{ StringValue(it.toString()) } ?: DoubleValue.ZERO }
|
||||
map.put("has_chosen_starter") { _ -> DoubleValue(Cobblemon.playerDataManager.getGenericData(player).starterSelected) }
|
||||
}
|
||||
map
|
||||
}
|
||||
@@ -891,6 +894,15 @@ object MoLangFunctions {
|
||||
map.put("is_of") { params -> DoubleValue(holder.`is`(params.getString(0).asIdentifierDefaultingNamespace())) }
|
||||
map.put("is_in") { params -> DoubleValue(holder.`is`(TagKey.create(Registries.ITEM, params.getString(0).replace("#", "").asIdentifierDefaultingNamespace()))) }
|
||||
map.put("is_food") { params -> DoubleValue(stack.has(DataComponents.FOOD)) }
|
||||
map.put("is_enchanted") { params -> DoubleValue(stack.hasFoil()) }
|
||||
map.put("has_enchantment") { params ->
|
||||
val enchantmentId = params.getString(0).asIdentifierDefaultingNamespace()
|
||||
val minLevel = params.getIntOrNull(1) ?: 1
|
||||
val enchantmentRegistry = registryAccess.registryOrThrow(Registries.ENCHANTMENT)
|
||||
val holder = enchantmentRegistry.getHolder(enchantmentId).orElse(null) ?: return@put DoubleValue.ZERO
|
||||
val level = EnchantmentHelper.getItemEnchantmentLevel(holder, stack)
|
||||
return@put DoubleValue(level >= minLevel)
|
||||
}
|
||||
return@mutableListOf map
|
||||
}
|
||||
)
|
||||
@@ -2815,8 +2827,8 @@ object MoLangFunctions {
|
||||
}
|
||||
variable
|
||||
}
|
||||
else -> null
|
||||
} ?: throw IllegalArgumentException("Invalid NBT element type: ${nbt.type}")
|
||||
else -> VariableStruct()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -119,7 +119,10 @@ class RidingController(
|
||||
private fun canTransitionToLand(): Boolean {
|
||||
if ((entity.isUnderWater)) return false
|
||||
if ((entity.isEyeInFluid(FluidTags.WATER) || entity.isEyeInFluid(FluidTags.LAVA))) return false
|
||||
return entity.onGround()
|
||||
// If the currently in the air but has no land style then don't transition and render the ride useless.
|
||||
// Hover is a good example for this.
|
||||
val shouldStayInAir = entity.pokemon.riding.behaviours?.get(RidingStyle.LAND) == null && context?.style == RidingStyle.AIR
|
||||
return entity.onGround() && !shouldStayInAir
|
||||
}
|
||||
|
||||
private fun canTransitionToLiquid(): Boolean {
|
||||
|
||||
@@ -213,10 +213,23 @@ class HoverBehaviour : RidingBehaviour<HoverSettings, HoverState> {
|
||||
val accel = topSpeed / (vehicle.runtime.resolveDouble(settings.accelerationExpr ?: globalHover.accelerationExpr!!) * 20.0)
|
||||
|
||||
var newVelocity = state.rideVelocity.get()
|
||||
val unrotateVel = vehicle.deltaMovement.yRot(vehicle.yRot)
|
||||
|
||||
val vehicleFrontVec = Vec3(0.0, 0.0, 1.0)
|
||||
val faceVel = Vec3(vehicle.deltaMovement.x, 0.0, vehicle.deltaMovement.z)
|
||||
|
||||
val d = vehicle.deltaMovement.horizontalDistance()
|
||||
val v2 = Vec3(faceVel.dot(Vec3(1.0, 0.0, 0.0)) * d, newVelocity.y, faceVel.dot(Vec3(0.0, 0.0, 1.0)) * d)
|
||||
|
||||
// Check for collisions and if found, update the speed to reflect it
|
||||
if (vehicle.verticalCollision || vehicle.horizontalCollision) {
|
||||
state.speed.set(vehicle.deltaMovement.length())
|
||||
if (vehicle.horizontalCollision) {
|
||||
val smackingIntoWallSpeed = max( vehicle.deltaMovement.horizontalDistance(), 0.2)
|
||||
newVelocity = Vec3(newVelocity.x, 0.0, newVelocity.z).normalize().scale(smackingIntoWallSpeed).add(0.0, newVelocity.y, 0.0)
|
||||
}
|
||||
|
||||
|
||||
if (vehicle.verticalCollision) {
|
||||
newVelocity = Vec3(newVelocity.x, 0.0, newVelocity.z)
|
||||
}
|
||||
|
||||
// align the velocity vector to be in local vehicle space
|
||||
|
||||
@@ -60,7 +60,7 @@ class SubmarineBehaviour : RidingBehaviour<SubmarineSettings, SubmarineState> {
|
||||
val poseProvider = PoseProvider<SubmarineSettings, SubmarineState>(PoseType.FLOAT)
|
||||
.with(PoseOption(PoseType.SWIM) { _, state, entity -> state.rideVelocity.get().z > 0.05 && !state.onSurface.get()})
|
||||
.with(PoseOption(PoseType.STAND) { _, state, entity -> state.rideVelocity.get().z <= 0.05 && state.onSurface.get()})
|
||||
.with(PoseOption(PoseType.STAND) { _, state, entity -> state.rideVelocity.get().z > 0.05 && state.onSurface.get()})
|
||||
.with(PoseOption(PoseType.SWIM) { _, state, entity -> state.rideVelocity.get().z > 0.05 && state.onSurface.get()})
|
||||
|
||||
override fun isActive(settings: SubmarineSettings, state: SubmarineState, vehicle: PokemonEntity): Boolean {
|
||||
return vehicle.isInWater || !vehicle.onGround()
|
||||
@@ -191,11 +191,17 @@ class SubmarineBehaviour : RidingBehaviour<SubmarineSettings, SubmarineState> {
|
||||
* Calculate Forward Velocity
|
||||
*********************************************/
|
||||
val currZVel = state.rideVelocity.get().z
|
||||
val newZVel = when {
|
||||
var newZVel = when {
|
||||
driver.zza > 0.0 -> min(topSpeed, currZVel + accel)
|
||||
driver.zza < 0.0 -> max( -strafeSpeed, currZVel - strafeAccel) //TODO: Might need to be applied in addition to the normal braking force?
|
||||
else -> lerp(currZVel, 0.0, 0.05)
|
||||
driver.zza < 0.0 -> max( -strafeSpeed, currZVel - strafeAccel)
|
||||
else -> lerp(currZVel, 0.0, 0.02)
|
||||
}
|
||||
|
||||
// If trying to brake then add the friction to the braking force
|
||||
if (driver.zza != 0.0f && driver.zza.sign.toDouble() != newZVel.sign) {
|
||||
newZVel = lerp(newZVel, 0.0, 0.02)
|
||||
}
|
||||
|
||||
currVel = Vec3(currVel.x, currVel.y, newZVel)
|
||||
|
||||
/*********************************************
|
||||
@@ -206,14 +212,20 @@ class SubmarineBehaviour : RidingBehaviour<SubmarineSettings, SubmarineState> {
|
||||
val gravity = (9.8 / ( 20.0)) * 0.2 * 0.4
|
||||
val terminalYVel = 2.0
|
||||
val driverYInput = if(driver.jumping) 1.0 else if (driver.isShiftKeyDown) -1.0 else 0.0
|
||||
val newYVel = when {
|
||||
var newYVel = when {
|
||||
(!vehicle.isInWater) -> max(-terminalYVel, currYVel - gravity)
|
||||
//(vehicle.isInWater && !vehicle.isUnderWater && currYVel > 0.001) -> lerp(currYVel, 0.0, 0.1) // Make sure that yVel is above a threshold before doing this otherwise it'll block submerging.
|
||||
//driverYInput != 0.0 && currYVel > 0.001 && driverYInput.sign != currYVel.sign -> lerp(currYVel, 0.0, 0.05)
|
||||
driverYInput > 0.0 -> min(vertTopSpeed, currYVel + strafeAccel)
|
||||
driverYInput < 0.0 -> max(-vertTopSpeed, currYVel - strafeAccel)
|
||||
else -> lerp(currYVel, 0.0, 0.05)
|
||||
else -> lerp(currYVel, 0.0, 0.02)
|
||||
}
|
||||
|
||||
// If trying to brake then add the friction to the braking force
|
||||
if (driverYInput != 0.0 && driverYInput != newYVel.sign) {
|
||||
newYVel = lerp(newYVel, 0.0, 0.02)
|
||||
}
|
||||
|
||||
currVel = Vec3(currVel.x, newYVel, currVel.z)
|
||||
|
||||
/*********************************************
|
||||
@@ -221,11 +233,17 @@ class SubmarineBehaviour : RidingBehaviour<SubmarineSettings, SubmarineState> {
|
||||
*********************************************/
|
||||
val currXVel = state.rideVelocity.get().x
|
||||
val horzTopSpeed = strafeSpeed
|
||||
val newXVel = when {
|
||||
var newXVel = when {
|
||||
driver.xxa > 0.0 -> min(horzTopSpeed, currXVel + strafeAccel)
|
||||
driver.xxa < 0.0 -> max( -horzTopSpeed, currXVel - strafeAccel)
|
||||
else -> lerp(currXVel, 0.0, 0.01)
|
||||
else -> lerp(currXVel, 0.0, 0.02)
|
||||
}
|
||||
|
||||
// If trying to brake then add the friction to the braking force
|
||||
if (driver.xxa != 0.0f && driver.xxa.sign.toDouble() != newZVel.sign) {
|
||||
newXVel = lerp(newXVel, 0.0, 0.02)
|
||||
}
|
||||
|
||||
currVel = Vec3(newXVel, currVel.y, currVel.z)
|
||||
|
||||
// Set the new velocity
|
||||
@@ -305,81 +323,6 @@ class SubmarineBehaviour : RidingBehaviour<SubmarineSettings, SubmarineState> {
|
||||
|
||||
}
|
||||
|
||||
private fun correctOrientation(
|
||||
settings: SubmarineSettings,
|
||||
state: SubmarineState,
|
||||
vehicle: PokemonEntity,
|
||||
controller: OrientationController,
|
||||
driver: Player,
|
||||
deltaTime: Double
|
||||
) {
|
||||
|
||||
// TODO: remove if not needed
|
||||
|
||||
// // Calculate correcting roll force.
|
||||
// // If the ride is moving then have the correction rate be an equal proportion of:
|
||||
// // - how rolled are you
|
||||
// // - how long has it been since last mouse input (higher is stronger correction)
|
||||
// // Also the correction is proportional as a whole to how NOT pitched are you so you don't spin endlessly when looking up or down
|
||||
// val howRolledAmI = sqrt(abs((cos(controller.roll.toRadians()) - 1.0f) * 0.5f)) // sqrt so it trends towards one pretty quickly
|
||||
// val maxRollCorrectionRate =
|
||||
// if (state.rideVelocity.get().length() < 0.2) 10.0f * abs(cos(controller.pitch.toRadians()))
|
||||
// else 10.0f * cos(controller.pitch.toRadians()).pow(2) * (
|
||||
// howRolledAmI*1.0f +
|
||||
// (state.noInputTime.get() - rollCorrectionTimer).coerceIn(0.0, 1.0).pow(2).toFloat()*0.5f
|
||||
// )
|
||||
// val maxRollForce = maxRollCorrectionRate / 40.0f
|
||||
// val rollArrivalDeg = 60.0f
|
||||
// val desiredRoll = 0.0f
|
||||
//
|
||||
// // Calculate the signed error (how far and in what direction)
|
||||
// val rollError = Mth.wrapDegrees(desiredRoll.angleDifference(controller.roll))
|
||||
//
|
||||
// // Use the absolute error to calculate the magnitude of the influence
|
||||
// val influenceMagnitude = (min(rollArrivalDeg, abs(rollError)) / rollArrivalDeg)
|
||||
// val desiredRollForce = maxRollCorrectionRate * influenceMagnitude * -rollError.sign
|
||||
// var steeredRollForce = desiredRollForce - state.currRollCorrectionForce.get()
|
||||
//
|
||||
// // Ensure the 'steering' correction force doesn't exceed our maxForce
|
||||
// if (abs(steeredRollForce) > maxRollForce) {
|
||||
// steeredRollForce = steeredRollForce.sign * maxRollForce
|
||||
// }
|
||||
//
|
||||
// // Apply the 'steered' force (its really not a steering force I need a better name)
|
||||
// state.currRollCorrectionForce.set(
|
||||
// state.currRollCorrectionForce.get() + steeredRollForce
|
||||
// )
|
||||
|
||||
//Calculate correcting pitch force.
|
||||
// val rollCorrectionTimer = vehicle.runtime.resolveDouble(settings.timeToRollCorrect ?: globalSubmarine.timeToRollCorrect!!)
|
||||
// val maxPitchCorrectionRate = 5.0f * (state.noInputTime.get() - rollCorrectionTimer).coerceIn(0.0, 1.0).pow(2).toFloat()*0.5f
|
||||
// val maxPitchForce = maxPitchCorrectionRate / 40.0f
|
||||
// val pitchArrivalDeg = 45.0f
|
||||
// val desiredPitch = 0.0f
|
||||
//
|
||||
// if(state.rideVelocity.get().length() < 0.1 && state.noInputTime.get() > rollCorrectionTimer) {
|
||||
// val pitchErrror = Mth.wrapDegrees(desiredPitch.angleDifference(controller.pitch))
|
||||
// val arrivalInfluence = (min(pitchArrivalDeg,abs(pitchErrror)) / pitchArrivalDeg)
|
||||
// val desiredPitchForce = maxPitchCorrectionRate * arrivalInfluence * -pitchErrror.sign
|
||||
// var steeredPitchForce = desiredPitchForce - state.currPitchCorrectionForce.get()
|
||||
//
|
||||
// // Ensure the 'steering' correction force doesn't exceed our maxForce
|
||||
// if (abs(steeredPitchForce) > maxPitchForce) {
|
||||
// steeredPitchForce = steeredPitchForce.sign * maxPitchForce
|
||||
// }
|
||||
//
|
||||
// // Apply the 'steered' force (its really not a steering force I need a better name)
|
||||
// state.currPitchCorrectionForce.set(
|
||||
// state.currPitchCorrectionForce.get() + steeredPitchForce
|
||||
// )
|
||||
// } else {
|
||||
// state.currPitchCorrectionForce.set(
|
||||
// //reduce rollCorrection gradually
|
||||
// lerp(state.currPitchCorrectionForce.get(), 0.0, deltaTime * 0.98)
|
||||
// )
|
||||
// }
|
||||
}
|
||||
|
||||
override fun rotationOnMouseXY(
|
||||
settings: SubmarineSettings,
|
||||
state: SubmarineState,
|
||||
|
||||
@@ -44,6 +44,7 @@ import com.cobblemon.mod.common.api.spawning.preset.BestSpawnerConfig
|
||||
import com.cobblemon.mod.common.api.spawning.preset.PokemonSpawnDetailPreset
|
||||
import com.cobblemon.mod.common.api.spawning.selection.SpawningSelector
|
||||
import com.cobblemon.mod.common.api.spawning.spawner.BasicSpawner
|
||||
import com.cobblemon.mod.common.api.spawning.spawner.FishingSpawnerFactory
|
||||
import com.cobblemon.mod.common.api.spawning.spawner.FixedAreaSpawner
|
||||
import com.cobblemon.mod.common.api.spawning.spawner.PlayerSpawner
|
||||
import com.cobblemon.mod.common.api.spawning.spawner.PlayerSpawnerFactory
|
||||
@@ -139,19 +140,6 @@ object BestSpawner {
|
||||
|
||||
fun onServerStarted(server: MinecraftServer) {
|
||||
CobblemonSpawnPools.onServerLoad(server)
|
||||
fishingSpawner = BasicSpawner(
|
||||
name = "fishing",
|
||||
spawnPool = CobblemonSpawnPools.WORLD_SPAWN_POOL
|
||||
).also {
|
||||
it.influences.add(
|
||||
BucketMultiplyingInfluence(
|
||||
multipliers = mapOf(
|
||||
"uncommon" to 2.25f,
|
||||
"rare" to 5.5f,
|
||||
"ultra-rare" to 5.5f,
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
fishingSpawner = FishingSpawnerFactory.createSharedSpawner()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* 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.api.spawning.spawner
|
||||
|
||||
import com.cobblemon.mod.common.api.spawning.CobblemonSpawnPools
|
||||
import com.cobblemon.mod.common.api.spawning.CobblemonSpawnRules
|
||||
import com.cobblemon.mod.common.api.spawning.detail.SpawnPool
|
||||
import com.cobblemon.mod.common.api.spawning.influence.BucketMultiplyingInfluence
|
||||
import com.cobblemon.mod.common.api.spawning.influence.BucketNormalizingInfluence
|
||||
import com.cobblemon.mod.common.api.spawning.influence.PlayerLevelRangeInfluence
|
||||
import com.cobblemon.mod.common.api.spawning.influence.PlayerLevelRangeInfluence.Companion.TYPICAL_VARIATION
|
||||
import com.cobblemon.mod.common.api.spawning.influence.SpawningInfluence
|
||||
import com.cobblemon.mod.common.util.mutableLazy
|
||||
import net.minecraft.core.BlockPos
|
||||
import net.minecraft.server.level.ServerLevel
|
||||
import net.minecraft.server.level.ServerPlayer
|
||||
import net.minecraft.world.item.ItemStack
|
||||
import com.cobblemon.mod.common.api.spawning.BestSpawner;
|
||||
import com.cobblemon.mod.common.api.spawning.position.FishingSpawnablePosition
|
||||
|
||||
|
||||
/**
|
||||
* This isn't really a factory, one FishingSpawner is created as a field on [BestSpawner] on
|
||||
* server start. However, this emulates the systems that PlayerSpawner uses so extenders can
|
||||
* add influences that affect all fishing encounters.
|
||||
*
|
||||
* Responsible for creating [BasicSpawner]s for Fishing with whatever appropriate settings.
|
||||
* You can swap over the spawn pool and the influences here, and it will apply to all newly-generated
|
||||
* [BasicSpawner]s for Fishing. Has a global every-cast influence list, as well as a context-sensitive
|
||||
* influence list.
|
||||
*
|
||||
* @author Andy
|
||||
* @since January 23rd, 2026
|
||||
*/
|
||||
object FishingSpawnerFactory {
|
||||
var spawnPool: SpawnPool by mutableLazy {
|
||||
CobblemonSpawnPools.WORLD_SPAWN_POOL
|
||||
}
|
||||
|
||||
data class Context(
|
||||
val player: ServerPlayer,
|
||||
val rodStack: ItemStack,
|
||||
val lureLevel: Int,
|
||||
val luckOfTheSeaLevel: Int,
|
||||
val world: ServerLevel,
|
||||
val pos: BlockPos,
|
||||
val spawner: BasicSpawner
|
||||
)
|
||||
|
||||
/**
|
||||
* List of influences for a new cast of the fishing rod. Context is provided at
|
||||
* build time in [buildPositionInfluences]
|
||||
*/
|
||||
var positionInfluenceBuilders = mutableListOf<(ctx: Context) -> SpawningInfluence?>(
|
||||
{ ctx -> PlayerLevelRangeInfluence(ctx.player, TYPICAL_VARIATION) },
|
||||
{ ctx -> BucketNormalizingInfluence(tier = ctx.lureLevel + ctx.luckOfTheSeaLevel) }
|
||||
)
|
||||
|
||||
fun createSharedSpawner(): BasicSpawner {
|
||||
return BasicSpawner(
|
||||
name = "fishing",
|
||||
spawnPool = spawnPool
|
||||
).also { spawner ->
|
||||
spawner.influences += BucketMultiplyingInfluence(
|
||||
multipliers = mapOf(
|
||||
"uncommon" to 2.25f,
|
||||
"rare" to 5.5f,
|
||||
"ultra-rare" to 5.5f,
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the per-cast influences for [FishingSpawnablePosition]
|
||||
*/
|
||||
fun buildPositionInfluences(ctx: Context): MutableList<SpawningInfluence> {
|
||||
return positionInfluenceBuilders.mapNotNullTo(mutableListOf()) { it(ctx) }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
* 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.api.spawning.spawner
|
||||
|
||||
import com.cobblemon.mod.common.api.fishing.SpawnBait
|
||||
import com.cobblemon.mod.common.api.spawning.CobblemonSpawnPools
|
||||
import com.cobblemon.mod.common.api.spawning.CobblemonSpawnRules
|
||||
import com.cobblemon.mod.common.api.spawning.detail.SpawnPool
|
||||
import com.cobblemon.mod.common.api.spawning.influence.BucketMultiplyingInfluence
|
||||
import com.cobblemon.mod.common.api.spawning.influence.BucketNormalizingInfluence
|
||||
import com.cobblemon.mod.common.api.spawning.influence.SpawnBaitInfluence
|
||||
import com.cobblemon.mod.common.api.spawning.influence.SpawningInfluence
|
||||
import com.cobblemon.mod.common.api.spawning.rules.SpawnRule
|
||||
import com.cobblemon.mod.common.util.mutableLazy
|
||||
import net.minecraft.core.BlockPos
|
||||
import net.minecraft.server.level.ServerLevel
|
||||
|
||||
/**
|
||||
* Responsible for creating [FixedAreaSpawner]s for PokeSnacks with whatever appropriate settings.
|
||||
* You can swap over the spawn pool and the influences here, and it will apply to all newly-generated
|
||||
* [FixedAreaSpawner]s for PokeSnacks.
|
||||
*
|
||||
* @author Andy
|
||||
* @since January 23rd, 2026
|
||||
*/
|
||||
object PokeSnackSpawnerFactory {
|
||||
var spawnPool: SpawnPool by mutableLazy {
|
||||
CobblemonSpawnPools.WORLD_SPAWN_POOL
|
||||
}
|
||||
|
||||
data class Context(
|
||||
val world: ServerLevel,
|
||||
val pos: BlockPos,
|
||||
val horizontalRadius: Int,
|
||||
val verticalRadius: Int,
|
||||
val maxPokemonPerChunk: Float,
|
||||
val name: String,
|
||||
val baitEffects: List<SpawnBait.Effect>
|
||||
)
|
||||
|
||||
/**
|
||||
* The list of influences for a new [FixedAreaSpawner] for a PokeSnack.
|
||||
* The influences will be added to the spawner in the order they are added to this list.
|
||||
*/
|
||||
var influenceBuilders = mutableListOf<(ctx: Context) -> SpawningInfluence?>(
|
||||
{ ctx ->
|
||||
val stackedLureTier = ctx.baitEffects
|
||||
.filter { it.type == SpawnBait.Effects.RARITY_BUCKET }
|
||||
.sumOf { it.value }
|
||||
.toInt()
|
||||
|
||||
if (stackedLureTier <= 0) null else BucketNormalizingInfluence(
|
||||
tier = stackedLureTier,
|
||||
gradient = 0.2F,
|
||||
firstTier = 1.2F
|
||||
)
|
||||
},
|
||||
{ _ ->
|
||||
BucketMultiplyingInfluence(
|
||||
mapOf(
|
||||
"uncommon" to 2.25f,
|
||||
"rare" to 5.5f,
|
||||
"ultra-rare" to 5.5f,
|
||||
)
|
||||
)
|
||||
},
|
||||
{ ctx ->
|
||||
SpawnBaitInfluence(effects = ctx.baitEffects)
|
||||
},
|
||||
)
|
||||
|
||||
fun create(ctx: Context): FixedAreaSpawner {
|
||||
val influences = influenceBuilders.mapNotNull { it(ctx) }
|
||||
|
||||
return FixedAreaSpawner(
|
||||
name = ctx.name,
|
||||
spawnPool = spawnPool,
|
||||
world = ctx.world,
|
||||
position = ctx.pos,
|
||||
horizontalRadius = ctx.horizontalRadius,
|
||||
verticalRadius = ctx.verticalRadius,
|
||||
maxPokemonPerChunk = ctx.maxPokemonPerChunk
|
||||
).also { spawner ->
|
||||
spawner.influences.addAll(influences)
|
||||
|
||||
// TODO(Andy): PokeSnacks currently bypass pokemon spawn rules, should that be true?
|
||||
// Adding this rule will change that
|
||||
spawner.influences.addAll(
|
||||
CobblemonSpawnRules.rules.values
|
||||
.filter(SpawnRule::enabled)
|
||||
.flatMap(SpawnRule::components)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,7 @@ data class GeneralPlayerData(
|
||||
var starterUUID: UUID?,
|
||||
var keyItems: MutableSet<ResourceLocation>,
|
||||
var battleTheme: ResourceLocation?,
|
||||
var partySelectTutorialDone: Boolean = false,
|
||||
val extraData: MutableMap<String, PlayerDataExtension>,
|
||||
) : InstancedPlayerData {
|
||||
var advancementData: PlayerAdvancementData = PlayerAdvancementData()
|
||||
@@ -53,7 +54,8 @@ data class GeneralPlayerData(
|
||||
starterSelected,
|
||||
starterUUID,
|
||||
advancementData.totalBattleVictoryCount == 0,
|
||||
battleTheme
|
||||
battleTheme,
|
||||
partySelectTutorialDone
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,8 @@ class PlayerDataJsonBackend: JsonBackedPlayerDataStoreBackend<GeneralPlayerData>
|
||||
starterUUID = null,
|
||||
keyItems = Cobblemon.config.defaultKeyItems,
|
||||
extraData = mutableMapOf(),
|
||||
battleTheme = CobblemonSounds.PVP_BATTLE.location
|
||||
battleTheme = CobblemonSounds.PVP_BATTLE.location,
|
||||
partySelectTutorialDone = false
|
||||
)}
|
||||
|
||||
override val gson = GsonBuilder()
|
||||
|
||||
@@ -37,7 +37,8 @@ class PlayerDataMongoBackend(mongoClient: MongoClient, databaseName: String, col
|
||||
starterUUID = null,
|
||||
keyItems = Cobblemon.config.defaultKeyItems,
|
||||
extraData = mutableMapOf(),
|
||||
battleTheme = CobblemonSounds.PVP_BATTLE.location
|
||||
battleTheme = CobblemonSounds.PVP_BATTLE.location,
|
||||
partySelectTutorialDone = false
|
||||
)}
|
||||
|
||||
override val gson = GsonBuilder()
|
||||
|
||||
@@ -34,7 +34,8 @@ data class ClientGeneralPlayerData(
|
||||
var starterSelected: Boolean = false,
|
||||
var starterUUID: UUID? = null,
|
||||
var showChallengeLabel: Boolean = true,
|
||||
val battleTheme: ResourceLocation? = null
|
||||
val battleTheme: ResourceLocation? = null,
|
||||
var partySelectTutorialDone: Boolean = false
|
||||
) : ClientInstancedPlayerData {
|
||||
|
||||
override fun encode(buf: RegistryFriendlyByteBuf) {
|
||||
@@ -46,6 +47,7 @@ data class ClientGeneralPlayerData(
|
||||
buf.writeNullable(starterUUID) { pb, value -> pb.writeString(value.toString()) }
|
||||
buf.writeNullable(resetStarters) { pb, value -> pb.writeBoolean(value) }
|
||||
buf.writeNullable(battleTheme) {pb, value -> pb.writeIdentifier(value)}
|
||||
buf.writeBoolean(partySelectTutorialDone)
|
||||
}
|
||||
companion object {
|
||||
fun decode(buffer: RegistryFriendlyByteBuf): SetClientPlayerDataPacket {
|
||||
@@ -57,6 +59,7 @@ data class ClientGeneralPlayerData(
|
||||
val starterUUID = buffer.readNullable { it.readString() }?.let { UUID.fromString(it) }
|
||||
val resetStarterPrompt = buffer.readNullable { it.readBoolean() }
|
||||
val battleTheme = buffer.readNullable { it.readIdentifier() }
|
||||
val partySelectTutorialDone = buffer.readBoolean()
|
||||
val data = ClientGeneralPlayerData(
|
||||
resetStarterPrompt,
|
||||
promptStarter,
|
||||
@@ -64,7 +67,8 @@ data class ClientGeneralPlayerData(
|
||||
starterSelected,
|
||||
starterUUID,
|
||||
showChallengeLabel,
|
||||
battleTheme
|
||||
battleTheme,
|
||||
partySelectTutorialDone
|
||||
)
|
||||
//Weird to do this, but since the flag doesn't get passed to the decoded obj, do it here
|
||||
//Should be fine, as long as decode doesn't get run on the server for some reason
|
||||
|
||||
@@ -31,7 +31,6 @@ import kotlin.collections.associateWith
|
||||
import kotlin.collections.partition
|
||||
import kotlin.math.absoluteValue
|
||||
|
||||
|
||||
/**
|
||||
* AI that tries to choose the best move for the given situations. Based off of the Pokemon Trainer Tournament Simulator Github
|
||||
* https://github.com/cRz-Shadows/Pokemon_Trainer_Tournament_Simulator/blob/main/pokemon-showdown/sim/examples/Simulation-test-1.ts#L330
|
||||
@@ -49,7 +48,7 @@ class StrongBattleAI(skill: Int) : BattleAI {
|
||||
private val hpWeightConsideration = 0.25 // how much HP difference is a consideration for switchins
|
||||
private val hpFractionCoefficient = 0.4 // how much HP differences should be taken into account for switch ins
|
||||
private val boostWeightCoefficient = 1 // the amount of boosts considered a baseline to be removed
|
||||
private val switchOutMatchupThreshold = 0 // todo change this to get it feeling just right (-7 never switches)
|
||||
private val switchOutMatchupThreshold = -2 // todo change this to get it feeling just right (-7 never switches)
|
||||
private val selfKoMoveMatchupThreshold = 0.3
|
||||
private val trickRoomThreshold = 85
|
||||
private val recoveryMoveThreshold = 0.50
|
||||
@@ -219,19 +218,14 @@ class StrongBattleAI(skill: Int) : BattleAI {
|
||||
.filter { it.second.canBeSentOut() }
|
||||
|
||||
if (forceSwitch || activeBattlePokemon.isGone()) {
|
||||
if (battle.turn == 1) {
|
||||
val switchTo = activeBattlePokemon.actor.pokemonList.filter { it.canBeSentOut() }.randomOrNull()
|
||||
?: return DefaultActionResponse()
|
||||
switchTo.willBeSwitchedIn = true
|
||||
return SwitchActionResponse(switchTo.uuid)
|
||||
}
|
||||
else {
|
||||
val bestEstimation = availableSwitches.maxByOrNull { estimateMatchup(activeBattlePokemon, aiSide, battle, it.first) }
|
||||
?: return PassActionResponse
|
||||
// When forced to switch, pick the Pokemon with the best matchup estimation
|
||||
val bestSwitchScore = availableSwitches.maxOfOrNull { estimateMatchup(activeBattlePokemon, aiSide, battle, it.first) }
|
||||
?: return PassActionResponse
|
||||
val bestSwitch = availableSwitches.firstOrNull { estimateMatchup(activeBattlePokemon, aiSide, battle, it.first) == bestSwitchScore }
|
||||
?: return PassActionResponse
|
||||
|
||||
bestEstimation.second.willBeSwitchedIn = true
|
||||
return SwitchActionResponse(bestEstimation.second.uuid)
|
||||
}
|
||||
bestSwitch.second.willBeSwitchedIn = true
|
||||
return SwitchActionResponse(bestSwitch.second.uuid)
|
||||
}
|
||||
if (moveset == null) {
|
||||
return PassActionResponse
|
||||
@@ -259,9 +253,9 @@ class StrongBattleAI(skill: Int) : BattleAI {
|
||||
|
||||
if (!checkSkillLevel()){
|
||||
val move = availableMoves
|
||||
.filter { it.first.target.targetList(activeBattlePokemon)?.isEmpty() != true }
|
||||
.randomOrNull()
|
||||
?: return MoveActionResponse("struggle")
|
||||
.filter { it.first.target.targetList(activeBattlePokemon)?.isEmpty() != true }
|
||||
.randomOrNull()
|
||||
?: return MoveActionResponse("struggle")
|
||||
|
||||
return chooseMove(move.first, activeBattlePokemon)
|
||||
}
|
||||
@@ -270,7 +264,6 @@ class StrongBattleAI(skill: Int) : BattleAI {
|
||||
if (checkSwitchOutSkill() && shouldSwitchOut(aiSide, battle, activeBattlePokemon, moveset)) {
|
||||
considerSwitching(activeBattlePokemon, activeTrackerPokemon, opponents, availableMoves, availableSwitches, battle, aiSide)
|
||||
}
|
||||
activeTrackerPokemon.firstTurn = false
|
||||
|
||||
// If HP is below 30% and not switching out, always use the most damaging move
|
||||
if (activeTrackerPokemon.currentHpPercent < 0.3 && !shouldSwitchOut(aiSide, battle, activeBattlePokemon, moveset)) {
|
||||
@@ -296,8 +289,6 @@ class StrongBattleAI(skill: Int) : BattleAI {
|
||||
return chooseMove(fakeOut.first, activeBattlePokemon, targets.firstOrNull { validTarget != null && validTarget.id == it.battlePokemon!!.uuid})
|
||||
}
|
||||
|
||||
activeTrackerPokemon.firstTurn = false
|
||||
|
||||
|
||||
// Explosion/Self destruct
|
||||
availableMoves.firstOrNull {
|
||||
@@ -315,7 +306,7 @@ class StrongBattleAI(skill: Int) : BattleAI {
|
||||
|
||||
// Deal with non-weather related field changing effects
|
||||
for (move in availableMoves) {
|
||||
|
||||
|
||||
// Tailwind
|
||||
if (move.first.id == "tailwind" && move.first.id != activeTracker.alliedSide.tailwindCondition &&
|
||||
availableSwitches.size > 2) {
|
||||
@@ -324,21 +315,21 @@ class StrongBattleAI(skill: Int) : BattleAI {
|
||||
|
||||
// Trick room
|
||||
if (move.first.id == "trickroom" && move.first.id != activeTracker.currentRoom
|
||||
&& availableSwitches.count { statEstimationActive(it.first, Stats.SPEED) <= trickRoomThreshold } >= 2) {
|
||||
&& availableSwitches.count { statEstimationActive(it.first, Stats.SPEED) <= trickRoomThreshold } >= 2) {
|
||||
return chooseMove(move.first, activeBattlePokemon)
|
||||
}
|
||||
|
||||
// todo find a way to get list of active screens
|
||||
// Aurora veil
|
||||
if (move.first.id == "auroraveil" && move.first.id != activeTracker.alliedSide.screenCondition
|
||||
&& activeTracker.currentWeather in listOf("hail", "snow")) {
|
||||
&& activeTracker.currentWeather in listOf("hail", "snow")) {
|
||||
return chooseMove(move.first, activeBattlePokemon)
|
||||
}
|
||||
|
||||
// todo find a way to get list of active screens
|
||||
// Light Screen
|
||||
if (move.first.id == "lightscreen" && move.first.id != activeTracker.alliedSide.screenCondition
|
||||
&& opponents.any { (it.species?.baseStats?.get(Stats.SPECIAL_ATTACK) ?: 0) > (it.species?.baseStats?.get(Stats.ATTACK) ?: 0) }
|
||||
&& opponents.any { (it.species?.baseStats?.get(Stats.SPECIAL_ATTACK) ?: 0) > (it.species?.baseStats?.get(Stats.ATTACK) ?: 0) }
|
||||
&& availableSwitches.size > 1) {
|
||||
return chooseMove(move.first, activeBattlePokemon)
|
||||
}
|
||||
@@ -356,13 +347,13 @@ class StrongBattleAI(skill: Int) : BattleAI {
|
||||
for (move in availableMoves) {
|
||||
// Setup
|
||||
if (nOppRemainingMons >= 3 && move.first.id in AIUtility.entryHazards
|
||||
&& !activeTracker.opponentSide.sideHazards.contains(move.first.id)) {
|
||||
&& !activeTracker.opponentSide.sideHazards.contains(move.first.id)) {
|
||||
return chooseMove(move.first, activeBattlePokemon)
|
||||
}
|
||||
|
||||
// Removal
|
||||
if (nRemainingMons >= 2 && move.first.id in AIUtility.antiHazardsMoves
|
||||
&& activeTracker.alliedSide.sideHazards.isNotEmpty()) {
|
||||
&& activeTracker.alliedSide.sideHazards.isNotEmpty()) {
|
||||
return chooseMove(move.first, activeBattlePokemon)
|
||||
}
|
||||
}
|
||||
@@ -372,10 +363,10 @@ class StrongBattleAI(skill: Int) : BattleAI {
|
||||
// Court Change
|
||||
for (move in availableMoves) {
|
||||
if (move.first.id == "courtchange"
|
||||
&& (!AIUtility.entryHazards.none { it in activeTracker.alliedSide.sideHazards }
|
||||
|| setOf("tailwind", "lightscreen", "reflect").any { it in activeTracker.opponentSide.sideHazards })
|
||||
&& setOf("tailwind", "lightscreen", "reflect").none { it in activeTracker.opponentSide.sideHazards }
|
||||
&& AIUtility.entryHazards.none { it in activeTracker.opponentSide.sideHazards }) {
|
||||
&& (!AIUtility.entryHazards.none { it in activeTracker.alliedSide.sideHazards }
|
||||
|| setOf("tailwind", "lightscreen", "reflect").any { it in activeTracker.opponentSide.sideHazards })
|
||||
&& setOf("tailwind", "lightscreen", "reflect").none { it in activeTracker.opponentSide.sideHazards }
|
||||
&& AIUtility.entryHazards.none { it in activeTracker.opponentSide.sideHazards }) {
|
||||
return chooseMove(move.first, activeBattlePokemon)
|
||||
}
|
||||
}
|
||||
@@ -383,7 +374,7 @@ class StrongBattleAI(skill: Int) : BattleAI {
|
||||
// Strength Sap
|
||||
for (move in availableMoves) {
|
||||
if (move.first.id == "strengthsap" && activeTrackerPokemon.currentHpPercent < 0.5
|
||||
&& activeTrackerPokemon.species!!.baseStats.getOrDefault(Stats.ATTACK, 0) > 80) {
|
||||
&& activeTrackerPokemon.species!!.baseStats.getOrDefault(Stats.ATTACK, 0) > 80) {
|
||||
return chooseMove(move.first, activeBattlePokemon)
|
||||
}
|
||||
}
|
||||
@@ -391,10 +382,10 @@ class StrongBattleAI(skill: Int) : BattleAI {
|
||||
// Belly Drum
|
||||
for (move in availableMoves) {
|
||||
if (move.first.id == "bellydrum"
|
||||
&& (activeTrackerPokemon.currentHpPercent > 0.6
|
||||
&& activeTrackerPokemon.pokemon!!.heldItem().item == CobblemonItems.SITRUS_BERRY
|
||||
|| activeTrackerPokemon.currentHpPercent > 0.8)
|
||||
&& activeTrackerPokemon.boosts.getOrDefault(Stats.ATTACK, 0) < 1) {
|
||||
&& (activeTrackerPokemon.currentHpPercent > 0.6
|
||||
&& activeTrackerPokemon.pokemon!!.heldItem().item == CobblemonItems.SITRUS_BERRY
|
||||
|| activeTrackerPokemon.currentHpPercent > 0.8)
|
||||
&& activeTrackerPokemon.boosts.getOrDefault(Stats.ATTACK, 0) < 1) {
|
||||
return chooseMove(move.first, activeBattlePokemon)
|
||||
}
|
||||
}
|
||||
@@ -404,8 +395,8 @@ class StrongBattleAI(skill: Int) : BattleAI {
|
||||
for (move in availableMoves) {
|
||||
AIUtility.weatherSetupMoves[move.first.id]?.let { requiredWeather ->
|
||||
if (activeTracker.currentWeather != requiredWeather.lowercase() &&
|
||||
!(activeTracker.currentWeather == "primordialsea" && requiredWeather == "raindance") &&
|
||||
!(activeTracker.currentWeather == "desolateland" && requiredWeather == "sunnyday")) {
|
||||
!(activeTracker.currentWeather == "primordialsea" && requiredWeather == "raindance") &&
|
||||
!(activeTracker.currentWeather == "desolateland" && requiredWeather == "sunnyday")) {
|
||||
return chooseMove(move.first, activeBattlePokemon)
|
||||
}
|
||||
}
|
||||
@@ -431,8 +422,8 @@ class StrongBattleAI(skill: Int) : BattleAI {
|
||||
// Stall out side conditions
|
||||
if ((activeTracker.opponentSide.screenCondition != null || activeTracker.opponentSide.tailwindCondition != null) &&
|
||||
(activeTracker.alliedSide.screenCondition == null || activeTracker.alliedSide.tailwindCondition == null) ||
|
||||
opponents.any { it.currentStatus == null } &&
|
||||
activeTrackerPokemon.protectCount == 0 && opponents.none { it.currentAbility?.name == "unseenfist"}) {
|
||||
opponents.any { it.currentStatus == null } &&
|
||||
activeTrackerPokemon.protectCount == 0 && opponents.none { it.currentAbility?.name == "unseenfist"}) {
|
||||
activeTrackerPokemon.protectCount = 3
|
||||
return chooseMove(move.first, activeBattlePokemon)
|
||||
}
|
||||
@@ -460,10 +451,10 @@ class StrongBattleAI(skill: Int) : BattleAI {
|
||||
activeTrackerPokemon.firstTurn = false
|
||||
|
||||
val move = availableMoves
|
||||
.filter { it.first.canBeUsed() }
|
||||
.filter { it.first.mustBeUsed() || it.first.target.targetList(activeBattlePokemon)?.isEmpty() != true }
|
||||
.randomOrNull()
|
||||
?: return MoveActionResponse("struggle")
|
||||
.filter { it.first.canBeUsed() }
|
||||
.filter { it.first.mustBeUsed() || it.first.target.targetList(activeBattlePokemon)?.isEmpty() != true }
|
||||
.randomOrNull()
|
||||
?: return MoveActionResponse("struggle")
|
||||
|
||||
return chooseMove(move.first, activeBattlePokemon)
|
||||
}
|
||||
@@ -520,6 +511,10 @@ class StrongBattleAI(skill: Int) : BattleAI {
|
||||
return false
|
||||
|
||||
val activeTrackerPokemon = activeTracker.alliedSide.activePokemon.first { it.id == activeBattlePokemon.battlePokemon!!.uuid }
|
||||
|
||||
// Don't switch out if we just switched in
|
||||
if (activeTrackerPokemon.firstTurn)
|
||||
return false
|
||||
val actorTracker = activeTracker.alliedSide.actors.first { activeTrackerPokemon in it.activePokemon }
|
||||
val availableSwitches = actorTracker.party.filter { it.currentHp!! > 0 }
|
||||
val currentAbility = activeTrackerPokemon.pokemon!!.ability
|
||||
@@ -532,7 +527,7 @@ class StrongBattleAI(skill: Int) : BattleAI {
|
||||
// Only switch if a switch-in is significantly better than the current Pokémon
|
||||
val currentScore = estimateMatchup(activeBattlePokemon, side, battle)
|
||||
val bestSwitchScore = availableSwitches.maxOfOrNull { estimateMatchup(activeBattlePokemon, side, battle, it) } ?: currentScore
|
||||
val improvementThreshold = currentScore.absoluteValue * 0.25 + 2
|
||||
val improvementThreshold = currentScore.absoluteValue * 0.5 + 3
|
||||
if (bestSwitchScore <= currentScore + improvementThreshold) {
|
||||
return false
|
||||
}
|
||||
@@ -567,7 +562,7 @@ class StrongBattleAI(skill: Int) : BattleAI {
|
||||
if (availableSwitches.isEmpty() || availableSwitches.none { estimateMatchup(activeBattlePokemon, side, battle, it) > 0 })
|
||||
return false
|
||||
|
||||
|
||||
|
||||
|
||||
// ...and a 'good' reason to switch out
|
||||
if (opponentActiveTracker.any { it.boosts.getOrDefault(Stats.ACCURACY, 0) <= accuracySwitchThreshold } ||
|
||||
@@ -995,6 +990,4 @@ class StrongBattleAI(skill: Int) : BattleAI {
|
||||
return MoveActionResponse(move.id, chosenTarget.getPNX())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -132,6 +132,7 @@ class TrackerActor(val uuid: UUID) {
|
||||
actor.activePokemon.filter { newActive -> activePokemon.none { it.id == newActive.battlePokemon?.uuid } }.forEach {
|
||||
val active = party.firstOrNull { trackMon -> trackMon.id == it.battlePokemon?.uuid } ?: return@forEach
|
||||
party.remove(active)
|
||||
active.firstTurn = true // Reset firstTurn when switching in
|
||||
activePokemon.add(active)
|
||||
}
|
||||
val swappedOut = activePokemon.filter { trackMon -> actor.activePokemon.none { it.battlePokemon?.uuid == trackMon.id } }
|
||||
@@ -145,6 +146,7 @@ class TrackerActor(val uuid: UUID) {
|
||||
actor.activePokemon.filter { newActive -> activePokemon.none { it.id == newActive.battlePokemon?.uuid } }.forEach {
|
||||
val active = party.firstOrNull { trackMon -> trackMon.id == it.battlePokemon?.uuid } ?: return@forEach
|
||||
party.remove(active)
|
||||
active.firstTurn = true // Reset firstTurn when switching in
|
||||
activePokemon.add(active)
|
||||
}
|
||||
val swappedOut = activePokemon.filter { trackMon -> actor.activePokemon.none { it.battlePokemon?.uuid == trackMon.id } }
|
||||
|
||||
@@ -133,7 +133,10 @@ class ApricornBlock(settings: Properties, val apricorn: Apricorn) : HorizontalDi
|
||||
override fun isBonemealSuccess(world: Level, random: RandomSource, pos: BlockPos, state: BlockState) = true
|
||||
|
||||
override fun performBonemeal(world: ServerLevel, random: RandomSource, pos: BlockPos, state: BlockState) {
|
||||
world.setBlock(pos, state.setValue(AGE, state.getValue(AGE) + 1), 2)
|
||||
val curAge = state.getValue(AGE)
|
||||
val newAge = curAge + 1
|
||||
if (newAge > MAX_AGE) return
|
||||
world.setBlock(pos, state.setValue(AGE, newAge), UPDATE_CLIENTS)
|
||||
}
|
||||
|
||||
override fun createBlockStateDefinition(builder: StateDefinition.Builder<Block, BlockState>) {
|
||||
@@ -186,17 +189,17 @@ class ApricornBlock(settings: Properties, val apricorn: Apricorn) : HorizontalDi
|
||||
* This uses [Block.dropResources] to handle the drops.
|
||||
* It will also reset the [BlockState] of this block at the given location to the start of growth.
|
||||
*
|
||||
* @param world The [World] the apricorn is in.
|
||||
* @param world The [Level] the apricorn is in.
|
||||
* @param state The [BlockState] of the apricorn.
|
||||
* @param pos The [BlockPos] of the apricorn.
|
||||
* @return The [BlockState] after harvest.
|
||||
*/
|
||||
fun harvest(world: Level, state: BlockState, pos: BlockPos): BlockState {
|
||||
// Uses loot tables, to change the drops use 'data/cobblemon/loot_tables/blocks/<color>_apricorn.json'
|
||||
Block.dropResources(state, world, pos)
|
||||
dropResources(state, world, pos)
|
||||
// Don't use default as we want to keep the facing
|
||||
val resetState = state.setValue(AGE, MIN_AGE)
|
||||
world.setBlock(pos, resetState, Block.UPDATE_CLIENTS)
|
||||
world.setBlock(pos, resetState, UPDATE_CLIENTS)
|
||||
return resetState
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,32 @@ class BerryBlock(private val berryIdentifier: ResourceLocation, settings: Proper
|
||||
|
||||
override fun isBonemealSuccess(world: Level, random: RandomSource, pos: BlockPos, state: BlockState) = !this.isMaxAge(state)
|
||||
|
||||
override fun <T : BlockEntity> getTicker(world: Level, blockState: BlockState, blockWithEntityType: BlockEntityType<T>): BlockEntityTicker<T>? = createTickerHelper(blockWithEntityType, CobblemonBlockEntities.BERRY, BerryBlockEntity.TICKER)
|
||||
// Use Random Tick instead of BlockEntityTicker for performance optimization
|
||||
override fun <T : BlockEntity> getTicker(world: Level, blockState: BlockState, blockWithEntityType: BlockEntityType<T>): BlockEntityTicker<T>? = null
|
||||
|
||||
// Enable Random Tick: only immature and non-rooted berries need to tick
|
||||
override fun isRandomlyTicking(state: BlockState): Boolean {
|
||||
return state.getValue(AGE) < FRUIT_AGE && !state.getValue(IS_ROOTED)
|
||||
}
|
||||
|
||||
// Random Tick handler: uses time compensation to ensure correct growth speed
|
||||
@Deprecated("Deprecated in Java")
|
||||
override fun randomTick(state: BlockState, world: ServerLevel, pos: BlockPos, random: RandomSource) {
|
||||
val blockEntity = world.getBlockEntity(pos) as? BerryBlockEntity ?: return
|
||||
|
||||
// processTick calculates elapsed time and updates timer, returns whether growth is needed
|
||||
if (blockEntity.processTick(world, pos, state) && !world.getBlockTicks().hasScheduledTick(pos, this)) {
|
||||
// Schedule growth for next tick to avoid tick scheduler conflicts during randomTick
|
||||
world.scheduleTick(pos, this, 1)
|
||||
}
|
||||
}
|
||||
|
||||
// Scheduled tick handler: performs the actual growth
|
||||
@Deprecated("Deprecated in Java")
|
||||
override fun tick(state: BlockState, world: ServerLevel, pos: BlockPos, random: RandomSource) {
|
||||
if (state.getValue(IS_ROOTED)) return
|
||||
growHelper(world, random, pos, state)
|
||||
}
|
||||
|
||||
init {
|
||||
registerDefaultState(stateDefinition.any()
|
||||
|
||||
@@ -65,6 +65,9 @@ class BerryBlockEntity(pos: BlockPos, state: BlockState) : BlockEntity(Cobblemon
|
||||
private val growthPoints = arrayListOf<ResourceLocation>()
|
||||
var mulchVariant = MulchVariant.NONE
|
||||
|
||||
// For Random Tick compensation: records the game time of last tick
|
||||
var lastTickTime: Long = 0L
|
||||
|
||||
/**
|
||||
* The idea behind the growth point sequence is it's a 16-long string of
|
||||
* hexadecimal numbers. They represent the order of the growth points that
|
||||
@@ -267,6 +270,7 @@ class BerryBlockEntity(pos: BlockPos, state: BlockState) : BlockEntity(Cobblemon
|
||||
} catch (ignored: ResourceLocationException) {}
|
||||
}
|
||||
this.mulchDuration = nbt.getInt(MULCH_DURATION)
|
||||
this.lastTickTime = nbt.getLong(LAST_TICK_TIME)
|
||||
this.wasLoading = false
|
||||
if (nbt.contains(GROWTH_POINTS_SEQUENCE)) {
|
||||
growthPointSequence = nbt.getString(GROWTH_POINTS_SEQUENCE)
|
||||
@@ -287,6 +291,7 @@ class BerryBlockEntity(pos: BlockPos, state: BlockState) : BlockEntity(Cobblemon
|
||||
nbt.putInt(MULCH_DURATION, mulchDuration)
|
||||
nbt.putString(GROWTH_POINTS_SEQUENCE, growthPointSequence)
|
||||
nbt.putString(MULCH_VARIANT, mulchVariant.toString())
|
||||
nbt.putLong(LAST_TICK_TIME, lastTickTime)
|
||||
}
|
||||
|
||||
override fun setChanged() {
|
||||
@@ -346,24 +351,39 @@ class BerryBlockEntity(pos: BlockPos, state: BlockState) : BlockEntity(Cobblemon
|
||||
return
|
||||
}
|
||||
|
||||
/**
|
||||
* Process Random Tick compensation logic.
|
||||
* Calculates elapsed time since last tick and batch-decrements stageTimer.
|
||||
*/
|
||||
fun processTick(world: ServerLevel, pos: BlockPos, state: BlockState): Boolean {
|
||||
if (state.getValue(BerryBlock.IS_ROOTED)) return false
|
||||
|
||||
val currentTime = world.gameTime
|
||||
val elapsed = if (lastTickTime > 0L) {
|
||||
(currentTime - lastTickTime).toInt().coerceAtLeast(1)
|
||||
} else {
|
||||
1 // First tick, only decrement by 1
|
||||
}
|
||||
lastTickTime = currentTime
|
||||
|
||||
// Batch decrement the timer
|
||||
if (stageTimer > 0) {
|
||||
stageTimer = (stageTimer - elapsed).coerceAtLeast(0)
|
||||
}
|
||||
|
||||
// Return whether growth is needed
|
||||
return stageTimer <= 0
|
||||
}
|
||||
|
||||
//Using a similar approach to ComputerCraft, implement this client side
|
||||
interface RenderState : AutoCloseable {
|
||||
var needsRebuild: Boolean
|
||||
}
|
||||
|
||||
companion object {
|
||||
internal val TICKER = BlockEntityTicker<BerryBlockEntity> { world, pos, state, blockEntity ->
|
||||
if (world.isClientSide) return@BlockEntityTicker
|
||||
if (state.getValue(BerryBlock.IS_ROOTED)) return@BlockEntityTicker
|
||||
if (blockEntity.stageTimer >= 0) {
|
||||
blockEntity.stageTimer--
|
||||
}
|
||||
if (blockEntity.stageTimer <= 0) {
|
||||
(state.block as BerryBlock).growHelper(world as ServerLevel, world.random, pos, state)
|
||||
}
|
||||
}
|
||||
//private const val LIFE_CYCLES = "life_cycles"
|
||||
private const val GROWTH_POINTS = "GrowthPoints"
|
||||
private const val LAST_TICK_TIME = "LastTickTime"
|
||||
private const val GROWTH_POINTS_SEQUENCE = "GrowthPointsSequence"
|
||||
private const val GROWTH_TIMER = "GrowthTimer"
|
||||
private const val STAGE_TIMER = "StageTimer"
|
||||
|
||||
@@ -29,6 +29,7 @@ import com.cobblemon.mod.common.api.spawning.influence.SpawnBaitInfluence
|
||||
import com.cobblemon.mod.common.api.spawning.influence.SpawningInfluence
|
||||
import com.cobblemon.mod.common.api.spawning.position.SpawnablePosition
|
||||
import com.cobblemon.mod.common.api.spawning.spawner.FixedAreaSpawner
|
||||
import com.cobblemon.mod.common.api.spawning.spawner.PokeSnackSpawnerFactory
|
||||
import com.cobblemon.mod.common.block.PokeSnackBlock
|
||||
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
|
||||
import com.cobblemon.mod.common.item.components.BaitEffectsComponent
|
||||
@@ -62,41 +63,22 @@ open class PokeSnackBlockEntity(pos: BlockPos, state: BlockState) :
|
||||
}
|
||||
|
||||
val spawner: FixedAreaSpawner by lazy {
|
||||
FixedAreaSpawner(
|
||||
name = "poke_snack_spawner_${level?.dimension()?.location()}}_$blockPos",
|
||||
spawnPool = CobblemonSpawnPools.WORLD_SPAWN_POOL,
|
||||
world = level as ServerLevel,
|
||||
position = blockPos,
|
||||
val server = level as ServerLevel
|
||||
|
||||
val baitEffects = getBaitEffects()
|
||||
|
||||
val ctx = PokeSnackSpawnerFactory.Context(
|
||||
world = server,
|
||||
pos = blockPos,
|
||||
horizontalRadius = RADIUS,
|
||||
verticalRadius = RADIUS,
|
||||
maxPokemonPerChunk = Cobblemon.config.pokeSnackPokemonPerChunk
|
||||
).also {
|
||||
it.influences.add(this)
|
||||
maxPokemonPerChunk = Cobblemon.config.pokeSnackPokemonPerChunk,
|
||||
name = "poke_snack_spawner_${server.dimension().location()}_$blockPos",
|
||||
baitEffects = baitEffects
|
||||
)
|
||||
|
||||
val baitEffects = getBaitEffects()
|
||||
|
||||
val stackedLureTier = baitEffects
|
||||
.filter { it.type == SpawnBait.Effects.RARITY_BUCKET }
|
||||
.sumOf { it.value }
|
||||
.toInt()
|
||||
|
||||
if (stackedLureTier > 0) {
|
||||
it.influences += BucketNormalizingInfluence(
|
||||
tier = stackedLureTier,
|
||||
gradient = 0.2F,
|
||||
firstTier = 1.2F
|
||||
)
|
||||
}
|
||||
|
||||
it.influences += BucketMultiplyingInfluence(
|
||||
mapOf(
|
||||
"uncommon" to 2.25f,
|
||||
"rare" to 5.5f,
|
||||
"ultra-rare" to 5.5f,
|
||||
)
|
||||
)
|
||||
|
||||
it.influences += SpawnBaitInfluence(effects = baitEffects)
|
||||
PokeSnackSpawnerFactory.create(ctx).also { spawner ->
|
||||
spawner.influences.add(this)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -128,11 +128,11 @@ class FossilMultiblockStructure (
|
||||
|
||||
if(pokemon != null) {
|
||||
pokemon.caughtBall = ballType
|
||||
player.party().add(pokemon)
|
||||
this.fossilState.growthState = "Taken"
|
||||
player.playSound(CobblemonSounds.FOSSIL_MACHINE_RETRIEVE_POKEMON, 1.0F, 1.0F)
|
||||
CobblemonEvents.FOSSIL_REVIVED.post(FossilRevivedEvent(pokemon, player))
|
||||
CobblemonCriteria.RESURRECT_POKEMON.trigger(player, pokemon)
|
||||
player.party().add(pokemon)
|
||||
}
|
||||
|
||||
// Turn the monitor off
|
||||
|
||||
@@ -27,6 +27,7 @@ import com.cobblemon.mod.common.client.gui.PartyOverlayDataControl
|
||||
import com.cobblemon.mod.common.client.gui.RideControlsOverlay
|
||||
import com.cobblemon.mod.common.client.gui.battle.BattleOverlay
|
||||
import com.cobblemon.mod.common.client.gui.cookingpot.CookingPotScreen
|
||||
import com.cobblemon.mod.common.client.gui.party.PartyTutorialToasts
|
||||
import com.cobblemon.mod.common.client.particle.BedrockParticleOptionsRepository
|
||||
import com.cobblemon.mod.common.client.render.ClientPlayerIcon
|
||||
import com.cobblemon.mod.common.client.render.DeferredRenderer
|
||||
@@ -128,6 +129,8 @@ object CobblemonClient {
|
||||
battleOverlay.onLogout()
|
||||
ClientTaskTracker.clear()
|
||||
checkedStarterScreen = false
|
||||
overlay.resetAttachedToast()
|
||||
PartyTutorialToasts.reset()
|
||||
// CobblemonDataProvider.canReload = true
|
||||
DeferredRenderer.clearAll()
|
||||
ClientPlayerIcon.clear()
|
||||
@@ -165,13 +168,12 @@ object CobblemonClient {
|
||||
PlatformEvents.CLIENT_TICK_POST.subscribe { event ->
|
||||
val player = event.client.player
|
||||
if (player != null) {
|
||||
var selectedItem = player.inventory.getItem(player.inventory.selected)
|
||||
val selectedItem = player.inventory.getItem(player.inventory.selected)
|
||||
if (pokedexUsageContext.scanningGuiOpen &&
|
||||
!(selectedItem.`is`(CobblemonItemTags.POKEDEX)) &&
|
||||
!(player.offhandItem.`is`(CobblemonItemTags.POKEDEX) &&
|
||||
player.isUsingItem == true &&
|
||||
player.usedItemHand == InteractionHand.OFF_HAND
|
||||
)
|
||||
player.isUsingItem &&
|
||||
player.usedItemHand == InteractionHand.OFF_HAND)
|
||||
) {
|
||||
// Stop using Pokédex in main hand if player switches to a different slot in hotbar
|
||||
pokedexUsageContext.stopUsing(PokedexUsageContext.OPEN_SCANNER_BUFFER_TICKS + 1)
|
||||
@@ -216,7 +218,7 @@ object CobblemonClient {
|
||||
}
|
||||
|
||||
fun registerColors() {
|
||||
this.implementation.registerBlockColors(BlockColor { blockState, view, blockPos, tintIndex ->
|
||||
this.implementation.registerBlockColors(BlockColor { _, view, blockPos, _ ->
|
||||
blockPos?.let { pos ->
|
||||
view?.getBlockEntity(pos)?.let { blockEntity ->
|
||||
if (blockEntity is TintBlockEntity) return@BlockColor blockEntity.getTint()
|
||||
|
||||
@@ -12,16 +12,17 @@ import com.cobblemon.mod.common.Cobblemon
|
||||
import com.cobblemon.mod.common.CobblemonItems
|
||||
import com.cobblemon.mod.common.api.gui.blitk
|
||||
import com.cobblemon.mod.common.api.gui.drawPosablePortrait
|
||||
import com.cobblemon.mod.common.api.text.bold
|
||||
import com.cobblemon.mod.common.api.text.darkGray
|
||||
import com.cobblemon.mod.common.api.text.red
|
||||
import com.cobblemon.mod.common.api.text.text
|
||||
import com.cobblemon.mod.common.client.CobblemonClient
|
||||
import com.cobblemon.mod.common.client.CobblemonResources
|
||||
import com.cobblemon.mod.common.client.gui.battle.BattleGUI
|
||||
import com.cobblemon.mod.common.client.gui.party.PartyTutorialToasts
|
||||
import com.cobblemon.mod.common.client.gui.toast.CobblemonToast
|
||||
import com.cobblemon.mod.common.client.keybind.boundKey
|
||||
import com.cobblemon.mod.common.client.keybind.keybinds.HidePartyBinding
|
||||
import com.cobblemon.mod.common.client.keybind.keybinds.SummaryBinding
|
||||
import com.cobblemon.mod.common.client.keybind.keybinds.*
|
||||
import com.cobblemon.mod.common.client.render.drawScaledText
|
||||
import com.cobblemon.mod.common.client.render.getDepletableRedGreen
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.FloatingState
|
||||
@@ -150,6 +151,9 @@ class PartyOverlay : Gui(Minecraft.getInstance()) {
|
||||
val portraitFrameOffsetY = 2
|
||||
val selectedSlot = CobblemonClient.storage.selectedSlot
|
||||
|
||||
val partySize = party.slots.count { it != null }
|
||||
PartyTutorialToasts.onOverlayRender(partySize)
|
||||
|
||||
party.forEachIndexed { index, pokemon ->
|
||||
if (pokemon != null) {
|
||||
val selectedOffsetX = if (selectedSlot == index) 6 else 0
|
||||
@@ -226,7 +230,7 @@ class PartyOverlay : Gui(Minecraft.getInstance()) {
|
||||
var levelScrollOffset = 0F
|
||||
var levelScrollPositionOffset = 0F
|
||||
var levelScrollSize = 17F
|
||||
if (expGainedData != null && expGainedData.oldLevel != null) {
|
||||
if (expGainedData?.oldLevel != null) {
|
||||
val ticksWithDelta = (expGainedData.ticks + partialDeltaTicks) - (PartyOverlayDataControl.BAR_UPDATE_BEFORE_TIME + PartyOverlayDataControl.BAR_FLASH_TIME)
|
||||
val transition = ticksWithDelta / PartyOverlayDataControl.LEVEL_UP_PORTRAIT_TIME
|
||||
if ((0F..<1F).contains(transition)) {
|
||||
@@ -400,10 +404,48 @@ class PartyOverlay : Gui(Minecraft.getInstance()) {
|
||||
blue = expBlue
|
||||
)
|
||||
|
||||
//Handling EXP Text
|
||||
|
||||
var expGained = 0
|
||||
var expTextTransparency = 0F
|
||||
var expTextOffset = 0F
|
||||
|
||||
if (expGainedData != null) {
|
||||
expGained = expGainedData.expGained
|
||||
val ticksWithDelta = expGainedData.ticks + partialDeltaTicks
|
||||
if (ticksWithDelta <= PartyOverlayDataControl.EXP_POPUP_TIME.fadeIn) {
|
||||
val transition = ticksWithDelta / PartyOverlayDataControl.EXP_POPUP_TIME.fadeIn
|
||||
val step = (floor(transition * 3)) + 1
|
||||
expTextTransparency = step * 0.25F
|
||||
expTextOffset = 4 - step
|
||||
} else if (ticksWithDelta <= PartyOverlayDataControl.EXP_POPUP_TIME.fadeIn + PartyOverlayDataControl.EXP_POPUP_TIME.hold) {
|
||||
expTextTransparency = 1F
|
||||
expTextOffset = 0F
|
||||
} else {
|
||||
val adjustedTicks = ticksWithDelta - (PartyOverlayDataControl.EXP_POPUP_TIME.fadeIn + PartyOverlayDataControl.EXP_POPUP_TIME.hold)
|
||||
val transition = adjustedTicks / PartyOverlayDataControl.EXP_POPUP_TIME.fadeOut
|
||||
val step = (floor(transition * 3)) + 1
|
||||
expTextTransparency = 1F - (step * 0.25F)
|
||||
expTextOffset = -step
|
||||
}
|
||||
}
|
||||
|
||||
if (expTextTransparency > 0) {
|
||||
drawScaledText(
|
||||
context = context,
|
||||
text = lang("ui.exp.number", expGained.toString()).bold(),
|
||||
x = panelX + selectedOffsetX + 57F,
|
||||
y = indexY + 17F + expTextOffset,
|
||||
scale = SCALE,
|
||||
shadow = true,
|
||||
opacity = expTextTransparency
|
||||
)
|
||||
}
|
||||
|
||||
//Handling Popups
|
||||
var ticksForMove = -1F
|
||||
var ticksForEvo = -1F
|
||||
|
||||
//Handling Popups
|
||||
if (expGainedData != null) {
|
||||
val ticksWithDelta = expGainedData.ticks + partialDeltaTicks
|
||||
val ticks = ticksWithDelta - (PartyOverlayDataControl.BAR_UPDATE_BEFORE_TIME + PartyOverlayDataControl.BAR_FLASH_TIME)
|
||||
@@ -434,7 +476,7 @@ class PartyOverlay : Gui(Minecraft.getInstance()) {
|
||||
return 0F to 1F
|
||||
} else {
|
||||
val adjustedPopupTicks = ticks - (PartyOverlayDataControl.POPUP_TIME.fadeIn + PartyOverlayDataControl.POPUP_TIME.hold)
|
||||
val transition = adjustedPopupTicks / PartyOverlayDataControl.POPUP_TIME.fadeIn
|
||||
val transition = adjustedPopupTicks / PartyOverlayDataControl.POPUP_TIME.fadeOut
|
||||
val step = (floor(transition * 3)) + 1
|
||||
return (-step) to (1F - (step * 0.25F))
|
||||
}
|
||||
@@ -448,7 +490,7 @@ class PartyOverlay : Gui(Minecraft.getInstance()) {
|
||||
blitk(
|
||||
matrixStack = matrices,
|
||||
texture = newEvoPopup,
|
||||
x = (panelX + selectedOffsetX + 56.5F) / SCALE,
|
||||
x = (panelX + selectedOffsetX + (if (expTextTransparency > 0 && movePopupTransparency > 0) 78F else 56.5F)) / SCALE,
|
||||
y = (indexY + 4 + evoPopupYOffset) / SCALE,
|
||||
width = 37,
|
||||
height = 20,
|
||||
@@ -461,7 +503,7 @@ class PartyOverlay : Gui(Minecraft.getInstance()) {
|
||||
matrixStack = matrices,
|
||||
texture = newMovesPopup,
|
||||
x = (panelX + selectedOffsetX + 56.5F) / SCALE,
|
||||
y = (indexY + 17 + movePopupYOffset) / SCALE,
|
||||
y = (indexY + (if (expTextTransparency > 0) 4 else 17) + movePopupYOffset) / SCALE,
|
||||
width = 37,
|
||||
height = 20,
|
||||
scale = SCALE,
|
||||
|
||||
@@ -19,10 +19,10 @@ object PartyOverlayDataControl {
|
||||
const val BAR_UPDATE_BEFORE_TIME = 15
|
||||
const val BAR_UPDATE_AFTER_TIME = 15
|
||||
const val BAR_FLASH_TIME = 2
|
||||
const val BAR_UPDATE_NO_LEVEL_TIME = BAR_UPDATE_BEFORE_TIME + BAR_UPDATE_AFTER_TIME + BAR_FLASH_TIME
|
||||
val POPUP_TIME = FadeTimings(3, 40, 3)
|
||||
const val LEVEL_UP_PORTRAIT_TIME = 10
|
||||
|
||||
val BAR_UPDATE_NO_LEVEL_TIME = BAR_UPDATE_BEFORE_TIME + BAR_UPDATE_AFTER_TIME + BAR_FLASH_TIME
|
||||
val EXP_POPUP_TIME = FadeTimings(3, BAR_UPDATE_BEFORE_TIME + BAR_FLASH_TIME + POPUP_TIME.total() - 6, 3)
|
||||
|
||||
private enum class RenderTarget {
|
||||
NONE,
|
||||
@@ -35,21 +35,19 @@ object PartyOverlayDataControl {
|
||||
|
||||
private var barFillupSound: SoundInstance? = null
|
||||
private var levelUpJingleSound: SoundInstance? = null
|
||||
private var levelUpJingleSoundType: SoundEvent? = null
|
||||
|
||||
fun pokemonGainedExp(pokemonUuid : UUID, oldLevel: Int?, expGained: Int, countOfMovesLearned: Int, countOfEvosUnlocked: Int = 0) {
|
||||
var time = BAR_UPDATE_NO_LEVEL_TIME
|
||||
if (countOfMovesLearned > 0 || countOfEvosUnlocked > 0) {
|
||||
time = BAR_UPDATE_BEFORE_TIME + BAR_FLASH_TIME + POPUP_TIME.total()
|
||||
}
|
||||
|
||||
val data = overlayData[pokemonUuid]
|
||||
val newData = ExpGainedData(oldLevel, expGained, countOfMovesLearned, countOfEvosUnlocked).also { it.ticksMax = time }
|
||||
val newData = ExpGainedData(oldLevel, expGained, countOfMovesLearned, countOfEvosUnlocked).also { it.ticksMax = BAR_UPDATE_BEFORE_TIME + BAR_FLASH_TIME + POPUP_TIME.total() }
|
||||
if (data != null) {
|
||||
if (data.movesGainedData != null) {
|
||||
if (data.movesGainedData != null) { //Absorb Data
|
||||
newData.countOfMovesLearned += data.movesGainedData!!.movesCount
|
||||
data.movesGainedData = null
|
||||
}
|
||||
if (data.evoGainedData != null) {
|
||||
if (data.evoGainedData != null) { //Absorb Data
|
||||
newData.countOfEvosUnlocked += data.evoGainedData!!.evolutionCount
|
||||
data.evoGainedData = null
|
||||
}
|
||||
|
||||
val expData = data.expGainedData
|
||||
@@ -72,8 +70,7 @@ object PartyOverlayDataControl {
|
||||
val data = overlayData[pokemonUuid]
|
||||
val newData = EvolutionGainedData(evoCount).also { it.ticksMax = POPUP_TIME.total() }
|
||||
if (data != null) {
|
||||
if (data.expGainedData != null && data.expGainedData!!.ticks < BAR_UPDATE_BEFORE_TIME + BAR_FLASH_TIME) {
|
||||
data.expGainedData!!.ticksMax = BAR_UPDATE_BEFORE_TIME + BAR_FLASH_TIME + POPUP_TIME.total()
|
||||
if (data.expGainedData != null) {
|
||||
data.expGainedData!!.countOfEvosUnlocked += evoCount
|
||||
return
|
||||
}
|
||||
@@ -93,8 +90,7 @@ object PartyOverlayDataControl {
|
||||
val data = overlayData[pokemonUuid]
|
||||
val newData = MovesGainedData(movesCount).also { it.ticksMax = POPUP_TIME.total() }
|
||||
if (data != null) {
|
||||
if (data.expGainedData != null && data.expGainedData!!.ticks < BAR_UPDATE_BEFORE_TIME + BAR_FLASH_TIME) {
|
||||
data.expGainedData!!.ticksMax = BAR_UPDATE_BEFORE_TIME + BAR_FLASH_TIME + POPUP_TIME.total()
|
||||
if (data.expGainedData != null) {
|
||||
data.expGainedData!!.countOfMovesLearned += movesCount
|
||||
return
|
||||
}
|
||||
@@ -137,13 +133,28 @@ object PartyOverlayDataControl {
|
||||
fun tick(paused: Boolean) {
|
||||
val deletion = mutableListOf<UUID>()
|
||||
if (paused) return
|
||||
|
||||
if (levelUpJingleSound != null && !Minecraft.getInstance().soundManager.isActive(levelUpJingleSound!!)) {
|
||||
levelUpJingleSound = null
|
||||
levelUpJingleSoundType = null
|
||||
}
|
||||
|
||||
overlayData.forEach { (id, data) ->
|
||||
if (data.expGainedData != null) { // We update this in order and render these in order, and as such we don't tick others
|
||||
val expGainedData = data.expGainedData!!
|
||||
expGainedData.ticks += 1
|
||||
if (expGainedData.ticks == BAR_UPDATE_BEFORE_TIME && expGainedData.oldLevel != null) {
|
||||
stopSound(levelUpJingleSound)
|
||||
levelUpJingleSound = playSound(CobblemonSounds.LEVELUP)
|
||||
if (expGainedData.countOfEvosUnlocked > 0) {
|
||||
stopSound(levelUpJingleSound)
|
||||
levelUpJingleSound = playSound(CobblemonSounds.EVOLUTION_NOTIFICATION)
|
||||
levelUpJingleSoundType = CobblemonSounds.EVOLUTION_NOTIFICATION
|
||||
} else {
|
||||
if (levelUpJingleSoundType != CobblemonSounds.EVOLUTION_NOTIFICATION) {
|
||||
stopSound(levelUpJingleSound)
|
||||
levelUpJingleSound = playSound(CobblemonSounds.LEVELUP)
|
||||
levelUpJingleSoundType = CobblemonSounds.LEVELUP
|
||||
}
|
||||
}
|
||||
}
|
||||
if (expGainedData.ticks >= expGainedData.ticksMax) {
|
||||
data.expGainedData = null
|
||||
@@ -166,6 +177,7 @@ object PartyOverlayDataControl {
|
||||
}
|
||||
if (getCurrentRenderTarget(id) == RenderTarget.NONE) deletion.add(id)
|
||||
}
|
||||
|
||||
deletion.forEach {
|
||||
overlayData.remove(it)
|
||||
}
|
||||
@@ -216,7 +228,7 @@ object PartyOverlayDataControl {
|
||||
//SOUNDS
|
||||
private fun playSound(soundEvent: SoundEvent): SoundInstance? {
|
||||
if (!PartyOverlay.canRender()) return null
|
||||
val soundInstance = SimpleSoundInstance.forUI(soundEvent, 1F)
|
||||
val soundInstance = SimpleSoundInstance.forUI(soundEvent, 1F, 1F)
|
||||
Minecraft.getInstance().soundManager.play(soundInstance)
|
||||
return soundInstance
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ fun drawProfilePokemon(
|
||||
a: Float = 1F,
|
||||
headYaw: Float = 0f,
|
||||
headPitch: Float = 0f,
|
||||
blockLight: Int = 13
|
||||
) = drawProfilePokemon(
|
||||
species = renderablePokemon.species.resourceIdentifier,
|
||||
matrixStack = matrixStack,
|
||||
@@ -63,6 +64,7 @@ fun drawProfilePokemon(
|
||||
a = a,
|
||||
headYaw = headYaw,
|
||||
headPitch = headPitch,
|
||||
blockLight = blockLight
|
||||
)
|
||||
|
||||
fun drawProfilePokemon(
|
||||
@@ -82,6 +84,7 @@ fun drawProfilePokemon(
|
||||
a: Float = 1F,
|
||||
headYaw: Float = 0f,
|
||||
headPitch: Float = 0f,
|
||||
blockLight: Int = 13
|
||||
) {
|
||||
RenderSystem.applyModelViewMatrix()
|
||||
matrixStack.scale(scale, scale, -scale)
|
||||
@@ -138,7 +141,7 @@ fun drawProfilePokemon(
|
||||
val light1 = Vector3f(-1F, 1F, 1.0F)
|
||||
val light2 = Vector3f(1.3F, -1F, 1.0F)
|
||||
RenderSystem.setShaderLights(light1, light2)
|
||||
val packedLight = LightTexture.pack(11, 7)
|
||||
val packedLight = LightTexture.pack(blockLight, 0)
|
||||
|
||||
val colour = toHex(r, g, b, a)
|
||||
model.withLayerContext(bufferSource, state, VaryingModelRepository.getLayers(species, state)) {
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
/*
|
||||
* 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.gui
|
||||
|
||||
import com.cobblemon.mod.common.api.gui.blitk
|
||||
import net.minecraft.client.gui.GuiGraphics
|
||||
import net.minecraft.client.gui.components.AbstractWidget
|
||||
import net.minecraft.client.gui.components.events.GuiEventListener
|
||||
import net.minecraft.client.gui.narration.NarrationElementOutput
|
||||
import net.minecraft.network.chat.CommonComponents
|
||||
import net.minecraft.resources.ResourceLocation
|
||||
import kotlin.math.floor
|
||||
|
||||
open class VariableObjectSelectionList(x: Int, y: Int, width: Int, height: Int): AbstractWidget(x, y, width, height, CommonComponents.EMPTY) {
|
||||
val children = mutableListOf<Entry>()
|
||||
|
||||
var listHeight = 0
|
||||
var scrollAmount = 0.0
|
||||
|
||||
fun updateScroll(offset: Double) {
|
||||
setScroll(scrollAmount + offset)
|
||||
}
|
||||
|
||||
fun getMaxScroll(): Int {
|
||||
return (listHeight - height).coerceAtLeast(0)
|
||||
}
|
||||
|
||||
fun setScroll(scroll: Double) {
|
||||
scrollAmount = scroll.coerceIn(0.0, getMaxScroll().toDouble())
|
||||
}
|
||||
|
||||
fun removeEntry(index: Int) {
|
||||
listHeight -= children[index].height
|
||||
children.removeAt(index)
|
||||
updatePositions()
|
||||
}
|
||||
|
||||
fun removeEntry(entry: Entry) {
|
||||
listHeight -= entry.height
|
||||
children.remove(entry)
|
||||
updatePositions()
|
||||
}
|
||||
|
||||
fun removeLastEntry() {
|
||||
listHeight -= children.last().height
|
||||
children.removeLast()
|
||||
}
|
||||
|
||||
fun updatePositions() {
|
||||
var stackHeight = 0
|
||||
children.forEach {
|
||||
it.scrolledY = stackHeight
|
||||
stackHeight += it.height
|
||||
}
|
||||
updateScroll(0.0)
|
||||
}
|
||||
|
||||
fun addEntry(entry: Entry) {
|
||||
children.add(entry)
|
||||
entry.scrolledY = listHeight
|
||||
listHeight += entry.height
|
||||
}
|
||||
|
||||
override fun renderWidget(guiGraphics: GuiGraphics, mouseX: Int, mouseY: Int, partialTick: Float) {
|
||||
var stackHeight = -scrollAmount.toInt()
|
||||
guiGraphics.enableScissor(x, y, x + width, y + height)
|
||||
children.forEachIndexed { index, entry ->
|
||||
if (stackHeight in 1..<height || stackHeight + entry.height in 1..<height) {
|
||||
entry.render(guiGraphics, index, x, y + stackHeight, mouseX, mouseY, partialTick)
|
||||
}
|
||||
stackHeight += entry.height
|
||||
}
|
||||
guiGraphics.disableScissor()
|
||||
}
|
||||
|
||||
fun getEntryAtPosition(mouseX: Int, mouseY: Int): Entry? {
|
||||
if (mouseX in x..(x + width) && mouseY in y..(y + height)) {
|
||||
var stackHeight = -scrollAmount
|
||||
children.forEach {
|
||||
if (mouseY.toDouble() in (y + stackHeight)..(y + stackHeight + it.height)) {
|
||||
return it
|
||||
}
|
||||
stackHeight += it.height
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
fun ensureVisible(index: Int) {
|
||||
val entry = children[index]
|
||||
if (entry.scrolledY - scrollAmount < 0) {
|
||||
setScroll(entry.scrolledY.toDouble())
|
||||
} else if (entry.scrolledY + entry.height > height) {
|
||||
setScroll(entry.scrolledY.toDouble() + entry.height)
|
||||
}
|
||||
}
|
||||
|
||||
override fun mouseScrolled(mouseX: Double, mouseY: Double, horizontalAmount: Double, verticalAmount: Double): Boolean {
|
||||
updateScroll(-verticalAmount * (listHeight / children.size / 2))
|
||||
return true
|
||||
}
|
||||
|
||||
override fun mouseClicked(pMouseX: Double, pMouseY: Double, pButton: Int): Boolean {
|
||||
val entry = getEntryAtPosition(pMouseX.toInt(), pMouseY.toInt())
|
||||
if (entry != null) {
|
||||
return entry.mouseClicked(pMouseX, pMouseY, pButton)
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
override fun mouseReleased(pMouseX: Double, pMouseY: Double, pButton: Int): Boolean {
|
||||
return children.any {
|
||||
it.mouseReleased(pMouseX, pMouseY, pButton)
|
||||
} || super.mouseReleased(pMouseX, pMouseY, pButton)
|
||||
}
|
||||
|
||||
fun getRowTop(entry: Entry): Int {
|
||||
var stackHeight = -scrollAmount.toInt()
|
||||
children.forEach {
|
||||
if (it == entry) {
|
||||
return y + stackHeight
|
||||
}
|
||||
stackHeight += it.height
|
||||
}
|
||||
return y
|
||||
}
|
||||
|
||||
override fun defaultButtonNarrationText(pNarrationElementOutput: NarrationElementOutput) {}
|
||||
override fun updateWidgetNarration(narrationElementOutput: NarrationElementOutput) {}
|
||||
|
||||
abstract inner class Entry(var height: Int): GuiEventListener {
|
||||
var scrolledY: Int = 0
|
||||
private var widgetFocused = false
|
||||
|
||||
override fun setFocused(focused: Boolean) {
|
||||
this.widgetFocused = focused
|
||||
}
|
||||
|
||||
override fun isFocused(): Boolean = widgetFocused
|
||||
|
||||
abstract fun render(guiGraphics: GuiGraphics, index: Int, x: Int, y: Int, mouseX: Int, mouseY: Int, partialTick: Float)
|
||||
}
|
||||
|
||||
inner class EmptySeparator(height: Int): Entry(height) {
|
||||
override fun render(guiGraphics: GuiGraphics, index: Int, x: Int, y: Int, mouseX: Int, mouseY: Int, partialTick: Float) {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* 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.gui
|
||||
|
||||
import com.cobblemon.mod.common.api.gui.blitk
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import net.minecraft.client.gui.GuiGraphics
|
||||
import net.minecraft.client.gui.components.AbstractWidget
|
||||
import net.minecraft.client.gui.narration.NarrationElementOutput
|
||||
import net.minecraft.client.sounds.SoundManager
|
||||
import net.minecraft.network.chat.CommonComponents
|
||||
import net.minecraft.resources.ResourceLocation
|
||||
|
||||
class VariableObjectSelectionScrollbar(var parent: VariableObjectSelectionList, x: Int, y: Int, width: Int, height: Int): AbstractWidget(x, y, width, height, CommonComponents.EMPTY) {
|
||||
companion object {
|
||||
private val scrollerResource: ResourceLocation = ResourceLocation("minecraft", "textures/gui/sprites/widget/scroller.png")
|
||||
private val scrollerBackgroundResource: ResourceLocation = ResourceLocation("minecraft", "textures/gui/sprites/widget/scroller_background.png")
|
||||
|
||||
private const val SCROLLER_HEIGHT = 32
|
||||
}
|
||||
|
||||
private var scrolling = false
|
||||
private var scrollHoldOffset = 0.0
|
||||
|
||||
fun scrollbarVisible(): Boolean = parent.getMaxScroll() > 0
|
||||
|
||||
override fun renderWidget(guiGraphics: GuiGraphics, mouseX: Int, mouseY: Int, partialTick: Float) {
|
||||
if (scrollbarVisible()) {
|
||||
val scrollPosition = (parent.scrollAmount / parent.getMaxScroll()) * (height - SCROLLER_HEIGHT)
|
||||
|
||||
blitk(
|
||||
matrixStack = guiGraphics.pose(),
|
||||
texture = scrollerBackgroundResource,
|
||||
x = x,
|
||||
y = y,
|
||||
width = width,
|
||||
height = height,
|
||||
)
|
||||
|
||||
blitk(
|
||||
matrixStack = guiGraphics.pose(),
|
||||
texture = scrollerResource,
|
||||
x = x,
|
||||
y = y + scrollPosition,
|
||||
width = width,
|
||||
height = SCROLLER_HEIGHT,
|
||||
textureWidth = 6,
|
||||
textureHeight = SCROLLER_HEIGHT
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun mouseScrolled(mouseX: Double, mouseY: Double, scrollX: Double, scrollY: Double): Boolean {
|
||||
return parent.mouseScrolled(mouseX, mouseY, scrollX, scrollY)
|
||||
}
|
||||
|
||||
override fun mouseClicked(mouseX: Double, mouseY: Double, button: Int): Boolean {
|
||||
if (mouseX.toInt() in x..(x + width) && mouseY.toInt() in y..(y + height)) {
|
||||
if (button == 0) {
|
||||
var scrollPosition = (parent.scrollAmount / parent.getMaxScroll()) * (height - SCROLLER_HEIGHT)
|
||||
if (mouseY !in (y + scrollPosition)..(y + scrollPosition + SCROLLER_HEIGHT)) {
|
||||
val scrollRatio =
|
||||
((mouseY - y - SCROLLER_HEIGHT / 2) / (height - SCROLLER_HEIGHT)).coerceIn(0.0, 1.0)
|
||||
parent.setScroll(scrollRatio * parent.getMaxScroll())
|
||||
scrollPosition = (parent.scrollAmount / parent.getMaxScroll()) * (height - SCROLLER_HEIGHT)
|
||||
}
|
||||
scrollHoldOffset = mouseY - y - scrollPosition
|
||||
scrolling = true
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
override fun mouseDragged(mouseX: Double, mouseY: Double, button: Int, dragX: Double, dragY: Double): Boolean {
|
||||
if (button == 0 && scrolling) {
|
||||
val scrollRatio = ((mouseY - y - scrollHoldOffset) / (height - SCROLLER_HEIGHT)).coerceIn(0.0,1.0)
|
||||
parent.setScroll(scrollRatio * parent.getMaxScroll())
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
override fun mouseReleased(mouseX: Double, mouseY: Double, button: Int): Boolean {
|
||||
if (button == 0 && scrolling) {
|
||||
scrolling = false
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
override fun playDownSound(handler: SoundManager) {}
|
||||
override fun updateWidgetNarration(narrationElementOutput: NarrationElementOutput) {}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* 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.gui.party
|
||||
|
||||
import com.cobblemon.mod.common.CobblemonItems
|
||||
import com.cobblemon.mod.common.api.text.darkGray
|
||||
import com.cobblemon.mod.common.api.text.red
|
||||
import com.cobblemon.mod.common.client.CobblemonClient
|
||||
import com.cobblemon.mod.common.client.gui.toast.CobblemonToast
|
||||
import com.cobblemon.mod.common.client.keybind.boundKey
|
||||
import com.cobblemon.mod.common.client.keybind.keybinds.DownShiftPartyBinding
|
||||
import com.cobblemon.mod.common.client.keybind.keybinds.PartySendBinding
|
||||
import com.cobblemon.mod.common.client.keybind.keybinds.UpShiftPartyBinding
|
||||
import com.cobblemon.mod.common.net.messages.server.storage.party.PartyTutorialPacket
|
||||
import com.cobblemon.mod.common.util.lang
|
||||
import com.mojang.blaze3d.platform.InputConstants
|
||||
import net.minecraft.client.Minecraft
|
||||
import net.minecraft.client.gui.components.toasts.Toast
|
||||
import net.minecraft.client.gui.components.toasts.AdvancementToast
|
||||
import net.minecraft.network.chat.Component
|
||||
import net.minecraft.util.Mth
|
||||
|
||||
object PartyTutorialToasts {
|
||||
|
||||
private var toastAttached = false
|
||||
|
||||
val upKey = UpShiftPartyBinding.boundKey()
|
||||
val downKey = DownShiftPartyBinding.boundKey()
|
||||
|
||||
val upDisplay =
|
||||
if (upKey.type == InputConstants.Type.KEYSYM && upKey.value == InputConstants.KEY_UP)
|
||||
Component.literal("↑")
|
||||
else upKey.displayName
|
||||
|
||||
val downDisplay =
|
||||
if (downKey.type == InputConstants.Type.KEYSYM && downKey.value == InputConstants.KEY_DOWN)
|
||||
Component.literal("↓")
|
||||
else downKey.displayName
|
||||
|
||||
private val toast = CobblemonToast(
|
||||
Mth.createInsecureUUID(),
|
||||
CobblemonItems.POKEDEX_RED.defaultInstance,
|
||||
lang("ui.party.party_select_title").red(),
|
||||
lang(
|
||||
"ui.party.party_select_description",
|
||||
upDisplay,
|
||||
downDisplay,
|
||||
PartySendBinding.boundKey().displayName
|
||||
).darkGray(),
|
||||
AdvancementToast.BACKGROUND_SPRITE,
|
||||
-1F,
|
||||
0
|
||||
)
|
||||
|
||||
fun reset() {
|
||||
toastAttached = false
|
||||
}
|
||||
|
||||
fun onOverlayRender(partySize: Int) {
|
||||
if (partySize <= 1) return
|
||||
|
||||
if (!CobblemonClient.clientPlayerData.partySelectTutorialDone) {
|
||||
showToast()
|
||||
}
|
||||
}
|
||||
|
||||
fun onArrowKeySwitchedSlot() {
|
||||
if (CobblemonClient.clientPlayerData.partySelectTutorialDone) return
|
||||
if (CobblemonClient.storage.party.count { it != null } < 2) return
|
||||
PartyTutorialPacket().sendToServer()
|
||||
hideToast()
|
||||
}
|
||||
|
||||
fun onHoldKeyScrollSwitchedSlot() {
|
||||
if (CobblemonClient.clientPlayerData.partySelectTutorialDone) return
|
||||
if (CobblemonClient.storage.party.count { it != null } < 2) return
|
||||
PartyTutorialPacket().sendToServer()
|
||||
hideToast()
|
||||
}
|
||||
|
||||
private fun showToast() {
|
||||
val minecraft = Minecraft.getInstance()
|
||||
if (!toastAttached) {
|
||||
toast.nextVisibility = Toast.Visibility.SHOW
|
||||
minecraft.toasts.addToast(toast)
|
||||
toastAttached = true
|
||||
}
|
||||
}
|
||||
|
||||
private fun hideToast() {
|
||||
if (toastAttached) toast.nextVisibility = Toast.Visibility.HIDE
|
||||
}
|
||||
}
|
||||
@@ -40,6 +40,7 @@ import com.cobblemon.mod.common.util.asTranslated
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import com.cobblemon.mod.common.util.isInventoryKeyPressed
|
||||
import com.cobblemon.mod.common.util.lang
|
||||
import com.cobblemon.mod.common.util.toAssetPath
|
||||
import com.mojang.blaze3d.platform.InputConstants
|
||||
import net.minecraft.client.Minecraft
|
||||
import net.minecraft.client.gui.GuiGraphics
|
||||
@@ -463,7 +464,7 @@ class PCGUI(
|
||||
)
|
||||
|
||||
// Poké Ball
|
||||
val ballResource = cobblemonResource("textures/item/poke_balls/" + pokemon.caughtBall.name.path + ".png")
|
||||
val ballResource = pokemon.caughtBall.name.toAssetPath("textures/item/poke_balls/", ".png")
|
||||
blitk(
|
||||
matrixStack = matrices,
|
||||
texture = ballResource,
|
||||
|
||||
@@ -375,7 +375,8 @@ class PokemonInfoWidget(val pX: Int, val pY: Int, val updateForm: (PokedexForm)
|
||||
matrixStack = matrices,
|
||||
partialTicks = delta,
|
||||
rotation = Quaternionf().fromEulerXYZDegrees(rotationVector),
|
||||
state = state
|
||||
state = state,
|
||||
blockLight = 15
|
||||
)
|
||||
|
||||
matrices.popPose()
|
||||
|
||||
@@ -15,18 +15,19 @@ import com.cobblemon.mod.common.api.gui.ColourLibrary
|
||||
import com.cobblemon.mod.common.api.gui.MultiLineLabelK
|
||||
import com.cobblemon.mod.common.api.gui.blitk
|
||||
import com.cobblemon.mod.common.api.text.bold
|
||||
import com.cobblemon.mod.common.api.text.text
|
||||
import com.cobblemon.mod.common.api.types.ElementalType
|
||||
import com.cobblemon.mod.common.client.CobblemonClient
|
||||
import com.cobblemon.mod.common.client.CobblemonResources
|
||||
import com.cobblemon.mod.common.client.gui.CobblemonRenderable
|
||||
import com.cobblemon.mod.common.client.gui.ExitButton
|
||||
import com.cobblemon.mod.common.client.gui.TypeIcon
|
||||
import com.cobblemon.mod.common.client.gui.VariableObjectSelectionScrollbar
|
||||
import com.cobblemon.mod.common.client.gui.startselection.widgets.CategoryList
|
||||
import com.cobblemon.mod.common.client.gui.startselection.widgets.ExitButton
|
||||
import com.cobblemon.mod.common.client.gui.startselection.widgets.preview.ArrowButton
|
||||
import com.cobblemon.mod.common.client.gui.startselection.widgets.preview.SelectionButton
|
||||
import com.cobblemon.mod.common.client.gui.startselection.widgets.SelectionButton
|
||||
import com.cobblemon.mod.common.client.gui.startselection.widgets.preview.StarterRoundabout
|
||||
import com.cobblemon.mod.common.client.gui.summary.Summary.Companion.PARTY
|
||||
import com.cobblemon.mod.common.client.gui.summary.widgets.ModelWidget
|
||||
import com.cobblemon.mod.common.client.gui.summary.widgets.type.DualTypeWidget
|
||||
import com.cobblemon.mod.common.client.gui.summary.widgets.type.SingleTypeWidget
|
||||
import com.cobblemon.mod.common.client.gui.summary.widgets.type.TypeWidget
|
||||
import com.cobblemon.mod.common.client.render.drawScaledText
|
||||
import com.cobblemon.mod.common.config.starter.RenderableStarterCategory
|
||||
import com.cobblemon.mod.common.net.messages.server.SelectStarterPacket
|
||||
@@ -34,13 +35,14 @@ import com.cobblemon.mod.common.pokemon.RenderablePokemon
|
||||
import com.cobblemon.mod.common.util.asTranslated
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import com.cobblemon.mod.common.util.lang
|
||||
import com.cobblemon.mod.common.util.math.toRGB
|
||||
import net.minecraft.client.Minecraft
|
||||
import net.minecraft.client.gui.GuiGraphics
|
||||
import net.minecraft.client.gui.components.toasts.Toast
|
||||
import net.minecraft.client.gui.screens.Screen
|
||||
import net.minecraft.client.resources.sounds.SimpleSoundInstance
|
||||
import net.minecraft.network.chat.Component
|
||||
import net.minecraft.resources.ResourceLocation
|
||||
import net.minecraft.sounds.SoundEvent
|
||||
import java.io.FileNotFoundException
|
||||
|
||||
/**
|
||||
* Starterselection Screen Thingy
|
||||
@@ -49,32 +51,31 @@ import net.minecraft.network.chat.Component
|
||||
* @since 2022-06-18
|
||||
*/
|
||||
class StarterSelectionScreen(private val categories: List<RenderableStarterCategory>): Screen("cobblemon.ui.starter.title".asTranslated()), CobblemonRenderable {
|
||||
|
||||
companion object {
|
||||
// Size of UI at scale 1
|
||||
private const val BASE_WIDTH = 200
|
||||
private const val BASE_HEIGHT = 175
|
||||
private const val BASE_WIDTH = 239
|
||||
private const val BASE_HEIGHT = 197
|
||||
|
||||
// Resources
|
||||
private val base = cobblemonResource("textures/gui/starterselection/starterselection_base.png")
|
||||
private val baseUnderlay = cobblemonResource("textures/gui/starterselection/starterselection_base_underlay.png")
|
||||
private val baseFrame = cobblemonResource("textures/gui/starterselection/starterselection_base_frame.png")
|
||||
private val baseResource = cobblemonResource("textures/gui/starterselection/base.png")
|
||||
private val backgroundResource = cobblemonResource("textures/gui/starterselection/background.png")
|
||||
private val backgroundBallResource = cobblemonResource("textures/gui/starterselection/background_poke_ball.png")
|
||||
|
||||
// Type Backgrounds
|
||||
private val singleTypeBackground = cobblemonResource("textures/gui/starterselection/starterselection_type_slot1.png")
|
||||
private val doubleTypeBackground = cobblemonResource("textures/gui/starterselection/starterselection_type_slot2.png")
|
||||
private val platformResource = cobblemonResource("textures/gui/starterselection/platform_base.png")
|
||||
private val platformShadow = cobblemonResource("textures/gui/pokedex/platform_shadow.png")
|
||||
private val typeSpacerResource = cobblemonResource("textures/gui/starterselection/type_spacer_single.png")
|
||||
private val ballResource = cobblemonResource("textures/item/poke_balls/poke_ball.png")
|
||||
}
|
||||
|
||||
private var currentSelection = 0
|
||||
private lateinit var currentCategory: RenderableStarterCategory
|
||||
var currentSelection = 0
|
||||
lateinit var currentCategory: RenderableStarterCategory
|
||||
private lateinit var modelWidget: ModelWidget
|
||||
private lateinit var currentPokemon: RenderablePokemon
|
||||
private lateinit var typeWidget: TypeWidget
|
||||
private lateinit var starterRoundaboutCenter: StarterRoundabout
|
||||
private lateinit var starterRoundaboutLeft: StarterRoundabout
|
||||
private lateinit var starterRoundaboutRight: StarterRoundabout
|
||||
|
||||
override fun renderBlurredBackground(delta: Float) { }
|
||||
var ticksElapsed = 0
|
||||
var currentBallBackgroundFrame = 0
|
||||
|
||||
override fun renderBlurredBackground(delta: Float) {}
|
||||
|
||||
override fun renderMenuBackground(context: GuiGraphics) {}
|
||||
|
||||
@@ -95,55 +96,24 @@ class StarterSelectionScreen(private val categories: List<RenderableStarterCateg
|
||||
return
|
||||
}
|
||||
|
||||
addRenderableWidget(
|
||||
CategoryList(
|
||||
paneWidth = 71, paneHeight = BASE_HEIGHT - 11,
|
||||
topOffset = 6,
|
||||
entryHeight = 20, entryWidth = 57,
|
||||
categories = categories,
|
||||
listX = x - 2, listY = y + 8,
|
||||
starterSelectionScreen = this
|
||||
)
|
||||
)
|
||||
|
||||
val rightButton = ArrowButton(
|
||||
pX = x + 183, pY = y + 151,
|
||||
pWidth = 9, pHeight = 14,
|
||||
right = true
|
||||
) {
|
||||
right()
|
||||
}
|
||||
|
||||
val leftButton = ArrowButton(
|
||||
pX = x + 72, pY = y + 151,
|
||||
pWidth = 9, pHeight = 14,
|
||||
right = false
|
||||
) {
|
||||
left()
|
||||
}
|
||||
|
||||
addRenderableWidget(rightButton)
|
||||
addRenderableWidget(leftButton)
|
||||
|
||||
currentCategory = categories.first()
|
||||
currentPokemon = currentCategory.pokemon[currentSelection]
|
||||
|
||||
with(currentPokemon) {
|
||||
modelWidget = ModelWidget(
|
||||
pX = x + 85, pY = y + 50,
|
||||
pWidth = 102, pHeight = 100,
|
||||
pX = x + 6, pY = y + 17,
|
||||
pWidth = 118, pHeight = 100,
|
||||
pokemon = this,
|
||||
baseScale = 2.0f,
|
||||
baseScale = 2.7f,
|
||||
playCryOnClick = true,
|
||||
offsetY = -12.0
|
||||
)
|
||||
|
||||
typeWidget = typeWidget(this, x, y)
|
||||
}
|
||||
|
||||
addRenderableWidget(modelWidget)
|
||||
|
||||
val selectionButton = SelectionButton(
|
||||
pX = x + 106, pY = y + 124,
|
||||
pX = x + 13, pY = y + 180,
|
||||
pWidth = SelectionButton.BUTTON_WIDTH, pHeight = SelectionButton.BUTTON_HEIGHT
|
||||
) {
|
||||
CobblemonNetwork.sendToServer(
|
||||
@@ -152,182 +122,214 @@ class StarterSelectionScreen(private val categories: List<RenderableStarterCateg
|
||||
selected = currentSelection
|
||||
)
|
||||
)
|
||||
Minecraft.getInstance().setScreen(null)
|
||||
playSound(CobblemonSounds.GUI_CLICK)
|
||||
onClose()
|
||||
}
|
||||
|
||||
addRenderableWidget(selectionButton)
|
||||
|
||||
starterRoundaboutCenter = StarterRoundabout(
|
||||
pX = x + 119, pY = height / 2 + 84,
|
||||
pWidth = StarterRoundabout.MODEL_WIDTH, pHeight = StarterRoundabout.MODEL_HEIGHT,
|
||||
pokemon = currentPokemon,
|
||||
rotationVector = this.modelWidget.rotationVector
|
||||
)
|
||||
|
||||
starterRoundaboutLeft = StarterRoundabout(
|
||||
pX = x + 89, pY = height / 2 + 84,
|
||||
pWidth = StarterRoundabout.MODEL_WIDTH, pHeight = StarterRoundabout.MODEL_HEIGHT,
|
||||
pokemon = currentCategory.pokemon[leftOfCurrentSelection()],
|
||||
clickAction = { _, _ -> this.left() },
|
||||
rotationVector = this.modelWidget.rotationVector
|
||||
)
|
||||
|
||||
starterRoundaboutRight = StarterRoundabout(
|
||||
pX = x + 149, pY = height / 2 + 84,
|
||||
pWidth = StarterRoundabout.MODEL_WIDTH, pHeight = StarterRoundabout.MODEL_HEIGHT,
|
||||
pokemon = currentCategory.pokemon[rightOfCurrentSelection()],
|
||||
clickAction = { _, _ -> this.right() },
|
||||
rotationVector = this.modelWidget.rotationVector
|
||||
)
|
||||
|
||||
addRenderableWidget(starterRoundaboutLeft)
|
||||
addRenderableWidget(starterRoundaboutCenter)
|
||||
addRenderableWidget(starterRoundaboutRight)
|
||||
|
||||
// Add Exit Button
|
||||
addRenderableWidget(
|
||||
ExitButton(
|
||||
pX = x + 181, pY = y + 2,
|
||||
pWidth = 16, pHeight = 12,
|
||||
pXTexStart = 0, pYTexStart = 0, pYDiffText = 0
|
||||
) {
|
||||
Minecraft.getInstance().setScreen(null)
|
||||
Minecraft.getInstance().soundManager.play(SimpleSoundInstance.forUI(CobblemonSounds.GUI_CLICK, 1.0F))
|
||||
ExitButton(pX = x + 210, pY = y + 181) {
|
||||
playSound(CobblemonSounds.GUI_CLICK)
|
||||
onClose()
|
||||
}
|
||||
)
|
||||
|
||||
val categoryList = CategoryList(
|
||||
paneWidth = 97, paneHeight = 145,
|
||||
categories = categories,
|
||||
listX = x + 134, listY = y + 27,
|
||||
starterSelectionScreen = this
|
||||
)
|
||||
addRenderableWidget(categoryList)
|
||||
|
||||
addRenderableWidget(VariableObjectSelectionScrollbar(
|
||||
parent = categoryList,
|
||||
x = x + 231,
|
||||
y = y + 27,
|
||||
width = 3,
|
||||
height = 145
|
||||
))
|
||||
}
|
||||
|
||||
override fun render(context: GuiGraphics, mouseX: Int, mouseY: Int, delta: Float) {
|
||||
val matrices = context.pose()
|
||||
val x = (width - BASE_WIDTH) / 2
|
||||
val y = (height - BASE_HEIGHT) / 2
|
||||
// Render Underlay
|
||||
|
||||
//Background
|
||||
blitk(
|
||||
matrixStack = matrices,
|
||||
texture = baseUnderlay,
|
||||
x = x, y = y,
|
||||
width = BASE_WIDTH, height = BASE_HEIGHT
|
||||
texture = backgroundResource,
|
||||
x = x + 6,
|
||||
y = y + 17,
|
||||
width = 118,
|
||||
height = 100
|
||||
)
|
||||
// Render Base
|
||||
|
||||
blitk(
|
||||
matrixStack = matrices,
|
||||
texture = base,
|
||||
x = x, y = y,
|
||||
width = BASE_WIDTH, height = BASE_HEIGHT
|
||||
texture = backgroundBallResource,
|
||||
x = x + 10.5,
|
||||
y = y + 12.5,
|
||||
width = 109,
|
||||
height = 109,
|
||||
textureHeight = 1744,
|
||||
vOffset = currentBallBackgroundFrame * 109
|
||||
)
|
||||
// Render Frame
|
||||
val (r, g, b) = currentPokemon.form.primaryType.hue.toRGB()
|
||||
|
||||
//Platform
|
||||
blitk(
|
||||
matrixStack = matrices,
|
||||
texture = baseFrame,
|
||||
red = r,
|
||||
green = g,
|
||||
blue = b,
|
||||
x = x, y = y,
|
||||
width = BASE_WIDTH, height = BASE_HEIGHT
|
||||
texture = platformResource,
|
||||
x = x + 8.5,
|
||||
y = y + 88,
|
||||
width = 113,
|
||||
height = 32
|
||||
)
|
||||
// Render Text
|
||||
val typePlatform = getPlatformResource(currentPokemon.form.primaryType)
|
||||
if (typePlatform != null) {
|
||||
blitk(
|
||||
matrixStack = matrices,
|
||||
texture = typePlatform,
|
||||
x = x + 8.5,
|
||||
y = y + 82,
|
||||
width = 113,
|
||||
height = 30
|
||||
)
|
||||
}
|
||||
blitk(
|
||||
matrixStack = matrices,
|
||||
texture = platformShadow,
|
||||
x = (x + 43) / 0.5F,
|
||||
y = (y + 93.5) / 0.5F,
|
||||
width = 90,
|
||||
height = 20,
|
||||
scale = 0.5F
|
||||
)
|
||||
|
||||
//Base
|
||||
blitk(
|
||||
matrixStack = matrices,
|
||||
texture = baseResource,
|
||||
x = x,
|
||||
y = y,
|
||||
width = BASE_WIDTH,
|
||||
height = BASE_HEIGHT
|
||||
)
|
||||
|
||||
//Type Icon
|
||||
TypeIcon(
|
||||
x = x + 65,
|
||||
y = y + 120,
|
||||
type = currentPokemon.form.primaryType,
|
||||
secondaryType = currentPokemon.form.secondaryType,
|
||||
centeredX = true
|
||||
).render(context)
|
||||
|
||||
if (currentPokemon.form.secondaryType == null) {
|
||||
blitk(
|
||||
matrixStack = matrices,
|
||||
texture = typeSpacerResource,
|
||||
x = x + 47,
|
||||
y = y + 123,
|
||||
width = 36,
|
||||
height = 12
|
||||
)
|
||||
}
|
||||
|
||||
//Name
|
||||
blitk(
|
||||
matrixStack = matrices,
|
||||
texture = ballResource,
|
||||
x = (x + 4) / 0.5F,
|
||||
y = (y + 3) / 0.5F,
|
||||
width = 16,
|
||||
height = 16,
|
||||
scale = 0.5F
|
||||
)
|
||||
|
||||
drawScaledText(
|
||||
context = context,
|
||||
font = CobblemonResources.DEFAULT_LARGE,
|
||||
text = currentPokemon.species.translatedName.bold(),
|
||||
x = x + 14,
|
||||
y = y + 2,
|
||||
shadow = true
|
||||
)
|
||||
|
||||
// Pokédex Number
|
||||
// Add preceding zeroes if Pokédex number is less than 4 digits
|
||||
var dexNo = currentPokemon.species.nationalPokedexNumber.toString()
|
||||
while (dexNo.length < 4) {
|
||||
dexNo = "0$dexNo"
|
||||
}
|
||||
dexNo = "#$dexNo"
|
||||
|
||||
drawScaledText(
|
||||
context = context,
|
||||
font = CobblemonResources.DEFAULT_LARGE,
|
||||
text = dexNo.text().bold(),
|
||||
x = x + 79,
|
||||
y = y + 1,
|
||||
shadow = true
|
||||
)
|
||||
|
||||
//"Title"
|
||||
drawScaledText(
|
||||
context = context,
|
||||
font = CobblemonResources.DEFAULT_LARGE,
|
||||
text = lang("ui.starter.title").bold(),
|
||||
x = x + 125, y = y + 3F,
|
||||
centered = true,
|
||||
scale = 1.4F,
|
||||
maxCharacterWidth = 120,
|
||||
shadow = true
|
||||
x = x + 172,
|
||||
y = y + 11,
|
||||
shadow = true,
|
||||
centered = true
|
||||
)
|
||||
|
||||
// Render Name
|
||||
val pokemonName = currentPokemon.species.translatedName
|
||||
val scale = 0.8F
|
||||
drawScaledText(
|
||||
context = context,
|
||||
text = pokemonName,
|
||||
centered = true,
|
||||
scale = scale,
|
||||
maxCharacterWidth = 50,
|
||||
x = x + 94,
|
||||
y = y + 19.5,
|
||||
shadow = false
|
||||
)
|
||||
//Description Text
|
||||
val smallTextScale = 0.5F
|
||||
|
||||
// Render Description
|
||||
val scale2 = 0.60F
|
||||
matrices.pushPose()
|
||||
matrices.scale(scale2, scale2, 1F)
|
||||
|
||||
// TODO use all pokedex lines across multiple clickable pages in this screen
|
||||
matrices.scale(smallTextScale, smallTextScale, 1F)
|
||||
MultiLineLabelK.create(
|
||||
component = currentPokemon.form.pokedex.first().asTranslated(),
|
||||
width = 127,
|
||||
maxLines = 4
|
||||
width = 114 / smallTextScale,
|
||||
maxLines = 5
|
||||
).renderLeftAligned(
|
||||
context = context,
|
||||
x = (x + 119) / scale2 + 4, y = (y + 18) / scale2 + 4.0,
|
||||
ySpacing = (8.0 / scale2) - 1.25,
|
||||
colour = ColourLibrary.WHITE, shadow = false
|
||||
x = (x + 8) / smallTextScale,
|
||||
y = (y + 143) / smallTextScale,
|
||||
ySpacing = 5.5 / smallTextScale,
|
||||
colour = ColourLibrary.WHITE,
|
||||
shadow = true
|
||||
)
|
||||
matrices.popPose()
|
||||
|
||||
// Render the type background
|
||||
blitk(
|
||||
matrixStack = matrices,
|
||||
texture = currentPokemon.form.secondaryType?.let { doubleTypeBackground } ?: singleTypeBackground,
|
||||
x = (currentPokemon.form.secondaryType?.let { x + 76.75 } ?: (x + 85.25)), y = y + 29.4,
|
||||
width = currentPokemon.form.secondaryType?.let { 35.25 } ?: 19, height = 19.25
|
||||
)
|
||||
// Render the type widget
|
||||
typeWidget.render(context, mouseX, mouseY, delta)
|
||||
// Render the rest
|
||||
super.render(context, mouseX, mouseY, delta)
|
||||
}
|
||||
|
||||
fun changeCategory(category: RenderableStarterCategory) {
|
||||
fun getPlatformResource(type: ElementalType): ResourceLocation? {
|
||||
return try {
|
||||
cobblemonResource("textures/gui/starterselection/starter_platform_base_${type.showdownId}.png")
|
||||
} catch (error: FileNotFoundException) {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
fun selectPokemon(category: RenderableStarterCategory, slot: Int) {
|
||||
currentCategory = category
|
||||
currentSelection = 0
|
||||
updateSelection()
|
||||
}
|
||||
|
||||
private fun right() {
|
||||
Minecraft.getInstance().soundManager.play(SimpleSoundInstance.forUI(CobblemonSounds.GUI_CLICK, 1.0F))
|
||||
currentSelection = rightOfCurrentSelection()
|
||||
updateSelection()
|
||||
}
|
||||
|
||||
private fun rightOfCurrentSelection() : Int = if (currentSelection + 1 <= currentCategory.pokemon.size - 1) currentSelection + 1 else 0
|
||||
|
||||
private fun left() {
|
||||
Minecraft.getInstance().soundManager.play(SimpleSoundInstance.forUI(CobblemonSounds.GUI_CLICK, 1.0F))
|
||||
currentSelection = leftOfCurrentSelection()
|
||||
updateSelection()
|
||||
}
|
||||
|
||||
private fun leftOfCurrentSelection() : Int = if (currentSelection - 1 == -1) currentCategory.pokemon.size - 1 else currentSelection - 1
|
||||
|
||||
private fun updateSelection() {
|
||||
currentSelection = slot
|
||||
currentPokemon = currentCategory.pokemon[currentSelection].also {
|
||||
modelWidget.pokemon = it
|
||||
typeWidget = typeWidget(it, (width - BASE_WIDTH) / 2, (height - BASE_HEIGHT) / 2)
|
||||
}
|
||||
starterRoundaboutLeft.pokemon = currentCategory.pokemon[leftOfCurrentSelection()]
|
||||
starterRoundaboutCenter.pokemon = currentPokemon
|
||||
starterRoundaboutRight.pokemon = currentCategory.pokemon[rightOfCurrentSelection()]
|
||||
}
|
||||
|
||||
private fun typeWidget(pokemon: RenderablePokemon, x: Int, y: Int) : TypeWidget {
|
||||
return pokemon.form.secondaryType?.let {
|
||||
DualTypeWidget(
|
||||
pX = x + 77, pY = y + 30,
|
||||
pWidth = 18, pHeight = 18,
|
||||
pMessage = Component.literal("What?"),
|
||||
mainType = pokemon.form.primaryType, secondaryType = it
|
||||
)
|
||||
} ?: SingleTypeWidget(
|
||||
pX = x + 85, pY = y + 30,
|
||||
pWidth = 18, pHeight = 18,
|
||||
type = pokemon.form.primaryType,
|
||||
renderText = false
|
||||
)
|
||||
override fun tick() {
|
||||
ticksElapsed++
|
||||
|
||||
val delay = 3
|
||||
if (ticksElapsed % delay == 0) currentBallBackgroundFrame++
|
||||
if (currentBallBackgroundFrame == 16) currentBallBackgroundFrame = 0
|
||||
}
|
||||
|
||||
override fun keyPressed(keyCode: Int, scanCode: Int, modifiers: Int): Boolean {
|
||||
@@ -340,4 +342,8 @@ class StarterSelectionScreen(private val categories: List<RenderableStarterCateg
|
||||
}
|
||||
|
||||
override fun isPauseScreen() = true
|
||||
|
||||
fun playSound(soundEvent: SoundEvent) {
|
||||
Minecraft.getInstance().soundManager.play(SimpleSoundInstance.forUI(soundEvent, 1.0F))
|
||||
}
|
||||
}
|
||||
@@ -8,126 +8,212 @@
|
||||
|
||||
package com.cobblemon.mod.common.client.gui.startselection.widgets
|
||||
|
||||
import com.cobblemon.mod.common.Cobblemon
|
||||
import com.cobblemon.mod.common.CobblemonSounds
|
||||
import com.cobblemon.mod.common.api.gui.blitk
|
||||
import com.cobblemon.mod.common.api.text.bold
|
||||
import com.cobblemon.mod.common.client.gui.CobblemonRenderable
|
||||
import com.cobblemon.mod.common.client.gui.PokemonGUIAnimationStyle
|
||||
import com.cobblemon.mod.common.client.gui.VariableObjectSelectionList
|
||||
import com.cobblemon.mod.common.client.gui.drawProfilePokemon
|
||||
import com.cobblemon.mod.common.client.gui.startselection.StarterSelectionScreen
|
||||
import com.cobblemon.mod.common.client.render.drawScaledText
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.FloatingState
|
||||
import com.cobblemon.mod.common.config.starter.RenderableStarterCategory
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import com.cobblemon.mod.common.util.math.fromEulerXYZDegrees
|
||||
import net.minecraft.client.Minecraft
|
||||
import net.minecraft.client.gui.GuiGraphics
|
||||
import net.minecraft.client.gui.components.ObjectSelectionList
|
||||
import net.minecraft.client.resources.sounds.SimpleSoundInstance
|
||||
import net.minecraft.network.chat.Component
|
||||
import org.joml.Quaternionf
|
||||
import org.joml.Vector3f
|
||||
|
||||
class CategoryList(
|
||||
private val paneWidth: Int,
|
||||
private val paneHeight: Int,
|
||||
topOffset: Int,
|
||||
private val entryWidth: Int,
|
||||
entryHeight: Int,
|
||||
private val categories: List<RenderableStarterCategory>,
|
||||
val listX: Int,
|
||||
val listY: Int,
|
||||
private val minecraft: Minecraft = Minecraft.getInstance(),
|
||||
private val starterSelectionScreen: StarterSelectionScreen
|
||||
) : ObjectSelectionList<CategoryList.Category>(
|
||||
minecraft,
|
||||
) : VariableObjectSelectionList(
|
||||
listX,
|
||||
listY,
|
||||
paneWidth,
|
||||
paneHeight,
|
||||
topOffset,
|
||||
entryHeight
|
||||
paneHeight
|
||||
), CobblemonRenderable {
|
||||
|
||||
companion object {
|
||||
private const val CATEGORY_BUTTON_WIDTH = 51.5f
|
||||
private const val CATEGORY_BUTTON_HEIGHT = 16f
|
||||
private const val ENTRY_X_OFFSET = 10f
|
||||
private val categoryResource = cobblemonResource("textures/gui/starterselection/starterselection_slot.png")
|
||||
private val headerResource = cobblemonResource("textures/gui/starterselection/selection_container_header.png")
|
||||
private val footerResource = cobblemonResource("textures/gui/starterselection/selection_container_footer.png")
|
||||
private val edgeResource = cobblemonResource("textures/gui/starterselection/selection_container_edge.png")
|
||||
private val containerResource = cobblemonResource("textures/gui/starterselection/selection_container.png")
|
||||
|
||||
private val buttonResource = cobblemonResource("textures/gui/starterselection/starter_selection.png")
|
||||
private val buttonActiveResource = cobblemonResource("textures/gui/starterselection/starter_selection_active.png")
|
||||
|
||||
const val MARGIN = 4
|
||||
const val HEADER_HEIGHT = 7
|
||||
const val BUTTON_SEPERATION = 3
|
||||
const val CONTAINER_BUTTON_SIZE = 25
|
||||
const val CONTAINER_WIDTH = 89
|
||||
}
|
||||
|
||||
init {
|
||||
this.x = listX
|
||||
this.y = listY
|
||||
this.correctSize()
|
||||
createEntries().forEach { addEntry(it) }
|
||||
//this.setRenderBackground(false)
|
||||
addEntry(EmptySeparator(MARGIN))
|
||||
createEntries().forEach {
|
||||
addEntry(it)
|
||||
addEntry(EmptySeparator(MARGIN))
|
||||
}
|
||||
}
|
||||
|
||||
private fun createEntries() = categories.map {
|
||||
Category(it)
|
||||
private fun createEntries() = categories.map { category ->
|
||||
val rows = (category.pokemon.size - 1) / 3 + 1
|
||||
val height = CONTAINER_BUTTON_SIZE * rows + BUTTON_SEPERATION * (rows + 1) + HEADER_HEIGHT + 3
|
||||
Category(category, height)
|
||||
}
|
||||
|
||||
override fun renderListBackground(context: GuiGraphics) {}
|
||||
|
||||
override fun renderWidget(context: GuiGraphics, mouseX: Int, mouseY: Int, delta: Float) {
|
||||
super.renderWidget(context, mouseX, mouseY, delta)
|
||||
correctSize()
|
||||
}
|
||||
|
||||
private fun correctSize() {
|
||||
this.setRectangle(this.paneWidth, this.paneHeight, this.listX, this.listY)
|
||||
}
|
||||
|
||||
private fun scale(n: Int): Int = (this.minecraft.window.guiScale * n).toInt()
|
||||
override fun getRowWidth() = this.entryWidth
|
||||
override fun getScrollbarPosition(): Int {
|
||||
return this.listX + this.width - 5
|
||||
}
|
||||
|
||||
|
||||
inner class Category(private val category: RenderableStarterCategory) : Entry<Category>() {
|
||||
inner class Category(private val category: RenderableStarterCategory, height: Int) : Entry(height) {
|
||||
|
||||
override fun render(
|
||||
context: GuiGraphics,
|
||||
guiGraphics: GuiGraphics,
|
||||
index: Int,
|
||||
y: Int,
|
||||
x: Int,
|
||||
entryWidth: Int,
|
||||
entryHeight: Int,
|
||||
y: Int,
|
||||
mouseX: Int,
|
||||
mouseY: Int,
|
||||
hovered: Boolean,
|
||||
tickDelta: Float
|
||||
partialTick: Float
|
||||
) {
|
||||
val matrices = context.pose()
|
||||
val isHovered = mouseX >= x && mouseY >= y && mouseX < x + entryWidth && mouseY < y + (entryHeight - 1)
|
||||
if (isHovered) {
|
||||
blitk(
|
||||
matrixStack = matrices,
|
||||
x = x + 2.5f, y = y,
|
||||
texture = categoryResource,
|
||||
width = CATEGORY_BUTTON_WIDTH, height = CATEGORY_BUTTON_HEIGHT,
|
||||
red = 0.75f, green = 0.75f, blue = 0.75f
|
||||
)
|
||||
} else
|
||||
blitk(
|
||||
matrixStack = matrices,
|
||||
x = x + 2.5f, y = y,
|
||||
texture = categoryResource,
|
||||
width = CATEGORY_BUTTON_WIDTH, height = CATEGORY_BUTTON_HEIGHT
|
||||
)
|
||||
drawScaledText(
|
||||
context = context,
|
||||
text = category.displayNameText,
|
||||
x = x + 28,
|
||||
y = y + 4.5F,
|
||||
scale = 1F,
|
||||
maxCharacterWidth = 50,
|
||||
shadow = true,
|
||||
centered = true
|
||||
val rows = (category.pokemon.size - 1) / 3 + 1
|
||||
val matrices = guiGraphics.pose()
|
||||
//Header
|
||||
blitk(
|
||||
matrixStack = matrices,
|
||||
texture = headerResource,
|
||||
x = x + MARGIN,
|
||||
y = y,
|
||||
width = CONTAINER_WIDTH,
|
||||
height = HEADER_HEIGHT
|
||||
)
|
||||
|
||||
val smallTextScale = 0.5F
|
||||
drawScaledText(
|
||||
context = guiGraphics,
|
||||
text = category.displayNameText.bold(),
|
||||
x = x + MARGIN + CONTAINER_WIDTH / 2,
|
||||
y = y + 2,
|
||||
shadow = true,
|
||||
centered = true,
|
||||
scale = smallTextScale
|
||||
)
|
||||
|
||||
//Container
|
||||
var stackHeight = HEADER_HEIGHT
|
||||
blitk(
|
||||
matrixStack = matrices,
|
||||
texture = edgeResource,
|
||||
x = x + MARGIN,
|
||||
y = y + stackHeight,
|
||||
width = CONTAINER_WIDTH,
|
||||
height = 1
|
||||
)
|
||||
stackHeight += 1
|
||||
|
||||
val containerInnerHeight = CONTAINER_BUTTON_SIZE * rows + BUTTON_SEPERATION * (rows + 1)
|
||||
|
||||
blitk(
|
||||
matrixStack = matrices,
|
||||
texture = containerResource,
|
||||
x = x + MARGIN,
|
||||
y = y + stackHeight,
|
||||
width = CONTAINER_WIDTH,
|
||||
height = containerInnerHeight
|
||||
)
|
||||
stackHeight += containerInnerHeight
|
||||
|
||||
blitk(
|
||||
matrixStack = matrices,
|
||||
texture = edgeResource,
|
||||
x = x + MARGIN,
|
||||
y = y + stackHeight,
|
||||
width = CONTAINER_WIDTH,
|
||||
height = 1
|
||||
)
|
||||
stackHeight += 1
|
||||
|
||||
//Footer
|
||||
blitk(
|
||||
matrixStack = matrices,
|
||||
texture = footerResource,
|
||||
x = x + MARGIN,
|
||||
y = y + stackHeight,
|
||||
width = CONTAINER_WIDTH,
|
||||
height = 1
|
||||
)
|
||||
|
||||
//Buttons
|
||||
for (index in 0..<category.pokemon.size) {
|
||||
val row = index / 3
|
||||
val column = index % 3
|
||||
|
||||
val startX = x + MARGIN + 5 + column * (CONTAINER_BUTTON_SIZE + 2)
|
||||
val startY = y + HEADER_HEIGHT + 1 + BUTTON_SEPERATION + row * (BUTTON_SEPERATION + CONTAINER_BUTTON_SIZE)
|
||||
|
||||
val active = starterSelectionScreen.currentCategory == category && starterSelectionScreen.currentSelection == index
|
||||
val hovered = getEntryAtPosition(mouseX, mouseY) == this && mouseX in startX..(startX + CONTAINER_BUTTON_SIZE) && mouseY in startY..(startY + CONTAINER_BUTTON_SIZE)
|
||||
|
||||
blitk(
|
||||
matrixStack = matrices,
|
||||
texture = if (active) buttonActiveResource else buttonResource,
|
||||
x = startX,
|
||||
y = startY,
|
||||
width = CONTAINER_BUTTON_SIZE,
|
||||
height = CONTAINER_BUTTON_SIZE,
|
||||
textureHeight = CONTAINER_BUTTON_SIZE * 2,
|
||||
vOffset = if (hovered) CONTAINER_BUTTON_SIZE else 0
|
||||
)
|
||||
|
||||
matrices.pushPose()
|
||||
matrices.translate(startX + (CONTAINER_BUTTON_SIZE / 2.0), startY.toDouble() - 6, 0.0)
|
||||
matrices.scale(3.5F, 3.5F, 1F)
|
||||
|
||||
val state = FloatingState()
|
||||
drawProfilePokemon(
|
||||
species = category.pokemon[index].species.resourceIdentifier,
|
||||
matrixStack = matrices,
|
||||
rotation = Quaternionf().fromEulerXYZDegrees(Vector3f(13F, 35F, 0F)),
|
||||
state = state,
|
||||
scale = 4.5F,
|
||||
partialTicks = 0F
|
||||
)
|
||||
matrices.popPose()
|
||||
}
|
||||
}
|
||||
|
||||
override fun mouseClicked(mouseX: Double, mouseY: Double, button: Int): Boolean {
|
||||
starterSelectionScreen.changeCategory(category = category)
|
||||
minecraft.soundManager.play(SimpleSoundInstance.forUI(CobblemonSounds.GUI_CLICK, 1.0F))
|
||||
return true
|
||||
val entryY = getRowTop(this)
|
||||
val hoveredButton = getButtonHovered(x, entryY, mouseX, mouseY)
|
||||
if (hoveredButton != -1) {
|
||||
starterSelectionScreen.selectPokemon(category, hoveredButton)
|
||||
Minecraft.getInstance().soundManager.play(SimpleSoundInstance.forUI(CobblemonSounds.GUI_CLICK, 1.0F))
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
override fun getNarration(): Component {
|
||||
return Component.literal("Yes")
|
||||
private fun getButtonHovered(x: Int, y: Int, mouseX: Double, mouseY: Double): Int {
|
||||
for (index in 0..<category.pokemon.size) {
|
||||
val row = index / 3
|
||||
val column = index % 3
|
||||
|
||||
val startX = x + MARGIN + 5 + column * (CONTAINER_BUTTON_SIZE + 2)
|
||||
val startY = y + HEADER_HEIGHT + 1 + BUTTON_SEPERATION + row * (BUTTON_SEPERATION + CONTAINER_BUTTON_SIZE)
|
||||
|
||||
if (getEntryAtPosition(mouseX.toInt(), mouseY.toInt()) == this && mouseX.toInt() in startX..(startX + CONTAINER_BUTTON_SIZE) && mouseY.toInt() in startY..(startY + CONTAINER_BUTTON_SIZE)) {
|
||||
return index
|
||||
}
|
||||
}
|
||||
return -1
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,11 +6,13 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.client.gui.startselection.widgets.preview
|
||||
package com.cobblemon.mod.common.client.gui.startselection.widgets
|
||||
|
||||
import com.cobblemon.mod.common.CobblemonSounds
|
||||
import com.cobblemon.mod.common.api.gui.ColourLibrary
|
||||
import com.cobblemon.mod.common.api.gui.blitk
|
||||
import com.cobblemon.mod.common.api.text.bold
|
||||
import com.cobblemon.mod.common.client.CobblemonResources
|
||||
import com.cobblemon.mod.common.client.gui.CobblemonRenderable
|
||||
import com.cobblemon.mod.common.client.render.drawScaledText
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
@@ -26,45 +28,39 @@ class SelectionButton(
|
||||
pX: Int, pY: Int,
|
||||
pWidth: Int, pHeight: Int,
|
||||
onPress: OnPress
|
||||
): Button(pX, pY, pWidth, pHeight, Component.literal("SelectionButton"), onPress, DEFAULT_NARRATION), CobblemonRenderable {
|
||||
): Button(pX, pY, pWidth, pHeight, Component.literal("SelectionButton"), onPress, DEFAULT_NARRATION),
|
||||
CobblemonRenderable {
|
||||
|
||||
companion object {
|
||||
private val buttonTexture = cobblemonResource("textures/gui/starterselection/starterselection_button.png")
|
||||
const val BUTTON_WIDTH = 56
|
||||
const val BUTTON_HEIGHT = 12
|
||||
private const val SCALE = 0.7f
|
||||
private val buttonResource = cobblemonResource("textures/gui/starterselection/choose_button.png")
|
||||
const val BUTTON_WIDTH = 106
|
||||
const val BUTTON_HEIGHT = 14
|
||||
const val TEXT_HEIGHT = 10
|
||||
}
|
||||
|
||||
override fun playDownSound(soundManager: SoundManager) {
|
||||
Minecraft.getInstance().soundManager.play(SimpleSoundInstance.forUI(CobblemonSounds.GUI_CLICK, 1.0F))
|
||||
}
|
||||
override fun playDownSound(soundManager: SoundManager) {}
|
||||
|
||||
override fun renderWidget(context: GuiGraphics, mouseX: Int, mouseY: Int, delta: Float) {
|
||||
val matrices = context.pose()
|
||||
if (isHovered)
|
||||
blitk(
|
||||
matrixStack = matrices,
|
||||
texture = buttonTexture,
|
||||
x = x + 0.6, y = y + 0.6,
|
||||
width = BUTTON_WIDTH - 0.25, height = BUTTON_HEIGHT - 0.25,
|
||||
red = 0.75f, green = 0.75f, blue = 0.75f
|
||||
)
|
||||
else
|
||||
blitk(
|
||||
matrixStack = matrices,
|
||||
texture = buttonTexture,
|
||||
x = x + 0.6, y = y + 0.6,
|
||||
width = BUTTON_WIDTH - 0.25, height = BUTTON_HEIGHT - 0.25
|
||||
)
|
||||
blitk(
|
||||
matrixStack = matrices,
|
||||
texture = buttonResource,
|
||||
x = x,
|
||||
y = y,
|
||||
width = BUTTON_WIDTH,
|
||||
height = BUTTON_HEIGHT,
|
||||
textureHeight = BUTTON_HEIGHT * 2,
|
||||
vOffset = if (isHovered) BUTTON_HEIGHT else 0
|
||||
)
|
||||
|
||||
drawScaledText(
|
||||
context = context,
|
||||
text = lang("ui.starter.choosebutton"),
|
||||
x = x + BUTTON_WIDTH / 2, y = y + BUTTON_HEIGHT / 2 - 2.4,
|
||||
colour = ColourLibrary.WHITE,
|
||||
centered = true,
|
||||
maxCharacterWidth = 68,
|
||||
scale = SCALE,
|
||||
shadow = true
|
||||
font = CobblemonResources.DEFAULT_LARGE,
|
||||
text = lang("ui.starter.choosebutton").bold(),
|
||||
x = x + BUTTON_WIDTH / 2,
|
||||
y = y + BUTTON_HEIGHT / 2 - TEXT_HEIGHT / 2,
|
||||
shadow = true,
|
||||
centered = true
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -45,6 +45,7 @@ import com.cobblemon.mod.common.pokemon.Pokemon
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import com.cobblemon.mod.common.util.isInventoryKeyPressed
|
||||
import com.cobblemon.mod.common.util.lang
|
||||
import com.cobblemon.mod.common.util.toAssetPath
|
||||
import com.mojang.blaze3d.platform.InputConstants
|
||||
import net.minecraft.client.Minecraft
|
||||
import net.minecraft.client.gui.GuiGraphics
|
||||
@@ -558,7 +559,7 @@ class Summary private constructor(party: Collection<Pokemon?>, private val edita
|
||||
}
|
||||
|
||||
// Poké Ball
|
||||
val ballResource = cobblemonResource("textures/item/poke_balls/" + selectedPokemon.caughtBall.name.path + ".png")
|
||||
val ballResource = selectedPokemon.caughtBall.name.toAssetPath("textures/item/poke_balls/", ".png")
|
||||
blitk(
|
||||
matrixStack = matrices,
|
||||
texture = ballResource,
|
||||
|
||||
@@ -31,6 +31,7 @@ class ModelWidget(
|
||||
var offsetY: Double = 0.0,
|
||||
val playCryOnClick: Boolean = false,
|
||||
val shouldFollowCursor: Boolean = false,
|
||||
val blockLight: Int = 13
|
||||
): SoundlessWidget(pX, pY, pWidth, pHeight, Component.literal("Summary - ModelWidget")) {
|
||||
|
||||
companion object {
|
||||
@@ -115,6 +116,7 @@ class ModelWidget(
|
||||
partialTicks = partialTicks,
|
||||
headYaw = currentYawAndPitch.first,
|
||||
headPitch = currentYawAndPitch.second,
|
||||
blockLight = blockLight
|
||||
)
|
||||
|
||||
heldItemRenderer.renderOnModel(
|
||||
|
||||
@@ -19,11 +19,11 @@ import com.cobblemon.mod.common.client.render.drawScaledText
|
||||
import com.cobblemon.mod.common.net.messages.server.RequestMoveSwapPacket
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import com.cobblemon.mod.common.util.lang
|
||||
import java.math.RoundingMode
|
||||
import java.text.DecimalFormat
|
||||
import net.minecraft.client.Minecraft
|
||||
import net.minecraft.client.gui.GuiGraphics
|
||||
import net.minecraft.network.chat.Component
|
||||
import java.math.RoundingMode
|
||||
import java.text.DecimalFormat
|
||||
|
||||
class MovesWidget(
|
||||
pX: Int, pY: Int,
|
||||
|
||||
@@ -20,6 +20,8 @@ import net.minecraft.resources.ResourceLocation
|
||||
import net.minecraft.util.Mth
|
||||
import java.util.*
|
||||
import kotlin.math.min
|
||||
import net.minecraft.client.gui.Font
|
||||
import net.minecraft.util.FormattedCharSequence
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
class CobblemonToast(
|
||||
@@ -38,11 +40,18 @@ class CobblemonToast(
|
||||
private var lastTime = 0L
|
||||
internal var nextVisibility: Toast.Visibility = Toast.Visibility.SHOW
|
||||
|
||||
fun getLines(font: Font, maxWidth: Int): List<FormattedCharSequence> {
|
||||
return font.split(this.description, maxWidth)
|
||||
}
|
||||
|
||||
override fun render(context: GuiGraphics, manager: ToastComponent, startTime: Long): Toast.Visibility {
|
||||
context.blitSprite(this.frameTexture, 0, 0, this.width(), this.height())
|
||||
val maxWidth = 125
|
||||
val textRenderer = manager.minecraft.font
|
||||
|
||||
context.blitSprite(this.frameTexture, 0, 0, this.width(), this.height() + (getLines(textRenderer, maxWidth).size - 1) * 10)
|
||||
|
||||
context.drawString(textRenderer, this.title, 30, 7, this.title.style.color?.value ?: -1, false)
|
||||
context.drawString(textRenderer, this.description, 30, 18, this.description.style.color?.value ?: -1, false)
|
||||
context.drawWordWrap(textRenderer, this.description, 30, 18, maxWidth, this.description.style.color?.value ?: -1)
|
||||
context.renderFakeItem(this.icon, 8, 8)
|
||||
if (this.hasProgressBar()) {
|
||||
context.fill(3, 28, 157, 29, -1)
|
||||
|
||||
@@ -32,6 +32,7 @@ import com.cobblemon.mod.common.pokemon.Pokemon
|
||||
import com.cobblemon.mod.common.util.asTranslated
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import com.cobblemon.mod.common.util.lang
|
||||
import com.cobblemon.mod.common.util.toAssetPath
|
||||
import com.mojang.blaze3d.platform.InputConstants
|
||||
import net.minecraft.client.Minecraft
|
||||
import net.minecraft.client.gui.GuiGraphics
|
||||
@@ -584,7 +585,7 @@ class TradeGUI(
|
||||
|
||||
// Poké Ball
|
||||
val nameXOffset = if (isOpposing) 75 else 0
|
||||
val ballResource = cobblemonResource("textures/item/poke_balls/" + pokemon.caughtBall.name.path + ".png")
|
||||
val ballResource = pokemon.caughtBall.name.toAssetPath("textures/item/poke_balls/", ".png")
|
||||
blitk(
|
||||
matrixStack = context.pose(),
|
||||
texture = ballResource,
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
package com.cobblemon.mod.common.client.keybind.keybinds
|
||||
|
||||
import com.cobblemon.mod.common.client.CobblemonClient
|
||||
import com.cobblemon.mod.common.client.gui.party.PartyTutorialToasts
|
||||
import com.cobblemon.mod.common.client.keybind.CobblemonKeyBinding
|
||||
import com.cobblemon.mod.common.client.keybind.KeybindCategories
|
||||
import com.mojang.blaze3d.platform.InputConstants
|
||||
@@ -21,5 +22,6 @@ object DownShiftPartyBinding : CobblemonKeyBinding(
|
||||
) {
|
||||
override fun onPress() {
|
||||
CobblemonClient.storage.shiftSelected(true)
|
||||
PartyTutorialToasts.onArrowKeySwitchedSlot()
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
package com.cobblemon.mod.common.client.keybind.keybinds
|
||||
|
||||
import com.cobblemon.mod.common.client.CobblemonClient
|
||||
import com.cobblemon.mod.common.client.gui.party.PartyTutorialToasts
|
||||
import com.cobblemon.mod.common.client.keybind.CobblemonKeyBinding
|
||||
import com.cobblemon.mod.common.client.keybind.KeybindCategories
|
||||
import com.mojang.blaze3d.platform.InputConstants
|
||||
@@ -21,5 +22,6 @@ object UpShiftPartyBinding : CobblemonKeyBinding(
|
||||
) {
|
||||
override fun onPress() {
|
||||
CobblemonClient.storage.shiftSelected(false)
|
||||
PartyTutorialToasts.onArrowKeySwitchedSlot()
|
||||
}
|
||||
}
|
||||
@@ -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.client.net.data
|
||||
|
||||
import com.cobblemon.mod.common.api.interaction.PokemonInteractions
|
||||
import com.cobblemon.mod.common.api.net.ClientNetworkPacketHandler
|
||||
import com.cobblemon.mod.common.net.messages.client.data.PokemonInteractionsSyncPacket
|
||||
import net.minecraft.client.Minecraft
|
||||
|
||||
object PokemonInteractionsSyncHandler : ClientNetworkPacketHandler<PokemonInteractionsSyncPacket> {
|
||||
|
||||
override fun handle(
|
||||
packet: PokemonInteractionsSyncPacket,
|
||||
client: Minecraft,
|
||||
) {
|
||||
PokemonInteractions.speciesInteractions.clear()
|
||||
PokemonInteractions.speciesInteractions.addAll(packet.speciesInteractions)
|
||||
PokemonInteractions.generalInteractions.clear()
|
||||
PokemonInteractions.generalInteractions.addAll(packet.generalInteractions)
|
||||
}
|
||||
}
|
||||
@@ -309,6 +309,7 @@ class SnowstormParticle(
|
||||
boundingBox = AABB.ofSize(Vec3(x, y, z), radius, radius, radius)
|
||||
if (dx == 0.0 && dy == 0.0 && dz == 0.0) {
|
||||
updatePosition()
|
||||
expandBoundingBoxForCulling(radius)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -366,6 +367,16 @@ class SnowstormParticle(
|
||||
}
|
||||
}
|
||||
updatePosition()
|
||||
expandBoundingBoxForCulling(radius)
|
||||
}
|
||||
|
||||
private fun expandBoundingBoxForCulling(collisionRadius: Double) {
|
||||
val visualSizeX = abs(runtime.resolveDouble(storm.effect.particle.sizeX))
|
||||
val visualSizeY = abs(runtime.resolveDouble(storm.effect.particle.sizeY))
|
||||
val visualExtent = maxOf(visualSizeX, visualSizeY)
|
||||
if (visualExtent > collisionRadius) {
|
||||
boundingBox = AABB.ofSize(Vec3(x, y, z), visualExtent, visualExtent, visualExtent)
|
||||
}
|
||||
}
|
||||
|
||||
fun updatePosition() {
|
||||
|
||||
@@ -290,8 +290,14 @@ class ModelLayer {
|
||||
val emissive: Boolean = false
|
||||
val translucent: Boolean = false
|
||||
val translucent_cull: Boolean = false
|
||||
val scrolling: ScrollingTextureSettings? = null
|
||||
}
|
||||
|
||||
class ScrollingTextureSettings(
|
||||
val speedU: Float = 0.01F,
|
||||
val speedV: Float = 0.01F
|
||||
)
|
||||
|
||||
enum class SpriteType {
|
||||
PORTRAIT,
|
||||
PROFILE
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.cobblemon.mod.common.client.ClientMoLangFunctions.setupClient
|
||||
import com.cobblemon.mod.common.client.entity.PokemonClientDelegate
|
||||
import com.cobblemon.mod.common.client.render.AnimatedModelTextureSupplier
|
||||
import com.cobblemon.mod.common.client.render.ModelLayer
|
||||
import com.cobblemon.mod.common.client.render.ScrollingTextureSettings
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.animation.*
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.bedrock.animation.BedrockActiveAnimation
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.bedrock.animation.BedrockAnimationRepository
|
||||
@@ -48,6 +49,7 @@ import com.mojang.blaze3d.vertex.PoseStack
|
||||
import com.mojang.blaze3d.vertex.VertexConsumer
|
||||
import com.mojang.blaze3d.vertex.VertexFormat
|
||||
import com.mojang.math.Axis
|
||||
import net.minecraft.Util
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.client.renderer.MultiBufferSource
|
||||
import net.minecraft.client.renderer.RenderStateShard
|
||||
@@ -453,15 +455,16 @@ open class PosableModel(@Transient override val rootPart: Bone) : ModelFrame {
|
||||
val provider = bufferProvider
|
||||
if (provider != null) {
|
||||
for (layer in currentLayers) {
|
||||
var renderLayer : RenderType
|
||||
if (layer.texture is AnimatedModelTextureSupplier && layer.texture.interpolation) {
|
||||
//Handle Interpolation
|
||||
val texture = layer.texture.interpolatedTexture(currentState ?: FloatingState()) ?: continue
|
||||
renderLayer = makeLayer(DynamicStateShard(texture), layer.emissive, layer.translucent, layer.translucent_cull)
|
||||
}
|
||||
else {
|
||||
val texture = layer.texture?.invoke(currentState ?: FloatingState()) ?: continue
|
||||
renderLayer = getLayer(texture, layer.emissive, layer.translucent, layer.translucent_cull)
|
||||
val texture = layer.texture?.invoke(currentState ?: FloatingState()) ?: continue
|
||||
val scrolling = layer.scrolling
|
||||
|
||||
val renderLayer: RenderType = if (scrolling != null) {
|
||||
getScrollingLayer(texture, scrolling)
|
||||
} else if (layer.texture is AnimatedModelTextureSupplier && layer.texture.interpolation) {
|
||||
val interpolatedTexture = layer.texture.interpolatedTexture(currentState ?: FloatingState()) ?: continue
|
||||
makeLayer(DynamicStateShard(interpolatedTexture), layer.emissive, layer.translucent, layer.translucent_cull)
|
||||
} else {
|
||||
getLayer(texture, layer.emissive, layer.translucent, layer.translucent_cull)
|
||||
}
|
||||
val consumer = provider.getBuffer(renderLayer)
|
||||
val tint = layer.tint
|
||||
@@ -500,7 +503,7 @@ open class PosableModel(@Transient override val rootPart: Bone) : ModelFrame {
|
||||
!emissive && translucent && translucentCull -> RenderStateShard.RENDERTYPE_ENTITY_TRANSLUCENT_CULL_SHADER
|
||||
!emissive && translucent -> RenderStateShard.RENDERTYPE_ENTITY_TRANSLUCENT_SHADER
|
||||
!emissive && !translucent -> RenderStateShard.RENDERTYPE_ENTITY_CUTOUT_SHADER
|
||||
else -> RenderStateShard.RENDERTYPE_ENTITY_TRANSLUCENT_EMISSIVE_SHADER // This one should be changed to maybe a custom shader? Translucent stuffs with things
|
||||
else -> RenderStateShard.RENDERTYPE_ENTITY_TRANSLUCENT_EMISSIVE_SHADER
|
||||
}
|
||||
)
|
||||
.setTextureState(texture)
|
||||
@@ -533,6 +536,12 @@ open class PosableModel(@Transient override val rootPart: Bone) : ModelFrame {
|
||||
}
|
||||
}
|
||||
|
||||
fun getScrollingLayer(texture: ResourceLocation, scrolling: ScrollingTextureSettings): RenderType {
|
||||
val gameTime = Util.getMillis().toFloat() / 1000f
|
||||
val offsetU = (gameTime * scrolling.speedU) % 1.0f
|
||||
val offsetV = (gameTime * scrolling.speedV) % 1.0f
|
||||
return RenderType.breezeWind(texture, offsetU, offsetV)
|
||||
}
|
||||
|
||||
/** Applies the given pose's [ModelPartTransformation]s to the model, if there is a matching pose. */
|
||||
fun applyPose(state: PosableState, pose: Pose, intensity: Float) = pose.transformedParts.forEach { it.apply(state, intensity) }
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
|
||||
package com.cobblemon.mod.common.command
|
||||
|
||||
import com.cobblemon.mod.common.Cobblemon
|
||||
import com.cobblemon.mod.common.api.permission.CobblemonPermissions
|
||||
import com.cobblemon.mod.common.api.storage.pc.PCPosition
|
||||
import com.cobblemon.mod.common.api.storage.pc.POKEMON_PER_BOX
|
||||
import com.cobblemon.mod.common.api.text.red
|
||||
import com.cobblemon.mod.common.api.text.text
|
||||
import com.cobblemon.mod.common.util.*
|
||||
import com.mojang.brigadier.Command
|
||||
import com.mojang.brigadier.CommandDispatcher
|
||||
@@ -35,7 +35,7 @@ object PcTakeCommand {
|
||||
.then(
|
||||
Commands.argument("box", IntegerArgumentType.integer(1))
|
||||
.then(
|
||||
Commands.argument("slot", IntegerArgumentType.integer(1, 30))
|
||||
Commands.argument("slot", IntegerArgumentType.integer(1, POKEMON_PER_BOX))
|
||||
.executes(::execute)
|
||||
)
|
||||
)
|
||||
@@ -60,8 +60,8 @@ object PcTakeCommand {
|
||||
val slot = IntegerArgumentType.getInteger(context, "slot")
|
||||
val pc = target.pc()
|
||||
|
||||
if (box > POKEMON_PER_BOX) {
|
||||
context.source.sendFailure(commandLang("pctake.too_many_boxes", POKEMON_PER_BOX))
|
||||
if (box > pc.boxes.size) {
|
||||
context.source.sendFailure(commandLang("pctake.too_many_boxes", pc.boxes.size))
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
@@ -247,7 +247,7 @@ class CobblemonConfig {
|
||||
var pastureBlockUpdateTicks = 40
|
||||
|
||||
@CobblemonConfigField(Category.World, lang = "pasture_max_wander_distance", SERVER)
|
||||
var pastureMaxWanderDistance = 64
|
||||
var pastureMaxWanderDistance = 32
|
||||
|
||||
@CobblemonConfigField(Category.World, lang = "pasture_max_per_chunk", SERVER)
|
||||
var pastureMaxPerChunk = 4F
|
||||
|
||||
@@ -126,6 +126,14 @@ class StarterConfig {
|
||||
PokemonProperties.parse("Fuecoco level=10"),
|
||||
PokemonProperties.parse("Quaxly level=10"),
|
||||
)
|
||||
),
|
||||
StarterCategory(
|
||||
name = "Special",
|
||||
displayName = "cobblemon.starterselection.category.special",
|
||||
pokemon = mutableListOf(
|
||||
PokemonProperties.parse("Pikachu level=10"),
|
||||
PokemonProperties.parse("Eevee level=10")
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -90,8 +90,10 @@ interface MoLangScriptingEntity {
|
||||
behavioursAreCustom = nbt.getBoolean(DataKeys.SCRIPTED_BEHAVIOURS_ARE_CUSTOM)
|
||||
behaviours.clear()
|
||||
behaviours.addAll(nbt.getList(DataKeys.SCRIPTED_BEHAVIOURS, ListTag.TAG_STRING.toInt()).map { ResourceLocation.parse(it.asString) })
|
||||
data = MoLangFunctions.readMoValueFromNBT(nbt.getCompound(DataKeys.SCRIPTED_DATA)) as VariableStruct
|
||||
config = if (nbt.contains(DataKeys.SCRIPTED_CONFIG)) MoLangFunctions.readMoValueFromNBT(nbt.getCompound(DataKeys.SCRIPTED_CONFIG)) as VariableStruct else VariableStruct()
|
||||
val dataKey = if (nbt.contains(DataKeys.SCRIPTED_DATA)) DataKeys.SCRIPTED_DATA else "Data" // migrate old use of "Data"
|
||||
data = MoLangFunctions.readMoValueFromNBT(nbt.getCompound(dataKey)) as VariableStruct
|
||||
val configKey = if (nbt.contains(DataKeys.SCRIPTED_CONFIG)) DataKeys.SCRIPTED_CONFIG else "Config" // migrate old use of "Config"
|
||||
config = if (nbt.contains(configKey)) MoLangFunctions.readMoValueFromNBT(nbt.getCompound(configKey)) as VariableStruct else VariableStruct()
|
||||
}
|
||||
|
||||
fun registerFunctionsForScripting(struct: QueryStruct) {
|
||||
|
||||
@@ -27,6 +27,7 @@ import com.cobblemon.mod.common.api.spawning.influence.BucketNormalizingInfluenc
|
||||
import com.cobblemon.mod.common.api.spawning.influence.PlayerLevelRangeInfluence
|
||||
import com.cobblemon.mod.common.api.spawning.influence.PlayerLevelRangeInfluence.Companion.TYPICAL_VARIATION
|
||||
import com.cobblemon.mod.common.api.spawning.position.FishingSpawnablePosition
|
||||
import com.cobblemon.mod.common.api.spawning.spawner.FishingSpawnerFactory
|
||||
import com.cobblemon.mod.common.api.text.red
|
||||
import com.cobblemon.mod.common.client.sound.EntitySoundTracker
|
||||
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
|
||||
@@ -762,7 +763,6 @@ class PokeRodFishingBobberEntity(type: EntityType<out PokeRodFishingBobberEntity
|
||||
lureLevel: Int
|
||||
) {
|
||||
val spawner = BestSpawner.fishingSpawner
|
||||
val bucketInfluence = BucketNormalizingInfluence(tier = lureLevel + luckOfTheSeaLevel)
|
||||
|
||||
val spawnCause = FishingSpawnCause(
|
||||
spawner = spawner,
|
||||
@@ -771,14 +771,21 @@ class PokeRodFishingBobberEntity(type: EntityType<out PokeRodFishingBobberEntity
|
||||
lureLevel = lureLevel,
|
||||
)
|
||||
|
||||
val spawnablePosition = FishingSpawnablePosition(
|
||||
cause = spawnCause,
|
||||
val ctx = FishingSpawnerFactory.Context(
|
||||
player = player,
|
||||
rodStack = rodItemStack,
|
||||
lureLevel = lureLevel,
|
||||
luckOfTheSeaLevel = luckOfTheSeaLevel,
|
||||
world = level() as ServerLevel,
|
||||
pos = position().toBlockPos(),
|
||||
influences = mutableListOf(
|
||||
PlayerLevelRangeInfluence(player, TYPICAL_VARIATION),
|
||||
bucketInfluence
|
||||
)
|
||||
spawner = spawner
|
||||
)
|
||||
|
||||
val spawnablePosition = FishingSpawnablePosition(
|
||||
cause = spawnCause,
|
||||
world = ctx.world,
|
||||
pos = ctx.pos,
|
||||
influences = FishingSpawnerFactory.buildPositionInfluences(ctx)
|
||||
)
|
||||
|
||||
val result = spawner.calculateSpawnActionForPosition(
|
||||
|
||||
@@ -164,6 +164,7 @@ import net.minecraft.world.item.ItemUtils
|
||||
import net.minecraft.world.item.Items
|
||||
import net.minecraft.world.level.Level
|
||||
import net.minecraft.world.level.LightLayer
|
||||
import net.minecraft.world.level.block.HorizontalDirectionalBlock
|
||||
import net.minecraft.world.level.block.SuspiciousEffectHolder
|
||||
import net.minecraft.world.level.block.state.BlockState
|
||||
import net.minecraft.world.level.gameevent.GameEvent
|
||||
@@ -677,13 +678,10 @@ open class PokemonEntity(
|
||||
yBodyRot = (spawnDirection * 1000F).toInt() / 1000F
|
||||
}
|
||||
|
||||
if (this.tethering != null && !this.tethering!!.box.contains(this.x, this.y, this.z)) {
|
||||
this.tethering = null
|
||||
this.pokemon.recall()
|
||||
}
|
||||
|
||||
jumping = false
|
||||
|
||||
checkPastureTether()
|
||||
|
||||
//This is so that pokemon in the pasture block are ALWAYS in sync with the pokemon box
|
||||
//Before, pokemon entities in pastures would hold an old ref to a pokemon obj and changes to that would not appear to the underlying file
|
||||
if (this.tethering != null && age % 20 == 0) {
|
||||
@@ -705,6 +703,40 @@ open class PokemonEntity(
|
||||
schedulingTracker.update(1 / 20F)
|
||||
}
|
||||
|
||||
|
||||
// Check to see if the entity needs recalled or repositioned if pastured.
|
||||
fun checkPastureTether() {
|
||||
// Teleport a pastured mon back to the pasture block if they are out of range
|
||||
if (this.tethering != null && !this.tethering!!.box.contains(this.x, this.y, this.z)) {
|
||||
|
||||
// Gather the ideal position (behind the pastureBlock)
|
||||
val pastureBlockPos = this.tethering!!.pasturePos
|
||||
val state = this.level().getBlockState(pastureBlockPos)
|
||||
|
||||
// Check to ensure we are working with a pastureblock here and it hasn't been broken
|
||||
if (state.block == CobblemonBlocks.PASTURE) {
|
||||
val direction = state.getValue(HorizontalDirectionalBlock.FACING)
|
||||
val width = this.boundingBox.xsize
|
||||
val tpPos = pastureBlockPos.offset(direction.normal.multiply(ceil(width).toInt() + 1)).center
|
||||
val heightAllowance = 4.0 // Allow spawning up to x blocks above the pastureBlock y level
|
||||
|
||||
// Attempt tp and recall if it fails
|
||||
if (!this.randomTeleport(tpPos.x, tpPos.y + heightAllowance, tpPos.z, false)) {
|
||||
// If the teleport was not successful then recall the mon
|
||||
this.tethering = null
|
||||
this.pokemon.recall()
|
||||
} else {
|
||||
// Stop any now invalid navigation post teleport
|
||||
this.navigation.stop()
|
||||
}
|
||||
} else {
|
||||
// If the block is destroyed or something else went wrong.
|
||||
this.tethering = null
|
||||
this.pokemon.recall()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun customServerAiStep() {
|
||||
this.getBrain().tick(level() as ServerLevel, this)
|
||||
// PokemonBrain.updateActivities(this)
|
||||
|
||||
@@ -31,7 +31,7 @@ class BaitEffectsComponent(
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
return other is BaitEffectsComponent && effects.size == other.effects.size && effects.all { it in other.effects }
|
||||
return other is BaitEffectsComponent && effects == other.effects
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
|
||||
@@ -49,9 +49,7 @@ class FoodColourComponent(
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
return other is FoodColourComponent &&
|
||||
colours.size == other.colours.size &&
|
||||
colours.mapIndexed { index, value -> value == other.colours[index] }.all { it }
|
||||
return other is FoodColourComponent && colours == other.colours // List == List in kotlin checks for element order and index.
|
||||
}
|
||||
|
||||
fun getColoursAsARGB(): List<Int> {
|
||||
|
||||
@@ -20,11 +20,12 @@ class BerryRegistrySyncPacket(berries: Collection<Berry>) : DataRegistrySyncPack
|
||||
}
|
||||
|
||||
override val id = ID
|
||||
|
||||
override fun encodeEntry(buffer: RegistryFriendlyByteBuf, entry: Berry) {
|
||||
entry.encode(buffer)
|
||||
}
|
||||
|
||||
override fun decodeEntry(buffer: RegistryFriendlyByteBuf): Berry? = Berry.decode(buffer)
|
||||
override fun decodeEntry(buffer: RegistryFriendlyByteBuf): Berry = Berry.decode(buffer)
|
||||
|
||||
override fun synchronizeDecoded(entries: Collection<Berry>) {
|
||||
Berries.reload(entries.associateBy { it.identifier })
|
||||
|
||||
@@ -9,40 +9,30 @@
|
||||
package com.cobblemon.mod.common.net.messages.client.data
|
||||
|
||||
import com.cobblemon.mod.common.api.interaction.PokemonInteractionSet
|
||||
import com.cobblemon.mod.common.api.net.NetworkPacket
|
||||
import com.cobblemon.mod.common.api.interaction.PokemonInteractions
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
|
||||
class PokemonInteractionsSyncPacket(
|
||||
val speciesInteractions: List<PokemonInteractionSet>,
|
||||
val generalInteractions: List<PokemonInteractionSet>,
|
||||
) : NetworkPacket<PokemonInteractionsSyncPacket> {
|
||||
entries: Collection<PokemonInteractionSet>,
|
||||
) : DataRegistrySyncPacket<PokemonInteractionSet, PokemonInteractionsSyncPacket>(entries) {
|
||||
override val id = ID
|
||||
|
||||
override fun encode(buffer: RegistryFriendlyByteBuf) {
|
||||
buffer.writeCollection(speciesInteractions) { it, speciesInteraction ->
|
||||
speciesInteraction.encode(it)
|
||||
}
|
||||
buffer.writeCollection(generalInteractions) { it, generalInteraction ->
|
||||
generalInteraction.encode(it)
|
||||
}
|
||||
override fun encodeEntry(buffer: RegistryFriendlyByteBuf, entry: PokemonInteractionSet) {
|
||||
entry.encode(buffer)
|
||||
}
|
||||
|
||||
override fun decodeEntry(buffer: RegistryFriendlyByteBuf): PokemonInteractionSet {
|
||||
return PokemonInteractionSet.decode(buffer)
|
||||
}
|
||||
|
||||
override fun synchronizeDecoded(entries: Collection<PokemonInteractionSet>) {
|
||||
PokemonInteractions.interactions.clear()
|
||||
PokemonInteractions.interactions.addAll(entries)
|
||||
}
|
||||
|
||||
companion object {
|
||||
val ID = cobblemonResource("pokemon_interactions_sync")
|
||||
|
||||
fun decode(buffer: RegistryFriendlyByteBuf): PokemonInteractionsSyncPacket {
|
||||
val speciesInteractions = buffer.readList { it ->
|
||||
PokemonInteractionSet.decode(it)
|
||||
}
|
||||
val generalInteractions = buffer.readList { it ->
|
||||
PokemonInteractionSet.decode(it)
|
||||
}
|
||||
|
||||
return PokemonInteractionsSyncPacket(
|
||||
speciesInteractions,
|
||||
generalInteractions,
|
||||
)
|
||||
}
|
||||
fun decode(buffer: RegistryFriendlyByteBuf): PokemonInteractionsSyncPacket = PokemonInteractionsSyncPacket(emptyList()).apply { decodeBuffer(buffer) }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* 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.storage.party
|
||||
|
||||
import com.cobblemon.mod.common.api.net.NetworkPacket
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
|
||||
class PartyTutorialPacket : NetworkPacket<PartyTutorialPacket> {
|
||||
override val id = ID
|
||||
|
||||
override fun encode(buffer: RegistryFriendlyByteBuf) {}
|
||||
|
||||
companion object {
|
||||
val ID = cobblemonResource("party_select_tutorial")
|
||||
fun decode(buffer: RegistryFriendlyByteBuf): PartyTutorialPacket = PartyTutorialPacket()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* 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.storage.party
|
||||
|
||||
import com.cobblemon.mod.common.Cobblemon
|
||||
import com.cobblemon.mod.common.api.net.ServerNetworkPacketHandler
|
||||
import com.cobblemon.mod.common.api.storage.player.PlayerInstancedDataStoreTypes
|
||||
import com.cobblemon.mod.common.net.messages.server.storage.party.PartyTutorialPacket
|
||||
import net.minecraft.server.MinecraftServer
|
||||
import net.minecraft.server.level.ServerPlayer
|
||||
|
||||
object PartyTutorialPacketHandler : ServerNetworkPacketHandler<PartyTutorialPacket> {
|
||||
override fun handle(packet: PartyTutorialPacket, server: MinecraftServer, player: ServerPlayer) {
|
||||
val pd = Cobblemon.playerDataManager.getGenericData(player)
|
||||
|
||||
if (!pd.partySelectTutorialDone) {
|
||||
pd.partySelectTutorialDone = true
|
||||
Cobblemon.playerDataManager.saveSingle(pd, PlayerInstancedDataStoreTypes.GENERAL)
|
||||
pd.sendToPlayer(player)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -67,6 +67,7 @@ object CobblemonRequirementAdapter : RequirementAdapter {
|
||||
this.registerType(PropertyRangeRequirement.ADAPTER_VARIANT, PropertyRangeRequirement::class)
|
||||
this.registerType(AdvancementRequirement.ADAPTER_VARIANT, AdvancementRequirement::class)
|
||||
this.registerType(OwnerHoldsItemRequirement.ADAPTER_VARIANT, OwnerHoldsItemRequirement::class)
|
||||
this.registerType(ChanceRequirement.ADAPTER_VARIANT, ChanceRequirement::class)
|
||||
}
|
||||
|
||||
val gson: Gson by lazy {
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* 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.requirements
|
||||
|
||||
import com.cobblemon.mod.common.api.molang.ExpressionLike
|
||||
import com.cobblemon.mod.common.api.pokemon.requirement.Requirement
|
||||
import com.cobblemon.mod.common.pokemon.Pokemon
|
||||
import com.cobblemon.mod.common.util.asExpressionLike
|
||||
import com.cobblemon.mod.common.util.genericRuntime
|
||||
import com.cobblemon.mod.common.util.resolveFloat
|
||||
import kotlin.random.Random
|
||||
|
||||
/**
|
||||
* A requirement that will only pass the check if some random chance is satisfied.
|
||||
*
|
||||
* @author Hiroku
|
||||
* @since January 30th, 2026
|
||||
*/
|
||||
class ChanceRequirement : Requirement {
|
||||
companion object {
|
||||
const val ADAPTER_VARIANT = "chance"
|
||||
}
|
||||
|
||||
val chance: ExpressionLike = "1".asExpressionLike()
|
||||
|
||||
override fun check(pokemon: Pokemon): Boolean {
|
||||
genericRuntime.environment.query.addFunction("pokemon") { pokemon.struct }
|
||||
val chance = genericRuntime.resolveFloat(chance)
|
||||
return Random.nextFloat() < chance
|
||||
}
|
||||
}
|
||||
@@ -45,14 +45,15 @@ class ActiveTrade(val player1: TradeParticipant, val player2: TradeParticipant)
|
||||
|
||||
fun performTrade(tradeParticipant: TradeParticipant) {
|
||||
val offer = getOpposingOffer(tradeParticipant)
|
||||
|
||||
if (offer.accepted && getOffer(tradeParticipant).accepted) {
|
||||
TradeManager.performTrade(
|
||||
activeTrade = this,
|
||||
player1 = player1,
|
||||
player2 = player2,
|
||||
pokemon1 = player1Offer.pokemon!!,
|
||||
pokemon2 = player2Offer.pokemon!!
|
||||
)
|
||||
completeTrade()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -98,11 +98,23 @@ object TradeManager : RequestManager<TradeManager.TradeRequest>() {
|
||||
}
|
||||
}
|
||||
|
||||
fun performTrade(player1: TradeParticipant, pokemon1: Pokemon, player2: TradeParticipant, pokemon2: Pokemon) {
|
||||
CobblemonEvents.TRADE_EVENT_PRE.postThen(TradeEvent.Pre(player1, pokemon2, player2, pokemon1)) {
|
||||
val party1 = player1.party
|
||||
val party2 = player2.party
|
||||
fun performTrade(
|
||||
activeTrade: ActiveTrade,
|
||||
player1: TradeParticipant,
|
||||
pokemon1: Pokemon,
|
||||
player2: TradeParticipant,
|
||||
pokemon2: Pokemon
|
||||
) {
|
||||
val party1 = player1.party
|
||||
val party2 = player2.party
|
||||
|
||||
if (pokemon1 !in party1 || pokemon2 !in party2) {
|
||||
Cobblemon.LOGGER.warn("Attempted to perform a trade with Pokémon that aren't in the party anymore. Could be attempted duping between ${player1.name} and ${player2.name}")
|
||||
activeTrade.cancelTrade()
|
||||
return
|
||||
}
|
||||
|
||||
CobblemonEvents.TRADE_EVENT_PRE.postThen(TradeEvent.Pre(player1, pokemon2, player2, pokemon1)) {
|
||||
party1.remove(pokemon1)
|
||||
party2.remove(pokemon2)
|
||||
|
||||
@@ -120,6 +132,8 @@ object TradeManager : RequestManager<TradeManager.TradeRequest>() {
|
||||
it.attemptEvolution(pokemon2, pokemon1)
|
||||
}
|
||||
|
||||
activeTrade.completeTrade()
|
||||
|
||||
CobblemonEvents.TRADE_EVENT_POST.post(TradeEvent.Post(player1, pokemon2, player2, pokemon1))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -261,8 +261,8 @@ object DataKeys {
|
||||
|
||||
const val SCRIPTED_BEHAVIOURS_ARE_CUSTOM = "BehavioursAreCustom"
|
||||
const val SCRIPTED_BEHAVIOURS = "Behaviours"
|
||||
const val SCRIPTED_DATA = "Data"
|
||||
const val SCRIPTED_CONFIG = "Config"
|
||||
const val SCRIPTED_DATA = "ScriptingData"
|
||||
const val SCRIPTED_CONFIG = "ScriptingConfig"
|
||||
|
||||
// PokemonProperties
|
||||
const val ELEMENTAL_TYPE = "ElementalType"
|
||||
|
||||
@@ -547,6 +547,8 @@
|
||||
"cobblemon.trade.request_sent": "Offer'd to trade w'th %1$s",
|
||||
"cobblemon.trade.offer": "%1$s offer'd to trade crewmates with ye.",
|
||||
"cobblemon.ui.party": "Crew",
|
||||
"cobblemon.ui.party.party_select_title": "Pick Yer Party Pal",
|
||||
"cobblemon.ui.party.party_select_description": "Slam %1$s/%2$s...",
|
||||
"cobblemon.ui.power": "Damage",
|
||||
"cobblemon.ui.accuracy": "Shot rate",
|
||||
"cobblemon.ui.effect": "Bonus",
|
||||
|
||||
@@ -824,10 +824,6 @@
|
||||
"effect.cobblemon.cleanse_negative": "Negative Effect Cleanse",
|
||||
"effect.cobblemon.mental_restoration": "Mental Restoration",
|
||||
|
||||
"effect.cobblemon.cleanse_all": "Effect Cleanse",
|
||||
"effect.cobblemon.cleanse_negative": "Negative Effect Cleanse",
|
||||
"effect.cobblemon.mental_restoration": "Mental Restoration",
|
||||
|
||||
"cobblemon.fossil.armor": "Armor",
|
||||
"cobblemon.fossil.bird": "Bird",
|
||||
"cobblemon.fossil.claw": "Claw",
|
||||
@@ -1214,6 +1210,8 @@
|
||||
"cobblemon.trade.error.duplicate": "You already sent a trade request to %1$s!",
|
||||
|
||||
"cobblemon.ui.party": "Party",
|
||||
"cobblemon.ui.party.party_select_title": "Change Party Selection",
|
||||
"cobblemon.ui.party.party_select_description": "Press %1$s/%2$s or hold %3$s and scroll.",
|
||||
"cobblemon.ui.power": "Power",
|
||||
"cobblemon.ui.accuracy": "Accuracy",
|
||||
"cobblemon.ui.effect": "Effect",
|
||||
@@ -2124,6 +2122,7 @@
|
||||
"cobblemon.ui.status.psn": "PSN",
|
||||
"cobblemon.ui.status.slp": "SLP",
|
||||
"cobblemon.ui.status.tox": "PSN",
|
||||
"cobblemon.ui.exp.number": "+%1$s §oEXP",
|
||||
"cobblemon.battle.ui.fight": "Fight",
|
||||
"cobblemon.battle.ui.switch": "Switch",
|
||||
"cobblemon.battle.ui.capture": "Catch",
|
||||
@@ -3405,6 +3404,7 @@
|
||||
"cobblemon.starterselection.category.galar": "Galar",
|
||||
"cobblemon.starterselection.category.hisui_bias": "Hisui",
|
||||
"cobblemon.starterselection.category.paldea": "Paldea",
|
||||
"cobblemon.starterselection.category.special": "Special",
|
||||
|
||||
"cobblemon.stat.hp.name": "HP",
|
||||
"cobblemon.stat.attack.name": "Attack",
|
||||
|
||||
@@ -6360,7 +6360,7 @@
|
||||
"advancements.cobblemon.craft_rod.description": "Crea una Poké Caña en una mesa de herrería y descubre nuevas formas de pescar",
|
||||
"advancements.cobblemon.use_bait.description": "Usa una baya como cebo en tu Poké Caña",
|
||||
"advancements.cobblemon.craft_master_rod.description": "Fabrica una Poké Caña usando una Master Ball",
|
||||
"advancements.cobblemon.craft_master_rod": "Dedicación magistral",
|
||||
"advancements.cobblemon.craft_master_rod": "Esto repercutirá en las poblaciones de Whiscash",
|
||||
"cobblemon.battle.shift": "%1$s se movió al centro",
|
||||
"cobblemon.challenge.pending": "¡Aún no has respondido al desafío de %1$s!",
|
||||
"cobblemon.challenge.multi.team_request.receiver": "¡%1$s ha solicitado hacer equipo contigo para combates múltiples!",
|
||||
@@ -8687,5 +8687,35 @@
|
||||
"cobblemon.ui.ride_style.land.cart": "Coche",
|
||||
"effect.cobblemon.cleanse_all": "Limpieza de efectos",
|
||||
"effect.cobblemon.cleanse_negative": "Limpieza de efectos negativos",
|
||||
"effect.cobblemon.mental_restoration": "Descanso mental"
|
||||
"effect.cobblemon.mental_restoration": "Descanso mental",
|
||||
"block.cobblemon.white_plaque": "Placa blanca",
|
||||
"block.cobblemon.light_gray_plaque": "Placa gris claro",
|
||||
"block.cobblemon.gray_plaque": "Placa gris",
|
||||
"block.cobblemon.black_plaque": "Placa negra",
|
||||
"block.cobblemon.brown_plaque": "Placa marrón",
|
||||
"block.cobblemon.red_plaque": "Placa roja",
|
||||
"block.cobblemon.orange_plaque": "Placa naranja",
|
||||
"block.cobblemon.yellow_plaque": "Placa amarilla",
|
||||
"block.cobblemon.lime_plaque": "Placa verde lima",
|
||||
"block.cobblemon.green_plaque": "Placa verde",
|
||||
"block.cobblemon.cyan_plaque": "Placa cian",
|
||||
"block.cobblemon.light_blue_plaque": "Placa azul claro",
|
||||
"block.cobblemon.blue_plaque": "Placa azul",
|
||||
"block.cobblemon.purple_plaque": "Placa morada",
|
||||
"block.cobblemon.magenta_plaque": "Placa magenta",
|
||||
"block.cobblemon.pink_plaque": "Placa rosa",
|
||||
"advancements.cobblemon.cook_all_regional_delicacies": "Gira mundial culinaria",
|
||||
"advancements.cobblemon.cook_all_regional_delicacies.description": "Cocina todas las delicatesen regionales",
|
||||
"advancements.cobblemon.cook_all_ev_mochi": "¡Mucho mochi!",
|
||||
"advancements.cobblemon.cook_all_ev_mochi.description": "Cocina todos los sabores de mochi, un delicioso tentempié que modifica los puntos de esfuerzo de un Pokémon",
|
||||
"advancements.cobblemon.cook_snack": "Un aroma tentador",
|
||||
"advancements.cobblemon.cook_snack.description": "Hornea un Poké Snack, un delicioso pastel que puede atraer a ciertos Pokémon según la baya que uses",
|
||||
"advancements.cobblemon.use_poke_bait": "Seguro que pican",
|
||||
"advancements.cobblemon.use_poke_bait.description": "Prepara Poké Cebo en una cacerola para hogueras y usalo para atraer a un Pokémon",
|
||||
"advancements.cobblemon.max_ride_stats": "Poké Atleta de renombre",
|
||||
"advancements.cobblemon.max_ride_stats.description": "Aumenta al máximo las estadísticas de montura de un Pokémon dándole bongurchata de sabores\nLos distintos sabores aumentan distintas características",
|
||||
"advancements.cobblemon.interact_with_pokemon": "Zafarrancho en el rancho",
|
||||
"advancements.cobblemon.interact_with_pokemon.description": "Usa alguna de tus herramientas para obtener recursos de uno de tus Pokémon",
|
||||
"advancements.cobblemon.slather_saccharine": "Solo un mordisquito",
|
||||
"advancements.cobblemon.slather_saccharine.description": "Unta una botella de miel en el tronco de un sacarino y atrae a ciertos Pokémon"
|
||||
}
|
||||
|
||||
@@ -9191,10 +9191,12 @@
|
||||
"tag.item.cobblemon.plaques": "Plaques",
|
||||
"tag.item.cobblemon.display_case_items": "Modèles d'objets en vitrine",
|
||||
"tag.item.cobblemon.item_blocks": "Objets décoratifs",
|
||||
"cobblemon.behaviour.defend_owner.name": "Défendre le propriétaire",
|
||||
"cobblemon.behaviour.defend_owner.desc": "Défend son propriétaire lorsqu'il est attaqué.",
|
||||
"cobblemon.behaviour.defend_owner.name": "Défendre le dresseur",
|
||||
"cobblemon.behaviour.defend_owner.desc": "Défend son dresseur lorsqu'il est attaqué.",
|
||||
"stat.cobblemon.riding_land": "Distance parcourue par Pokémon sur terre",
|
||||
"stat.cobblemon.riding_air": "Distance parcourue par Pokémon dans les airs",
|
||||
"stat.cobblemon.riding_liquid": "Distance parcourue par Pokémon dans un liquide",
|
||||
"cobblemon.ui.ride_style.air.bird": "Oiseau"
|
||||
"cobblemon.ui.ride_style.air.bird": "Oiseau",
|
||||
"effect.cobblemon.cleanse_all": "Nettoyage des effets",
|
||||
"effect.cobblemon.cleanse_negative": "Nettoyage des effets négatifs"
|
||||
}
|
||||
|
||||
@@ -9178,5 +9178,39 @@
|
||||
"cobblemon.ui.ride_style.air.bird": "Oiseau",
|
||||
"cobblemon.ui.ride_style.air.hover": "Flotte",
|
||||
"cobblemon.ui.ride_style.air.jet": "Avion",
|
||||
"cobblemon.ui.ride_style.air.rocket": "Fusée"
|
||||
"cobblemon.ui.ride_style.air.rocket": "Fusée",
|
||||
"cobblemon.ui.ride_style.land.horse": "Standard",
|
||||
"cobblemon.ui.ride_style.land.cart": "Voiture",
|
||||
"cobblemon.ui.ride_style.liquid.boat": "Bateau",
|
||||
"cobblemon.ui.ride_style.liquid.dolphin": "Dauphin",
|
||||
"cobblemon.ui.ride_style.liquid.submarine": "Sous-marin",
|
||||
"cobblemon.config.ui.enable_in_flight_dismounting": "Activer le débarquement en vol",
|
||||
"cobblemon.config.ui.enable_in_flight_dismounting.tooltip": "Permet aux joueurs de descendre de leur Pokémon en plein vol. Lorsque cette option est désactivée, il n'est possible de descendre que depuis le sol.",
|
||||
"block.cobblemon.white_plaque": "Plaque blanche",
|
||||
"block.cobblemon.light_gray_plaque": "Plaque gris clair",
|
||||
"block.cobblemon.gray_plaque": "Plaque grise",
|
||||
"block.cobblemon.black_plaque": "Plaque noire",
|
||||
"block.cobblemon.brown_plaque": "Plaque marron",
|
||||
"block.cobblemon.red_plaque": "Plaque rouge",
|
||||
"block.cobblemon.orange_plaque": "Plaque orange",
|
||||
"block.cobblemon.yellow_plaque": "Plaque jaune",
|
||||
"block.cobblemon.lime_plaque": "Plaque vert clair",
|
||||
"block.cobblemon.green_plaque": "Plaque verte",
|
||||
"block.cobblemon.cyan_plaque": "Plaque cyan",
|
||||
"block.cobblemon.light_blue_plaque": "Plaque bleu clair",
|
||||
"block.cobblemon.blue_plaque": "Plaque bleue",
|
||||
"block.cobblemon.purple_plaque": "Plaque violette",
|
||||
"block.cobblemon.magenta_plaque": "Plaque magenta",
|
||||
"block.cobblemon.pink_plaque": "Plaque rose",
|
||||
"tag.item.cobblemon.chest_boats": "Bateaux de stockage",
|
||||
"tag.item.cobblemon.plaques": "Plaques",
|
||||
"tag.item.cobblemon.display_case_items": "Modèles d'objets en vitrine",
|
||||
"tag.item.cobblemon.item_blocks": "Objets décoratifs",
|
||||
"cobblemon.behaviour.defend_owner.name": "Défendre le dresseur",
|
||||
"cobblemon.behaviour.defend_owner.desc": "Défend son dresseur lorsqu'il est attaqué.",
|
||||
"stat.cobblemon.riding_land": "Distance parcourue par Pokémon sur terre",
|
||||
"stat.cobblemon.riding_air": "Distance parcourue par Pokémon dans les airs",
|
||||
"stat.cobblemon.riding_liquid": "Distance parcourue par Pokémon dans un liquide",
|
||||
"effect.cobblemon.cleanse_all": "Nettoyage des effets",
|
||||
"effect.cobblemon.cleanse_negative": "Nettoyage des effets négatifs"
|
||||
}
|
||||
|
||||
@@ -322,7 +322,7 @@
|
||||
"item.cobblemon.rich_mulch": "주렁주렁비료",
|
||||
"item.cobblemon.sandy_mulch": "모래비료",
|
||||
"item.cobblemon.surprise_mulch": "깜놀비료",
|
||||
"item.cobblemon.medicinal_leek": "약초",
|
||||
"item.cobblemon.medicinal_leek": "약초 대파",
|
||||
"item.cobblemon.energy_root": "힘의뿌리",
|
||||
"item.cobblemon.revival_herb": "부활초",
|
||||
"item.cobblemon.roasted_leek": "구운 대파",
|
||||
@@ -826,10 +826,10 @@
|
||||
"advancements.cobblemon.first_shiny_catch.description": "특별한 색 포켓몬을 잡으세요",
|
||||
"advancements.cobblemon.healing_machine": "치료의 힘",
|
||||
"advancements.cobblemon.healing_machine.description": "치료 머신이 충전될 때까지 기다린 후 당신의 포켓몬들을 치료하세요",
|
||||
"advancements.cobblemon.obtain_leek": "대파를 손에 넣었다!",
|
||||
"advancements.cobblemon.obtain_leek.description": "담수 지역에서 자라는 약초를 획득하세요",
|
||||
"advancements.cobblemon.obtain_leek": "약초 대파를 손에 넣었다!",
|
||||
"advancements.cobblemon.obtain_leek.description": "담수 지역에서 자라는 약초 대파를 획득하세요",
|
||||
"advancements.cobblemon.medicinal_brew": "동네 약국",
|
||||
"advancements.cobblemon.medicinal_brew.description": "약초를 양조해 치유에 필요한 기본 재료를 만드세요",
|
||||
"advancements.cobblemon.medicinal_brew.description": "약초 대파를 양조해 치유에 필요한 기본 재료를 만드세요",
|
||||
"advancements.cobblemon.brew_potion": "기초적인 회복 아이템",
|
||||
"advancements.cobblemon.brew_potion.description": "오랭열매와 약용물약을 양조해 상처약을 만드세요",
|
||||
"advancements.cobblemon.brew_full_restore": "챔피언의 선택",
|
||||
|
||||
@@ -600,8 +600,8 @@
|
||||
"cobblemon.healingmachine.alreadyhealing": "A tua equipa de Pokémon já está a ser curada noutro lado!",
|
||||
"cobblemon.pc.inbattle": "Não podes usar o PC durante um combate!",
|
||||
"cobblemon.held_item": "Item segurado",
|
||||
"cobblemon.held_item.give": "%1$s passou a segurar %2$s.",
|
||||
"cobblemon.held_item.replace": "Passaste %1$s de %2$s para %3$s segurar.",
|
||||
"cobblemon.held_item.give": "%1$s recebeu %2$s.",
|
||||
"cobblemon.held_item.replace": "Passaste %1$s de %2$s para %3$s.",
|
||||
"cobblemon.held_item.take": "%2$s deixou de segurar %1$s.",
|
||||
"cobblemon.held_item.already_holding": "%1$s já está a segurar %2$s!",
|
||||
"cobblemon.ui.pokemonteam": "Equipa",
|
||||
@@ -646,9 +646,9 @@
|
||||
"item.cobblemon.babiri_berry": "Baga Babiri",
|
||||
"item.cobblemon.babiri_berry.tooltip": "Reduz pela metade o dano recebido de um ataque supereficaz do tipo Aço",
|
||||
"item.cobblemon.belue_berry": "Baga Belue",
|
||||
"item.cobblemon.belue_berry.tooltip": "Não pode ser comida pelo portador",
|
||||
"item.cobblemon.belue_berry.tooltip": "Não pode ser comida durante batalhas",
|
||||
"item.cobblemon.bluk_berry": "Baga Bluk",
|
||||
"item.cobblemon.bluk_berry.tooltip": "Não pode ser comida pelo portador",
|
||||
"item.cobblemon.bluk_berry.tooltip": "Não pode ser comida durante batalhas",
|
||||
"item.cobblemon.charti_berry": "Baga Charti",
|
||||
"item.cobblemon.charti_berry.tooltip": "Reduz pela metade o dano recebido de um ataque supereficaz do tipo Rocha",
|
||||
"item.cobblemon.cheri_berry": "Baga Cheri",
|
||||
@@ -664,11 +664,11 @@
|
||||
"item.cobblemon.colbur_berry": "Baga Colbur",
|
||||
"item.cobblemon.colbur_berry.tooltip": "Reduz pela metade o dano recebido de um ataque supereficaz do tipo Escuridão",
|
||||
"item.cobblemon.cornn_berry": "Baga Cornn",
|
||||
"item.cobblemon.cornn_berry.tooltip": "Não pode ser comida pelo portador",
|
||||
"item.cobblemon.cornn_berry.tooltip": "Não pode ser comida durante batalhas",
|
||||
"item.cobblemon.custap_berry": "Baga Custap",
|
||||
"item.cobblemon.custap_berry.tooltip": "O portador move-se primeiro ao alcançar 1/4 do HP máximo",
|
||||
"item.cobblemon.durin_berry": "Baga Durin",
|
||||
"item.cobblemon.durin_berry.tooltip": "Não pode ser comida pelo portador",
|
||||
"item.cobblemon.durin_berry.tooltip": "Não pode ser comida durante batalhas",
|
||||
"item.cobblemon.enigma_berry": "Baga Enigma",
|
||||
"item.cobblemon.enigma_berry.tooltip": "Restaura 1/4 do HP máximo após o portador ser atingido por um movimento supereficaz",
|
||||
"item.cobblemon.figy_berry": "Baga Figy",
|
||||
@@ -682,7 +682,7 @@
|
||||
"item.cobblemon.hondew_berry": "Baga Hondrew",
|
||||
"item.cobblemon.hondew_berry.tooltip": "Não pode ser comida pelo portador",
|
||||
"item.cobblemon.hopo_berry": "Baga Hopo",
|
||||
"item.cobblemon.hopo_berry.tooltip": "Não pode ser comida pelo portador",
|
||||
"item.cobblemon.hopo_berry.tooltip": "Restaura 10 PP do movimento selecionado quando consumida por um Pokémon",
|
||||
"item.cobblemon.iapapa_berry": "Baga Iapapa",
|
||||
"item.cobblemon.iapapa_berry.tooltip": "Restaura 1/3 do HP máximo ao alcançar 1/4 do HP máximo ou menos; confunde se Natureza -Def",
|
||||
"item.cobblemon.jaboca_berry": "Baga Jaboca",
|
||||
@@ -706,23 +706,23 @@
|
||||
"item.cobblemon.mago_berry": "Baga Mago",
|
||||
"item.cobblemon.mago_berry.tooltip": "Restaura 1/3 do HP máximo ao alcançar 1/4 do HP máximo ou menos; confunde se Natureza -Spe",
|
||||
"item.cobblemon.magost_berry": "Baga Magost",
|
||||
"item.cobblemon.magost_berry.tooltip": "Não pode ser comida pelo portador",
|
||||
"item.cobblemon.magost_berry.tooltip": "Não pode ser comida durante batalhas",
|
||||
"item.cobblemon.maranga_berry": "Baga Maranga",
|
||||
"item.cobblemon.maranga_berry.tooltip": "Aumenta a Defesa Especial do portador por 1 estágio após ser atingido por um ataque especial",
|
||||
"item.cobblemon.micle_berry": "Baga Micle",
|
||||
"item.cobblemon.micle_berry.tooltip": "O próximo ataque do portador tem 1.2x precisão ao alcançar 1/4 do HP máximo or menos",
|
||||
"item.cobblemon.nanab_berry": "Baga Nanab",
|
||||
"item.cobblemon.nanab_berry.tooltip": "Não pode ser comida pelo portador",
|
||||
"item.cobblemon.nanab_berry.tooltip": "Não pode ser comida durante batalhas",
|
||||
"item.cobblemon.touga_berry": "Baga Touga",
|
||||
"item.cobblemon.touga_berry.tooltip": "O portador é curado se ficar confuso",
|
||||
"item.cobblemon.nomel_berry": "Baga Nomel",
|
||||
"item.cobblemon.nomel_berry.tooltip": "Não pode ser comida pelo portador",
|
||||
"item.cobblemon.nomel_berry.tooltip": "Não pode ser comida durante batalhas",
|
||||
"item.cobblemon.occa_berry": "Baga Occa",
|
||||
"item.cobblemon.occa_berry.tooltip": "Reduz pela metade o dano recebido de um ataque supereficaz do tipo Fogo",
|
||||
"item.cobblemon.oran_berry": "Baga Oran",
|
||||
"item.cobblemon.oran_berry.tooltip": "Restaura 10 HP ao alcançar 1/2 do HP máximo ou menos",
|
||||
"item.cobblemon.pamtre_berry": "Baga Pamtre",
|
||||
"item.cobblemon.pamtre_berry.tooltip": "Não pode ser comida pelo portador",
|
||||
"item.cobblemon.pamtre_berry.tooltip": "Não pode ser comida durante batalhas",
|
||||
"item.cobblemon.passho_berry": "Baga Passho",
|
||||
"item.cobblemon.passho_berry.tooltip": "Reduz pela metade o dano recebido de um ataque supereficaz do tipo Água",
|
||||
"item.cobblemon.payapa_berry": "Baga Payapa",
|
||||
@@ -734,17 +734,17 @@
|
||||
"item.cobblemon.petaya_berry": "Baga Petaya",
|
||||
"item.cobblemon.petaya_berry.tooltip": "Aumenta o Ataque Especial do portador por 1 estágio ao alcançar 1/4 do HP máximo ou menos",
|
||||
"item.cobblemon.pinap_berry": "Baga Pinap",
|
||||
"item.cobblemon.pinap_berry.tooltip": "Não pode ser comida pelo portador",
|
||||
"item.cobblemon.pinap_berry.tooltip": "Não pode ser comida durante batalhas",
|
||||
"item.cobblemon.pomeg_berry": "Baga Pomeg",
|
||||
"item.cobblemon.pomeg_berry.tooltip": "Não pode ser comida pelo portador",
|
||||
"item.cobblemon.qualot_berry": "Baga Qualot",
|
||||
"item.cobblemon.qualot_berry.tooltip": "Não pode ser comida pelo portador",
|
||||
"item.cobblemon.rabuta_berry": "Baga Rabuta",
|
||||
"item.cobblemon.rabuta_berry.tooltip": "Não pode ser comida pelo portador",
|
||||
"item.cobblemon.rabuta_berry.tooltip": "Não pode ser comida durante batalhas",
|
||||
"item.cobblemon.rawst_berry": "Baga Rawst",
|
||||
"item.cobblemon.rawst_berry.tooltip": "O portador é curado se for queimado",
|
||||
"item.cobblemon.razz_berry": "Baga Razz",
|
||||
"item.cobblemon.razz_berry.tooltip": "Não pode ser comida pelo portador",
|
||||
"item.cobblemon.razz_berry.tooltip": "Não pode ser comida durante batalhas",
|
||||
"item.cobblemon.rindo_berry": "Baga Rindo",
|
||||
"item.cobblemon.rindo_berry.tooltip": "Reduz pela metade o dano recebido de um ataque supereficaz do tipo Planta",
|
||||
"item.cobblemon.roseli_berry": "Baga Roseli",
|
||||
@@ -758,7 +758,7 @@
|
||||
"item.cobblemon.sitrus_berry": "Baga Sitrus",
|
||||
"item.cobblemon.sitrus_berry.tooltip": "Restaura 1/4 do HP máximo quando alcançar 1/2 do HP máximo ou menos",
|
||||
"item.cobblemon.spelon_berry": "Baga Spelon",
|
||||
"item.cobblemon.spelon_berry.tooltip": "Não pode ser comida pelo portador",
|
||||
"item.cobblemon.spelon_berry.tooltip": "Não pode ser comida durante batalhas",
|
||||
"item.cobblemon.starf_berry": "Baga Starf",
|
||||
"item.cobblemon.starf_berry.tooltip": "Aumenta um atributo aleatório por 2 ao alcançar 1/4 do HP máximo ou menos",
|
||||
"item.cobblemon.tamato_berry": "Baga Tamato",
|
||||
@@ -768,9 +768,9 @@
|
||||
"item.cobblemon.wacan_berry": "Baga Wacan",
|
||||
"item.cobblemon.wacan_berry.tooltip": "Reduz pela metade o dano recebido de um ataque supereficaz do tipo Elétrico",
|
||||
"item.cobblemon.watmel_berry": "Baga Watmel",
|
||||
"item.cobblemon.watmel_berry.tooltip": "Não pode ser comida pelo portador",
|
||||
"item.cobblemon.watmel_berry.tooltip": "Não pode ser comida durante batalhas",
|
||||
"item.cobblemon.wepear_berry": "Baga Wepear",
|
||||
"item.cobblemon.wepear_berry.tooltip": "Não pode ser comida pelo portador",
|
||||
"item.cobblemon.wepear_berry.tooltip": "Não pode ser comida durante batalhas",
|
||||
"item.cobblemon.wiki_berry": "Baga Wiki",
|
||||
"item.cobblemon.wiki_berry.tooltip": "Restaura 1/3 do HP máximo ao alcançar 1/4 do HP máximo ou menos; confunde se Natureza -SpA",
|
||||
"item.cobblemon.yache_berry": "Baga Yache",
|
||||
@@ -2240,7 +2240,7 @@
|
||||
"cobblemon.mark.ribbon_event_color_green.desc": "Uma Fita comemorativa.",
|
||||
"key.cobblemon.pokedex": "Abrir Pokédex",
|
||||
"cobblemon.subtitle.wallpaper.unlock": "Papel de parede da caixa do PC desbloqueado",
|
||||
"cobblemon.held_item.forbidden": "Tu não podes dar %1$s para %2$s segurar.",
|
||||
"cobblemon.held_item.forbidden": "Tu não podes dar %1$s a %2$s.",
|
||||
"cobblemon.cosmetic_item": "Item Cosmético",
|
||||
"cobblemon.cosmetic_item.take": "Tu recuperaste %1$s de %2$s.",
|
||||
"cobblemon.challenge.sent": "Tu desafiaste %1$s para uma %2$s.",
|
||||
@@ -5509,7 +5509,7 @@
|
||||
"cobblemon.team.error.missing_pokemon.receiver": "Não tens nenhum Pokémon usável!",
|
||||
"item.cobblemon.grepa_berry.tooltip_1": "Diminui os EVs de Defesa Especial por 10 e aumenta Amizade",
|
||||
"item.cobblemon.pomeg_berry.tooltip_1": "Diminui os EVs de HP por 10 e aumenta Amizade",
|
||||
"item.cobblemon.hondew_berry.tooltip_2": "Não pode ser comida pelo portador",
|
||||
"item.cobblemon.hondew_berry.tooltip_2": "Não pode ser comida durante batalhas",
|
||||
"cobblemon.config.ui.default_box_count.tooltip": "O número de caixas disponíveis no PC.",
|
||||
"cobblemon.config.ui.experience_multiplier.tooltip": "Multiplicador de Experiência adicional para o cálculo de Experiência.",
|
||||
"cobblemon.battle.sidestart.ally.spikes": "Espinhos foram espalhados no chão à volta da tua equipa!",
|
||||
@@ -5551,8 +5551,8 @@
|
||||
"cobblemon.ui.challenge.challenge_title": "Pedido de Batalha",
|
||||
"cobblemon.challenge.multi.error.invalid_team_size": "Equipas para Batalha Múltipla só podem ter %1$s jogadores!",
|
||||
"item.cobblemon.kelpsy_berry.tooltip_1": "Diminui os EVs de Ataque por 10 e aumenta Amizade",
|
||||
"item.cobblemon.qualot_berry.tooltip_2": "Não pode ser comida pelo portador",
|
||||
"item.cobblemon.tamato_berry.tooltip_2": "Não pode ser comida pelo portador",
|
||||
"item.cobblemon.qualot_berry.tooltip_2": "Não pode ser comida durante batalhas",
|
||||
"item.cobblemon.tamato_berry.tooltip_2": "Não pode ser comida durante batalhas",
|
||||
"cobblemon.command.behaviouredit.non_scriptable": "Não estás a olhar para uma entidade MoLang programável.",
|
||||
"item.cobblemon.hondew_berry.tooltip_1": "Diminui os EVs de Ataque Especial por 10 e aumenta Amizade",
|
||||
"cobblemon.command.cobblemon_config.reload": "Recarregando as configurações do Cobblemon.",
|
||||
@@ -5611,7 +5611,7 @@
|
||||
"item.cobblemon.mirror_herb.tooltip_1": "Permite ao portador refletir os aumentos de atributos de um adversário para aumentar os seus próprios atributos",
|
||||
"item.cobblemon.revive.tooltip": "Reanima um Pokémon desmaiado até 50% do seu HP máximo",
|
||||
"item.cobblemon.max_revive.tooltip": "Reanima e cura totalmente um Pokémon desmaiado",
|
||||
"item.cobblemon.revival_herb.tooltip": "Revive totalmente um Pokémon desmaiado, mas reduz Amizade",
|
||||
"item.cobblemon.revival_herb.tooltip": "Revive um Pokémon desmaiado até 25% do seu HP máximo, mas reduz Amizade",
|
||||
"item.cobblemon.moomoo_milk": "Leite Moomoo",
|
||||
"item.cobblemon.awakening.tooltip": "Desperta um Pokémon do sono",
|
||||
"item.cobblemon.burn_heal.tooltip": "Cura um Pokémon de uma queimadura",
|
||||
@@ -5622,12 +5622,12 @@
|
||||
"item.cobblemon.genius_mochi": "Mochi Genial",
|
||||
"item.cobblemon.clever_mochi": "Mochi Esperto",
|
||||
"item.cobblemon.swift_mochi": "Mochi Rápido",
|
||||
"item.cobblemon.health_mochi.tooltip": "Aumenta os EVs de HP do Pokémon por 10",
|
||||
"item.cobblemon.muscle_mochi.tooltip": "Aumenta os EVs de Ataque do Pokémon por 10",
|
||||
"item.cobblemon.resist_mochi.tooltip": "Aumenta os EVs de Defesa do Pokémon por 10",
|
||||
"item.cobblemon.genius_mochi.tooltip": "Aumenta os EVs de Ataque Especial do Pokémon por 10",
|
||||
"item.cobblemon.clever_mochi.tooltip": "Aumenta os EVs de Defesa Especial do Pokémon por 10",
|
||||
"item.cobblemon.swift_mochi.tooltip": "Aumenta os EVs de Velocidade do Pokémon por 10",
|
||||
"item.cobblemon.health_mochi.tooltip": "Aumenta os EVs de HP do Pokémon por 4",
|
||||
"item.cobblemon.muscle_mochi.tooltip": "Aumenta os EVs de Ataque do Pokémon por 4",
|
||||
"item.cobblemon.resist_mochi.tooltip": "Aumenta os EVs de Defesa do Pokémon por 4",
|
||||
"item.cobblemon.genius_mochi.tooltip": "Aumenta os EVs de Ataque Especial do Pokémon por 4",
|
||||
"item.cobblemon.clever_mochi.tooltip": "Aumenta os EVs de Defesa Especial do Pokémon por 4",
|
||||
"item.cobblemon.swift_mochi.tooltip": "Aumenta os EVs de Velocidade do Pokémon por 4",
|
||||
"item.cobblemon.fresh_start_mochi": "Mochi em Branco",
|
||||
"item.cobblemon.fresh_start_mochi.tooltip": "Repõe todos os EVs do Pokémon a 0",
|
||||
"item.cobblemon.aprijuice_black": "Sumo de Bolota Preta",
|
||||
@@ -5636,7 +5636,7 @@
|
||||
"item.cobblemon.aprijuice_pink": "Sumo de Bolota Rosa",
|
||||
"item.cobblemon.aprijuice_white": "Sumo de Bolota Branca",
|
||||
"item.cobblemon.aprijuice_yellow": "Sumo de Bolota Amarela",
|
||||
"cobblemon.seasoning_food_header": "Comida",
|
||||
"cobblemon.seasoning_food_header": "Nutrição",
|
||||
"cobblemon.seasoning_flavor.dry": "Seco",
|
||||
"cobblemon.seasoning_flavor.sweet": "Doce",
|
||||
"item.cobblemon.tasty_tail": "Cauda Saborosa",
|
||||
@@ -5648,7 +5648,7 @@
|
||||
"cobblemon.item_class.seasonings": "Temperos",
|
||||
"cobblemon.item_class.bait_effect_seasoning": "Tempero de Isca",
|
||||
"cobblemon.item_class.mob_effect_seasoning": "Tempero de Efeito",
|
||||
"cobblemon.item_class.food_seasoning": "Tempero de Comida",
|
||||
"cobblemon.item_class.food_seasoning": "Temperos Nutricionais",
|
||||
"cobblemon.seasoning_bait_effect_header": "Isca",
|
||||
"cobblemon.seasoning_flavor_header": "Sabor",
|
||||
"cobblemon.seasoning_bait_effect_info_header": "Informação da Isca:",
|
||||
@@ -5742,11 +5742,11 @@
|
||||
"cobblemon.team.error.existing_team.other": "%1$s já faz parte de uma equipa!",
|
||||
"cobblemon.team.error.max_team_size.other": "%1$s não se pode juntar porque a equipa está cheia!",
|
||||
"cobblemon.team.error.max_team_size.self": "Não é possível entrar, a equipa está cheia!",
|
||||
"item.cobblemon.grepa_berry.tooltip_2": "Não pode ser comida pelo portador",
|
||||
"item.cobblemon.kelpsy_berry.tooltip_2": "Não pode ser comida pelo portador",
|
||||
"item.cobblemon.grepa_berry.tooltip_2": "Não pode ser comida durante batalhas",
|
||||
"item.cobblemon.kelpsy_berry.tooltip_2": "Não pode ser comida durante batalhas",
|
||||
"item.cobblemon.qualot_berry.tooltip_1": "Diminui os EVs de Defesa por 10 e aumenta Amizade",
|
||||
"item.cobblemon.tamato_berry.tooltip_1": "Diminui os EVs de Velocidade por 10 e aumenta Amizade",
|
||||
"item.cobblemon.pomeg_berry.tooltip_2": "Não pode ser comida pelo portador",
|
||||
"item.cobblemon.pomeg_berry.tooltip_2": "Não pode ser comida durante batalhas",
|
||||
"cobblemon.command.mark.invalid": "Nome de marca inválido.",
|
||||
"cobblemon.command.error.nonpc": "Erro: Tu precisas de incluir um identificador de NPC válido.",
|
||||
"cobblemon.command.freezepokemon.non_pokemon": "Não estás a olhar para um Pokémon.",
|
||||
@@ -6165,5 +6165,66 @@
|
||||
"tag.item.cobblemon.candies": "Guloseimas",
|
||||
"tag.item.cobblemon.mint_leaves": "Folhas de Hortelã",
|
||||
"tag.item.cobblemon.berries.stat_buff": "Bagas de Batalha",
|
||||
"cobblemon.move.hydrovortex": "Vórtice Aquático"
|
||||
"cobblemon.move.hydrovortex": "Vórtice Aquático",
|
||||
"cobblemon.ui.ride_style.air.rocket": "Foguete",
|
||||
"cobblemon.ui.ride_style.land": "Terrestre",
|
||||
"cobblemon.ui.ride_style.land.horse": "Padrão",
|
||||
"cobblemon.ui.ride_style.land.cart": "Carrinho",
|
||||
"cobblemon.ui.ride_style.liquid": "Líquido",
|
||||
"cobblemon.ui.ride_style.liquid.boat": "Barco",
|
||||
"cobblemon.ui.ride_style.liquid.dolphin": "Golfinho",
|
||||
"cobblemon.ui.ride_style.liquid.submarine": "Submarino",
|
||||
"item.cobblemon.eggant_berry": "Baga Eggant",
|
||||
"item.cobblemon.eggant_berry.tooltip": "O portador é curado se ficar apaixonado",
|
||||
"cobblemon.battle.end.sandtomb": "%1$s foi libertado(a) da Sepultura de Areia!",
|
||||
"gamerule.healersHealPC": "Curar Pokémon no PC ao usar uma Máquina de Cura",
|
||||
"tag.item.cobblemon.berries.colour.white": "Bagas Brancas",
|
||||
"tag.item.cobblemon.berries.colour.brown": "Bagas Castanhas",
|
||||
"tag.item.cobblemon.berries.colour.red": "Bagas Vermelhas",
|
||||
"tag.item.cobblemon.berries.colour.orange": "Bagas Laranjas",
|
||||
"tag.item.cobblemon.berries.colour.yellow": "Bagas Amarelas",
|
||||
"tag.item.cobblemon.berries.colour.lime": "Bagas Lima",
|
||||
"tag.item.cobblemon.berries.colour.green": "Bagas Verdes",
|
||||
"tag.item.cobblemon.berries.colour.cyan": "Bagas Ciano",
|
||||
"tag.item.cobblemon.berries.colour.light_blue": "Bagas Azuis Claras",
|
||||
"tag.item.cobblemon.berries.colour.blue": "Bagas Azuis",
|
||||
"tag.item.cobblemon.berries.colour.purple": "Bagas Roxas",
|
||||
"tag.item.cobblemon.berries.colour.magenta": "Bagas Magenta",
|
||||
"tag.item.cobblemon.berries.colour.pink": "Bagas Rosa",
|
||||
"tag.item.cobblemon.item_blocks": "Itens Decorativos",
|
||||
"cobblemon.move.guardianofalola": "Guardião de Alola",
|
||||
"cobblemon.move.guardianofalola.desc": "O utilizador, o Pokémon Espírito da Terra, obtém a energia de Alola usando o seu Poder-Z e ataca o alvo, reduzindo significativamente o HP do alvo.",
|
||||
"cobblemon.move.oceanicoperetta": "Sinfonia Marítima",
|
||||
"cobblemon.move.oceanicoperetta.desc": "O utilizador, Primarina, invoca uma enorme quantidade de água usando o seu Z-Power e ataca o alvo com toda a força.",
|
||||
"cobblemon.move.pulverizingpancake": "Panqueca Pulverizadora",
|
||||
"cobblemon.move.pulverizingpancake.desc": "O Poder-Z revela as verdadeiras capacidades do utilizador, Snorlax. O Pokémon move o seu enorme corpo energicamente e ataca o alvo com toda a força.",
|
||||
"cobblemon.move.lightthatburnsthesky": "Luz Que Queima o Céu",
|
||||
"cobblemon.move.lightthatburnsthesky.desc": "Este ataque compara os atributos de Ataque e Ataque Especial do utilizador e usa o que for mais elevado. Este movimento ignora a Habilidade do alvo.",
|
||||
"cobblemon.move.letssnuggleforever": "Aconchego Eterno",
|
||||
"cobblemon.move.letssnuggleforever.desc": "Usando o seu Poder-Z, o utilizador, Mimikyu, espanca o alvo com toda a sua força.",
|
||||
"cobblemon.move.blackholeeclipse": "Buraco Negro Eclipsante",
|
||||
"cobblemon.move.blackholeeclipse.desc": "O utilizador reúne energia negra usando o seu Poder-Z e suga o alvo para dentro dela. O poder varia, dependendo do movimento original.",
|
||||
"cobblemon.entity.variable.resource_identifier.desc": "O identificador de recurso a ser usado para controlar a aparência do NPC, como cobblemon:standard ou cobblemon:mudkip.",
|
||||
"cobblemon.entity.variable.resource_identifier.name": "Identificador de Recurso",
|
||||
"cobblemon.move.continentalcrush": "Colisão Continental",
|
||||
"cobblemon.move.continentalcrush.desc": "O utilizador invoca uma enorme montanha rochosa usando o seu Poder-Z e deixa-a cair sobre o alvo. O poder varia, dependendo do movimento original.",
|
||||
"cobblemon.move.tectonicrage": "Fúria Tectónica",
|
||||
"cobblemon.move.tectonicrage.desc": "O utilizador enterra-se no solo e atinge o alvo com toda a força do seu Poder-Z. O poder varia, dependendo do movimento original.",
|
||||
"cobblemon.behaviour.configurable_resource_identifier.name": "Identificador de Recurso Configurável",
|
||||
"cobblemon.behaviour.configurable_resource_identifier.desc": "Permite alterar o identificador de recurso que controla a aparência do NPC.",
|
||||
"cobblemon.entity.variable.dialogue_selection.name": "Diálogo",
|
||||
"cobblemon.entity.variable.dialogue_selection.desc": "O identificador de recurso do diálogo a ser aberto na interação, como cobblemon:your_dialogue",
|
||||
"cobblemon.move.aciddownpour": "Dilúvio Ácido",
|
||||
"cobblemon.move.aciddownpour.desc": "O utilizador cria um pântano venenoso usando o seu Poder-Z, afundando o alvo. O poder varia, dependendo do movimento original.",
|
||||
"cobblemon.move.bloomdoom": "Desgraça Floral",
|
||||
"cobblemon.move.bloomdoom.desc": "O utilizador recolhe energia vegetal usando o seu Poder-Z e ataca o alvo com toda a força. O poder varia, dependendo do movimento original.",
|
||||
"cobblemon.behaviour.defend_owner.name": "Defender Dono",
|
||||
"cobblemon.behaviour.defend_owner.desc": "Defende o seu dono quando este é atacado.",
|
||||
"cobblemon.behaviour.pokemon_picks_up_items.name": "Apanha Itens",
|
||||
"cobblemon.behaviour.pokemon_picks_up_items.desc": "O Pokémon irá apanhar itens que lhe interessam.",
|
||||
"cobblemon.behaviour.player_textured.name": "Textura de Jogador",
|
||||
"cobblemon.behaviour.player_textured.desc": "O NPC será texturizado com base num nome de utilizador de jogador específico.",
|
||||
"cobblemon.behaviour.pokemon_gets_mad_at_thrower.name": "Fica Zangado com o Lançador da Pokébola",
|
||||
"cobblemon.behaviour.pokemon_gets_mad_at_thrower.desc": "Fica zangado com o jogador que lhe atirou uma Pokébola. Pokémon agressivos atacarão o jogador e não agressivos fugirão.",
|
||||
"cobblemon.move.twinkletackle": "Investida Brilhante"
|
||||
}
|
||||
|
||||
@@ -9174,5 +9174,44 @@
|
||||
"stat.cobblemon.battles_fled": "宝可梦对战逃跑次数",
|
||||
"stat.cobblemon.eggs_collected": "已收集宝可梦蛋数",
|
||||
"stat.cobblemon.level_up": "提升宝可梦等级次数",
|
||||
"stat.cobblemon.times_ridden": "骑乘宝可梦次数"
|
||||
"stat.cobblemon.times_ridden": "骑乘宝可梦次数",
|
||||
"effect.cobblemon.cleanse_all": "效果清除",
|
||||
"effect.cobblemon.cleanse_negative": "负面效果清除",
|
||||
"effect.cobblemon.mental_restoration": "精神恢复",
|
||||
"cobblemon.ui.ride_style.air.bird": "鸟类",
|
||||
"cobblemon.ui.ride_style.air.hover": "悬浮",
|
||||
"cobblemon.ui.ride_style.air.jet": "喷射",
|
||||
"cobblemon.ui.ride_style.air.rocket": "火箭",
|
||||
"cobblemon.ui.ride_style.land.horse": "常规",
|
||||
"cobblemon.ui.ride_style.land.cart": "轮驱",
|
||||
"cobblemon.ui.ride_style.liquid.boat": "乘船",
|
||||
"cobblemon.ui.ride_style.liquid.dolphin": "海豚",
|
||||
"cobblemon.ui.ride_style.liquid.submarine": "潜艇",
|
||||
"cobblemon.config.ui.enable_in_flight_dismounting": "启用在飞行中离乘",
|
||||
"cobblemon.config.ui.enable_in_flight_dismounting.tooltip": "允许玩家在空中骑乘宝可梦时离乘。禁用时,仅能在地面上离乘。",
|
||||
"block.cobblemon.white_plaque": "白色标识牌",
|
||||
"block.cobblemon.light_gray_plaque": "淡灰色标识牌",
|
||||
"block.cobblemon.gray_plaque": "灰色标识牌",
|
||||
"block.cobblemon.black_plaque": "黑色标识牌",
|
||||
"block.cobblemon.brown_plaque": "棕色标识牌",
|
||||
"block.cobblemon.red_plaque": "红色标识牌",
|
||||
"block.cobblemon.orange_plaque": "橙色标识牌",
|
||||
"block.cobblemon.yellow_plaque": "黄色标识牌",
|
||||
"block.cobblemon.lime_plaque": "黄绿色标识牌",
|
||||
"block.cobblemon.green_plaque": "绿色标识牌",
|
||||
"block.cobblemon.cyan_plaque": "青色标识牌",
|
||||
"block.cobblemon.light_blue_plaque": "淡蓝色标识牌",
|
||||
"block.cobblemon.blue_plaque": "蓝色标识牌",
|
||||
"block.cobblemon.purple_plaque": "紫色标识牌",
|
||||
"block.cobblemon.magenta_plaque": "品红色标识牌",
|
||||
"block.cobblemon.pink_plaque": "粉红色标识牌",
|
||||
"tag.item.cobblemon.chest_boats": "箱船",
|
||||
"tag.item.cobblemon.plaques": "标识牌",
|
||||
"tag.item.cobblemon.display_case_items": "展示柜中的物品模型",
|
||||
"tag.item.cobblemon.item_blocks": "装饰品",
|
||||
"cobblemon.behaviour.defend_owner.name": "保护主人",
|
||||
"cobblemon.behaviour.defend_owner.desc": "在主人受到攻击时保护他们。",
|
||||
"stat.cobblemon.riding_land": "骑着宝可梦在陆地移动距离",
|
||||
"stat.cobblemon.riding_air": "骑着宝可梦在空中移动距离",
|
||||
"stat.cobblemon.riding_liquid": "骑着宝可梦在水域移动距离"
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
"sounds": [ { "name": "cobblemon:item/pokedex/pokedex_scan_zoom_increment", "volume": 0.7 } ]
|
||||
},
|
||||
"evolution.notification": {
|
||||
"sounds": [ { "name": "cobblemon:evolution/evolution_notification", "volume": 0.7 } ]
|
||||
"sounds": [ { "name": "cobblemon:evolution/evolution_notification", "volume": 1.0 } ]
|
||||
},
|
||||
"evolution.full": {
|
||||
"sounds": [ { "name": "cobblemon:evolution/evolution_full", "volume": 0.9 } ]
|
||||
@@ -173,7 +173,7 @@
|
||||
"sounds": [ { "name": "cobblemon:gui/levelup_start", "volume": 0.15 } ]
|
||||
},
|
||||
"gui.levelup": {
|
||||
"sounds": [ { "name": "cobblemon:gui/levelup", "volume": 0.65 } ]
|
||||
"sounds": [ { "name": "cobblemon:gui/levelup", "volume": 0.55 } ]
|
||||
},
|
||||
"gui.click": {
|
||||
"sounds": [ "cobblemon:gui/click" ]
|
||||
|
||||
|
After Width: | Height: | Size: 248 B |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 299 B |
|
After Width: | Height: | Size: 946 B |
|
After Width: | Height: | Size: 124 B |
|
After Width: | Height: | Size: 117 B |
|
After Width: | Height: | Size: 505 B |
|
After Width: | Height: | Size: 145 B |
|
After Width: | Height: | Size: 576 B |
|
After Width: | Height: | Size: 798 B |
|
After Width: | Height: | Size: 786 B |
|
After Width: | Height: | Size: 853 B |
|
After Width: | Height: | Size: 746 B |
|
After Width: | Height: | Size: 689 B |
|
After Width: | Height: | Size: 851 B |
|
After Width: | Height: | Size: 785 B |
|
After Width: | Height: | Size: 698 B |
|
After Width: | Height: | Size: 818 B |
|
After Width: | Height: | Size: 731 B |
|
After Width: | Height: | Size: 786 B |
|
After Width: | Height: | Size: 683 B |