Compare commits

..
Author SHA1 Message Date
CeeJay 874d1d9329 Battle ends if teleport succeeds. Don't broadcast messages for ended battles 2025-09-25 00:18:59 -04:00
CeeJay d29e688064 rollback InstructionSet.execute() changes 2025-09-25 00:18:03 -04:00
CeeJay b6802069d8 Allow battle to continue if Teleport didn't succeed 2025-09-24 18:50:36 -04:00
CeeJay a4b8aafa27 Merge branch 'main' into wild-teleporting 2025-09-23 01:10:12 -04:00
Polymeta b00f1d9352 fix typo in pokemon interactions
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-09-22 10:53:31 +01:00
Polymeta a588cfadf8 Merge branch 'riding-scrape' into 'main'
Riding scrape

See merge request cable-mc/cobblemon!1869
2025-09-22 09:29:38 +00:00
Polymeta 2eb4062f67 [skip-ci] re-add client config for consistency
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-09-22 10:23:14 +01:00
Polymeta 43321d8872 licenses
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-09-22 10:07:19 +01:00
Hiroku a5ea584b75 Merge branch 'held-item-datapack' into 'main'
Implemented user-driven held item effects

See merge request cable-mc/cobblemon!1811
2025-09-22 08:10:13 +00:00
CraterandHiroku 6a9edc2e67 Implemented user-driven held item effects 2025-09-22 08:10:13 +00:00
Test 12377deff7 Merge branch 'dynlight-refactor' into 'main'
Number pushing and Dynlight betterments

See merge request cable-mc/cobblemon!1864
2025-09-22 07:47:42 +00:00
Paul 737ddd973b Tiny cleanup stuff dw about it [skip-ci] 2025-09-22 15:16:25 +10:00
Test d749b04261 fix cyclizar mount idle 2025-09-22 05:14:50 +00:00
Landon Wills a62e5a6571 Revert Golurk changes 2025-09-21 18:54:27 -04:00
Landon Wills 0ec337ee6c Scrape riding updates 2025-09-21 18:20:32 -04:00
Carmendar 76df0a429d changelog 2025-09-21 16:58:50 -05:00
Carmendar 08ea9378de Dewgong ready to scrape. 2025-09-21 16:57:07 -05:00
Carmendar c2bd21ab96 Merge branch 'main' into implement_pokemon 2025-09-21 11:42:32 -05:00
Paul 5db8ccfad4 Fixed various things about aprijuice ride boosts 2025-09-21 22:39:55 +10:00
Polymeta aa206d386a Merge branch 'stop-the-disco-spin' into 'main'
Fixed Pokémon spinning a bunch when re-calculating a path to a moving target, closes #1703

Closes #1703

See merge request cable-mc/cobblemon!1868
2025-09-21 10:11:11 +00:00
Paul a235af6c01 Fixed fliers taking fall damage upon landing without a passenger, fixed rarely flying pokemon joining a herd and launching into space 2025-09-21 19:24:23 +10:00
Carmendar a666a74a32 Slaking jump seat fix. 2025-09-21 03:22:51 -05:00
Carmendar c285120ff4 Merge branch 'main' into implement_pokemon 2025-09-21 03:17:33 -05:00
Paul dbd2890120 oop 2025-09-21 18:09:17 +10:00
Carmendar a5db46cdc5 Rhyhorn line ready for scrape & ride overlays for Slaking. 2025-09-21 01:17:58 -05:00
Carmendar 765cf9b96a Send in the bulls. (Tauros is ready to scrape.) 2025-09-21 01:12:38 -05:00
Paul efe7952869 Fixed Pokémon spinning a bunch when re-calculating a path to a moving target, closes #1703 2025-09-21 14:29:30 +10:00
Carmendar 9e434de285 Implemented spicy chicken legs animations. 2025-09-20 22:11:22 -05:00
Carmendar 712fe2c250 Merge branch 'main' into implement_pokemon 2025-09-20 22:09:16 -05:00
Hiroku 5db5a2ed35 Merge branch 'root-bone-animations-in-riding' into 'main'
Root bone animations in riding

See merge request cable-mc/cobblemon!1866
2025-09-21 02:15:02 +00:00
Paul 49c96e6fc8 Merge remote-tracking branch 'origin/main' 2025-09-21 10:46:21 +10:00
Paul d56c9a3f5a put da aprijuice recipes back 2025-09-21 10:42:53 +10:00
Carmendar a117303147 Merge branch 'main' into implement_pokemon 2025-09-20 17:50:10 -05:00
Landon dbf248a508 Merge branch 'riding-behaviour-tweaks-03' into 'main'
ride tweaks extended cut

See merge request cable-mc/cobblemon!1865
2025-09-20 17:40:28 +00:00
Jackson BowesandLandon 56d75b14fa ride tweaks extended cut 2025-09-20 17:40:27 +00:00
Paul 87311e2d7d Added default ride pose and use that instead of letting minecraft animate them 2025-09-20 22:03:44 +10:00
Hiroku 1b525ca3a5 Merge branch 'the-curse-of-gradle-island' into 'main'
Stop using Architectury Runtime Transfomers implicitly

See merge request cable-mc/cobblemon!1867
2025-09-20 10:27:52 +00:00
Nadja Reitzenstein 78ec9d3723 Stop using Architectury Runtime Transfomers implicitly
We don't use the Architectury Runtime Transformers in any of our direct code, so there is no downside for setting compile_only and entirely dropping them.
This necessitates the other implemented changes to our build system though as the transformers also inject code and resources from the :common project into the platform-specific ones in dev-env runs. Production jars use compile-time transformed and remapped jar shadowing for the same purpose so they are wholly unaffected by this removal.
Removing ART has several upsides: For one their dev-env injections have proven very unreliable so with this change a lot of caching issues have been fundamentally removed. They also inject deep into different parts of the JVM, making hot code reloads almost impossible to function so with this change reloads should be able to apply more often.
2025-09-20 11:42:14 +02:00
Paul afa5d22c8e Re-enabled aprijuice and made creative menu aprijuice 10 in all flavours because w/e 2025-09-20 18:50:02 +10:00
Paul bd63fb686d Support marking some seats as making the hands busy 2025-09-20 17:00:35 +10:00
Carmendar 0f9a422d44 no more garchomp quirks while mount flying. 2025-09-20 00:52:41 -05:00
Paul 32d18b47f9 Positional scaling fix for root-based ride player animation 2025-09-20 15:46:11 +10:00
Paul c618bf95fa Merge remote-tracking branch 'origin/main' into root-bone-animations-in-riding
# Conflicts:
#	common/src/main/java/com/cobblemon/mod/common/mixin/client/HumanoidModelMixin.java
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/player/MountedPlayerRenderer.kt
#	common/src/main/resources/mixins.cobblemon-common.json
2025-09-20 14:46:37 +10:00
Paul 18a8aa12d1 Release the held pokemon before sorting, closes #1663 2025-09-20 14:16:21 +10:00
Paul 308ca6369d Fixed persistence issues for pokemon item pickup behaviours 2025-09-20 12:44:17 +10:00
Paul 79fd9f4e04 Fixed pokemon having the NPC dialogues memory 2025-09-20 12:28:06 +10:00
Paul 38219bbca2 Fixed pokemon in the party following and looking around while asleep, closes #1668 2025-09-20 12:27:48 +10:00
Paul 87de288777 Fixed crash when adding stationary Behaviour without a movement providing behaviour. Closes #1678 2025-09-20 11:25:04 +10:00
Paul b6f1d6c62e Fixed terralith:shrubland not counting as plains for pokemon spawning, closes #1685 2025-09-20 10:44:36 +10:00
Nadja Reitzenstein a7bd70e334 Make only held Pokedexes cast light 2025-09-19 13:10:12 +02:00
Polymeta 43310d3a3b tweak default stat ranges for some flying behaviours
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-09-19 10:29:34 +01:00
GenotypeXD-Dev d12bdc3745 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-09-18 21:53:03 -05:00
GenotypeXD-Dev 08c8623951 Flygon Size Fix 2025-09-18 21:38:51 -05:00
Paul 6ae375cf4e Added math.sign and math.copy_sigh molang dep update 2025-09-19 10:34:19 +10:00
Polymeta 29c65c18ff Merge branch 'what-a-grain' into 'main'
Grain Improvements

Closes #1702

See merge request cable-mc/cobblemon!1863
2025-09-18 17:10:08 +00:00
dhi_holoandPolymeta b90384fe08 Grain Improvements 2025-09-18 17:10:08 +00:00
Nadja Reitzenstein d2ff7e3748 Make Charmander glow 2025-09-18 17:48:30 +02:00
Nadja Reitzenstein ea6452287b Refactor dynamic light support to be future-proof 2025-09-18 17:48:28 +02:00
Nadja Reitzenstein b1f7731563 Update dependencies all around 2025-09-18 17:47:39 +02:00
Test 5ad881235f update fabric-permissions-api to 0.3.1 2025-09-18 04:53:02 +00:00
Landon 05796998e8 Merge branch 'riding-behaviour-tweaks-02' into 'main'
Behaviour tweaks

See merge request cable-mc/cobblemon!1862
2025-09-17 18:36:53 +00:00
Jackson BowesandLandon aaf1aad9a4 Behaviour tweaks 2025-09-17 18:36:53 +00:00
Polymeta b315fdcadc Merge branch 'sand-witches' into 'main'
Small Data Changes

See merge request cable-mc/cobblemon!1861
2025-09-17 18:23:42 +00:00
dhi_holo 5b95f0a1c7 Update mochis.json
Added missing and reorganised
2025-09-18 00:01:56 +10:00
dhi_holo 7641a839c2 Merge branch 'main' into sand-witches 2025-09-17 23:33:08 +10:00
dhi_holo 6ed6ca6937 IV Drip
Added new candy tags for IV Candies (additive, subtractive, general, and general candy that includes Exp Candies)
Added Vivichoke, Cobblemon Apples, and Beetroots to Sandwich Vegetable tag
Added advancement for using IV candy
2025-09-17 23:28:18 +10:00
Landon be106a465e Merge branch 'riding-debug-ui-tweaks-02' into 'main'
Ride settings editor

See merge request cable-mc/cobblemon!1858
2025-09-17 12:53:24 +00:00
Jackson BowesandLandon e7c0374c83 Ride settings editor 2025-09-17 12:53:24 +00:00
Polymeta 7fd1a443ac Merge branch 'riding-fix-air-dismount' into 'main'
Fix in air dismount

See merge request cable-mc/cobblemon!1831
2025-09-17 06:22:21 +00:00
Jackson BowesandPolymeta 31359077ed Fix in air dismount 2025-09-17 06:22:20 +00:00
Polymeta 7f683bd618 Merge branch 'riding-fix-waterwalk' into 'main'
Fix riding waterwalk

See merge request cable-mc/cobblemon!1838
2025-09-17 06:21:36 +00:00
Jackson BowesandPolymeta 012f15878e Fix riding waterwalk 2025-09-17 06:21:36 +00:00
Polymeta f406b9695d Merge branch 'main' into 'main'
Skip battle check if the mobTargetInBattle game rule is set to false

See merge request cable-mc/cobblemon!1857
2025-09-16 08:17:01 +00:00
Polymeta f6dbe40246 Merge branch 'implement_pokemon' into 'main'
lots o' implementing, animating and fixing.

See merge request cable-mc/cobblemon!1846
2025-09-16 08:15:52 +00:00
Polymeta a1f6e47f42 Merge branch 'fix-cooking-pot-button-color' into 'main'
Fix Campfire Pot Lid Button Sprite

See merge request cable-mc/cobblemon!1859
2025-09-16 08:15:13 +00:00
Polymeta 04f5dbfca0 swap out textures
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-09-16 09:11:38 +01:00
martin fd940b5549 Remove unnecessary check on resource 2025-09-15 16:12:36 +08:00
Hiroku 3e37c1af32 Merge branch 'animation-scale-shenanigan' into 'main'
Removed Animators/Engineer Frame Ghost Scale Jumpscare

See merge request cable-mc/cobblemon!1855
2025-09-15 01:15:16 +00:00
Paul 8b6b9ffede Changelog [skip-ci] 2025-09-15 10:07:03 +10:00
Hiroku 329a13867c Merge branch 'implemented-patch' into 'main'
Fixes PokemonSpecies.implemented not containing pokémon marked implemented via species additions.

See merge request cable-mc/cobblemon!1835
2025-09-15 00:02:47 +00:00
Carmendar 5c6632c3fb Forgor camera offsets for extra seats 2025-09-14 03:20:07 -05:00
Carmendar ebde125895 Bronzong ready to scrape. 2025-09-14 03:18:17 -05:00
martin c45c74c508 Fix double lid on campfire pot open sprites 2025-09-14 14:31:13 +08:00
martin cd6bc23825 Rename CookingPotColor to CampfirePotColor 2025-09-14 06:16:57 +00:00
martin 3df95df1f9 Add color property in CampfirePotItem
To make it really easy to get it in the future
2025-09-14 06:16:57 +00:00
martin ad3ee75c22 Sync cooking pot button color with open / closed state 2025-09-14 06:16:57 +00:00
martin ce3935950a Add cooking pot open sprites 2025-09-14 06:16:57 +00:00
Paul e1380df7d1 Fixed herd counts exceeding the max, smooth the following timing so it's less robotic 2025-09-14 14:03:13 +10:00
Carmendar cf8cfb8dad Nickel no longer defies gravity when sleeping & corrected underwater behaviors on wiglett line. 2025-09-13 18:52:42 -05:00
Instrafe 3729728124 Implemented locators for Omanyte & Omastar 2025-09-13 17:16:41 -04:00
MemencioPerez 3092abfdd0 Inline mobTargetInBattle game rule check in TargetingConditions mixin 2025-09-12 15:07:30 -04:00
Carmendar 3150f33e9e underwater walkers now walk underwater, and some swimmers now avoid land. (Crabrawler line avoids water entirely.) 2025-09-12 01:27:34 -05:00
Carmendar 40d7e7bccb Merge branch 'main' into implement_pokemon 2025-09-12 01:27:10 -05:00
MemencioPerez cdbe61843f Skip battle check if the mobTargetInBattle game rule is set to false 2025-09-11 23:00:53 -04:00
Paul b13c168347 Increased default PC box count from 30 to 40 2025-09-12 12:12:39 +10:00
Carmendar f77fa82e4f Implemented finalized Mochi sprites. 2025-09-11 19:02:26 -05:00
Konoha 2e2b10311d Implement Unown ! and ? lang 2025-09-11 17:36:42 -04:00
Gertimoshka 2af5de8ce4 Fixed issue where Animation Transition has a frame non zero scale render on a part that is scale 0 for both animations 2025-09-12 00:02:56 +03:00
Jerzykv 66eea576f3 comma 2025-09-11 10:45:55 +02:00
Carmendar 53a516266f Annihilape anims and particle! -- jump anims for Garchomp and Ursaring + jump fixes for a few other mons. 2025-09-11 02:43:41 -05:00
Carmendar f732442133 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-09-11 02:41:16 -05:00
GenotypeXD-Dev 34cad13f57 Pachirisu scale fix 2025-09-11 02:19:23 -05:00
GenotypeXD-Dev e879a755a4 Implemented Mew and Pachirisu Remodels, Updated gengars uv/textures 2025-09-11 02:16:58 -05:00
Carmendar 2ac9c827d4 Merge branch 'refs/heads/main' into implement_pokemon 2025-09-10 23:02:07 -05:00
Test a0ef46a18c Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon 2025-09-10 21:09:09 -04:00
Test 9dc15c9096 fix pasture scroll crash 2025-09-10 21:08:49 -04:00
Landon 346e2cd094 Merge branch 'horse-stepup-tweak' into 'main'
Vanilla-Like Horse Ride Style Stepup

See merge request cable-mc/cobblemon!1854
2025-09-10 20:08:24 +00:00
Konoha f7794d50dd Import for cleanliness 2025-09-10 15:24:04 -04:00
Konoha 3b8d67ce64 Tweak the Horse Ride-style "StepUp" to check for the ground similar to vanilla horses. 2025-09-10 14:52:57 -04:00
Test 105d3a7d90 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon 2025-09-09 20:15:56 -04:00
Tyzillion 8a685cefc0 Poodle trimmin tweaks. 2025-09-09 13:35:09 -04:00
Tyzillion 3ff536dc02 Updated Changelog. 2025-09-09 11:16:56 -04:00
Tyzillion 638ec03244 The trimming particles no longer glow. 2025-09-09 11:14:00 -04:00
Tyzillion 37438c9fdd CYAN AND LIGHT BLUE ARE NOT THE SAME. WAAAAAAAAAH 2025-09-09 09:58:30 -04:00
Tyzillion cbc4b52193 Finishing touches on Furfrou. 2025-09-09 09:48:18 -04:00
Tyzillion 9a760d8eae Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-09-09 08:36:17 -04:00
Tyzillion b7d26d99cd Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon
# Conflicts:
#	common/src/main/resources/data/cobblemon/cosmetic_items/dyes.json
2025-09-09 08:33:02 -04:00
Tyzillion 04c8b1e95b Let me pet dat dawg! Can I pet dat dawg? 2025-09-09 08:32:21 -04:00
Tyzillion e4149b2a5e Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2025-09-09 08:29:44 -04:00
HirokuandGitLab b446af166d Merge branch 'ImproveHoverWander' into 'main'
Improvements to hover (air) wandering

See merge request cable-mc/cobblemon!1845
2025-09-09 11:50:00 +00:00
Carmendar 3cdaa513f8 Lickilicky ready for scrape with placeholder controller, and various other small fixes and tweaks. 2025-09-09 03:09:19 -05:00
PolymetaandGitLab 75e0da38c4 Merge branch 'pot-jei-catalysts' into 'main'
Added JEI recipe catalysts for campfire pots

See merge request cable-mc/cobblemon!1848
2025-09-09 08:06:53 +00:00
GenotypeXD-Dev ca43fcf3a2 Implemented New cosmetics [Watermelon Electrodes, Pokemopolis alakazam, gengar, and jigglypuff, Dots Tinkatink, Tinkatuff, and Tinkaton, Golden Sudowoodo] 2025-09-09 01:39:33 -05:00
gruxor 4f71e11383 Added JEI recipe catalysts for campfire pots 2025-09-09 01:48:58 -04:00
Tyzillion 5b56a5758a Drednaw, more like, DredMAH THERE'S A WEIRD MF CAT OUTSIDE. 2025-09-08 21:54:46 -04:00
Tyzillion 424889e820 You know what, screw you. *Downgrades your Chewtle* 2025-09-08 21:24:10 -04:00
Tyzillion 6d3f00cd58 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2025-09-08 21:07:08 -04:00
Carmendar 1d375bdffa Last Bouffalant fix I swear... also Garchomp head fix in sand. 2025-09-08 19:23:24 -05:00
Carmendar e563bbee49 bouff blink fix 2025-09-08 18:05:22 -05:00
PolymetaandGitLab e2ccb20402 Merge branch 'hydrophobic-gates' into 'main'
Removed Hydrophobia from cobblemon gates + consistency changes

See merge request cable-mc/cobblemon!1847
2025-09-08 21:30:49 +00:00
Sterrezo 8fe2dc8304 Restored Golurk's ride sounds 2025-09-08 22:27:49 +02:00
Gertimoshka 4ddc167254 Gates no longer self destruct then open and near water at random rate, also can be ingited by lava 2025-09-08 23:22:16 +03:00
Lennie e3502ec320 Added wing flap sounds to updated noivern & volcarona animations, adjusted noivern's portrait 2025-09-08 10:20:00 +02:00
Carmendar d8d0ade350 luigi and netherite hoe controller updates. 2025-09-08 02:34:31 -05:00
GenotypeXD-Dev e2ac4449b3 Implemented Seedot line Remodels 2025-09-07 22:15:30 -05:00
GenotypeXD-Dev ecec7ccee3 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-09-07 21:16:30 -05:00
GenotypeXD-Dev 228282f083 Added regional caps for raichu and pichu, added ukulele pichu, and fixes for pikachu cap cosmetics 2025-09-07 21:15:25 -05:00
Carmendar 3bc7d39800 Forgor changelog 2025-09-07 21:06:30 -05:00
Carmendar 3dc5873642 Nickel line remodels, Garchomp anims, fixed Bouffalant battle_idle, fixed Noivern clipping, updated Volcarona anim file, implemented Chewtle line cries and Axew cry, removed reference to clobbopus cry anim (it doesn't have one), and fixed third person camera offset for some mons. 2025-09-07 21:03:52 -05:00
Lennie 8d6291c4c2 Fixed a crash due to a poser issue 2025-09-07 13:36:37 +02:00
Jerzykv 2b77d030e8 You can drive now! (Implemented Varoom & Revavroom remodels + placeholder ride data) 2025-09-07 11:45:27 +02:00
Carmendar 029927af6a Merge branch 'main' into implement_pokemon 2025-09-07 04:12:19 -05:00
Carmendar bf791dc4d1 Bouffalant can eepy. 2025-09-07 04:08:13 -05:00
PolymetaandGitLab 56ad481304 Merge branch 'implement_pokemon' into 'main'
Implement pokemon

See merge request cable-mc/cobblemon!1842
2025-09-07 09:04:19 +00:00
PolymetaandGitLab cc7a9ae44a Merge branch 'Move-Particles-1.7' into 'main'
YOU GET PARTICLES, YOU GET PARTICLES, AND YOU GET PARTICLES. SO MANY MOVES WITH PARTICLES.

See merge request cable-mc/cobblemon!1839
2025-09-07 09:02:16 +00:00
TyzillionandGitLab 664f79f3a7 YOU GET PARTICLES, YOU GET PARTICLES, AND YOU GET PARTICLES. SO MANY MOVES WITH PARTICLES. 2025-09-07 09:02:16 +00:00
JazzMcNade 9a2ed78b0d Improve air wanders 2025-09-07 03:54:55 -05:00
Carmendar 558907eb5c Drednaw cry and sobble also smol 2025-09-07 03:31:26 -05:00
Carmendar 370b689ab4 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-09-07 03:21:59 -05:00
Carmendar e2740babc5 Togetic smol 2025-09-07 03:21:15 -05:00
Lennie 3393ab17d8 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-09-07 09:06:05 +02:00
Lennie 645029a9c7 Fixed wings being invisible for wattrel in its battle stance 2025-09-07 09:05:41 +02:00
Carmendar f168744ccd Merge branch 'main' into implement_pokemon 2025-09-06 23:49:08 -05:00
Carmendar 67210cb5f9 Fixed Parasect crash. 2025-09-06 23:15:44 -05:00
Carmendar 779fbb4f38 Removed walking privileges from Hydreigon and Volcarona, and fixed Magnezone's magnets being too spinny. 2025-09-06 21:01:31 -05:00
LandonandGitLab ce04f546e7 Merge branch 'ride_pokemon_event' into 'main'
Molang and Flowback for Riding Pokemon

See merge request cable-mc/cobblemon!1843
2025-09-07 01:46:58 +00:00
LandonandGitLab a36437ea16 Merge branch 'riding-behaviour-tweaks-01' into 'main'
Ride behaviour tweaks based on team feedback

See merge request cable-mc/cobblemon!1844
2025-09-07 01:35:50 +00:00
Jackson BowesandGitLab aa5af84283 Ride behaviour tweaks based on team feedback 2025-09-07 01:35:50 +00:00
Konoha e3031d2618 Use 'this' in tryRidingPokemon instead of unnecessary parameter. 2025-09-06 21:34:03 -04:00
Konoha 9e44ba1fb1 Fix getRideBoost function call 2025-09-06 21:31:55 -04:00
Konoha 1af66d4175 Revert function refactoring, set rideBoosts to private. 2025-09-06 21:21:43 -04:00
Konoha 144213cee8 Remove redundant check in tryRidingPokemon 2025-09-06 21:17:40 -04:00
Konoha cc95b4450e Make set_ride_boost and add_ride_boost to case insensitive. 2025-09-06 21:04:37 -04:00
Konoha 4bda306a3b Refactor "getRideBoosts" helper to avoid signature conflict on public "rideBoosts" 2025-09-06 20:18:14 -04:00
Carmendar 2ee556dc31 Updated Bastiodon third person camera. 2025-09-06 18:21:05 -05:00
Carmendar 4457df9aba Updated Bastiodon ride overlays and fixed Magnezone portrait. 2025-09-06 18:15:47 -05:00
Konoha 6dfb073242 Add Ride Boost Molang Functions 2025-09-06 19:04:44 -04:00
Jakotens e1bd0d688f Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-09-06 17:00:23 -06:00
Jakotens 0bce2d8645 Fix third-person camera positions for most rideable Pokemon. 2025-09-06 17:00:14 -06:00
LandonandGitLab dfe240f1d3 Merge branch 'riding-scrape' into 'main'
More riding scrape stuff

See merge request cable-mc/cobblemon!1841
2025-09-06 22:11:16 +00:00
Landon Wills f1ac0fe99f Scrape riding updates 2025-09-06 17:27:08 -04:00
Landon Wills c2f575bf22 Add condition so boat jumps do not run land jump animations 2025-09-06 17:11:22 -04:00
Konoha 5f76966678 Implement event handling function on InteractPokemonHandler
Update licenses.
2025-09-06 17:09:14 -04:00
Carmendar beddea1ecb Merge branch 'main' into implement_pokemon 2025-09-06 16:08:48 -05:00
Carmendar 04236fcf33 Prepped Bouffalant for scrape. 2025-09-06 15:59:12 -05:00
LandonandGitLab 05e87b7faf Merge branch 'riding-scrape' into 'main'
Add new scraper files

See merge request cable-mc/cobblemon!1840
2025-09-06 20:55:34 +00:00
Landon Wills e9d298834a Merge branch 'riding-scrape' into implement_pokemon 2025-09-06 16:14:59 -04:00
Landon Wills ce113cbb80 Add new condition to poser for ride style 2025-09-06 16:11:13 -04:00
Tyzillion 61ebe7124a Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-09-06 16:01:04 -04:00
Tyzillion 462c0b35b8 Starly Line remodels implemented. 2025-09-06 16:00:51 -04:00
Carmendar 0b55c88ec4 Prepped Rampardos for scrape, includes placeholder controller. 2025-09-06 14:51:38 -05:00
Landon Wills 942da6b2f6 Merge branch 'implement_pokemon' into riding-scrape 2025-09-06 15:45:20 -04:00
Konoha 224c38e0a7 Ride Pokemon Event and Flowback 2025-09-06 15:36:10 -04:00
Landon Wills 056917f7df Adjust basic behaviour in scraper, run scraper 2025-09-06 15:28:15 -04:00
Carmendar 2aa9379987 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-09-06 14:06:16 -05:00
Carmendar 3a6a3253a3 Prepped Carracosta for scrape, removed controller from Unfezant. 2025-09-06 14:05:48 -05:00
Landon Wills 1580a06a8e Run scraper 2025-09-06 14:32:26 -04:00
Tyzillion e2bfdd3e76 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/repository/VaryingModelRepository.kt
2025-09-06 14:30:50 -04:00
Jerzykv 1d24565aa6 Changelog 2025-09-06 18:03:55 +02:00
Jerzykv 2d80402688 Added Gholdengo and Gimmighoul remodels/retextures + cosmetics 2025-09-06 16:13:13 +02:00
Carmendar 20614b6b07 Merge branch 'main' into implement_pokemon 2025-09-06 04:58:47 -05:00
Carmendar b32b5a66a4 Prepped Venusaur, Parasect and Dusknoir for scraping. Adjusted portraits for Squirtle and Wartortle. - updated changelog. 2025-09-06 04:57:38 -05:00
Carmendar ad92804fce Prepped Amaura, Bastiodon and Ursaring for Scraping. Includes placeholder controllers. 2025-09-06 01:08:35 -05:00
GenotypeXD-Dev ca93955134 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-09-06 00:55:37 -05:00
HirokuandGitLab 01d99676f9 Merge branch 'mo-molang-mo-problems' into 'main'
Add ability to specify file paths for MoLang stores

See merge request cable-mc/cobblemon!1744
2025-09-06 05:55:06 +00:00
GenotypeXD-Dev 2c8fd29cf1 Implemented Pikachu Cosmetics (Ash caps, Captain Cap, Hair Fluff) and added more usable leaves for hawluchas cosmetic [Detective pikachu and Partner Pikachu Tomorrow] 2025-09-06 00:55:06 -05:00
Carmendar a9eec5f568 Removed Hisuian Avalugg from evo selection. 2025-09-06 00:47:30 -05:00
Hiroku e54eaa728b Merge branch 'main' into 'mo-molang-mo-problems'
# Conflicts:
#   common/src/main/kotlin/com/cobblemon/mod/common/api/molang/MoLangFunctions.kt
2025-09-06 04:17:27 +00:00
Paul 4e550151e5 Merge remote-tracking branch 'origin/main' 2025-09-06 14:16:02 +10:00
Paul 67f5259742 Pokemon that don't defend themselves will instead run for their life when hurt 2025-09-06 14:15:52 +10:00
jackowes eb783e13ba un t-pose gyarados 2025-09-05 22:33:25 -05:00
HirokuandGitLab 68237e7161 Merge branch 'Special-Candy-Recipes-2-Electric-Boogaloo' into 'main'
Special candy balancing.

See merge request cable-mc/cobblemon!1832
2025-09-06 02:52:59 +00:00
Wi2tert ec9f7665e2 Push files!! 2025-09-06 10:16:19 +08:00
Wi2tert f19ae0120e Push files!! 2025-09-06 10:07:08 +08:00
Wi2tert d674ff1d40 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-09-06 10:01:51 +08:00
Wi2tert 37d6f58536 "Remodels": dusknoir 2025-09-06 10:00:26 +08:00
Jakotens 2ce23e072d Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-09-05 19:08:15 -06:00
Jakotens d37dfee032 Updated models and animations for Sneasel, Sneasel (Hisui), Weavile, and Sneasler. Added animations for Capsakid and Scovillain. Updated changelog to reflect previous changes. 2025-09-05 19:08:08 -06:00
HirokuandGitLab ee567a63b6 Merge branch 'hero-holo' into 'main'
Data Tweaks

See merge request cable-mc/cobblemon!1836
2025-09-05 23:45:13 +00:00
dhi_holoandGitLab 868dd9cc44 Data Tweaks 2025-09-05 23:45:12 +00:00
HirokuandGitLab 3f9b0002a9 Merge branch 'FixDespawns' into 'main'
Fixed despawning blocking on empty held items, fixed forced spawns having...

See merge request cable-mc/cobblemon!1834
2025-09-05 23:44:37 +00:00
Hiroku e07b15c8fc Use named parameters where same type arguments are chained 2025-09-05 23:41:40 +00:00
HirokuandGitLab 44c5c21fb5 Merge branch 'storage-saver' into 'main'
Protect the storages!

See merge request cable-mc/cobblemon!1837
2025-09-05 23:39:27 +00:00
HirokuandGitLab 9d13e86487 Merge branch 'wild-interact' into 'main'
Prevent interact wheel on wild pokemon

See merge request cable-mc/cobblemon!1833
2025-09-05 23:26:06 +00:00
Landon Wills afa395cfeb Just mount without interact UI for passengers 2025-09-05 15:00:29 -04:00
Konoha 831903b8e3 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-09-05 14:58:19 -04:00
Konoha d382f48e2d Implement stubbed item evo conditions for Duraludon and Kubfu 2025-09-05 14:57:59 -04:00
Landon Wills 2b2b44a535 Merge branch 'main' into wild-interact 2025-09-05 14:16:22 -04:00
GenotypeXD-Dev ac9d85929e Implemented Articuno, Zapdos, Moltres, And Mewtwo Remodels 2025-09-05 11:29:13 -05:00
GenotypeXD-Dev 88c981bd6a Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-09-05 09:33:32 -05:00
GenotypeXD-Dev f0baa21b1f Fearow line, Vulpix line, And hawlucha placeholder cries 2025-09-05 09:33:13 -05:00
Neovitalism 1d5d78b953 Protect the storages! 2025-09-05 04:29:14 -05:00
Neovitalism 2a62b49eab Update PokemonSpecies.kt 2025-09-04 21:10:49 -05:00
Paul f771248936 oop 2025-09-05 12:05:16 +10:00
JazzMcNade 35850ea996 Merge branch 'main' into FixDespawns 2025-09-04 20:31:04 -05:00
Landon Wills caaccf0e67 Prevent mounting if pokemon is in pasture 2025-09-04 21:29:45 -04:00
JazzMcNade e5de8bd26f Fixed despawning blocking on empty held items, fixed forced spawns having persistence do to having a held item. 2025-09-04 20:28:33 -05:00
Landon Wills 9528d375f4 Prevent interact wheel on wild pokemon 2025-09-04 21:21:24 -04:00
Paul 9aac7dc8e3 Fixed crash when baiting rods on servers 2025-09-05 11:12:12 +10:00
Paul 0bebd2a71e Fixed sleepers not waking up properly in battle if they were sleeping before 2025-09-05 11:09:51 +10:00
Hiroku 55874e6a84 Merge branch 'poser-tpconvb' into 'main'
Add new offset option for third person offset + renamed the third person...

See merge request cable-mc/cobblemon!1817
2025-09-05 00:38:11 +00:00
Paul cda0e10524 Combee can herd after Vespiquen specifically (because it's funnier this way) 2025-09-05 10:24:50 +10:00
Paul 153f888cf5 Don't follow drowsy pokemon (get a designated driver smh) 2025-09-05 10:14:01 +10:00
Paul 6972b7d49d Eject passengers from pokemon the moment it starts getting recalled, combee no herd 2025-09-05 10:10:26 +10:00
Hiroku d7f442e2d0 Merge branch 'main' into 'poser-tpconvb'
# Conflicts:
#   common/src/main/resources/assets/cobblemon/bedrock/pokemon/posers/0967_cyclizar/cyclizar.json
2025-09-04 23:51:50 +00:00
Carmendar cc15c0a487 Special candy balancing. 2025-09-04 18:10:29 -05:00
Landon a37828e288 Merge branch 'riding-birddolphin-polish-01' into 'main'
Polish and improve bird ride

See merge request cable-mc/cobblemon!1829
2025-09-04 22:21:59 +00:00
Jackson BowesandLandon 91d00cb864 Polish and improve bird ride 2025-09-04 22:21:59 +00:00
Lennie 4ee628ea7a Implemented riding animations & temp ride controller for piloswine 2025-09-05 00:04:30 +02:00
Lennie 64c0001aff Implemented wing flapping sounds for volcarona 2025-09-04 23:17:55 +02:00
Lennie 320b2ff528 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-09-04 23:08:35 +02:00
Lennie cf8a1f5447 Implemented Mamoswine animation changes & model edits and added placeholder ride controller 2025-09-04 23:08:19 +02:00
Sterrezo 696d98f7cd Rebalanced wing flap sound volumes and properly added sounds for large chitin wings 2025-09-04 23:07:42 +02:00
Sterrezo 909b90aea1 Update gyarados_cry.ogg 2025-09-04 22:56:39 +02:00
GenotypeXD-Dev 04296ae04e Implemented Hawlucha Tweaks+Forest Champion Mask Cosmetic 2025-09-04 14:24:02 -05:00
Kenji_64 025dea4201 Dragapult remodels! (will come back for new poser and anims for Draga) 2025-09-04 15:21:00 +02:00
Sterrezo a0630ff738 Added sounds for large chitin wings and updated medium steel wing sounds 2025-09-04 14:43:57 +02:00
Polymeta 5b5de641cb poof and its gone
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-09-04 11:28:33 +01:00
Polymeta 5a8101e535 fix hydreigon behaviour and horse settings sync
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-09-04 11:02:54 +01:00
Polymeta 054c841ec7 Merge branch 'implement_pokemon' into 'main'
mergin' imp to main

See merge request cable-mc/cobblemon!1830
2025-09-04 08:25:24 +00:00
Carmendar b02ac04fe3 rabsca crash fix & prep for lugia scrape. 2025-09-04 00:44:33 -05:00
CeeJay c46a4d5936 try to offset vertically if teleport location is invalid 2025-09-04 01:08:11 -04:00
Landon 57b4159691 Merge branch 'Special-Candy-Recipes' into 'main'
Special candy recipes

See merge request cable-mc/cobblemon!1826
2025-09-04 02:31:36 +00:00
Landon 41e3b61657 Merge branch 'riding-scraper-3' into 'main'
Scrape new rideable pokemon

See merge request cable-mc/cobblemon!1828
2025-09-04 02:06:16 +00:00
Landon f48cd648fc Merge branch 'boat-expressions' into 'main'
Add expressions to behaviour settings for boat

See merge request cable-mc/cobblemon!1827
2025-09-04 01:57:05 +00:00
Landon Wills 76c457dcbc Update scraped pokemon 2025-09-03 21:20:49 -04:00
Landon Wills cae828dc48 Merge branch 'main' into riding-scraper-3 2025-09-03 21:16:34 -04:00
Landon 39aa9d3ff1 Merge branch 'riding-scraper-ranges' into 'main'
Update scraped data

See merge request cable-mc/cobblemon!1823
2025-09-04 01:15:57 +00:00
Landon Wills 43d4b127ae Merge branch 'implement_pokemon' into riding-scraper-3 2025-09-03 21:12:07 -04:00
Landon Wills 008c75d591 Add expressions to behaviour settings for boat 2025-09-03 21:09:53 -04:00
Landon c32d8a5389 Merge branch 'boat-changes' into 'main'
Modify stamina logic, add 'sprint' to boat

See merge request cable-mc/cobblemon!1825
2025-09-03 23:14:02 +00:00
CeeJay c3c57f3f33 try using randomTeleport rather than homemade teleportation 2025-09-03 17:48:04 -04:00
Landon Wills 24bbfdf038 Modify stamina logic, add 'sprint' to boat 2025-09-03 12:10:56 -04:00
Polymeta b3590eb49b Merge branch 'Mo-Functions-MOLANG' into 'main'
Battle Themes Fixed and A BUNCH of MoLang.

Closes #1468

See merge request cable-mc/cobblemon!1797
2025-09-03 08:31:43 +00:00
Carmendar 0b51e0fe48 Typo fix 2025-09-03 00:29:46 -05:00
Carmendar 68c144e366 Added recipes for... candy. 2025-09-02 21:05:00 -05:00
Carmendar 506b0e8c70 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-09-02 17:55:09 -05:00
Carmendar 5091abc8ef Implemented new animations for Baltoy & Claydol. 2025-09-02 17:54:30 -05:00
Tyzillion 2a7503db06 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2025-09-02 15:55:55 -04:00
Tyzillion 1480bd97c2 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/repository/VaryingModelRepository.kt
2025-09-02 15:55:42 -04:00
Segfault Guy 11239ff856 Add flag to BattleMusicPacket to determine whether a sound is restarted if played consecutively. 2025-09-02 15:36:27 -04:00
Polymeta eaca59a420 Merge branch 'cooking-fixes-never-stop' into 'main'
Another Serving of Cooking Pot Fixes

See merge request cable-mc/cobblemon!1820
2025-09-02 14:47:59 +00:00
Gertimoshka 6e5a09d74d Silly Eevee make silly mistake - Fixed cooking pot cooking only then open instead of closed 2025-09-02 16:47:06 +03:00
Jerzykv 79d6f4de1f Bellibolt species file fix 2025-09-02 11:27:40 +02:00
violet 3e212a8eb1 bellibolt fixes + houndour & houndoom placeholder cries 2025-09-02 04:45:19 -04:00
Polymeta 1084f40282 Merge branch 'snack' into 'main'
♨️

See merge request cable-mc/cobblemon!1815
2025-09-02 08:34:49 +00:00
Polymeta e82609176f Merge branch 'client-on-server-bug' into 'main'
Fix bug with LivingEntityMixin$pick() on server with riding.

See merge request cable-mc/cobblemon!1816
2025-09-02 08:30:20 +00:00
Carmendar 169464ca47 Merge branch 'main' into implement_pokemon 2025-09-02 00:27:51 -05:00
Gertimoshka 3a3a505e92 Fixed Merge Conflicts 2025-09-02 05:03:19 +00:00
Konoha df727d8619 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-09-01 21:50:03 -04:00
Konoha c44e2f43f8 Fix conflicting regional evolution anticonditions.
Implement Galarian Weezing evolution.
Stub Hisuian Avalugg evolution.
2025-09-01 21:49:50 -04:00
Carmendar 7223bd77d9 Updated Zweilous model. 2025-09-01 20:46:09 -05:00
Konoha 59cb3017a2 Implement Bergmite Hisuian Evolution 2025-09-01 20:12:13 -04:00
Landon Wills 1f00890cec Remove debug logs from scraper 2025-09-01 18:20:29 -04:00
Landon Wills c7e01ae07b Update ride stats for real this time 2025-09-01 18:19:42 -04:00
Landon Wills f0fa87e06a Update script for new columns and stat ranges, update scraped riding stats 2025-09-01 17:19:12 -04:00
Landon Wills b4c211ac08 Merge branch 'implement_pokemon' into riding-scraper-ranges 2025-09-01 17:08:38 -04:00
Landon 82da0e8337 Merge branch 'riding-bug-fixes' into 'main'
Riding bug fixes

See merge request cable-mc/cobblemon!1822
2025-09-01 20:43:40 +00:00
Landon Wills 75bb5d8ac7 Reset animation data on driver dismount 2025-09-01 15:59:40 -04:00
Landon 2ae3da859a Merge branch 'riding-rocket-polish-01' into 'main'
Finalize rocket functionality

See merge request cable-mc/cobblemon!1803
2025-09-01 19:39:46 +00:00
Jackson BowesandLandon ef3e49529b Finalize rocket functionality 2025-09-01 19:39:46 +00:00
Landon 121afaf478 Merge branch 'riding-jet-polish-01' into 'main'
Jet Polish

See merge request cable-mc/cobblemon!1819
2025-09-01 19:39:44 +00:00
Jackson BowesandLandon a6128cd36a Jet Polish 2025-09-01 19:39:44 +00:00
Landon c8cd9adb4f Merge branch 'riding-hover-polish-01' into 'main'
Hover Ride polish

See merge request cable-mc/cobblemon!1818
2025-09-01 19:39:27 +00:00
Jackson BowesandLandon b2d5b9d6a2 Hover Ride polish 2025-09-01 19:39:27 +00:00
Landon Wills ab6051f88a Fix boats behaviours sinking, fix boat mount logic if submerged 2025-09-01 15:34:22 -04:00
Landon Wills 98800f695a Prevent transitions to air if pokemon does not have air behaviour 2025-09-01 15:24:20 -04:00
Gertimoshka fdebf4db73 General cleanup of unused/redundant code of cooking pot related stuff 2025-09-01 20:25:22 +03:00
Lennie 5f21a50e7e Animation updates for Klink, Klang & Klinklang
Implemented a temporary ride controller for klinklang
2025-09-01 18:41:34 +02:00
Gertimoshka 0d233f109d Fixed the Achievement for placing cooking pot on the campfire 2025-09-01 19:36:08 +03:00
Gertimoshka 467a6901c7 Fixed the raycast collision of campfire with pot not counting pot 2025-09-01 19:12:10 +03:00
Kenji_64 d4cd6b0ac6 Updated Pikachu line's emissives + minor head rotation adjustments for Alolan Raichu 2025-09-01 15:59:43 +02:00
Gertimoshka ee7e0b2e91 Fixed default color broth bubbles not apearing as well as fixing some new blockstate caused minor bugs 2025-09-01 16:31:49 +03:00
Jerzykv 1da1cdcb10 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-09-01 15:00:07 +02:00
Jerzykv 35c5e2fec6 Unmuted Abra and Kadabra 2025-09-01 14:59:42 +02:00
Kenji_64 efa1a9f383 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-09-01 14:13:15 +02:00
Paul 6bb749d806 Duplicate JSON keys in Unown oops 2025-09-01 20:15:57 +10:00
Carmendar 104755343b Texture updates for Weedle. 2025-08-31 21:13:11 -05:00
Carmendar 9e0ab5363f Animations added for Deino line and Slaking, and added placeholder ride controllers. 2025-08-31 20:26:28 -05:00
Paul 19d5903e2c Fixed R-bind misbehaving 2025-09-01 10:47:38 +10:00
Lennie dbd55b9382 Corrected a typo in dwebble's poser 2025-09-01 00:12:35 +02:00
JPAKx4 3bb5ecd2b6 Add new offset option for third person offset + renamed the third person offset with no view bobbing. 2025-08-31 16:59:38 -05:00
JPAKx4 def44930e4 Fix bug with pick() on server with riding. 2025-08-31 16:05:22 -05:00
Jakotens 3d7b95d7fe Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-08-31 13:23:27 -06:00
Jakotens 0f44b40d21 Added riding animations to Dragonite. Implemented animations for Serperior. 2025-08-31 13:23:20 -06:00
Lennie 987c1e2244 Removed kotlin posers for espathra, flygon, larvesta and volcarona 2025-08-31 20:49:16 +02:00
Lennie 1b184af306 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-08-31 20:24:48 +02:00
Lennie fc37cf403b Implemented espathra ride animations and placeholder ride controller 2025-08-31 20:24:30 +02:00
Jerzykv ae160cca80 Implemented Kadabra and Alakazam animations + locators for the whole line. Fixed Abra's portrait. Kadabra can sleep now 2025-08-31 18:04:47 +02:00
Kenji_64 ea21596460 Changelog for the Pikas 2025-08-31 15:25:17 +02:00
Kenji_64 32233737c1 Implemented Pikachu line remodels and some clean-up for their regional bias forms! 2025-08-31 15:24:30 +02:00
Kenji_64 f0ab01ed0c Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-08-31 15:19:56 +02:00
Konoha 3a8354fb1f Legacy Learnable move MoLang query implementation 2025-08-31 09:08:52 -04:00
Kenji_64 25493b521e Fixed Spinarak's shoulder pose position 2025-08-31 14:16:01 +02:00
Gertimoshka df5407e200 Lid and Cooking is now Blockstates for the Campfire with Pot fixing several bugs as well as introducing additional observer interactions 2025-08-31 13:15:06 +03:00
Lennie 2bdc29873a Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-08-31 10:30:35 +02:00
Lennie 6ca89e1091 Implemented animations and placeholder ride controller for flygon 2025-08-31 10:30:12 +02:00
violet 92c488861c Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-08-31 04:24:43 -04:00
violet 259bf693b6 ⭐ Added Cleffa, Clefairy, and Clefable's remodels 2025-08-31 04:24:34 -04:00
Test 43dbfc772e Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon 2025-08-30 22:06:27 -04:00
GenotypeXD-Dev ab8dd5f477 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-08-30 19:23:59 -05:00
GenotypeXD-Dev f1d2145359 Implemented Remodels for the Spearow line, Nidoking, Vulpix line, and Grimer line 2025-08-30 19:21:50 -05:00
Test 52a74bd182 Merge branch 'sterr/wind-noises-lite' into 'main'
Updated ambient ride sounds

See merge request cable-mc/cobblemon!1814
2025-08-30 23:21:45 +00:00
Sterrezo ef9f84d127 Updated ambient ride sounds 2025-08-31 00:07:25 +02:00
Test d27a30d5f1 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into snack 2025-08-30 17:59:40 -04:00
Test c1b4d98b6d ender pearl cosmetic mixin, kingler bubbles 2025-08-30 17:59:26 -04:00
Tyzillion e14e44a1c5 Mime.Jr and Mr.Mime model updated, Mr.Mime animations updated. 2025-08-30 17:58:00 -04:00
Test eb64aa3207 add particles for poke snack, update item sprite for differentiation 2025-08-30 17:50:59 -04:00
Tyzillion 46cc276e2e Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-08-30 17:17:52 -04:00
Jakotens d663461c51 Added riding animations to Mudsdale. Implemented animations for Rookidee, Corvisquire, and riding animations for Corviknight. Adjusted third-person riding camera offsets for Skiddo, Gogoat, Girafarig, Farigiraf, Braviary, Braviary-Hisuian, and Cyclizar. 2025-08-30 14:55:14 -06:00
Kenji_64 8c1d4f9790 Backtracked and made Dudunsparce rideable! (with placeholder stats) 2025-08-30 21:23:49 +02:00
Kenji_64 82bf374cad Replaced the placeholder cry for Cyclizar with the approved cry! 2025-08-30 18:16:33 +02:00
Kenji_64 5c9c42705a Added placeholder cry for Cyclizar! 2025-08-30 16:42:39 +02:00
Kenji_64 4c77dba0b5 Tadbulb base texture fix 2025-08-30 15:49:45 +02:00
Kenji_64 dcd431c699 Shiny Tirtouga palette fix 2025-08-30 15:49:34 +02:00
Kenji_64 165b137de2 Shiny Emboar nose fix 2025-08-30 15:49:18 +02:00
Kenji_64 e40a2386c2 Latias and Latios are rideable again (with placeholder stats) 2025-08-30 15:48:32 +02:00
Kenji_64 8933bab24f New metal textures for Beldum line 2025-08-30 15:47:52 +02:00
Lennie b7b58019cd Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-08-30 14:29:32 +02:00
Lennie edffb938d6 Implemented animations for dwebble and crustle 2025-08-30 14:28:39 +02:00
Paul 3a074bff8a Fixed dummy moves from removed addons corrupting pokemon stores 2025-08-30 21:35:08 +10:00
Jerzykv 0e33023517 Fixed Politoed's drop 2025-08-30 13:35:06 +02:00
Paul 3874e21c65 Fixed dummy abilities from removed addons corrupting pokemon stores 2025-08-30 21:21:20 +10:00
Jerzykv 5132b47427 Leavanny no longer ominously t-poses when walking 2025-08-30 11:56:41 +02:00
Jerzykv 526b1d145b Adjusted Sewaddle line hitboxes 2025-08-30 11:56:13 +02:00
Hiroku 70659cd818 Merge branch 'events_plus' into 'main'
Community Event Improvements

See merge request cable-mc/cobblemon!1798
2025-08-30 09:28:51 +00:00
AramandHiroku acdd6692c8 Community Event Improvements 2025-08-30 09:28:51 +00:00
violet 5607eb0bd8 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-08-30 05:24:30 -04:00
Jerzykv 5634b94c35 Forgot changelog 2025-08-30 10:56:51 +02:00
Jerzykv 272209c268 Unovan Zorua and Zoroark model and texture updates 2025-08-30 10:53:30 +02:00
violet f26b3242d5 added togetic animations + togepi placeholder cry 2025-08-30 04:45:02 -04:00
Paul b6ea8f728e Merge remote-tracking branch 'origin/main' into flows-be-callbacks 2025-08-30 17:20:23 +10:00
Paul e76818d7d8 Renamed "Flows" to Callbacks so it's less eccentric 2025-08-30 17:20:01 +10:00
Hiroku bcf379f218 Merge branch 'recipe-obtainment' into 'main'
Recipe Obtainment Fixes

Closes #1661

See merge request cable-mc/cobblemon!1813
2025-08-30 05:21:57 +00:00
Test 6cb0f296ce Fix summary name text cursor 2025-08-30 01:20:46 -04:00
Hiroku 433f4f6ca5 Merge branch 'pokemon-form-abilities-fix' into 'main'
Fix 'Forced' tag on Abilities for Alternate Forms

Closes #1649

See merge request cable-mc/cobblemon!1787
2025-08-30 05:09:27 +00:00
Paul dc8d55a7d2 Changelog oopsies [skip-ci] 2025-08-30 11:02:44 +10:00
Konoha 219bbbe077 Implement Galarian Mr. Mime evo 2025-08-29 20:26:24 -04:00
Konoha 70704b6330 Implement Galarian Weezing evo 2025-08-29 20:25:17 -04:00
dhi_holo 7f511a391c Recipe Obtainment Fixes
Fixes some campfire pot recipes not showing up in the recipe book

Closes #1661
2025-08-30 10:03:58 +10:00
Lennie 932f366c83 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-08-30 00:43:35 +02:00
Lennie 434218dda3 Implemented animations for Larvesta & Volcarona
Implemented placeholder ride stats for volcarona
2025-08-30 00:43:06 +02:00
Polymeta e4dbba026c Merge branch 'josh/model-widget-fixes' into 'main'
Model Widget Item Fixes

See merge request cable-mc/cobblemon!1812
2025-08-29 20:56:26 +00:00
Jakotens db1834f6bc Tweaked pokemon_follows_owner behavior so that Pokemon follow you more closely and don't teleport until you are much further away. 2025-08-29 14:49:44 -06:00
Jakotens dbbf96bb36 Updated Cyclizar animations and ride controller. 2025-08-29 13:11:40 -06:00
Josh 3a23f7a239 added item MoLang queries to Shoulder Mounts 2025-08-29 12:32:09 -04:00
Polymeta 9f6de64089 fix dolphins crashing... still looks odd, but progress
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-08-29 17:22:20 +01:00
Polymeta e86ee8a7d4 forcefully stop player sneaking when mounting pokemon
Fixes #1534

Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-08-29 16:30:43 +01:00
Josh 7829e83ba0 fixed item visibility button 2025-08-29 11:03:31 -04:00
Josh ab3747a0c4 added MoLang queries to ModelWidget.kt 2025-08-29 11:02:43 -04:00
Polymeta 501d81e4a6 fix cooking achievement not working on soul campfire
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-08-29 15:53:59 +01:00
Polymeta f62b566610 fix some particles not appearing on owned pokemon when thrown out
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-08-29 15:52:56 +01:00
Kenji_64 32a847af34 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-08-29 14:44:34 +02:00
Kenji_64 1d28672978 New posers for Plusle and Minun 2025-08-29 14:44:13 +02:00
Kenji_64 74a2a2b0ee Implemented Sobble line remodels! 2025-08-29 14:43:46 +02:00
Jerzykv 354ef66d2a Fixed oopsie with Murkrow poser 2025-08-29 14:43:38 +02:00
Kenji_64 a6f1182f02 Plusle and Minun remodels + animations! 2025-08-29 14:42:27 +02:00
Jerzykv 8825e7af3d Added Murkrow remodel and Honchkrow animations. Gave Honchkrow placeholder ride stats 2025-08-29 14:35:28 +02:00
Kenji_64 bcf119bf5d Fixed Bronzor's sleep not looping 2025-08-29 14:32:27 +02:00
Jerzykv d9cb59ca37 Changed Golurk's hitbox and made it able to breathe underwater 2025-08-29 14:21:00 +02:00
Jerzykv e33960effb Fixed Low-Key Toxtricity having no shiny 2025-08-29 14:11:46 +02:00
violet a20eae7cd8 fixed luigi's poser, labeled croagunk and toxicroak as implemented, gave alolan muk and grimer proper scales, fixed unown d's shiny 2025-08-29 04:15:54 -04:00
Hiroku 4adf40c5ec Merge branch 'LessRestrictiveWanders' into 'main'
Water Pathing Improvements

See merge request cable-mc/cobblemon!1807
2025-08-29 06:53:57 +00:00
Jakotens a27e0ffc7f Implemented riding animation for Drifblim. Implemented animations for Girafarig and Farigiraf. 2025-08-29 00:30:11 -06:00
JazzMcNade 3bea35eea2 Replace isInWater with isInLiquid 2025-08-29 01:04:06 -05:00
Jakotens 3db7ecd71f Temporary tweaks to Drifblim. 2025-08-28 19:26:09 -06:00
Paul 723eccc88a Fixed hypertrain IV fix running on already-converted data, causing random entities. Closes #1634 2025-08-29 11:08:43 +10:00
Paul 75785e0706 Fixed global species features not working, closes #810 2025-08-29 10:15:18 +10:00
Paul f21da15591 Fixed model sharing across posers causing cascading animation stacking 2025-08-29 09:53:39 +10:00
Polymeta 1be44c75d5 fix ride sound deserialization
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-08-29 00:50:30 +01:00
Jakotens cfea52f488 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-08-28 16:24:44 -06:00
Jakotens 53e94365ad Minor tweaks to Skiddo and Gogoat. 2025-08-28 16:24:34 -06:00
SamIr0n e393fd7a47 Teddiursa, Ursaring & Ursaluna Implementation
- Ride Mon Ursaluna
- Anims/Posers for all 3
- Fixed File Naming conventions
2025-08-28 22:57:24 +01:00
Polymeta 63eb0a1d9c Merge branch 'hoppers-like-vanilla' into 'main'
Revert Brewing Stand-Hopper interaction to Vanilla behavior

Closes #1658

See merge request cable-mc/cobblemon!1810
2025-08-28 21:29:55 +00:00
Jakotens 7a5908a0d3 Fixes to Braviary and Braviary-Hisuian posers. 2025-08-28 13:37:50 -06:00
Jakotens c234291e8c Temporary tweaks to Braviary and Braviary-Hisuian posers. Corrected sizes for Whirlipede and Scolipede. 2025-08-28 13:02:18 -06:00
Lennie b97115f1bd Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-08-28 19:55:24 +02:00
Lennie 8720a682c3 Created more personal space for the player when riding noivern 2025-08-28 19:55:10 +02:00
Sterrezo fd0d811b47 Retimed Noivern's wing flaps 2025-08-28 19:39:07 +02:00
Lennie 520341dfd3 Added animations, wing flap sounds and riding sounds for noivern.
More poser tweaks for zebstrika (he deserves it)
2025-08-28 19:14:17 +02:00
CeeJay d66b8d04c7 Change hopper removing from brewing stand to vanilla Minecraft
Resolves #1658
2025-08-28 11:51:40 -04:00
Tyzillion 5418407d1e Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into Mo-Functions-MOLANG 2025-08-28 09:55:19 -04:00
Kenji_64 4606d9e1c5 Magnezone flight animation added! 2025-08-28 15:54:31 +02:00
Kenji_64 4f839a2589 Added new animations for the Metagross line! 2025-08-28 15:54:01 +02:00
Kenji_64 257c362765 Added dive animation for Togekiss 2025-08-28 15:36:35 +02:00
Lennie 009a8c34e5 Tweaked seat positions for tropius and zebstrika
Small poser fixes to tropius, zebstrika and blitzle
2025-08-28 15:09:39 +02:00
Tyzillion 7e0ddb5b79 Now using readNullable and writeNullable. I made an attempt to fix the possible race condition but I don't know if it even fixed it. Removed the rideable check. I'll mess with that when I add the Riding flows. 2025-08-28 07:47:11 -04:00
Gertimoshka 8b5ef32d93 Fixed cooking pot JEI integration still allowing progress arrow to be pressed causing a crash without JEI 2025-08-28 14:22:11 +03:00
Polymeta 6acf2655b8 Merge branch 'main' into implement_pokemon 2025-08-28 12:16:35 +01:00
Lennie 0e40f0f3ad Updated changelog 2025-08-28 13:11:11 +02:00
Polymeta dfb2e21721 tweak golurk poser to show correct poses inside summary and pokedex GUI
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-08-28 12:10:36 +01:00
Polymeta 67cda56be5 Merge branch 'riding-scraper-2' into 'main'
Add scraper and results

See merge request cable-mc/cobblemon!1808
2025-08-28 11:06:48 +00:00
Polymeta b15545148b always run molang pose conditions instead of only when entity is attached, leaving control over this to the actual poser molang via q.has_entity
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-08-28 12:02:43 +01:00
Lennie b37a70c5db Updated changelog
Made unfezant un-ridable
Made kilowattrel ridable for testing purposes
Added ride_dive molang to tropius and kilowattrel posers
2025-08-28 12:58:40 +02:00
Landon Wills 0b9e0ac9c7 Add new scraped pokemon after implementation merge 2025-08-28 06:22:46 -04:00
Landon Wills f5383665f8 ridingSounds => rideSounds 2025-08-28 06:21:17 -04:00
Lennie 35bef5a008 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-08-28 12:17:51 +02:00
Lennie 17c25def97 Implemented unfezant line remodels
Implemented unfezant line animations
Made unfezant ridable for testing purposes
2025-08-28 12:14:10 +02:00
Landon Wills 5f9088dbf5 Merge branch 'implement_pokemon' into riding-scraper-2
# Conflicts:
#	common/src/main/resources/data/cobblemon/species/generation8a/wyrdeer.json
2025-08-28 06:11:56 -04:00
Landon Wills 8748ef6884 Add scraper and results 2025-08-28 06:09:01 -04:00
GenotypeXD-Dev ee270f59e1 Added Implemented Tag To Ho-oh 2025-08-28 04:42:31 -05:00
GenotypeXD-Dev a2c5866026 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-08-28 04:40:49 -05:00
GenotypeXD-Dev ab408c4246 Kentucky Fried Combusken 2025-08-28 04:40:21 -05:00
GenotypeXD-Dev 9e9a98b6f7 Implemented Ho-oh 2025-08-28 04:19:13 -05:00
violet 0b5fbb4d55 Added Luigi. 2025-08-28 05:07:25 -04:00
JazzMcNade d7a8e0fe92 Fix maths. Removed references to isSwimming b/c it empirically does not occur, even when the pokemon is actively traversing underwater. 2025-08-28 03:47:09 -05:00
JazzMcNade 3bd5867143 swimming wander can now target blocks without a solid below position. Fixed a bug in AABB.getRanges() for negative coordinates 2025-08-28 02:05:38 -05:00
Jakotens c8ab370720 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-08-27 20:49:09 -06:00
Jakotens 4a0ab9f092 Implemented animations and ride animations for Skiddo and Gogoat. Fixed ride animations for Braviary and Braviary-Hisuian. Implemented remodels and animations for Staryu, Starmie, Venipede, Whirlipede, and ride animations for Scolipede. 2025-08-27 20:49:02 -06:00
Jakotens a565f1cdb7 Revert "Implemented animations and ride animations for Skiddo and Gogoat. Fixed ride animations for Braviary and Braviary-Hisuian. Implemented remodels and animations for Staryu, Starmie, Venipede, Whirlipede, and ride animations for Scolipede."
This reverts commit 3a2075d00c.
2025-08-27 20:47:48 -06:00
Jakotens 3a2075d00c Implemented animations and ride animations for Skiddo and Gogoat. Fixed ride animations for Braviary and Braviary-Hisuian. Implemented remodels and animations for Staryu, Starmie, Venipede, Whirlipede, and ride animations for Scolipede. 2025-08-27 20:46:48 -06:00
Polymeta 9ef3caef53 Merge branch 'universal-healer-care' into 'main'
Healing at a healer heals PC Pokemon

Closes #731

See merge request cable-mc/cobblemon!1806
2025-08-27 21:07:28 +00:00
CeejayandPolymeta c449b84fff Healing at a healer heals PC Pokemon 2025-08-27 21:07:27 +00:00
Kenji_64 bcf429589a Some extra poser adjustments for Galarian Corsola 2025-08-27 23:05:54 +02:00
Kenji_64 4282445359 Added riding molang to Wyrdeer 2025-08-27 22:26:04 +02:00
Kenji_64 3e449ae1f5 Yoshi's Island looked different- Tyrantrum is now rideable! (+ attack anims) 2025-08-27 22:24:36 +02:00
Lennie 8510290e87 Implemented tropius animation updates & flapping sounds. Updated zebstrika's ride molang implementation 2025-08-27 21:30:05 +02:00
Tyzillion c854fc5745 Added q.player.riding_pokemon Molang function. Made an attempt of adding a Molang check for if a Pokemon is rideable but no luck. 2025-08-27 15:01:41 -04:00
Tyzillion 1a3a6443d8 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into Mo-Functions-MOLANG 2025-08-27 14:58:36 -04:00
Kenji_64 b461dbce62 You unlocked Ariados as a mount! (+ new animations for the whole line) 2025-08-27 20:01:48 +02:00
Kenji_64 86e33b3ffd You unlocked Togekiss as a mount! 2025-08-27 19:56:05 +02:00
Kenji_64 78c34fb7d0 You unlocked Wyrdeer as a mount! (+ animation update) 2025-08-27 19:53:53 +02:00
Kenji_64 2ce993718b You unlocked Zebstrika as a mount! 2025-08-27 19:47:38 +02:00
Tyzillion eee3296120 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2025-08-27 09:54:51 -04:00
Polymeta 9cf8b57457 Merge branch 'do-the-brew-fixes' into 'main'
Cobblemon Brewing Fixes

Closes #1656 and #1631

See merge request cable-mc/cobblemon!1805
2025-08-27 13:44:26 +00:00
CeejayandPolymeta 208937defc Cobblemon Brewing Fixes 2025-08-27 13:44:25 +00:00
Polymeta 3e9b6cffdb Merge branch 'pot' into 'main'
Pot, PC

See merge request cable-mc/cobblemon!1800
2025-08-27 13:31:53 +00:00
JazzMcNade 2cf253a1fe Allow amphibious pokemon to wander water. Allow walking pokemon to wander air. 2025-08-27 02:57:58 -05:00
Tyzillion 29bb481363 Added q.pokemon.is_busy Molang Function. 2025-08-26 21:52:59 -04:00
Tyzillion 1f3589a592 Added q.entity.make_intangible() Molang Function. 2025-08-26 21:31:35 -04:00
Jakotens 66d697aa69 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-08-26 16:11:17 -06:00
Jakotens f93ebf19b0 Fixed Rufflet, Braviary, and Braviary-Hisuian not having their sleep poses set or resting behaviors defined. 2025-08-26 16:11:06 -06:00
Lennie b7a30d8f62 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-08-26 23:26:53 +02:00
Lennie e75e54e7ff Added seat_1 locator to kilowattrel and updated changelog 2025-08-26 23:25:45 +02:00
Kenji_64 65707cbfde Finalized Golurk's poser with attacks + minor fixes! 2025-08-26 23:01:00 +02:00
Lennie 680bc25983 Added animations for wattrel and kilowattrel 2025-08-26 22:46:21 +02:00
Lennie f4a1e67f9b Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-08-26 22:35:16 +02:00
Lennie c269a808ea Added animations for wattrel and kilowattrel 2025-08-26 22:34:15 +02:00
Jakotens dbec251408 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-08-26 14:18:24 -06:00
Jakotens 1f9466412b Implemented animations for Rufflet, Braviary, and Braviary (Hisuian). Also fixed sounds.json to correctly include Braviary (Hisuian)'s cry. 2025-08-26 14:18:01 -06:00
Lennie aa6038c704 Riding animation edits for zebstrika, and tweaks for blitzle 2025-08-26 21:16:00 +02:00
Tyzillion 0d5c84c396 Changed battle theme related soundevents to all be resourcelocations instead. No more casting, yayyyy!
q.force_evolve now does just that.
Moved some variables in Battle Builder.
Updated Changelogs!
2025-08-26 13:24:24 -04:00
Tyzillion dd9bc0d1d5 Merge remote-tracking branch 'origin/Mo-Functions-MOLANG' into Mo-Functions-MOLANG 2025-08-26 13:00:43 -04:00
Tyzillion 8aa00c1c31 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into Mo-Functions-MOLANG 2025-08-26 13:00:16 -04:00
Jakotens eaec3ea2c8 Added animations for Rufflet, Braviary, and, Braviary (Hisuian) 2025-08-26 10:30:12 -06:00
Jakotens efd32d2eee Merge branch 'implement_pokemon' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2025-08-26 10:27:01 -06:00
Jakotens 49580bd65b Added animations for Rufflet, Braviary, and, Braviary (Hisuian) 2025-08-26 10:26:35 -06:00
Jakotens 7b761bfa8e Added animations for Rufflet, Braviary, and, Braviary (Hisuian) 2025-08-26 10:25:28 -06:00
Polymeta f7a82a5725 Merge branch 'implement_pokemon' into 'main'
more mons

See merge request cable-mc/cobblemon!1804
2025-08-26 10:42:03 +00:00
Polymeta 04384bb4f2 Edit CHANGELOG.md 2025-08-26 10:37:17 +00:00
Polymeta 9cd8a492a5 Merge branch 'main' into 'implement_pokemon'
# Conflicts:
#   common/src/main/resources/data/cobblemon/species/generation2/corsola.json
#   common/src/main/resources/data/cobblemon/species/generation8/cursola.json
2025-08-26 09:55:22 +00:00
Polymeta f340a5193a Merge branch 'riding-horse-polish-01' into 'main'
Riding horse polish

See merge request cable-mc/cobblemon!1796
2025-08-26 08:16:09 +00:00
Jackson BowesandPolymeta d7a444d884 Riding horse polish 2025-08-26 08:16:09 +00:00
Polymeta eb632362e9 Merge branch 'riding-dive-molang' into 'main'
Riding dive molang

See merge request cable-mc/cobblemon!1795
2025-08-26 08:12:42 +00:00
Jackson BowesandPolymeta 01fff25f39 Riding dive molang 2025-08-26 08:12:42 +00:00
Konoha 2ef1c7b855 Fix Drednaw hitbox, walk-speed, and anim. 2025-08-25 20:57:25 -04:00
Tyzillion caa46e8bbf Added spawn_npc Molang! 2025-08-25 17:55:41 -04:00
Konoha eeca593427 Resolve issue with Squawkabilly-White shiny.
Chewtle and Drednaw to CHANGELOG.md
2025-08-25 17:44:15 -04:00
Polymeta dee15861f0 [skip-ci] changelog
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-08-25 22:07:33 +01:00
Polymeta a1df2788be Merge branch 'main' into 'main'
Port recipes of botanypots to MC1.21.1

See merge request cable-mc/cobblemon!1793
2025-08-25 21:06:07 +00:00
Lennie 23d29c7309 Fixed drilbur poser referring to excadrill (oops) 2025-08-25 22:54:20 +02:00
Lennie 71312fd22b Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-08-25 22:27:58 +02:00
Lennie 02c7be92dc Implemented animations for drilbur and excadrill 2025-08-25 22:25:31 +02:00
Tyzillion 047172e30f Battle theme handling now uses ResourceLocation directly and added a Fading check to resolve issue of prior battle music instance not being reset for next battle. 2025-08-25 12:12:59 -04:00
Tyzillion 923d6f2a4d Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into Mo-Functions-MOLANG 2025-08-25 12:11:49 -04:00
Polymeta f7afdf6808 Merge branch 'riding-no-roll-options-01' into 'main'
Move and improve no roll compatibility for rolling controllers (dolphin wip)

See merge request cable-mc/cobblemon!1802
2025-08-25 15:45:21 +00:00
Jackson BowesandPolymeta 0c92fbf952 Move and improve no roll compatibility for rolling controllers (dolphin wip) 2025-08-25 15:45:21 +00:00
Tyzillion 21646d4646 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into Mo-Functions-MOLANG 2025-08-25 09:44:17 -04:00
Paul da29055309 Changelog 2025-08-25 20:03:26 +10:00
Paul 66e4390c79 Scraped herding species data and fixed a lil bug in the scraper 2025-08-25 20:03:18 +10:00
violet 0fbb97a9b9 Unknown. 2025-08-25 03:56:06 -04:00
Polymeta 93242c3025 Merge branch 'more-configs-for-riding' into 'main'
Riding: Mouse Control changes

See merge request cable-mc/cobblemon!1801
2025-08-24 21:26:58 +00:00
Test 11f7158e8e changelog 2025-08-24 17:22:15 -04:00
Test 5d503a90f7 add shading to berries on berry trees 2025-08-24 17:19:26 -04:00
Test 116db0aa7c update mark molang conditions 2025-08-24 16:59:57 -04:00
Test b90e700538 fixed background field, added textColor field for dialogues 2025-08-24 15:44:36 -04:00
Charzard4261 7074b310e6 Move riding pitch/yaw inversion to the MouseHandlerMixin
Added per-axis sensitivity and axes swapping to MouseHandlerMixin
Correct mixup in the invert pitch/yaw tooltip in en_us.json
2025-08-24 15:54:34 +01:00
Charzard4261 9a23eab208 Merge branch 'main' into more-configs-for-riding
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/api/riding/behaviour/types/air/BirdBehaviour.kt
2025-08-24 13:03:55 +01:00
violet b035cc7ca7 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-08-24 05:26:43 -04:00
violet f1b9a3dc00 added axew, fraxure,and haxorus 2025-08-24 05:26:15 -04:00
Test 57372335b3 add alternate wallpapers, assets 2025-08-24 01:14:02 -04:00
Hiroku 8563d27429 Merge branch 'riding-statsDebugGUI-fix' into 'main'
Fix issue with saving off all stats with the speed changes.

See merge request cable-mc/cobblemon!1799
2025-08-24 05:04:00 +00:00
jackowes 0b284b8b9a Fix issue with saving off all stats with the speed changes. 2025-08-23 21:31:35 -05:00
Tyzillion cd06bc9903 Varibles goes brrrrrr 2025-08-23 17:53:22 -04:00
Tyzillion a2531d359a Merged in Amo's branch that allows resourcepack sounds in battle music. Made it compatible with BattleBuilder.kt. I think I fixed BattleMusicController.music only letting the battle theme play for one battle? 2025-08-23 16:50:52 -04:00
Tyzillion 1ee12c592b Merge remote-tracking branch 'origin/battle-music-fix' into Mo-Functions-MOLANG 2025-08-23 14:41:48 -04:00
Tyzillion f52e31c770 You can now add a battle theme to a player and NPC through Molang. 2025-08-23 12:41:21 -04:00
Test f5debdb14f update pot to use model+tint instead of texture atlas 2025-08-23 12:34:57 -04:00
Test 25544681ae update pot to use model+tint instead of texture atlas 2025-08-23 12:32:49 -04:00
Tyzillion 529df4e8b4 Added Molang for checking if an entity is a certain thing and added the ability to apply, remove, and check effects of an entity. 2025-08-23 06:33:37 -04:00
Tyzillion d2bc8613c9 Added Molang evolution check and forcing an evolution. 2025-08-23 05:47:47 -04:00
Tyzillion 1706b7c516 Player Molang functions to control Battle Music. 2025-08-23 03:30:03 -04:00
Tyzillion c1263ad674 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into Mo-Functions-MOLANG 2025-08-23 02:52:27 -04:00
Paul 738a3e9446 KotlinExpression subclass of ExpressionLike, handy 2025-08-23 16:30:12 +10:00
Polymeta e18347ea75 Merge branch 'riding-revavroom' into 'main'
Unrideable Revavroom, for now

Closes #1650

See merge request cable-mc/cobblemon!1792
2025-08-22 23:05:19 +00:00
CeejayandPolymeta d064927715 Unrideable Revavroom, for now 2025-08-22 23:05:18 +00:00
CeeJay 32ef93d79d update changelog 2025-08-22 22:19:30 +00:00
CeeJay 5a06602503 make sure form setting happens before checking ability legality for applying Pokemon properties 2025-08-22 22:19:30 +00:00
Tyzillion 24a68fefa7 Added more Molang functions.
You can now check if the player is in survival, seen the credits, is in a dialogue and you can obtain the active dialogue.
Also check if an entity is looking at a certain entity.
2025-08-22 17:43:55 -04:00
Tyzillion b0dec54576 Added a creative and spectator mode check for the player via Molang. 2025-08-22 16:31:10 -04:00
Tyzillion fb7712a5ce Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into Mo-Functions-MOLANG 2025-08-22 16:28:19 -04:00
CeeJay 0dba1e9f82 teleporting changelog 2025-08-22 13:51:25 -04:00
CeeJay 41457d8da8 battle properly ends after wild pokemon teleport
Resolves #391
2025-08-22 13:48:54 -04:00
Polymeta 752941a5da Merge branch 'LionsFoxesAndWolvesOhMy' into 'main'
Configurable Pokemon Item Pickup and Consumption

See merge request cable-mc/cobblemon!1776
2025-08-22 09:48:29 +00:00
lsxuan12138 c6d63c42d2 delete load_conditions 2025-08-22 17:18:49 +08:00
Paul 975cba482a Collection<ObtainableItem>.findMatchingEntry requires a registry access 2025-08-22 18:54:48 +10:00
Paul 8a580ac75b Use mainThreadRuntime in a bunch of places 2025-08-22 18:46:27 +10:00
Paul bc5a858fe9 Merge remote-tracking branch 'origin/main' into LionsFoxesAndWolvesOhMy 2025-08-22 18:46:00 +10:00
lsxuan12138 bc40b101f1 Port recipes of botanypots to MC1.21.1 2025-08-22 16:41:22 +08:00
JazzMcNade 2b6fa0a38e Typo 2025-08-21 21:43:57 -05:00
JazzMcNade b1e9cddaa3 Fixed unsafe brain memory check 2025-08-21 21:38:39 -05:00
JazzMcNade 9983f44449 Missed a spot 2025-08-21 20:46:22 -05:00
JazzMcNade 6aa2a0db3d Peer Review changes 2025-08-21 20:40:49 -05:00
Sterrezo 384afd77ca Added wing flap sounds to Farfetch'd 2025-08-22 01:11:32 +02:00
Sterrezo d9b2a88040 Implemented wing flaps for Beedrill, Zubat and Venomoth 2025-08-22 00:46:43 +02:00
CeeJay a8db098652 Merge remote-tracking branch 'origin/wild-teleporting' into wild-teleporting
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/battles/interpreter/instructions/MoveInstruction.kt
2025-08-21 18:05:47 -04:00
CeeJay 1f241fc8dc add teleport sound 2025-08-21 18:03:23 -04:00
Kenji_64 88010bac6a Fixed G. Corsola line's walk speed (FR THIS TIME!!) 2025-08-21 23:54:51 +02:00
CeeJay 3921295fee send message in chat rather than battle ui 2025-08-21 15:17:17 -04:00
CeeJay 790e5e6c8b en_us and en_pt battleLang for a wild pokemon fleeing 2025-08-21 15:17:17 -04:00
CeeJay 2957cabf86 only end battle if pokemon successfully teleported away 2025-08-21 15:17:16 -04:00
CeeJay 6909c5ad6f wild pokemon use teleport -> teleports away 2025-08-21 15:17:16 -04:00
CeeJay c65d6bd83e send message in chat rather than battle ui 2025-08-21 15:16:33 -04:00
CeeJay dd6a526a49 en_us and en_pt battleLang for a wild pokemon fleeing 2025-08-21 14:28:31 -04:00
Landon b59b64153c Merge branch 'implement_pokemon' into 'main'
Merge implemented pokemon

See merge request cable-mc/cobblemon!1791
2025-08-21 16:38:53 +00:00
CeeJay b30b03fffd only end battle if pokemon successfully teleported away 2025-08-21 12:03:38 -04:00
Kenji_64 db61586f0f Added cry sounds to Slowpoke line + Galarian! 2025-08-21 15:18:47 +02:00
Kenji_64 07aca28b10 Fixed a resolver issue with the Kommo-o line 2025-08-21 15:01:52 +02:00
Kenji_64 9a2737722e Fixed the cry sound event for G. Corsola being wrong 2025-08-21 15:01:29 +02:00
Kenji_64 7210ed8ad3 Previously forgotten Changelog entries 2025-08-21 14:42:25 +02:00
Kenji_64 62e3f30eba Added placeholder cries back for Honedge line remodels 2025-08-21 14:41:35 +02:00
Kenji_64 84c2beb5c8 Added placeholder cries + sounds for Sewaddle line 2025-08-21 14:39:44 +02:00
Kenji_64 5204704e47 Tiny interpolation fix for Togekiss' special animation 2025-08-21 14:39:03 +02:00
Kenji_64 6eac615a67 Implemented Blitzle and Zebstrika animations! (Thank you Lennie!) 2025-08-21 13:46:58 +02:00
Kenji_64 c791b8a16d Fixed Alolan Raichu's and Galarian Rapidash's sound event being wrong 2025-08-21 13:41:39 +02:00
violet 0360e2eb88 added houndour & houndoom 🔥 2025-08-21 04:42:31 -04:00
CeeJay 1953538db5 wild pokemon use teleport -> teleports away 2025-08-21 01:38:55 -04:00
violet 5ecd69b3ce added togepi, togetic, togekiss (+ corsola animations) 2025-08-21 00:51:11 -04:00
Polymeta 5b90a4d894 prevent clientActions inside dialogues being executed twice
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-08-21 00:06:31 +01:00
Polymeta 69d3ef23ef fix pokedex lookup during battle causing crashes with namespaced species
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-08-20 21:50:03 +01:00
Konoha 3489389d79 chore: asset directory errors and typo corrections 2025-08-20 13:16:53 -04:00
Instrafe 4e417c0b19 Implemented locators for Remoraid & Octillery 2025-08-20 11:40:17 -04:00
Kenji_64 7aba5dc962 Fixed Altaria's cry sound event 2025-08-20 16:52:13 +02:00
Instrafe a5126f2158 Implemented locators for the Elemental Monkeys 2025-08-19 22:44:04 -04:00
Landon ca8bcd966f Merge branch 'playericonfix' into 'main'
don't touch my mixins if you're not going to bother testing your changes

See merge request cable-mc/cobblemon!1789
2025-08-19 19:06:49 +00:00
Segfault Guy 12c7318625 don't touch my mixins if you're not going to bother testing your changes 2025-08-19 09:42:44 -04:00
Hiroku 4f917b94e8 Merge branch 'narrator-dev-fix' into 'main'
Fixed narrator-related GUI crashes on NeoForge

See merge request cable-mc/cobblemon!1788
2025-08-19 12:03:57 +00:00
gruxor 9e82cb2516 Fixed narrator-related GUI crashes on NeoForge 2025-08-19 07:37:27 -04:00
Polymeta bbf85d5804 Merge branch 'riding-fix-failing-asserts' into 'main'
Move and rename the scaleToRange function and place it in the RidingBehaviour...

See merge request cable-mc/cobblemon!1783
2025-08-19 09:20:17 +00:00
Jackson BowesandPolymeta 9daa85750b Move and rename the scaleToRange function and place it in the RidingBehaviour... 2025-08-19 09:20:17 +00:00
Polymeta 6f7c3b0681 Merge branch 'riding-species-sprint-and-jet-crash-fix' into 'main'
Add ability to disable sprinting per species for horse and fix unneeded assert in a Jet function.

See merge request cable-mc/cobblemon!1780
2025-08-19 08:38:00 +00:00
Polymeta d262bb6136 Merge branch 'sound' into 'main'
Tatami, Hearty Grains and cooking sounds

See merge request cable-mc/cobblemon!1784
2025-08-19 08:37:18 +00:00
Polymeta 7509934394 Merge branch 'cooking-pot-ui-tweaks' into 'main'
Cooking Pot UI Tweaks + Bugfix

See merge request cable-mc/cobblemon!1785
2025-08-19 08:35:32 +00:00
GertimoshkaandPolymeta a0ae226506 Cooking Pot UI Tweaks + Bugfix 2025-08-19 08:35:32 +00:00
Sterrezo 0ca9f3a3ad Finalized wing flap audio assets 2025-08-18 15:11:49 +02:00
violet c5c10e0eec i forgot to update the changelog 🫶 2025-08-18 02:48:32 -04:00
violet 274ce14e0f added clouds ☁️🕊️ 2025-08-18 02:38:36 -04:00
Hiroku 0dde8d27e6 Merge branch 'ihatebugtypes' into 'main'
kill all bug type pokemon

Closes #1541

See merge request cable-mc/cobblemon!1786
2025-08-18 05:32:06 +00:00
Segfault Guy 559e728bc3 Deprecate ContextManager. 2025-08-18 00:34:12 -04:00
Segfault Guy dcea1bc67f Merge remote-tracking branch 'origin/main' into ihatebugtypes 2025-08-18 00:29:52 -04:00
JazzMcNade a08bb419dc Fixed issue in which pokemon would repeatedly exchange for an identical item. Fixed item sensor from repeatedly evaluator the priority of its held item 2025-08-17 17:45:41 -05:00
Tyzillion fa07b93d54 Splitting an atom has never been easier. 2025-08-17 18:39:02 -04:00
Sterrezo 7dc451f344 Ambient sound now stops when broken, volume adjustments 2025-08-17 23:28:53 +02:00
Sterrezo b6ea6a6850 Merge branch 'main' into sound 2025-08-17 22:37:13 +02:00
Kenji_64 9ad9c4643b Some fixes to Porygon's portrait animations acting up. This should hopefully work now 2025-08-17 21:37:33 +02:00
Kenji_64 a7065e5c06 Fixed a tiny oopsie with posers I did 2025-08-17 20:33:15 +02:00
Kenji_64 edf74d9ef4 Implemented attack animations for the Porygon line + made them no longer need air to breathe 2025-08-17 17:02:26 +02:00
Hiroku 768a6df247 Merge branch 'target-selection-fixes' into 'main'
Fix target selection for gimmick moves

See merge request cable-mc/cobblemon!1781
2025-08-17 08:14:39 +00:00
Landon Wills 5c9c8b0b3b Fix target selection for gimmick moves 2025-08-17 03:34:20 -04:00
jackowes 085972f2d3 Add ability to disable sprinting per species for horse and fix unneeded assert in a Jet function. 2025-08-17 01:51:35 -05:00
Landon ddefd1aa24 Merge branch 'booooooo' into 'main'
Fix ghost pokemon that occur due to riding

See merge request cable-mc/cobblemon!1779
2025-08-17 06:04:58 +00:00
JPAKx4 53f441884e Fix ghost pokemon that occur due to riding 2025-08-16 23:47:46 -05:00
Landon 954c5a1027 Merge branch 'riding-transition-changes' into 'main'
Riding transition changes

See merge request cable-mc/cobblemon!1778
2025-08-17 04:35:10 +00:00
Landon Wills c26ab8ff60 Add license 2025-08-17 00:12:39 -04:00
Landon Wills 9ea9f9b307 Fix issue with passenger ejection and survival double jump 2025-08-16 23:29:24 -04:00
Paul fc5ba24e76 removed some debug printlns 2025-08-17 10:07:59 +10:00
Paul c5547c9041 Merge remote-tracking branch 'origin/LionsFoxesAndWolvesOhMy' into LionsFoxesAndWolvesOhMy 2025-08-17 09:32:24 +10:00
Paul 8be9088888 Fixed the basic molang query functions not being registered for run_script task configs 2025-08-17 09:32:13 +10:00
JazzMcNade a0e66c4bf6 Merge branch 'main' into LionsFoxesAndWolvesOhMy 2025-08-16 13:42:43 -05:00
Landon Wills 0fe496a290 Fix up outstanding TODOs 2025-08-16 04:43:06 -04:00
Landon Wills df0eb21a9e Change some of the json files to new system 2025-08-16 04:36:52 -04:00
Landon Wills 79ed7da316 Sync behavours between client and server 2025-08-16 04:15:30 -04:00
Landon Wills 908a8b89a6 Add logic for if pokemon is always hovering 2025-08-16 03:34:35 -04:00
Landon Wills 83d4d6f7e9 Change logic for transitions 2025-08-16 03:20:56 -04:00
JazzMcNade f0fb3fa946 Fix timings for giving up on searching for berry bushes 2025-08-15 22:08:25 -05:00
JazzMcNade da444f401b Banned pokemon from eating potions by default. Fixed a bug in which pokemon would give up going to an item too early. Reduced eating cooldown. 2025-08-15 21:38:56 -05:00
Hiroku a588906f43 Merge branch 'showdown-datapack' into 'main'
Datapackable abilities/moves; refactoring

See merge request cable-mc/cobblemon!1686
2025-08-15 22:10:03 +00:00
Polymeta e890fd3e9e adjust mochi EV increase per previous discussion
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-08-15 21:16:46 +01:00
Test e7c95ac72c Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon 2025-08-15 13:15:08 -04:00
Test 245765c6af fix partial match filtering, +lang support in PC 2025-08-15 13:14:51 -04:00
Paul f8ae4dcecd Removed battler_cooldown stuff since it was not really fully implemented, fixed NPCs getting autoconfigured with pokemon behaviours 2025-08-15 21:12:54 +10:00
Test f694c7c821 Merge branch 'whispering-whismur' into 'main'
Implement a vibration-dampening behaviour for Pokémon living in the Deep Dark

See merge request cable-mc/cobblemon!1745
2025-08-15 03:26:36 +00:00
Test a4824b6766 Merge branch 'riding-fix-reverse-animation-input' into 'main'
amend what has been broken :(

See merge request cable-mc/cobblemon!1775
2025-08-15 03:22:15 +00:00
Test 834533aa6a Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon 2025-08-14 23:04:05 -04:00
Test 0c9cf2c83d update snack POI key 2025-08-14 23:03:33 -04:00
jackowes fbffeff8dc amend what has been broken :( 2025-08-14 21:39:51 -05:00
Paul 8532ca2d38 Added fluid sleeping, fixed non-water sleepers sleeping in water 2025-08-15 11:38:27 +10:00
Paul 722bf5ba7b Added q.delete_variable(struct, name) and q.delete_variables(struct) 2025-08-15 10:07:21 +10:00
Instrafe eb0365d7ce Implemented Escavalier remodel 2025-08-14 16:52:32 -04:00
gruxor ca1cf72d86 semicolon 2025-08-14 08:24:52 -04:00
gruxor e12936fb66 Refactoring; review resolution 2025-08-14 08:24:52 -04:00
gruxor 9b85742c00 Datapackable abilities/moves; refactoring 2025-08-14 08:24:52 -04:00
Kenji_64 97c2b46192 Implemented Togedemaru! 2025-08-14 13:59:40 +02:00
Kenji_64 847e5d7647 Tiny interpolation fix on Ceruledge's battle_cry 2025-08-14 13:28:38 +02:00
Kenji_64 43e05ef7e7 Urgent Dunsparce line poser fixes that caused a crash (so sorry) 2025-08-14 13:28:19 +02:00
Hiroku aceaef14c5 Merge branch 'tag-im-it' into 'main'
Errors Be Gone

See merge request cable-mc/cobblemon!1774
2025-08-14 11:28:17 +00:00
Kenji_64 b14eed17eb G.Corsola walk speed fixes, sound fixes and tiny adjustments to the icons 2025-08-14 13:27:41 +02:00
dhi_holo c168364ca4 Errors Be Gone
Fixed an error I made in a previous branch
Fixed some tag names erroring on NeoForge
Fixed some items not being properly scrubbed from the mod
Fixed some tags not having translations, causing errors in the log
2025-08-14 20:45:45 +10:00
violet 069d9df3be Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-08-14 05:37:47 -04:00
violet 7c40d4298d added meditite and medicham <3 2025-08-14 05:32:56 -04:00
Kenji_64 1a2c5851f4 Fixed the clipping of the ectoplasm overlay for G. Corsola + Cursola 2025-08-14 11:31:58 +02:00
RedGenesectNinja 5bf962897f Implemented animations for Hoppip, Skiploom and Jumpluff 2025-08-14 00:59:04 -05:00
JazzMcNade c1a18e91c3 Allow pokemon to give up on hard to reach items 2025-08-13 22:03:31 -05:00
JazzMcNade 881e57cbd2 Small refactor and comment 2025-08-13 20:34:33 -05:00
Polymeta db6533795b Merge branch 'Adjust-Generation-of-New-Flora-1.7' into 'main'
Adjusted generation chances/rates for all new 1.7 flora

See merge request cable-mc/cobblemon!1773
2025-08-13 22:45:52 +00:00
GenotypeXD-Dev 08c49d36db Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-08-13 17:43:35 -05:00
GenotypeXD-Dev 74cd758a0b Implemented Galarian Mr.Mime 2025-08-13 17:43:02 -05:00
Slippy 596c0cd8c3 Adjusted generation chances/rates for all new 1.7 flora 2025-08-13 15:55:40 -05:00
Kenji_64 9af0879359 Added animations and placeholder riding data for the Dunsparce line 2025-08-13 22:16:53 +02:00
Kenji_64 c42e6bb963 Added animations and sounds to G. Corsola + Cursola 2025-08-13 22:13:44 +02:00
Kenji_64 c12e6fd3ed Implemented Klink line retexture + locators 2025-08-13 22:12:42 +02:00
Kenji_64 78f97984c7 Added implemented: true tag and scales to a whole bunch of Mons 2025-08-13 19:23:20 +02:00
Polymeta b65cec2916 fix codec error
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-08-13 16:39:42 +01:00
Polymeta 63ef406058 Merge branch 'cooking-still-needs-fixes' into 'main'
Even More Cooking Fixes

See merge request cable-mc/cobblemon!1771
2025-08-13 13:42:14 +00:00
GertimoshkaandPolymeta 4856e9feee Even More Cooking Fixes 2025-08-13 13:42:14 +00:00
Polymeta e839813c2a Merge branch 'food-check' into 'main'
Food Balancing Tweaks and Asset Updates

See merge request cable-mc/cobblemon!1772
2025-08-13 11:05:29 +00:00
dhi_holoandPolymeta c70f2a6684 Food Balancing Tweaks and Asset Updates 2025-08-13 11:05:28 +00:00
Paul 860ec50071 Fixed the lerping between poses for pitch tilting 2025-08-13 20:44:54 +10:00
JazzMcNade 984d8c3e9d Restored dropping items with negative priority 2025-08-13 01:25:30 -05:00
Polymeta 93e26fb31f Merge branch 'snack' into 'main'
🍰

See merge request cable-mc/cobblemon!1768
2025-08-13 06:09:45 +00:00
TestandPolymeta 23e2e18019 🍰 2025-08-13 06:09:45 +00:00
Polymeta a0d5a1fbad Merge branch 'flx-the-big-oops' into 'main'
Fix the oopsie

See merge request cable-mc/cobblemon!1770
2025-08-13 06:08:27 +00:00
JPAKx4 b1b5ef7236 Fix the oopsie 2025-08-12 22:30:00 -05:00
RedGenesectNinja ef3623534c Updated changelog 2025-08-12 20:09:21 -05:00
Instrafe e4554faa4f Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-08-12 21:02:58 -04:00
Instrafe 0e32b20bbd Implemented the remodel for Shelmet 2025-08-12 21:01:02 -04:00
Polymeta 6ab2aa3413 fix game crashes if lure enchantment is not present
Closes #1646

Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-08-12 21:51:33 +01:00
Polymeta 16819bb0e7 * Updated Ponigiri Textures
* Updated Sinister Tea Textures, as well as added alternate recipes with altered component outputs (does encounter a slight bug with Minecraft's inherent behaviour, will be fixed naturally when we upgrade versions)
* Cleaned up a lot of recipe files
* Tweaked some food colours
* Made berries smeltable into their various dyes
* Updated the Apricorn crop models and hitboxes
* New Campfire Pot advancement
* Hearty Rice now has variable growth from bone meal
2025-08-12 20:17:45 +00:00
dhi_holoandPolymeta 0bf3488a01 Foods 2025-08-12 20:17:44 +00:00
Polymeta 1f3d3e90cf Merge branch 'even-more-cooking-fixes' into 'main'
Additional Fixes to Cooking Pots

See merge request cable-mc/cobblemon!1763
2025-08-12 20:16:09 +00:00
Konoha b1135e334c Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-08-12 11:23:17 -04:00
Konoha 6cdeea39c3 Implement Chewtle and Drednaw 2025-08-12 11:19:15 -04:00
Polymeta d141e6b46d Merge branch 'riding-controllers-expanded' into 'main'
Controller additions as well as many controller fixes and polish

See merge request cable-mc/cobblemon!1762
2025-08-12 15:13:04 +00:00
jackowes e683dedc2a rename rotateheadFunctions to unbreak 2025-08-12 09:25:16 -05:00
Paul 5150de74c8 Added a preconfigure step and finally fully resolved fox behaviour configuration 2025-08-12 22:38:53 +10:00
jackowes c7d6107cea Merge branch 'main' into riding-controllers-expanded 2025-08-11 22:52:55 -05:00
jackowes ef7e76dc07 move driverInput over to Player and check if input has changed before sending driverInput to the server. 2025-08-11 22:50:53 -05:00
jackowes 5697fa53f0 move driverInput over to ServerPlayer 2025-08-11 21:35:53 -05:00
Polymeta 8cf58d22f9 Merge branch 'main' into implement_pokemon 2025-08-11 22:16:32 +01:00
JPAKx4 50cb670eee Merge remote-tracking branch 'origin/mo-molang-mo-problems' into mo-molang-mo-problems
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/api/molang/MoLangFunctions.kt
2025-08-11 11:33:57 -05:00
JPAK cfd3eb6c4c Add ability to access a global MoLang Store (multiserver for example) 2025-08-11 11:33:27 -05:00
Konoha 6eccc0e3e3 Use those pesky unused Rotom form assets 2025-08-11 10:30:07 -04:00
Gertimoshka 59d3475b31 Recalculate then Seasoning Slots also change 2025-08-11 17:09:58 +03:00
Polymeta 2e87894dac Merge branch 'molang-commands' into 'main'
Add command to run MoLang expressions as well as add `entity` to RunMolangScriptCommand.kt.

See merge request cable-mc/cobblemon!1743
2025-08-11 13:46:05 +00:00
JordanandPolymeta 2dd4373890 Add command to run MoLang expressions as well as add entity to RunMolangScriptCommand.kt. 2025-08-11 13:46:05 +00:00
Konoha efa8f6a81e Conform texture references for Alolan Grimer line 2025-08-11 09:09:45 -04:00
Test e33587fefc pc walls 2025-08-10 23:50:02 -04:00
Polymeta 1089fb2571 various fixes for suspicious stew (specifically pep up flower ingredient too) interactions with mooshtanks
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-08-11 00:57:22 +01:00
Polymeta db777381e7 Merge branch 'josh/locator-flip-fix' into 'main'
Only flip locators Z axis if model is attached to an entity

See merge request cable-mc/cobblemon!1767
2025-08-10 21:48:32 +00:00
Polymeta 8fee43c0b8 Merge branch 'orientable-entities' into 'main'
Orientation now works for Living Entities

See merge request cable-mc/cobblemon!1601
2025-08-10 21:37:48 +00:00
JordanandPolymeta d7160948cd Orientation now works for Living Entities 2025-08-10 21:37:48 +00:00
Polymeta 868b8ae662 Merge branch 'neva-enough-molang' into 'main'
Neva enough molang

See merge request cable-mc/cobblemon!1755
2025-08-10 21:31:29 +00:00
JordanandPolymeta d65884de5b Neva enough molang 2025-08-10 21:31:29 +00:00
Josh 7714d60b2e Only flip locators Z axis if model is attached to an entity 2025-08-10 16:52:08 -04:00
Paul 46b9eccfb1 Migrated last of species-modifying from fox logic and auto-applied pickup tasks where it's needed 2025-08-10 21:34:03 +10:00
Paul 1936c8a0be Migrated the pickup items for foxes and stuff to the config struct 2025-08-10 19:13:35 +10:00
jackowes f4f6cbee38 Address MR comments 2025-08-10 02:02:49 -05:00
Paul 99b99a803c Streamlined item pickup / fox behaviours 2025-08-10 13:12:11 +10:00
Konoha 9081dc3a19 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-08-09 22:49:07 -04:00
Konoha c2b6421ff9 Source data error corrections (G-Weezing is not base stage and should not receive Aromatherapy as an egg move, Silvally is not limited to Grass Pledge outside of a coding error) 2025-08-09 22:48:03 -04:00
Konoha 99af478165 Pumpkaboo Line Portrait/Profile Size Variation 2025-08-09 22:39:10 -04:00
RedGenesectNinja 873028d8e8 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-08-09 21:02:53 -05:00
RedGenesectNinja 2db8728560 Implemented Toedscool and Toedscruel 2025-08-09 21:00:01 -05:00
Tyzillion d0dbbe7850 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-08-09 17:38:25 -04:00
Tyzillion a6280d223a Implemented Alolan Grimer line, Sewaddle line, Tadbulb line, and Capsakid line. 2025-08-09 17:37:52 -04:00
GenotypeXD-Dev 4187b31daf gogoat poser fix+changelog 2025-08-09 14:05:30 -05:00
GenotypeXD-Dev ea33d86dbd Implemented Tynamo line and Skorupi Line 2025-08-09 13:45:05 -05:00
Tyzillion 8dc5c19210 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2025-08-09 14:15:11 -04:00
Paul d37a928630 Merge remote-tracking branch 'origin/main' into LionsFoxesAndWolvesOhMy 2025-08-09 16:13:32 +10:00
GenotypeXD-Dev 3499111c92 Changelog 2025-08-09 00:35:41 -05:00
GenotypeXD-Dev 28cd404bef Implemented Espurr line and Morpeko, Poser fixes for hisuian braviary and galarian weezing 2025-08-09 00:34:41 -05:00
Hiroku 09883fd239 Merge branch 'pitch-tilting' into 'main'
Added pitch tilting animation for fishies and birds, implemented for magikarp and pidgey

See merge request cable-mc/cobblemon!1766
2025-08-09 05:25:38 +00:00
Paul d2e6be2c5f Merge remote-tracking branch 'origin/main' into LionsFoxesAndWolvesOhMy 2025-08-09 15:16:47 +10:00
Paul 50cea69dfb Added delta_movement query function to entities 2025-08-09 15:12:08 +10:00
Paul 583892364d Added pitch tilting animation for fishies and birds, implemented for magikarp and pidgey 2025-08-09 13:02:34 +10:00
GenotypeXD-Dev 407c4baff2 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-08-08 21:20:12 -05:00
GenotypeXD-Dev d0653c5b13 Implemented Weezing-Galar, Braviary-Hisui, Mr. Rime. Added the implemented tag to some of the elemental monkeys, skiddo line, and munna line. Fixed Toxtricity Battle Pose, Fixed Skiddo Line posers 2025-08-08 21:19:29 -05:00
Paul 325d1af484 Fixed swim wanders not working 2025-08-09 10:44:55 +10:00
Polymeta 6ae71f28e6 Merge branch 'spicy-molang' into 'main'
Added string utility related MoLang functions

See merge request cable-mc/cobblemon!1754
2025-08-08 23:29:38 +00:00
SpicyandPolymeta 5687a71de4 Added string utility related MoLang functions 2025-08-08 23:29:38 +00:00
jackowes 1664b917f8 Dolphin time 2025-08-08 16:48:07 -05:00
Polymeta 8199f8d7c2 Merge branch 'josh/helditem-render-fix' into 'main'
Fixed locators being flipped for shoulder mounts and model widgets

See merge request cable-mc/cobblemon!1764
2025-08-08 21:41:09 +00:00
Polymeta 6b39251d65 Merge branch 'Shipwreck-Loot-Table-Adjustments' into 'main'
Shipwreck loot table adjustments

See merge request cable-mc/cobblemon!1765
2025-08-08 21:40:50 +00:00
Charzard4261 3faa5913ad [TEMP] Test sensitivity and axis swapping on BirdBehaviour 2025-08-08 17:48:45 +01:00
Charzard4261 56927a7af5 Add config properties 2025-08-08 17:48:00 +01:00
Slippy cd03e6f8c4 Replaced the Phantoms with Breezes in the Lush Shipwreck Cove 2025-08-08 00:48:19 -05:00
Slippy a1b53f90ad Adjusting the loot table to trial spawners in shipwreck coves a little bit. 2025-08-08 00:40:54 -05:00
Test 55587908a2 update state icons/ride controls overlay 2025-08-07 22:05:09 -04:00
JazzMcNade a1aff7b457 Merge branch 'main' into LionsFoxesAndWolvesOhMy 2025-08-07 20:28:40 -05:00
jackowes e1ed483d67 Remove altitude limits on rides 2025-08-07 11:49:59 -05:00
jackowes c460bac177 Accessibility rides for jet and bird. Need hooked up to cobble settings/config and auto changed out if accessibility rides are enabled. Further refinement needed but waiting for the rolling counterparts to be polished first. 2025-08-06 20:29:08 -05:00
jackowes ad6771f8f4 minekart improvements 2025-08-05 21:34:52 -05:00
jackowes ad1a68cefe Add base of minekart behaviour and fix player head movement flag for a few rides 2025-08-05 16:19:18 -05:00
Josh c0677c6353 Fixed item rendering being flipped for shoulder mounts and model widgets 2025-08-05 13:11:14 -04:00
jackowes e8ab8fda71 Fix sound attenuation, inverse input_right() animation data, and properly destroy sounds after dismounting a pokmeon. 2025-08-05 10:09:00 -05:00
JazzMcNade a1d3e4577f Allow pokemon to give up on seeking an unreachable berry bush 2025-08-05 00:57:45 -05:00
jackowes 7def27e437 dupe function from merge 2025-08-04 20:37:24 -05:00
jackowes f3db0ed61d hover anim tests 2025-08-04 20:29:10 -05:00
jackowes fdcff83a2d Merge branch 'main' into riding-controllers-expanded
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/api/riding/behaviour/types/land/VehicleBehaviour.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/riding/behaviour/types/liquid/BoatBehaviour.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonEntity.kt
#	common/src/main/resources/assets/cobblemon/sounds.json
#	common/src/main/resources/data/cobblemon/species/generation1/charizard.json
2025-08-04 20:11:56 -05:00
jackowes 8815758bc0 Adjust all ride params after double tick error. Mirror deltamovement scale to ridevel to fix the catching on terrain issue. Scale smoothly between sprinting turn rate and walking turn rate on horse. 2025-08-04 20:00:34 -05:00
RedGenesectNinja 12212605cd Implemented Hoppip, Skiploom and Jumpluff 2025-08-04 19:01:29 -05:00
Gertimoshka ea49ea7818 Made Cooking pot drop/put crafting remainder items from pots facing direction, as well as unhardcoded the remainder item calculation 2025-08-04 21:18:54 +03:00
Paul 756989b0c0 Fixed storages not saving (OOPS) 2025-08-04 21:26:01 +10:00
Paul 58a4267f42 Added a living entity look_at_position function so we can make funny battle effects 2025-08-04 21:25:54 +10:00
Hiroku e8826a3d0e Merge branch 'trigger-behaviour' into 'main'
EntityCallbacks

See merge request cable-mc/cobblemon!1757
2025-08-04 07:58:43 +00:00
Veraxiel 0606d57ef1 Edit README.md 2025-08-04 03:50:21 -04:00
Veraxiel ef2578c1a7 Fixed typo on tag readme 2025-08-04 03:49:26 -04:00
Veraxiel 3812de7558 Edit README.md 2025-08-04 03:46:47 -04:00
Hiroku ef558981c2 Add readme 2025-08-04 06:18:14 +00:00
Paul e4f928bce1 Revert "Removed #c:is_cold from #cobblemon:is_cold to prevent pokes in the end that should not be in the end"
This reverts commit 6090fce254.
2025-08-04 15:55:43 +10:00
Paul 6090fce254 Removed #c:is_cold from #cobblemon:is_cold to prevent pokes in the end that should not be in the end 2025-08-04 14:29:20 +10:00
JazzMcNade 82963f273a Refactored PokemonItemSensor 2025-08-03 21:27:13 -05:00
JazzMcNade 88c5c1e224 Removed non null assertions 2025-08-03 20:32:23 -05:00
Hiroku 5a5d43404f Merge branch 'safer-change-detection' into 'main'
Removed observable use from Pokemon to better secure saving from rollback issues

See merge request cable-mc/cobblemon!1759
2025-08-04 00:52:56 +00:00
JazzMcNade d8b661ed0b more licenses 2025-08-03 19:18:00 -05:00
Paul 931c3a7e6c Removed observable use from Pokemon to better secure saving from rollback issues 2025-08-04 10:09:16 +10:00
JazzMcNade 03c1d560bc Clean up and licenses 2025-08-03 16:48:35 -05:00
JazzMcNade 02c347d22f Pokemon that pick up an item in the world are now persistent 2025-08-03 01:58:03 -05:00
Paul d5a6e0dffd Ohhh, THAT's why it was written that way 2025-08-03 15:40:56 +10:00
JazzMcNade d296194cc7 Merge branch 'main' into LionsFoxesAndWolvesOhMy 2025-08-02 17:30:22 -05:00
JazzMcNade 57daf3e860 Pickup items can now be specified with molang, lifted fox pickup list to pokemon_fox.json 2025-08-02 17:29:59 -05:00
Polymeta f56c357e4e Merge branch 'retype' into 'main'
Small Asset Updates

See merge request cable-mc/cobblemon!1758
2025-08-02 21:16:38 +00:00
dhi_holoandPolymeta 4bfca0da43 Small Asset Updates 2025-08-02 21:16:38 +00:00
jackowes 1aaea961fb Fix cursed golurk jsons 2025-08-02 02:59:52 -05:00
jackowes 8253b96a67 Add multiplayer support for driver input tracking 2025-08-02 01:42:15 -05:00
Paul 52cff2e99d prepare_{id}, damage_{id} hooks for action effects, q.has_argument for battle messages, added q.hit_count to move action effects 2025-08-02 13:11:20 +10:00
Gertimoshka 725b8bc614 Made client not calculate preview item every render, and instead on crafting slot changes 2025-08-01 20:58:12 +03:00
Paul 52f21ffc82 License and registration please 2025-08-01 20:38:14 +10:00
Paul 9c31899f3c Fixed up some missing lang for behaviours 2025-08-01 20:32:17 +10:00
Polymeta 9a5172f1cc fix encoding issue with boat ride style
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-08-01 10:48:23 +01:00
Polymeta 11051f2b54 Merge branch 'riding-looping-sound' into 'main'
Ride specific sound implementation

See merge request cable-mc/cobblemon!1641
2025-08-01 08:12:32 +00:00
Jackson BowesandPolymeta 8b48cfaa50 Ride specific sound implementation 2025-08-01 08:12:32 +00:00
jackowes 6593fcc250 fix jittery mons 2025-08-01 00:59:09 -05:00
jackowes f51376f9c3 quick fixes 2025-07-31 21:58:23 -05:00
jackowes 23ecc3dd05 Merge branch 'main' into riding-controllers-expanded
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/api/riding/behaviour/RidingBehaviour.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/riding/behaviour/RidingController.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/riding/behaviour/types/GenericSwimBehaviour.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/riding/behaviour/types/air/BirdBehaviour.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/riding/behaviour/types/air/GliderBehaviour.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/riding/behaviour/types/air/JetBehaviour.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/riding/behaviour/types/land/HorseBehaviour.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/riding/behaviour/types/land/VehicleBehaviour.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/riding/behaviour/types/liquid/BurstBehaviour.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonEntity.kt
#	common/src/main/resources/assets/cobblemon/bedrock/pokemon/animations/0967_cyclizar/cyclizar.animation.json
#	common/src/main/resources/assets/cobblemon/bedrock/pokemon/models/0967_cyclizar/cyclizar.geo.json
#	common/src/main/resources/assets/cobblemon/bedrock/pokemon/posers/0967_cyclizar/cyclizar.json
#	common/src/main/resources/data/cobblemon/species/generation1/charizard.json
#	common/src/main/resources/data/cobblemon/species/generation9/cyclizar.json
2025-07-31 21:25:01 -05:00
jackowes 9e6f27162e quick tweak 2025-07-31 21:13:06 -05:00
jackowes 6c279e0986 vehicle tweaks 2025-07-31 21:13:06 -05:00
jackowes 76d1291180 vehicle v3 becoming 2025-07-31 21:13:06 -05:00
jackowes 627f09010b Start of vehicle v3 2025-07-31 21:13:03 -05:00
jackowes 9afd0e6fc3 nope 2025-07-31 21:11:28 -05:00
jackowes 1ea361cce9 I cannot for fine the culprit of this increase in vertical impulse when moving as opposed to standing still. :(. Also rocket improvements. 2025-07-31 21:11:28 -05:00
jackowes 41bf22c43a More rocket improvements
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/api/riding/behaviour/types/GenericSwimBehaviour.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/riding/behaviour/types/RocketBehaviour.kt
2025-07-31 21:11:24 -05:00
jackowes 71989292d3 Various rocket improvements including: lower boost turning speed, turn momentum, behaviour switch time decrease, temp golurk flight animation tweaks for fluidity (need to check with gingle), also tweaked the feel and air resistance of the ride as a whole 2025-07-31 21:10:35 -05:00
jackowes f46b13da6a Quick fix to velocity zeroing for dimensions that horse and rocket don't care about. 2025-07-31 21:10:35 -05:00
Gertimoshka 875cd2c1b9 Remove Depriciated CookingPotPreviewSlot class 2025-07-31 22:26:18 +03:00
Gertimoshka db972aba4a Fixed Preview Slot being dropped on breaking and showing by removing the fake slot and remaking how fake item render works 2025-07-31 21:36:24 +03:00
Kenji_64 dfc130cf55 Killed the oceans - added G. Corsola and Cursola 2025-07-31 15:13:26 +02:00
Kenji_64 7a7eed9c45 Implemented remodels for Mudkip, Marshtomp and Swampert 2025-07-31 15:12:35 +02:00
Tyzillion 37c4d4c7fe Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2025-07-29 15:07:22 -04:00
Tyzillion 2b5cac4361 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-07-29 15:07:03 -04:00
Polymeta 50c3ffc774 Merge branch 'bugfix-entity-health' into 'main'
Couple Pokémon HP / Entity health in a more sensible way.

See merge request cable-mc/cobblemon!1750
2025-07-28 08:58:23 +00:00
Polymeta daf32a5cf3 Merge branch 'food-tweaks' into 'main'
Eat your, well, lots of things

Closes #1616

See merge request cable-mc/cobblemon!1756
2025-07-28 08:56:41 +00:00
dhi_holoandPolymeta af4d2077ae Eat your, well, lots of things 2025-07-28 08:56:41 +00:00
JazzMcNade 7232b2cd26 Moved some fox configuration into pokemon_fox.json 2025-07-28 01:37:58 -05:00
GenotypeXD-Dev c19a94a2d3 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-07-27 21:17:33 -05:00
GenotypeXD-Dev fbe6328f97 Implemented Skiddo and gogoat 2025-07-27 21:13:43 -05:00
Paul 3f090ce691 Merge remote-tracking branch 'origin/main' into trigger-behaviour 2025-07-28 11:34:37 +10:00
Polymeta b1a3cbf29d Merge branch 'cleanup-crew' into 'main'
Small Fixes

Closes #1640 and #1199

See merge request cable-mc/cobblemon!1753
2025-07-27 21:08:36 +00:00
dhi_holoandPolymeta 130c50a2d6 Small Fixes 2025-07-27 21:08:35 +00:00
JazzMcNade bb926e2dc8 Refactoring item detection into a sensor, more refactoring 2025-07-27 15:05:00 -05:00
GenotypeXD-Dev d205650373 deleted accidentally duplicated files, added skwovet resolver 2025-07-27 14:36:30 -05:00
GenotypeXD-Dev eb4fa676ca Added Elektrike, Manectric, Yungoos, Gumshoos, Skwovet, Greedent, Toxel, Toxtricity Amped/Lowkey 2025-07-27 14:36:29 -05:00
GenotypeXD-Dev 2ec6ba382c deleted accidentally duplicated files, added skwovet resolver 2025-07-27 14:27:22 -05:00
GenotypeXD-Dev 65203b6d57 Added Elektrike, Manectric, Yungoos, Gumshoo, Skwovet, Greedent, Toxel, Toxtricity Amped/Lowkey 2025-07-27 14:22:39 -05:00
JazzMcNade e39564667e Merge branch 'main' into LionsFoxesAndWolvesOhMy 2025-07-27 11:36:51 -05:00
Hiroku 0b65259ee7 Merge branch 'let-me-break-it-down-for-you-mark-we-can-bee-bees' into 'main'
Species JSON dictates if something acts like a bee (pollinates flowers and delivers to hive/nest)

See merge request cable-mc/cobblemon!1709
2025-07-27 12:16:12 +00:00
Paul 53897a2613 Removed debug code 2025-07-27 22:04:17 +10:00
Paul 8e6681b3aa Introduced EntityCallbacks 2025-07-27 22:02:30 +10:00
JazzMcNade d5bfaf2331 Changed underlying datastructure to preserve key order when iterating. 2025-07-26 20:47:23 -05:00
JazzMcNade a1790120a1 Added option to filter items via molang 2025-07-26 20:31:51 -05:00
JazzMcNade 0a4b6e08b5 Merge branch 'main' into LionsFoxesAndWolvesOhMy 2025-07-26 15:23:51 -05:00
JazzMcNade 9152ded2cb refactor immuneToSweetBerryBushBlock to BlockInteract, added canStandOnPowderSnow option 2025-07-26 15:20:26 -05:00
JazzMcNade 714666df1c Added configuration support for Pokemon to pickup and consume items 2025-07-26 14:27:44 -05:00
Paul 50427965ab Merge remote-tracking branch 'origin/main' into trigger-behaviour 2025-07-26 21:41:09 +10:00
Hiroku 3318ee801a Merge branch 'extra_flows' into 'main'
Many more Pokemon function refinements and Molang Flows

See merge request cable-mc/cobblemon!1710
2025-07-26 11:04:31 +00:00
Hiroku 0b97d139af Edit CobblemonFlows.kt 2025-07-26 10:51:35 +00:00
Paul 3966607373 Tidy up the script actions for adding/removing a Behaviour on an entity 2025-07-26 18:34:40 +10:00
JazzMcNade 1f60d8f413 Merge branch 'main' into LionsFoxesAndWolvesOhMy 2025-07-26 03:20:18 -05:00
Paul b7c5f489fd More cleanup 2025-07-26 14:31:57 +10:00
Paul 39ec6187b5 Various cleanup items and important fixes for wandering caused by bee stuff 2025-07-26 14:29:05 +10:00
Paul b7681b43f9 Merge remote-tracking branch 'origin/main' into let-me-break-it-down-for-you-mark-we-can-bee-bees 2025-07-26 13:26:19 +10:00
Konoha ae594a0790 Merge branch 'main' into extra_flows
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/api/molang/MoLangFunctions.kt
2025-07-24 08:04:14 -04:00
Konoha 6af299406d Merge remote-tracking branch 'origin/main' 2025-07-24 07:57:51 -04:00
Nadja Reitzenstein 29833df50e Couple Pokémon HP / Entity health in a more sensible way.
Specifically, don't touch Battle HP for wild Pokémon so that you can't hurt a Pokémon down out of battle for an easier catch, and always round entity health up so that only a HP of 0 is a health of 0
2025-07-24 13:09:33 +02:00
Paul 01d42abdb2 look_at_target requires nearest living entities memory and sensor 2025-07-23 23:16:32 +10:00
Paul baa3f47769 Removed unused memory 2025-07-23 19:11:19 +10:00
Paul 16e716411a Merge remote-tracking branch 'origin/main' into let-me-break-it-down-for-you-mark-we-can-bee-bees
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/npc/NPCBrain.kt
2025-07-23 18:58:19 +10:00
Paul 3bbc551fd7 Wander controls supporting keeping wanderers around a point, bees stay around their hive 2025-07-23 18:55:52 +10:00
Polymeta 74381d8e3c move mixin away from ModifyConstant to improve compatibility with other mods
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-07-22 23:48:21 +01:00
Polymeta 6688c32a1d Merge branch 'smashling' into 'main'
Create saccharine_sapling.json

See merge request cable-mc/cobblemon!1749
2025-07-22 21:39:24 +00:00
dhi_holo 45dcf6f23b Create saccharine_sapling.json 2025-07-22 17:02:54 +10:00
JazzMcNade 7366e82bd1 Added the ability for pokemon to remember if they've been given an item by a player. 2025-07-21 00:27:49 -05:00
Polymeta e4d92ead6a Merge branch 'log-spawn' into 'main'
Update saccharine log spawning

See merge request cable-mc/cobblemon!1742
2025-07-19 20:11:01 +00:00
TestandPolymeta 9631f3c9d5 Update saccharine log spawning 2025-07-19 20:11:01 +00:00
Polymeta 0787f2772d Merge branch '1.7-Tree-and-Crop-Generation' into 'main'
SaccharineTreeFeature to consider #cobblemon:has_feature/saccharine_tree

See merge request cable-mc/cobblemon!1748
2025-07-19 19:24:00 +00:00
Polymeta 4011502e54 changelog and license
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-07-19 08:35:51 +01:00
Polymeta 06855f6404 adding placed features for grains and galarica nuts
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-07-19 08:17:37 +01:00
Slippy 815955b904 Hearty Grains, Galarica Nut Bushes, and Saccharine Trees now generate with appropriate rates and locations. Just need Poly to do the mixin work 2025-07-19 01:50:24 -05:00
Polymeta df9eed0da3 Merge branch '1,21-Gigawatts' into 'main'
Lightning Interactions with Pokemon

See merge request cable-mc/cobblemon!1733
2025-07-19 06:08:35 +00:00
JazzMcNadeandPolymeta 99b73aa8dd Lightning Interactions with Pokemon 2025-07-19 06:08:34 +00:00
Polymeta f2d5073c7c enforce fabric versions to match what cobblemon is built against for consistency
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-07-19 00:02:49 +01:00
Paul 3fda5f7c7a give all NPCs the dialogues and battling memories 2025-07-18 18:18:44 +10:00
Hiroku 1e573f80bb Merge branch 'cvnty_gyarados' into 'implement_pokemon'
Fixed issue with gyarados_female.geo.json where it was a duplicate of gyarados_male.geo.json, now allowing for correct Implementation of Female Gyarados!

See merge request cable-mc/cobblemon!1747
2025-07-18 06:30:46 +00:00
Hiroku 9b81666437 Merge branch 'pokedex-percentage-command' into 'main'
Fix Pokedex Percentage Command

Closes #1525

See merge request cable-mc/cobblemon!1692
2025-07-18 04:58:34 +00:00
CeejayandHiroku b43f969c02 Fix Pokedex Percentage Command 2025-07-18 04:58:34 +00:00
SamIr0n 819630a8db Gyarados can be female again 👀 2025-07-17 23:19:18 +01:00
Polymeta 02c4947513 fixed some typos in pokemon interactions
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-07-17 23:10:07 +01:00
Nadja Reitzenstein 714412246b Implement a vibration-dampening behaviour for Pokémon living in the Deep Dark 2025-07-17 20:01:27 +02:00
Slippy 6158b36103 Saccharine trees are now rarer and generate in the correct biomes 2025-07-16 12:18:39 -05:00
Polymeta 2e14f8f8e8 hearty grains will generate with both blocks when of the right age
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-07-16 10:22:48 +01:00
Polymeta bc80d6a171 SaccharineTreeFeature to consider #cobblemon:has_feature/saccharine_tree
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-07-16 08:30:32 +01:00
Konoha 65a7fc6fd7 Implement includeLegacy parameters 2025-07-15 22:11:47 -04:00
Konoha ce019631ce Merge branch 'main' into extra_flows 2025-07-15 21:58:19 -04:00
Konoha 0534e0d201 Merge remote-tracking branch 'origin/main' 2025-07-15 21:51:31 -04:00
Konoha 895e3ca378 Update Benched Moves after teachLearnableMoves call 2025-07-15 21:51:14 -04:00
JPAK 38cfd7eca8 Add ability to access a global MoLang Store (multiserver for example) 2025-07-15 15:03:04 -05:00
Test 3048e3d81d fix data for variations and species features 2025-07-15 02:14:53 -04:00
JazzMcNade d0293ad177 Fox sweet/glow berry harvesting and eating 2025-07-14 21:23:00 -05:00
Polymeta 77fb94d9ef Merge branch 'fix-x-axis-offsets' into 'main'
Fix X-axis being a different direction than Blockbench and addded new property attachment_options

See merge request cable-mc/cobblemon!1730
2025-07-13 23:25:25 +00:00
JordanandPolymeta 9078ee2191 Fix X-axis being a different direction than Blockbench and addded new property attachment_options 2025-07-13 23:25:24 +00:00
Polymeta 06edc2810e Merge branch 'cooking-fixes-gert' into 'main'
Plefora of Cooking related fixes/implementations

See merge request cable-mc/cobblemon!1739
2025-07-13 22:56:49 +00:00
GertimoshkaandPolymeta 81b83aabc1 Plefora of Cooking related fixes/implementations 2025-07-13 22:56:49 +00:00
JPAK 2ba2eea801 Add functions to remove entity and spawn NPCs for Molangs 2025-07-13 13:16:44 -05:00
Polymeta 6e7895c3b3 Merge branch 'PhantomsFearTheFurySwipes' into 'main'
Implement avoidedByPhantom behavior

See merge request cable-mc/cobblemon!1737
2025-07-12 20:26:33 +00:00
JazzMcNade c69de804b9 Merge branch 'main' into PhantomsFearTheFurySwipes 2025-07-12 11:15:39 -05:00
JazzMcNade fbbed7b20a More license 2025-07-12 11:15:27 -05:00
Polymeta a1b5f0a567 Merge branch 'i-cant-take-it-anymore' into 'main'
Block Texture Clean Up

See merge request cable-mc/cobblemon!1738
2025-07-12 12:07:01 +00:00
Polymeta e42e06781d Merge branch 'flora-heals-an-aching-soul' into 'main'
Design Meeting Changes - Recipe/Loot Table Tweaks

See merge request cable-mc/cobblemon!1740
2025-07-12 12:03:35 +00:00
Konoha 6a7b71d5a7 Cleanup 2025-07-11 22:30:30 -04:00
dhi_holo 0a48014931 Design Meeting Changes
- Healing Machine recipe rebalanced
- Vivichoke Crops now drop one seed at full grown stage as well as the crop
- Vivichoke now can only be crafted into one seed, rather than two, to compensate for the above
2025-07-12 11:23:21 +10:00
Polymeta a70fed25c5 Merge branch 'feature/type-madness' into 'main'
make elementaltypes showdown identifiable for consistency

See merge request cable-mc/cobblemon!1688
2025-07-11 21:01:59 +00:00
Polymeta c2daed803f make elementaltypes showdown identifiable for consistency 2025-07-11 21:01:58 +00:00
dhi_holo 658fed638d Update saccharine_log_slathered.json
Should remove errors from that blockstate too
2025-07-11 19:39:10 +10:00
dhi_holo 3faa2a0467 Saccharine and Candles
Fixed all Saccharine wood recipes missing advancements, and the log spamming Candle Poké Cake Blockstate being missin
2025-07-11 19:05:32 +10:00
dhi_holo 77788a91b7 Merge branch 'main' into i-cant-take-it-anymore 2025-07-11 19:01:21 +10:00
dhi_holo 745b48e77b Update CHANGELOG.md
Changelog.
2025-07-09 15:06:40 +10:00
dhi_holo 9a4815f453 Block Texture Clean Up
Re-organised all the Block textures to match how the Item textures are sorted

Also did a very minor clean up of the item texture folder to just keep it clean.
2025-07-09 15:06:09 +10:00
JazzMcNade 2ff41cdf9b Updated Cresselia to scare off phantoms 2025-07-08 23:35:08 -05:00
JazzMcNade d5268e8751 Added TODO for should mount cries 2025-07-08 21:40:46 -05:00
JazzMcNade 518799ee25 Updated Changelog 2025-07-08 21:38:07 -05:00
JazzMcNade b597bb0818 Clean up multiple entity searches. 2025-07-08 21:31:42 -05:00
JazzMcNade 1b39a64927 Added check for shoulder mounted phantom feared pokemon 2025-07-08 21:01:45 -05:00
Sterrezo db37721e9f Merge branch 'main' into sound 2025-07-08 17:18:03 +02:00
Sterrezo c373d24fe1 Campfire Pot now plays the break sound when the campfire is broken 2025-07-08 17:17:50 +02:00
Sterrezo 2770cbbe35 Added Campfire Pot sounds 2025-07-08 17:09:26 +02:00
JazzMcNade dda128e9e3 implemented mixin for avoidedByPhantom behavior flag 2025-07-08 02:42:24 -05:00
Sterrezo 699a47c633 Updated Hearty Grains sounds and added Hearty Grain Bale sounds 2025-07-06 17:51:45 +02:00
Sterrezo 47ebc6c6ca Merge branch 'main' into sound 2025-07-06 17:37:57 +02:00
Tyzillion 5a7da67d67 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2025-07-05 21:26:47 -04:00
Tyzillion 60feb21e49 Removed Drowzee line hard coded posers. 2025-07-05 19:03:10 -04:00
Tyzillion 00d7db6f48 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-07-05 19:02:12 -04:00
Sterrezo bdb47532b9 let's not import everything there is 2025-07-05 18:50:31 +02:00
Sterrezo b5a40adcdf Merge branch 'main' into sound 2025-07-05 18:12:18 +02:00
Sterrezo 955422aab7 Updated Hearty Grains sounds and added water variation 2025-07-05 17:55:30 +02:00
Paul 599603501a Combee should fly instead of walk, and not fly crazy fast 2025-07-05 22:42:30 +10:00
Paul 891ed6045d This is good news 2025-07-05 22:30:07 +10:00
Paul a15aa86c66 Merge remote-tracking branch 'origin/we-must-defend-our-way-of-life' into let-me-break-it-down-for-you-mark-we-can-bee-bees
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/api/ai/config/task/TaskConfig.kt
2025-07-05 10:14:41 +10:00
JazzMcNade 4890e857f4 Added new mixin behaviors with vanilla mobs, added a flag for fox pokemon to avoid sweet berry bush damage. 2025-07-03 02:14:56 -05:00
Tyzillion d112475c97 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2025-07-02 15:54:57 -04:00
Tyzillion b652235791 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2025-07-02 15:54:16 -04:00
Sterrezo cfa55095aa Added sounds for Hearty Grains, updated Tatami sounds 2025-06-30 19:41:26 +02:00
Konoha 1984990a7e Array Utilities 2025-06-29 08:42:28 -04:00
Konoha 49e2e635db Ability Pokemon Function 2025-06-28 19:09:37 -04:00
Konoha d795dca4fa Inventory player function 2025-06-27 16:02:18 -04:00
Konoha 503511e0ae teach_move, can_learn_move, set_iv, set_ev` Pokemon functions 2025-06-27 14:39:04 -04:00
Konoha a7f8a281a8 Minor comment fix 2025-06-25 19:53:54 -04:00
Konoha 5ba6679a84 Changelog 2025-06-25 19:49:17 -04:00
Konoha 4ecd64bdf6 Set Level and clone party for NPC / MoLang battles 2025-06-25 19:46:51 -04:00
Konoha 6863cd0602 Battle Format Parameters 2025-06-24 22:03:49 -04:00
Tyzillion cb86c8d4dd Implemented Drowzee Line Remodels. 2025-06-23 17:55:46 -04:00
Sterrezo bcac005fb1 Merge branch 'main' into sound 2025-06-23 14:03:31 +02:00
Sterrezo aa6536b57c Added sounds for Tatami blocks and mats 2025-06-23 12:22:06 +02:00
Konoha b9e6d63049 Extra Battle Format MoLang parameters 2025-06-22 21:52:34 -04:00
Konoha cb002ff530 Battle Format and Rule Selection via MoLang Test 2025-06-22 13:34:50 -04:00
Konoha 19da349e78 Merge AI Shenanigans 2025-06-22 11:25:28 -04:00
Konoha 30c3b605a3 Merge branch 'refs/heads/feature/ai-shenanigans' into extra_flows
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/npc/NPCServerDelegate.kt
2025-06-22 11:23:06 -04:00
Konoha b8e79d2d3e Attempt to not publish HELD_ITEM_PRE on the client (spoilers, it doesn't work :[ ) 2025-06-21 22:27:02 -04:00
Konoha 60c2721b53 Cleanup LootDroppedEvent Flow 2025-06-21 20:50:46 -04:00
Konoha b6f2ab25e1 Fix berry in BerryHarvestEvent 2025-06-21 20:49:07 -04:00
Konoha 6417f8cfa8 Cleanup 2025-06-21 20:45:18 -04:00
Konoha 1d473437de MoLang moveset queries
Viewable Hyper Trained IVs in PC
2025-06-21 20:19:41 -04:00
Konoha c24b60785f Player battle function and battle format setting parameters. 2025-06-21 14:17:31 -04:00
Konoha 08df2fef6c Molang setter functions for Party & PC 2025-06-21 12:13:07 -04:00
plastered_crab bae3da9411 Merge branch 'refs/heads/main' into let-me-break-it-down-for-you-mark-we-can-bee-bees
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonMemories.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/ai/config/task/TaskConfig.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/pokemon/ai/PokemonBrain.kt
2025-06-20 06:07:01 -07:00
Konoha db7745589a Cleanup 2025-06-19 21:27:55 -04:00
Konoha 65f0f69726 Teach All Learnable Moves MoLang Function 2025-06-19 21:25:26 -04:00
Konoha 19263ddec6 Minor fix 2025-06-19 17:29:40 -04:00
Konoha dde4680ce0 Refactor Client Context on HeldItemEvent 2025-06-19 16:13:36 -04:00
Konoha a2939e34a0 Cosmetic Item Property, MoLang functions for fullness, unlearning moves. 2025-06-19 14:25:20 -04:00
plastered_crab 6a937492dd Licenses 2025-06-19 07:37:53 -07:00
Konoha d13e456d17 Minor Optimization ft. landon 2025-06-17 22:08:29 -04:00
Konoha e36de84927 1.7: The Flowing Mapmaker's Update (Friendship, Fullness, AspectChanged, CatchRate, PokeRod, ShoulderMount event flows) 2025-06-17 22:05:44 -04:00
Konoha 54cbaa9a10 Flows for PokemonHealed, PokemonSent, and ChangePCBoxWallpaper. 2025-06-17 12:43:24 -04:00
Konoha dbe743b50a Do not publish HelpItemEvent if it's running on client. 2025-06-17 08:47:38 -04:00
Konoha 7d26870a13 Pokemon Scanned, Loot Dropped, Berry Harvest Flows 2025-06-16 14:50:53 -04:00
Konoha a418cbd118 Pokemon Seen Flow 2025-06-16 12:03:00 -04:00
Konoha e45af26af3 Split Cosmetic Item Event from HeldItemEvent. 2025-06-16 10:08:52 -04:00
Konoha bdc260abca Aspects MoLang function for Pokemon 2025-06-15 21:54:39 -04:00
Konoha d9e5e52d9f Flows for ExperienceGainedEvent, CollectEggEvent, HatchEggEvent. MoLang functions to add exp, initialize a Pokemon's moveset, and validate an existing moveset. 2025-06-15 21:31:10 -04:00
Polymeta c12f991b18 testing round no1
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-06-13 01:20:15 +01:00
Polymeta 977d66dafd fixing some errors
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-06-13 01:05:55 +01:00
Polymeta f0b1843b71 StrongBattleAI without build errors
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-06-13 01:05:54 +01:00
Polymeta 785e63c7d4 rafactoring of the ActiveTracker to be on a "seen" basis with opposing pokemon
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-06-13 01:05:54 +01:00
Polymeta 61c3c995aa tidying up
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-06-13 01:05:43 +01:00
plastered_crab 5dc56bd4fc Merge branch 'refs/heads/main' into let-me-break-it-down-for-you-mark-we-can-bee-bees
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/api/ai/config/task/TaskConfig.kt
2025-06-10 18:11:57 -07:00
plastered_crab f9afd1d3e6 My kid pooped his pants and fell back asleep so let's code real fast 2025-06-10 02:46:26 -07:00
plastered_crab ad3cfe3708 You'll be a pet 2025-06-01 14:14:31 -07:00
plastered_crab 109895c0ff Mark this is good news 2025-05-31 17:13:36 -07:00
plastered_crab 96bcffcc84 We can finally be bees Mark 2025-05-31 14:29:35 -07:00
plastered_crab dc4f204db6 This is not our home 2025-05-31 01:11:50 -07:00
plastered_crab c07c78c331 You'll live for 30 years 2025-05-31 00:39:00 -07:00
Plastered_Crab e902e034ad This is good news 2025-05-30 14:19:31 -07:00
Plastered_Crab 77218f5250 Mark, we can BEE bees 2025-05-30 13:23:16 -07:00
JacksonB ab1f169fcc add forgotten rocket loop 2025-05-20 22:35:59 -05:00
JacksonB ce5928e783 Add rocket sounds 2025-05-20 22:35:15 -05:00
JacksonB e3e40627e8 Beginnings of rocket controller (for real this time) 2025-05-16 21:41:20 -05:00
Paul be5ee8a6a3 Potentially got root bone animation working for players on pokes 2025-05-16 22:22:05 +10:00
JacksonB 140158f5bb Default riding sounds to only be heard by passengers and default sounds to not muffle or reduce in volume when behind a block. Also move the attenuation logic out of RideLoopSound and have openAL handle all attenuation models. 2025-05-11 19:33:00 -05:00
amo 44c27be590 oops 2025-05-08 17:53:42 +01:00
amo a704972dea oops 2025-05-06 04:33:11 +01:00
amo 0b43342a5c fix battle music attempting to use registered sound events instead of just creating and using one from the id (allows resourcepackable etc) 2025-05-06 04:32:59 +01:00
Segfault Guy 58a5412602 Shift arbitrary battle lead to front of party while preserving order. 2025-05-02 00:48:05 -04:00
JacksonB aeec991e7b add license 2025-04-27 22:44:06 -05:00
JacksonB 7751b13611 merge main 2025-04-27 18:50:35 -05:00
JacksonB e0cbc0bdc3 Riding Sound refactor to support and arbitrary number of sounds per behaviour per species. Implemented a fade in and out for any rideSound instance and added support for a handful of configurations when specifying the sound. 2025-04-27 16:52:04 -05:00
JacksonB 2f64ab1018 merge main 2025-04-26 17:33:09 -05:00
JacksonB 6c74d30ce8 Fix some filter issues and add saucer noise for magnezone 2025-04-26 17:26:35 -05:00
JacksonB 25956d5f23 temp commit for sound fixes 2025-04-25 16:16:15 -05:00
JacksonB f6832cd44c temp commit for cone raycasting 2025-04-25 11:46:33 -05:00
JacksonB 313e9dadb6 Add soundOcclusion, doppler effect, and custom non linear sound attenuation. 2025-04-25 09:05:43 -05:00
JacksonB 1d171268ed Behaviours can specify a looping ride sound and control its volume and pitch dynamically. Still need to allow multiple sound instances and also clean up my wip code 2025-04-23 00:34:13 -05:00
6095 changed files with 675146 additions and 86348 deletions
+6
View File
@@ -6,15 +6,21 @@
- Cat Pokémon (Meowth, Persian, etc.) intimidate Creepers and Phantoms.
- Sleep-related Pokémon (Munsharna, Komala, etc.) intimidate Phantoms.
- Some Pokémon naturally hunt each other.
- Some Pokémon herd together.
- Added a Behaviour Editor to the NPC editing screen.
- Added /behaviouredit command for opening the Behaviour Editor on Pokémon and NPCs.
- Editing variables for Pokémon is not yet supported.
### Developer
- baseScale in NPCs has been removed from classes and presets, and in the entity it is replaced with hitboxScale and renderScale.
- Added `EntityCallbacks` to `NPCEntity` and `PokemonEntity`. You can trigger custom callback types by using `[Entity].callbacks.process(...)`
### Fixes
- Fixed Pokémon with a moving walk target frequently spinning in place as they re-calculate their path.
### MoLang & Datapacks
- Added a `behaviours` datapack folder which motivates the Behaviour Editor screen on NPCs and Pokémon.
- Added "callback" support on PokemonEntity and NPCEntity that allows MoLang scripts to be executed in response to certain scenarios.
- Added very many behaviours to choose from.
- Removed many NPC presets that now exist as behaviours. This is a breaking change if you are using NPCs with these presets.
- NPCs with these presets should be modified to instead list under `"behaviours"` all the equivalent behaviours.
+2 -1
View File
@@ -8,7 +8,8 @@
- Lure Cakes can be used to modify the spawn rate of Pokémon in the wild.
- Added the Saccharine Tree, which can be found in the wild and is used to obtain Honey Bottles.
- The leaves of the tree can be harvested to obtain honey, which can be used in the Campfire Pot to make Lure Cakes.
- The Log of the tree can be clicked on with honey to create a Honey Log, which increases the change of spawning a Pokemon with an Hidden Ability.
- The Log of the tree can be interacted with using a honey bottle to create a Honey-Slathered Saccharine Log, which increases the change of spawning a Pokémon with a Hidden Ability.
- Added Hearty Grains
- Clicking on the Progress Arrow will show the JEI Recipe Book for the Campfire Pot, which will show all recipes that can be made with it.
- Added a Ton of Redstone Compatibility.
- Dispenser can now Honey and Unhoney:
+2 -1
View File
@@ -1,6 +1,7 @@
### Additions
- Added functionality for marks.
- Added data for all marks and all title ribbons from Pokémon.
- Added data for all marks and ribbons from the mainline Pokémon games.
- Implemented fishing, personality, weather, and time related marks, that can rarely be granted to a wild-spawned Pokémon.
- Added marks screen within the summary UI.
- Added `/givemark <player> <partySlot> <mark>` command to give a mark to a Pokémon.
- Added `/takemark <player> <partySlot> <mark>` command to remove a mark from a Pokémon.
+11 -2
View File
@@ -1,19 +1,28 @@
### Additions
- Added ability to rename PC Boxes by clicking on the name of a box.
- Added box options buttons for boxes, toggleable by clicking the right icon button in the bottom bar.
- The button on the right allows for changing the box wallpaper.
- The option buttons on the left side allow for sorting the box by name, level, Pokédex number, gender, and type. Shift clicking allows for sorting in reverse order.
- The button on the right allows for changing the box wallpaper.
- 10 additional color-based wallpapers have been added.
- 5 unlockable biome-based wallpapers have been added, which can be unlocked by visiting:
- Forest biome
- Ocean biome
- Cave Biome
- The End
- The Nether
- Added filter functionality in PC UI, which supports `PokemonProperties` (e.g. `shiny=yes` shows all shiny Pokémon).
- Names can be filtered by exact or partial matches, e.g. entering "cha" will show Charmander, Charmeleon, etc.
- Added `/changewallpaper <player> <boxNumber> <wallpaper>` command to change a box wallpaper through commands.
- Added `/renamebox <player> <boxNumber> <name>` command to rename a PC box through commands.
- Added IVs and EVs stat displays in PC.
- Added ability to change boxes by scrolling.
- The displays can be cycled through by scrolling when the display is hovered over.
- Added ability to cycle through boxes by scrolling when the box is hovered over.
- PC will now open to last box viewed within a session.
### Changes
- Slots in pastures will now have darker backgrounds and italicised Pokémon names if the Pokémon is not owned by the player.
- The pasture slot will show the name of the Pokémon owner when hovered if the Pokémon is not owned.
- Increased the default PC box count from 30 to 40 to accommodate the fact that we have way more Pokémon now. If you've changed this config option then you'll need to edit it again after starting up with 1.7!
### Developer
- Added `RenamePCBoxEvent.Pre` and `RenamePCBoxEvent.Post` events to prevent players from renaming a box or changing their input.
+1
View File
@@ -4,6 +4,7 @@
### Fixes
- Fixed the "enabled" property in spawn files not actually being respected. Where do they find these devs?
- Fixed Terralith's shrubland not counting as plains for spawning purposes the way it was intended to.
### Developer
- Spawning Influences now have the context of what the other buckets are when adjusting bucket weights. This will break existing influences that do bucket weight adjustment.
+442 -20
View File
@@ -11,11 +11,11 @@
- Pokémon's held items can now be rendered, with a visibility toggle in the Summary screen.
- Added cosmetic item functionality for Pokémon. Certain cosmetic items can be given to applicable Pokémon via the interact menu.
- Added the various log blocks as cosmetic items for Timburr and Komala.
- Added cosmetics for Spoink, Gurdurr, Conkeldurr, Squirtle Line, Sneasler, Sandile line, Treecko line, Braixen, Delphox, and Dragonite.
- Added Gilded Chest cosmetics for Chest Gimmighoul and Gholdengo
- Added `visibility/hidden`, `visibility/hat` and `visibility/face` tags to control where and how certain items are rendered.
- Added Pokémon markings, toggleable within the summary.
- Added `/boxcount` command to change PC boxes amount
- Added cosmetics for Gurdurr, Conkeldurr, Squirtle Line, Sneasler, Sandile line, Treecko line, Braixen, Delphox, and Dragonite.
- Added cosmetics for Gurdurr, Conkeldurr, Squirtle Line, Sneasler, Sandle line, Treecko line, Braixen, Delphox, and Dragonite.
- Added `/transformmodelpart (position|rotation|scale) <modelPart> <transform: x y z>` command that can add transformations to a pokemon's model part.
- The player executing the command must be facing the target pokemon entity. Transformations are not persistent and will revert when resources are reloaded.
- Added `legacy` and `special` sourced moves to Pokémon.
@@ -23,7 +23,7 @@
- Added `translucent_cull` boolean option into resolver's layer to allow for translucent textures with culling
- Added [LambDynamicLights](https://modrinth.com/mod/lambdynamiclights) support for items held by Pokémon, evolution stone blocks, evolution stone items, Pokédex, Luminous Moss, Flame Orb, and Magmarizer.
- Added the Clear Amulet, Grip Claw, Lagging Tail, Luminous Moss, Metal Alloy, Scroll of Darkness, Scroll of Waters
- Added Recipes for Masterpiece Cup, Eject Pack
- Added Recipes for Masterpiece Cup, Eject Pack.
- Added modification to Minecraft Creative Inventory search to account for item names that contain `poké` when input contains `poke`.
- Added Campfire Pot as well as loads of new food items (Poke Puffs, Ponigiri, Sinister Tea, etc)
- Added Hearty Grains, a new crop used in the new cooking mechanic
@@ -32,19 +32,55 @@
- Added `/pctake <player> <box> <slot>` command that takes a specific Pokémon from a player's PC. Removes the pokemon if target is self or ran from the server.
- Added Hyper Training items (IV Modification) as well as some additional candy items to do so (Health Candy, Sickly Candy)
- Added Galarica Nut Bushes
- Many Pokémon (mostly cats) are now feared by phantoms
- Lightning is now affected by a Pokemon's ability/typing
- Pokémon with the ability Lightning Rod draw in lightning similar to a lightning rod block albeit with a lower priority and range, gain immunity to lightning damage, and receive a temporary damage buff.
- Pokémon with the ability Motor Drive are immune to lightning damage and receive a temporary speed buff when struck by lightning
- Pokémon with the ability Volt Absorb are immune to lightning damage and receive Regeneration II for a short duration
- Ground type Pokémon are immune to lightning damage
- Added functionality to Everstone when held by a Pokémon; suppresses evolution notification and hides evolve button in summary interface.
- Added optional `filePath` parameter to MoLang functions to allow for global stores (ex. `../global/`). Path must end in a forward slash.
- Added new optional property `attachment_options` for most EmitterShapes to be attached to the locator/entities scale, rotation, and/or position. Position is true by default.
- Galarica Nut bushes now generate on beaches.
- Some Pokémon now pitch their bodies in the direction they're moving.
- Added new advancements Didn't Stop To Think, We Need To Cook, and Pokémon Jockey!.
- Berries can now be smelted into their respective dyes.
- Added Syrupy Apples.
- Added `/runmolang <molang> [<npc>|<player>|<pokemon>]` command that executes a MoLang expression with the provided options as environment variables, as well as the entity (as `q.entity`) that executed the command.
- Added bubble quirk to Kingler; like Krabby, Kingler will blows bubbles during dusk.
- Added `.Pre` and `.Post` to the following events:
- `PokemonRecallEvent`
- `TradeEvent`
- Added a new gamerule, 'healerHealsPC', when set to true a successful use of a healer will also heal all of the Pokemon in that player's PC.
### Pokémon Added
#### Gen 2
- Marill
- Azumarill
- Hoppip
- Skiploom
- Jumpluff
- Dunsparce
- Togepi
- Togetic
- Unown
- Houndour
- Houndoom
- Ho-Oh
- Lugia
- Alola Bias Pichu (built-in resourcepack)
#### Gen 3
- Azurill
- Meditite
- Medicham
- Electrike
- Manectric
- Spoink
- Grumpig
- Swablu
- Altaria
- Snorunt
- Glalie
- Latias
@@ -58,6 +94,9 @@
- Froslass
- Glameow
- Purugly
- Skorupi
- Drapion
- Togekiss
#### Gen 5
- Pansage
@@ -80,25 +119,60 @@
- Solosis
- Duosion
- Reuniclus
- Tynamo
- Eelektrik
- Eelektross
- Axew
- Fraxure
- Haxorus
- Mienfoo
- Mienshao
- Sewaddle
- Swadloon
- Leavanny
- Druddigon
#### Gen 6
- Skiddo
- Gogoat
- Espurr
- Meowstic
- Inkay
- Malamar
- Hawlucha
- Dedenne
- Noibat
- Noivern
- Furfrou
- You can change Furfrou's form by using shears on it while it holds a certain dye in its cosmetic slot.
#### Gen 7
- Yungoos
- Gumshoos
- Drampa
- Alolan Grimer
- Alolan Muk
- Togedemaru
#### Gen 8
- Skwovet
- Greedent
- Chewtle
- Drednaw
- Toxel
- Toxtricity
- Morpeko
- Silicobra
- Sandaconda
- Sinistea
- Polteageist
- Galarian Corsola
- Cursola
- Mr. Rime
- Galarian Mr. Mime
- Clobbopus
- Grapploct
- Galarian Weezing
#### Gen 9
- Smoliv
@@ -111,13 +185,24 @@
- Cyclizar
- Poltchageist
- Sinistcha
- Capsakid
- Scovillain
- Tadbulb
- Bellibolt
- Toedscool
- Toedscruel
- Rellor
- Rabsca
- Bramblin
- Brambleghast
### Animation updates for the following Pokémon
- Garchomp
- Tropius
- Torpius
- Nosepass
- Probopass
- Sneasel
- Weavile
- Sneasler
- Braixen
- Delphox
@@ -132,8 +217,86 @@
- Dratini
- Dragonair
- Dragonite
- G. Corsola
- Cursola
- Dunsparce
- Dudunsparce (both forms)
- Porygon
- Porygon2
- Porygon-Z
- Wattrel
- Kilowattrel
- Golurk
- Spinarak
- Ariados
- Wyrdeer
- Tyrantrum
- Pidove
- Tranquill
- Unfezant
- Beldum
- Metang
- Metagross
- Plusle
- Minun
- Murkrow
- Honchkrow
- Larvesta
- Volcarona
- Dwebble
- Crustle
- Mr. Mime
- Flygon
- Pichu
- Pikachu
- Raichu
- Alolan Raichu
- Espathra
- Abra
- Kadabra
- Alakazam
- Deino
- Zweilous
- Hydreigon
- Slaking
- Klink
- Klang
- Klinklang
- Baltoy
- Claydol
- Mamoswine
- Rufflet
- Braviary
- Girafarig
- Farigiraf
- Rookidee
- Corvisquire
- Corviknight
- Venipede
- Whirlipede
- Scolipede
- Venusaur
- Parasect
- Bastiodon
- Amaura
- Varoom
- Revavroom
- Bouffalant
- Lickilicky
- Blaziken
- Rhyhorn
- Rhydon
- Rhyperior
- Tauros
- Tauros - Paldea Aqua
- Tauros - Paldea Blaze
- Tauros - Paldea Combat
- Dewgong
### Model updates for the following Pokémon
- Cleffa
- Clefairy
- Clefable
- Gyarados
- Dragonite
- Eevee
@@ -179,12 +342,66 @@
- Cacturne
- Taillow
- Swellow
- Added Syrupy Apples.
- Seel
- Dewgong
- Honedge
- Doublade
- Aegislash
- Drowzee
- Hypno
- Mudkip
- Marshtomp
- Swampert
- Shelmet
- Escavalier
- Klink
- Klank
- Klinklang
- Spinarak
- Ariados
- Pidove
- Tranquill
- Unfezant
- Sobble
- Drizzile
- Inteleon
- Plusle
- Minun
- Murkrow
- Zorua
- Zoroark
- Mime.Jr
- Mr. Mime
- Pichu
- Pikachu
- Raichu
- Alolan Raichu
- Dusknoir
- Deino
- Zweilous
- Hydreigon
- Dreepy
- Drakloak
- Dragapult
- Mamoswine
- Rookidee
- Corvisquire
- Corviknight
- Venipede
- Whirlipede
- Scolipede
- Farigiraf
- Staryu
- Starmie
- Gimmighoul
- Gholdengo
- Starly
- Staravia
- Staraptor
- Varoom
- Revavroom
- Nickit
- Thievul
### Changes
- Changed pokemon caught and seen count to update based on the current pokedex being looked
@@ -229,6 +446,27 @@
- Updated interaction interface to include 4 more option spaces
- Made lecterns that hold a Pokédex emit light.
- Updated light levels for active PC, Pasture, Healing Machine, and Data Monitor.
- Vivichokes now always drop one seed when harvested, and converting a fully grown Vivichoke to seeds via crafting results in 1 seed.
- Healing Machine recipe rebalanced.
- Reorganised the `block` texture folder to be more organised, in line with the `item` texture folder.
- Offset in EmitterShape now ignores scale to be more like Blockbench by default. You can get this behaviour back by adding `"scale": true` in the `attachment_options` property in most EmitterShapes.
- Not specifying a dex in `/pokedex printcalculations {player} {dex}` will now print the National Dex statistics instead of showing all dexes. `/pokedex printcalculations {player} all` is how to view all dex statistics in one command.
- Removed Braised Vivichoke
- Updated Pokémon state icons shown in party interfaces
- MoLang `face` function can now be run on any `PosableEntity` (Like Pokémon!) instead of just NPCs.
- MoLang `run_action_effect` now works on Pokémon.
- Changed MoLang entity function `is_standing_on` to allow for block tags in the list.
- Added entity (as `q.entity`) that executed the command to the `executemolangscript` command.
- A wild Pokémon using Teleport now ends the battle and causes the Pokémon to teleport a short distance away. Teleport still behaves the same in PvP battles.
- Refactored the following events to `.Pre` and `.Post` for consistency:
- `PokemonSentEvent`
- `ExperienceGainedEvent`
- `BattleStartedEvent`
- Updated `PokemonSentEvent` parameters to include the Position and Level of the Pokémon being sent out.
- Updated `EvolutionCompleteEvent` parameters to include the Source Pokemon that evolved.
- Updated `HatchEggEvent.Post` to include the Pokemon that hatched.
- Roseli Berry Trees now naturally generate in their preferred biomes.
- Refactored dynamic lights compat to be more future proof. The dynamic light support is only tested with LambDynamicLights, on NeoForged use that mod in combination with Sinytra Connector
### Fixes
- Fixed game crashing when removing national pokedex using datapacks
@@ -272,8 +510,8 @@
- Fix issue where locator X axis was not aligned with blockbench.
- Fix issue where particle effects that play on frame 1 on sendout would never play (Gastly)
- The Wiglett line will now sink in water again.
- Fixed the Sprigatito line's portraits being zoomed in too far.
- Fixed Floragato's battle cry animation from breaking.
- Fixed the Sprigatito line's portraits being zoomed in too far.
- Fixed Floragato's battle cry animation from breaking.
- Fixed the block texture name for the Pep-Up Flower being inaccurate
- Fixed issue where the restoration tank would not accept valid items from a hopper.
- Fixed energy root not being shearable
@@ -291,12 +529,27 @@
- Improved flyers avoiding getting stuck on fence posts.
- Fixed air balloon battle text not correctly displaying the Pokémon or item name
- Fixed an issue where items retrieved from a Display case would disappear if a player's inventory is full
- Fixed Pokédex Scanner not respecting the "Invert Mouse" option.
- Fixed a crash due to a ConcurrentModificationException that could occur during world generation.
- Fixed Moon Ball moon phase logic to actually work correctly
- Fixed Pokédex Scanner not respecting the "Invert Mouse" option
- Fixed recoil eyes on Shellder & Cloyster.
- Fixed Shroomish spinning at lightning speed when fainting (no longer allowed to let it rip.)
- Fixed Pokédex Scanner not respecting the "Invert Mouse" option.
- Fixed a crash due to a ConcurrentModificationException that could occur during world generation.
- Fixed Quaxly's animations showing hidden wing sets
- Fixed Moon Ball moon phase logic to actually work correctly
- Fixed `/pokedex printcalculations` to now show the correct percentage completed of the Pokedex
- Fixed mod incompatibility with the `Raised` mod
- Fixed a vulnerability that could cause party and PC rollbacks under specific circumstances.
- Fixed a rare edge case where sorting your PC could be rolled back later.
- Fixed BotanyPots built-in integration
- Fixed shading of berries on berry trees.
- Fixed static text cursor for nickname input in summary.
- Fixed Cobblemon brewing recipes placing result into all slots, and not just slots with correct ingredients inside the brewing stand.
- Fixed an issue where hoppers and brewing stands were not recognizing Cobblemon brewing recipes.
- Fixed global species features... not working. Since they were created. Oops.
- Fixed Pokémon with alternate forms being created with an incorrect 'forced' tag on their ability.
- Fixed busted abilities and moves in Pokémon data due to removed datapacks etc. causing storage corruption. It now just rerolls their ability / uses Tackle.
- Fixed singular Pokémon corruption causing entire storage corruption. Storages will now skip corrupted Pokémon and print an error to console.
- Fixed species additions not being able to properly mark a species as implemented.
### Developer
- A finished battle now has winners and losers set inside of `PokemonBattle` instead of them always being empty.
@@ -308,9 +561,8 @@
- Renamed Cobblemon's creative tabs to start with "Cobblemon: " to distinguish Cobblemon's tabs from tabs for other mods.
- Various items now have a rarity value.
- Reworked observable handling in `Pokemon.kt` to cut down on RAM usage and clarify the file.
- Note: This will break mods that used our observable functionality there or in MoveSet, IVs, EVs, or BenchedMoves.
- Note: This will break mods that used our observable functionality there or in MoveSet, IVs, EVs, or BenchedMoves.
- Using `Pokemon#onChange()` is now the way to mark a Pokémon as needing a save.
- Using `[Pokemon].changeObservable` is now the way to get an `Observable` for any save-worthy changes.
- Updated NPCEntity beam positioning to properly account for the baseScale property.
- Updated NPCEntity pokeball throw positioning to properly account for the baseScale property.
- Fixed `[Pokemon].copyFrom` error causing forms, IVs, and EVs to not be applied properly when using `[Pokemon].loadFromJSON` or `[Pokemon].loadFromNBT`
@@ -331,10 +583,15 @@
- The IVs class has now been extended to include Hyper Trained values.
- Added `Pokemon#hyperTrainIV()` and `IVs#setHyperTrainedIV(Stat, Int)`.
- Added `HyperTrainedIvEvent.Pre` and `HyperTrainedIvEvent.Post`.
- Added `Pokemon#validateMoveSet()` to validate an existing Pokemon's moveset, clearing illegal moves.
- Added a `hoverText` option to PartySelectCallback, to display a tooltip on hovering over a Pokémon in the selection screen.
- `PokemonEntity` instances spawned into the world now appropriately finalize the spawn for mod compatibility.
- Added PokedexManager.obtain as a replacement for .catch which is not a friendly function name in Java.
- Added `Pokemon#hyperTrainIV()` and `IVs#setHyperTrainedIV(Stat, Int)`
- `ElementalType` now implements `ShowdownIdentifiable` to ensure the communcation with showdown stays consistent (also in regards to TeraTypes)
- Pokemon no longer have a change observable
### MoLang & Datapacks
- The following usages for item predicates can now use item conditions like advancements do, you can learn about them in the [Minecraft wiki](https://minecraft.wiki/w/Advancement_definition#minecraft:filled_bucket)
- The `requiredContext` for an item interaction evolution
@@ -364,9 +621,174 @@
- The format of the `remedies.json` file has changed to allow for individual friendshipDrop amounts per remedy
- Fixed `entity.find_nearby_block` causing crashes when attempting to use a block tag
- Spawn Filters can now access `v.spawn.class` to get the identifier of an NPC class for when trying to influence NPC spawns
- Added Molang functions for Party and PC: `set_pokemon`
- Added Molang functions for Pokémon: `pokeball`, `held_item`, `remove_held_item`, `hyper_train_iv`, `validate_moveset`, `initialize_moveset`, and `add_exp`.
- Added Molang functions for Pokémon: `aspects`, `form_aspects`, `unlearn_move`, `teach_learnable_moves`, `cosmetic_item`, and `remove_cosmetic_item`.
- Added Molang functions for Pokémon: `ability`, `set_iv`, `set_ev`, `teach_move`, and `can_learn_move`.
- Added Molang function `q.delete_variable(<struct>, <variable_name>)` to delete a value from a variable structure in MoLang data.
- Added Molang function `q.delete_variables(<struct>)` to delete all values from a variable structure in MoLang data.
- Adds Flows for `STARTER_CHOSEN`, `SHOULDER_MOUNTED`, `EV_GAINED`, `POKEMON_RELEASED`, `POKEMON_NICKNAMED`, `HELD_ITEM`, and `TRADE_COMPLETED` events
- Adds Flows for `POKEMON_HEALED`, `POKEMON_SCANNED`, `BERRY_HARVEST`, `LOOT_DROPPED`, `POKEMON_SEEN`, `COLLECT_EGG`, `HATCH_EGG`, and `EXPERIENCE_GAINED`.
- Adds Flows for `POKEMON_CATCH_RATE`, `BAIT_SET`, `BAIT_SET_PRE`, `BAIT_CONSUMED`, `POKEROD_CAST_PRE`, `POKEROD_CAST_POST`, `POKEROD_REEL`, and `BOBBER_SPAWN_POKEMON_PRE`.
- Adds Flows for `POKEMON_ASPECTS_CHANGED`, `FRIENDSHIP_UPDATED`, `CHANGE_PC_BOX_WALLPAPER_EVENT_PRE`, `CHANGE_PC_BOX_WALLPAPER_EVENT_POST`, and `FULLNESS_UPDATED`.
- MoLang triggered battles may now set the battle format, whether to clone the player's party, set level, or heal prior.
- Added Molang function for Player: `inventory`
- Adds Flows for `STARTER_CHOSEN`, `EV_GAINED`, `POKEMON_RELEASED`, `POKEMON_NICKNAMED`, `HELD_ITEM`, and `TRADE_COMPLETED` events
- Adds Pokemon functions for `pokeball`, `held_item` and `remove_held_item`
- Adds Pokemon functions for `pokeball`, `held_item`, `remove_held_item`, `add_aspects`, and `remove_aspects`
- Added `pokemon.hyper_train_iv` as an available Molang function.
- Added `prepare_{effect}` and `damage_{effect}` action effect hooks in battles for more battle particle effects.
- Added `q.has_argument(<argument_name>, [argument_value])` MoLang function to several battle-related action effect contexts.
- Added `q.has_argument_at(<index>, [argument_value])` MoLang function to several battle-related action effect contexts.
- Added `q.hit_count` MoLang function to move action effect contexts.
- Added `is_included`, `to_lower`, `to_upper`, and `string_length` as available Molang functions.
- Fixed a crash that would occur during battles if the opponent wild Pokémon species comes from a namespace other than cobblemon
- Fixed `clientActions` inside Dialogue pages being executed twice
- Added `q.split_string(<text>, <delimiter/comma>)` Outputs an array with the divided text.
- Added `q.spawn_npc(<x>, <y>, <z>, <npc>)` Spawns an NPC at the given coordinates and returns the NPC.
- Added `q.player.seen_credits` Returns whether the player has seen the end credits.
- Added `q.player.is_in_dialogue` Returns whether the player is currently in a dialogue.
- Added `q.player.active_dialogue` Returns the active dialogue of the player, or null if none.
- Added `q.player.is_spectator` Returns whether the player is in spectator mode.
- Added `q.player.is_adventure` Returns whether the player is in adventure mode.
- Added `q.player.is_creative` Returns whether the player is in creative mode.
- Added `q.player.is_survival` Returns whether the player is in survival mode.
- Added `q.player.set_battle_theme(<sound resource>)` Sets the player's battle theme to the given theme.
- Added `q.player.battle_music(<sound_resource>, <volume>, <pitch>)` Plays the given battle music for the player.
- Added `q.player.stop_battle_music()` Stops any currently playing battle music for the player. (With a fade out).
- Added `q.player.riding_pokemon` Returns the Pokémon the player is currently riding.
- Added `q.entity.is_player` Returns whether the entity is a player.
- Added `q.entity.is_pokemon` Returns whether the entity is a Pokémon.
- Added `q.entity.is_npc` Returns whether the entity is an NPC.
- Added `q.entity.is_mob` Returns whether the entity is a vanilla mob.
- Added `q.entity.is_animal` Returns whether the entity is an animal.
- Added `q.entity.is_hostile` Returns whether the entity is a hostile mob.
- Added `q.entity.is_baby` Returns whether the entity is a baby.
- Added `q.entity.is_adult` Returns whether the entity is an adult.
- Added `q.entity.is_tamable` Returns whether the entity is tamable.
- Added `q.entity.is_tamed` Returns whether the entity is tamed.
- Added `q.entity.add_effect(<effect>, <duration>, <amplifier>, <ambient> <show_particles>)` Adds a status effect to the entity.
- Added `q.entity.remove_effect(<effect>)` Removes a status effect from the entity.
- Added `q.entity.has_effect(<effect>)` Returns whether the entity has the given status effect.
- Added `q.entity.is_looking_at(<entity>)` Returns whether the entity is looking at the given entity.
- Added `q.entity.tags` Returns an array of the entity's tags.
- Added `q.entity.add_tag(<tag>)` Adds the given tag to the entity.
- Added `q.entity.remove_tag(<tag>)` Removes the given tag from the entity.
- Added `q.entity.has_tag(<tag>)` Returns whether the entity has the given tag.
- Added `q.entity.make_intangible(<true/false>)` Makes the entity intangible.
- Added `q.pokemon.force_evolve(<index>)` Forces the Pokémon at the given index.
- Added `q.pokemon.can_evolve` Returns whether the Pokémon at the given index can evolve.
- Added `q.pokemon.is_busy` Returns whether the Pokémon is busy.
- Added `q.pokemon.is_rideable` Returns whether the Pokémon is rideable.
- Fixed `background` field and added `textColor` field for dialogues.
### Particles
Added new/updated particles for the following moves:
- Absorb
- Acid
- Acid Spray
- Aerial Ace
- Amnesia
- Aurora Beam
- Bite
- Body Slam
- Bubble
- Bubble Beam
- Bulldoze
- Bullet Punch
- Close Combat
- Confusion
- Crunch
- Cotton Guard
- Double Team
- Dragon Claw
- Egg Bomb
- Ember
- Eruption
- Explosion
- Fire Blast
- Fire Punch
- Fire Spin
- Flame Burst
- Flame Charge
- Flamethrower
- Flame Wheel
- Frost Breath
- Frustration
- Giga Drain
- Growl
- Haze
- Hidden Power
- Horn Attack
- Hyper Fang
- Hypnosis
- Ice Beam
- Ice Punch
- Ice Shard
- Icy Wind
- Infestation
- Kinesis
- Lava Plume
- Leech Life
- Leech Seed
- Leer
- Lick
- Magical Leaf
- Mega Drain
- Minimize
- Mist
- Mud Bomb
- MudSport
- Mystical Fire
- Nasty Plot
- Poison Fang
- Poison Gas
- Poison Powder
- Population Bomb
- Pound
- Powder
- Powder Snow
- Present
- Protect
- Psybeam
- Psychic
- Pursuit
- Quick Attack
- Rage Powder
- Razor Leaf
- Return
- Rock Throw
- Sand Attack
- Scary Face
- Scratch
- Seed Bomb
- Seismic Toss
- Self Destruct
- Shadow Ball
- Shadow Claw
- Sing
- Sleep Powder
- Sludge Bomb
- Smokescreen
- Spike
- Spore
- Stomp
- String Shot
- Stun Spore
- Super Fang
- Swords Dance
- Tackle
- Tail Whip
- Thunder
- Thunder Punch
- Thunderbolt
- Thunder Shock
- Thunder Wave
- Toxic
- Water Gun
- Water Pulse
- Water Sport
- Will-O-Wisp
- Withdraw
## [1.6.1 (January 26th, 2025)](#1-6-1)
@@ -379,7 +801,7 @@
- Added optional box argument to the /pc command.
- Pokédex and Dialogue screens now close when the inventory keybind is pressed.
- Added config setting `maxPokedexScanningDetectionRange` to control from what distance the player can scan Pokémon using the Pokédex.
- Added config setting `hideUnimplementedPokemonInThePokedex` which hides unimplemented Pokémon from the Pokédex when set to true.
- Added config setting `hideUnimplementedPokemonInThePokedex` which hides unimplemented Pokémon from the Pokédex when set to true.
- Added debug renderer for posable entity locators.
- Added crossover paintings from Close Combat, Premonition, Altar, Slumber, and Nomad.
- Added optional box argument to the /pc command
@@ -533,7 +955,7 @@
- Fixed Vivichoke Dip and Leek & Potato Stew not returning a bowl upon consumption.
- Fixed Fossil Restoration Tank not accepting Hay Bales as organic material.
- Fixed Potion items applying double their intended healing value.
- Fixed Fast Ball capture bonuses applying to all Pokémon, making it the Best Ball instead of the Mediocre Edge-Case Ball.
- Fixed Fast Ball capture bonuses applying to all Pokémon, making it the Best Ball instead of the Mediocre Edge-Case Ball.
- Fixed "learned new move" messages appearing for already-known moves on Pokémon evolutions.
- Fixed Pokémon Item Models breaking shadows nearby when being placed in Display Cases or Item Frames.
- Fixed berries not giving bonus yields when planted in their preferred biomes. I'm sure we've fixed that 5 times now.
@@ -542,7 +964,7 @@
- Fixed players with shouldered Pokémon not being able to rejoin their 1.5.2 worlds using 1.6.
- Fixed `PokemonProperties` utilizing `ability=<some ability>` being treated as a forced ability even when it is a legal ability for the Pokémon.
- Fixed type formatting in Pokédex scanner mode when dual types require two lines.
- Fixed trading sometimes crashing the game or server.
- Fixed trading sometimes crashing the game or server.
- Fixed Wild shiny sounds not respecting the `shinyNoticeParticlesDistance` config setting.
- Fixed Pokémon being able to evolve mid-battle.
- Fixed NPC held items being able to be stolen by players. Don't be a thief!
@@ -636,7 +1058,7 @@
- Stonjourner Henge Ruins, Luna Henge Ruins, and Sol Henge Ruins.
- Submerged Shipwreck Cove and Lush Shipwreck Cove.
- Pokémon Centers to all 5 village types.
### Pokémon Added
#### Gen 1
- Alola Bias Cubone (built-in resource pack)
@@ -959,7 +1381,7 @@
- Big Roots and Energy Roots now share the same sounds as intended.
- Fixed sounds made by blocks playing at a lower pitch than intended.
- Fixed Chimchar and Monferno comically T posing whenever they sleep.
- Fixed Cetitan's cry breaking its walk and sleep animations.
- Fixed Cetitan's cry breaking its walk and sleep animations.
- Fixed the Magby line not having any placeholder walk animations.
- Fixed Duskull and Dusclops using skylight levels for their nether spawn data. There is no sun in the Nether!
- Fixed Hisuian Zoroark using base Zoroark stats.
@@ -975,7 +1397,7 @@
- Fixed Trevenant T-posing after 8 seconds of sleeping. I also do that.
- Fixed Bewear T-posing for a bit if a wild one faints where you can see.
- Fixed Noctowl's placeholder fly animation.
- Corrected Lotad blinking animation.
- Corrected Lotad blinking animation.
- Fixed reviving items causing errors when used in battle.
- Fixed messages for Focus Sash, Confusion, Mummy, Ice Face, Own Tempo, and Revive.
- Improve error handling when loading spawn-sets to ensure invalid configurations don't crash the server.
@@ -1065,7 +1487,7 @@
- Added a new universal locator called "top".
- Added `eggs_collected` and `eggs_hatched` Advancement triggers.
- Added missing `minYaw` configuration to the `q.look()` function for JSON posers.
- Some pose condition names have been changed:
- Some pose condition names have been changed:
- `isTouchingWaterOrRain` has been changed to `isInWaterOrRain`
- `isSubermegedInWater` has been changed to `isUnderWater`
+8 -1
View File
@@ -31,6 +31,7 @@ repositories {
maven(url = "${rootProject.projectDir}/deps")
maven(url = "https://api.modrinth.com/maven")
maven(url = "https://maven.neoforged.net/releases")
maven(url = "https://maven.gegy.dev")
mavenLocal()
}
@@ -44,6 +45,12 @@ dependencies {
modCompileOnly(libs.bundles.common.integrations.compileOnly) {
isTransitive = false
}
// LambDynamicLights is handled differently because we need the Mojang-mappings version of it.
modCompileOnly(libs.lambDynamicLights) {
capabilities {
requireCapability("dev.lambdaurora.lambdynamiclights:api-mojmap")
}
}
// Flywheel has no common dep so just pick one and don't use any platform specific code in common
// modCompileOnly(libs.flywheelFabric)
@@ -94,4 +101,4 @@ sourceSets {
}
}
}
}
}
@@ -0,0 +1,13 @@
/*
* 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;
public interface DoubleJump {
boolean isDoubleJumping();
}
@@ -9,15 +9,6 @@
package com.cobblemon.mod.common;
import com.cobblemon.mod.common.api.orientation.OrientationController;
import net.minecraft.util.Mth;
import net.minecraft.util.SmoothDouble;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.phys.Vec3;
import org.jetbrains.annotations.Nullable;
import org.joml.Matrix3f;
import org.joml.Vector3f;
import java.util.function.Function;
public interface OrientationControllable {
OrientationController getOrientationController();
@@ -1,102 +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.compat;
import com.cobblemon.mod.common.CobblemonEntities;
import com.cobblemon.mod.common.client.render.layer.PokemonOnShoulderRenderer;
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity;
import com.cobblemon.mod.common.item.PokedexItem;
import com.cobblemon.mod.common.pokemon.FormData;
import com.cobblemon.mod.common.pokemon.lighthing.LightingData;
import dev.lambdaurora.lambdynlights.LambDynLights;
import dev.lambdaurora.lambdynlights.api.DynamicLightHandler;
import dev.lambdaurora.lambdynlights.api.DynamicLightHandlers;
import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.item.ItemStack;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Optional;
import net.minecraft.world.entity.player.Player;
// Java class due to relying on entrypoint on Fabric side
public class LambDynamicLightsCompat {
// This is all called on client side
// These things are checked every tick so try to keep it as free as possible
// That being said it's unlikely school Toshiba person is running dynamic lighting and shaders to enjoy this
// Make sure not to call anything Fabric specific :)
public static void hookCompat() {
// Pokémon entities
DynamicLightHandlers.registerDynamicLightHandler(
CobblemonEntities.POKEMON,
DynamicLightHandler.makeHandler(
LambDynamicLightsCompat::resolvedPokemonLightLevel,
pokemon -> false
)
);
// Shouldered Pokémon
DynamicLightHandlers.registerDynamicLightHandler(
EntityType.PLAYER,
DynamicLightHandler.makeHandler(
LambDynamicLightsCompat::resolvedPlayerLightLevel,
player -> false
)
);
}
private static int resolvedPokemonLightLevel(PokemonEntity pokemon) {
var underwater = !pokemon.level().getFluidState(BlockPos.containing(pokemon.getX(), pokemon.getEyeY(), pokemon.getZ())).isEmpty();
ItemStack item = pokemon.getShownItem();
int itemLightLevel = item.isEmpty()?0:LambDynLights.getLuminanceFromItemStack(item, underwater);
int formLightLevel = extractFormLightLevel(pokemon.getForm(), underwater).orElse(0);
return Math.max(itemLightLevel, formLightLevel);
}
private static int resolvedPlayerLightLevel(Player player) {
var underwater = !player.level().getFluidState(BlockPos.containing(player.getX(), player.getEyeY(), player.getZ())).isEmpty();
final int leftShoulderLightLevel = extractShoulderLightLevel(PokemonOnShoulderRenderer.shoulderDataFrom(player.getShoulderEntityLeft()), underwater);
final int rightShoulderLightLevel = extractShoulderLightLevel(PokemonOnShoulderRenderer.shoulderDataFrom(player.getShoulderEntityRight()), underwater);
final int itemLightLevel = customHeldItemLightLevel(player.getMainHandItem(), player.getOffhandItem());
return Math.max(itemLightLevel, Math.max(leftShoulderLightLevel, rightShoulderLightLevel));
}
private static Optional<Integer> extractFormLightLevel(@NotNull FormData form, boolean underwater) {
if (form.getLightingData() == null || !liquidGlowModeSupport(form.getLightingData().getLiquidGlowMode(), underwater)) {
return Optional.empty();
}
return Optional.of(form.getLightingData().getLightLevel());
}
private static int extractShoulderLightLevel(@Nullable PokemonOnShoulderRenderer.ShoulderData shoulderData, boolean underwater) {
if (shoulderData == null) {
return 0;
}
ItemStack item = shoulderData.getShownItem();
int itemLightLevel = item.isEmpty() ? 0 :LambDynLights.getLuminanceFromItemStack(item, underwater);
int formLightLevel = extractFormLightLevel(shoulderData.getForm(), underwater).orElse(0);
return Math.max(itemLightLevel, formLightLevel);
}
private static int customHeldItemLightLevel(ItemStack mainhand, ItemStack offhand) {
return (mainhand.getItem() instanceof PokedexItem || offhand.getItem() instanceof PokedexItem) ? 13 : 0;
}
private static boolean liquidGlowModeSupport(@NotNull LightingData.LiquidGlowMode liquidGlowMode, boolean underwater) {
return underwater ? liquidGlowMode.getGlowsUnderwater() : liquidGlowMode.getGlowsInLand();
}
}
@@ -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.compat.lambdynamiclights;
import com.cobblemon.mod.common.pokemon.FormData;
import com.cobblemon.mod.common.pokemon.lighthing.LightingData;
import org.jetbrains.annotations.NotNull;
import java.util.Optional;
public abstract class CustomLuminance {
protected static Optional<Integer> extractFormLightLevel(@NotNull FormData form, boolean underwater) {
if (form.getLightingData() == null || !liquidGlowModeSupport(form.getLightingData().getLiquidGlowMode(), underwater)) {
return Optional.empty();
}
return Optional.of(form.getLightingData().getLightLevel());
}
protected static boolean liquidGlowModeSupport(@NotNull LightingData.LiquidGlowMode liquidGlowMode, boolean underwater) {
return underwater ? liquidGlowMode.getGlowsUnderwater() : liquidGlowMode.getGlowsInLand();
}
}
@@ -0,0 +1,42 @@
/*
* 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.compat.lambdynamiclights;
import com.cobblemon.mod.common.Cobblemon;
import dev.lambdaurora.lambdynlights.api.DynamicLightsContext;
import dev.lambdaurora.lambdynlights.api.DynamicLightsInitializer;
import dev.lambdaurora.lambdynlights.api.entity.luminance.EntityLuminance;
import dev.lambdaurora.lambdynlights.api.item.ItemLightSourceManager;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.EntityType;
public class LambDynamicLightsInitializer implements DynamicLightsInitializer {
public static final EntityLuminance.Type POKEMON_LUMINANCE = EntityLuminance.Type.registerSimple(
ResourceLocation.fromNamespaceAndPath(Cobblemon.MODID, "pokemon"),
PokemonLuminance.INSTANCE
);
public static final EntityLuminance.Type PLAYER_LUMINANCE = EntityLuminance.Type.registerSimple(
ResourceLocation.fromNamespaceAndPath(Cobblemon.MODID, "shoulder"),
PlayerLuminance.INSTANCE
);
@Override
public void onInitializeDynamicLights(DynamicLightsContext context) {
Cobblemon.LOGGER.info("Lamb Dynamic Lights compatibility enabled");
context.entityLightSourceManager().onRegisterEvent().register(ctx -> {
ctx.register(EntityType.PLAYER, PlayerLuminance.INSTANCE);
});
}
@SuppressWarnings({"removal", "UnstableApiUsage"})
@Override
public void onInitializeDynamicLights(ItemLightSourceManager itemLightSourceManager) {}
}
@@ -0,0 +1,72 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.compat.lambdynamiclights;
import com.cobblemon.mod.common.Cobblemon;
import com.cobblemon.mod.common.client.render.layer.PokemonOnShoulderRenderer;
import dev.lambdaurora.lambdynlights.api.entity.luminance.EntityLuminance;
import dev.lambdaurora.lambdynlights.api.item.ItemLightSourceManager;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.TagKey;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.Range;
public final class PlayerLuminance extends CustomLuminance implements EntityLuminance {
public static final PlayerLuminance INSTANCE = new PlayerLuminance();
private static final TagKey<Item> POKEDEX = TagKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(Cobblemon.MODID, "pokedex"));
@Override
public @NotNull Type type() {
return LambDynamicLightsInitializer.PLAYER_LUMINANCE;
}
@Override
public @Range(from = 0L, to = 15L) int getLuminance(@NotNull ItemLightSourceManager itemLightSourceManager, @NotNull Entity entity) {
if (entity instanceof Player player) {
final int shoulderLightLevel = shoulderLuminance(itemLightSourceManager, player);
final int itemLightLevel = player.isHolding(stack -> stack.is(POKEDEX)) ? 13 : 0;
return Math.max(shoulderLightLevel, itemLightLevel);
} else {
return 0;
}
}
private @Range(from = 0L, to = 15L) static int shoulderLuminance(@NotNull ItemLightSourceManager itemLightSourceManager, @NotNull Player player) {
final var leftShoulder = PokemonOnShoulderRenderer.shoulderDataFrom(player.getShoulderEntityLeft());
final var rightShoulder = PokemonOnShoulderRenderer.shoulderDataFrom(player.getShoulderEntityRight());
if (leftShoulder == null && rightShoulder == null) {
return 0;
}
final int leftShoulderLightLevel = extractShoulderLightLevel(leftShoulder, itemLightSourceManager, player.isUnderWater());
final int rightShoulderLightLevel = extractShoulderLightLevel(rightShoulder, itemLightSourceManager, player.isUnderWater());
return Math.max(leftShoulderLightLevel, rightShoulderLightLevel);
}
private static int extractShoulderLightLevel(@Nullable PokemonOnShoulderRenderer.ShoulderData shoulderData, @NotNull ItemLightSourceManager itemLightSourceManager, boolean underwater) {
if (shoulderData == null) {
return 0;
}
ItemStack item = shoulderData.getShownItem();
int itemLightLevel = item.isEmpty() ? 0 : itemLightSourceManager.getLuminance(item, underwater);
int formLightLevel = extractFormLightLevel(shoulderData.getForm(), underwater).orElse(0);
return Math.max(itemLightLevel, formLightLevel);
}
}
@@ -0,0 +1,45 @@
/*
* 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.compat.lambdynamiclights;
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity;
import dev.lambdaurora.lambdynlights.api.entity.luminance.EntityLuminance;
import dev.lambdaurora.lambdynlights.api.item.ItemLightSourceManager;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.item.ItemStack;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Range;
public final class PokemonLuminance extends CustomLuminance implements EntityLuminance {
public static final PokemonLuminance INSTANCE = new PokemonLuminance();
private PokemonLuminance() {}
@Override
public @NotNull Type type() {
return LambDynamicLightsInitializer.POKEMON_LUMINANCE;
}
@Override
public @Range(from = 0L, to = 15L) int getLuminance(
@NotNull ItemLightSourceManager itemLightSourceManager,
@NotNull Entity entity
) {
if (entity instanceof PokemonEntity pokemon) {
boolean underwater = pokemon.isUnderWater();
ItemStack item = pokemon.getShownItem();
int itemLightLevel = item.isEmpty() ? 0 : itemLightSourceManager.getLuminance(item, underwater);
int formLightLevel = extractFormLightLevel(pokemon.getForm(), underwater).orElse(0);
return Math.max(itemLightLevel, formLightLevel);
} else {
return 0;
}
}
}
@@ -0,0 +1,17 @@
/*
* 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.duck;
public interface ChannelDuck {
void cobblemon$applyLowPassFilter(float gain, float hfGain);
void cobblemon$inverseAttenuation(float rolloffFactor);
void cobblemon$clearFilters();
// void cobblemon$exponentialAttenuation(float rolloff, float refDistance, float maxDistance);
}
@@ -0,0 +1,18 @@
/*
* 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.duck;
import org.joml.Vector3f;
public interface PlayerDuck {
void setDriverInput(Vector3f driverInput);
Vector3f getDriverInput();
void setLastSentDriverInput(Vector3f driverInput);
Vector3f getLastSentDriverInput();
}
@@ -0,0 +1,69 @@
/*
* 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.mixin;
import com.cobblemon.mod.common.duck.ChannelDuck;
import com.mojang.blaze3d.audio.Channel;
import org.lwjgl.openal.AL10;
import org.lwjgl.openal.EXTEfx;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
@Mixin(Channel.class)
public abstract class ChannelMixin implements ChannelDuck {
@Shadow
private int source;
// Id of filter applied when sound is obstructed
private int cobblemon$lowPassFilterId = 0;
@Override
public void cobblemon$applyLowPassFilter(float gain, float hfGain) {
// Delete old filter if it exists
if (cobblemon$lowPassFilterId != 0) {
AL10.alSourcei(source, EXTEfx.AL_DIRECT_FILTER, 0); // Detach filter from source
EXTEfx.alDeleteFilters(cobblemon$lowPassFilterId); // Delete old filter
cobblemon$lowPassFilterId = 0;
}
// Generate a fresh filter
int filterId = EXTEfx.alGenFilters();
if (!EXTEfx.alIsFilter(filterId)) {
System.err.println("Failed to create OpenAL low-pass filter");
return;
}
EXTEfx.alFilteri(filterId, EXTEfx.AL_FILTER_TYPE, EXTEfx.AL_FILTER_LOWPASS);
EXTEfx.alFilterf(filterId, EXTEfx.AL_LOWPASS_GAIN, gain);
EXTEfx.alFilterf(filterId, EXTEfx.AL_LOWPASS_GAINHF, hfGain);
AL10.alSourcei(source, EXTEfx.AL_DIRECT_FILTER, filterId);
// Save the new filter ID
cobblemon$lowPassFilterId = filterId;
}
@Override
public void cobblemon$inverseAttenuation(float rolloffFactor) {
AL10.alSourcei(source, AL10.AL_DISTANCE_MODEL, AL10.AL_INVERSE_DISTANCE);
AL10.alSourcef(source, AL10.AL_ROLLOFF_FACTOR, rolloffFactor);
AL10.alSourcef(source, AL10.AL_REFERENCE_DISTANCE, 1.0f);
AL10.alSourcef(source, AL10.AL_MAX_DISTANCE, 0.0f);
}
@Override
public void cobblemon$clearFilters() {
AL10.alSourcei(source, EXTEfx.AL_DIRECT_FILTER, 0);
if (EXTEfx.alIsFilter(cobblemon$lowPassFilterId)) {
EXTEfx.alDeleteFilters(cobblemon$lowPassFilterId);
cobblemon$lowPassFilterId = 0;
}
}
}
@@ -0,0 +1,62 @@
/*
* 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.mixin;
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResultHolder;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.EnderpearlItem;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.Vec3;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.util.Comparator;
@Mixin(EnderpearlItem.class)
public abstract class EnderPearlItemMixin {
@Inject(method = "use", at = @At(value = "HEAD"), cancellable = true)
private void cobblemon$use(Level level, Player player, InteractionHand usedHand, CallbackInfoReturnable<InteractionResultHolder<ItemStack>> cir) {
double range = player.entityInteractionRange();
Entity closestEntity = level.getEntities(player, AABB.ofSize(player.position(), range, range, range)).stream()
.filter(entity -> isLookingAt(player, entity))
.min(Comparator.comparingDouble(entity -> entity.distanceTo(player)))
.orElse(null);
if (closestEntity instanceof PokemonEntity pokemonEntity) {
if (player.isCrouching() && pokemonEntity.getOwnerUUID() == player.getUUID()) {
cir.cancel();
}
}
}
public boolean isLookingAt(Player player, Entity other) {
float maxDistance = 10F;
float stepDistance = 0.1F;
double step = stepDistance;
Vec3 startPos = player.getEyePosition();
Vec3 direction = player.getLookAngle();
while (step <= maxDistance) {
Vec3 location = startPos.add(direction.scale(step));
step += stepDistance;
if (other.getBoundingBox().contains(location)) {
return true;
}
}
return false;
}
}
@@ -0,0 +1,62 @@
/*
* 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.mixin;
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity;
import com.cobblemon.mod.common.pokemon.ai.EntityBehaviour;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.ai.goal.AvoidEntityGoal;
import net.minecraft.world.entity.animal.Fox;
import net.minecraft.world.entity.monster.Creeper;
import net.minecraft.world.level.Level;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(Fox.class)
public class EntityFoxMixin extends Mob {
private EntityFoxMixin(net.minecraft.world.entity.EntityType<? extends Creeper> entityType, Level world) {
super(entityType, world);
}
@Inject(method = "registerGoals", at = @At(value = "TAIL"), cancellable = false)
private void cobblemon$initGoals(CallbackInfo callbackInfo) {
final Fox fox = (Fox) (Object) this;
// Pokemon Entities
this.goalSelector.addGoal(
4,
new AvoidEntityGoal<>(
fox,
PokemonEntity.class,
8.0f,
1.6,
1.4,
entity -> ((PokemonEntity)entity).getBehaviour().getEntityInteract().getAvoidedByFox() && ((PokemonEntity)entity).getBeamMode() != 1
)
);
// Players with shoulder mounted Pokemon
this.goalSelector.addGoal(
3,
new AvoidEntityGoal<>(
fox,
ServerPlayer.class,
8.0f,
1.6,
1.4,
entity -> EntityBehaviour.Companion.hasFoxFearedShoulderMount((ServerPlayer)entity)
)
);
}
}
@@ -1,39 +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.mixin;
import net.minecraft.world.entity.monster.Phantom;
import org.spongepowered.asm.mixin.Mixin;
@Mixin(targets = "net/minecraft/world/entity/monster/Phantom$PhantomSweepAttackGoal")
public class EntityPhantomMixin {
// TODO: Figure out how to access the outer class that wraps SwoopMovementGoal
// Need to find the cat mons that are near the phantom
// @Inject(method = "shouldContinue", at = @At(value = "RETURN"), cancellable = true)
// public void cobblemon$shouldContinue(CallbackInfoReturnable<Boolean> ci) {
//// var goalSelectorField = PhantomEntity.class.getClasses();// PhantomEntity.class.getFields();// .class.getDeclaredField("goalSelector");
//
//// goalSelectorField.setAccessible(true);
//// GoalSelector goalSelector = (GoalSelector) goalSelectorField.get(mobEntity);
//// final SwoopMovementGoal phantom = (SwoopMovementGoal) (Object) this;
//// if(ci.getReturnValue() == false) {
//// var result = this$0.getWorld().getEntitiesByClass(
//// PokemonEntity.class,
//// this$0.getBoundingBox().expand(16.0),
//// entity -> {
//// return ((PokemonEntity) entity).getBehaviour().getEntityInteract().getAvoidedByPhantom();
//// }
//// ).isEmpty();
////
//// ci.setReturnValue(result);
//// }
// }
}
@@ -0,0 +1,44 @@
/*
* 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.mixin;
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LightningBolt;
import net.minecraft.world.phys.AABB;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import java.util.List;
@Mixin(LightningBolt.class)
public abstract class LightningBoltMixin {
@Inject(method = "spawnFire", at = @At(value = "Head"), cancellable = true)
private void cobblemon$spawnFire(int extraIgnitions, CallbackInfo ci) {
// This prevents fire from spawning around Pokemon who otherwise should be immune to lightning and effectively absorb the hit
final LightningBolt lightningBolt = (LightningBolt) (Object) this;
List<Entity> list = lightningBolt.level().getEntities(
lightningBolt,
new AABB(lightningBolt.getX() - 2.0, lightningBolt.getY() - 2.0, lightningBolt.getZ() - 2.0, lightningBolt.getX() + 2.0, lightningBolt.getY() + 2.0, lightningBolt.getZ() + 2.0),
it -> {
if (!it.isAlive() || !(it instanceof PokemonEntity)) {
return false;
}
String abilityName = ((PokemonEntity) it).getPokemon().getAbility().getName();
return abilityName.equals("lightningrod") || abilityName.equals("voltabsorb") || abilityName.equals("motordrive");
});
if (!list.isEmpty()) {
ci.cancel();
}
}
}
@@ -8,17 +8,44 @@
package com.cobblemon.mod.common.mixin;
import com.cobblemon.mod.common.OrientationControllable;
import com.cobblemon.mod.common.api.orientation.OrientationController;
import com.cobblemon.mod.common.api.pokemon.effect.ShoulderEffectRegistry;
import com.cobblemon.mod.common.api.riding.Seat;
import com.cobblemon.mod.common.client.entity.PokemonClientDelegate;
import com.cobblemon.mod.common.client.render.MatrixWrapper;
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.level.ClipContext;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.Vec3;
import org.jetbrains.annotations.NotNull;
import org.joml.Quaternionf;
import org.joml.Vector3f;
import org.spongepowered.asm.mixin.Mixin;
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;
@Mixin(LivingEntity.class)
public abstract class LivingEntityMixin {
public abstract class LivingEntityMixin extends Entity implements OrientationControllable {
public LivingEntityMixin(EntityType<?> entityType, Level level) {
super(entityType, level);
}
@Unique
private final OrientationController cobblemon$orientationController = new OrientationController((LivingEntity) (Object) this);
public OrientationController getOrientationController() {
return cobblemon$orientationController;
}
@Inject(method = "onEffectRemoved", at = @At(value = "TAIL"))
private void cobblemon$onEffectRemoved(MobEffectInstance effect, CallbackInfo ci) {
@@ -28,4 +55,65 @@ public abstract class LivingEntityMixin {
}
}
@Override
public @NotNull HitResult pick(double hitDistance, float partialTicks, boolean hitFluids) {
Entity vehicle = this.getVehicle();
if (vehicle instanceof PokemonEntity pokemonEntity && pokemonEntity.getDelegate() instanceof PokemonClientDelegate delegate) {
int seatIndex = pokemonEntity.getPassengers().indexOf(this);
Seat seat = pokemonEntity.getSeats().get(seatIndex);
MatrixWrapper locator = delegate.getLocatorStates().get(seat.getLocator());
Vec3 locatorOffset = new Vec3(locator.getMatrix().getTranslation(new Vector3f()));
Vec3 eyePosition = cobblemon$getEyePosition(partialTicks, pokemonEntity, locatorOffset);
Vec3 viewVector = this.getViewVector(partialTicks);
Vec3 viewDistanceVector = eyePosition.add(viewVector.x * hitDistance, viewVector.y * hitDistance, viewVector.z * hitDistance);
return this.level()
.clip(
new ClipContext(
eyePosition, viewDistanceVector, ClipContext.Block.OUTLINE, hitFluids ? net.minecraft.world.level.ClipContext.Fluid.ANY : net.minecraft.world.level.ClipContext.Fluid.NONE, this
)
);
}
return super.pick(hitDistance, partialTicks, hitFluids);
}
@Unique
private Vec3 cobblemon$getEyePosition(float partialTicks, PokemonEntity pokemonEntity, Vec3 locatorOffset) {
OrientationController controller = this.getOrientationController();
float currEyeHeight = this.getEyeHeight();
Vec3 offset = locatorOffset.add(pokemonEntity.position());
if (controller.isActive() && controller.getOrientation() != null) {
Quaternionf orientation = controller.getRenderOrientation(partialTicks);
Vec3 rotatedEyeHeight = new Vec3(orientation.transform(new Vector3f(0f, currEyeHeight - (this.getBbHeight() / 2), 0f)));
offset.add(rotatedEyeHeight);
}
return offset;
}
@Inject(method = "tick", at = @At("HEAD"))
private void cobblemon$updateRenderOrientation(CallbackInfo ci) {
this.cobblemon$orientationController.tick();
}
@Override
public void absMoveTo(double x, double y, double z, float yaw, float pitch) {
if (cobblemon$orientationController.getActive()) {
this.absMoveTo(x, y, z);
this.setYRot(yaw % 360.0f);
this.setXRot(pitch % 360.0f);
this.yRotO = this.getYRot();
this.xRotO = this.getXRot();
} else {
this.absMoveTo(x, y, z);
this.absRotateTo(yaw, pitch);
}
}
}
@@ -0,0 +1,57 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.mixin;
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity;
import com.cobblemon.mod.common.pokemon.ai.EntityBehaviour;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.ai.goal.Goal;
import net.minecraft.world.entity.monster.Phantom;
import org.spongepowered.asm.mixin.Mixin;
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 org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(targets = "net.minecraft.world.entity.monster.Phantom$PhantomSweepAttackGoal")
public abstract class PhantomSweepAttackGoalMixin extends Goal {
@Unique
private Phantom phantomSelf; // Allows access to the outer class
@Inject(method = "<init>", at = @At("TAIL"))
private void onInit(Phantom phantom, CallbackInfo ci) {
this.phantomSelf = phantom;
}
@Inject(method = "canContinueToUse", at = @At("RETURN"), cancellable = true)
private void modifyCanContinueToUse(CallbackInfoReturnable<Boolean> cir) {
Phantom phantom = this.phantomSelf; // Outer class instance
if(phantom == null) return;
if (cir.getReturnValue()) {
var nearbyFearedEntities = phantom.level().getEntities(phantom, phantom.getBoundingBox().inflate(16.0),
(entity -> ((entity instanceof PokemonEntity && ((PokemonEntity) entity).getBeamMode() == 0 && ((PokemonEntity) entity).getBehaviour().getEntityInteract().getAvoidedByPhantom())
|| (entity instanceof ServerPlayer && EntityBehaviour.Companion.hasPhantomFearedShoulderMount((ServerPlayer)entity)))));
if (!nearbyFearedEntities.isEmpty()) {
nearbyFearedEntities.forEach(entity -> {
if (entity instanceof PokemonEntity) {
((PokemonEntity) entity).cry();
}
//TODO: Find a way to make shoulder mounted Pokemon cry
});
cir.setReturnValue(false);
}
}
}
}
@@ -18,6 +18,7 @@ import com.cobblemon.mod.common.api.pokemon.PokemonSpecies;
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;
import com.cobblemon.mod.common.duck.PlayerDuck;
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity;
import com.cobblemon.mod.common.pokedex.scanner.PokedexEntityData;
import com.cobblemon.mod.common.pokedex.scanner.ScannableEntity;
@@ -47,6 +48,7 @@ import net.minecraft.world.food.FoodProperties;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import org.jetbrains.annotations.Nullable;
import org.joml.Vector3f;
import org.objectweb.asm.Opcodes;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
@@ -61,7 +63,12 @@ import java.util.*;
import java.util.stream.Collectors;
@Mixin(Player.class)
public abstract class PlayerMixin extends LivingEntity implements ScannableEntity, OrientationControllable {
public abstract class PlayerMixin extends LivingEntity implements ScannableEntity, OrientationControllable, PlayerDuck {
@Unique
private Vector3f cobblemon$driverInput;
@Unique
private Vector3f cobblemon$lastSentDriverInput;
@Shadow public abstract CompoundTag getShoulderEntityLeft();
@@ -81,8 +88,8 @@ public abstract class PlayerMixin extends LivingEntity implements ScannableEntit
@Shadow @Final private static Map<Pose, EntityDimensions> POSES;
@Shadow @Final public static EntityDimensions STANDING_DIMENSIONS;
@Unique
private final OrientationController cobblemon$orientationController = new OrientationController(this);
@Shadow protected int jumpTriggerTime;
@Unique private final OrientationController cobblemon$orientationController = new OrientationController(this);
protected PlayerMixin(EntityType<? extends LivingEntity> p_20966_, Level p_20967_) {
super(p_20966_, p_20967_);
@@ -279,4 +286,25 @@ public abstract class PlayerMixin extends LivingEntity implements ScannableEntit
public OrientationController getOrientationController() {
return cobblemon$orientationController;
}
@Override
public void setDriverInput(Vector3f driverInput) {
cobblemon$driverInput = driverInput;
}
@Override
public Vector3f getDriverInput() {
return cobblemon$driverInput;
}
@Override
public void setLastSentDriverInput(Vector3f lastSentDriverInput) {
cobblemon$lastSentDriverInput = lastSentDriverInput;
}
@Override
public Vector3f getLastSentDriverInput() {
return cobblemon$lastSentDriverInput;
}
}
@@ -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.mixin;
import com.bedrockk.molang.runtime.value.DoubleValue;
import com.cobblemon.mod.common.entity.MoLangScriptingEntity;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.block.PowderSnowBlock;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(PowderSnowBlock.class)
public abstract class PowderSnowBlockMixin {
@Inject(method = "canEntityWalkOnPowderSnow", at = @At(value = "RETURN"), cancellable = true)
private static void cobblemon$canEntityWalkOnPowderSnow(Entity entity, CallbackInfoReturnable<Boolean> ci) {
if (ci.getReturnValue() == false && entity instanceof MoLangScriptingEntity) {
ci.setReturnValue(((MoLangScriptingEntity) entity).getConfig().getMap().getOrDefault("can_stand_on_powder_snow", DoubleValue.ZERO).asDouble() == 1.0);
}
}
}
@@ -12,9 +12,11 @@ import com.cobblemon.mod.common.CobblemonNetwork;
import com.cobblemon.mod.common.OrientationControllable;
import com.cobblemon.mod.common.api.net.NetworkPacket;
import com.cobblemon.mod.common.api.orientation.OrientationController;
import com.cobblemon.mod.common.duck.PlayerDuck;
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity;
import com.cobblemon.mod.common.mixin.accessor.ChunkMapAccessor;
import com.cobblemon.mod.common.mixin.accessor.TrackedEntityAccessor;
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.pokemon.update.ClientboundUpdateRidingStatePacket;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
@@ -26,6 +28,7 @@ import net.minecraft.server.level.ServerPlayer;
import net.minecraft.server.network.ServerPlayerConnection;
import net.minecraft.world.entity.Entity;
import org.joml.Matrix3f;
import org.joml.Vector3f;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
@@ -55,17 +58,20 @@ public abstract class ServerEntityMixin {
private void cobblemon$sendChanges(CallbackInfo ci) {
cobblemon$sendOrientationChanges();
cobblemon$sendRidingStateChanges();
cobblemon$sendDriverInput();
}
private void cobblemon$sendRidingStateChanges() {
if (!(this.entity instanceof PokemonEntity pokemonEntity)) return;
if (pokemonEntity.getRidingState() == null) return;
if (pokemonEntity.getRiding() == null) return;
var ridingBehaviour = pokemonEntity.getRiding();
var ridingState = pokemonEntity.getRidingState();
if (pokemonEntity.getRidingController() == null) return;
var ridingController = pokemonEntity.getRidingController();
if (ridingController.getContext() == null) return;
var context = ridingController.getContext();
var ridingBehaviour = context.getBehaviour();
var ridingState = context.getState();
var previousRidingState = pokemonEntity.getPreviousRidingState();
if (previousRidingState != null && !ridingState.shouldSync(previousRidingState)) return;
cobblemon$broadcast(new ClientboundUpdateRidingStatePacket(pokemonEntity.getId(), ridingBehaviour.getKey(), pokemonEntity.getRidingState(), null));
cobblemon$broadcast(new ClientboundUpdateRidingStatePacket(pokemonEntity.getId(), ridingBehaviour, ridingState, null));
}
private void cobblemon$sendOrientationChanges() {
@@ -82,6 +88,19 @@ public abstract class ServerEntityMixin {
cobblemon$broadcast(new ClientboundUpdateOrientationPacket(currOrientation, currActive, entity.getId()));
}
private void cobblemon$sendDriverInput() {
if (!(this.entity instanceof ServerPlayer serverPlayer)) return;
if(!(serverPlayer.getVehicle() instanceof PokemonEntity)) return;
Vector3f driverInput = ((PlayerDuck)serverPlayer).getDriverInput();
if(driverInput == null) return;
// If no change in input is detected then don't send a new packet
Vector3f lastSentDriverInput = ((PlayerDuck)serverPlayer).getLastSentDriverInput();
if (driverInput.equals(lastSentDriverInput)) return;
((PlayerDuck)serverPlayer).setLastSentDriverInput(driverInput);
cobblemon$broadcast(new ClientboundUpdateDriverInputPacket(driverInput, entity.getId()));
}
private void cobblemon$broadcast(NetworkPacket<?> packet) {
if (!(entity.level() instanceof ServerLevel level)) return;
ChunkMap chunkMap = level.getChunkSource().chunkMap;
@@ -97,5 +116,4 @@ public abstract class ServerEntityMixin {
}
}
}
@@ -0,0 +1,44 @@
/*
* 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.mixin;
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity;
import net.minecraft.core.BlockPos;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.phys.AABB;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.util.List;
import java.util.Optional;
@Mixin(ServerLevel.class)
public abstract class ServerLevelMixin {
@Inject(method = "findLightningRod", at = @At(value = "RETURN"), cancellable = true)
private void cobblemon$findLightningRod(BlockPos blockPos, CallbackInfoReturnable<Optional<BlockPos>> ci) {
final ServerLevel serverLevel = (ServerLevel) (Object) this;
if (ci.getReturnValue().isEmpty()) {
// Search for Pokemon with the ability Lightning Rod and redirect to them
AABB aABB = AABB.encapsulatingFullBlocks(blockPos, new BlockPos(blockPos.atY(serverLevel.getMaxBuildHeight()))).inflate(64.0);
List<LivingEntity> list = serverLevel.getEntitiesOfClass(LivingEntity.class, aABB, (livingEntity) -> livingEntity != null
&& livingEntity.isAlive()
&& livingEntity instanceof PokemonEntity
&& ((PokemonEntity) livingEntity).getBeamMode() == 0
&& ((PokemonEntity) livingEntity).getPokemon().getAbility().getName().equals("lightningrod"));
if (!list.isEmpty()) {
ci.setReturnValue(Optional.of((list.get(serverLevel.random.nextInt(list.size()))).blockPosition()));
}
}
}
}
@@ -10,7 +10,10 @@ package com.cobblemon.mod.common.mixin;
import com.cobblemon.mod.common.OrientationControllable;
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity;
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import com.llamalad7.mixinextras.sugar.Local;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.Entity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
@@ -43,4 +46,10 @@ public abstract class ServerPlayerMixin {
controllable.getOrientationController().setActive(false);
}
//TODO: Switch to sending out on load instead of preventing saving
@ModifyExpressionValue(method = "addAdditionalSaveData", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/Entity;hasExactlyOnePlayerPassenger()Z"))
private boolean cobblemon$cancelSavingPokemonMounts(boolean original, @Local(ordinal=0) Entity entity) {
return original && !(entity instanceof PokemonEntity);
}
}
@@ -0,0 +1,50 @@
/*
* 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.mixin;
import com.cobblemon.mod.common.block.HeartyGrainsBlock;
import com.llamalad7.mixinextras.sugar.Local;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.DoublePlantBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.DoubleBlockHalf;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.SimpleBlockFeature;
import net.minecraft.world.level.levelgen.feature.configurations.SimpleBlockConfiguration;
import org.spongepowered.asm.mixin.Debug;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(SimpleBlockFeature.class)
@Debug(export = true, print = true)
public class SimpleBlockFeatureMixin {
//this mixin inserts the logic needed to ensure that when hearty grains are of a certain age, they place with the upper block too
//similarly to what the doubleblock logic is here
@Inject(method = "place", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/state/BlockState;canSurvive(Lnet/minecraft/world/level/LevelReader;Lnet/minecraft/core/BlockPos;)Z", shift = At.Shift.AFTER), cancellable = true)
public void place(FeaturePlaceContext<SimpleBlockConfiguration> context, CallbackInfoReturnable<Boolean> cir,
@Local BlockState blockState, @Local BlockPos blockPos, @Local WorldGenLevel worldGenLevel) {
if (!(blockState.getBlock() instanceof HeartyGrainsBlock)) {
return;
}
if (blockState.getValue(HeartyGrainsBlock.Companion.getAGE()) <= HeartyGrainsBlock.AGE_AFTER_HARVEST) {
return; //block is too young to be double
}
if (!worldGenLevel.isEmptyBlock(blockPos.above())) {
cir.setReturnValue(false); //no space for the 2nd block above
return;
}
DoublePlantBlock.placeAt(worldGenLevel, blockState, blockPos, Block.UPDATE_CLIENTS);
cir.setReturnValue(true);
}
}
@@ -8,23 +8,33 @@
package com.cobblemon.mod.common.mixin;
import com.cobblemon.mod.common.api.riding.sound.RideAttenuationModel;
import com.cobblemon.mod.common.api.riding.sound.RideLoopSound;
import com.cobblemon.mod.common.client.sound.BattleMusicController;
import com.cobblemon.mod.common.duck.ChannelDuck;
import com.cobblemon.mod.common.duck.SoundEngineDuck;
import com.google.common.collect.Multimap;
import com.llamalad7.mixinextras.sugar.Local;
import com.mojang.blaze3d.audio.Channel;
import net.minecraft.client.resources.sounds.Sound;
import net.minecraft.client.resources.sounds.SoundInstance;
import net.minecraft.client.resources.sounds.TickableSoundInstance;
import net.minecraft.client.sounds.ChannelAccess;
import net.minecraft.client.sounds.SoundEngine;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.phys.Vec3;
import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
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.LocalCapture;
import java.util.Iterator;
import java.util.Map;
@Mixin(SoundEngine.class)
@@ -45,6 +55,86 @@ public abstract class SoundEngineMixin implements SoundEngineDuck {
@Shadow
public abstract boolean isActive(SoundInstance sound);
@Inject(method = "play",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/sounds/ChannelAccess$ChannelHandle;execute(Ljava/util/function/Consumer;)V"
),
cancellable = true
)
private void cobblemon$overrideChannelExecute(
SoundInstance sound,
CallbackInfo ci,
@Local(name = "h") float h,
@Local(name = "i") float i,
@Local(name = "g") float g,
@Local(name = "bl2") boolean bl2,
@Local(name = "bl3") boolean bl3,
@Local(name = "bl") boolean bl,
@Local(name = "vec3") Vec3 vec3,
@Local(name = "channelHandle") ChannelAccess.ChannelHandle handle
) {
if (!(sound instanceof RideLoopSound rideSound)) return;
if (handle == null) return;
handle.execute((channel) -> {
channel.setPitch(i);
channel.setVolume(h);
if (rideSound.getRideAttenuation() == RideAttenuationModel.LINEAR) {
channel.linearAttenuation(g);
} else if (rideSound.getRideAttenuation() == RideAttenuationModel.EXPONENTIAL){
((ChannelDuck) channel).cobblemon$inverseAttenuation(g);
} else {
channel.disableAttenuation();
}
// Apply low pass filter if the rideSound dictate that it should be muffled
if (rideSound.getShouldMuffle()) {
((ChannelDuck) channel).cobblemon$applyLowPassFilter(1.0f, rideSound.getMuffleAmount());
} else {
((ChannelDuck) channel).cobblemon$clearFilters();
}
channel.setLooping(bl2 && !bl3);
channel.setSelfPosition(vec3);
channel.setRelative(bl);
});
}
@Inject(
method = "tickNonPaused",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/sounds/ChannelAccess$ChannelHandle;execute(Ljava/util/function/Consumer;)V",
ordinal = 0
)
)
private void cobblemon$tickableSoundTick(
CallbackInfo ci,
@Local(name = "tickableSoundInstance") TickableSoundInstance instance,
@Local(name = "channelHandle", ordinal = 0) ChannelAccess.ChannelHandle handle,
@Local(name = "f", ordinal = 0) float volume,
@Local(name = "g", ordinal = 0) float pitch,
@Local(name = "vec3", ordinal = 0) Vec3 vec3
) {
if (!(instance instanceof RideLoopSound rideSound)) return;
handle.execute(channel -> {
channel.setVolume(volume);
channel.setPitch(pitch);
channel.setSelfPosition(vec3);
// Apply low pass filter if the rideSound dictate that it should be muffled
if (rideSound.getShouldMuffle()) {
((ChannelDuck) channel).cobblemon$applyLowPassFilter(1.0f, rideSound.getMuffleAmount());
} else {
((ChannelDuck) channel).cobblemon$clearFilters();
}
});
}
/** Resumes the Source belonging to the queried SoundInstance. */
private void resume(SoundInstance sound) {
ChannelAccess.ChannelHandle sourceManager = this.instanceToChannel.get(sound);
@@ -0,0 +1,35 @@
/*
* 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.mixin;
import com.bedrockk.molang.runtime.value.DoubleValue;
import com.cobblemon.mod.common.entity.MoLangScriptingEntity;
import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.SweetBerryBushBlock;
import net.minecraft.world.level.block.state.BlockState;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(SweetBerryBushBlock.class)
public abstract class SweetBerryBushBlockMixin {
@Inject(method = "entityInside", at = @At(value = "HEAD"), cancellable = true)
private void cobblemon$entityInside(BlockState state, Level level, BlockPos pos, Entity entity, CallbackInfo callbackInfo) {
if (entity instanceof MoLangScriptingEntity) {
if (((MoLangScriptingEntity) entity).getConfig().getMap().getOrDefault("immune_to_sweet_berry_bush_block", DoubleValue.ZERO).asDouble() == 1.0) {
callbackInfo.cancel();
}
}
}
}
@@ -25,9 +25,9 @@ public class TargetingConditionsMixin {
@Inject(method = "test", at = @At("HEAD"), cancellable = true)
public void test(@Nullable LivingEntity baseEntity, LivingEntity targetEntity, CallbackInfoReturnable<Boolean> ci) {
if (targetEntity instanceof ServerPlayer player) {
boolean canTargetInBattle = player.level().getGameRules().getBoolean(CobblemonGameRules.MOB_TARGET_IN_BATTLE);
if (player.level().getGameRules().getBoolean(CobblemonGameRules.MOB_TARGET_IN_BATTLE)) return;
boolean targetInBattle = Cobblemon.INSTANCE.getBattleRegistry().getBattleByParticipatingPlayer(player) != null;
if (!canTargetInBattle && targetInBattle) ci.setReturnValue(false);
if (targetInBattle) ci.setReturnValue(false);
}
}
}
@@ -8,6 +8,7 @@
package com.cobblemon.mod.common.mixin.accessor;
import net.minecraft.server.level.ServerEntity;
import net.minecraft.server.network.ServerPlayerConnection;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
@@ -18,4 +19,7 @@ import java.util.Set;
public interface TrackedEntityAccessor {
@Accessor("seenBy")
Set<ServerPlayerConnection> getSeenBy();
@Accessor("serverEntity")
ServerEntity getServerEntity();
}
@@ -15,9 +15,11 @@ import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import com.llamalad7.mixinextras.sugar.Local;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.NonNullList;
import net.minecraft.world.Containers;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.alchemy.PotionBrewing;
import net.minecraft.world.item.crafting.RecipeHolder;
import net.minecraft.world.item.crafting.RecipeManager;
@@ -27,6 +29,8 @@ import net.minecraft.world.level.block.entity.BrewingStandBlockEntity;
import org.spongepowered.asm.mixin.Mixin;
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.CallbackInfoReturnable;
import java.util.List;
import java.util.Optional;
@@ -43,7 +47,9 @@ public class BrewingStandBlockEntityMixin {
//copied from vanilla doBrew logic, but slightly tweaked to work for cobblemon, this was needed as replacing the loop was not quite possible inside doBrew
ItemStack itemStack = slots.get(3);
for(int i = 0; i < 3; ++i) {
slots.set(i, recipe.getResult().copy());
if (!slots.get(i).isEmpty()){
slots.set(i, recipe.getResult().copy());
}
}
itemStack.shrink(1);
@@ -91,4 +97,35 @@ public class BrewingStandBlockEntityMixin {
return recipeHolder.map(RecipeHolder::value).orElse(null);
}
@Inject(method = "canPlaceItem", at = @At("HEAD"), cancellable = true)
private void cobblemon$canPlaceItem(int slot, ItemStack stack, CallbackInfoReturnable<Boolean> cir) {
if (stack == null || stack.isEmpty()) return;
BrewingStandBlockEntity self = (BrewingStandBlockEntity) (Object) this;
Level level = self.getLevel();
if (level != null) {
var rm = level.getRecipeManager();
//Input slot
if (slot == 3) {
if (BrewingStandRecipe.Companion.isInput(stack, rm)) {
cir.setReturnValue(true);
return;
}
}
// Output slots
if (slot >= 0 && slot < 3) {
if (BrewingStandRecipe.Companion.isBottle(stack, rm)) {
if (self.getItem(slot).isEmpty()) {
cir.setReturnValue(true);
} else {
cir.setReturnValue(false);
}
}
}
}
}
}
@@ -31,14 +31,15 @@ public class AbstractClientPlayerMixin {
PokedexUsageContext usageContext = CobblemonClient.INSTANCE.getPokedexUsageContext();
if (usageContext.getScanningGuiOpen()) {
cir.setReturnValue(usageContext.getFovMultiplier());
}
} else {
// Only modify fov through riding if the pokedex is not open
LocalPlayer player = (LocalPlayer) (Object) this;
if (player != null && player.isPassenger() && player.getVehicle() instanceof PokemonEntity) {
PokemonEntity ride = (PokemonEntity) player.getVehicle();
LocalPlayer player = (LocalPlayer) (Object) this;
if (player != null && player.isPassenger() && player.getVehicle() instanceof PokemonEntity) {
PokemonEntity ride = (PokemonEntity) player.getVehicle();
//Return custom fov mult
cir.setReturnValue(ride.rideFovMult());
// Return custom fov mult for riding
cir.setReturnValue(ride.rideFovMult());
}
}
}
}
@@ -0,0 +1,46 @@
/*
* 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.mixin.client;
import com.cobblemon.mod.common.client.render.player.MountedPlayerRenderer;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import net.minecraft.client.model.AgeableListModel;
import net.minecraft.client.model.HumanoidModel;
import net.minecraft.client.model.Model;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
/**
* This mixin adds to the head of the renderToBuffer function and allows us to detect if it is a HumanoidModel and
* is being rendered as part of a player in the world who is riding a PokemonEntity. If so we need to obey any
* root animations that have been applied earlier.
*
* @author Hiroku
* @since May 16, 2025
*/
@Mixin(AgeableListModel.class)
public class AgeableListModelMixin {
@Inject(method = "renderToBuffer", at = @At("HEAD"))
private void cobblemon$renderToBuffer(
PoseStack poseStack,
VertexConsumer vertexConsumer,
int packedLight,
int packedOverlay,
int colour,
CallbackInfo ci
) {
Model model = (Model) (Object) this;
if (model instanceof HumanoidModel<?> && MountedPlayerRenderer.shouldApplyRootAnimation) {
MountedPlayerRenderer.INSTANCE.animateRoot(poseStack);
}
}
}
@@ -55,7 +55,7 @@ public abstract class CameraMixin {
@Inject(method = "setRotation", at = @At("HEAD"), cancellable = true)
public void cobblemon$setRotation(float f, float g, CallbackInfo ci) {
if (!(this.entity instanceof OrientationControllable controllable) || Cobblemon.config.getDisableRoll()) return;
if (!(this.entity instanceof OrientationControllable controllable)) return;
var controller = controllable.getOrientationController();
if (!controller.isActive() && controller.getOrientation() != null) {
if(this.returnTimer < 1) {
@@ -11,6 +11,7 @@ package com.cobblemon.mod.common.mixin.client;
import com.cobblemon.mod.common.CobblemonRecipeCategories;
import com.cobblemon.mod.common.item.crafting.CookingPotBookCategory;
import com.cobblemon.mod.common.item.crafting.CookingPotRecipe;
import com.cobblemon.mod.common.item.crafting.CookingPotRecipeBase;
import com.cobblemon.mod.common.item.crafting.CookingPotShapelessRecipe;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
@@ -48,10 +49,8 @@ public abstract class ClientRecipeBookMixin {
@Inject(method = "getCategory", at = @At(value = "HEAD"), cancellable = true)
private static void addCustomCategory(RecipeHolder<?> recipe, CallbackInfoReturnable<RecipeBookCategories> cir) {
Recipe<?> recipe2 = recipe.value();
if (recipe2 instanceof CookingPotRecipe || recipe2 instanceof CookingPotShapelessRecipe) {
CookingPotBookCategory category = recipe2 instanceof CookingPotRecipe
? ((CookingPotRecipe) recipe2).getCategory()
: ((CookingPotShapelessRecipe) recipe2).category();
if (recipe2 instanceof CookingPotRecipeBase) {
CookingPotBookCategory category = ((CookingPotRecipeBase) recipe2).getCategory();
RecipeBookCategories var7;
switch (category) {
case MISC -> var7 = CobblemonRecipeCategories.COOKING_POT_MISC.toVanillaCategory();
@@ -9,22 +9,21 @@
package com.cobblemon.mod.common.mixin.client;
import com.cobblemon.mod.common.client.gui.ScrollingWidget;
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import net.minecraft.client.gui.components.AbstractSelectionList;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
import org.spongepowered.asm.mixin.injection.At;
@Mixin(AbstractSelectionList.class)
public abstract class EntryListWidgetMixin {
@SuppressWarnings("ConstantValue")
@ModifyConstant(method = "getEntryAtPosition", constant = @Constant(intValue = 4))
public int cobblemon$adjustOnlyIfNecessary(int input) {
@ModifyExpressionValue(method = "getEntryAtPosition", at = @At(value = "CONSTANT", args = {"intValue=4"}))
public int cobblemon$adjustOnlyIfNecessary(int original) {
if(ScrollingWidget.class.isInstance(this)) {
return 0;
}
return input;
return original;
}
}
@@ -8,6 +8,7 @@
package com.cobblemon.mod.common.mixin.client;
import com.cobblemon.mod.common.OrientationControllable;
import com.cobblemon.mod.common.client.render.player.MountedPlayerRenderer;
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity;
import net.minecraft.client.model.HumanoidModel;
@@ -18,20 +19,17 @@ import net.minecraft.world.entity.LivingEntity;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
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.callback.CallbackInfo;
import java.util.HashMap;
@Mixin(HumanoidModel.class)
public class HumanoidModelMixin {
@Unique HashMap<String, ModelPart> relevantPartsByName = new HashMap<>();
@Shadow @Final
public ModelPart head;
@Shadow @Final
public ModelPart hat;
@Shadow @Final
public ModelPart rightArm;
@Shadow @Final
public ModelPart leftArm;
@@ -39,6 +37,8 @@ public class HumanoidModelMixin {
public ModelPart rightLeg;
@Shadow @Final
public ModelPart leftLeg;
@Shadow @Final
public ModelPart body;
@Inject(method = "setupAnim*", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/geom/ModelPart;copyFrom(Lnet/minecraft/client/model/geom/ModelPart;)V", shift = At.Shift.BEFORE))
public void cobblemon$animateRiders(
@@ -50,19 +50,23 @@ public class HumanoidModelMixin {
float headPitch,
CallbackInfo ci
) {
if (relevantPartsByName.isEmpty()) {
relevantPartsByName.put("arm_left", leftArm);
relevantPartsByName.put("arm_right", rightArm);
relevantPartsByName.put("leg_left", leftLeg);
relevantPartsByName.put("leg_right", rightLeg);
relevantPartsByName.put("head", head);
MountedPlayerRenderer.shouldApplyRootAnimation = false;
if (MountedPlayerRenderer.relevantPartsByName.size() <= 1) {
MountedPlayerRenderer.relevantPartsByName.put("arm_left", leftArm);
MountedPlayerRenderer.relevantPartsByName.put("arm_right", rightArm);
MountedPlayerRenderer.relevantPartsByName.put("leg_left", leftLeg);
MountedPlayerRenderer.relevantPartsByName.put("leg_right", rightLeg);
MountedPlayerRenderer.relevantPartsByName.put("head", head);
MountedPlayerRenderer.relevantPartsByName.put("hat", hat);
MountedPlayerRenderer.relevantPartsByName.put("torso", body);
}
Entity vehicle = entity.getVehicle();
if (vehicle instanceof PokemonEntity pokemonEntity && entity instanceof AbstractClientPlayer) {
var shouldRotatePlayerHead = pokemonEntity.ifRidingAvailableSupply(false, (behaviour, settings, state) -> {
return behaviour.shouldRotatePlayerHead(settings, state, pokemonEntity);
});
if (vehicle instanceof PokemonEntity pokemonEntity && entity instanceof OrientationControllable) {
var shouldRotatePlayerHead = pokemonEntity.ifRidingAvailableSupply(false, (behaviour, settings, state) ->
behaviour.shouldRotateRiderHead(settings, state, pokemonEntity)
);
if (!shouldRotatePlayerHead) {
netHeadYaw = 0f;
@@ -73,7 +77,10 @@ public class HumanoidModelMixin {
}
}
MountedPlayerRenderer.INSTANCE.animate(pokemonEntity, (AbstractClientPlayer) entity, relevantPartsByName, netHeadYaw, headPitch, ageInTicks, limbSwing, limbSwingAmount);
if (!(entity instanceof AbstractClientPlayer player)) return;
MountedPlayerRenderer.shouldApplyRootAnimation = true;
MountedPlayerRenderer.INSTANCE.animate((HumanoidModel<AbstractClientPlayer>)(Object)this, pokemonEntity, player, netHeadYaw, headPitch, ageInTicks, limbSwing, limbSwingAmount);
}
}
}
@@ -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.mixin.client;
import com.cobblemon.mod.common.client.render.entity.MountedLivingEntityRenderer;
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity;
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.model.EntityModel;
import net.minecraft.client.renderer.entity.LivingEntityRenderer;
import net.minecraft.world.entity.LivingEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(LivingEntityRenderer.class)
public class LivingEntityRendererMixin<T extends LivingEntity, M extends EntityModel<T>> {
@Inject(
method = "setupRotations",
at = @At("HEAD")
)
private void cobblemon$modifyRoll(LivingEntity entity, PoseStack poseStack, float bob, float yBodyRot, float partialTick, float scale, CallbackInfo ci) {
if (entity.isPassenger()) {
var vehicle = entity.getVehicle();
if (vehicle instanceof PokemonEntity pokemonEntity) {
MountedLivingEntityRenderer.INSTANCE.render(entity, pokemonEntity, poseStack, bob, yBodyRot, partialTick, scale);
}
}
}
}
@@ -9,6 +9,7 @@
package com.cobblemon.mod.common.mixin.client;
import com.cobblemon.mod.common.CobblemonNetwork;
import com.cobblemon.mod.common.DoubleJump;
import com.cobblemon.mod.common.OrientationControllable;
import com.cobblemon.mod.common.api.orientation.OrientationController;
import com.cobblemon.mod.common.api.riding.Seat;
@@ -17,17 +18,21 @@ import com.cobblemon.mod.common.client.render.MatrixWrapper;
import com.cobblemon.mod.common.client.render.models.blockbench.FloatingState;
import com.cobblemon.mod.common.client.render.models.blockbench.PosableModel;
import com.cobblemon.mod.common.client.render.models.blockbench.repository.VaryingModelRepository;
import com.cobblemon.mod.common.duck.PlayerDuck;
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity;
import com.cobblemon.mod.common.net.messages.server.orientation.ServerboundUpdateOrientationPacket;
import com.cobblemon.mod.common.net.messages.server.riding.ServerboundUpdateDriverInputPacket;
import com.mojang.authlib.GameProfile;
import net.minecraft.client.CameraType;
import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.player.AbstractClientPlayer;
import net.minecraft.client.player.Input;
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.ClipContext;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.HitResult;
@@ -46,13 +51,23 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.util.Map;
@Mixin(LocalPlayer.class)
public abstract class LocalPlayerMixin extends AbstractClientPlayer implements OrientationControllable{
public abstract class LocalPlayerMixin extends AbstractClientPlayer implements OrientationControllable, DoubleJump {
@Unique Matrix3f cobblemon$lastOrientation;
@Unique boolean cobblemon$isDoubleJumping = false;
@Shadow
private float jumpRidingScale;
@Shadow public Input input;
@Shadow private int autoJumpTime;
@Unique private int cobblemon$survivalJumpTriggerTime;
@Unique private boolean cobblemon$isJumping;
public LocalPlayerMixin(ClientLevel clientLevel, GameProfile gameProfile) {
super(clientLevel, gameProfile);
}
@@ -83,6 +98,23 @@ public abstract class LocalPlayerMixin extends AbstractClientPlayer implements O
controllable.getOrientationController().setActive(shouldUseCustomOrientation);
}
@Inject(method = "rideTick", at = @At("HEAD"))
private void cobblemon$updateDriverInputRideTick(CallbackInfo ci) {
if (Minecraft.getInstance().player != (Object)this) return;
if (!(this.getVehicle() instanceof PokemonEntity pokemonEntity)) return;
// Gather driver Input
float vertInput = this.jumping ? 1.0f : (((Player)this).isShiftKeyDown() ? -1.0f : 0.0f);
Vector3f driverInput = new Vector3f(Math.signum(this.xxa), vertInput, Math.signum(this.zza));
// Check if player input has changed. If it has then update the last sent and send it
Vector3f lastSentDriverInput = ((PlayerDuck)this).getLastSentDriverInput();
if (driverInput.equals(lastSentDriverInput)) return;
((PlayerDuck)this).setLastSentDriverInput(driverInput);
CobblemonNetwork.INSTANCE.sendToServer(new ServerboundUpdateDriverInputPacket(driverInput));
}
@Unique
private boolean cobblemon$shouldUseCustomOrientation(LocalPlayer player) {
var playerVehicle = player.getVehicle();
@@ -115,6 +147,43 @@ public abstract class LocalPlayerMixin extends AbstractClientPlayer implements O
}
}
@Inject(method = "aiStep", at = @At("HEAD"))
private void cobblemon$aiStep(CallbackInfo ci) {
this.cobblemon$isDoubleJumping = false;
this.cobblemon$isJumping = this.input.jumping;
}
@Inject(method = "aiStep", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/player/LocalPlayer;isSprinting()Z", shift = At.Shift.BEFORE))
private void cobblemon$updateDoubleJumping(CallbackInfo ci) {
if (!this.cobblemon$isJumping && this.input.jumping && this.autoJumpTime <= 0 && !this.isSwimming()) {
if (this.cobblemon$survivalJumpTriggerTime != 0) {
this.cobblemon$isDoubleJumping = true;
this.cobblemon$survivalJumpTriggerTime = 0;
}
else {
this.cobblemon$survivalJumpTriggerTime = 7;
}
}
else if (this.cobblemon$survivalJumpTriggerTime > 0) {
this.cobblemon$survivalJumpTriggerTime--;
}
}
@Override
public boolean isDoubleJumping() {
return this.cobblemon$isDoubleJumping;
}
@Inject(method = "isHandsBusy", at = @At("HEAD"), cancellable = true)
private void cobblemon$isHandsBusy(CallbackInfoReturnable<Boolean> cir) {
Entity vehicle = this.getVehicle();
if (vehicle instanceof PokemonEntity pokemonEntity) {
int seatIndex = pokemonEntity.getPassengers().indexOf(this);
Seat seat = pokemonEntity.getSeats().get(seatIndex);
cir.setReturnValue(seat.getHandsBusy());
}
}
@Override
public HitResult pick(double hitDistance, float partialTicks, boolean hitFluids) {
Entity vehicle = this.getVehicle();
@@ -127,7 +196,7 @@ public abstract class LocalPlayerMixin extends AbstractClientPlayer implements O
return super.pick(hitDistance, partialTicks, hitFluids);
}
Vec3 locatorOffset = new Vec3(locator.getMatrix().getTranslation(new Vector3f()));
Vec3 locatorOffset = locator != null ? new Vec3(locator.getMatrix().getTranslation(new Vector3f())) : Vec3.ZERO;
OrientationController controller = this.getOrientationController();
@@ -8,6 +8,7 @@
package com.cobblemon.mod.common.mixin.client;
import com.cobblemon.mod.common.Cobblemon;
import com.cobblemon.mod.common.OrientationControllable;
import com.cobblemon.mod.common.client.CobblemonClient;
import com.cobblemon.mod.common.client.keybind.keybinds.PartySendBinding;
@@ -129,6 +130,11 @@ public abstract class MouseHandlerMixin {
return false;
}
// Clamp player rotation if riding and the vehicle demands it
if (player.isPassenger() && player.getVehicle() instanceof PokemonEntity vehicle) {
vehicle.clampPassengerRotation(player);
}
if (!(player instanceof OrientationControllable controllable)) return true;
if (!controllable.getOrientationController().isActive()) {
@@ -140,32 +146,30 @@ public abstract class MouseHandlerMixin {
return true;
}
//Send mouse input to be interpreted into rotation
//deltas by the ride controller
// Send mouse input to be interpreted into rotation
// deltas by the ride controller
Vec3 angVecMouse = cobblemon$getRideMouseRotation(cursorDeltaX, cursorDeltaY, movementTime);
//Perform Rotation using mouse influenced rotation deltas.
// Perform Rotation using mouse influenced rotation deltas.
controllable.getOrientationController().rotate(
(float) angVecMouse.x,
(float) angVecMouse.y,
(float) angVecMouse.z
);
//Gather and apply the current rotation deltas
// Gather and apply the current rotation deltas
var angRot = cobblemon$getAngularVelocity(movementTime);
//Apply smoothing if requested by the controller.
//This Might be best if done by the controller itself?
if(cobblemon$shouldUseAngVelSmoothing())
{
// Apply smoothing if requested by the controller.
// This Might be best if done by the controller itself?
if(cobblemon$shouldUseAngVelSmoothing()) {
var yaw = yawSmoother.getNewDeltaValue(angRot.x * 0.5f, d);
var pitch = pitchSmoother.getNewDeltaValue(angRot.y * 0.5f, d);
var roll = rollSmoother.getNewDeltaValue(angRot.z * 0.5f, d);
controllable.getOrientationController().rotate((float) yaw, (float) pitch, (float) roll);
}
//Otherwise simply apply the smoothing
else
{
// Otherwise simply apply the smoothing
else {
controllable.getOrientationController().rotate((float) (angRot.x * 10 * d), (float) (angRot.y * 10 * d), (float) (angRot.z * 10 * d));
}
return false;
@@ -210,6 +214,18 @@ public abstract class MouseHandlerMixin {
if (vehicle == null) return Vec3.ZERO;
if (!(vehicle instanceof PokemonEntity pokemonEntity)) return Vec3.ZERO;
var invertYaw = Cobblemon.config.getInvertYaw();
var invertPitch = Cobblemon.config.getInvertPitch();
var xValue = mouseX * Cobblemon.config.getXAxisSensitivity();
var yValue = mouseY * Cobblemon.config.getYAxisSensitivity();
var swapXAndY = Cobblemon.config.getSwapXAndYAxes();
var yaw = (swapXAndY ? yValue : xValue) * (invertYaw? -1.0f : 1.0f);
var pitch = (swapXAndY ? xValue : yValue) * (invertPitch? -1.0f : 1.0f);
var sensitivity = cobblemon$getRidingSensitivity();
return pokemonEntity.ifRidingAvailableSupply(Vec3.ZERO, (behaviour, settings, state) -> {
return behaviour.rotationOnMouseXY(
@@ -217,8 +233,8 @@ public abstract class MouseHandlerMixin {
state,
pokemonEntity,
player,
mouseY,
mouseX,
pitch,
yaw,
yMouseSmoother,
xMouseSmoother,
sensitivity,
@@ -9,20 +9,16 @@
package com.cobblemon.mod.common.mixin.client;
import com.cobblemon.mod.common.client.render.ClientPlayerIcon;
import com.cobblemon.mod.common.client.render.player.MountedPlayerRenderer;
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity;
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.model.EntityModel;
import net.minecraft.client.model.PlayerModel;
import net.minecraft.client.player.AbstractClientPlayer;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.client.renderer.entity.LivingEntityRenderer;
import net.minecraft.client.renderer.entity.player.PlayerRenderer;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
@@ -35,9 +31,9 @@ public abstract class PlayerRendererMixin extends LivingEntityRenderer<AbstractC
super(context, model, shadowRadius);
}
@Inject(method = "render(Lnet/minecraft/world/entity/LivingEntity;FFLcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;I)V", at = @At(value = "TAIL"))
public void cobblemon$clientPlayerIcon(LivingEntity entity, float entityYaw, float partialTicks, PoseStack poseStack, MultiBufferSource buffer, int packedLight, CallbackInfo ci) {
ClientPlayerIcon.Companion.onRenderPlayer((Player) entity);
@Inject(method = "render", at = @At(value = "TAIL"))
public void renderPlayer(AbstractClientPlayer player, float f, float g, PoseStack poseStack, MultiBufferSource multiBufferSource, int i, CallbackInfo ci) {
ClientPlayerIcon.Companion.onRenderPlayer(player);
}
@WrapOperation(method = "getRenderOffset(Lnet/minecraft/client/player/AbstractClientPlayer;F)Lnet/minecraft/world/phys/Vec3;", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/player/AbstractClientPlayer;isCrouching()Z"))
@@ -55,17 +51,4 @@ public abstract class PlayerRendererMixin extends LivingEntityRenderer<AbstractC
playerModel.crouching = false;
}
}
@Inject(
method = "setupRotations(Lnet/minecraft/client/player/AbstractClientPlayer;Lcom/mojang/blaze3d/vertex/PoseStack;FFFF)V",
at = @At("HEAD")
)
private void cobblemon$modifyRoll(AbstractClientPlayer player, PoseStack poseStack, float a, float b, float partialTicks, float i, CallbackInfo ci) {
if (player.isPassenger()) {
var vehicle = player.getVehicle();
if (vehicle instanceof PokemonEntity entity) {
MountedPlayerRenderer.INSTANCE.render(player, entity, poseStack, a, b, partialTicks, i);
}
}
}
}
@@ -9,12 +9,18 @@
package com.cobblemon.mod.common.mixin.entity;
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity;
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.Level;
import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
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;
@Mixin(Entity.class)
@@ -29,4 +35,27 @@ public abstract class EntityMixin {
}
}
@WrapOperation(
method = "collide(Lnet/minecraft/world/phys/Vec3;)Lnet/minecraft/world/phys/Vec3;",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/world/entity/Entity;onGround()Z"
)
)
public boolean cobblemon$forceOnGroundForStepUp(Entity entity, Operation<Boolean> original) {
if (entity instanceof PokemonEntity && entity.hasControllingPassenger()) {
BlockPos below = entity.blockPosition().below();
Level level = entity.level();
var blockStateBelow = level.getBlockState(below);
boolean isAirOrLiquid = blockStateBelow.isAir() || !blockStateBelow.getFluidState().isEmpty();
boolean canSupportEntity = blockStateBelow.isFaceSturdy(level, below, Direction.UP);
boolean standingOnSolid = canSupportEntity && !isAirOrLiquid;
if (standingOnSolid) {
return true;
}
}
return original.call(entity);
}
}
@@ -75,7 +75,8 @@ 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.AdvancementHandler
import com.cobblemon.mod.common.events.FlowHandler
import com.cobblemon.mod.common.events.EntityCallbackHandler
import com.cobblemon.mod.common.events.CallbackHandler
import com.cobblemon.mod.common.events.PokedexHandler
import com.cobblemon.mod.common.events.ServerTickHandler
import com.cobblemon.mod.common.net.messages.client.settings.ServerSettingsPacket
@@ -312,7 +313,8 @@ object Cobblemon {
CobblemonEvents.POKEMON_PROPERTY_INITIALISED.emit(Unit)
FlowHandler.setup()
CallbackHandler.setup()
EntityCallbackHandler.setup()
ifDedicatedServer {
isDedicatedServer = true
@@ -19,6 +19,7 @@ object CobblemonActivities {
val POKEMON_GROW_CROP = register(Activity("pokemon_grow_crop"))
val POKEMON_SLEEP_ON_TRAINER_BED = register(Activity("pokemon_sleep_on_trainer_bed"))
val POKEMON_HERD = register(Activity("pokemon_herd"))
val POKEMON_POLLINATION = register(Activity("pokemon_pollination"))
fun register(activity: Activity): Activity {
activities.add(activity)
@@ -78,6 +78,9 @@ object CobblemonBehaviours : JsonDataRegistry<CobblemonBehaviour> {
*/
val autoPokemonBehaviours = mutableListOf<CobblemonBehaviour>()
/** See [autoPokemonBehaviours] but think npc instead of pokemon*/
val autoNPCBehaviours = mutableListOf<CobblemonBehaviour>()
val behaviours = mutableMapOf<ResourceLocation, CobblemonBehaviour>()
override fun sync(player: ServerPlayer) {
@@ -86,6 +89,7 @@ object CobblemonBehaviours : JsonDataRegistry<CobblemonBehaviour> {
override fun reload(manager: ResourceManager) {
autoPokemonBehaviours.clear()
autoNPCBehaviours.clear()
val data = mutableMapOf<ResourceLocation, CobblemonBehaviour>()
manager.listResources(resourcePath) { path -> path.endsWith(JSON_EXTENSION) }.forEach { (identifier, resource) ->
resource.open().use { stream ->
@@ -94,6 +98,8 @@ object CobblemonBehaviours : JsonDataRegistry<CobblemonBehaviour> {
val behaviour = parse(reader, resolvedIdentifier)
if ("pokemon/auto/" in identifier.path) {
autoPokemonBehaviours.add(behaviour)
} else if ("npc/auto/" in identifier.path) {
autoNPCBehaviours.add(behaviour)
}
data[resolvedIdentifier] = behaviour
}
@@ -8,7 +8,6 @@
package com.cobblemon.mod.common
import com.cobblemon.mod.common.block.entity.PokeCakeBlockEntity
import com.cobblemon.mod.common.block.entity.BerryBlockEntity
import com.cobblemon.mod.common.block.entity.HealingMachineBlockEntity
import com.cobblemon.mod.common.block.entity.PCBlockEntity
@@ -88,35 +87,23 @@ object CobblemonBlockEntities : PlatformRegistry<Registry<BlockEntityType<*>>, R
BlockEntityType.Builder.of(::DisplayCaseBlockEntity, CobblemonBlocks.DISPLAY_CASE).build(null)
)
@JvmField
val INCENSE_SWEET: BlockEntityType<SweetIncenseBlockEntity> = this.create("incense_sweet",
BlockEntityType.Builder.of(::SweetIncenseBlockEntity, CobblemonBlocks.INCENSE_SWEET).build(null)
)
// TODO after 1.7
// @JvmField
// val INCENSE_SWEET: BlockEntityType<SweetIncenseBlockEntity> = this.create("incense_sweet",
// BlockEntityType.Builder.of(::SweetIncenseBlockEntity, CobblemonBlocks.INCENSE_SWEET).build(null)
// )
@JvmField
val CAMPFIRE: BlockEntityType<CampfireBlockEntity> = this.create("campfire_pot",
BlockEntityType.Builder.of(::CampfireBlockEntity, CobblemonBlocks.CAMPFIRE).build(null)
BlockEntityType.Builder.of(::CampfireBlockEntity,
CobblemonBlocks.CAMPFIRE,
CobblemonBlocks.SOUL_CAMPFIRE
).build(null)
)
/*@JvmField
val LURE_CAKE: BlockEntityType<LureCakeBlockEntity> =
BlockEntityType.Builder.of({ pos, state -> LureCakeBlockEntity(pos, state) },
CobblemonBlocks.LURE_CAKE
).build(null)*/
@JvmField
val LURE_CAKE: BlockEntityType<LureCakeBlockEntity> = this.create(
"lure_cake",
BlockEntityType.Builder.of(::LureCakeBlockEntity, CobblemonBlocks.LURE_CAKE).build(null)
)
@JvmField
val POKE_CAKE: BlockEntityType<PokeCakeBlockEntity> = this.create(
"poke_cake",
BlockEntityType.Builder.of(::PokeCakeBlockEntity, CobblemonBlocks.POKE_CAKE).build(null)
)
@JvmField
val CANDLE_POKE_CAKE: BlockEntityType<CandlePokeCakeBlockEntity> = this.create(
"candle_poke_cake",
BlockEntityType.Builder.of(::CandlePokeCakeBlockEntity, CobblemonBlocks.CANDLE_POKE_CAKE).build(null)
val POKE_SNACK: BlockEntityType<PokeSnackBlockEntity> = this.create(
"poke_snack",
BlockEntityType.Builder.of(::PokeSnackBlockEntity, CobblemonBlocks.POKE_SNACK, CobblemonBlocks.POKE_CAKE).build(null)
)
}
@@ -40,6 +40,7 @@ import net.minecraft.world.level.block.*
import net.minecraft.world.level.block.state.BlockBehaviour
import net.minecraft.world.level.block.state.BlockState
import net.minecraft.world.level.block.state.properties.BlockSetType
import net.minecraft.world.level.block.state.properties.BlockStateProperties
import net.minecraft.world.level.block.state.properties.BlockStateProperties.LIT
import net.minecraft.world.level.block.state.properties.NoteBlockInstrument
import net.minecraft.world.level.block.state.properties.WoodType
@@ -127,7 +128,7 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, ResourceKey<Registry<
@JvmField
val APRICORN_FENCE = this.create("apricorn_fence", FenceBlock(BlockBehaviour.Properties.of().mapColor(APRICORN_PLANKS.defaultMapColor()).instrument(NoteBlockInstrument.BASS).strength(2.0f, 3.0f).sound(SoundType.WOOD)))
@JvmField
val APRICORN_FENCE_GATE = this.create("apricorn_fence_gate", FenceGateBlock(APRICORN_WOOD_TYPE, BlockBehaviour.Properties.of().mapColor(APRICORN_PLANKS.defaultMapColor()).strength(2.0f, 3.0f).sound(SoundType.WOOD)))
val APRICORN_FENCE_GATE = this.create("apricorn_fence_gate", FenceGateBlock(APRICORN_WOOD_TYPE, BlockBehaviour.Properties.of().mapColor(APRICORN_PLANKS.defaultMapColor()).strength(2.0f, 3.0f).sound(SoundType.WOOD).ignitedByLava().forceSolidOn()))
@JvmField
val APRICORN_BUTTON = this.create("apricorn_button", BlocksInvoker.createWoodenButtonBlock(APRICORN_BLOCK_SET_TYPE))
@JvmField
@@ -204,7 +205,7 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, ResourceKey<Registry<
@JvmField
val SACCHARINE_FENCE = this.create("saccharine_fence", FenceBlock(BlockBehaviour.Properties.of().mapColor(SACCHARINE_PLANKS.defaultMapColor()).instrument(NoteBlockInstrument.BASS).strength(2.0f, 3.0f).sound(SoundType.WOOD)))
@JvmField
val SACCHARINE_FENCE_GATE = this.create("saccharine_fence_gate", FenceGateBlock(SACCHARINE_WOOD_TYPE, BlockBehaviour.Properties.of().mapColor(SACCHARINE_PLANKS.defaultMapColor()).instrument(NoteBlockInstrument.BASS).strength(2.0f, 3.0f).sound(SoundType.WOOD)))
val SACCHARINE_FENCE_GATE = this.create("saccharine_fence_gate", FenceGateBlock(SACCHARINE_WOOD_TYPE, BlockBehaviour.Properties.of().mapColor(SACCHARINE_PLANKS.defaultMapColor()).instrument(NoteBlockInstrument.BASS).strength(2.0f, 3.0f).sound(SoundType.WOOD).ignitedByLava().forceSolidOn()))
@JvmField
val SACCHARINE_BUTTON = this.create("saccharine_button", BlocksInvoker.createWoodenButtonBlock(BlockSetType.OAK))
@JvmField
@@ -230,8 +231,10 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, ResourceKey<Registry<
@JvmField
val MEDICINAL_LEEK = this.create("medicinal_leek", MedicinalLeekBlock(BlockBehaviour.Properties.of().pushReaction(PushReaction.DESTROY).ignitedByLava().mapColor(MapColor.CRIMSON_NYLIUM).noCollission().randomTicks().instabreak().sound(CobblemonSounds.MEDICINAL_LEEK_SOUNDS)))
@JvmField
val BUGWORT = this.create("bugwort", BugwortBlock(BlockBehaviour.Properties.of().pushReaction(PushReaction.DESTROY).ignitedByLava().mapColor(MapColor.COLOR_PURPLE).noCollission().randomTicks().instabreak().sound(CobblemonSounds.MEDICINAL_LEEK_SOUNDS)))
// TODO after 1.7
// @JvmField
// val BUGWORT = this.create("bugwort", BugwortBlock(BlockBehaviour.Properties.of().pushReaction(PushReaction.DESTROY).ignitedByLava().mapColor(MapColor.COLOR_PURPLE).noCollission().randomTicks().instabreak().sound(CobblemonSounds.MEDICINAL_LEEK_SOUNDS)))
@JvmField
val ENERGY_ROOT = this.create("energy_root", EnergyRootBlock(BlockBehaviour.Properties.of().pushReaction(PushReaction.DESTROY).ignitedByLava().mapColor(MapColor.DIRT).noCollission().randomTicks().instabreak().sound(CobblemonSounds.ENERGY_ROOT_SOUNDS)))
@JvmField
@@ -240,11 +243,9 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, ResourceKey<Registry<
val REVIVAL_HERB = this.create("revival_herb", RevivalHerbBlock(BlockBehaviour.Properties.of().pushReaction(PushReaction.DESTROY).mapColor(MapColor.PLANT).ignitedByLava().noCollission().instabreak().sound(CobblemonSounds.REVIVAL_HERB_SOUNDS)))
@JvmField
val LURE_CAKE = this.create("lure_cake", LureCakeBlock(BlockBehaviour.Properties.of().forceSolidOn().strength(0.5F).sound(SoundType.WOOL).pushReaction(PushReaction.DESTROY)))
val POKE_CAKE = this.create("poke_cake", PokeSnackBlock(BlockBehaviour.Properties.of().forceSolidOn().strength(0.5F).sound(SoundType.WOOL).pushReaction(PushReaction.DESTROY).lightLevel { if (it.getValue(LIT)) 3 else 0 }, false))
@JvmField
val POKE_CAKE = this.create("poke_cake", PokeCakeBlock(BlockBehaviour.Properties.ofFullCopy(LURE_CAKE)))
@JvmField
val CANDLE_POKE_CAKE = this.create("candle_poke_cake", CandlePokeCakeBlock(BlockBehaviour.Properties.ofFullCopy(LURE_CAKE).lightLevel { blockState -> if (blockState.getValue(LIT) == true) 3 else 0 }))
val POKE_SNACK = this.create("poke_snack", PokeSnackBlock(BlockBehaviour.Properties.of().forceSolidOn().strength(0.5F).sound(SoundType.WOOL).pushReaction(PushReaction.DESTROY).lightLevel { if (it.getValue(LIT)) 3 else 0 }, true))
@JvmField
val TUMBLESTONE_CLUSTER = tumblestoneBlock("tumblestone_cluster", GrowableStoneBlock.STAGE_3, 7, 3, null)
@@ -449,7 +450,10 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, ResourceKey<Registry<
)
@JvmField
val CAMPFIRE = create("campfire", CampfireBlock(BlockBehaviour.Properties.of().sound(SoundType.WOOD).noOcclusion().pushReaction(PushReaction.BLOCK).mapColor(MapColor.PODZOL).strength(2.0F).lightLevel { if ((it.getValue(CampfireBlock.SOUL) as Boolean)) 9 else 14 }))
val CAMPFIRE = create("campfire", CampfireBlock(BlockBehaviour.Properties.of().sound(SoundType.WOOD).noOcclusion().pushReaction(PushReaction.BLOCK).mapColor(MapColor.PODZOL).strength(2.0F).lightLevel{14}, false))
@JvmField
val SOUL_CAMPFIRE = create("soul_campfire", CampfireBlock(BlockBehaviour.Properties.of().sound(SoundType.WOOD).noOcclusion().pushReaction(PushReaction.BLOCK).mapColor(MapColor.PODZOL).strength(2.0F).lightLevel{9}, true))
@JvmField
val RELIC_COIN_POUCH = create("relic_coin_pouch", CoinPouchBlock(BlockBehaviour.Properties.of().sound(CobblemonSounds.RELIC_COIN_POUCH_SOUNDS).pushReaction(PushReaction.DESTROY).noOcclusion(), true))
@@ -492,8 +496,9 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, ResourceKey<Registry<
@JvmField
val DISPLAY_CASE = create("display_case", DisplayCaseBlock(BlockBehaviour.Properties.of().sound(CobblemonSounds.DISPLAY_CASE_SOUNDS).noOcclusion().pushReaction(PushReaction.BLOCK).mapColor(MapColor.STONE).strength(0.3F).requiresCorrectToolForDrops()))
@JvmField
val INCENSE_SWEET = create("incense_sweet", SweetIncenseBlock(BlockBehaviour.Properties.of().sound(CobblemonSounds.DISPLAY_CASE_SOUNDS).noOcclusion().pushReaction(PushReaction.BLOCK).mapColor(MapColor.STONE).strength(0.3f)))
// TODO after 1.7
// @JvmField
// val INCENSE_SWEET = create("incense_sweet", SweetIncenseBlock(BlockBehaviour.Properties.of().sound(CobblemonSounds.DISPLAY_CASE_SOUNDS).noOcclusion().pushReaction(PushReaction.BLOCK).mapColor(MapColor.STONE).strength(0.3f)))
@JvmField
val PASTURE = create("pasture", PastureBlock(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_BROWN).sound(SoundType.WOOD).strength(2F).noOcclusion().pushReaction(PushReaction.BLOCK).lightLevel { if ((it.getValue(PastureBlock.ON) as Boolean) && (it.getValue(PastureBlock.PART) == PastureBlock.PasturePart.TOP)) 13 else 0 }))
@@ -517,7 +522,7 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, ResourceKey<Registry<
@JvmField
val POTTED_PEP_UP_FLOWER = this.create("potted_pep_up_flower", BlocksInvoker.createFlowerPotBlock(PEP_UP_FLOWER))
@JvmField
val HEARTY_GRAINS = this.create("hearty_grains", HeartyGrainsBlock(BlockBehaviour.Properties.of().pushReaction(PushReaction.DESTROY).ignitedByLava().mapColor(MapColor.PLANT).noCollission().randomTicks().instabreak().sound(CobblemonSounds.VIVICHOKE_SOUNDS)))
val HEARTY_GRAINS = this.create("hearty_grains", HeartyGrainsBlock(BlockBehaviour.Properties.of().pushReaction(PushReaction.DESTROY).ignitedByLava().mapColor(MapColor.PLANT).noCollission().randomTicks().instabreak()))
@JvmField
val GALARICA_NUT_BUSH = this.create("galarica_nut_bush", NutBushBlock(BlockBehaviour.Properties.of().mapColor(MapColor.PLANT).randomTicks().noCollission().sound(SoundType.SWEET_BERRY_BUSH).pushReaction(PushReaction.DESTROY)))
@@ -540,11 +545,11 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, ResourceKey<Registry<
val POTTED_SACCHARINE_SAPLING = this.create("potted_saccharine_sapling", BlocksInvoker.createFlowerPotBlock(SACCHARINE_SAPLING))
@JvmField
val HEARTY_GRAIN_BALE = this.create("hearty_grain_bale", BaleBlock(BlockBehaviour.Properties.of().mapColor(MapColor.PLANT).instrument(NoteBlockInstrument.BANJO).strength(0.5F).sound(SoundType.GRASS)))
val HEARTY_GRAIN_BALE = this.create("hearty_grain_bale", BaleBlock(BlockBehaviour.Properties.of().mapColor(MapColor.PLANT).instrument(NoteBlockInstrument.BANJO).strength(0.5F).sound(CobblemonSounds.HEARTY_GRAIN_BALE_SOUNDS)))
@JvmField
val TATAMI_BLOCK = this.create("tatami_block", HorizontalRotationalBlock(BlockBehaviour.Properties.of().ignitedByLava().mapColor(MapColor.PLANT).strength(0.1F).sound(SoundType.MOSS_CARPET)))
val TATAMI_BLOCK = this.create("tatami_block", HorizontalRotationalBlock(BlockBehaviour.Properties.of().ignitedByLava().mapColor(MapColor.PLANT).strength(0.1F).sound(CobblemonSounds.TATAMI_BLOCK_SOUNDS)))
@JvmField
val TATAMI_MAT = this.create("tatami_mat", HorizontalRotationCarpetBlock(BlockBehaviour.Properties.of().ignitedByLava().mapColor(MapColor.PLANT).strength(0.1F).sound(SoundType.MOSS_CARPET)))
val TATAMI_MAT = this.create("tatami_mat", HorizontalRotationCarpetBlock(BlockBehaviour.Properties.of().ignitedByLava().mapColor(MapColor.PLANT).strength(0.1F).sound(CobblemonSounds.TATAMI_MAT_SOUNDS)))
/**
* Returns a map of all the blocks that can be stripped with an axe in the format of input - output.
@@ -18,72 +18,78 @@ import com.cobblemon.mod.common.api.molang.ExpressionLike
import com.cobblemon.mod.common.api.molang.MoLangFunctions.setup
import com.cobblemon.mod.common.api.reactive.SimpleObservable
import com.cobblemon.mod.common.api.scripting.CobblemonScripts
import com.cobblemon.mod.common.net.messages.client.data.FlowRegistrySyncPacket
import com.cobblemon.mod.common.net.messages.client.data.CallbackRegistrySyncPacket
import com.cobblemon.mod.common.util.asExpressionLike
import com.cobblemon.mod.common.util.cobblemonResource
import com.cobblemon.mod.common.util.endsWith
import java.util.concurrent.ExecutionException
import java.util.function.Predicate
import net.minecraft.resources.ResourceLocation
import net.minecraft.server.level.ServerPlayer
import net.minecraft.server.packs.PackType
import net.minecraft.server.packs.resources.ResourceManager
/**
* Holds all the flows that are loaded from the server's data packs. A flow is foldered under the event identifier,
* Holds all the callbacks that are loaded from the server's data packs. A callback is foldered under the event identifier,
* which can be Cobblemon's namespace but can also be minecraft or any other namespace someone has added hooks for.
* The value of the map is a list of MoLang scripts that will execute when that event occurs.
*
* @author Hiroku
* @since February 24th, 2024
*/
object CobblemonFlows : DataRegistry {
override val id = cobblemonResource("flows")
override val observable = SimpleObservable<CobblemonFlows>()
object CobblemonCallbacks : DataRegistry {
override val id = cobblemonResource("callbacks")
override val observable = SimpleObservable<CobblemonCallbacks>()
override val type = PackType.SERVER_DATA
override fun sync(player: ServerPlayer) {
player.sendPacket(FlowRegistrySyncPacket(clientFlows.entries))
player.sendPacket(CallbackRegistrySyncPacket(clientCallbacks.entries))
}
val runtime by lazy { MoLangRuntime().setup() } // Lazy for if someone adds to generalFunctions in MoLangFunctions
val clientFlows = hashMapOf<ResourceLocation, MutableList<ExpressionLike>>()
val flows = hashMapOf<ResourceLocation, MutableList<ExpressionLike>>()
val clientCallbacks = hashMapOf<ResourceLocation, MutableList<ExpressionLike>>()
val callbacks = hashMapOf<ResourceLocation, MutableList<ExpressionLike>>()
override fun reload(manager: ResourceManager) {
clientFlows.clear()
flows.clear()
clientCallbacks.clear()
callbacks.clear()
val unsortedFlows = mutableMapOf<ResourceLocation, MutableList<Pair<String, ExpressionLike>>>()
val unsortedCallbacks = mutableMapOf<ResourceLocation, MutableList<Pair<String, ExpressionLike>>>()
val folderBeforeNameRegex = ".*\\/([^\\/]+)\\/[^\\/]+\$".toRegex()
manager.listResources("flows") { path -> path.endsWith(CobblemonScripts.MOLANG_EXTENSION) }.forEach { (identifier, resource) ->
resource.openAsReader().use { stream ->
stream.buffered().use { reader ->
try {
val expression = reader.readText().asExpressionLike()
val predicate: Predicate<ResourceLocation> = Predicate { path -> path.endsWith(CobblemonScripts.MOLANG_EXTENSION) }
val event = folderBeforeNameRegex.find(identifier.path)?.groupValues?.get(1)
?: throw IllegalArgumentException("Invalid flow path: $identifier. Should have a folder structure that includes the name of the event being flowed.")
manager.listResources("callbacks", predicate)
.plus(manager.listResources("flows", predicate)) // old name
.forEach { (identifier, resource) ->
resource.openAsReader().use { stream ->
stream.buffered().use { reader ->
try {
val expression = reader.readText().asExpressionLike()
val flowKey = ResourceLocation.fromNamespaceAndPath(identifier.namespace, event)
unsortedFlows.putIfAbsent(flowKey, mutableListOf())
unsortedFlows[flowKey]!!.add(identifier.path to expression)
} catch (exception: Exception) {
throw ExecutionException("Error loading MoLang script for flow: $identifier", exception)
val event = folderBeforeNameRegex.find(identifier.path)?.groupValues?.get(1)
?: throw IllegalArgumentException("Invalid callback path: $identifier. Should have a folder structure that includes the name of the event to callback.")
val callbackKey = ResourceLocation.fromNamespaceAndPath(identifier.namespace, event)
unsortedCallbacks.putIfAbsent(callbackKey, mutableListOf())
unsortedCallbacks[callbackKey]!!.add(identifier.path to expression)
} catch (exception: Exception) {
throw ExecutionException("Error loading MoLang script for callback: $identifier", exception)
}
}
}
}
}
unsortedFlows.forEach { (key, value) ->
unsortedCallbacks.forEach { (key, value) ->
value.sortBy { it.first }
if (key.path.startsWith("flows/client/")) {
clientFlows.getOrPut(key) { mutableListOf() }.addAll(value.map { it.second })
if (key.path.startsWith("flows/client/") || key.path.startsWith("callbacks/client/")) {
clientCallbacks.getOrPut(key) { mutableListOf() }.addAll(value.map { it.second })
} else {
flows.getOrPut(key) { mutableListOf() }.addAll(value.map { it.second })
callbacks.getOrPut(key) { mutableListOf() }.addAll(value.map { it.second })
}
}
Cobblemon.LOGGER.info("Loaded ${flows.size} flows and ${clientFlows.size} client flows")
Cobblemon.LOGGER.info("Loaded ${callbacks.size} callbacks and ${clientCallbacks.size} client callbacks")
observable.emit(this)
}
@@ -93,6 +99,8 @@ object CobblemonFlows : DataRegistry {
functions: Map<String, (MoParams) -> Any> = emptyMap(),
cancelable: Cancelable? = null
) {
if (eventResourceLocation !in callbacks) return
if (cancelable == null) {
runtime.environment.query.functions.remove("cancel")
} else {
@@ -104,7 +112,7 @@ object CobblemonFlows : DataRegistry {
functions.forEach { (name, function) -> runtime.environment.query.addFunction(name, function) }
flows[eventResourceLocation]?.forEach {
callbacks[eventResourceLocation]?.forEach {
if (cancelable != null && cancelable.isCanceled) {
return
}
@@ -59,6 +59,7 @@ object CobblemonCommands {
ApplyPlayerTextureCommand.register(dispatcher)
RenameBoxCommand.register(dispatcher)
ChangeBoxWallpaperCommand.register(dispatcher)
RunMolangCommand.register(dispatcher)
RunMolangScriptCommand.register(dispatcher)
SpectateBattleCommand.register(dispatcher)
CobblemonConfigCommand.register(dispatcher)
@@ -26,10 +26,10 @@ object CobblemonItemComponents : PlatformRegistry<Registry<DataComponentType<*>>
.networkSynchronized(PokemonItemComponent.PACKET_CODEC)
.build())
val HELD_ITEM_REP: DataComponentType<HeldItemCapableComponent> = DataComponentType.builder<HeldItemCapableComponent>()
.persistent(HeldItemCapableComponent.CODEC)
.networkSynchronized(HeldItemCapableComponent.PACKET_CODEC)
.build()
val HELD_ITEM_EFFECT: DataComponentType<HeldItemEffectComponent> = create("held_item_effect", DataComponentType.builder<HeldItemEffectComponent>()
.persistent(HeldItemEffectComponent.CODEC)
.networkSynchronized(HeldItemEffectComponent.PACKET_CODEC)
.build())
val BAIT: DataComponentType<RodBaitComponent> = create("bait", DataComponentType.builder<RodBaitComponent>()
.persistent(RodBaitComponent.CODEC)
@@ -86,6 +86,7 @@ object CobblemonItemComponents : PlatformRegistry<Registry<DataComponentType<*>>
Registry.register(BuiltInRegistries.DATA_COMPONENT_TYPE, ResourceLocation.parse("cobblemon:ingredient"), INGREDIENT)
Registry.register(BuiltInRegistries.DATA_COMPONENT_TYPE, ResourceLocation.parse("cobblemon:food"), FOOD)
Registry.register(BuiltInRegistries.DATA_COMPONENT_TYPE, ResourceLocation.parse("cobblemon:mob_effects"), MOB_EFFECTS)
Registry.register(BuiltInRegistries.DATA_COMPONENT_TYPE, ResourceLocation.parse("cobblemon:held_item_effect"), HELD_ITEM_EFFECT)
}
override val registry = BuiltInRegistries.DATA_COMPONENT_TYPE
@@ -22,6 +22,7 @@ import com.cobblemon.mod.common.block.BerryBlock
import com.cobblemon.mod.common.block.MintBlock
import com.cobblemon.mod.common.block.MintBlock.MintType
import com.cobblemon.mod.common.client.pokedex.PokedexType
import com.cobblemon.mod.common.block.campfirepot.CampfirePotColor
import com.cobblemon.mod.common.entity.boat.CobblemonBoatType
import com.cobblemon.mod.common.item.*
import com.cobblemon.mod.common.item.armor.CobblemonArmorTrims
@@ -192,19 +193,19 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
val campfire_pots = mutableListOf<CampfirePotItem>()
@JvmField
val CAMPFIRE_POT_RED = campfirePotItem(CobblemonBlocks.RED_CAMPFIRE_POT, "red")
val CAMPFIRE_POT_RED = campfirePotItem(CobblemonBlocks.RED_CAMPFIRE_POT, CampfirePotColor.RED)
@JvmField
val CAMPFIRE_POT_YELLOW = campfirePotItem(CobblemonBlocks.YELLOW_CAMPFIRE_POT, "yellow")
val CAMPFIRE_POT_YELLOW = campfirePotItem(CobblemonBlocks.YELLOW_CAMPFIRE_POT, CampfirePotColor.YELLOW)
@JvmField
val CAMPFIRE_POT_GREEN = campfirePotItem(CobblemonBlocks.GREEN_CAMPFIRE_POT, "green")
val CAMPFIRE_POT_GREEN = campfirePotItem(CobblemonBlocks.GREEN_CAMPFIRE_POT, CampfirePotColor.GREEN)
@JvmField
val CAMPFIRE_POT_BLUE = campfirePotItem(CobblemonBlocks.BLUE_CAMPFIRE_POT, "blue")
val CAMPFIRE_POT_BLUE = campfirePotItem(CobblemonBlocks.BLUE_CAMPFIRE_POT, CampfirePotColor.BLUE)
@JvmField
val CAMPFIRE_POT_PINK = campfirePotItem(CobblemonBlocks.PINK_CAMPFIRE_POT, "pink")
val CAMPFIRE_POT_PINK = campfirePotItem(CobblemonBlocks.PINK_CAMPFIRE_POT, CampfirePotColor.PINK)
@JvmField
val CAMPFIRE_POT_BLACK = campfirePotItem(CobblemonBlocks.BLACK_CAMPFIRE_POT, "black")
val CAMPFIRE_POT_BLACK = campfirePotItem(CobblemonBlocks.BLACK_CAMPFIRE_POT, CampfirePotColor.BLACK)
@JvmField
val CAMPFIRE_POT_WHITE = campfirePotItem(CobblemonBlocks.WHITE_CAMPFIRE_POT, "white")
val CAMPFIRE_POT_WHITE = campfirePotItem(CobblemonBlocks.WHITE_CAMPFIRE_POT, CampfirePotColor.WHITE)
@JvmField
val HEARTY_GRAINS = compostableItem("hearty_grains", ItemNameBlockItem(CobblemonBlocks.HEARTY_GRAINS, Properties().rarity(Rarity.COMMON)))
@@ -349,15 +350,15 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
@JvmField
val SACCHARINE_SAPLING = compostableBlockItem("saccharine_sapling", CobblemonBlocks.SACCHARINE_SAPLING, 0.30f)
@JvmField
val BUGWORT = compostableBlockItem("bugwort", CobblemonBlocks.BUGWORT)
// @JvmField
// val BUGWORT = compostableBlockItem("bugwort", CobblemonBlocks.BUGWORT) // TODO after 1.7
@JvmField
val POKE_BAIT = noSettingsItem("poke_bait")
@JvmField
val LURE_CAKE = blockItem("lure_cake", CobblemonBlocks.LURE_CAKE)
val POKE_CAKE = this.create("poke_cake", BlockItem(CobblemonBlocks.POKE_CAKE, Item.Properties().stacksTo(1)))
@JvmField
val POKE_CAKE = blockItem("poke_cake", CobblemonBlocks.POKE_CAKE)
val POKE_SNACK = this.create("poke_snack", BlockItem(CobblemonBlocks.POKE_SNACK, Item.Properties().stacksTo(16)))
val aprijuices = mutableListOf<AprijuiceItem>()
@JvmField
@@ -386,43 +387,31 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
// FOODS
@JvmField
val SWEET_HEART = noSettingsItem("sweet_heart") // todo make a SweetHeartItem class for breeding purposes
val SWEET_HEART = noSettingsItem("sweet_heart") // TODO make a SweetHeartItem class for breeding purposes
@JvmField
val TASTY_TAIL = noSettingsItem("tasty_tail")
val TASTY_TAIL = create("tasty_tail", foodItem(3, 0.3f))
@JvmField // todo get final values for this from vera
val PEWTER_CRUNCHIES = regionalFoodItem("pewter_crunchies", 16, 10, 1.2f, MobEffectInstance(MobEffects.ABSORPTION, 900, 0), 1f, false)
@JvmField // todo get final values for this from vera
val RAGE_CANDY_BAR = regionalFoodItem("rage_candy_bar", 16, 10, 1.2f, MobEffectInstance(MobEffects.ABSORPTION, 900, 0), 1f, false)
@JvmField // todo get final values for this from vera
val LAVA_COOKIE = regionalFoodItem("lava_cookie", 16, 10, 1.2f, MobEffectInstance(MobEffects.ABSORPTION, 900, 0), 1f)
@JvmField // todo get final values for this from vera
val OLD_GATEAU = regionalFoodItem("old_gateau", 16, 10, 1.2f, MobEffectInstance(MobEffects.ABSORPTION, 900, 0), 1f)
@JvmField // todo get final values for this from vera
val CASTELIACONE = regionalFoodItem("casteliacone", 16, 10, 1.2f, MobEffectInstance(MobEffects.ABSORPTION, 900, 0), 1f)
@JvmField // todo get final values for this from vera
val SHALOUR_SABLE = regionalFoodItem("shalour_sable", 16, 10, 1.2f, MobEffectInstance(MobEffects.ABSORPTION, 900, 0), 1f)
@JvmField // todo get final values for this from vera
val LUMIOSE_GALETTE = regionalFoodItem("lumiose_galette", 16, 10, 1.2f, MobEffectInstance(MobEffects.ABSORPTION, 900, 0), 1f)
@JvmField // todo get final values for this from vera
val BIG_MALASADA = regionalFoodItem("big_malasada", 16, 10, 1.2f, MobEffectInstance(MobEffects.ABSORPTION, 900, 0), 1f)
@JvmField // todo get final values for this from vera
val SMOKED_TAIL_CURRY = regionalFoodItem("smoked_tail_curry", 16, 10, 1.2f, MobEffectInstance(MobEffects.ABSORPTION, 900, 0), 1f, false, ItemStack(Items.BOWL, 1))
@JvmField // todo get final values for this from vera
val JUBILIFE_MUFFIN = regionalFoodItem("jubilife_muffin", 16, 10, 1.2f, MobEffectInstance(MobEffects.ABSORPTION, 900, 0), 1f)
@JvmField // todo get final values for this from vera
val OPEN_FACED_SANDWICH = regionalFoodItem("open_faced_sandwich", 16, 10, 1.2f, MobEffectInstance(MobEffects.ABSORPTION, 900, 0), 1f)
@JvmField
val PEWTER_CRUNCHIES = regionalFoodItem("pewter_crunchies", 64, 7, 0.343f, false)
@JvmField
val RAGE_CANDY_BAR = regionalFoodItem("rage_candy_bar", 64, 8, 0.2f, false)
@JvmField
val LAVA_COOKIE = regionalFoodItem("lava_cookie", 64, 2, 0.3f, false)
@JvmField
val OLD_GATEAU = regionalFoodItem("old_gateau", 64, 9, 0.1335f, false)
@JvmField
val CASTELIACONE = regionalFoodItem("casteliacone", 64, 5, 0.28f, false)
@JvmField
val LUMIOSE_GALETTE = regionalFoodItem("lumiose_galette", 64, 4, 0.4f, false)
@JvmField
val BIG_MALASADA = regionalFoodItem("big_malasada", 64, 7, 0.343f, false)
@JvmField
val SMOKED_TAIL_CURRY = regionalFoodItem("smoked_tail_curry", 64, 10, 0.6f, false, ItemStack(Items.BOWL, 1))
@JvmField
val JUBILIFE_MUFFIN = regionalFoodItem("jubilife_muffin", 64, 8, 0.2f, false)
@JvmField
val OPEN_FACED_SANDWICH = regionalFoodItem("open_faced_sandwich", 64, 13, 0.5f, false)
// todo we might need to wait on these for later? These impact battles and may be harder to do
/*@JvmField
@@ -433,32 +422,24 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
val TWICE_SPICED_BEETROOT = noSettingsItem("twice_spiced_beetroot") // todo make a TwiceSpiceBeetrootItem class for battle purposes
*/
@JvmField
val POTATO_MOCHI = create("potato_mochi", CobblemonItem(Properties().stacksTo(16)
val POTATO_MOCHI = create("potato_mochi", CobblemonItem(Properties().stacksTo(64)
.food(FoodProperties.Builder()
.nutrition(10) // todo get final values for this from vera
.saturationModifier(1.2F) // todo get final values for this from vera
.alwaysEdible()
.nutrition(4)
.saturationModifier(0.4F)
.build())))
@JvmField
val FRIED_RICE = create("fried_rice", CobblemonItem(Properties().stacksTo(16)
val CANDIED_APPLE = create("candied_apple", CobblemonItem(Properties().stacksTo(64)
.food(FoodProperties.Builder()
.nutrition(10) // todo get final values for this from vera
.saturationModifier(1.2F) // todo get final values for this from vera
.alwaysEdible()
.nutrition(6)
.saturationModifier(0.2335F)
.usingConvertsTo(Items.STICK)
.build())))
@JvmField
val CANDIED_APPLE = create("candied_apple", CobblemonItem(Properties().stacksTo(16)
val CANDIED_BERRY = create("candied_berry", CobblemonItem(Properties().stacksTo(64)
.food(FoodProperties.Builder()
.nutrition(10) // todo get final values for this from vera
.saturationModifier(1.2F) // todo get final values for this from vera
.alwaysEdible()
.build())))
@JvmField
val CANDIED_BERRY = create("candied_berry", CobblemonItem(Properties().stacksTo(16)
.food(FoodProperties.Builder()
.nutrition(10) // todo get final values for this from vera
.saturationModifier(1.2F) // todo get final values for this from vera
.alwaysEdible()
.nutrition(5)
.saturationModifier(0.22F)
.usingConvertsTo(Items.STICK)
.build())))
//@JvmField
@@ -480,8 +461,8 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
val PASTURE = blockItem("pasture", CobblemonBlocks.PASTURE)
@JvmField
val DISPLAY_CASE = blockItem("display_case", CobblemonBlocks.DISPLAY_CASE)
@JvmField
val INCENSE_SWEET = blockItem("incense_sweet", CobblemonBlocks.INCENSE_SWEET)
// @JvmField
// val INCENSE_SWEET = blockItem("incense_sweet", CobblemonBlocks.INCENSE_SWEET) // TODO after 1.7
// Evolution items
@@ -685,14 +666,12 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
@JvmField
val MEDICINAL_LEEK = heldItem("medicinal_leek", MedicinalLeekItem(CobblemonBlocks.MEDICINAL_LEEK, Item.Properties().food(FoodProperties.Builder().fast().nutrition(1).saturationModifier(0.2f).build())), "leek")
@JvmField
val ROASTED_LEEK = compostableItem("roasted_leek", CobblemonItem(Item.Properties().food(FoodProperties.Builder().fast().nutrition(3).saturationModifier(0.3f).build())), 0.85f)
@JvmField
val BRAISED_VIVICHOKE = compostableItem("braised_vivichoke", foodItem(6, 0.6F), 0.85f)
val ROASTED_LEEK = compostableItem("roasted_leek", CobblemonItem(Item.Properties().food(FoodProperties.Builder().fast().nutrition(3).saturationModifier(0.2f).build())), 0.85f)
@JvmField
val VIVICHOKE_DIP = create("vivichoke_dip", object : CobblemonItem(Properties().stacksTo(1)
.food(FoodProperties.Builder()
.nutrition(10)
.saturationModifier(1.2F)
.saturationModifier(0.6F)
.effect(MobEffectInstance(MobEffects.ABSORPTION, 900, 0), 1F)
.alwaysEdible()
.usingConvertsTo(Items.BOWL)
@@ -703,7 +682,7 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
}
})
@JvmField
val ENERGY_ROOT = compostableItem("energy_root", EnergyRootItem(CobblemonBlocks.ENERGY_ROOT, Item.Properties().food(FoodProperties.Builder().nutrition(1).fast().saturationModifier(0.2f).build())), 0.60f)
val ENERGY_ROOT = compostableItem("energy_root", EnergyRootItem(CobblemonBlocks.ENERGY_ROOT, Properties()), 0.60f)
@JvmField
val REVIVAL_HERB = compostableItem("revival_herb", RevivalHerbItem(CobblemonBlocks.REVIVAL_HERB))
@JvmField
@@ -717,7 +696,7 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
@JvmField
val SUPERB_REMEDY = compostableItem("superb_remedy", RemedyItem(RemedyItem.SUPERB), 0.85f)
@JvmField
val MOOMOO_MILK = noSettingsItem("moomoo_milk")
val MOOMOO_MILK = create("moomoo_milk", CobblemonItem(Item.Properties().craftRemainder(Items.GLASS_BOTTLE).stacksTo((16))))
@JvmField
val POTION = create("potion", PotionItem(PotionType.POTION))
@@ -733,7 +712,7 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
@JvmField
val HEAL_POWDER = create("heal_powder", HealPowderItem())
@JvmField
val LEEK_AND_POTATO_STEW = create("leek_and_potato_stew", CobblemonItem(Item.Properties().food(FoodProperties.Builder().nutrition(8).saturationModifier(0.6f).usingConvertsTo(Items.BOWL).build()).stacksTo(1)))
val LEEK_AND_POTATO_STEW = create("leek_and_potato_stew", CobblemonItem(Item.Properties().food(FoodProperties.Builder().nutrition(6).saturationModifier(0.6f).usingConvertsTo(Items.BOWL).build()).stacksTo(1)))
@JvmField
val REVIVE = create("revive", ReviveItem(max = false))
@JvmField
@@ -1522,8 +1501,8 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
}
)
private fun campfirePotItem(block: Block, type: String): CampfirePotItem {
val item = create("campfire_pot_${type}", CampfirePotItem(block))
private fun campfirePotItem(block: Block, color: CampfirePotColor): CampfirePotItem {
val item = create("campfire_pot_${color.suffix}", CampfirePotItem(block, color))
campfire_pots.add(item)
return item
}
@@ -1544,8 +1523,6 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
stacksTo: Int,
nutrition: Int,
saturationModifier: Float,
effect: MobEffectInstance? = null,
effectChance: Float? = null,
alwaysEdible: Boolean = false,
convertsToOnUse: ItemStack? = null
): RegionalFoodItem {
@@ -1553,10 +1530,6 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
.nutrition(nutrition)
.saturationModifier(saturationModifier)
if (effect != null && effectChance != null) {
foodPropertiesBuilder.effect(effect, effectChance)
}
if (alwaysEdible == true) {
foodPropertiesBuilder.alwaysEdible()
}
@@ -1676,4 +1649,4 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
private fun foodItem(nutrition: Int, saturationModifier: Float): Item {
return CobblemonItem(Item.Properties().food(FoodProperties.Builder().nutrition(nutrition).saturationModifier(saturationModifier).build()))
}
}
}
@@ -9,6 +9,7 @@
package com.cobblemon.mod.common
import com.cobblemon.mod.common.api.ai.CobblemonAttackTargetData
import com.cobblemon.mod.common.api.ai.CobblemonWanderControl
import com.cobblemon.mod.common.api.dialogue.ActiveDialogue
import com.cobblemon.mod.common.api.moves.animations.ActionEffectContext
import com.mojang.serialization.Codec
@@ -42,12 +43,23 @@ object CobblemonMemories {
val TARGETED_BATTLE_POKEMON = register<UUID>("targeted_battle_pokemon")
val NEAREST_VISIBLE_ATTACKER = register<LivingEntity>("nearest_visible_attacker")
val NEARBY_GROWABLE_CROPS = register<BlockPos>("nearby_growable_crops")
val NEARBY_SWEET_BERRY_BUSH = register<BlockPos>("nearest_sweet_berry_bush")
val DISABLE_WALK_TO_BERRY_BUSH = register<Boolean>("disable_walk_to_berry_bush")
val TIME_TRYING_TO_REACH_BERRY_BUSH = register<Int>("time_trying_to_reach_berry_bush")
val IS_CONSUMING_ITEM = register<Boolean>("is_consuming_item")
val RECENTLY_ATE_GRASS = register<Boolean>("recently_ate_grass")
val HIVE_LOCATION = register<BlockPos>("hive_location")
val HIVE_COOLDOWN = register<Boolean>("hive_cooldown")
val NEARBY_FLOWERS = register<List<BlockPos>>("nearby_flower")
val POLLINATED = register<Boolean>("pollinated", PrimitiveCodec.BOOL)
/** who am i following rn? */
val HERD_LEADER = register<String>("herd_leader", PrimitiveCodec.STRING)
/** how many are following me rn? */
val HERD_SIZE = register<Int>("herd_size") // Don't bother saving it, we'll try to keep count roughly.
val ATTACK_TARGET_DATA = register<CobblemonAttackTargetData>("attack_target_data") // This is used to store additional information about the attack target, such as when to give up pursuit.
val WANDER_CONTROL = register<CobblemonWanderControl>("wander_control")
val DISABLE_WALK_TO_WANTED_ITEM = register<Boolean>("disable_walk_to_wanted_item")
val TIME_TRYING_TO_REACH_WANTED_ITEM = register<Int>("time_trying_to_wanted_item")
fun <U> register(id: String, codec: Codec<U>): MemoryModuleType<U> {
val memoryModule = MemoryModuleType(Optional.of(codec))
@@ -23,7 +23,9 @@ import com.cobblemon.mod.common.client.net.data.DataRegistrySyncPacketHandler
import com.cobblemon.mod.common.client.net.data.UnlockReloadPacketHandler
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.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.InteractPokemonUIPacketHandler
@@ -40,6 +42,7 @@ import com.cobblemon.mod.common.client.net.pasture.UpdatePastureConflictFlagHand
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
import com.cobblemon.mod.common.client.net.riding.ClientboundUpdateDriverInputHandler
import com.cobblemon.mod.common.client.net.settings.OpenCobblemonConfigEditorHandler
import com.cobblemon.mod.common.client.net.settings.ServerSettingsPacketHandler
import com.cobblemon.mod.common.client.net.sound.UnvalidatedPlaySoundS2CPacketHandler
@@ -76,11 +79,14 @@ import com.cobblemon.mod.common.net.messages.client.cooking.ToggleCookingPotLidP
import com.cobblemon.mod.common.net.messages.client.data.*
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.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.ClosePasturePacket
import com.cobblemon.mod.common.net.messages.client.pasture.OpenPasturePacket
@@ -151,6 +157,7 @@ import com.cobblemon.mod.common.net.messages.server.callback.party.PartyPokemonS
import com.cobblemon.mod.common.net.messages.server.callback.party.PartySelectCancelledPacket
import com.cobblemon.mod.common.net.messages.server.callback.partymove.PartyMoveSelectCancelledPacket
import com.cobblemon.mod.common.net.messages.server.callback.partymove.PartyPokemonMoveSelectedPacket
import com.cobblemon.mod.common.net.messages.server.debug.ServerboundUpdateRidingSettingsPacket
import com.cobblemon.mod.common.net.messages.server.debug.ServerboundUpdateRidingStatRangePacket
import com.cobblemon.mod.common.net.messages.server.debug.ServerboundUpdateRidingStatsPacket
import com.cobblemon.mod.common.net.messages.server.dialogue.EscapeDialoguePacket
@@ -171,6 +178,7 @@ import com.cobblemon.mod.common.net.messages.server.pokemon.update.SetMarkingsPa
import com.cobblemon.mod.common.net.messages.server.pokemon.update.ServerboundUpdateRidingStatePacket
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
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
@@ -201,6 +209,7 @@ import com.cobblemon.mod.common.net.serverhandling.callback.party.PartyPokemonSe
import com.cobblemon.mod.common.net.serverhandling.callback.party.PartySelectCancelledHandler
import com.cobblemon.mod.common.net.serverhandling.callback.partymove.PartyMoveSelectCancelledHandler
import com.cobblemon.mod.common.net.serverhandling.callback.partymove.PartyPokemonMoveSelectedHandler
import com.cobblemon.mod.common.net.serverhandling.debug.ServerboundUpdateRidingSettingsHandler
import com.cobblemon.mod.common.net.serverhandling.debug.ServerboundUpdateRidingStatRangeHandler
import com.cobblemon.mod.common.net.serverhandling.debug.ServerboundUpdateRidingStatsHandler
import com.cobblemon.mod.common.net.serverhandling.dialogue.EscapeDialogueHandler
@@ -221,6 +230,7 @@ import com.cobblemon.mod.common.net.serverhandling.pokemon.update.SetActiveMarkH
import com.cobblemon.mod.common.net.serverhandling.pokemon.update.SetMarkingsHandler
import com.cobblemon.mod.common.net.serverhandling.pokemon.update.ServerboundUpdateRidingStateHandler
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.starter.RequestStarterScreenHandler
import com.cobblemon.mod.common.net.serverhandling.starter.SelectStarterPacketHandler
import com.cobblemon.mod.common.net.serverhandling.storage.BenchMoveHandler
@@ -393,7 +403,7 @@ object CobblemonNetwork {
list.add(PacketRegisterInfo(DexEntrySyncPacket.ID, DexEntrySyncPacket::decode, DataRegistrySyncPacketHandler()))
list.add(PacketRegisterInfo(SpawnBaitRegistrySyncPacket.ID, SpawnBaitRegistrySyncPacket::decode, DataRegistrySyncPacketHandler()))
list.add(PacketRegisterInfo(SeasoningRegistrySyncPacket.ID, SeasoningRegistrySyncPacket::decode, DataRegistrySyncPacketHandler()))
list.add(PacketRegisterInfo(FlowRegistrySyncPacket.ID, FlowRegistrySyncPacket::decode, DataRegistrySyncPacketHandler()))
list.add(PacketRegisterInfo(CallbackRegistrySyncPacket.ID, CallbackRegistrySyncPacket::decode, DataRegistrySyncPacketHandler()))
list.add(PacketRegisterInfo(CosmeticItemAssignmentSyncPacket.ID, CosmeticItemAssignmentSyncPacket::decode, DataRegistrySyncPacketHandler()))
list.add(PacketRegisterInfo(BehaviourSyncPacket.ID, BehaviourSyncPacket::decode, DataRegistrySyncPacketHandler()))
list.add(PacketRegisterInfo(MarkRegistrySyncPacket.ID, MarkRegistrySyncPacket::decode, DataRegistrySyncPacketHandler()))
@@ -402,6 +412,8 @@ object CobblemonNetwork {
list.add(PacketRegisterInfo(SpawnSnowstormParticlePacket.ID, SpawnSnowstormParticlePacket::decode, SpawnSnowstormParticleHandler))
list.add(PacketRegisterInfo(SpawnSnowstormEntityParticlePacket.ID, SpawnSnowstormEntityParticlePacket::decode, SpawnSnowstormEntityParticleHandler))
list.add(PacketRegisterInfo(RunPosableMoLangPacket.ID, RunPosableMoLangPacket::decode, RunPosableMoLangHandler))
list.add(PacketRegisterInfo(SaccharineLogBlockParticlesPacket.ID, SaccharineLogBlockParticlesPacket::decode, SaccharineLogBlockParticlesHandler))
list.add(PacketRegisterInfo(PokeSnackBlockParticlesPacket.ID, PokeSnackBlockParticlesPacket::decode, PokeSnackBlockParticlesHandler))
// Hax
list.add(PacketRegisterInfo(UnvalidatedPlaySoundS2CPacket.ID, UnvalidatedPlaySoundS2CPacket::decode, UnvalidatedPlaySoundS2CPacketHandler))
@@ -462,6 +474,7 @@ object CobblemonNetwork {
// Riding
list.add(PacketRegisterInfo(ClientboundUpdateRidingStatePacket.ID, ClientboundUpdateRidingStatePacket::decode, ClientboundUpdateRidingStateHandler))
list.add(PacketRegisterInfo(ClientboundUpdateDriverInputPacket.ID, ClientboundUpdateDriverInputPacket::decode, ClientboundUpdateDriverInputHandler))
return list
}
@@ -567,7 +580,9 @@ object CobblemonNetwork {
list.add(PacketRegisterInfo(ServerboundUpdateRidingStatePacket.ID, ServerboundUpdateRidingStatePacket::decode, ServerboundUpdateRidingStateHandler))
list.add(PacketRegisterInfo(ServerboundUpdateRidingStatsPacket.ID, ServerboundUpdateRidingStatsPacket::decode, ServerboundUpdateRidingStatsHandler))
list.add(PacketRegisterInfo(ServerboundUpdateRidingStatRangePacket.ID, ServerboundUpdateRidingStatRangePacket::decode, ServerboundUpdateRidingStatRangeHandler))
list.add(PacketRegisterInfo(ServerboundUpdateRidingSettingsPacket.ID, ServerboundUpdateRidingSettingsPacket::decode, ServerboundUpdateRidingSettingsHandler))
list.add(PacketRegisterInfo(DismountPokemonPacket.ID, DismountPokemonPacket::decode, DismountPokemonPacketHandler))
list.add(PacketRegisterInfo(ServerboundUpdateDriverInputPacket.ID, ServerboundUpdateDriverInputPacket::decode, DriverInputPacketHandler))
// Cooking
list.add(PacketRegisterInfo(ToggleCookingPotLidPacket.ID, ToggleCookingPotLidPacket::decode, ToggleCookingPotLidHandler))
@@ -26,11 +26,12 @@ object CobblemonPoiTypes: PlatformRegistry<Registry<PoiType>, ResourceKey<Regist
@JvmField
val NURSE_KEY = createKey("nurse", CobblemonBlocks.HEALING_MACHINE, 1, 1)
@JvmField
val LURE_CAKE_KEY = createKey("lure_cake", CobblemonBlocks.LURE_CAKE, 0, 1)
val POKE_SNACK_KEY = createKey("poke_snack", CobblemonBlocks.POKE_SNACK, 0, 1)
@JvmField
val SACCHARINE_LOG_SLATHERED_KEY = createKey("saccharine_log_slathered", CobblemonBlocks.SACCHARINE_LOG_SLATHERED, 0, 1)
@JvmField
val INCENSE_SWEET_KEY = createKey("incense_sweet", CobblemonBlocks.INCENSE_SWEET, 0, 1)
// TODO after 1.7
// @JvmField
// val INCENSE_SWEET_KEY = createKey("incense_sweet", CobblemonBlocks.INCENSE_SWEET, 0, 1)
private fun createKey(string: String, block: Block, maxTickets: Int, validRange: Int ): ResourceKey<PoiType> =
ResourceKey.create(Registries.POINT_OF_INTEREST_TYPE, cobblemonResource(string)).also { resourceKey ->
@@ -8,10 +8,7 @@
package com.cobblemon.mod.common
import com.cobblemon.mod.common.entity.pokemon.ai.sensors.DefendOwnerSensor
import com.cobblemon.mod.common.entity.pokemon.ai.sensors.DrowsySensor
import com.cobblemon.mod.common.entity.pokemon.ai.sensors.PokemonAdultSensor
import com.cobblemon.mod.common.entity.pokemon.ai.sensors.PokemonGrowableCropSensor
import com.cobblemon.mod.common.entity.pokemon.ai.sensors.*
import com.cobblemon.mod.common.pokemon.ai.PokemonDisturbancesSensor
import com.cobblemon.mod.common.entity.sensor.BattlingPokemonSensor
import com.cobblemon.mod.common.entity.sensor.NPCBattlingSensor
@@ -36,6 +33,14 @@ object CobblemonSensors {
val NEARBY_GROWABLE_CROPS = register("nearby_growable_crops", ::PokemonGrowableCropSensor)
val NEARBY_BEE_HIVE = register("nearby_bee_hive", ::BeeHiveSensor)
val NEARBY_FLOWER = register("nearby_flower", ::FlowerSensor)
val NEARBY_SWEET_BERRY_BUSH = register("nearby_sweet_berry_bush", ::SweetBerryBushSensor)
val POKEMON_NEARBY_WANTED_ITEM = register("pokemon_nearby_wanted_item", ::PokemonItemSensor)
fun <E : Entity, U : Sensor<E>> register(id: String, supplier: Supplier<U>): SensorType<U> {
val sensor = SensorType(supplier)
sensors[id] = sensor
@@ -204,6 +204,19 @@ object CobblemonSounds : PlatformRegistry<Registry<SoundEvent>, ResourceKey<Regi
@JvmField
val EVOLUTION_STONE_BLOCK_STEP = this.create("block.evolution_stone_block.step")
@JvmField
val TATAMI_BLOCK_BREAK = this.create("block.tatami.break")
@JvmField
val TATAMI_BLOCK_HIT = this.create("block.tatami.hit")
@JvmField
val TATAMI_BLOCK_PLACE = this.create("block.tatami.place")
@JvmField
val TATAMI_BLOCK_STEP = this.create("block.tatami.step")
@JvmField
val TATAMI_MAT_BREAK = this.create("block.tatami_mat.break")
@JvmField
val TATAMI_MAT_PLACE = this.create("block.tatami_mat.place")
@JvmField
val GIMMIGHOUL_GIVE_ITEM = this.create("pokemon.gimmighoul.give_item")
@JvmField
@@ -230,6 +243,24 @@ object CobblemonSounds : PlatformRegistry<Registry<SoundEvent>, ResourceKey<Regi
@JvmField
val VIVICHOKE_PLACE = this.create("block.vivichoke.place")
@JvmField
val HEARTY_GRAIN_BALE_BREAK = this.create("block.hearty_grain_bale.break")
@JvmField
val HEARTY_GRAIN_BALE_PLACE = this.create("block.hearty_grain_bale.place")
@JvmField
val HEARTY_GRAIN_BALE_HIT = this.create("block.hearty_grain_bale.hit")
@JvmField
val HEARTY_GRAIN_BALE_STEP = this.create("block.hearty_grain_bale.step")
@JvmField
val HEARTY_GRAINS_BREAK = this.create("block.hearty_grains.break")
@JvmField
val HEARTY_GRAINS_PLACE = this.create("block.hearty_grains.place")
@JvmField
val HEARTY_GRAINS_BREAK_WATER = this.create("block.hearty_grains.break_water")
@JvmField
val HEARTY_GRAINS_PLACE_WATER = this.create("block.hearty_grains.place_water")
@JvmField
val MINT_BREAK = this.create("block.mint.break")
@JvmField
@@ -275,6 +306,11 @@ object CobblemonSounds : PlatformRegistry<Registry<SoundEvent>, ResourceKey<Regi
RELIC_COIN_SACK_STEP
)
@JvmField
val RIDE_LOOP_LEATHER = create("ride.loop.leather")
@JvmField
val RIDE_LOOP_PLUMAGE = create("ride.loop.plumage")
@JvmField
val MOVE_QUICKATTACK_TARGET = this.create("move.quickattack.target")
@JvmField
@@ -319,6 +355,8 @@ object CobblemonSounds : PlatformRegistry<Registry<SoundEvent>, ResourceKey<Regi
@JvmField
val IMPACT_WATER = this.create("impact.water")
// Note to self or whoever's peeking, block sounds have to be at 1.1f pitch
// For some reason, the game pitches them down and compensating for it here returns them to normal
@JvmField
val TUMBLESTONE_SOUNDS = SoundType(1f, 1.1f,
TUMBLESTONE_BREAK,
@@ -336,6 +374,7 @@ object CobblemonSounds : PlatformRegistry<Registry<SoundEvent>, ResourceKey<Regi
TUMBLESTONE_HIT,
TUMBLESTONE_STEP
)
@JvmField
val EVOLUTION_STONE_BLOCK_SOUNDS = SoundType(1f, 1.1f,
EVOLUTION_STONE_BLOCK_BREAK,
@@ -345,6 +384,23 @@ object CobblemonSounds : PlatformRegistry<Registry<SoundEvent>, ResourceKey<Regi
EVOLUTION_STONE_BLOCK_STEP
)
@JvmField
val TATAMI_BLOCK_SOUNDS = SoundType(1f, 1.1f,
TATAMI_BLOCK_BREAK,
TATAMI_BLOCK_STEP,
TATAMI_BLOCK_PLACE,
TATAMI_BLOCK_HIT,
TATAMI_BLOCK_STEP
)
@JvmField
val TATAMI_MAT_SOUNDS = SoundType(1f, 1.1f,
TATAMI_MAT_BREAK,
TATAMI_BLOCK_STEP,
TATAMI_MAT_PLACE,
TATAMI_BLOCK_HIT,
TATAMI_BLOCK_STEP
)
@JvmField
val BERRY_BUSH_SOUNDS = SoundType(0.8f, 1.1f,
@@ -391,6 +447,33 @@ object CobblemonSounds : PlatformRegistry<Registry<SoundEvent>, ResourceKey<Regi
SoundEvents.GRASS_FALL
)
@JvmField
val HEARTY_GRAIN_BALE_SOUNDS = SoundType(0.6f, 1.1f,
HEARTY_GRAIN_BALE_BREAK,
HEARTY_GRAIN_BALE_STEP,
HEARTY_GRAIN_BALE_PLACE,
HEARTY_GRAIN_BALE_HIT,
HEARTY_GRAIN_BALE_STEP
)
@JvmField
val HEARTY_GRAINS_SOUNDS = SoundType(0.6f, 1.1f,
HEARTY_GRAINS_BREAK,
HEARTY_GRAIN_BALE_STEP,
HEARTY_GRAINS_PLACE,
HEARTY_GRAIN_BALE_HIT,
HEARTY_GRAIN_BALE_STEP
)
@JvmField
val HEARTY_GRAINS_WATER_SOUNDS = SoundType(0.6f, 1.1f,
HEARTY_GRAINS_BREAK_WATER,
SoundEvents.GRASS_STEP,
HEARTY_GRAINS_PLACE_WATER,
SoundEvents.GRASS_HIT,
SoundEvents.GRASS_FALL
)
@JvmField
val MINT_SOUNDS = SoundType(0.6f, 1.1f,
MINT_BREAK,
@@ -430,7 +513,6 @@ object CobblemonSounds : PlatformRegistry<Registry<SoundEvent>, ResourceKey<Regi
val DISPLAY_CASE_PLACE = this.create("block.display_case.place")
@JvmField
val DISPLAY_CASE_STEP = this.create("block.display_case.step")
@JvmField
val DISPLAY_CASE_SOUNDS = SoundType(1f, 1f,
DISPLAY_CASE_BREAK,
@@ -441,7 +523,7 @@ object CobblemonSounds : PlatformRegistry<Registry<SoundEvent>, ResourceKey<Regi
)
@JvmField
val CAMPFIRE_POT_PLACE_CAMPFIRE = this.create("block.campfire_pot.place_campfire")
val CAMPFIRE_POT_SET = this.create("block.campfire_pot.set")
@JvmField
val CAMPFIRE_POT_RETRIEVE = this.create("block.campfire_pot.retrieve")
@JvmField
@@ -449,12 +531,14 @@ object CobblemonSounds : PlatformRegistry<Registry<SoundEvent>, ResourceKey<Regi
@JvmField
val CAMPFIRE_POT_CLOSE = this.create("block.campfire_pot.close")
@JvmField
val CAMPFIRE_POT_USE = this.create("block.campfire_pot.use")
val CAMPFIRE_POT_TAKE_ITEM = this.create("block.campfire_pot.take_item")
@JvmField
val CAMPFIRE_POT_ACTIVE = this.create("block.campfire_pot.active")
@JvmField
val CAMPFIRE_POT_AMBIENT = this.create("block.campfire_pot.ambient")
@JvmField
val CAMPFIRE_POT_COOK = this.create("block.campfire_pot.cook")
@JvmField
val CAMPFIRE_POT_CRAFT = this.create("block.campfire_pot.craft")
@JvmField
val CAMPFIRE_POT_PLACE = this.create("block.campfire_pot.place")
@JvmField
val CAMPFIRE_POT_BREAK = this.create("block.campfire_pot.break")
@@ -15,9 +15,12 @@ import com.cobblemon.mod.common.battles.runner.ShowdownService
import com.cobblemon.mod.common.net.messages.client.data.AbilityRegistrySyncPacket
import com.cobblemon.mod.common.pokemon.abilities.HiddenAbilityType
import com.cobblemon.mod.common.util.cobblemonResource
import net.minecraft.resources.ResourceLocation
import net.minecraft.server.level.ServerPlayer
import net.minecraft.server.packs.PackType
import net.minecraft.server.packs.resources.ResourceManager
import java.io.File
import kotlin.collections.set
/**
* Registry for all known Abilities
@@ -31,15 +34,31 @@ object Abilities : DataRegistry {
val DUMMY = AbilityTemplate(name = "dummy")
private val abilityMap = mutableMapOf<String, AbilityTemplate>()
internal val abilityScripts = mutableMapOf<String, String>() // abilityId to JavaScript
override fun reload(manager: ResourceManager) {
PotentialAbility.types.clear()
PotentialAbility.types.add(CommonAbilityType)
PotentialAbility.types.add(HiddenAbilityType)
this.abilityMap.clear()
val abilitiesJson = ShowdownService.service.getAbilityIds()
this.abilityScripts.clear()
ShowdownService.service.resetRegistryData("ability")
manager.listResources("abilities") { it.path.endsWith(".js") }.forEach { (identifier, resource) ->
resource.open().use { stream ->
stream.bufferedReader().use { reader ->
val resolvedIdentifier = ResourceLocation.fromNamespaceAndPath(identifier.namespace, File(identifier.path).nameWithoutExtension)
val js = reader.readText()
abilityScripts[resolvedIdentifier.path] = js
}
}
}
ShowdownService.service.sendRegistryData(abilityScripts, "ability")
val abilitiesJson = ShowdownService.service.getRegistryData("ability")
for (i in 0 until abilitiesJson.size()) {
val id = abilitiesJson[i].asString
val jsonAbility = abilitiesJson[i].asJsonObject
val id = jsonAbility.get("id").asString
val ability = AbilityTemplate(id)
this.register(ability)
}
@@ -59,6 +78,7 @@ object Abilities : DataRegistry {
fun all() = this.abilityMap.values.toList()
fun first() = this.abilityMap.values.first()
fun get(name: String) = abilityMap[name.lowercase()]
fun getOrDummy(name: String) = get(name) ?: DUMMY
fun getOrException(name: String) = get(name) ?: throw IllegalArgumentException("Unable to find ability of name: $name")
fun count() = this.abilityMap.size
@@ -49,10 +49,9 @@ class AbilityTemplate(
@JvmStatic
val CODEC: Codec<AbilityTemplate> = CodecUtils.createByStringCodec(
Abilities::get,
Abilities::getOrDummy,
AbilityTemplate::name
) { id -> "No ability for ID $id" }
}
}
@@ -8,17 +8,35 @@
package com.cobblemon.mod.common.api.ai
import com.bedrockk.molang.runtime.MoLangRuntime
import com.bedrockk.molang.runtime.struct.QueryStruct
import com.bedrockk.molang.runtime.value.DoubleValue
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.api.ai.config.BehaviourConfig
import com.cobblemon.mod.common.api.molang.ExpressionLike
import com.cobblemon.mod.common.api.molang.MoLangFunctions.addStandardFunctions
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asMostSpecificMoLangValue
import com.cobblemon.mod.common.api.molang.MoLangFunctions.setup
import com.cobblemon.mod.common.api.molang.ObjectValue
import com.cobblemon.mod.common.api.scripting.CobblemonScripts
import com.cobblemon.mod.common.entity.MoLangScriptingEntity
import com.cobblemon.mod.common.util.activityRegistry
import com.cobblemon.mod.common.util.asIdentifierDefaultingNamespace
import com.cobblemon.mod.common.util.resolve
import com.cobblemon.mod.common.util.withQueryValue
import com.mojang.datafixers.util.Pair
import com.mojang.serialization.Dynamic
import net.minecraft.resources.ResourceLocation
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.ai.behavior.BehaviorControl
import net.minecraft.world.entity.ai.memory.MemoryModuleType
import net.minecraft.world.entity.ai.sensing.SensorType
import net.minecraft.world.entity.schedule.Activity
import net.minecraft.world.entity.schedule.Schedule
class BehaviourConfigurationContext {
val runtime = MoLangRuntime().setup()
var appliedBehaviours: Set<ResourceLocation> = setOf()
var defaultActivity = Activity.IDLE
@@ -28,6 +46,8 @@ class BehaviourConfigurationContext {
val memories = mutableSetOf<MemoryModuleType<*>>()
val sensors = mutableSetOf<SensorType<*>>()
val onAdd = mutableListOf<ExpressionLike>()
fun getOrCreateActivity(activity: Activity): ActivityConfigurationContext {
return activities.firstOrNull { it.activity == activity } ?: ActivityConfigurationContext(activity).also(activities::add)
}
@@ -48,20 +68,28 @@ class BehaviourConfigurationContext {
this.sensors.addAll(sensors)
}
fun addOnAddScript(script: ExpressionLike) {
onAdd.add(script)
}
fun apply(entity: LivingEntity, behaviourConfigs: List<BehaviourConfig>, dynamic: Dynamic<*>) {
runtime.withQueryValue("entity", entity.asMostSpecificMoLangValue())
runtime.withQueryValue("brain", createBrainStruct(entity, this))
if (entity is MoLangScriptingEntity) {
entity.registerVariables(behaviourConfigs.flatMap { it.getVariables(entity) })
entity.registerVariables(behaviourConfigs.flatMap { it.getVariables(entity, this) })
entity.initializeScripting()
}
// Setup the brain config
behaviourConfigs.forEach { it.preconfigure(entity, this) }
behaviourConfigs.forEach { it.configure(entity, this) }
var brain = entity.brain
// Apply the brain config
if (entity is MoLangScriptingEntity) {
brain = entity.assignNewBrainWithMemoriesAndSensors(dynamic, memories, sensors)
onAdd.forEach { runtime.resolve(it) }
}
activities.forEach { it.apply(entity) }
brain.setCoreActivities(coreActivities)
@@ -69,4 +97,43 @@ class BehaviourConfigurationContext {
brain.schedule = schedule
brain.setActiveActivityIfPossible(defaultActivity)
}
fun createBrainStruct(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext): QueryStruct {
return QueryStruct(hashMapOf()).addStandardFunctions()
.addFunction("entity") { entity.asMostSpecificMoLangValue() }
.addFunction("create_activity") { params ->
val name = params.getString(0).asIdentifierDefaultingNamespace()
val activity = entity.level().activityRegistry.get(name) ?: return@addFunction run {
Cobblemon.LOGGER.error("Tried loading activity $name as part of an entity brain but that activity does not exist")
DoubleValue.ZERO
}
val existingActivityBuilder = behaviourConfigurationContext.activities.find { it.activity == activity }
if (existingActivityBuilder != null) {
return@addFunction createActivityStruct(existingActivityBuilder)
} else {
val activityConfigurationContext = ActivityConfigurationContext(activity)
behaviourConfigurationContext.activities.add(activityConfigurationContext)
return@addFunction createActivityStruct(activityConfigurationContext)
}
}
.addFunction("set_core_activities") { params ->
behaviourConfigurationContext.coreActivities = params.params.map { (it as ObjectValue<ActivityConfigurationContext>).obj.activity }.toSet()
return@addFunction DoubleValue.ONE
}
.addFunction("set_default_activity") { params ->
behaviourConfigurationContext.defaultActivity = params.get<ObjectValue<ActivityConfigurationContext>>(0).obj.activity
return@addFunction DoubleValue.ONE
}
}
fun createActivityStruct(activityConfigurationContext: ActivityConfigurationContext): ObjectValue<ActivityConfigurationContext> {
val struct = ObjectValue(activityConfigurationContext)
struct.addStandardFunctions()
.addFunction("add_task") { params ->
val priority = params.getInt(0)
val task = params.get(1) as ObjectValue<BehaviorControl<in LivingEntity>>
activityConfigurationContext.tasks.add(Pair(priority, task.obj))
}
return struct
}
}
@@ -9,7 +9,17 @@
package com.cobblemon.mod.common.api.ai
import com.bedrockk.molang.Expression
import com.bedrockk.molang.runtime.MoLangRuntime
import com.bedrockk.molang.runtime.value.DoubleValue
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asMostSpecificMoLangValue
import com.cobblemon.mod.common.api.molang.MoLangFunctions.setup
import com.cobblemon.mod.common.api.molang.ObjectValue
import com.cobblemon.mod.common.api.scripting.CobblemonScripts
import com.cobblemon.mod.common.util.asExpression
import com.cobblemon.mod.common.util.asIdentifierDefaultingNamespace
import com.cobblemon.mod.common.util.resolve
import net.minecraft.world.entity.Entity
/**
* This is used in the AI system to store optional additional information about the attack target,
@@ -30,5 +40,32 @@ import com.cobblemon.mod.common.util.asExpression
*/
class CobblemonAttackTargetData(
/** An expression that returns false when the target is no longer worth attacking. */
val shouldContinue: Expression = "true".asExpression()
)
var shouldContinue: Expression = "true".asExpression(),
var hitsUntilDisengage: Int = -1, // -1 means no limit
var disengageAction: (entity: Entity) -> Unit = {}
) {
val struct = ObjectValue<CobblemonAttackTargetData>(this).also {
it.addFunction("hits_until_disengage") { DoubleValue(hitsUntilDisengage.toDouble()) }
it.addFunction("set_hits_until_disengage") { params ->
val value = params.getDouble(0)
hitsUntilDisengage = value.toInt()
DoubleValue(hitsUntilDisengage.toDouble())
}
it.addFunction("set_disengage_action") { params ->
val script = params.getString(0).asIdentifierDefaultingNamespace()
val function = CobblemonScripts.scripts[script] ?: run {
Cobblemon.LOGGER.warn("set_disengage_action was given script '$script' which does not exist.")
return@addFunction DoubleValue.ZERO
}
disengageAction = { entity ->
val runtime = MoLangRuntime().setup()
runtime.environment.query.addFunction("entity") { entity.asMostSpecificMoLangValue() }
runtime.resolve(function)
}
DoubleValue.ONE
}
it.addFunction("unset_disengage_action") { params ->
disengageAction = {}
}
}
}
@@ -17,6 +17,7 @@ import com.cobblemon.mod.common.api.scripting.CobblemonScripts
import com.cobblemon.mod.common.util.asTranslated
import com.cobblemon.mod.common.util.resolve
import com.cobblemon.mod.common.util.withQueryValue
import com.google.gson.annotations.SerializedName
import net.minecraft.network.chat.Component
import net.minecraft.resources.ResourceLocation
import net.minecraft.world.entity.LivingEntity
@@ -28,23 +29,26 @@ class CobblemonBehaviour(
val visible: Boolean = true,
val entityType: ResourceLocation? = null,
val configurations: List<BehaviourConfig> = mutableListOf(),
val undo: ExpressionLike? = null,
val undoScript: ResourceLocation? = null,
// I feel like the onAdd+onAddScript etc could be merged using some interface and a clever deserializer,
// detect if it's a ResourceLocation and failing that, Expression. The on[..]Script fields are kinda fringe though.
@SerializedName("onRemove", alternate = ["undo"])
val onRemove: ExpressionLike? = null,
val onAdd: ExpressionLike? = null,
) {
fun canBeApplied(entity: LivingEntity) = entityType?.let { entityType == entity.type.builtInRegistryHolder().unwrapKey().get().location() } != false
fun configure(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) {
if (onAdd != null) {
behaviourConfigurationContext.addOnAddScript(onAdd)
}
configurations.forEach { it.configure(entity, behaviourConfigurationContext) }
}
/** Undoes anything that needs undoing once this configuration is being removed from an entity that had it before. */
fun undo(entity: LivingEntity) {
fun onRemove(entity: LivingEntity) {
val runtime = MoLangRuntime().setup()
runtime.withQueryValue("entity", entity.asMostSpecificMoLangValue())
if (undoScript != null) {
CobblemonScripts.run(undoScript, runtime)
}
if (undo != null) {
runtime.resolve(undo)
if (onRemove != null) {
runtime.resolve(onRemove)
}
}
}
@@ -0,0 +1,29 @@
/*
* 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.ai
import net.minecraft.world.entity.ai.behavior.BlockPosTracker
import net.minecraft.world.phys.Vec3
/**
* Wraps around [BlockPosTracker] to add additional flags for Cobblemon-specific behavior.
*
* @author Hiroku
* @since August 4th, 2025
*/
class CobblemonBlockPosTracker(
pos: Vec3,
val flags: Set<String> = emptySet(),
) : BlockPosTracker(pos) {
companion object {
const val BATTLE_LOOK_BYPASS_FLAG = "battle_look_bypass"
}
fun isBattleLookBypass() = flags.contains(BATTLE_LOOK_BYPASS_FLAG)
}
@@ -0,0 +1,91 @@
/*
* 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.ai
import com.bedrockk.molang.runtime.struct.QueryStruct
import com.cobblemon.mod.common.util.getBooleanOrNull
import com.cobblemon.mod.common.util.getDoubleOrNull
import kotlin.math.sqrt
import net.minecraft.core.BlockPos
import net.minecraft.world.entity.PathfinderMob
/**
* Used to maintain some settings around how the entity should wander this tick. The idea is you
* reset this with some script task at priority 0 then some number of steps before it gets to the wander
* tasks you can have other conditional tasks jump in to configure parts of this.
*
* @author Hiroku
* @since July 18, 2025
*/
class CobblemonWanderControl(
var center: WanderCenter? = null,
var maxAttempts: Int = 4, // How many times to try to find a suitable point before giving up on that tick.
var allowLand: Boolean = true,
var allowWater: Boolean = false,
var allowAir: Boolean = false,
var pathCooldownTicks: Int = 20 * 5, // Used to mitigate the cost of pathfinding.
var wanderSpeed: Float = 0.35F,
) {
class WanderCenter(val x: Number, val y: Number, val z: Number, val minRange: Float, val maxRange: Float)
@Transient
val struct: QueryStruct = QueryStruct(hashMapOf())
.addFunction("center_x") { center?.x ?: 0.0 }
.addFunction("center_y") { center?.y ?: 0.0 }
.addFunction("center_z") { center?.z ?: 0.0 }
.addFunction("max_attempts") { maxAttempts.toDouble() }
.addFunction("min_range") { center?.minRange ?: 0.0 }
.addFunction("max_range") { center?.maxRange ?: 0.0 }
.addFunction("allow_land") { if (allowLand) 1.0 else 0.0 }
.addFunction("allow_water") { if (allowWater) 1.0 else 0.0 }
.addFunction("allow_air") { if (allowAir) 1.0 else 0.0 }
.addFunction("path_cooldown_ticks") { pathCooldownTicks.toDouble() }
.addFunction("wander_speed") { wanderSpeed }
.addFunction("set_center") { params ->
if (params.params.size < 3) {
throw IllegalArgumentException("set_center requires at least 3 parameters: x, y, z")
}
val x = params.getDouble(0)
val y = params.getDouble(1)
val z = params.getDouble(2)
val minRange = params.getDoubleOrNull(3) ?: 0.0
val maxRange = params.getDoubleOrNull(4) ?: Float.MAX_VALUE.toDouble()
center = WanderCenter(
x = x,
y = y,
z = z,
minRange = minRange.toFloat(),
maxRange = maxRange.toFloat(),
)
}
.addFunction("set_max_attempts") { params -> maxAttempts = params.getDoubleOrNull(0)?.toInt() ?: 4 }
.addFunction("set_allow_land") { params -> allowLand = params.getBooleanOrNull(0) ?: true }
.addFunction("set_allow_water") { params -> allowWater = params.getBooleanOrNull(0) ?: false }
.addFunction("set_allow_air") { params -> allowAir = params.getBooleanOrNull(0) ?: false }
.addFunction("set_path_cooldown_ticks") { params -> pathCooldownTicks = params.getDoubleOrNull(0)?.toInt() ?: (20 * 5) }
.addFunction("set_wander_speed") { params -> wanderSpeed = params.getDoubleOrNull(0)?.toFloat() ?: 0.35F }
.addFunction("reset") {
center = null
allowLand = false
allowWater = false
allowAir = false
pathCooldownTicks = 20 * 5
wanderSpeed = 0.35F
maxAttempts = 4
}
fun isSuitable(position: BlockPos): Boolean {
val center = center ?: return true
val centerPos = BlockPos(center.x.toInt(), center.y.toInt(), center.z.toInt())
val distance = sqrt(centerPos.distSqr(position))
val suitable = distance >= center.minRange && distance <= center.maxRange
return suitable
}
}
@@ -13,6 +13,22 @@ import com.cobblemon.mod.common.api.npc.configuration.MoLangConfigVariable
import com.mojang.datafixers.util.Either
import kotlin.jvm.optionals.getOrNull
/**
* The issue in a lot of the behaviour datapacking is that there are times when a property should be exposed to
* the user and other times that you want to fix the value in place. The remedy to this is using an [Either] where
* one side is an Expression, ergo a value that is not exposed to the user, and the other side is a fully defined
* configuration variable.
*
* When users are editing JSONs they can have a simple expression, or they can declare full variable to show to the
* user. Similarly, the classes for tasks and brain configurations can have defaults that hide from the user or
* defaults that are properly defined variables. One example where this is useful is Wander tasks which might be reused
* in panic activities where the walk speed is tuned up. When specifying the task in the panic activity, the value of
* the walk speed would be set (overriding the default which is the walk_speed MoLang variable) to a separate config
* variable that is exposed to the user. Pretty neat!
*
* @author Hiroku
* @since January 4th, 2025
*/
typealias ExpressionOrEntityVariable = Either<Expression, MoLangConfigVariable>
/**
@@ -12,6 +12,7 @@ import com.cobblemon.mod.common.api.ai.BehaviourConfigurationContext
import com.cobblemon.mod.common.api.ai.ExpressionOrEntityVariable
import com.cobblemon.mod.common.api.ai.asVariables
import com.cobblemon.mod.common.util.asExpression
import com.cobblemon.mod.common.util.resolveBoolean
import com.mojang.datafixers.util.Either
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.ai.memory.MemoryModuleType
@@ -28,9 +29,9 @@ class AddMemoriesAndSensorsConfig : BehaviourConfig {
val memories: Set<MemoryModuleType<*>> = emptySet()
val sensors: Set<SensorType<*>> = mutableSetOf()
override fun getVariables(entity: LivingEntity) = listOf(condition).asVariables()
override fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) = listOf(condition).asVariables()
override fun configure(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) {
if (!checkCondition(entity, condition)) return
if (!checkCondition(behaviourConfigurationContext, condition)) return
behaviourConfigurationContext.addMemories(memories)
behaviourConfigurationContext.addSensors(sensors)
}
@@ -24,9 +24,13 @@ class AddTasksToActivity : BehaviourConfig {
val condition: ExpressionOrEntityVariable = Either.left("true".asExpression())
val tasksByPriority = mutableMapOf<Int, List<TaskConfig>>()
override fun getVariables(entity: LivingEntity) = tasksByPriority.values.flatten().flatMap { it.getVariables(entity) } + listOf(condition).asVariables()
override fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) = tasksByPriority.values
.flatten()
.flatMap {
it.getVariables(entity, behaviourConfigurationContext)
} + listOf(condition).asVariables()
override fun configure(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) {
if (!checkCondition(entity, condition)) return
if (!checkCondition(behaviourConfigurationContext, condition)) return
val activities = if (activity != null) (activities + activity) else activities
@@ -13,7 +13,7 @@ import com.cobblemon.mod.common.api.npc.configuration.MoLangConfigVariable
import net.minecraft.world.entity.LivingEntity
class AddVariablesConfig(val variables: List<MoLangConfigVariable> = emptyList()) : BehaviourConfig {
override fun getVariables(entity: LivingEntity) = variables
override fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) = variables
// Configuration happens naturally through the override on variables
override fun configure(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) {}
@@ -25,18 +25,27 @@ class ApplyBehaviours : BehaviourConfig {
@SerializedName("behaviours", alternate = ["behaviors"])
val behaviours = mutableListOf<ResourceLocation>()
override fun getVariables(entity: LivingEntity): List<MoLangConfigVariable> {
return if (checkCondition(entity, condition)) {
override fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext): List<MoLangConfigVariable> {
return if (checkCondition(behaviourConfigurationContext, condition)) {
behaviours.flatMap {
CobblemonBehaviours.behaviours[it]?.configurations?.flatMap { it.getVariables(entity) } ?: emptyList()
CobblemonBehaviours.behaviours[it]?.configurations?.flatMap { it.getVariables(entity, behaviourConfigurationContext) } ?: emptyList()
} + listOf(condition).asVariables()
} else {
listOf(condition).asVariables()
}
}
override fun preconfigure(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) {
if (!checkCondition(behaviourConfigurationContext, condition)) return
val configurations = behaviours.map { CobblemonBehaviours.behaviours[it]?.takeIf { it.canBeApplied(entity) } ?: return }
configurations.forEach {
it.configurations.forEach { it.preconfigure(entity, behaviourConfigurationContext) }
}
}
override fun configure(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) {
if (!checkCondition(entity, condition)) return
if (!checkCondition(behaviourConfigurationContext, condition)) return
val configurations = behaviours.map { CobblemonBehaviours.behaviours[it]?.takeIf { it.canBeApplied(entity) } ?: return Cobblemon.LOGGER.warn("Behaviour $it not found") }
// Why not just add the presets to the context directly?
@@ -37,7 +37,6 @@ interface BehaviourConfig {
companion object {
val types = mutableMapOf<ResourceLocation, Class<out BehaviourConfig>>(
cobblemonResource("script") to ScriptBehaviourConfig::class.java,
cobblemonResource("custom_script") to CustomScriptBehaviourConfig::class.java,
cobblemonResource("add_tasks_to_activity") to AddTasksToActivity::class.java,
cobblemonResource("apply_behaviours") to ApplyBehaviours::class.java,
cobblemonResource("set_default_activity") to SetDefaultActivity::class.java,
@@ -48,12 +47,16 @@ interface BehaviourConfig {
)
}
fun checkCondition(entity: LivingEntity, expressionOrEntityVariable: ExpressionOrEntityVariable): Boolean {
val runtime = MoLangRuntime().setup()
runtime.withQueryValue("entity", entity.asMostSpecificMoLangValue())
return runtime.resolveBoolean(expressionOrEntityVariable.map({ it }, { "q.entity.config.${it.variableName}".asExpression() }))
/** Literally just here for shorthand. */
fun checkCondition(behaviourConfigurationContext: BehaviourConfigurationContext, expressionOrEntityVariable: ExpressionOrEntityVariable): Boolean {
return behaviourConfigurationContext.runtime.resolveBoolean(expressionOrEntityVariable.map({ it }, { "q.entity.config.${it.variableName}".asExpression() }))
}
fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext): List<MoLangConfigVariable>
fun preconfigure(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) {
// Default implementation does nothing, can be overridden if needed
}
fun getVariables(entity: LivingEntity): List<MoLangConfigVariable>
fun configure(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext)
}
@@ -1,46 +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.api.ai.config
import com.bedrockk.molang.runtime.MoLangRuntime
import com.cobblemon.mod.common.api.ai.BehaviourConfigurationContext
import com.cobblemon.mod.common.api.ai.ExpressionOrEntityVariable
import com.cobblemon.mod.common.api.molang.ExpressionLike
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asMostSpecificMoLangValue
import com.cobblemon.mod.common.api.molang.MoLangFunctions.setup
import com.cobblemon.mod.common.api.npc.configuration.MoLangConfigVariable
import com.cobblemon.mod.common.util.asExpression
import com.cobblemon.mod.common.util.asExpressionLike
import com.cobblemon.mod.common.util.resolve
import com.cobblemon.mod.common.util.withQueryValue
import com.mojang.datafixers.util.Either
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.ai.memory.MemoryModuleType
import net.minecraft.world.entity.ai.sensing.SensorType
class CustomScriptBehaviourConfig : BehaviourConfig {
companion object {
val runtime = MoLangRuntime().setup()
}
var condition: ExpressionOrEntityVariable = Either.left("true".asExpression())
val variables: List<MoLangConfigVariable> = emptyList()
val script: ExpressionLike = "0".asExpressionLike()
val memories = emptySet<MemoryModuleType<*>>()
val sensors = emptySet<SensorType<*>>()
override fun getVariables(entity: LivingEntity) = variables
override fun configure(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) {
if (!checkCondition(entity, condition)) return
behaviourConfigurationContext.addMemories(memories)
behaviourConfigurationContext.addSensors(sensors)
runtime.withQueryValue("entity", entity.asMostSpecificMoLangValue())
runtime.resolve(script)
}
}
@@ -117,7 +117,7 @@ Example behaviour (`uses_healing_machine.json`):
"configurations": [
{
"type": "add_tasks_to_activity",
"activity": "idle",
"activity": "minecraft:idle",
"tasksByPriority": {
"1": [
"heal_using_healing_machine",
@@ -177,27 +177,26 @@ Example:
### script
The `script` type executes a registered MoLang script which will apply some changes to the brain or entity. This can be
useful if the goal is to apply some kind of configuration to the entity that would otherwise be performed by an NPC preset
or NPC class. `q.entity` will refer to the entity. This is powerful when combined with [add_variables](#add_variables)
configs in the same behaviour preset.
useful for complex variable configuration. `q.entity` will refer to the entity.
- `executeEarly`: If true, the script will be executed in the variable phase which occurs before tasks are added to the brain. Use this when your script might influence which tasks are put onto the brain.
- `script`: Either a resource location for the `molang` datapack folder or a MoLang expression that will be executed.
- `variables`: A list of variables that can be configured in the UI. Each variable has the same properties as in `add_variables`.
Example:
```json
{
"type": "script",
"script": "cobblemon:configure_npc_party"
}
```
### custom_script
The `custom_script` type executes a custom MoLang script from this config which will apply some changes to the brain or
entity. This is useful for when you want to apply some kind of configuration to the entity that would otherwise be
by an NPC preset or NPC class. `q.entity` will refer to the entity.
Example:
```json
{
"type": "custom_script",
"script": "q.entity.set_pathfinding_malus('WATER', -1);"
"executeEarly": true,
"script": "cobblemon:configure_npc_party",
"variables": [
{
"variableName": "party_size",
"defaultValue": "3",
"displayName": "Party Size",
"description": "The number of Pokémon in the NPC's party.",
"type": "NUMBER"
}
]
}
```
@@ -9,94 +9,50 @@
package com.cobblemon.mod.common.api.ai.config
import com.bedrockk.molang.runtime.MoLangRuntime
import com.bedrockk.molang.runtime.struct.QueryStruct
import com.bedrockk.molang.runtime.value.DoubleValue
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.api.ai.ActivityConfigurationContext
import com.cobblemon.mod.common.api.ai.BehaviourConfigurationContext
import com.cobblemon.mod.common.api.ai.ExpressionOrEntityVariable
import com.cobblemon.mod.common.api.molang.MoLangFunctions.addStandardFunctions
import com.cobblemon.mod.common.api.molang.ExpressionLike
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asMostSpecificMoLangValue
import com.cobblemon.mod.common.api.molang.MoLangFunctions.setup
import com.cobblemon.mod.common.api.molang.ObjectValue
import com.cobblemon.mod.common.api.npc.configuration.MoLangConfigVariable
import com.cobblemon.mod.common.api.scripting.CobblemonScripts
import com.cobblemon.mod.common.util.activityRegistry
import com.cobblemon.mod.common.util.asExpression
import com.cobblemon.mod.common.util.asIdentifierDefaultingNamespace
import com.cobblemon.mod.common.util.cobblemonResource
import com.cobblemon.mod.common.util.resolve
import com.cobblemon.mod.common.util.asExpressionLike
import com.cobblemon.mod.common.util.withQueryValue
import com.mojang.datafixers.util.Either
import com.mojang.datafixers.util.Pair
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.ai.behavior.BehaviorControl
import net.minecraft.world.entity.ai.memory.MemoryModuleType
import net.minecraft.world.entity.ai.sensing.SensorType
/**
* Runs a MoLang script as part of the entity's behaviour configuration. Variables can be configured here for convenience.
*
* When [executeEarly] is true, the script will run in an earlier phase than most configs, allowing it to get ahead of
* other behaviour configurations that might depend on the changes made by the script.
*
* @author Hiroku
* @since August 11th, 2025
*/
class ScriptBehaviourConfig : BehaviourConfig {
/** If true, the script will execute as part of the getVariables phase. */
val executeEarly: Boolean = false
val condition: ExpressionOrEntityVariable = Either.left("true".asExpression())
val script = cobblemonResource("dummy")
val script: ExpressionLike = "0".asExpressionLike()
val variables = mutableListOf<MoLangConfigVariable>()
val memories = emptySet<MemoryModuleType<*>>()
val sensors = emptySet<SensorType<*>>()
override fun getVariables(entity: LivingEntity) = variables
private fun runScript(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) {
if (!checkCondition(behaviourConfigurationContext, condition)) return
script.resolve(behaviourConfigurationContext.runtime)
}
override fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) = variables
override fun preconfigure(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) {
if (executeEarly) {
runScript(entity = entity, behaviourConfigurationContext = behaviourConfigurationContext)
}
}
override fun configure(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) {
if (!checkCondition(entity, condition)) return
val runtime = MoLangRuntime().setup()
runtime.withQueryValue("entity", entity.asMostSpecificMoLangValue())
val struct = createBrainStruct(entity, behaviourConfigurationContext)
val script = CobblemonScripts.scripts[this.script]
?: run {
Cobblemon.LOGGER.error("Tried loading script $script as part of an entity brain but that script does not exist")
return
}
behaviourConfigurationContext.addMemories(memories)
behaviourConfigurationContext.addSensors(sensors)
runtime.resolve(script, mapOf("brain" to struct))
}
fun createBrainStruct(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext): QueryStruct {
return QueryStruct(hashMapOf()).addStandardFunctions()
.addFunction("entity") { entity.asMostSpecificMoLangValue() }
.addFunction("create_activity") { params ->
val name = params.getString(0).asIdentifierDefaultingNamespace()
val activity = entity.level().activityRegistry.get(name) ?: return@addFunction run {
Cobblemon.LOGGER.error("Tried loading activity $name as part of an entity brain but that activity does not exist")
DoubleValue.ZERO
}
val existingActivityBuilder = behaviourConfigurationContext.activities.find { it.activity == activity }
if (existingActivityBuilder != null) {
return@addFunction createActivityStruct(existingActivityBuilder)
} else {
val activityConfigurationContext = ActivityConfigurationContext(activity)
behaviourConfigurationContext.activities.add(activityConfigurationContext)
return@addFunction createActivityStruct(activityConfigurationContext)
}
}
.addFunction("set_core_activities") { params ->
behaviourConfigurationContext.coreActivities = params.params.map { (it as ObjectValue<ActivityConfigurationContext>).obj.activity }.toSet()
return@addFunction DoubleValue.ONE
}
.addFunction("set_default_activity") { params ->
behaviourConfigurationContext.defaultActivity = params.get<ObjectValue<ActivityConfigurationContext>>(0).obj.activity
return@addFunction DoubleValue.ONE
}
}
fun createActivityStruct(activityConfigurationContext: ActivityConfigurationContext): ObjectValue<ActivityConfigurationContext> {
val struct = ObjectValue(activityConfigurationContext)
struct.addStandardFunctions()
.addFunction("add_task") { params ->
val priority = params.getInt(0)
val task = params.get(1) as ObjectValue<BehaviorControl<in LivingEntity>>
activityConfigurationContext.tasks.add(Pair(priority, task.obj))
}
return struct
if (!executeEarly) {
runScript(entity = entity, behaviourConfigurationContext = behaviourConfigurationContext)
}
}
}
@@ -15,7 +15,7 @@ import net.minecraft.world.entity.schedule.Activity
class SetCoreActivities : BehaviourConfig {
val activities = mutableListOf<Activity>()
override fun getVariables(entity: LivingEntity) = emptyList<MoLangConfigVariable>()
override fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) = emptyList<MoLangConfigVariable>()
override fun configure(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) {
behaviourConfigurationContext.coreActivities = activities.toSet()
}
@@ -16,7 +16,7 @@ import net.minecraft.world.entity.schedule.Activity
class SetDefaultActivity : BehaviourConfig {
val activity: Activity = Activity.IDLE
override fun getVariables(entity: LivingEntity) = emptyList<MoLangConfigVariable>()
override fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) = emptyList<MoLangConfigVariable>()
override fun configure(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) {
behaviourConfigurationContext.defaultActivity = activity
}
@@ -8,27 +8,21 @@
package com.cobblemon.mod.common.api.ai.config
import com.bedrockk.molang.runtime.MoLangRuntime
import com.cobblemon.mod.common.api.ai.BehaviourConfigurationContext
import com.cobblemon.mod.common.api.molang.ExpressionLike
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asMostSpecificMoLangValue
import com.cobblemon.mod.common.api.molang.MoLangFunctions.setup
import com.cobblemon.mod.common.api.npc.configuration.MoLangConfigVariable
import com.cobblemon.mod.common.entity.MoLangScriptingEntity
import com.cobblemon.mod.common.util.resolve
import com.cobblemon.mod.common.util.withQueryValue
import net.minecraft.world.entity.LivingEntity
class SetVariablesConfig : BehaviourConfig {
var variableValues = mutableMapOf<String, ExpressionLike>()
override fun getVariables(entity: LivingEntity) = emptyList<MoLangConfigVariable>()
override fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) = emptyList<MoLangConfigVariable>()
override fun configure(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) {
val runtime = MoLangRuntime().setup()
runtime.withQueryValue("entity", entity.asMostSpecificMoLangValue())
if (entity is MoLangScriptingEntity) {
variableValues.forEach { (variableName, valueExpression) ->
entity.config.setDirectly(variableName, runtime.resolve(valueExpression))
entity.config.setDirectly(variableName, behaviourConfigurationContext.runtime.resolve(valueExpression))
}
}
}
@@ -0,0 +1,46 @@
/*
* 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.ai.config.task
import com.cobblemon.mod.common.api.ai.BehaviourConfigurationContext
import com.cobblemon.mod.common.api.molang.ExpressionLike
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asMostSpecificMoLangValue
import com.cobblemon.mod.common.api.npc.configuration.MoLangConfigVariable
import com.cobblemon.mod.common.util.asExpressionLike
import com.cobblemon.mod.common.util.mainThreadRuntime
import com.cobblemon.mod.common.util.withQueryValue
import net.minecraft.server.level.ServerLevel
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.ai.behavior.BehaviorControl
import net.minecraft.world.entity.ai.behavior.OneShot
import net.minecraft.world.entity.schedule.Activity
class ActivityChangeTaskConfig : SingleTaskConfig {
val activity: Activity = Activity.IDLE
val condition: ExpressionLike = "false".asExpressionLike()
override fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext): List<MoLangConfigVariable> = emptyList()
override fun createTask(
entity: LivingEntity,
behaviourConfigurationContext: BehaviourConfigurationContext
): BehaviorControl<in LivingEntity> {
return object : OneShot<LivingEntity>() {
override fun trigger(serverLevel: ServerLevel, livingEntity: LivingEntity, l: Long): Boolean {
mainThreadRuntime.withQueryValue("entity", livingEntity.asMostSpecificMoLangValue())
if (condition.resolveBoolean(mainThreadRuntime)) {
livingEntity.brain.setActiveActivityIfPossible(activity)
return true
} else {
return false
}
}
}
}
}
@@ -16,6 +16,7 @@ import com.cobblemon.mod.common.api.ai.config.task.WanderTaskConfig.Companion.WA
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asMostSpecificMoLangValue
import com.cobblemon.mod.common.api.npc.configuration.MoLangConfigVariable
import com.cobblemon.mod.common.util.asExpression
import com.cobblemon.mod.common.util.mainThreadRuntime
import com.cobblemon.mod.common.util.resolveFloat
import com.cobblemon.mod.common.util.withQueryValue
import com.mojang.datafixers.util.Either
@@ -38,7 +39,7 @@ class AirWanderTaskConfig : SingleTaskConfig {
val minUpwardsMovement: ExpressionOrEntityVariable = Either.left("3.0".asExpression())
val minDownwardsMovement: ExpressionOrEntityVariable = Either.left("3.0".asExpression())
override fun getVariables(entity: LivingEntity): List<MoLangConfigVariable> {
override fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext): List<MoLangConfigVariable> {
return listOf(condition, wanderChance, horizontalRange, verticalRange, speedMultiplier, minUpwardsMovement, minDownwardsMovement).asVariables()
}
@@ -46,8 +47,7 @@ class AirWanderTaskConfig : SingleTaskConfig {
entity: LivingEntity,
behaviourConfigurationContext: BehaviourConfigurationContext
): BehaviorControl<in LivingEntity>? {
runtime.withQueryValue("entity", entity.asMostSpecificMoLangValue())
if (!condition.resolveBoolean()) return null
if (!condition.resolveBoolean(behaviourConfigurationContext.runtime)) return null
behaviourConfigurationContext.addMemories(MemoryModuleType.WALK_TARGET, MemoryModuleType.LOOK_TARGET, CobblemonMemories.PATH_COOLDOWN)
val wanderChanceExpression = wanderChance.asSimplifiedExpression(entity)
@@ -62,15 +62,16 @@ class AirWanderTaskConfig : SingleTaskConfig {
return@Trigger false
}
val runtime = mainThreadRuntime
runtime.withQueryValue("entity", entity.asMostSpecificMoLangValue())
val wanderChance = runtime.resolveFloat(wanderChanceExpression)
if (wanderChance <= 0 || world.random.nextFloat() > wanderChance) return@Trigger false
val rotVec = entity.getViewVector(0F)
pathCooldown.setWithExpiry(true, 60L)
val target = HoverRandomPos.getPos(entity, horizontalRange.resolveInt(), verticalRange.resolveInt(), rotVec.x, rotVec.y, 1.5707964f, minUpwardsMovement.resolveInt(), minDownwardsMovement.resolveInt())
val target = HoverRandomPos.getPos(entity, horizontalRange.resolveInt(runtime), verticalRange.resolveInt(runtime), rotVec.x, rotVec.y, 1.5707964f, minUpwardsMovement.resolveInt(runtime), minDownwardsMovement.resolveInt(runtime))
?: return@Trigger false
walkTarget.set(WalkTarget(target, speedMultiplier.resolveFloat(), 3))
walkTarget.set(WalkTarget(target, speedMultiplier.resolveFloat(runtime), 3))
lookTarget.set(BlockPosTracker(target))
return@Trigger true
}
@@ -10,9 +10,7 @@ package com.cobblemon.mod.common.api.ai.config.task
import com.cobblemon.mod.common.api.ai.BehaviourConfigurationContext
import com.cobblemon.mod.common.api.ai.ExpressionOrEntityVariable
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asMostSpecificMoLangValue
import com.cobblemon.mod.common.util.asExpression
import com.cobblemon.mod.common.util.withQueryValue
import com.mojang.datafixers.util.Either
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.ai.behavior.BehaviorControl
@@ -21,14 +19,12 @@ class AllOfTaskConfig : TaskConfig {
val condition: ExpressionOrEntityVariable = Either.left("true".asExpression())
val tasks: List<TaskConfig> = emptyList()
override fun getVariables(entity: LivingEntity) = tasks.flatMap { it.getVariables(entity) }
override fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) = tasks.flatMap { it.getVariables(entity, behaviourConfigurationContext) }
override fun createTasks(
entity: LivingEntity,
behaviourConfigurationContext: BehaviourConfigurationContext
): List<BehaviorControl<in LivingEntity>> {
runtime.withQueryValue("entity", entity.asMostSpecificMoLangValue())
if (!condition.resolveBoolean()) return emptyList()
if (!condition.resolveBoolean(behaviourConfigurationContext.runtime)) return emptyList()
return tasks.flatMap { it.createTasks(entity, behaviourConfigurationContext) }
}
}
@@ -17,7 +17,7 @@ import net.minecraft.world.entity.ai.behavior.BehaviorControl
import net.minecraft.world.entity.ai.memory.MemoryModuleType
class AttackAngryAtTaskConfig : SingleTaskConfig {
override fun getVariables(entity: LivingEntity) = emptyList<MoLangConfigVariable>()
override fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) = emptyList<MoLangConfigVariable>()
override fun createTask(
entity: LivingEntity,
behaviourConfigurationContext: BehaviourConfigurationContext
@@ -16,8 +16,8 @@ import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.ai.behavior.BehaviorControl
class AttackHostileMobsTaskConfig : SingleTaskConfig {
override fun getVariables(entity: LivingEntity): List<MoLangConfigVariable> {
return emptyList<MoLangConfigVariable>()
override fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext): List<MoLangConfigVariable> {
return emptyList()
}
override fun createTask(
@@ -10,11 +10,8 @@ package com.cobblemon.mod.common.api.ai.config.task
import com.cobblemon.mod.common.api.ai.BehaviourConfigurationContext
import com.cobblemon.mod.common.api.ai.ExpressionOrEntityVariable
import com.cobblemon.mod.common.api.ai.asVariables
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asMostSpecificMoLangValue
import com.cobblemon.mod.common.api.npc.configuration.MoLangConfigVariable
import com.cobblemon.mod.common.util.asExpression
import com.cobblemon.mod.common.util.withQueryValue
import com.mojang.datafixers.util.Either
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.ai.behavior.BehaviorControl
@@ -24,13 +21,12 @@ import net.minecraft.world.entity.ai.sensing.SensorType
class CalmDownTaskConfig : SingleTaskConfig {
var condition: ExpressionOrEntityVariable = Either.left("true".asExpression())
override fun getVariables(entity: LivingEntity) = emptyList<MoLangConfigVariable>()
override fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) = emptyList<MoLangConfigVariable>()
override fun createTask(
entity: LivingEntity,
behaviourConfigurationContext: BehaviourConfigurationContext
): BehaviorControl<in LivingEntity>? {
runtime.withQueryValue("entity", entity.asMostSpecificMoLangValue())
if (!condition.resolveBoolean()) return null
if (!condition.resolveBoolean(behaviourConfigurationContext.runtime)) return null
behaviourConfigurationContext.addMemories(
MemoryModuleType.HURT_BY,
MemoryModuleType.HURT_BY_ENTITY,
@@ -12,11 +12,9 @@ import com.cobblemon.mod.common.CobblemonMemories
import com.cobblemon.mod.common.api.ai.BehaviourConfigurationContext
import com.cobblemon.mod.common.api.ai.ExpressionOrEntityVariable
import com.cobblemon.mod.common.api.ai.asVariables
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asMostSpecificMoLangValue
import com.cobblemon.mod.common.api.npc.configuration.MoLangConfigVariable
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.util.asExpression
import com.cobblemon.mod.common.util.withQueryValue
import com.mojang.datafixers.util.Either
import kotlin.jvm.optionals.getOrNull
import net.minecraft.world.entity.LivingEntity
@@ -27,7 +25,9 @@ import net.minecraft.world.entity.ai.memory.MemoryModuleType
import net.minecraft.world.entity.ai.sensing.SensorType
/**
* Checks nearby entities and counts how many have nominated this entity as their leader.
* Checks nearby entities and counts how many have nominated this entity as their leader. We normally update this
* as people join and leave the herd, but this is a fallback to make sure we don't get stuck with an incorrect value
* like if the entities die or whatever.
*
* @author Hiroku
* @since June 17th, 2025
@@ -35,7 +35,7 @@ import net.minecraft.world.entity.ai.sensing.SensorType
class CountFollowersTaskConfig : SingleTaskConfig {
val checkTicks: ExpressionOrEntityVariable = Either.left("10".asExpression())
override fun getVariables(entity: LivingEntity): List<MoLangConfigVariable> {
override fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext): List<MoLangConfigVariable> {
return listOf(checkTicks).asVariables()
}
@@ -43,8 +43,7 @@ class CountFollowersTaskConfig : SingleTaskConfig {
entity: LivingEntity,
behaviourConfigurationContext: BehaviourConfigurationContext
): BehaviorControl<in LivingEntity>? {
runtime.withQueryValue("entity", entity.asMostSpecificMoLangValue())
val checkTicksValue = checkTicks.resolveInt()
val checkTicksValue = checkTicks.resolveInt(behaviourConfigurationContext.runtime)
behaviourConfigurationContext.addMemories(
MemoryModuleType.NEAREST_VISIBLE_LIVING_ENTITIES,
CobblemonMemories.HERD_SIZE,
@@ -23,14 +23,14 @@ class DoNothingTaskConfig : SingleTaskConfig {
val condition: ExpressionOrEntityVariable = Either.left("true".asExpression())
val minDurationTicks: ExpressionOrEntityVariable = Either.left("40".asExpression())
val maxDurationTicks: ExpressionOrEntityVariable = Either.left("80".asExpression())
override fun getVariables(entity: LivingEntity) = listOf(minDurationTicks, maxDurationTicks).asVariables()
override fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) = listOf(minDurationTicks, maxDurationTicks).asVariables()
override fun createTask(
entity: LivingEntity,
behaviourConfigurationContext: BehaviourConfigurationContext
): BehaviorControl<in LivingEntity>? {
runtime.withQueryValue("entity", entity.asMostSpecificMoLangValue())
if (!condition.resolveBoolean()) return null
return DoNothing(minDurationTicks.resolveInt(), maxDurationTicks.resolveInt())
if (!condition.resolveBoolean(behaviourConfigurationContext.runtime)) return null
return DoNothing(minDurationTicks.resolveInt(behaviourConfigurationContext.runtime), maxDurationTicks.resolveInt(behaviourConfigurationContext.runtime))
}
}
@@ -29,7 +29,7 @@ class EatGrassTaskConfig : SingleTaskConfig {
val cooldown = numberVariable(category = EATING_GRASS, name = COOLDOWN, default = 20 * 20).asExpressible()
val eatGrassChance = numberVariable(category = EATING_GRASS, name = EAT_GRASS_CHANCE, default = 1 / (20 * 20F)).asExpressible()
override fun getVariables(entity: LivingEntity): List<MoLangConfigVariable> {
override fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext): List<MoLangConfigVariable> {
return listOf(
cooldown,
eatGrassChance
@@ -44,7 +44,7 @@ class EatGrassTaskConfig : SingleTaskConfig {
return null
}
val chance = eatGrassChance.resolveFloat()
val chance = eatGrassChance.resolveFloat(behaviourConfigurationContext.runtime)
if (chance == 0F) {
return null
}
@@ -54,7 +54,7 @@ class EatGrassTaskConfig : SingleTaskConfig {
return WrapperLivingEntityTask(
EatGrassTask(
chance,
cooldown.resolveInt().toLong()
cooldown.resolveInt(behaviourConfigurationContext.runtime).toLong()
),
PokemonEntity::class.java
)
@@ -0,0 +1,38 @@
/*
* 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.ai.config.task
import com.cobblemon.mod.common.CobblemonMemories
import com.cobblemon.mod.common.api.ai.BehaviourConfigurationContext
import com.cobblemon.mod.common.api.ai.WrapperLivingEntityTask.Companion.wrapped
import com.cobblemon.mod.common.api.npc.configuration.MoLangConfigVariable
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.entity.pokemon.ai.tasks.EatHeldItemTask
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.ai.behavior.BehaviorControl
class EatHeldItemTaskConfig : SingleTaskConfig {
override fun getVariables(
entity: LivingEntity,
behaviourConfigurationContext: BehaviourConfigurationContext
) = emptyList<MoLangConfigVariable>()
override fun createTask(
entity: LivingEntity,
behaviourConfigurationContext: BehaviourConfigurationContext
): BehaviorControl<in LivingEntity>? {
if (entity !is PokemonEntity) {
return null
}
behaviourConfigurationContext.addMemories(
CobblemonMemories.IS_CONSUMING_ITEM,
)
return EatHeldItemTask(entity).wrapped<PokemonEntity>()
}
}
@@ -28,7 +28,7 @@ class ExitBattleWhenHurtTaskConfig : SingleTaskConfig {
var condition = booleanVariable(SharedEntityVariables.BATTLING_CATEGORY, "exit_battle_when_hurt", true).asExpressible()
var includePassiveDamage = booleanVariable(SharedEntityVariables.BATTLING_CATEGORY, "exit_battle_from_passive_damage", true).asExpressible()
override fun getVariables(entity: LivingEntity) = listOf(
override fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) = listOf(
condition,
includePassiveDamage
).asVariables()
@@ -37,10 +37,9 @@ class ExitBattleWhenHurtTaskConfig : SingleTaskConfig {
entity: LivingEntity,
behaviourConfigurationContext: BehaviourConfigurationContext
): BehaviorControl<in LivingEntity>? {
runtime.withQueryValue("entity", entity.asMostSpecificMoLangValue())
if (!condition.resolveBoolean()) return null
if (!condition.resolveBoolean(behaviourConfigurationContext.runtime)) return null
val includePassiveDamage = includePassiveDamage.resolveBoolean()
val includePassiveDamage = includePassiveDamage.resolveBoolean(behaviourConfigurationContext.runtime)
behaviourConfigurationContext.addMemories(
MemoryModuleType.HURT_BY,
@@ -32,7 +32,7 @@ import net.minecraft.world.level.pathfinder.PathComputationType
*/
class FindAirTaskConfig : SingleTaskConfig {
val walkSpeed = numberVariable(SharedEntityVariables.MOVEMENT_CATEGORY, SharedEntityVariables.WALK_SPEED, 0.35).asExpressible()
override fun getVariables(entity: LivingEntity): List<MoLangConfigVariable> {
override fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext): List<MoLangConfigVariable> {
return listOf(walkSpeed).asVariables()
}
@@ -8,17 +8,16 @@
package com.cobblemon.mod.common.api.ai.config.task
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.CobblemonMemories
import com.cobblemon.mod.common.api.ai.BehaviourConfigurationContext
import com.cobblemon.mod.common.api.ai.ExpressionOrEntityVariable
import com.cobblemon.mod.common.api.ai.asVariables
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asMostSpecificMoLangValue
import com.cobblemon.mod.common.api.npc.configuration.MoLangConfigVariable
import com.cobblemon.mod.common.api.storage.party.PartyStore
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.pokemon.ai.ToleratedHerdLeader
import com.cobblemon.mod.common.util.asExpression
import com.cobblemon.mod.common.util.withQueryValue
import com.mojang.datafixers.util.Either
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.ai.behavior.BehaviorControl
@@ -53,24 +52,25 @@ class FindHerdLeaderTaskConfig : SingleTaskConfig {
it is PokemonEntity &&
it != currentLeader &&
it.pokemon.storeCoordinates.get()?.store !is PartyStore &&
it.getHerdSize() < it.behaviour.herd.maxSize
it.getHerdSize() < it.behaviour.herd.maxSize &&
!it.brain.hasMemoryValue(CobblemonMemories.POKEMON_DROWSY)
}.forEach { possibleLeader ->
possibleLeader as PokemonEntity
val matchingHerdLeader = entity.behaviour.herd.bestMatchLeader(entity, possibleLeader) ?: return@forEach
val alreadyIsALeader = possibleLeader.brain.hasMemoryValue(CobblemonMemories.HERD_SIZE)
val nestedHerdTier = currentLeaderEntity?.getHerdTier() ?: 0
if (nestedHerdTier >= matchingHerdLeader.tier) {
val bestMatchingHerdLeader = entity.behaviour.herd.bestMatchLeader(entity, possibleLeader) ?: return@forEach
val possibleLeaderIsAlreadyALeader = possibleLeader.brain.hasMemoryValue(CobblemonMemories.HERD_SIZE)
val currentLeaderHerdTier = currentLeaderEntity?.getHerdTier() ?: entity.getHerdTier()
if (currentLeaderHerdTier >= bestMatchingHerdLeader.tier) {
return@forEach // This leader is following a leader of a higher tier, we can't replace them
}
val distance = entity.distanceTo(possibleLeader)
if (matchingHerdLeader.tier < bestTier) {
if (bestMatchingHerdLeader.tier < bestTier) {
return@forEach // No need to check further if this leader is worse than the best found so far
} else if ((distance > bestDistance && !alreadyIsALeader) && matchingHerdLeader.tier == bestTier) {
} else if ((distance > bestDistance && !possibleLeaderIsAlreadyALeader) && bestMatchingHerdLeader.tier == bestTier) {
return@forEach // No need to check further if this leader is farther than the best found so far, unless they are already a leader - I'd prefer to join a pack
} else {
bestLeader = possibleLeader
bestDistance = distance
bestTier = matchingHerdLeader.tier
bestTier = bestMatchingHerdLeader.tier
}
}
return bestLeader ?: currentLeaderEntity
@@ -80,7 +80,7 @@ class FindHerdLeaderTaskConfig : SingleTaskConfig {
// How frequently to check for whether it should herd. Probably isn't that expensive but might use this for chance.
val checkTicks: ExpressionOrEntityVariable = Either.left("60".asExpression())
override fun getVariables(entity: LivingEntity): List<MoLangConfigVariable> {
override fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext): List<MoLangConfigVariable> {
return listOf(checkTicks).asVariables()
}
@@ -98,8 +98,7 @@ class FindHerdLeaderTaskConfig : SingleTaskConfig {
MemoryModuleType.WALK_TARGET
)
behaviourConfigurationContext.addSensors(SensorType.NEAREST_LIVING_ENTITIES)
runtime.withQueryValue("entity", entity.asMostSpecificMoLangValue())
val checkTicksValue = checkTicks.resolveInt()
val checkTicksValue = checkTicks.resolveInt(behaviourConfigurationContext.runtime)
return BehaviorBuilder.create { instance ->
instance.group(
instance.present(MemoryModuleType.NEAREST_VISIBLE_LIVING_ENTITIES),
@@ -119,6 +118,7 @@ class FindHerdLeaderTaskConfig : SingleTaskConfig {
herdLeader.set(bestLeader.uuid.toString())
bestLeader.brain.eraseMemory(CobblemonMemories.HERD_LEADER)
bestLeader.adjustHerdSize(1)
return@Trigger true
}
}
@@ -14,23 +14,34 @@ import com.cobblemon.mod.common.api.ai.BehaviourConfigurationContext
import com.cobblemon.mod.common.api.ai.ExpressionOrEntityVariable
import com.cobblemon.mod.common.api.ai.WrapperLivingEntityTask
import com.cobblemon.mod.common.api.ai.asVariables
import com.cobblemon.mod.common.api.molang.ExpressionLike
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.entity.pokemon.ai.tasks.FindRestingPlaceTask
import com.cobblemon.mod.common.util.asExpression
import com.cobblemon.mod.common.util.asExpressionLike
import com.cobblemon.mod.common.util.resolveBoolean
import com.mojang.datafixers.util.Either
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.ai.behavior.BehaviorControl
import net.minecraft.world.entity.ai.memory.MemoryModuleType
class FindRestingPlaceTaskConfig : SingleTaskConfig {
val condition: ExpressionLike = "true".asExpressionLike()
val horizontalSearchDistance: ExpressionOrEntityVariable = Either.left("16".asExpression())
val verticalSearchDistance: ExpressionOrEntityVariable = Either.left("5".asExpression())
override fun getVariables(entity: LivingEntity) = listOf(horizontalSearchDistance, verticalSearchDistance).asVariables()
override fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) = listOf(horizontalSearchDistance, verticalSearchDistance).asVariables()
override fun createTask(
entity: LivingEntity,
behaviourConfigurationContext: BehaviourConfigurationContext
): BehaviorControl<in LivingEntity>? {
if (entity !is PokemonEntity) {
return null
}
if (!behaviourConfigurationContext.runtime.resolveBoolean(condition)) {
return null
}
behaviourConfigurationContext.addMemories(
CobblemonMemories.PATH_COOLDOWN,
CobblemonMemories.POKEMON_DROWSY,
@@ -39,7 +50,7 @@ class FindRestingPlaceTaskConfig : SingleTaskConfig {
behaviourConfigurationContext.addSensors(CobblemonSensors.POKEMON_DROWSY)
return WrapperLivingEntityTask(
FindRestingPlaceTask.create(horizontalSearchDistance.resolveInt(), verticalSearchDistance.resolveInt()),
FindRestingPlaceTask.create(horizontalSearchDistance.resolveInt(behaviourConfigurationContext.runtime), verticalSearchDistance.resolveInt(behaviourConfigurationContext.runtime)),
PokemonEntity::class.java
)
}
@@ -9,45 +9,36 @@
package com.cobblemon.mod.common.api.ai.config.task
import com.cobblemon.mod.common.api.ai.BehaviourConfigurationContext
import com.cobblemon.mod.common.api.ai.WrapperLivingEntityTask
import com.cobblemon.mod.common.api.ai.ExpressionOrEntityVariable
import com.cobblemon.mod.common.api.ai.asVariables
import com.cobblemon.mod.common.api.ai.config.task.SharedEntityVariables.FLEE_DESIRED_DISTANCE
import com.cobblemon.mod.common.api.ai.config.task.SharedEntityVariables.FLEE_SPEED_MULTIPLIER
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asMostSpecificMoLangValue
import com.cobblemon.mod.common.util.withQueryValue
import com.cobblemon.mod.common.api.npc.configuration.MoLangConfigVariable
import com.cobblemon.mod.common.entity.ai.FleeFromAttackerTask
import com.cobblemon.mod.common.util.asExpression
import com.mojang.datafixers.util.Either
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.PathfinderMob
import net.minecraft.world.entity.ai.behavior.BehaviorControl
import net.minecraft.world.entity.ai.behavior.SetWalkTargetAwayFrom
import net.minecraft.world.entity.ai.memory.MemoryModuleType
import net.minecraft.world.entity.ai.sensing.SensorType
class FleeAttackerTaskConfig : SingleTaskConfig {
var condition = booleanVariable(SharedEntityVariables.FEAR_CATEGORY, "flee_attacker", true).asExpressible()
var speedMultiplier = numberVariable(SharedEntityVariables.FEAR_CATEGORY, FLEE_SPEED_MULTIPLIER, 0.5).asExpressible()
var desiredDistance = numberVariable(SharedEntityVariables.FEAR_CATEGORY, FLEE_DESIRED_DISTANCE, 9).asExpressible()
val avoidDurationTicks: ExpressionOrEntityVariable = Either.left("600".asExpression())
override fun getVariables(entity: LivingEntity) = listOf(
condition,
speedMultiplier,
desiredDistance
).asVariables()
override fun getVariables(
entity: LivingEntity,
behaviourConfigurationContext: BehaviourConfigurationContext
): List<MoLangConfigVariable> {
return listOf(avoidDurationTicks).asVariables()
}
override fun createTask(
entity: LivingEntity,
behaviourConfigurationContext: BehaviourConfigurationContext
): BehaviorControl<in LivingEntity>? {
runtime.withQueryValue("entity", entity.asMostSpecificMoLangValue())
if (!condition.resolveBoolean() || entity !is PathfinderMob) return null
behaviourConfigurationContext.addMemories(MemoryModuleType.HURT_BY_ENTITY, MemoryModuleType.WALK_TARGET)
behaviourConfigurationContext.addSensors(SensorType.HURT_BY)
val speedMultiplier = speedMultiplier.resolveFloat()
val desiredDistance = desiredDistance.resolveInt()
return WrapperLivingEntityTask(
SetWalkTargetAwayFrom.entity(MemoryModuleType.HURT_BY_ENTITY, speedMultiplier, desiredDistance, false),
PathfinderMob::class.java
): BehaviorControl<in LivingEntity> {
behaviourConfigurationContext.addMemories(
MemoryModuleType.HURT_BY_ENTITY,
MemoryModuleType.AVOID_TARGET
)
behaviourConfigurationContext.addSensors(SensorType.HURT_BY)
return FleeFromAttackerTask.create(avoidDurationTicks.asExpression())
}
}
@@ -27,18 +27,17 @@ class FleeNearestHostileTaskConfig : SingleTaskConfig {
var speedMultiplier = numberVariable(SharedEntityVariables.FEAR_CATEGORY, FLEE_SPEED_MULTIPLIER, 0.5).asExpressible()
var desiredDistance = numberVariable(SharedEntityVariables.FEAR_CATEGORY, FLEE_DESIRED_DISTANCE, 9).asExpressible()
override fun getVariables(entity: LivingEntity) = listOf(condition, speedMultiplier, desiredDistance).asVariables()
override fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) = listOf(condition, speedMultiplier, desiredDistance).asVariables()
override fun createTask(
entity: LivingEntity,
behaviourConfigurationContext: BehaviourConfigurationContext
): BehaviorControl<in LivingEntity>? {
runtime.withQueryValue("entity", entity.asMostSpecificMoLangValue())
if (!condition.resolveBoolean() || entity !is PathfinderMob) return null
if (!condition.resolveBoolean(behaviourConfigurationContext.runtime) || entity !is PathfinderMob) return null
behaviourConfigurationContext.addMemories(MemoryModuleType.NEAREST_HOSTILE, MemoryModuleType.WALK_TARGET)
behaviourConfigurationContext.addSensors(SensorType.VILLAGER_HOSTILES)
val speedMultiplier = speedMultiplier.resolveFloat()
val desiredDistance = desiredDistance.resolveInt()
val speedMultiplier = speedMultiplier.resolveFloat(behaviourConfigurationContext.runtime)
val desiredDistance = desiredDistance.resolveInt(behaviourConfigurationContext.runtime)
return WrapperLivingEntityTask(
SetWalkTargetAwayFrom.entity(MemoryModuleType.NEAREST_HOSTILE, speedMultiplier, desiredDistance, false),
PathfinderMob::class.java
@@ -38,7 +38,7 @@ class FlyInCirclesTaskConfig : SingleTaskConfig {
val minDurationTicks: ExpressionOrEntityVariable = Either.left("60".asExpression())
val maxDurationTicks: ExpressionOrEntityVariable = Either.left("180".asExpression())
override fun getVariables(entity: LivingEntity): List<MoLangConfigVariable> {
override fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext): List<MoLangConfigVariable> {
return listOf(
minAngularVelocityDegrees,
maxAngularVelocityDegrees,
@@ -57,15 +57,14 @@ class FlyInCirclesTaskConfig : SingleTaskConfig {
return null
}
behaviourConfigurationContext.addMemories(MemoryModuleType.WALK_TARGET, MemoryModuleType.PATH)
runtime.withQueryValue("entity", entity.asMostSpecificMoLangValue())
return CircleAroundTask(
poseTypes = poseTypes,
minTurnAngleDegrees = minAngularVelocityDegrees.resolveFloat(),
maxTurnAngleDegrees = maxAngularVelocityDegrees.resolveFloat(),
speed = speed.resolveFloat(),
verticalSpeed = verticalSpeed.resolveFloat(),
minDurationTicks = minDurationTicks.resolveFloat().toInt(),
maxDurationTicks = maxDurationTicks.resolveFloat().toInt()
minTurnAngleDegrees = minAngularVelocityDegrees.resolveFloat(behaviourConfigurationContext.runtime),
maxTurnAngleDegrees = maxAngularVelocityDegrees.resolveFloat(behaviourConfigurationContext.runtime),
speed = speed.resolveFloat(behaviourConfigurationContext.runtime),
verticalSpeed = verticalSpeed.resolveFloat(behaviourConfigurationContext.runtime),
minDurationTicks = minDurationTicks.resolveFloat(behaviourConfigurationContext.runtime).toInt(),
maxDurationTicks = maxDurationTicks.resolveFloat(behaviourConfigurationContext.runtime).toInt()
).wrapped<PokemonEntity>()
}
}
@@ -19,7 +19,7 @@ import net.minecraft.world.entity.ai.behavior.BehaviorControl
import net.minecraft.world.entity.ai.memory.MemoryModuleType
class FollowHerdLeaderTaskConfig : SingleTaskConfig {
override fun getVariables(entity: LivingEntity): List<MoLangConfigVariable> {
override fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext): List<MoLangConfigVariable> {
return listOf()
}
@@ -27,13 +27,12 @@ class FollowWalkTargetTaskConfig : SingleTaskConfig {
val minRunTicks: ExpressionOrEntityVariable = Either.left("150".asExpression())
val maxRunTicks: ExpressionOrEntityVariable = Either.left("250".asExpression())
override fun getVariables(entity: LivingEntity) = listOf(minRunTicks, maxRunTicks).asVariables()
override fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) = listOf(minRunTicks, maxRunTicks).asVariables()
override fun createTask(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext): BehaviorControl<LivingEntity>? {
runtime.withQueryValue("entity", entity.asMostSpecificMoLangValue())
behaviourConfigurationContext.addMemories(MemoryModuleType.WALK_TARGET, MemoryModuleType.PATH, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE)
return WrapperLivingEntityTask(
FollowWalkTargetTask(minRunTicks.resolveInt(), maxRunTicks.resolveInt()),
FollowWalkTargetTask(minRunTicks.resolveInt(behaviourConfigurationContext.runtime), maxRunTicks.resolveInt(behaviourConfigurationContext.runtime)),
PathfinderMob::class.java
)
}
@@ -26,14 +26,13 @@ class GetAngryAtAttackerTaskConfig : SingleTaskConfig {
val condition = booleanVariable(ATTACKING_CATEGORY, GET_ANGRY_AT_ATTACKER, true).asExpressible()
override fun getVariables(entity: LivingEntity) = listOf(condition).asVariables()
override fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) = listOf(condition).asVariables()
override fun createTask(
entity: LivingEntity,
behaviourConfigurationContext: BehaviourConfigurationContext
): BehaviorControl<in LivingEntity>? {
runtime.withQueryValue("entity", entity.asMostSpecificMoLangValue())
if (!condition.resolveBoolean()) return null
if (!condition.resolveBoolean(behaviourConfigurationContext.runtime)) return null
behaviourConfigurationContext.addMemories(
MemoryModuleType.HURT_BY_ENTITY,
MemoryModuleType.ANGRY_AT,
@@ -30,7 +30,7 @@ class GoToHealingMachineTaskConfig : SingleTaskConfig {
val completionRange: ExpressionOrEntityVariable = Either.left("1".asExpression())
val walkSpeed = numberVariable(SharedEntityVariables.MOVEMENT_CATEGORY, SharedEntityVariables.WALK_SPEED, 0.35).asExpressible()
override fun getVariables(entity: LivingEntity) = listOf(condition, walkSpeed, horizontalSearchRange, verticalSearchRange, completionRange).asVariables()
override fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) = listOf(condition, walkSpeed, horizontalSearchRange, verticalSearchRange, completionRange).asVariables()
companion object {
const val SELF_HEALING = "self_healing"
@@ -41,8 +41,7 @@ class GoToHealingMachineTaskConfig : SingleTaskConfig {
entity: LivingEntity,
behaviourConfigurationContext: BehaviourConfigurationContext
): BehaviorControl<in LivingEntity>? {
runtime.withQueryValue("entity", entity.asMostSpecificMoLangValue())
if (!condition.resolveBoolean()) return null
if (!condition.resolveBoolean(behaviourConfigurationContext.runtime)) return null
behaviourConfigurationContext.addMemories(
MemoryModuleType.WALK_TARGET,
MemoryModuleType.LOOK_TARGET,
@@ -11,9 +11,12 @@ package com.cobblemon.mod.common.api.ai.config.task
import com.cobblemon.mod.common.CobblemonMemories
import com.cobblemon.mod.common.api.ai.BehaviourConfigurationContext
import com.cobblemon.mod.common.api.ai.asVariables
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asMostSpecificMoLangValue
import com.cobblemon.mod.common.api.npc.configuration.MoLangConfigVariable
import com.cobblemon.mod.common.entity.OmniPathingEntity
import com.cobblemon.mod.common.util.closestPosition
import com.cobblemon.mod.common.util.mainThreadRuntime
import com.cobblemon.mod.common.util.withQueryValue
import kotlin.math.ceil
import kotlin.math.floor
import net.minecraft.core.BlockPos
@@ -33,7 +36,7 @@ import net.minecraft.world.level.pathfinder.PathComputationType
*/
class GoToLandTaskConfig : SingleTaskConfig {
val walkSpeed = numberVariable(SharedEntityVariables.MOVEMENT_CATEGORY, SharedEntityVariables.WALK_SPEED, 0.35).asExpressible()
override fun getVariables(entity: LivingEntity): List<MoLangConfigVariable> {
override fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext): List<MoLangConfigVariable> {
return listOf(walkSpeed).asVariables()
}
@@ -60,7 +63,8 @@ class GoToLandTaskConfig : SingleTaskConfig {
entity as PathfinderMob
val walkSpeedValue = walkSpeed.resolveFloat()
mainThreadRuntime.withQueryValue("entity", entity.asMostSpecificMoLangValue())
val walkSpeedValue = walkSpeed.resolveFloat(mainThreadRuntime)
val iterable = BlockPos.betweenClosed(
Mth.floor(entity.x - 8.0),

Some files were not shown because too many files have changed in this diff Show More