Compare commits

...
Author SHA1 Message Date
Paul a7e6e638fe Added run_command molang function to general query structs and player structs 2024-05-20 09:10:04 +10:00
Paul 9ef3ea2932 Use context for flows because it's cooler, added more functions to pokemon related molang 2024-05-19 19:08:56 +10:00
Paul 38dcee3327 Merge remote-tracking branch 'origin/sega_bass_pro_fishing_2' into event-flows
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonNetwork.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokeball/EmptyPokeBallEntity.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/util/MoLangExtensions.kt
2024-05-19 11:27:18 +10:00
Hiroku f81e8ba766 Merge branch 'npcs' into 'sega_bass_pro_fishing_2'
NPC foundationwork that's not implemented but I need the tech for reasons

See merge request cable-mc/cobblemon!1024
2024-05-19 00:31:46 +00:00
Plastered_Crab 2f3ae9bc5e - correct particles now play at certain events when fishing 2024-05-16 15:37:11 -07:00
apion ccbe33bfe5 Fixed missing texture on fishing particle 2024-05-16 17:55:23 -04:00
apion 0989c90eb3 Fixed server sync issue on rod registry 2024-05-16 17:11:32 -04:00
apion ddcd0ffd37 Merge branch 'refs/heads/main' into sega_bass_pro_fishing_2
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonSounds.kt
2024-05-16 16:57:47 -04:00
Plastered_Crab 1f5d15e59d - rods now use NBT to store baits on them 2024-05-16 13:21:32 -07:00
Plastered_Crab a3ff4b6b81 - more particle work and dynamic tooltip parsing 2024-05-15 22:22:46 -07:00
apion 90c5180712 Revert "update Forge to current RB, update Fabric deps to latest"
This reverts commit 7139d4708b.
2024-05-15 18:17:29 -04:00
Plastered_Crab d2c084e4af - more setup for the dynamic tooltips 2024-05-15 12:37:52 -07:00
Plastered_Crab 98eda52866 - adjustments to fishing particles 2024-05-15 12:13:07 -07:00
Plastered_Crab c9d3cbd848 - initial steps for dynamic tooltips for pokerods + test particles 2024-05-15 10:34:22 -07:00
Nick 158aa05f24 Merge branch 'fix/downgrade-loom' into 'main'
fix: resolve mapping issues by downgrading loom

See merge request cable-mc/cobblemon!1015
2024-05-15 15:38:09 +00:00
Apion 8924d0fe0f Merge branch 'navneetset-main-patch-27693' into 'main'
Fix PC store downsizing not working with .resize()

See merge request cable-mc/cobblemon!1016
2024-05-15 12:12:04 +00:00
PebblesandApion d510eaa462 Fix PC store downsizing not working with .resize() 2024-05-15 12:12:04 +00:00
Hiroku 8b63057d9d Merge branch 'we-ballin' into 'main'
Cherish, Dream, Beast, and Ancient Origin Send Out Particles

See merge request cable-mc/cobblemon!1018
2024-05-15 10:26:08 +00:00
Hiroku d572b3c505 Missed a bit [skip-ci] 2024-05-15 10:25:21 +00:00
Hiroku 8edc60224a Merge branch 'main' into 'we-ballin'
# Conflicts:
#   CHANGELOG.md
2024-05-15 10:24:54 +00:00
Hiroku a634c4f046 Merge branch 'update-libs' into 'main'
Update libs

See merge request cable-mc/cobblemon!1017
2024-05-15 10:23:14 +00:00
MoeBoy76 7139d4708b update Forge to current RB, update Fabric deps to latest 2024-05-15 11:11:02 +10:00
dhi_holo 50e99736a3 Partial Fix
Origin Ball now plays correctly in resource pack, but not in the mod itself, updated jsons to match, so all that's left is working out why the mod refuses to read the new jsons even though the new jsons are read in the files, in intellij, and in github desktop.
2024-05-15 10:43:09 +10:00
Plastered_Crab e9a2bed304 - fixed bobber splash sounds (again) 2024-05-14 17:42:40 -07:00
Plastered_Crab 6476f61d09 - fixed bobber splash sounds 2024-05-14 17:37:43 -07:00
MoeBoy76 68c4acf0eb Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon 2024-05-15 09:21:22 +10:00
Sterrezo 74ae10b342 Sound updates and fixes 2024-05-15 01:02:24 +02:00
Plastered_Crab 9e2b15e9ec - implementation of new Bobber landing sounds 2024-05-14 15:27:19 -07:00
broccoli 5b5e7109f5 fix: resolve mapping issues by downgrading loom
fixes regression in fd7b82dbe3
2024-05-14 23:17:16 +01:00
Plastered_Crab d401b987ce - Changed FishingSpawnContext to allow for min and max Lure Levels of rod enchants
- first implementation of new Bobber landing sounds
2024-05-14 14:53:09 -07:00
Hiroku 37596523db Merge branch 'tmetcalfe89/abstract-stat-ratio-requirement' into 'main'
abstracted stat ratio requirement

See merge request cable-mc/cobblemon!1011
2024-05-14 20:15:13 +00:00
Plastered_Crab b7ba3f62f7 - Made all berries work as bait as well as their effects
- Reworked IV bait logic to allow for stacking effects
- Fixed Glow Berries and Sweet Berries to work as bait
2024-05-14 12:35:43 -07:00
tmetcalfe89 eb80c20dbf updated readme 2024-05-14 09:11:16 -07:00
Apion 3813ec3c92 Merge branch 'sound' into 'main'
Renamed Relic Coin Sack sound assets. Added new sounds for Relic Coin Pouches.

See merge request cable-mc/cobblemon!1013
2024-05-14 14:12:24 +00:00
Sterrezo 9be212d2b8 Renamed Relic Coin Sack sound assets. Added new sounds for Relic Coin Pouches.
Renamed all sounds called "coin_pouch..." to "relic_coin_sack..." Added new sounds for breaking and placing Relic Coin Pouches with a new sound group for them.
2024-05-14 13:27:11 +02:00
tmetcalfe89 2559257b3a added licenses 2024-05-14 01:16:30 -07:00
Apion a1687e8304 Merge branch 'tmetcalfe89/ensure-defeat-count' into 'main'
Ensure update total defeat count on battle win

See merge request cable-mc/cobblemon!1010
2024-05-14 07:25:09 +00:00
tmetcalfe89 3aa95b9339 abstracted stat ratio requirement 2024-05-13 23:39:01 -07:00
tmetcalfe89 4e97f70801 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into tmetcalfe89/ensure-defeat-count 2024-05-13 22:39:56 -07:00
dhi_holo 404ca565f5 4 balls maybe working
Send out particles for Cherish, Dream, Beast, and Ancient Origin balls

Needs testing on one issue before MR
2024-05-14 15:35:32 +10:00
MoeBoy76 93db0e1cda Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon 2024-05-14 08:57:15 +10:00
Paul 78d34e0ae6 Mergo conflicto 2024-05-13 21:16:25 +10:00
Paul 4f7630eee0 Merge branch 'refs/heads/sega_bass_pro_fishing_2' into npcs
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonEntities.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonNetwork.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/battles/BattleBuilder.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/ClientMoLangFunctions.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/PoseableEntityState.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonEntity.kt
#	common/src/main/resources/cobblemon-common.accesswidener
#	gradle/libs.versions.yml
2024-05-13 20:55:16 +10:00
Hiroku 1bf9d36dbd Merge branch 'wheres-the-tag-drake' into 'main'
Updated fossils.json Item Tag

Closes #834

See merge request cable-mc/cobblemon!1009
2024-05-13 09:45:38 +00:00
dhi_holo b19c5ed125 Updated fossils.json Item Tag
Sorted the fossils tag to match the order on Bulbapedia (just to make sure all other fossils were there, and because it looks a little nicer), and added Fossilized Drake to the tag
2024-05-13 17:51:19 +10:00
Paul c1b5e58f8a Added Lure Ball functionality, improved spawning API's use of causes, added forcedAspects to Pokemon, added aspect/unaspect in PokemonProperties 2024-05-13 17:42:36 +10:00
Paul b1904ab3fd Sega Bas Pro Fishing 2™ is the 1.6.0 branch 2024-05-13 15:19:23 +10:00
Paul 949925ca9f Merge remote-tracking branch 'origin/main' into sega_bass_pro_fishing_2 2024-05-13 15:17:19 +10:00
Paul e3cca0d9cf SpawnAction#complete returns R instead of Boolean 2024-05-13 15:08:55 +10:00
tmetcalfe89 1aa55f8199 replaced entity ref with originalPokemon 2024-05-12 21:49:58 -07:00
Paul 4c16b2ce2e Track friendship on client entities, tweaks to dataTracker initializing, MoLang in pose & quirk conditions 2024-05-13 12:47:53 +10:00
Hiroku 920e314444 Merge branch '830-only-player-entity-can-send-out-pokemon' into 'main'
Remove unnecessary cast of phaseTarget to PlayerEntity in PokemonRenderer.renderTransition

Closes #830

See merge request cable-mc/cobblemon!1008
2024-05-12 10:23:34 +00:00
David Sadler 3e4fdc0f22 Remove unnecessary cast of phaseTarget to PlayerEntity in PokemonRenderer.renderTransition 2024-05-12 11:04:52 +01:00
Hiroku 209ac71e06 Merge branch 'FossilTankFixes' into 'main'
Fix for using incorrect item count when applying organic material with right click.

See merge request cable-mc/cobblemon!1007
2024-05-12 08:05:27 +00:00
JazzMcNade ecfc77f311 Updated Changelog 2024-05-12 02:49:19 -05:00
JazzMcNade e64de3aa7d Fixed a bug in which adding organic material was adding the full count of the stack currently in hand 2024-05-12 01:29:55 -05:00
Nick fd7b82dbe3 Merge branch 'build/gradle-updates' into 'main'
gradle and build improvements

See merge request cable-mc/cobblemon!1006
2024-05-11 23:40:09 +00:00
broccolaiandNick 7ef48402fb gradle and build improvements 2024-05-11 23:40:09 +00:00
Nick 81ac6f3b44 Snapshot = true 2024-05-11 16:39:06 -07:00
Paul 347e10d7e4 Snapshot = false 2024-05-12 08:20:46 +10:00
Paul 7ebe0551e1 Fixed build issue caused by unnecessary AW 2024-05-11 18:54:29 +10:00
Paul 6e1d4e0c4d Merge remote-tracking branch 'origin/main' into sega_bass_pro_fishing_2 2024-05-11 18:32:10 +10:00
Paul 32270b6176 Attempt at fixing data migration error in species features 2024-05-11 14:39:49 +10:00
Hiroku a0a26a98b5 Merge branch 'V-lpen-main-patch-49919' into 'main'
Update dragapult.json

See merge request cable-mc/cobblemon!996
2024-05-11 04:37:18 +00:00
Hiroku 85836f19b2 Merge branch 'held_item_back' into 'main'
Fixed held items without consumable tags from being consumed or swapped in battle.

See merge request cable-mc/cobblemon!1005
2024-05-11 04:36:47 +00:00
Hiroku 9f251b7070 Update CHANGELOG.md 2024-05-11 04:36:13 +00:00
Segfault Guy 86ddb6d743 Fixed held items without consumable tags from being consumed or swapped in battle. 2024-05-11 00:15:26 -04:00
Paul 9c8a00bbdc Fixed bad moveset JSON for Kyurem 2024-05-11 13:04:50 +10:00
Hiroku 04abf2bd25 Update CHANGELOG.md [skip-ci] 2024-05-11 00:27:36 +00:00
Paul e6553655a6 Changelog update heading [skip-ci] 2024-05-11 10:19:43 +10:00
Paul 5f33d16a75 More changelog cleanup 2024-05-11 09:53:00 +10:00
Hiroku 468f84862e Merge branch '1.5-structure-fixes' into 'main'
Deleted Duplicate Loot Table

See merge request cable-mc/cobblemon!1003
2024-05-10 22:27:50 +00:00
Slippy e863c6d094 Deleted Duplicate Loot Table 2024-05-10 16:19:15 -05:00
Nick 5b2d542fca Merge branch 'Myslippy-main-patch-94569' into 'main'
Update CHANGELOG.md

See merge request cable-mc/cobblemon!1002
2024-05-10 20:06:14 +00:00
Myslippy 95db34c55e Update CHANGELOG.md 2024-05-10 19:41:41 +00:00
Paul 15da48c5c0 Merge remote-tracking branch 'origin/main' 2024-05-10 18:42:29 +10:00
Paul ead62763c1 Changelog cleanup 2024-05-10 18:42:22 +10:00
apion 247c475c2d Fix oversight in incendium fix 2024-05-09 23:44:04 -04:00
Hiroku 44aab4f0e7 Merge branch 'spawn-fixes' into 'main'
Spawn fixes

See merge request cable-mc/cobblemon!1001
2024-05-10 03:02:48 +00:00
Frank The FarmerandHiroku 94edae591c Spawn fixes 2024-05-10 03:02:48 +00:00
Hiroku c83f045b4d Merge branch 'incendium-fix' into 'main'
Fixes #823

Closes #823

See merge request cable-mc/cobblemon!999
2024-05-10 00:16:23 +00:00
apion b5d7786ff7 Fixes #823 2024-05-09 20:05:03 -04:00
Paul 9283794e26 Merge remote-tracking branch 'origin/main' 2024-05-10 09:53:11 +10:00
Hiroku 55580fb564 Merge branch 'sound' into 'main'
Flamethrower sound fixes

See merge request cable-mc/cobblemon!998
2024-05-09 23:52:44 +00:00
Paul 472c9be634 Applied pt-pt translations 2024-05-10 09:49:07 +10:00
Sterrezo a247344ae4 Removed unused audio files 2024-05-10 01:41:03 +02:00
FrankTheFarmer 1fd0a9775c Flamethrower is flamethrowering now 2024-05-10 09:39:32 +10:00
Hiroku 9d9495f1f9 Merge branch 'fix-adorn-compat' into 'main'
Fixed adorn compat

See merge request cable-mc/cobblemon!997
2024-05-09 22:56:26 +00:00
apion 88e301d7c8 Fixed adorn compat 2024-05-09 18:53:44 -04:00
Hiroku b0e16a7f26 Merge branch 'FossilTankCreateFix' into 'main'
Fossil Tank Create Fix

See merge request cable-mc/cobblemon!993
2024-05-09 22:07:43 +00:00
Hiroku 54b5b3cbbc Merge branch 'implement_pokemon' into 'main'
Forgot to merge request

See merge request cable-mc/cobblemon!992
2024-05-09 22:07:14 +00:00
Frank The FarmerandHiroku 7850bc5263 Forgot to merge request 2024-05-09 22:07:14 +00:00
V-lpen 8ce5a927b9 Update dragapult.json 2024-05-09 19:19:22 +00:00
Test 24c34af8bf remove random color from ui text 2024-05-08 22:25:19 +00:00
Hiroku 7402426656 Merge branch 'tmetcalfe89/fletchinder-name-ru' into 'main'
in Russian translation the fletchinder was called fletchling

See merge request cable-mc/cobblemon!990
2024-05-08 20:47:41 +00:00
Hiroku c658e496cc Merge branch 'GildedChestHopperInteractionFix' into 'main'
Hoppers can now interact with all inventory slots in a Gilded Chest, Closes #822

Closes #822

See merge request cable-mc/cobblemon!994
2024-05-08 20:40:42 +00:00
JazzMcNade f3300806a3 Hoppers can now interact with all inventory slots in a Gilded Chest 2024-05-08 02:12:53 -05:00
JazzMcNade 8fee4de49b Graceful transition to new inventory, fixed item scatterer 2024-05-08 01:28:41 -05:00
JazzMcNade 5b951ef511 Added Anti-item clogging technology to the fossil tank 2024-05-07 23:43:40 -05:00
tmetcalfe89 6e0850331a held item too 2024-05-06 12:40:22 -07:00
tmetcalfe89 79b1771e7e quick fix 2024-05-06 10:00:50 -07:00
JazzMcNade c9b2c44083 Fixed create chute crash and item duping when chutes attempt to put items in a restoration tank. Refactored RestorationTankEntity to use SimpleInventory 2024-05-05 20:19:09 -05:00
Hiroku c370076337 Merge branch 'bye-j16' into 'main'
Bye J16

See merge request cable-mc/cobblemon!988
2024-05-05 03:34:07 +00:00
MoeBoy76 a0b263e392 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon 2024-05-03 10:45:11 +10:00
MoeBoy76 d05ae4d535 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into bye-j16 2024-05-03 10:19:18 +10:00
MoeBoy76 3cebfb38ef fix mixin compat level being set to Java 16 for no reason 2024-05-03 10:18:58 +10:00
Apion d69f1f17b6 Merge branch 'implement_pokemon' into 'main'
Daily Implementation Mission

See merge request cable-mc/cobblemon!987
2024-05-02 06:59:35 +00:00
Frank The FarmerandApion 3ba89472fa Daily Implementation Mission 2024-05-02 06:59:35 +00:00
MoeBoy76 573608b6fc Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon 2024-05-02 16:04:01 +10:00
MoeBoy76 f092584f83 changelog blank line at end [skip-ci] 2024-05-02 16:03:52 +10:00
Apion a76146f8e9 Merge branch 'JSON-Poser-Tweaks' into 'main'
Json poser tweaks

See merge request cable-mc/cobblemon!986
2024-05-02 05:53:59 +00:00
Frank The FarmerandApion 548daa84e4 Json poser tweaks 2024-05-02 05:53:59 +00:00
Apion 7f1dd4546b Merge branch 'can-moe-scrape' into 'main'
Blueberry DLC

Closes #757, #649, and #758

See merge request cable-mc/cobblemon!953
2024-05-02 05:48:29 +00:00
MoeBoy76andApion a129c361df Blueberry DLC 2024-05-02 05:48:29 +00:00
Hiroku 5d5508a71e Merge branch '1.5-structure-fixes' into 'main'
1.5 structure fixes

See merge request cable-mc/cobblemon!984
2024-04-29 12:29:34 +00:00
Hiroku 5e5684d9fd Merge branch 'implement_pokemon' into 'main'
A couple fixes

See merge request cable-mc/cobblemon!985
2024-04-29 12:29:16 +00:00
Frank The FarmerandHiroku a1623c04b7 A couple fixes 2024-04-29 12:29:15 +00:00
Slippy a070dc56bd Cleaning up unused files 2024-04-29 01:05:00 -05:00
Slippy 79f9e0f0f2 Gimmi Towers now have more junk it can generate at the top 2024-04-29 00:59:41 -05:00
Slippy 8500eb58ef Removed spam log issues and blended some structures into the world better 2024-04-29 00:49:48 -05:00
Hiroku 97e51eb7b5 Merge branch 'removing-items-is-hard' into 'main'
Update is_held_item.json

See merge request cable-mc/cobblemon!983
2024-04-29 05:44:20 +00:00
dhi_holo ba75dcdf31 Update is_held_item.json
why is removing held items so damn annoying, can't we just get vera to fasttrack the sprites instead /j
2024-04-29 15:19:59 +10:00
Paul 9bf8c0e3ec Fixed MOVING data tracker field not using the new logic that drives the pose 2024-04-29 11:25:12 +10:00
Hiroku 0c62c247ec Merge branch '1.5-bug-fixes' into 'main'
(misleading branch name) Run config changes

See merge request cable-mc/cobblemon!980
2024-04-29 00:16:52 +00:00
Hiroku c70e8872ce Merge branch 'implement_pokemon' into 'main'
Implementation yet again

See merge request cable-mc/cobblemon!982
2024-04-29 00:10:19 +00:00
Frank The FarmerandHiroku ce323ddfbf Implementation yet again 2024-04-29 00:10:19 +00:00
Hiroku ffe7978560 Merge branch 'no-more-heldies' into 'main'
Commented out the Held Items

See merge request cable-mc/cobblemon!981
2024-04-28 07:44:29 +00:00
dhi_holo a58632752a Commented out the Held Items
(just the ones without sprites, ofc, just trying to scare public git readers)
2024-04-28 17:21:23 +10:00
apion 0b93481dbf Remove unneeded imports 2024-04-27 13:10:21 -04:00
apion dda004a66c Change default run configs to generate with a uuid and username 2024-04-27 13:05:44 -04:00
Paul 7aef56c610 license 2024-04-27 14:28:30 +10:00
Paul 27e1a34097 Merge remote-tracking branch 'origin/main' into sega_bass_pro_fishing_2
# Conflicts:
#	common/src/main/resources/assets/cobblemon/textures/item/poke_balls/beast_ball.png
2024-04-27 12:43:42 +10:00
apion 9648a91f4a Fixed fabric server run config, split client and server run folders 2024-04-26 20:35:50 -04:00
Hiroku e0c4bf7fb2 Merge branch 'implement_pokemon' into 'main'
Today's implementation fixes

See merge request cable-mc/cobblemon!977
2024-04-26 23:23:50 +00:00
Frank The FarmerandHiroku ed919f63f0 Today's implementation fixes 2024-04-26 23:23:49 +00:00
Apion 239acc0623 Merge branch '1.5-structure-fixes' into 'main'
One more try

See merge request cable-mc/cobblemon!978
2024-04-26 22:12:46 +00:00
Slippy e835b833b3 One more try 2024-04-26 16:48:04 -05:00
Hiroku 8f1127be46 Merge branch 'pve-fix' into 'main'
Fix BattleBuilder's Successful-ness

See merge request cable-mc/cobblemon!976
2024-04-26 00:44:27 +00:00
Hiroku 26a8bf1ca5 Merge branch 'idev-botarium-crash-fix' into 'main'
Fix for a very specific issue where Botarium and Cobblemon will have mapping...

See merge request cable-mc/cobblemon!975
2024-04-25 23:43:58 +00:00
Stampede d3da8c99a8 Simplify battle success fix and apply to 1v1s 2024-04-25 16:41:56 -05:00
Stampede d106deb7f6 Fix PvE battles not returning successful even it was 2024-04-25 14:32:57 -05:00
Waterpicker f1d1e87e47 Fix for a very specific issue where Botarium and Cobblemon will have mapping conflicts indev when the project uses mojang due to how kotlin syntax works. 2024-04-25 12:20:48 -05:00
Paul 2d9d6e172c Updated pt_pt 2024-04-25 19:19:07 +10:00
Paul 3c03b0e210 Updated many translations (de_de, en_pt, es_es, es_mx, fr_ca, fr_fr, ja_jp, ko_kr, pl_pl, ru_ru) 2024-04-25 19:03:35 +10:00
Nick 724c674992 Fix packet/mixin issues related to forge, bump KFF version, and build details 2024-04-24 22:07:31 -07:00
Paul 99eb317a87 Fixed Kabuto animations 2024-04-25 13:32:06 +10:00
Hiroku 43a2c2f55d Merge branch 'implement_pokemon' into 'main'
Implementation stuff

See merge request cable-mc/cobblemon!973
2024-04-25 02:00:16 +00:00
Frank The FarmerandHiroku 4db9a35f2b Implementation stuff 2024-04-25 02:00:16 +00:00
Hiroku 8228ac517b Merge branch 'interpreter_my_beloved' into 'main'
Misc interpreter refactor fixes

See merge request cable-mc/cobblemon!972
2024-04-24 02:48:02 +00:00
Segfault Guy c7ae41bf7b Merge branch 'main' into interpreter_my_beloved 2024-04-23 22:43:06 -04:00
Segfault Guy 1653be5fa8 Misc refactor fixes. 2024-04-23 22:42:00 -04:00
Hiroku b0497065f4 Merge branch '1.5-spawns-and-fixes' into 'main'
1.5 spawns and fixes

See merge request cable-mc/cobblemon!968
2024-04-24 02:34:03 +00:00
Paul dfc1a39f58 Merge branch 'refs/heads/main' into 1.5-spawns-and-fixes
# Conflicts:
#	CHANGELOG.md
2024-04-24 12:30:17 +10:00
Paul 9a92e074a2 Fixed instant particle emitter not defaulting the number of particles the way it does in Snowstorm 2024-04-24 11:38:59 +10:00
Hiroku 44b195f0a6 Updated changelog with exact counts for structures [skip-ci] 2024-04-22 23:34:40 +00:00
Hiroku 7c21e6feb5 Merge branch '1.5-Structures' into 'main'
1.5 structures

See merge request cable-mc/cobblemon!971
2024-04-22 22:33:21 +00:00
Slippy 3b653b745e suspicious mound shoved further into the ground 2024-04-22 17:20:46 -05:00
Paul b25dc6610e Fixed bobber spawning not working 2024-04-22 11:20:54 +10:00
Paul fa67bba631 Merge remote-tracking branch 'origin/main' into sega_bass_pro_fishing_2
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonItems.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonNetwork.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonSounds.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/advancement/CobblemonCriteria.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/CobblemonClient.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/block/DisplayCaseRenderer.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen1/MagikarpModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/item/group/CobblemonItemGroups.kt
#	common/src/main/resources/assets/cobblemon/bedrock/pokemon/animations/0129_magikarp/magikarp.animation.json
2024-04-22 11:07:52 +10:00
Paul f246d90e4c Merge remote-tracking branch 'origin/main' 2024-04-22 09:11:59 +10:00
Hiroku df22cc5b3e Merge branch 'advancement-description-inconsistencies-fixes' into 'main'
Update en_us.json

Closes #809

See merge request cable-mc/cobblemon!969
2024-04-21 23:11:49 +00:00
Paul 3fbe2102a0 Fixed curves not working properly at the particle level if they weren't always on screen, closes #806 2024-04-22 09:11:39 +10:00
dhi_holo 21b667f5d8 Update en_us.json
Corrects two advancement descriptions to be accurate and match formatting of all other advancements.

I think I made the branch name longer than the changes, looking at it in githubdesktop I'm not so sure now xD
2024-04-21 16:35:29 +10:00
Paul eb88a43769 Fixed bedrock particle rotation velocity being treated as blocks per tick instead of blocks per second, closes #807 2024-04-21 15:32:07 +10:00
Paul c41a6766ef Fixed lookat_y camera mode 2024-04-21 15:31:19 +10:00
Paul 842de0e92c Fixed woopsy with automaton armor trim advancement 2024-04-21 15:30:50 +10:00
Veraxiel 04b516765d Edited Moon Stone Ore gen. Updated changelog. 2024-04-21 00:44:28 -04:00
Paul 3faad69484 Oops remove that TODO 2024-04-21 12:36:13 +10:00
Paul 74e2f8429c Fixed expiration events not running for particles when they expire on collision. Closes #805 2024-04-21 12:35:53 +10:00
Paul 10219fbf38 Made vivillon advancement description consistent on punctuation. Closes #809 2024-04-21 12:33:15 +10:00
Hiroku cf68ccc29e Merge branch 'sound' into 'main'
Removed an unused sound file

See merge request cable-mc/cobblemon!966
2024-04-21 02:29:58 +00:00
Hiroku f78847f917 Merge branch 'mistrim' into 'main'
Trim Recipe Fixes

See merge request cable-mc/cobblemon!967
2024-04-21 02:29:17 +00:00
Village 8768c4c541 differentiate badly poisoned in ui 2024-04-17 21:50:03 -04:00
Veraxiel 2bf0fd625b Tweaked some spawns, flipped the Poison Barb sprite for looking too much like a sword when held. 2024-04-17 19:49:53 -04:00
dhi_holo 65e3052e69 Removed Missing Textures
Automaton Trims now work when trimming same material (Iron Armour, Iron Trim Material, same for diamond, gold, and netherite)
2024-04-16 17:00:28 +10:00
dhi_holo be7192ae2c Trim Recipe Fixes
+ Adds duplication recipe
+ Adds advancement to unlock duplication recipe
- Renamed smithing recipe to match Vanilla
+ Adds advancement to unlock smithing recipe
2024-04-16 16:14:45 +10:00
Sterrezo 1c921a372b Removed an unused sound file
My guess is it was put there when battle effects or particles were being worked on. As far as I can tell it's not used anywhere.
2024-04-15 23:14:01 +02:00
Nick cf3587557d Merge branch 'ui-icon' into 'main'
Update shiny icon

See merge request cable-mc/cobblemon!963
2024-04-15 19:14:48 +00:00
TestandNick bbd44c0010 Update shiny icon 2024-04-15 19:14:48 +00:00
Nick bb05177985 Merge branch 'imposter_fix' into 'main'
Imposter fixes

See merge request cable-mc/cobblemon!965
2024-04-15 19:14:18 +00:00
Segfault GuyandNick 31143359ee Imposter fixes 2024-04-15 19:14:18 +00:00
Nick c8f0140870 Merge branch '1.5-Structures' into 'main'
found a spelling error smh

See merge request cable-mc/cobblemon!964
2024-04-15 19:13:00 +00:00
MyslippyandNick 0b9ca3a97c found a spelling error smh 2024-04-15 19:12:59 +00:00
Slippy d03541ff6f iron bar fix 2024-04-15 00:56:31 -05:00
Slippy 0d7aff0349 Please work 2024-04-15 00:24:54 -05:00
Slippy c904888c6a found a spelling error smh 2024-04-13 09:12:21 -05:00
Hiroku 450ebfc44e Merge branch 'scripts/public-spawn-writer-script' into 'main'
public spawn writer script open beta

See merge request cable-mc/cobblemon!961
2024-04-13 01:26:36 +00:00
Hiroku 253bde945f Merge branch 'gilded-chest-crash-fix' into 'main'
Fixes gilded chest encounter from crashing when party is empty.

See merge request cable-mc/cobblemon!962
2024-04-13 01:06:14 +00:00
Islana 3622946974 Fixes gilded chest encounter from crashing when party is empty. 2024-04-12 19:52:33 -04:00
Paul 9d49ce086a merge conflict bug resolution 2024-04-11 15:10:17 +10:00
Paul 5f8c1d5b6d Merge remote-tracking branch 'origin/main' into npcs
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonCommands.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/battles/model/PokemonBattle.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/battles/ShowdownInterpreter.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/battles/interpreter/instructions/FaintInstruction.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/CobblemonClient.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/entity/PokemonClientDelegate.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/JsonPokemonPoseableModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/PokemonPoseableModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/pokemon/PokemonRenderer.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/command/TestCommand.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonEntity.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonServerDelegate.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/particle/SnowstormParticleReader.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/pokemon/Pokemon.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/util/MiscUtils.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/util/WorldExtensions.kt
2024-04-11 14:36:52 +10:00
Hiroku 4077feca35 Merge branch '1.5-Structures' into 'main'
It wasnt the last D:

See merge request cable-mc/cobblemon!960
2024-04-11 02:37:44 +00:00
Waldleufer bf330c112b Allowing any combination of Folder and File Name [skip-ci] 2024-04-10 21:47:26 +02:00
Slippy c07d7d304e It wasnt the last D: 2024-04-09 19:19:02 -05:00
Hiroku 5797a2e568 Merge branch '1.5-Structures' into 'main'
1.5 structures

See merge request cable-mc/cobblemon!959
2024-04-10 00:16:49 +00:00
Slippy 5f94999b4f Is this the last push? 2024-04-09 19:15:02 -05:00
Hiroku 8b8fa06472 Update 0999_gimmighoul.json 2024-04-09 01:24:18 +00:00
Hiroku 0459780171 Update 0442_spiritomb.json 2024-04-09 00:22:21 +00:00
Hiroku e27bf7fc4b Merge branch 'ys/forfeit' into 'main'
PVP Forfeit Option

Closes #142

See merge request cable-mc/cobblemon!957
2024-04-08 14:28:57 +00:00
Paul 36007caf16 Merge remote-tracking branch 'origin/main' into ys/forfeit
# Conflicts:
#	common/src/main/resources/assets/cobblemon/lang/en_us.json
2024-04-08 22:55:49 +10:00
Hiroku f00b16ab1a Merge branch 'better_victory_msg' into 'main'
Fix capture messages and improve win/defeat messages.

See merge request cable-mc/cobblemon!958
2024-04-08 12:25:37 +00:00
Hiroku ac93c89d2c Merge branch '1.5-more-spawn-and-drops' into 'main'
1.5 more spawn and drops

See merge request cable-mc/cobblemon!954
2024-04-08 12:22:00 +00:00
Hiroku 1c5f6a8f54 Merge branch 'implement_pokemon' into 'main'
Hisui Starters, some model, animation, & texture fixes, and more!

See merge request cable-mc/cobblemon!956
2024-04-08 04:09:18 +00:00
Segfault Guy f66358e358 Fix capture messages and improve win/defeat messages. 2024-04-07 22:53:50 -04:00
Tyzillion 446706e6cd Moved my conditions from PokemonEntity to EntityExtensions. 2024-04-07 22:50:42 -04:00
Segfault Guy 967fd2e0ec Force Showdown loss on forfeit. 2024-04-07 22:48:38 -04:00
Tyzillion 57d2b51264 Sorry, found another error in the changelog. 2024-04-07 22:29:21 -04:00
Tyzillion 4baa43ccb4 Quick changelog amend. 2024-04-07 22:26:28 -04:00
Tyzillion c9be0104dd Updated Changelog. 2024-04-07 22:14:04 -04:00
Tyzillion 55a179f548 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2024-04-07 22:11:23 -04:00
Tyzillion beaea0e88c Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2024-04-07 22:11:05 -04:00
Tyzillion fb54ff8054 Revamped Torkoal's particles. Made the particles only appear in battle. Hoping in the future when it gets more animations to add quirks that have it spew smoke. 2024-04-07 22:10:52 -04:00
Hiroku c273192ba2 Merge branch 'tumbleshatter' into 'main'
Reduces Tumblestone blocks to a 2x2 recipe, makes Tumblestone blocks drop the tumblestones on break

See merge request cable-mc/cobblemon!955
2024-04-08 02:06:33 +00:00
dhi_holo acfc3b1acc Tumbleshatter
Tumblestone Blocks now shatter back into tumblestones on breaking, unless using silk touch
2024-04-08 09:44:38 +10:00
dhi_holo e45e7a589b Reduces Tumblestone blocks to a 2x2 recipe
(this is for future content)
2024-04-08 09:09:31 +10:00
FrankTheFarmerReal 0fc3bf9de7 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2024-04-08 07:15:42 +10:00
FrankTheFarmerReal b6af9381f0 Ferroseed line is not from gen 2 🤔 2024-04-08 07:14:59 +10:00
Sterrezo ee64810970 Cry checker script fix 2024-04-07 23:05:51 +02:00
Tyzillion a7152f3e35 Added ambient Bubble particles to Krabby that play during sunset with no rain. 2024-04-07 14:09:11 -04:00
Tyzillion 46290554c5 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2024-04-07 14:08:38 -04:00
Tyzillion 771a2c0727 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2024-04-07 14:08:03 -04:00
Segfault Guy 4e456e030d Merge branch 'main' into ys/forfeit
Conflicts:
	common/src/main/kotlin/com/cobblemon/mod/common/api/battles/model/PokemonBattle.kt
	common/src/main/kotlin/com/cobblemon/mod/common/battles/ShowdownActionRequest.kt
	common/src/main/resources/assets/cobblemon/lang/en_us.json
2024-04-07 13:33:34 -04:00
FrankTheFarmerReal 9d69c593b8 Hitbox and Look animation fixes. Stopped Ferroseed and Whirlipede turbo spins. 2024-04-08 00:05:29 +10:00
Hiroku 6e58f4be59 Merge branch 'illusion' into 'main'
Illusion and Transform Entity Effects

Closes #769, #744, #741, #297, and #123

See merge request cable-mc/cobblemon!929
2024-04-07 01:33:47 +00:00
FrankTheFarmerReal f1807dc27c Many many fix 2024-04-06 22:13:33 +10:00
Tyzillion cb8e96230e Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2024-04-06 04:48:37 -04:00
Paul dc6b3ada9b Fixed F3-T crash on Fabric. Closes #780 2024-04-06 13:28:39 +10:00
Paul ccdb8803b2 Merge remote-tracking branch 'origin/main' into implement_pokemon 2024-04-06 12:00:24 +10:00
Paul fd917438a1 Fixed Pokémon pathing over snow layers and carpets. Closes #783 2024-04-06 11:44:39 +10:00
Tyzillion 4a0e567554 Fixed starterconfig to use right features 2024-04-05 16:18:46 -04:00
Tyzillion bb6b67e4aa Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2024-04-05 16:16:23 -04:00
Slippy 6515bfa108 Decaying Crypt no longer has a random floating granite block 2024-04-05 12:14:57 -05:00
FrankTheFarmerReal 8bf5492409 10 Fixes + Retextures implemented 2024-04-05 23:46:02 +10:00
FrankTheFarmerReal e6573f3c3b Sneasel hitbox fixes 2024-04-05 15:28:53 +10:00
Tyzillion 86d8fa1806 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2024-04-05 00:10:56 -04:00
Hiroku de65320610 Merge branch 'SortFaintedToBottom_Fix' into 'main'
Sort fainted to bottom fix

See merge request cable-mc/cobblemon!932
2024-04-05 02:57:21 +00:00
Hiroku 3828991a71 Update BattleActor.kt 2024-04-05 01:32:00 +00:00
Paul 129ea86829 Licenses 2024-04-05 11:10:51 +10:00
Hiroku 216270b798 Merge branch 'bugs_and_tweaks' into 'main'
Bugs and tweaks

Closes #782

See merge request cable-mc/cobblemon!931
2024-04-05 01:03:00 +00:00
Hiroku ad1674a1bc Merge branch 'main' into 'illusion'
# Conflicts:
#   common/src/main/kotlin/com/cobblemon/mod/common/pokemon/Pokemon.kt
2024-04-05 00:46:37 +00:00
FrankTheFarmerReal 2b80d99614 Commented out some faint poses for pokemon that don't have faint animations currently. 2024-04-04 22:56:26 +10:00
FrankTheFarmerReal 723302ed39 Fixed Shieldon animation crash 2024-04-04 22:42:15 +10:00
FrankTheFarmerReal 79bec94f55 Restored missing Hippowdon sound 2024-04-04 22:41:39 +10:00
FrankTheFarmerReal d7a7d421a0 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2024-04-04 21:52:50 +10:00
FrankTheFarmerReal 49632b6f85 Revised SingleBoneLookAnimation. Can properly invert X and Y axis and define range limits. 2024-04-04 21:50:13 +10:00
Tyzillion 308a41a5fc Gave Lapras funny placeholder Quadruped walk. hehe 2024-04-04 07:20:16 -04:00
Paul a5486be16f Removed a test log message 2024-04-04 20:40:33 +10:00
Paul 94c9f865e7 Fixed poser issues for gen8 fossils, Omanyte line, Wingull line, Hippowdown, Chespin line 2024-04-04 20:06:28 +10:00
Paul 3385b9c8bf Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2024-04-04 19:38:39 +10:00
Veraxiel cdfc894d49 Removed spawns not supposed to be there. 2024-04-03 16:55:13 -04:00
Veraxiel 784e2c0fb8 Updates to spawns and some tags. 2024-04-03 16:52:18 -04:00
Waldleufer e6a487dc52 Handling custom file name groupings and custom output folders in the public spawn writer [skip-ci] 2024-04-03 22:28:37 +02:00
Waldleufer bdb79a32cc Generated a bunch of drops. 2024-04-03 20:51:57 +02:00
Waldleufer 5d6a227c49 Merge branch 'main' into 1.5-more-spawn-and-drops 2024-04-03 19:37:40 +02:00
FrankTheFarmerReal 2bca651f75 PLEASE REVIEW: SingleBoneLookAnimation changes to support min and max ranges for yaw. Dugtrio and Dodrio examples. 2024-04-03 23:22:59 +10:00
FrankTheFarmerReal cbde864cc1 diglett and dugtrio hitbox fixes 2024-04-03 23:17:55 +10:00
FrankTheFarmerReal 4b3a5d7ca9 Flaaffy head bone correction 2024-04-03 20:04:30 +10:00
FrankTheFarmerReal e55c08648f Expanded constructor for SingleBoneLook and added Grimmsnarl sight cone restrictions. 2024-04-03 13:15:38 +10:00
FrankTheFarmerReal 052f8fd94a Some placeholder animations 2024-04-03 08:50:57 +10:00
Tyzillion cd4f7fc7aa Forgot to merge main into branch. 2024-04-02 17:19:33 -04:00
Tyzillion c90400bba6 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonEntity.kt
2024-04-02 17:17:32 -04:00
Tyzillion d390764717 changed pattern aspect to region_bias. Updated all that needed to be updated with the new aspect name. Made the region bias pokemon share animations with their normal variants. 2024-04-02 17:15:51 -04:00
Lily 0880d127a7 Merge branch 'main' into bugs_and_tweaks
# Conflicts:
#	common/src/main/resources/assets/cobblemon/lang/en_us.json
2024-04-02 16:13:39 -04:00
Nick 30466a6063 Merge branch 'shifting-shadows' into 'main'
Scale shadows on sendout/recall

See merge request cable-mc/cobblemon!949
2024-04-02 18:50:13 +00:00
MiaandNick fd59b81bff Scale shadows on sendout/recall 2024-04-02 18:50:13 +00:00
FrankTheFarmerReal ba82a6bc56 Some placeholder animations 2024-04-02 16:16:28 +10:00
Lily abf64e6047 Merge branch 'main' into bugs_and_tweaks 2024-04-01 22:06:23 -04:00
Lily c463278498 Fix outdated advancement name 2024-04-01 22:04:42 -04:00
Paul a37fdf709a Fixed Inkay evo method. Fixes #787 2024-04-01 18:51:55 +10:00
Paul 5023f28d04 Fixed underwalking the target position leading to walking in place. Fixes #790 2024-04-01 18:40:57 +10:00
Slippy c502fec709 more bug fixes and balancing 2024-04-01 02:48:33 -05:00
FrankTheFarmerReal 49444eea50 Updated walk animations for Armaldo and Hoothoot 2024-04-01 15:36:56 +10:00
FrankTheFarmerReal 470fb80e08 Cutiefly, Flabebe, Flittle, and Scatterbug are now shoulder mountable 2024-04-01 15:22:29 +10:00
FrankTheFarmerReal a2aa6deddb Fixed Roselia battle idle not playing 2024-04-01 14:26:12 +10:00
Paul 0d4ef20b4a Merge remote-tracking branch 'origin/main' into implement_pokemon
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonEntity.kt
2024-04-01 11:55:37 +10:00
Hiroku 67de28386a Merge branch 'ball-animation-changes' into 'main'
Breakout Animation, Overhauled Sendout Logic

See merge request cable-mc/cobblemon!943
2024-04-01 01:03:16 +00:00
Hiroku cd37d3538e Formatting 2024-04-01 00:39:38 +00:00
Tyzillion 137fed9152 Removed cry sound effect from Gimmighoul surprise animation so that it doesn't play the cry twice when encountering a closed Gimmighoul. Fixed Archen quirk sound being on wrong quirk. 2024-03-31 15:29:01 -04:00
Tyzillion 42ea462937 Hopefully fixed Xatu's t-posing while flying. 2024-03-31 11:14:19 -04:00
Tyzillion f32852db9d Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2024-03-31 11:08:30 -04:00
Tyzillion 4294360cb9 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2024-03-31 11:08:15 -04:00
FrankTheFarmerReal d54565dbb5 Fixed Rookidee and Corvisquire T posing underwater 2024-03-31 23:12:08 +10:00
FrankTheFarmerReal 0e005ea1ba Galarian Rapidash will now stop T posing when asleep, but will have to sleep with its eyes open :( 2024-03-31 22:58:16 +10:00
FrankTheFarmerReal d2e32bc26a Gave temporary walk animation to Salazzle 2024-03-31 22:47:16 +10:00
FrankTheFarmerReal 92d5005a62 Restored Lechonk's cry 2024-03-31 22:34:43 +10:00
Hiroku 3d03ee5eb3 Merge branch 'gilded_chest_names' into 'main'
Preserve and display custom names for gilded chests

Closes #792

See merge request cable-mc/cobblemon!945
2024-03-31 12:11:57 +00:00
Paul 0b685ed453 Actually that one field is nullable 2024-03-31 21:47:10 +10:00
Hiroku 115e990df6 Update GildedChestBlock.kt 2024-03-31 10:19:16 +00:00
Hiroku 2ee38f0a29 Merge branch '1.5-Structures' into 'main'
fixed spelling error in gilded chest loot table

See merge request cable-mc/cobblemon!948
2024-03-31 10:18:03 +00:00
Slippy 756ef48ba2 coins are more common in sus blocks 2024-03-31 04:52:02 -05:00
Slippy 2c4df6622a fixed spelling error in gilded chest loot table 2024-03-31 04:30:48 -05:00
FrankTheFarmerReal 99dc9930b8 Fixed Timburr and Gurdurr quirks 2024-03-31 18:52:28 +10:00
Hiroku 425c41bc4b Merge branch 'waterloggable-tumblestones' into 'main'
Make tumblestones waterloggable

Closes #793

See merge request cable-mc/cobblemon!946
2024-03-31 07:22:48 +00:00
Hiroku 9f7a99b583 Merge branch '1.5-Structures' into 'main'
1.5 structures

See merge request cable-mc/cobblemon!947
2024-03-31 07:22:22 +00:00
Slippy f1213abdf4 candy adjustment 2024-03-31 01:04:02 -05:00
Slippy 9b1d847f59 added absorb bulb to some fossil loot tables 2024-03-31 00:09:28 -05:00
Slippy bf900a0167 Just an enormous amount of changes to loot tables and structures 2024-03-30 23:57:54 -05:00
FrankTheFarmerReal 7b008fe0ec Fixed broken animations for Chinchou, Lanturn, Gallade, and Magikarp 2024-03-31 14:09:12 +10:00
FrankTheFarmerReal ffa9ae4e86 Updated animations for Unovan and Hisuian Petilil 2024-03-31 13:37:07 +10:00
miasmus d60d828e93 make tumblestones waterloggable 2024-03-30 23:00:08 -04:00
FrankTheFarmerReal fcbc7ee72b Updated more walk speeds 2024-03-31 12:13:50 +10:00
Tyzillion 7319fdf29b Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2024-03-30 21:53:27 -04:00
Slippy 703282eca1 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into 1.5-Structures 2024-03-30 19:39:12 -05:00
miasmus 5d7e6f6487 Preserve and display custom names for gilded chests 2024-03-30 19:38:38 -04:00
Hiroku 4e3e6405d0 Merge branch 'FossilMachineBalancing01' into 'main'
Fossil machine balancing01

See merge request cable-mc/cobblemon!944
2024-03-30 23:01:44 +00:00
Segfault Guy d8ad55506d Update Showdown w/ illusion and party bug fixes. 2024-03-30 16:00:18 -04:00
Segfault Guy adef71c23f Merge branch 'main' into illusion 2024-03-30 15:52:10 -04:00
Segfault Guy 9b49f5e01f Add licenses. 2024-03-30 15:37:37 -04:00
Segfault Guy 23c52fd106 Fix transform with shiny aspect. 2024-03-30 15:22:33 -04:00
Segfault Guy d118fe4ee8 Fix interpreter instructions pulling real BattlePokemon name before illusion is dispatched. 2024-03-30 15:09:17 -04:00
Segfault Guy 7b2b860e52 Fix ClientBattlePokemon syncing for transform and illusion. 2024-03-30 14:35:30 -04:00
FrankTheFarmerReal d733eaae2f Updated behaviours for Dreepy line and Flabebe line. 2024-03-31 00:25:40 +10:00
FrankTheFarmerReal 0c8fe42087 Fixed portraits for Lunatone, Solrock, and Salazzle 2024-03-30 23:38:26 +10:00
FrankTheFarmerReal 5e88116e08 Adjusted movement speed of Anorith and Armaldo. Fixed Hisuian Goodra crash 2024-03-30 23:30:45 +10:00
JazzMcNade 1e161a52ee Fixed an index out of bounds issue related to having a extreme excess of material in the tank 2024-03-30 02:27:04 -05:00
JazzMcNade 65b2204783 Decreased required material to 128 (from 256). Decreased restoration time to 12min (from 15min). 2024-03-30 02:14:06 -05:00
Flarkinater 76d9137ae4 Merge branch 'main' into ball-animation-changes 2024-03-29 22:09:21 -04:00
Flarkinater 9f6c44fd75 Sendout location is only shifted vertically when necessary 2024-03-29 22:08:40 -04:00
Flarkinater 6c086f5555 Fixed merge conflict goofs 2024-03-29 21:58:26 -04:00
FrankTheFarmerReal ef96814900 Restored cries for Gardevoir and Rowlet 2024-03-30 11:37:52 +10:00
Tyzillion f6161d8687 Misc fixes and implemented region pattern evolution methods. 2024-03-29 17:31:08 -04:00
Tyzillion 8aa5d3a72c Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2024-03-29 11:27:37 -04:00
Waldleufer 353de8b8a3 ✨ Polishing ✨ [skip-ci] 2024-03-29 16:23:21 +01:00
Waldleufer 0423dd4939 hint at potential partial implementations that are not checked of in the spreadsheet. [skip-ci] 2024-03-29 16:19:38 +01:00
Waldleufer fe02ea6fa9 Polished Cry Checker Skript to help verify implemented cries [skip-ci] 2024-03-29 16:08:18 +01:00
Tyzillion 90f7454ffb Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2024-03-29 08:52:39 -04:00
FrankTheFarmerReal 04f53040a3 Many long pokemon are no longer partly rendered in the PC 2024-03-29 22:50:16 +10:00
Tyzillion 69e21672eb Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon
# Conflicts:
#	CHANGELOG.md
2024-03-29 08:36:41 -04:00
FrankTheFarmerReal 4f2e3ecb0f Fixed Conkeldurr using Gurdurr's animations. Also updated the whole line's animations. 2024-03-29 22:27:30 +10:00
FrankTheFarmerReal 1acc41da8c Gimmighoul, Pupitar, and Tyranitar will now appear using the spawnallpokemon command 2024-03-29 20:50:56 +10:00
FrankTheFarmerReal a6917162a7 Updated animations on Quaxwell and Quaquaval 2024-03-29 17:47:53 +10:00
Slippy a9115bfb15 XL RCs are less common 2024-03-29 01:27:30 -05:00
FrankTheFarmerReal 111cb3a2f3 Fixed cries and T poses for Unovan and Hisuian Oshawott 2024-03-29 16:21:03 +10:00
Hiroku f2c5113f0b Merge branch 'json-addict' into 'main'
Advancement and Tag Updates

See merge request cable-mc/cobblemon!942
2024-03-29 05:31:33 +00:00
Hiroku e29a2402e9 Merge branch 'spawning-gamerule-change' into 'main'
Move doPokemonSpawning gamerule logic

See merge request cable-mc/cobblemon!941
2024-03-29 05:30:53 +00:00
Hiroku aa4857abbb Merge branch 'Quick-Move-Stacked-PokePotion-Bases' into 'main'
Add the ability to quick move stacked PokePotion bases into Brewing Stands.

See merge request cable-mc/cobblemon!935
2024-03-29 05:29:13 +00:00
Hiroku d29653233d Merge branch 'main' into 'Quick-Move-Stacked-PokePotion-Bases'
# Conflicts:
#   CHANGELOG.md
2024-03-29 05:28:22 +00:00
Hiroku 1b51a128d7 Merge branch 'OldAmberSpriteUpdate' into 'main'
Corrected Old Amber Sprite

See merge request cable-mc/cobblemon!939
2024-03-29 05:27:10 +00:00
Hiroku 245011cf5e Merge branch '1.5-Structures' into 'main'
Oh boy that's a lot of changes and fixes to structures

See merge request cable-mc/cobblemon!940
2024-03-29 05:26:30 +00:00
FrankTheFarmerReal 8ac9f38b06 Petilil pivot changes and Stonjourner walk speed adjusted 2024-03-29 15:12:47 +10:00
FrankTheFarmerReal 48193160b9 Texture updates for Forretress, Sizzlipede, and Centiskorch 2024-03-29 14:31:14 +10:00
FrankTheFarmerReal 83100dec11 Tweaked Anorith and Armaldo again 2024-03-29 14:14:52 +10:00
Flarkinater 100bf7fee4 Merge remote-tracking branch 'origin/main' into ball-animation-changes
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/pokemon/PokemonRenderer.kt
2024-03-29 00:05:58 -04:00
Flarkinater be043a0ea1 Fixed minor issue with shifting Pokemon vertically during suffocation sendout check 2024-03-28 23:41:24 -04:00
Flarkinater a902f4a8a3 Fixed suffocation avoidance when sending out Pokemon adjacent to a wall, other related fixes 2024-03-28 23:05:30 -04:00
Flarkinater 442f54839f Improved spacing when targeting walls and above blocks 2024-03-28 22:09:41 -04:00
FrankTheFarmerReal a87b5090b0 Added Anorith and Armaldo animations 2024-03-29 11:48:05 +10:00
dhi_holo 20a97984a2 Misc Structures
Just a couple tags containing all structures not represented in a sub-tag, if someone wants to go in and make more tags to reduce the ones in here feel free, just make sure it adds up.
2024-03-29 10:54:10 +10:00
dhi_holo d1517548bd Update en_us.json
Gamerule Translation so it's not just a shitty string anymore
2024-03-29 10:09:22 +10:00
dhi_holo 3e1f9dc9b0 2 Shiny
Updated shiny icon for summary and advancement
2024-03-29 09:54:52 +10:00
FrankTheFarmerReal f0c8d08a04 Pivot fixes for Kirlia and Obstagoon 2024-03-29 09:22:20 +10:00
FrankTheFarmerReal 4fdc738b9e Updated many Pokemon walk speeds 2024-03-29 08:55:53 +10:00
miasmus fd19e65f79 move doPokemonSpawing gamerule logic 2024-03-28 16:42:42 -04:00
dhi_holo 6b10d81bc8 Update en_us.json
Capital fixes because it wasn't right
2024-03-28 23:53:56 +10:00
FrankTheFarmerReal 920c5fd01a Rowlet, Dartrix, and Parasect retextures 2024-03-28 21:46:16 +10:00
dhi_holo f3b9c03fc2 Advancement Updates
Reorgainised the advancements Healing Power, Consult the Fossil, and Free Roam: Enabled, renamed Tumbling Down to be correct, and changed the Shiny advancement to use Shiny icon.
2024-03-28 21:39:56 +10:00
FrankTheFarmerReal 7d8c8a724f Fixed some aquatic pokemon drowning 2024-03-28 19:45:28 +10:00
Veraxiel 0f5f5d4eed Changed fossil machine recipes. Updated some tags. 2024-03-28 05:37:35 -04:00
FrankTheFarmerReal 30744c42a4 Changelog: Changelog changed 2024-03-28 18:14:39 +10:00
FrankTheFarmerReal 821bb79c14 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2024-03-28 16:19:51 +10:00
FrankTheFarmerReal f5171a4a8a PNG fixes for Flygon and Archen 2024-03-28 16:19:16 +10:00
Tyzillion 061c9a1c52 Fixed Darmanitan zen crash 2024-03-28 01:15:45 -04:00
FrankTheFarmerReal da45f7d040 Fixes that just keep happening 2024-03-28 14:41:37 +10:00
Flarkinater 92653c1307 When targeting a wall, Pokemon are sent out far enough away to avoid suffocation, based on their size. Wailord rejoice! 2024-03-27 23:42:24 -04:00
Flarkinater c372114da5 Improved avoidance of unsafe locations when sending out Pokemon 2024-03-27 23:26:07 -04:00
FrankTheFarmerReal 230ab53369 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon
# Conflicts:
#	CHANGELOG.md
2024-03-28 11:38:38 +10:00
FrankTheFarmerReal ac43853baa Changelog updates 2024-03-28 11:36:09 +10:00
Tyzillion 0de5f82971 More fixes 2024-03-27 21:24:46 -04:00
Slippy 2b95138c46 Oh boy that's a lot of changes and fixes to structures 2024-03-27 20:02:02 -05:00
JazzMcNade 864e6be461 Corrected Old Amber Sprite 2024-03-27 19:53:10 -05:00
Tyzillion ec084cffbc AHHHHHHHHHHHHHHHH 2024-03-27 17:41:44 -04:00
Tyzillion f8ae312c0a Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2024-03-27 17:28:34 -04:00
Tyzillion abce88fab6 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2024-03-27 17:28:21 -04:00
Apion c02fa1f85e Merge branch '1.5-Drops-and-Fixes' into 'main'
New drops and some tag/script fixes.

See merge request cable-mc/cobblemon!938
2024-03-27 20:29:11 +00:00
Apion 503b1069fd Merge branch 'MultiBlockEntityClientCrashFix' into 'main'
MultiBlockEntity Safer Casting

See merge request cable-mc/cobblemon!937
2024-03-27 20:27:01 +00:00
JazzMcNadeandApion f1d593d53c MultiBlockEntity Safer Casting 2024-03-27 20:27:01 +00:00
FrankTheFarmerReal 69fb39f148 Hisuian Typhlosion's flames are now hidden outside of battle 2024-03-27 20:44:23 +10:00
FrankTheFarmerReal 70838464d5 Litwick also wants to be shouldermountable 2024-03-27 20:14:28 +10:00
FrankTheFarmerReal 3cdb6e05c3 Kommo-o pose and model updates 2024-03-27 17:23:00 +10:00
FrankTheFarmerReal 87822bc2f7 Ralts, Roggenrola, Charcadet, and Sizzlepede are now shoulderable 2024-03-27 16:37:36 +10:00
Veraxiel 55dd486044 Updated Changelog. 2024-03-27 01:10:26 -04:00
FrankTheFarmerReal dffb944f3e Squirtle can now ride on your shoulder 2024-03-27 13:02:47 +10:00
FrankTheFarmerReal 613f3044bc Zorua and Zoroark hitbox fixes 2024-03-27 11:38:44 +10:00
FrankTheFarmerReal 342b9cb31e Fixed Dragapult height and Sliggoo's evolution not requiring rain 2024-03-27 11:23:39 +10:00
FrankTheFarmerReal 4679cfb07f -Updated UI positions and model scale of the Goomy line 2024-03-27 10:32:04 +10:00
FrankTheFarmerReal 9bb701abc8 -Updated scale values and regional data for many pokemon 2024-03-27 08:15:19 +10:00
FrankTheFarmerReal d070a7b75a -Fixed floating dragonair and T-posing sleeping Mawile 2024-03-26 20:40:24 +10:00
FrankTheFarmerReal 00a4b88437 -Model & Texture fixes for Gimmighoul, Lurantis, and Jangmo-o line
-Hisuian Samurott animation fix to prevent floating
2024-03-26 20:16:57 +10:00
FrankTheFarmerReal 005a98742e -Updated UI poses and data for several pokemon 2024-03-26 18:56:55 +10:00
FrankTheFarmerReal 94168a65f0 -Updated Walk Speed for some Pokemon 2024-03-26 16:26:20 +10:00
FrankTheFarmerReal 39d626b349 -Texture fixes for Aggron, Copperajah, Dracozolt, Gimmighoul and Lilligant 2024-03-26 14:06:45 +10:00
Hiroku 3263837137 Merge branch '1.5-Structures' into 'main'
Structure fixes and generation rate adjustments

See merge request cable-mc/cobblemon!936
2024-03-25 21:14:19 +00:00
Tyzillion db6852134c Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2024-03-25 17:03:22 -04:00
Slippy a471fcd948 Increased rates for underground ruin structures, forest ruin structures and gimmi towers 2024-03-25 12:29:03 -05:00
Slippy a14bfd55d1 Jungle Fossil rates were increased 2024-03-25 12:22:25 -05:00
Slippy 725e819e89 Snow Forest structures rates were increased 2024-03-25 12:21:23 -05:00
Slippy b52b843206 Ocean fossils structures rates were increased 2024-03-25 12:20:13 -05:00
Slippy 74c65e22cb Decaying Crypt generation rates increased 2024-03-25 12:19:20 -05:00
Slippy c348520a9b Increased the generation rate for Mossy Oubliette 2024-03-25 12:15:42 -05:00
Slippy 78dd5f334a Decrease how common desert ruins are and adjusted the weights at which each will generate 2024-03-25 12:12:54 -05:00
Slippy 67318c9307 Sandy Den's were way too common. Adjusted their rates of generation 2024-03-25 12:05:17 -05:00
Slippy 31c48407df Slightly lowered the amount of sus sand in the sandy den structure 2024-03-25 11:43:45 -05:00
FrankTheFarmerReal 7170825848 -Darmanitan revamp and Krokorok texture fixes 2024-03-25 16:32:52 +10:00
Flarkinater 43da7ecece First attempt at canceling sendouts into unsafe locations (cactus, fire if the Pokemon isn't immune) 2024-03-24 23:41:22 -04:00
FrankTheFarmerReal 5b1531b894 -License Changes 2024-03-25 11:14:59 +10:00
Charzard4261 0957de86c7 Add the ability to quick move stacked PokePotion bases into Brewing Stands. 2024-03-25 00:05:19 +00:00
Slippy daae444fa9 Prehistoric Rooted Pits are more common 2024-03-23 22:51:39 -05:00
Slippy 79423ef5ee Prehistoric_Birch_Tree Fix 2024-03-23 22:13:07 -05:00
Veraxiel 6255f7dc31 Removed spawn that shouldn't be in. 2024-03-23 22:29:43 -04:00
Segfault Guy af9f1accf8 Fix Cant and Damage instructions. 2024-03-23 20:41:36 -04:00
Hiroku ff10306372 Merge branch 'GiveGimmighoulRightClick' into 'main'
Easier Gimmighoul Giving

See merge request cable-mc/cobblemon!930
2024-03-23 22:07:16 +00:00
Hiroku aaf7daa45b Merge branch 'sound' into 'main'
A lot of audio asset updates

See merge request cable-mc/cobblemon!933
2024-03-23 22:06:29 +00:00
Tyzillion 3b87846562 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2024-03-23 16:09:42 -04:00
Tyzillion dfd4450e11 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2024-03-23 15:18:08 -04:00
Waldleufer 7c42f8e37f Added check for minimum audio length to cry checker script [skip-ci] 2024-03-23 18:45:18 +01:00
Waldleufer ae550f78c4 Now the order of selection of input and output does not matter anymore. [skip-ci] 2024-03-23 16:19:40 +01:00
Waldleufer 66e4194a3e Made public spawn writer read Dex No. as int for consistency [skip-ci] 2024-03-23 16:04:53 +01:00
Waldleufer 12e6b76504 chore: added spawn specific drops to a bunch of cobblemon - mainly nether spawns. 2024-03-23 15:54:52 +01:00
Waldleufer 93861af71f dropping drops helps. [skip-ci] 2024-03-23 15:51:34 +01:00
Waldleufer 0c80748012 perf: script speed is over 9000! [skip-ci] 2024-03-23 15:18:30 +01:00
FrankTheFarmerReal 4060dbd596 - Fixed Wartortle, Blissey, and Hisuian Sliggo crashes
- Implemented a bunch of pokemon
- Specifically added darumaka changes
2024-03-23 23:26:53 +10:00
Waldleufer fcf832c22c more sensible script default values [skip-ci] 2024-03-23 13:17:48 +01:00
Sterrezo a065aff744 Added audio assets for fossil Pokemon cries 2024-03-23 13:04:19 +01:00
Sterrezo d77f424a83 Updated battle SFX 2024-03-23 12:49:47 +01:00
Waldleufer d5d2a2cec3 fix: improved hint for rare spreadsheet parsing bug. [skip-ci] 2024-03-23 11:55:02 +01:00
Sterrezo 036e150191 Merge branch 'main' into sound 2024-03-23 11:52:52 +01:00
Waldleufer 0bf1d84675 fix: added hint for rare spreadsheet parsing bug. [skip-ci] 2024-03-23 11:52:52 +01:00
Waldleufer b1b8e658b2 chore: updated drops data and fixed some missing form specific drops. 2024-03-23 11:42:20 +01:00
Waldleufer f984b21929 fix: Drops script now robustly handles form drops and hints at missing data in both spreadsheet and .json files [skip-ci] 2024-03-23 11:34:42 +01:00
Waldleufer 0a5193b209 perf: Increase preformance of drops script to be linear function, added dex_range option [skip-ci] 2024-03-23 10:46:59 +01:00
Veraxiel 43f1f1c30d Update to spawns to use SkyLight. 2024-03-23 04:05:56 -04:00
Waldleufer c16597ae41 chore: CHANGELOG [skip-ci] 2024-03-22 23:31:39 +01:00
Waldleufer f76e7582d2 Reworked our spawn writer script to be compatible with new UI [skip-ci] 2024-03-22 23:28:41 +01:00
Waldleufer 40761d87db Adding DexRange as input [skip-ci] 2024-03-22 20:45:19 +01:00
Waldleufer 89a9ad0bfb Refactoring the hell out of it [skip-ci] 2024-03-22 19:41:36 +01:00
Waldleufer 20291c54a5 First Version of public spawn writer script [skip-ci] 2024-03-22 19:12:13 +01:00
Islana 04b7500887 Fixes battlebuilder from sending out fainted pokemon, causing a softlock. 2024-03-22 00:45:39 -04:00
Hiroku d6fdfe6ebc Merge branch 'FetusResizing' into 'main'
Fossil Fetus Rescaling

See merge request cable-mc/cobblemon!927
2024-03-22 01:06:17 +00:00
Islana fe3d2a29b9 Fixes battlebuilder from sending out fainted pokemon, causing a softlock. 2024-03-21 20:07:41 -04:00
Lily ad81202d49 Updated the display case to allow cleaner rotations 2024-03-21 15:54:06 -04:00
Lily acbacfa8cf Fixed certain evolutions not working 2024-03-21 15:30:15 -04:00
Lily 9740267f91 Fixed a bug causing items to disappear from display cases 2024-03-21 14:28:34 -04:00
Lily fcca3b1d68 Fix armor trim name inconsistency. Closes #782 2024-03-21 14:11:32 -04:00
Nick 9f63b62651 Merge branch '1.5-Structures' into 'main'
Hi Hiro

See merge request cable-mc/cobblemon!928
2024-03-21 16:42:25 +00:00
JazzMcNade 392632b7d4 Added the ability for a player to add to Gimighoul's treasure horde by right clicking directly on a gimmighoul that they own. 2024-03-21 00:48:59 -05:00
Segfault Guy 767e279cf1 Merge branch 'main' into illusion 2024-03-21 00:25:45 -04:00
Segfault Guy 6ace08aaa6 Fix illusion battle interactions. 2024-03-21 00:19:28 -04:00
Slippy 0d377dcbe0 Changes, fixes, and balancing of 1.5 structures 2024-03-20 22:17:13 -05:00
JazzMcNade 88c31bcb7b Scaled Archen to0.55 (from 0.8). Scaled Kabuto to 0.85 (from 0.75) 2024-03-20 19:36:27 -05:00
Waldleufer 8efea17ae6 added structure: prefix for anticonditions and conditions and refactored script [skip-ci] 2024-03-20 21:03:37 +01:00
Waldleufer cdbf569bbc feat: made spawnwriter handle new preset: tag for spawn specific drops [skip-ci] 2024-03-20 16:26:28 +01:00
Hiroku 8b81b13d01 Merge branch 'archaeology_fixup' into 'main'
Archaeology Fixup

See merge request cable-mc/cobblemon!925
2024-03-20 12:34:33 +00:00
Hiroku f19d9410c0 Merge branch 'GildedChestComparatorOutput' into 'main'
Add comparator output for the Gilded Chest

See merge request cable-mc/cobblemon!926
2024-03-20 11:36:52 +00:00
JazzMcNade 9ac3a9249d Added comparator output for the Gilded Chest 2024-03-20 00:49:56 -05:00
Lily 4f340b2eee - Fixed a bug involving hoppers and Gimmighoul chests
- Fixed certain structures not generating
- Fixed certain loot tables failing to load
2024-03-19 17:15:32 -04:00
Tyzillion 7dc00c3e88 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2024-03-19 13:19:11 -04:00
Lily e6590bef08 moved most baits to the new system 2024-03-19 15:00:59 +00:00
Lily 60b0e70651 updated some baits to use the new system 2024-03-19 14:40:17 +00:00
Sterrezo d000790996 Uhh some cries
Implemented cries for Scyther, Electabuzz, Lapras, Omastar, Aerodactyl.
I have to wait for the next animation push.
2024-03-19 14:12:32 +01:00
Veraxiel 0415cf8a69 Added Carnivine spawn files. 2024-03-19 04:09:58 -04:00
Lily 0d9f8bbb36 refactored the fishing bait system to allow for multiple effects per item 2024-03-18 22:24:24 -04:00
Sterrezo 663624c434 Implemented most Gen 1 cries for 1.5
Omitted Tangela because it's missing animation.json. Don't know how to work around that.
Script update is from a different branch, used it for implementation.
2024-03-18 16:18:02 +01:00
Sterrezo 79af092888 Merge branch 'main' into sound 2024-03-18 11:52:30 +01:00
Hiroku 5cff52df5f Merge branch 'archaeology' into 'main'
Merging Structure Tweaks for Playtesting

See merge request cable-mc/cobblemon!924
2024-03-18 06:38:20 +00:00
Hiroku ca311fa97c Merge branch 'Waldleufer/automatingTagListCreation' into 'main'
tooling: automating tag list creation

See merge request cable-mc/cobblemon!908
2024-03-18 06:34:42 +00:00
Slippy 27020d3068 Loot table changes for structures 2024-03-18 01:14:55 -05:00
Paul 3ac4b8622f Merge remote-tracking branch 'origin/main' into 1.5-Spawns 2024-03-18 15:41:22 +10:00
Paul acd7a0583c Fixed Ekans line spawns, fixed season tag references for new locations 2024-03-18 15:35:28 +10:00
Nick e341948bd4 Merge branch 'tooling-fixes' into 'main'
tooling: mark gradlew as executable & fix logs being created during unit tests

See merge request cable-mc/cobblemon!921
2024-03-18 04:24:22 +00:00
broccolaiandNick 1a465abf9d tooling: mark gradlew as executable & fix logs being created during unit tests 2024-03-18 04:24:22 +00:00
Paul e56a6e5b1a Updated qwilfish and overqwil spawns 2024-03-18 14:03:53 +10:00
Paul 33d707a73b Spawn fixes 2024-03-18 14:02:17 +10:00
Segfault Guy ba8e40d5a7 Implement illusion and transform entity effects. No pokemon can be trusted. 2024-03-18 00:00:43 -04:00
Paul e3c3cd380c Merge remote-tracking branch 'origin/main' into 1.5-Spawns
# Conflicts:
#	utilityscripts/cobblemon_drops_csv_to_json.py
2024-03-18 13:42:02 +10:00
Hiroku 578ce789b1 Merge branch 'implement_pokemon' into 'main'
Many Pokémon implemented and some animation transition fixes.

See merge request cable-mc/cobblemon!923
2024-03-18 03:19:20 +00:00
Paul 460e8f7501 Fixed various Pokemon not being marked as implemented when they are, fixed Golem and Lairon legs moving in a hurry 2024-03-18 11:37:24 +10:00
Tyzillion 2fee86e7bc Updated branch and forgot to add diglett line updates to changelog. 2024-03-17 19:35:04 -04:00
Tyzillion f73e631f81 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2024-03-17 19:28:46 -04:00
Tyzillion 0ca0c1a552 hitboxes adjusted. 2024-03-17 19:26:34 -04:00
Hiroku b3bf2c5ded Merge branch 'test-improvements' into 'main'
tooling: improve tests by properly bootstrapping minecraft

See merge request cable-mc/cobblemon!922
2024-03-17 22:31:17 +00:00
broccoli 7875006c8e tooling: improve tests by properly bootstrapping minecraft
- uses the fabric-loader-junit build
- rewrites the SpawnValidator to use #getResource instead of code file paths
- create a junit extension to bootstrap easier
2024-03-17 21:13:45 +00:00
Slippy 67bb63b638 Well that didn't work at all... 2024-03-17 14:34:42 -05:00
Slippy 511f97b963 Fixed structures unintentionally generating in the oceans. Fixed structures unintentionally generating on the surface. 2024-03-17 13:15:31 -05:00
Waldleufer 54c426f5ff feat: spawn writer now handles skyLight [skip-ci] 2024-03-17 16:01:07 +01:00
Waldleufer f89902ece8 feat: spawn_csv_to_json script improvements [skip-ci]
* only verify biome tags if tag directories are available.
* Missing cobblemon items in the natural names to tags spreadsheet are now printed out as an error.
2024-03-17 15:45:32 +01:00
Waldleufer 52c6bbd842 chore: update Changelog [skip-ci] 2024-03-17 14:24:26 +01:00
Waldleufer 8246a822cf feat: added "ready for implementation" list to cry_checker script. [skip-ci] 2024-03-17 14:17:01 +01:00
Hiroku 54202bed98 Merge branch 'BalancedFossils' into 'main'
Play test values for fossil machine

See merge request cable-mc/cobblemon!920
2024-03-17 08:55:46 +00:00
Paul e6313cf4c5 Reverted partial run change 2024-03-17 16:44:56 +10:00
JazzMcNade 7debc6e047 Increased timings, increased required natural material, updated material values, increased quirk cooldown. Fixed bugs revealed upon changing these values 2024-03-16 22:37:16 -05:00
Tyzillion bf9b69a143 Updated Dragonite, Omanyte, Omastar, and Pinsir animations. 2024-03-16 21:44:02 -04:00
Hiroku d7f34972c1 Merge branch 'MoreHoldItems' into 'main'
more held items woah

See merge request cable-mc/cobblemon!918
2024-03-17 00:58:35 +00:00
Veraxiel fa7356d2ed Update to Ocean tag. 2024-03-16 18:10:07 -04:00
Sterrezo 812d42a42f Merge branch 'main' into sound 2024-03-16 22:22:26 +01:00
Sterrezo 3f114706fa Implemented sounds for Revival Herb and Vivichoke. Volume adjustments.
Implemented sounds for Revival Herb and Vivichoke. Tweaked assets for Fossil Machine insert dna sounds. Adjusted volumes to Fossil Machine, Tumblestone and Coin Pouch sounds.
2024-03-16 22:21:05 +01:00
Lily 8d1f41919d nvm eject button can go back in 👍😄 2024-03-16 16:11:48 -04:00
Lily b40c21d99e pull eject pack and eject button since they brick battles 2024-03-16 16:07:35 -04:00
Lily 461d8bd282 more held items woah 2024-03-16 14:37:32 -04:00
Tyzillion 84d34709a3 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2024-03-16 13:44:49 -04:00
Tyzillion b6c04e8746 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon
# Conflicts:
#	common/src/main/resources/data/cobblemon/species/generation2/heracross.json
#	common/src/main/resources/data/cobblemon/species/generation5/darmanitan.json
#	common/src/main/resources/data/cobblemon/species/generation5/lilligant.json
#	common/src/main/resources/data/cobblemon/species/generation5/zoroark.json
#	common/src/main/resources/data/cobblemon/species/generation6/floette.json
#	common/src/main/resources/data/cobblemon/species/generation6/goodra.json
#	common/src/main/resources/data/cobblemon/species/generation7/kommoo.json
#	common/src/main/resources/data/cobblemon/species/generation7/lurantis.json
#	common/src/main/resources/data/cobblemon/species/generation7/salazzle.json
#	common/src/main/resources/data/cobblemon/species/generation8/copperajah.json
2024-03-16 13:43:31 -04:00
Hiroku 81a96afaa6 Merge branch 'tag-god' into 'main'
Added structure tags (for /locate command)

See merge request cable-mc/cobblemon!917
2024-03-16 11:19:40 +00:00
dhi_holo 724332dd34 Added structure tags (for /locate command)
The reason for these is primarily the /locate command, combining biome variants together so if you're just looking for a structure of a specific kind, but the biome doesn't matter, you don't have to deal with deciding which to search for.
2024-03-16 18:23:02 +10:00
Veraxiel f5bfd64495 Added some more spawns. 2024-03-16 01:32:55 -04:00
Hiroku bf8f7f628f Merge branch 'quick-ficks' into 'main'
Puffing Bells

See merge request cable-mc/cobblemon!916
2024-03-16 05:24:14 +00:00
dhi_holo 898fdf983f Puffing Bells
Hisui Puff hopefully fixed, and soothe bell recipe cleaned up (so many errors)

Also added the newer tags to the lang
2024-03-16 14:32:20 +10:00
Hiroku a547e0f535 Merge branch 'fix/adjust-node-type' into 'main'
fix: don't access entity in adjustNodeType

See merge request cable-mc/cobblemon!915
2024-03-16 02:34:46 +00:00
broccoli 564ced926c fix: don't access entity in adjustNodeType
Mojang has disposed of the entity by this point, leading to a crash that's
especially noticed in the Wander goal.
2024-03-16 02:16:28 +00:00
Paul a93dd14fd8 Fixed soothe bell recipe 2024-03-16 12:08:44 +10:00
Paul f0535901cb Fixed prepared transition animations not playing (lol) 2024-03-16 11:47:16 +10:00
Paul 7a42df591f Merge remote-tracking branch 'origin/main' into implement_pokemon
# Conflicts:
#	common/src/main/resources/assets/cobblemon/particles/snowstorm.json
#	common/src/main/resources/data/cobblemon/species/generation2/heracross.json
#	common/src/main/resources/data/cobblemon/species/generation5/darmanitan.json
#	common/src/main/resources/data/cobblemon/species/generation5/lilligant.json
#	common/src/main/resources/data/cobblemon/species/generation5/zoroark.json
#	common/src/main/resources/data/cobblemon/species/generation6/floette.json
#	common/src/main/resources/data/cobblemon/species/generation6/goodra.json
#	common/src/main/resources/data/cobblemon/species/generation7/kommoo.json
#	common/src/main/resources/data/cobblemon/species/generation7/lurantis.json
#	common/src/main/resources/data/cobblemon/species/generation7/salazzle.json
#	common/src/main/resources/data/cobblemon/species/generation8/copperajah.json
2024-03-16 11:21:54 +10:00
Paul bd8d9fa9e3 Added a bunch of AI tasks to NPCs for combat (I dunno it's neat) 2024-03-16 11:16:58 +10:00
Veraxiel 616419880f Updated spawn files. 2024-03-15 16:45:09 -04:00
Slippy 9fa38430c0 Deleted old structure file 2024-03-15 13:42:25 -05:00
Slippy 26012278e7 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into archaeology 2024-03-15 13:35:42 -05:00
Slippy 2c0967d293 1.5 structures for real??? 2024-03-15 13:04:00 -05:00
Nick 885fc72d93 Revert "1.5 Structures final changes before Playtesting"
This reverts commit 8130cd0998
2024-03-15 17:56:22 +00:00
Slippy 8130cd0998 1.5 Structures final changes before Playtesting 2024-03-15 12:52:32 -05:00
Veraxiel 447d35f28b Updated tags. Added presets. 2024-03-15 05:47:07 -04:00
Hiroku bf82def925 Merge branch 'MoreHoldItems' into 'main'
Implement more held items

See merge request cable-mc/cobblemon!905
2024-03-15 02:57:05 +00:00
Hiroku dace364701 Merge branch 'FossilMachineHandWaggling' into 'main'
When using a pokeball, fossil, or natural material on the fossil machine the...

See merge request cable-mc/cobblemon!911
2024-03-15 02:49:31 +00:00
Lily d737444ac9 Merge branch 'main' into MoreHoldItems
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/Cobblemon.kt
2024-03-14 21:43:54 -04:00
Hiroku 95f58ba557 Merge branch 'panning_for_gilded_chests' into 'main'
make gilded chests waterloggable

See merge request cable-mc/cobblemon!910
2024-03-15 01:28:56 +00:00
Hiroku 8993b007a5 Merge branch 'FossilMachineChunkLoadFix' into 'main'
Fossil machine chunk load fix

See merge request cable-mc/cobblemon!912
2024-03-15 01:28:04 +00:00
Hiroku c84f9dd112 Merge branch 'anychangeobservable-public' into 'main'
Make anyChangeObservable public

See merge request cable-mc/cobblemon!909
2024-03-15 01:25:46 +00:00
apionandJazzMcNade eea7477f7f More changes to how things work in unloaded chunks 2024-03-14 01:19:10 -05:00
JazzMcNade 241abd79d7 FossilMultiblock multiblock getter performance improvement for chunkloading issues 2024-03-14 01:19:10 -05:00
Veraxiel 35618cea46 Merge branch '1.5-Spawns' of https://gitlab.com/cable-mc/pokemon-cobbled into 1.5-Spawns 2024-03-14 02:10:34 -04:00
Veraxiel 31b97d391d Updated tags. Reorganized tags. Added tags for blocks in biomes. 2024-03-14 02:10:00 -04:00
Lily 7769a73246 make gilded chests waterloggable 2024-03-13 23:28:00 -04:00
Nick 65bf9507d3 Fix invalid JSON 2024-03-13 04:48:50 +00:00
miasmus 6d336fc27b make anyChangeObservable public 2024-03-12 17:25:54 -04:00
Sterrezo 9514a1d470 Fossil Machine sound updates
Updated audio assets. Moved and renamed the files for consistency. Adjusted volumes.
2024-03-12 13:31:02 +01:00
Waldleufer 16df7695c4 feat: made speciesJsonReader more robust. 2024-03-10 21:32:11 +01:00
Waldleufer 8fd63912a3 feat: always sort tables alphabetically 2024-03-09 09:07:53 +01:00
Waldleufer 04941a9a38 feat: adding header and TOC 2024-03-09 09:06:24 +01:00
Waldleufer 1853a1677a feat: adding header and TOC 2024-03-09 09:06:18 +01:00
Waldleufer 94f8de8ddc feat: three column representation 2024-03-09 08:52:51 +01:00
Waldleufer 7ea866d82a feat: 2 column version 2024-03-09 08:46:34 +01:00
Waldleufer ea529a52c2 feat: initial version of SpawnPresetListWriter script 2024-03-09 08:34:47 +01:00
Waldleufer 1f6dd03064 refactor: separating code into functions. 2024-03-09 07:42:49 +01:00
Waldleufer d62ea394ee feat: added place for descriptive text for the detailed tag files. 2024-03-09 07:36:33 +01:00
Waldleufer d0b8a3368c feat: moved full tag lists to their own folder 2024-03-09 07:25:32 +01:00
Tyzillion 6d23e762d6 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2024-03-08 19:41:19 -05:00
Tyzillion 6edb0c19c4 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon
# Conflicts:
#	common/src/main/resources/assets/cobblemon/particles/snowstorm.json
#	common/src/main/resources/data/cobblemon/species/generation2/heracross.json
#	common/src/main/resources/data/cobblemon/species/generation5/darmanitan.json
#	common/src/main/resources/data/cobblemon/species/generation5/lilligant.json
#	common/src/main/resources/data/cobblemon/species/generation5/zoroark.json
#	common/src/main/resources/data/cobblemon/species/generation6/floette.json
#	common/src/main/resources/data/cobblemon/species/generation6/goodra.json
#	common/src/main/resources/data/cobblemon/species/generation7/kommoo.json
#	common/src/main/resources/data/cobblemon/species/generation7/lurantis.json
#	common/src/main/resources/data/cobblemon/species/generation7/salazzle.json
#	common/src/main/resources/data/cobblemon/species/generation8/copperajah.json
2024-03-08 19:27:53 -05:00
Veraxiel 71e9adae1f Merge branch '1.5-Spawns' of https://gitlab.com/cable-mc/pokemon-cobbled into 1.5-Spawns 2024-03-08 19:16:02 -05:00
Veraxiel 35b53daa09 Added tags. 2024-03-08 19:12:59 -05:00
Waldleufer 937c30fca5 feat: initial version of output mds. 2024-03-08 23:54:34 +01:00
Waldleufer 141249e6c7 feat: remove redundant "Tags ↓" 2024-03-08 23:50:52 +01:00
Waldleufer 94f9bf9f50 feat: splitting output in multiple md files. 2024-03-08 23:43:20 +01:00
Waldleufer 4638b01279 feat: first version of markdown writer. 2024-03-08 23:35:10 +01:00
Nick e39d59c37a Merge branch 'gen10-will-wash-this-away' into 'main'
Support Stellar tera type & fix tera type selection.

See merge request cable-mc/cobblemon!907
2024-03-08 20:31:44 +00:00
LiciousandNick 072071d679 Support Stellar tera type & fix tera type selection. 2024-03-08 20:31:44 +00:00
Licious aa4400395b Support for soothe bell mechanic. 2024-03-08 10:50:07 +00:00
Licious 09ad3d0a4d Merge branch 'consolidated-versioning' into 'main'
Quick Fix for Crash Report Details to Actually be Written

See merge request cable-mc/cobblemon!906
2024-03-08 10:30:22 +00:00
NickandLicious de7df10f36 Quick Fix for Crash Report Details to Actually be Written 2024-03-08 10:30:22 +00:00
Lily 897bcf6fc0 Merge branch 'main' into MoreHoldItems
# Conflicts:
#	CHANGELOG.md
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonItems.kt
2024-03-07 17:21:43 -05:00
Lily 1e14042455 removed recipes for cut held items 2024-03-07 17:14:47 -05:00
Nick 8583c9af4d Merge branch 'ores_galore' into 'main'
terracotta sun stone ore

See merge request cable-mc/cobblemon!904
2024-03-07 19:50:08 +00:00
LilyandNick ce756997d6 terracotta sun stone ore 2024-03-07 19:50:08 +00:00
Licious 4efc5b6748 Merge branch 'consolidated-versioning' into 'main'
Change Version Publication for Better Maven Support

See merge request cable-mc/cobblemon!901
2024-03-07 18:23:07 +00:00
NickandLicious 7ed6075410 Change Version Publication for Better Maven Support 2024-03-07 18:23:06 +00:00
Lily 320d995672 add new held item sprites 2024-03-07 12:19:23 -05:00
Nick 8ae91587aa Merge branch 'feat/rework-starter-toast' into 'main'
Removing Starter Toast when it is nice and crispy.

Closes #579, #656, #771, and #655

See merge request cable-mc/cobblemon!898
2024-03-06 23:12:49 +00:00
WaldleuferandNick 61362fa1b1 Removing Starter Toast when it is nice and crispy. 2024-03-06 23:12:49 +00:00
Nick d010129864 Merge branch 'food_reorganization' into 'main'
moved the items in the food category around to make more sense (previously...

See merge request cable-mc/cobblemon!903
2024-03-06 21:24:18 +00:00
Nick 282f002895 Merge branch 'amo/sendout-upgrade' into 'main'
Ancient Send Outs

See merge request cable-mc/cobblemon!902
2024-03-06 21:22:48 +00:00
Lily 863f6de059 moved the items in the food category around to make more sense (previously were all at the very bottom) 2024-03-06 14:43:03 -05:00
JazzMcNade 8ddf628f19 When using a pokeball, fossil, or natural material on the fossil machine the client will always play ActionResult.CONSUME. 2024-03-05 01:25:43 -06:00
dhi_holo 8762d518c1 Merge branch 'main' into amo/sendout-upgrade 2024-03-05 13:56:10 +10:00
Sterrezo e75dcd63d1 Merge branch 'sega_bass_pro_fishing_2' of https://gitlab.com/cable-mc/cobblemon into sega_bass_pro_fishing_2 2024-03-04 17:46:49 +01:00
Sterrezo a4fc1442bf Updated fishing sounds 2024-03-04 17:46:06 +01:00
Paul 46798d694e Fixed generic entities not rendering, fixed Torkoal particles going upside down, fixed idle animation particles not playing, fixed loop particles not looping 2024-03-04 11:26:20 +10:00
Hiroku 056dd0fd4b Merge branch 'JsonScriptFixes' into 'main'
tiny Json script fixes

See merge request cable-mc/cobblemon!853
2024-03-03 07:54:12 +00:00
WaldleuferandHiroku 3ac00d976b tiny Json script fixes 2024-03-03 07:54:11 +00:00
Paul b30a76855b Fixed cancelling spawn events not actually cancelling the action, closes #612 2024-03-03 17:18:08 +10:00
Paul e976556ae3 (Probably) fixed edge case with pose transitions 2024-03-03 16:10:02 +10:00
Paul 9f16eca621 Merge branch 'main' into implement_pokemon 2024-03-03 15:49:20 +10:00
dhi_holo f4a94bd732 Merge branch 'main' into amo/sendout-upgrade
does this really fix forge?
2024-03-03 15:14:10 +10:00
Paul b6c964e03b Fixed Forge runs, again 2024-03-03 14:40:18 +10:00
dhi_holo aed2204483 Merge branch 'main' into amo/sendout-upgrade 2024-03-03 13:39:35 +10:00
Paul 3ed46cb7af Removed unused option in config (maxHorizontalSpace) 2024-03-03 13:38:59 +10:00
Paul cf9efe9b8c Fixed Snowstorm particles sometimes not appearing 2024-03-03 13:28:40 +10:00
Paul 02b9431731 Attach the entity from the entity particle packet to the storm (oops) 2024-03-03 13:14:13 +10:00
Paul a30ae0ccef Added query functions for entity_width, height, size, and radius to entity tracked particle storms 2024-03-03 12:46:28 +10:00
Hiroku a2905f4d37 Merge branch 'particle-events' into 'main'
Added "event" support to bedrock particles, locator support in the command,...

Closes #767

See merge request cable-mc/cobblemon!900
2024-03-03 02:00:36 +00:00
Paul b3aba1532c Added "event" support to bedrock particles, locator support in the command, and fixed inwards motion direction 2024-03-03 11:28:54 +10:00
Hiroku 6369bdb612 Merge branch '1.5_Structures' into 'main'
Added most of the 1.5 Structures

See merge request cable-mc/cobblemon!877
2024-03-03 00:20:02 +00:00
Hiroku b5db5605ef Merge branch 'FossilAnalyzerDirRenderFix' into 'main'
Fossils are now positioned correctly in all possible block facing directions

See merge request cable-mc/cobblemon!899
2024-03-02 23:48:29 +00:00
JazzMcNade 0207459a0f Fossils are now positioned correctly in all possible block facing directions 2024-03-02 16:37:44 -06:00
Hiroku 0e2fdfbce8 Merge branch 'ability-fix' into 'main'
Abilities fix

See merge request cable-mc/cobblemon!891
2024-03-02 05:20:10 +00:00
Hiroku 8c9da885c7 Merge branch 'main' into 'ability-fix'
# Conflicts:
#   CHANGELOG.md
2024-03-02 04:16:11 +00:00
Hiroku a5b6529f3c Merge branch 'display_case' into 'main'
Display case

See merge request cable-mc/cobblemon!879
2024-03-02 04:10:44 +00:00
Tyzillion 6e9bdb6019 Many hitboxes adjusted. Updated Squirtle and Wartortle animations. 2024-03-01 21:27:34 -05:00
Paul b430b7db76 Corrected Gimmighoul chest battle behaviour on server environments 2024-03-02 12:02:35 +10:00
Hiroku 8015ff0e20 Merge branch 'fix-grow-tumblestone-advancement' into 'main'
Grow Tumblestone Advancement triggers when placed near Lava or Magma

See merge request cable-mc/cobblemon!893
2024-03-02 01:21:55 +00:00
Dhyan PatelandHiroku ee78657e3d Grow Tumblestone Advancement triggers when placed near Lava or Magma 2024-03-02 01:21:55 +00:00
Hiroku 6cc84cd38c Merge branch 'tooltip-fix-fix' into 'main'
fix a small issue with appending tooltips

See merge request cable-mc/cobblemon!897
2024-03-02 00:28:30 +00:00
miasmus 31d6ff541e fix a small issue with appending tooltips 2024-03-01 16:36:31 -05:00
Plastered_Crab fb85ceacb0 - More adjustments to the reel-in trajectory 2024-03-01 12:40:14 -08:00
Veraxiel 841a40c973 Added and updated spawns. 2024-03-01 01:42:54 -05:00
jeffw773 e1a4086f24 - push new changes for Slippy 2024-02-29 20:11:09 -08:00
Tyzillion df049a315c Finished adjusting portraits and profiles on all newly implemented Pokemon. Started adjusting hitboxes. 2024-02-29 22:19:38 -05:00
Tyzillion 9ce5486189 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2024-02-29 22:18:54 -05:00
Paul b1992a94d3 Fixed piglin entity mixin on Forge 2024-03-01 11:10:47 +10:00
Paul 9da2e125ac More NPC AI, some molang context implementation 2024-03-01 10:07:25 +10:00
jeffw773 7d9644ba51 - tweak Gyarados spawn for testing 2024-02-29 08:58:05 -08:00
Veraxiel 167a1ea8eb Added some new tags. Updated spawn writer. 2024-02-29 10:19:57 -05:00
dhi_holo f95beaa7a1 Delete LICENSE
Gonna hope this wasn't important, it's giving a log error though and feels randomly placed in this folder, if we're meant to have it in here, probably shouldn't randomly be in the fossil items folder?
2024-02-29 20:08:36 +10:00
dhi_holo 1c0f7bbf8f Update restoration_tank.json
was erroring, so I fixed it so it'd be two less errors in the log (and potentially not break ingame, didn't test if these things could happen in natural gameplay)
2024-02-29 20:07:07 +10:00
dhi_holo 34cc2cda46 Maybe Masterball Fixes?
Need to break so just pushing this
2024-02-29 13:58:11 +10:00
dhi_holo 696e58bd1a Update snowstorm.json
removed unneeded/erroring lines
2024-02-29 13:50:40 +10:00
Tyzillion 10412b80ca Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2024-02-28 21:59:22 -05:00
dhi_holo 458c2ce0ed Merge branch 'main' into amo/sendout-upgrade 2024-02-29 12:34:00 +10:00
Tyzillion 6182715644 Implemented Salandit, Salazzle, Skarmory, Flabebe, Floette, Florges, Ferroseed Carbink, Goomy, Sliggoo, Goodra, Hisuian Goomy, Sliggoo, and Goodra, Flabebe, Floette, Florges, Jangmo-o, Hakamo-o, and Kommo-o.
Caught up a little on Profile and Portrait frames.
2024-02-28 21:26:20 -05:00
Plastered_Crab 39c856b69a - Added in all Ancient Rod predicates so they look right when casting 2024-02-28 15:49:56 -08:00
Plastered_Crab 4a4c375f66 - Added in new test sounds for fishing 2024-02-28 14:56:28 -08:00
Hiroku b41c4c21a8 Merge branch 'publish-versioning-fix' into 'main'
fix versioning

See merge request cable-mc/cobblemon!894
2024-02-28 22:07:33 +00:00
miasmus e1893f50ae fix versioning 2024-02-28 16:52:13 -05:00
Tyzillion a1bdf3ded6 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon
# Conflicts:
#	CHANGELOG.md
2024-02-28 15:21:29 -05:00
Lily a458b31c9f Merge branch 'main' into display_case
# Conflicts:
#	.gitignore
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonBlocks.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonItems.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonSounds.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/CobblemonClient.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/gui/battle/subscreen/BattleGeneralActionSelection.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/item/group/CobblemonItemGroups.kt
#	common/src/main/resources/assets/cobblemon/lang/en_us.json
#	common/src/main/resources/assets/cobblemon/models/item/relic_coin_pouch.json
#	common/src/main/resources/assets/cobblemon/sounds.json
2024-02-28 14:07:19 -05:00
Lily 03b5336eb8 refactor getPositioningType to avoid using tags 2024-02-28 14:02:29 -05:00
apion 9e2d00df63 Finished Anorith, Armaldo, Tyrantrum, Zorua, Zoroark, ZoruaH 2024-02-28 11:11:37 -05:00
apion e8003bb29a Added a few comments 2024-02-28 04:15:02 -05:00
apion a248d661fa Finished omastar 2024-02-28 01:07:05 -05:00
apion 59390f4d84 Finished archen line 2024-02-28 01:00:51 -05:00
apion 99b7e4a89e Finished tyrunt 2024-02-28 00:49:36 -05:00
apion fb37e543cf Fixed issues with json posers 2024-02-28 00:43:25 -05:00
apion c0c75a9735 Finished Rowlet line 2024-02-28 00:25:58 -05:00
apion 3febee21b6 Changed increment of debug keybindings 2024-02-28 00:03:44 -05:00
apion c3a017687c Finished Gen VIII fossil mons 2024-02-28 00:01:05 -05:00
apion afd082c966 Added scaling/translation key binds to portrait view, enableable/disableable via config 2024-02-27 23:34:52 -05:00
apion a6a1f7b75b Added scaling/translation keybinds to summary menu 2024-02-27 22:00:10 -05:00
apion 72738a45e6 Made portraitScale, portraitTranslation, profileScale, and profileTranslation vars instead of vals in every model file 2024-02-27 21:46:44 -05:00
apion 8a0076acb4 Start working on dragovish 2024-02-27 20:54:53 -05:00
apion f7e1def555 Fixed arctovish scaling and translations 2024-02-27 20:45:44 -05:00
Plastered_Crab d22df3e554 - tweaked reel in logic and trajectory 2024-02-27 16:36:09 -08:00
apion c13f6ae627 Implemented Ferrothorn, fixed missing anim on Dragonair 2024-02-27 19:12:39 -05:00
Plastered_Crab ed4dadc3f6 - cleaned up code 2024-02-26 16:21:44 -08:00
Plastered_Crab c2e5e39019 - Tweaked IV bait logic 2024-02-26 16:11:35 -08:00
Plastered_Crab f383e5a52f - Fixed some bait logic 2024-02-26 15:33:28 -08:00
Plastered_Crab 914b7c63c9 - Hooking entities no longer crashes the game :D 2024-02-26 14:37:57 -08:00
Plastered_Crab 5a17a5ed68 - Glow/Sweet Berries can be used as bait + fixes for particles for fishing trails 2024-02-26 12:04:54 -08:00
jeffw773 bb1a46950f - added comment to bobber entity 2024-02-26 06:27:39 -08:00
jeffw773 679d3eae58 - edit to vanilla bait list 2024-02-26 06:08:04 -08:00
jeffw773 a9cd80e496 - remove junk test fishing loot table. Finalize % chance to get Smithing Template odds 2024-02-26 05:38:50 -08:00
Licious c24ab2049d Merge branch 'main' into ability-fix
# Conflicts:
#	CHANGELOG.md
2024-02-26 11:45:32 +00:00
Licious b7b1850a4e Clarify changelog. 2024-02-26 11:41:49 +00:00
Licious 8995c107f7 Fix abilities, add ability capsule & patch. 2024-02-26 11:38:22 +00:00
dhi_holo d6a412b91a tags
tags
2024-02-26 17:38:30 +10:00
dhi_holo 5984d7a126 Cups and Functions
Adds Masterpiece and Unremarkable Teacups (Sinistea evolution items), and makes Medicinal Leek, Bone, and Snowball work as the Leek, Thick Club, and Snowball held items.
Snowballs do have a small issue with being thrown when trying to give it to a Pokemon though, for someone cool to investigate.
2024-02-26 16:44:26 +10:00
dhi_holo 6d8e645092 Merge branch 'main' into MoreHoldItems 2024-02-26 15:03:45 +10:00
apion a96cc307bb Fixed loot table injector 2024-02-25 23:39:06 -05:00
jeffw773 f2b2a282e5 Merge remote-tracking branch 'origin/sega_bass_pro_fishing_2' into sega_bass_pro_fishing_2 2024-02-25 19:56:20 -08:00
jeffw773 5bd7695ce8 - players can define their own bait now 2024-02-25 19:56:05 -08:00
Tyzillion 55f0db2263 Implemented Lunatone, Solrock, Woobat, Swoobat, Sandile, Krokorok, Krookodile, Frillish, Jellicent, Cubchoo, Beartic, Deino, Zweilous, Hydreigon, Larvesta, Volcarona, Fomantis, Lurantis, Dreepy, Drakloak, Dragapult, Makuhita, Hariyama, Alolan Diglett, Alolan Dugtrio, and Alomomola.
Updated Diglett and Dugtrio models.
2024-02-25 19:38:27 -05:00
Lily b42387a23f Merge remote-tracking branch 'origin/sega_bass_pro_fishing_2' into sega_bass_pro_fishing_2 2024-02-25 17:40:43 -05:00
Lily 6aa1e6f9ad advancement + tag changes 2024-02-25 17:39:55 -05:00
jeffw773 414fcf8278 - Removed additional crafting recipe 2024-02-24 21:27:26 -08:00
jeffw773 a3c26484a4 - Inejected Pokerod Smithing Template into Treasure Fishing table 2024-02-24 21:25:06 -08:00
Tyzillion 411788a07e Implemented Turtonator, Stonjourner, Cufant, Copperajah, Budew, Roselia, and Roserade.
Updated Growlithe's model.
2024-02-24 21:52:09 -05:00
Tyzillion f6151041c5 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon
# Conflicts:
#	CHANGELOG.md
2024-02-24 21:51:27 -05:00
Flarkinater f99168f1c3 Pokeball items no longer drift backwards when thrown directly overhead 2024-02-24 06:33:34 -05:00
Flarkinater adce1d8838 Fixed Pokemon not appearing when sent out from shoulder 2024-02-24 05:58:35 -05:00
Flarkinater e95c82b5af Greatly improved send-out location targeting 2024-02-24 05:16:44 -05:00
Paul 53acf7a628 Various improvements to NPC AI 2024-02-24 15:17:48 +10:00
Lily fbc8883c96 advancement fixes, removed crafting table recipes, fixed fishing bait not registering 2024-02-23 23:57:50 -05:00
Paul 235b5d062d Merge remote-tracking branch 'origin/main' into npcs 2024-02-24 13:56:55 +10:00
Paul 12b92d3f35 Added flow datapackable thing 2024-02-24 11:58:57 +10:00
jeffw773 baba3f669d Merge remote-tracking branch 'origin/sega_bass_pro_fishing_2' into sega_bass_pro_fishing_2 2024-02-23 17:45:38 -08:00
jeffw773 2fe098adac - added in recipes for ancient rods 2024-02-23 17:45:23 -08:00
Lily 1c770049b4 Merge remote-tracking branch 'origin/sega_bass_pro_fishing_2' into sega_bass_pro_fishing_2
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/item/interactive/PokerodItem.kt
2024-02-23 20:21:53 -05:00
Lily 71b854f36a ancient rods + advancements 2024-02-23 20:21:26 -05:00
Flarkinater dd273ffef2 Added beam mode for sending out Pokemon with no delay 2024-02-23 19:18:11 -05:00
jeffw773 61b944a293 - reworked fishing baits to be datapackable (now you can fish with steak if you wanted) 2024-02-23 16:16:48 -08:00
Paul dacfb4f1ff Merge branch 'npcs' into event-flows
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokeball/EmptyPokeBallEntity.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/util/MoLangExtensions.kt
2024-02-24 10:02:26 +10:00
Paul 4086ba73d3 Some structs for things 2024-02-24 09:59:27 +10:00
jeffw773 46ed6d0492 - more bait swapping logic 2024-02-23 08:53:46 -08:00
jeffw773 72058bb56f - Fixed some bait swapping logic 2024-02-22 23:57:05 -08:00
jeffw773 a7b28ed936 - Added some wip fishing sounds 2024-02-22 23:19:25 -08:00
jeffw773 96fce55688 - added some additional fishing spawn pool pokemon 2024-02-22 22:15:27 -08:00
Lily 85daf496d8 changes to pokerod item lang 2024-02-22 23:16:09 -05:00
Paul 7655ddb25b More AI work for NPCs, im lernings 2024-02-23 12:16:10 +10:00
Plastered_Crab 7b4b498877 - All but 6 berries are implemented for bait (save me) 2024-02-22 15:52:17 -08:00
Plastered_Crab 0ee32c7fd3 - Most of the baits work now (I am so tired) 2024-02-22 14:44:47 -08:00
Lily ac65910380 updated the relic coin pouch rendering inside display case 2024-02-22 17:18:20 -05:00
Lily ba6847be9a Merge branch 'gimmighoul_gholdengo' into display_case
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonBlocks.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonSounds.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/CobblemonClient.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/item/group/CobblemonItemGroups.kt
#	common/src/main/resources/assets/cobblemon/lang/en_us.json
#	common/src/main/resources/assets/cobblemon/sounds.json
2024-02-22 16:27:39 -05:00
Lily 5ddbcd1830 various changes to display case 2024-02-22 15:03:17 -05:00
Lily 47605646d0 Merge branch 'main' into display_case 2024-02-22 14:26:33 -05:00
Lily d9fdf089c2 fix display case z-fighting 2024-02-22 14:00:15 -05:00
Plastered_Crab 2c2c1b0cf4 - More groundwork for bait 2024-02-22 09:30:46 -08:00
jeffw773 218edf680b - Ground work for baits having effects on fishing 2024-02-21 21:35:21 -08:00
Plastered_Crab 7598a0dacc - Updated assets for rods 2024-02-21 18:33:25 -08:00
Lily e9a405694c display case sounds 2024-02-21 18:47:20 -05:00
Plastered_Crab 7327a4ddb5 - Bait can be removed and swapped out on the bobber 2024-02-21 11:44:21 -08:00
Plastered_Crab f1d3e7b12b - Bait can now be applied to the fishing bobbers 2024-02-21 11:09:53 -08:00
jeffw773 410ea6be87 - Tweaked line colors and started on bait testing 2024-02-20 23:08:48 -08:00
dhi_holo 8555168a6a Undoing commit "Tags on top of Tags"
Moving it to a new branch, so just removing it from here so my new changes don't conflict later
2024-02-21 15:41:48 +10:00
Tyzillion 1b5c0be975 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon
# Conflicts:
#	CHANGELOG.md
2024-02-20 23:25:41 -05:00
Plastered_Crab 399dfc33c5 - Added Beast Rod (blue string variant) 2024-02-20 17:05:20 -08:00
dhi_holo 5924398eff Update CobblemonItemGroups.kt
soothe bell to creative tab
2024-02-21 10:47:10 +10:00
dhi_holoandPlastered_Crab a08855ab37 Heal and Harm
Added translations for the battle text of Dry Skin, Cheek Pouch, Earth Eater, Icy Body, Volt Absorb, Water Absorb, and Sand Tomb.
2024-02-20 16:09:52 -08:00
Plastered_Crab 91abe39cdd Merge remote-tracking branch 'origin/MoreHoldItems' into MoreHoldItems
# Conflicts:
#	CHANGELOG.md
2024-02-20 16:07:49 -08:00
Plastered_Crab ad8aab7c19 - Added Soothe Bell 2024-02-20 16:06:45 -08:00
Plastered_Crab aa6b196c29 Merge branch 'main' into MoreHoldItems
# Conflicts:
#	common/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json
#	common/src/main/resources/data/minecraft/tags/items/decorated_pot_sherds.json
2024-02-20 15:58:50 -08:00
Plastered_Crab 26e39bb37d - Altered the trajectory of reeled in pokemon 2024-02-20 15:17:11 -08:00
dhi_holo 5268447fa3 could've sworn I pushed these yesterday
placeholder particles for balls which aren't getting particles yet
2024-02-21 09:11:07 +10:00
Plastered_Crab 4ff7df63c0 - Fixed colored fishing lines for cosmetic rods and fixed line not breaking when swapping to another rod 2024-02-20 14:45:39 -08:00
jeffw773 1d1f749d6d - Added cast predicates and JSON features to each remaining cosmetic rod 2024-02-20 01:36:14 -08:00
Segfault Guy acf467c8a3 Track battle time. 2024-02-19 22:51:16 -05:00
Segfault Guy 0ff5b95c44 Hello, I'm the Interpreter critic. I refactor it so you don't have to! 2024-02-19 21:12:51 -05:00
dhi_holo 818b39e945 Dusky
Apparently missed this one

But why do Ancient Feather, Wing, Jet, Leaden, Gigaton no worky??
(remaining unimplemented: cherish, dream, beast, origin)
2024-02-20 12:08:29 +10:00
Plastered_Crab d6e4b9c1a6 - Added other rods to the CobblemonItems list 2024-02-19 17:19:56 -08:00
apion 15d3ee0d49 Data-packable fishing rods kind of 2024-02-19 19:56:22 -05:00
Plastered_Crab de0ed1ab41 - Added crafting table recipes for cosmetic rods 2024-02-19 15:12:47 -08:00
Lily 81d930afae poke rod sync stuff (not fully working atm) 2024-02-19 15:37:30 -05:00
Plastered_Crab b83d75f30f - More Attempts at setting ball used for bobber and line color for rod during registry 2024-02-19 11:42:04 -08:00
Plastered_Crab 5814c1a5d6 - Attempts to get each ball rendered correctly for each rod (still needs work) 2024-02-19 10:10:57 -08:00
dhi_holo 30666349a1 [WIP] Ancient Send Outs
base 7, great, and ultra work right, but the heavy/wing sets have broken send out flashes (besides ancient heavy specifically)
Just pushing because it's 11pm and it's honkshnoomemememememe time
2024-02-19 23:09:17 +10:00
jeffw773 a45fec50a4 - Added fancy cosmetic Rods for each pokeball type 2024-02-18 22:51:05 -08:00
jeffw773 576b6ea767 - implemented test Magikarp animations + added test hook to Bobber 2024-02-18 18:05:16 -08:00
Paul dd6271ceed Merge remote-tracking branch 'origin/main' into npcs 2024-02-19 11:35:40 +10:00
jeffw773 792287cb5a - added new Magikarp models/textures/animations 2024-02-18 14:44:11 -08:00
Lily 42ad084dbe pokerod assets 2024-02-18 16:24:20 -05:00
jeffw773 b9bd61f3dc - fishing line connects to bobber much better now 2024-02-18 01:04:41 -08:00
jeffw773 c6d6f98d03 - fishing line connects to bobber much better now 2024-02-18 01:03:28 -08:00
jeffw773 abbd17faf7 - Pokeball Bobber now casts with more controlled random pitch/yaw amounts and also rotates upright when it hits water 2024-02-18 00:29:21 -08:00
jeffw773 c159137a70 Merge remote-tracking branch 'origin/display_case' into sega_bass_pro_fishing_2 2024-02-17 22:54:08 -08:00
jeffw773 03628631f7 - Pokeball bobber now rotates upwards when bobbing in water 2024-02-17 11:50:37 -08:00
jeffw773 e5e61df4b2 Merge remote-tracking branch 'origin/sega_bass_pro_fishing_2' into sega_bass_pro_fishing_2
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/entity/PokeBobberEntityRenderer.kt
2024-02-17 10:31:26 -08:00
Lily f07c4bf5b1 refactored fishing bobber variable names to be more readable instead of the single-letter names that mc gives us 2024-02-17 11:31:38 -05:00
Lily 0e3fd520f0 fixed naming to be more consistent with vanilla textures 2024-02-17 11:23:08 -05:00
jeffw773 935f3100d2 - Pokeball Bobber now slows down fast in water (due to water friction) and has a random spin applied when casting 2024-02-16 22:12:07 -08:00
Lily 8b32764ce3 pokerod smithing template assets 2024-02-17 00:14:26 -05:00
Lily 3e5a57ea20 pokerod now slowly stops spinning 2024-02-16 23:35:34 -05:00
Lily fb34d4bd23 suppressed gimmighoul's desire to be a necromancer 2024-02-16 20:50:03 -05:00
Plastered_Crab 6ee94aa55b - Pokeball Bobber now spins when cast and stops spinning on land, needs fixed for water surface 2024-02-16 17:01:07 -08:00
Paul 05e7e1448b Removed redundant function 2024-02-17 10:51:10 +10:00
Lily bd5185e69e Merge remote-tracking branch 'origin/sega_bass_pro_fishing_2' into sega_bass_pro_fishing_2 2024-02-16 19:31:40 -05:00
Lily 5e8df4609b started bobber rendering 2024-02-16 19:31:21 -05:00
Paul 6ca1337ff9 Merge branch 'gimmighoul_gholdengo' into 1.5_Structures 2024-02-17 10:29:18 +10:00
Plastered_Crab 289d1474a6 - Beeeeg Whiscash has been added to fishing spawn chances 2024-02-16 14:54:52 -08:00
Plastered_Crab e4604c0d13 - Wooper (Heart variant) is now fully implemented for fishing 2024-02-16 14:24:31 -08:00
Tyzillion d4f91fa945 Wooper Heart Fix. <3 2024-02-16 16:53:53 -05:00
Plastered_Crab 5c52a9a31a - Started Implemented Wooper (heart form) to be added to the fishing chance pool 2024-02-16 13:19:57 -08:00
Tyzillion 98106cad12 Implemented Darumaka line, and Petilil line with Hisuian counterparts. 2024-02-16 16:14:43 -05:00
Plastered_Crab db2efcb48e - added new spawn conditional for lureLevel. Variants of Karp can now only have a chance to appear at certain Lure levels 2024-02-16 10:32:55 -08:00
Plastered_Crab 3bcbe2fb45 - Incorporated Pokerod Treasure loot table and player will physically reel in pokemon under 200 lbs 2024-02-16 09:32:01 -08:00
Lily 0d344337dd Merge branch 'main' into display_case
# Conflicts:
#	.gitignore
#	CHANGELOG.md
#	common/src/main/kotlin/com/cobblemon/mod/common/client/CobblemonClient.kt
2024-02-16 11:55:15 -05:00
Paul 3d27681aaa Randomize Pokémon spawn positions and position gimmighoul reveals better 2024-02-16 16:31:00 +10:00
Paul 352202203a Merge branch 'gimmighoul_gholdengo' into 1.5_Structures 2024-02-16 15:04:51 +10:00
Paul 62cfbd7087 Licenses 2024-02-16 15:03:53 +10:00
Paul 5a64e8ea1b Animated the trap chest opening 2024-02-16 15:03:15 +10:00
Paul 8dc9863a5d Conflict resolution and cleanup 2024-02-16 14:39:22 +10:00
Myslippy 9280258413 Implemented most of the Fossil & Ruin Structures 2024-02-16 03:13:32 +00:00
Paul 51a11163dd Merge remote-tracking branch 'origin/main' into gimmighoul_gholdengo
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonBlocks.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonSounds.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/events/CobblemonEvents.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/CobblemonClient.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/block/FossilTubeRenderer.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/bedrock/animation/BedrockStatefulAnimation.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/item/group/CobblemonItemGroups.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/pokemon/Species.kt
#	common/src/main/resources/assets/cobblemon/lang/en_us.json
#	common/src/main/resources/assets/cobblemon/sounds.json
2024-02-16 12:43:35 +10:00
Paul c7202cc869 Fixed magikarp jump pattern spawn file 2024-02-16 11:34:40 +10:00
Lily 269e18786b Merge remote-tracking branch 'origin/sega_bass_pro_fishing_2' into sega_bass_pro_fishing_2 2024-02-15 19:40:14 -05:00
Lily bd79a4ecfb pokerod smithing template (needs some more assets but should be functional) 2024-02-15 19:39:49 -05:00
Plastered_Crab 3c3a8b1af9 - Pokerod now cannot stack and has same durability as vanilla fishing rod 2024-02-15 16:07:54 -08:00
Lily 11e2ed34e5 Merge branch 'main' into sega_bass_pro_fishing_2
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonEntities.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonItems.kt
#	fabric/src/main/kotlin/com/cobblemon/mod/fabric/client/CobblemonFabricClient.kt
#	forge/src/main/kotlin/com/cobblemon/mod/forge/client/CobblemonForgeClient.kt
2024-02-15 18:54:42 -05:00
Plastered_Crab 1500d6cdf1 - All Magikarp Jump variants implemented and new item loot tables started 2024-02-15 14:59:18 -08:00
Plastered_Crab acbbe2a1ba - Start to JUMP variants spawning properly when fishing 2024-02-14 16:42:58 -08:00
Plastered_Crab 0fe6bc918c - Adding Magikarp JUMP addon variants into Base mod 2024-02-14 14:57:27 -08:00
Plastered_Crab d399b3e29a - Magikarps now get reeled in at good distances in front of player 2024-02-14 14:20:32 -08:00
Flarkinater 82548b5383 Pokémon recoil when hit by a ball 2024-02-13 22:48:27 -05:00
Segfault Guy 8d7ebeef4f Merge branch 'main' into illusion 2024-02-13 21:15:49 -05:00
Plastered_Crab acc6f119e1 - Magikarps getting reeled in now land in front of the player instead of behind the player (for battle reasons) 2024-02-13 16:45:22 -08:00
Lily d5ad84a495 refactored PositioningType 2024-02-13 19:02:53 -05:00
Flarkinater ad73202e17 Adjusted timing on breaking free animation + sound 2024-02-13 18:50:08 -05:00
Plastered_Crab 932a2c375c - Begin different reel-in trajectories for fishing up Magikarps 2024-02-13 14:46:42 -08:00
Tyzillion 1560b142d2 Updated quirks for implemented Pokemon. 2024-02-13 08:22:50 -05:00
Flarkinater 2965a04742 Implemented existing "break free" animation when capture fails 2024-02-12 23:02:55 -05:00
Lily b01086270a fix positioning on certain items that use block entity renderers 2024-02-12 19:18:18 -05:00
Lily 8d5eb5883d gilded chests now get blocked with blocks above them like regular chests do 2024-02-12 14:57:24 -05:00
Tyzillion d5fa693f43 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon
# Conflicts:
#	CHANGELOG.md
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen1/BlastoiseModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen1/ChanseyModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen1/DragonairModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen1/DratiniModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen1/ElectabuzzModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen2/ElekidModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen3/IllumiseModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen3/NumelModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen3/VolbeatModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen4/CarnivineModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen4/DrifblimModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen4/DrifloonModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen5/ChandelureModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen5/LampentModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen5/LitwickModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen9/LechonkModel.kt
#	common/src/main/resources/assets/cobblemon/bedrock/pokemon/animations/0009_blastoise/blastoise.animation.json
#	common/src/main/resources/assets/cobblemon/bedrock/pokemon/models/0009_blastoise/blastoise.geo.json
#	common/src/main/resources/assets/cobblemon/particles/snowstorm.json
2024-02-11 12:52:08 -05:00
JazzMcNade 0d12bf1190 Relic Coins Sacks can be bartered with Piglins for loot.
Can always remove this if undesired or make it a tag, change the item, etc.
2024-02-10 21:23:05 -06:00
Paul 1d3de659a8 Conflicty resolvo 2024-02-11 12:14:51 +10:00
Paul 9e5879edd3 Put molang back 2024-02-11 12:01:39 +10:00
Paul 4f71340ef8 Conflict stuff 2024-02-11 11:59:40 +10:00
Paul b5c4863e20 Setup saving for NPC edit UI 2024-02-11 11:38:28 +10:00
Paul a3eff4b195 Merge branch 'move-animations' into npcs
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/battles/ShowdownInterpreter.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/entity/PokemonClientDelegate.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/pokemon/PokemonRenderer.kt
2024-02-10 16:12:26 +10:00
Nick 142eebe9e6 Apply model predicates, starting with Pokerod 2024-02-09 22:07:43 -08:00
jeffw773 36f19c9180 - Xp is rewarded to player for fishing up Pokemon 2024-02-09 21:15:10 -08:00
Paul 168e034daf Removed some more dead code 2024-02-10 13:28:56 +10:00
Lily 4f773f63cb fix hopper dupe bug 2024-02-09 22:04:01 -05:00
Paul 827e651b22 Removed some dead code 2024-02-10 12:15:37 +10:00
Paul fc34312bbb Crucial all-important fix (may change the world as we know it) 2024-02-10 12:15:14 +10:00
Paul 53261b3274 Removed dead code 2024-02-10 11:40:35 +10:00
Paul 9c3a38657c Merge remote-tracking branch 'origin/main' into move-animations 2024-02-10 11:37:57 +10:00
Paul 656487c868 Oops don't remove that 2024-02-10 11:36:36 +10:00
Paul d491f16aff Merge remote-tracking branch 'origin/main' into move-animations
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/fossil/FossilModel.kt
2024-02-10 11:31:10 +10:00
Paul 29a5b4931d Changelog 2024-02-10 11:30:47 +10:00
Paul 42fdcc740e The default target locator would probably work as a default special_attack locator 2024-02-10 11:27:20 +10:00
Paul 3bfc3ca425 Approximate the target locator for pokemon without that locator in the model 2024-02-10 11:19:28 +10:00
Lily 3f3ae74535 update .gitignore 2024-02-09 19:58:44 -05:00
Lily 7429fea802 fixed crash on dedicated servers (again) + made cases compatible with hoppers 2024-02-09 19:46:23 -05:00
Paul 82682c3710 Merge remote-tracking branch 'origin/main' into move-animations
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/PoseableEntityState.kt
2024-02-10 10:37:12 +10:00
Lily ac5cd47715 multiple display case bugfixes 2024-02-09 17:59:57 -05:00
jeffw773 beb8fed6bd - Pokeball Bobber now renders correctly when cast out with Pokerod
- Luck of the Sea and Lure get read correctly from the rod and factor into the spawn bucket chosen
2024-02-09 14:17:13 -08:00
Tyzillion 9901d39f9b Implemented Hisuian Sneasel, Sneasler, and Tropius. 2024-02-09 14:46:18 -05:00
JazzMcNade c635a1d331 Removed duped block tag entry 2024-02-09 01:08:35 -06:00
JazzMcNade cf2173a281 Opening a gilded chest now aggros piglins 2024-02-09 00:15:55 -06:00
JazzMcNade 710d37f453 Added piglin related tags for glided chests and relic coin related items 2024-02-08 23:52:36 -06:00
jeffw773 142284a17c - Pokemon rarity is altered by Luck of the Sea 2024-02-08 21:18:41 -08:00
Paul 261850cc9f Early work on NPC editor 2024-02-09 13:47:40 +10:00
Lily 1fb3416211 implemented the display case 2024-02-08 22:46:16 -05:00
jeffw773 f1ea86362a - Fixed fishing spawns being able to check if sky is actually visible.
- added isOcean to biomes to Magikarp
2024-02-07 18:28:42 -08:00
Tyzillion f49f2a7305 Implemented Amaura, Aurorus, Hisuian Voltorb, Hisuian Electrode, Sentret, Furret, Qwilfish, Hisuian Qwilfish, and Overqwil.
Updated Dracovish model.
2024-02-06 14:30:54 -05:00
Tyzillion b0e9c1ab28 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon
# Conflicts:
#	CHANGELOG.md
2024-02-06 14:22:32 -05:00
JazzMcNade ac1c7d8b78 Mobs can now pathfind around Gilded Chests 2024-02-04 20:00:20 -06:00
Tyzillion dec5151eb8 /gradlew updateLicenses go brrrrrrrrr. 2024-02-04 00:11:14 -05:00
Paul d1772b0241 Merge branch 'amo/sendout-upgrade' into npcs
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/client/CobblemonClient.kt
2024-02-04 14:46:04 +10:00
Tyzillion 196edc2711 Updated animations for Happiny, Carnivine, Litwick, Lampent, Chandelure, Lechonk, and Falinks.
Updated model for Lechonk, Drifloon, and Drifblim.
Fixed Drifloon eyes.
2024-02-03 23:35:35 -05:00
Tyzillion 18015a26fd Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon
# Conflicts:
#	CHANGELOG.md
2024-02-03 21:10:07 -05:00
Tyzillion aa296a79a9 Added placeholder walk animations to Zoroark. Updated animations for Galarian Meowth, Galarian Rapidash, Venonat, Venomoth, Phanphy, Donphan, Dratini, Dragonair, Chansey, Blissey, Volbeat, Illumise, Numel, Drifloon, and Drifblim.
Updated model and texture for Danphan.
Updated model for Illumise, Dratini, Dragonair, Drifloon, and Drifblim.
Added cries for all Meowth variants.
Added missing blink to Psyduck.
2024-02-03 21:09:04 -05:00
Lily 92dd85643e Merge branch 'amo/sendout-upgrade' into gimmighoul_gholdengo
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/api/events/CobblemonEvents.kt
2024-02-03 19:45:47 -05:00
Lily 8849de1bfd Merge remote-tracking branch 'origin/amo/sendout-upgrade' into amo/sendout-upgrade
# Conflicts:
#	common/src/main/resources/assets/cobblemon/bedrock/particles/balls/capture/capturestar.particle.json
#	common/src/main/resources/assets/cobblemon/bedrock/particles/balls/capture/hisui/hisuicapturestar.particle.json
2024-02-03 19:44:41 -05:00
Paul ec3361ad91 Added basic fishing spawn detail for Magikarp and use the world pool for fishing because ehhh 2024-02-03 12:16:53 +10:00
Paul ca7c36ce15 Added trigger spawning with a fishing implementation 2024-02-03 12:13:38 +10:00
jeffw773 f7c73728d7 - Added some newer spawning stuff and added battle initiation after fished up mon 2024-02-02 16:38:15 -08:00
jeffw773 1992a23edc Merge branch 'main' into sega_bass_pro_fishing_2 2024-02-02 13:39:02 -08:00
Paul 4bb2564b80 Merge branch 'amo/sendout-upgrade' into move-animations 2024-02-02 14:26:44 +10:00
Paul 4ab72dd0d9 Added MoLang scrip framework 2024-02-02 11:31:42 +10:00
Lily 2a349697b4 colored gilded chest variants :3 2024-02-01 20:28:12 -05:00
Tyzillion a4055e6206 Been a minute since I've last added stuff...
Updated models and textures for Omanyte, Squirtle, Rowlet line, Psyduck, Dusknoir, Swinub, and Piloswine.

Implemented Aron, Gossifleur, Zorua, Hisui Zorua, Hippopotas, Tyrunt, Anorith, and Archen line.
2024-01-31 20:58:23 -05:00
Lily 03bda4e27d fixes to be compatible with the updated held item event 2024-01-30 17:33:51 -05:00
Lily 5d8abbd4c7 Merge branch 'main' into gimmighoul_gholdengo
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/client/CobblemonClient.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/pokemon/Pokemon.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/pokemon/evolution/adapters/CobbledRequirementAdapter.kt
2024-01-30 16:51:56 -05:00
Lily 6b167a7a17 gilded chest variants are implemented, waiting for textures 2024-01-30 16:46:22 -05:00
Tyzillion 5c64bc94ff Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2024-01-30 13:32:04 -05:00
apion d36c24075c Fixed rotations? 2024-01-29 16:48:21 -05:00
Lily d1a8122296 fixed rotation for gilded chest as well 2024-01-29 12:44:41 -05:00
Lily a8e6e684ab updated relic_coin_pouch.png 2024-01-29 12:22:55 -05:00
Lily 188fc2b5d9 fixed inconsistencies between the actual value of the facing property and the direction the coin pouch was facing 2024-01-29 12:19:50 -05:00
Tyzillion 2bc2e3f020 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon
# Conflicts:
#	common/src/main/resources/data/cobblemon/species/generation8/basculegion.json
2024-01-28 12:36:36 -05:00
Paul 7f6eb452be Moved NPCs over to JSON posers and improved declaration of label exclusions in primary animations 2024-01-27 11:08:01 +10:00
Lily 7a15e6b004 Merge remote-tracking branch 'origin/amo/sendout-upgrade' into amo/sendout-upgrade
# Conflicts:
#	CHANGELOG.md
#	common/src/main/resources/assets/cobblemon/bedrock/particles/balls/capture/hisui/hisuicapturestar.particle.json
2024-01-26 17:46:34 -05:00
Lily 6ee6beddeb capture particles... again 2024-01-26 17:45:31 -05:00
Lily b92960da77 Merge branch 'main' into amo/sendout-upgrade 2024-01-26 17:29:13 -05:00
Paul 0afe50c883 Some fixes to have NPCs use the send out animations 2024-01-26 12:59:08 +10:00
Paul a74499a14b Conflict issues 2024-01-26 11:07:23 +10:00
Paul e6ff24072f Merge branch 'move-animations' into npcs
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/Cobblemon.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonEntities.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/net/serializers/IdentifierDataSerializer.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/scheduling/SchedulingFunctions.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/CobblemonClient.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/PoseableEntityModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/bedrock/animation/BedrockStatefulAnimation.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/pokemon/PokemonRenderer.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/command/TestCommand.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/data/CobblemonDataProvider.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonEntity.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/pokemon/Pokemon.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/util/DataKeys.kt
2024-01-26 10:51:47 +10:00
Paul 7693d22e58 Why is there a .ignored folder 2024-01-25 19:31:25 +10:00
Paul f3544f9cdf Updated inbuilt posers for new animation system stuff 2024-01-25 19:30:44 +10:00
Paul 9f7800b995 Mountains of remaining work on move animations system 2024-01-25 19:10:41 +10:00
dhi_holo 99618184e7 Heal and Harm
Added translations for the battle text of Dry Skin, Cheek Pouch, Earth Eater, Icy Body, Volt Absorb, Water Absorb, and Sand Tomb.
2024-01-22 16:18:55 +10:00
dhi_holo fcdff126fd Merge branch 'main' into MoreHoldItems 2024-01-22 15:22:31 +10:00
jeffw773 3b285cc8bd - Changes to Relic Coin sack default placement direction for Structures 2024-01-19 10:51:21 -08:00
Paul 022c8ed499 Merge branch 'amo/sendout-upgrade' into move-animations
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/client/entity/PokemonClientDelegate.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/PoseableEntityModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/PoseableEntityState.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/bedrock/animation/BedrockAnimation.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokeball/PokeBallModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/JsonPokemonPoseableModel.kt
2024-01-19 13:50:41 +10:00
jeffw773 4dead98e6b - Pesky little chest Gimmieghouls spawn facing the direction of the chest block now 2024-01-18 18:16:09 -08:00
jeffw773 db36f8da2a - Gimmieghoul Chest and Gilded Chest now face the player when placed down 2024-01-18 16:07:45 -08:00
jeffw773 dad28135cc - Brief changes to particle count based on rarity reeled in 2024-01-18 14:32:43 -08:00
dhi_holo 3a448071d7 Merge branch 'main' into MoreHoldItems 2024-01-16 11:38:51 +10:00
jeffw773 e41d13dd53 - Pokerod now uses config values for rarity buckets and access biome spawn pools 2024-01-14 23:02:33 -08:00
jeffw773 64cae53d82 - Pokerod foundation laid out for having chance to spawn Pokemon instead of getting item as well as rarity chance started 2024-01-14 00:11:12 -08:00
dhi_holo c9bf0bd8d7 Merge branch 'sega_bass_pro_fishing_2' of https://gitlab.com/cable-mc/cobblemon into sega_bass_pro_fishing_2 2024-01-14 13:36:53 +10:00
dhi_holo 97d2047aee It's a Tool, It's a Rod
makes pokerod be held correctly, and adds second model file for the cast variation, when that is implemented.
2024-01-14 13:36:04 +10:00
jeffw773 811f8abed7 - Added override for model of pokerod when cast 2024-01-13 19:27:22 -08:00
jeffw773 ab02a54f28 - Finally the Pokerod is starting to work! (it is backwards tho) 2024-01-13 19:08:36 -08:00
Paul 7215860d74 Merge remote-tracking branch 'origin/gimmighoul_gholdengo' into gimmighoul_gholdengo 2024-01-14 08:08:04 +10:00
Paul dc899ffc1b Fixed gimmighoul stuff for realsies this time 2024-01-14 08:07:49 +10:00
jeffw773 6e0c1aefcc - More testing fishing code for pokerod 2024-01-13 13:55:02 -08:00
Lily 88fe55bbb9 pouch blocks and bugfixes 2024-01-13 16:23:39 -05:00
jeffw773 e887b6c43c - Some code for fishing testing again 2024-01-13 12:16:38 -08:00
jeffw773 25172c2bc9 - Some code for fishing testing 2024-01-13 11:23:38 -08:00
jeffw773 929b90173a - Some code for fishing testing 2024-01-12 11:58:02 -08:00
jeffw773 70a65f6ffe - Testing code 2024-01-12 07:39:21 -08:00
jeffw773 db7d3f01d8 - Starting implementation on fishing 2024-01-12 07:39:20 -08:00
Paul 3d3c421b5c Fixed syncing issues with species feature providers 2024-01-12 18:15:10 +10:00
Paul 08565a9823 Brought fossils into the new molang/animation changes 2024-01-12 10:01:02 +10:00
Tyzillion 3c2cfa4ffc Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2024-01-10 18:46:04 -05:00
Lily 89a4edb327 drops and creative inv 2024-01-09 15:59:33 -05:00
Lily ab37580258 gimmighoul chests crash ur game a little bit less now :o 2024-01-09 14:56:50 -05:00
Lily c116c01fd6 licenses 2024-01-09 14:16:09 -05:00
Lily e3ad8f8079 gimmi now challenges the player on reveal 2024-01-09 13:54:35 -05:00
Lily a491d508b6 gilded chest visuals, loot tables/recipes, sounds, etc. 2024-01-09 12:38:58 -05:00
dhi_holo 3e11d0550f More item sprites!
24 left, I think, since there's 4 updates and 4 news today
2024-01-09 18:49:20 +10:00
dhi_holo e8b50f8115 Merge branch 'main' into MoreHoldItems 2024-01-09 11:40:46 +10:00
apion 02fb825328 Update Gimmighoul model, add disguised chest block entity, gilded chests now save contents 2024-01-08 14:05:09 -05:00
Paul e11245f609 Merge remote-tracking branch 'origin/main' into move-animations
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonNetwork.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/molang/ExpressionLike.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/molang/MoLangFunctions.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/molang/SingleExpression.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/battles/ShowdownInterpreter.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/ClientMoLangFunctions.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/PoseableEntityModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/pokeball/PokeBallPoseableState.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/config/CobblemonConfig.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/Poseable.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonEntity.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/util/MiscUtils.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/util/MoLangExtensions.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/util/adapters/ExpressionLikeAdapter.kt
2024-01-08 16:17:56 +10:00
Paul b3a6d8eb27 Tried fixing a wander path issue 2024-01-08 12:30:35 +10:00
Paul 8df6eea107 Fixed various issues with the gilded chest and its animations 2024-01-08 11:00:20 +10:00
apion 1376bb68f4 Tried again, failed again 2024-01-07 11:53:38 -05:00
apion beb8f2ccf1 Merge branch 'main' into gimmighoul_gholdengo
# Conflicts:
#	CHANGELOG.md
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonNetwork.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonSounds.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/storage/party/PlayerPartyStore.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/CobblemonClient.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/PoseableEntityModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/repository/PokemonModelRepository.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonEntity.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/net/messages/PokemonDTO.kt
#	common/src/main/resources/assets/cobblemon/lang/en_us.json
#	common/src/main/resources/assets/cobblemon/sounds.json
#	common/src/main/resources/data/cobblemon/species/generation9/gimmighoul.json
2024-01-07 10:41:34 -05:00
Paul 093c3683c5 Merge remote-tracking branch 'origin/main' into npcs 2024-01-07 14:04:45 +10:00
Segfault Guy d9de8f2678 Update showdown to send UUID of Zoroark on switch. 2024-01-06 22:03:00 -05:00
Paul 2b4b9ca5dd Setup and foundation work on NPC entity AI 2024-01-07 12:32:25 +10:00
dhi_holo 510dfec0e5 Merge branch 'main' into MoreHoldItems 2024-01-06 13:12:24 +10:00
dhi_holo e54932c876 8 Textures
Replaced Black Belt and Focus Band textures, added Covert Cloak, Expert Belt, Focus Sash, Iron Ball, Red Card, and Shell Bell
2024-01-06 13:12:00 +10:00
Paul ea70d27f87 Merge remote-tracking branch 'origin/main' into npcs 2024-01-06 10:37:21 +10:00
Paul 5487b81f10 Improved rendering of reference faces and NPCs in dialogue GUI 2024-01-06 10:36:37 +10:00
Tyzillion dd14c3bbdd Implemented Basculegion, Cranidos, and Rampardos. Tyrogue can mount shoulder.
Updated models and textures for Basculin and Squirtle line.
2024-01-05 13:30:57 -05:00
Tyzillion 5ea237f8a0 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon
# Conflicts:
#	CHANGELOG.md
2024-01-05 13:29:56 -05:00
Paul 96b8aeb5b8 Added NPC face and dialogue scripty stuff woo 2024-01-05 16:00:03 +10:00
Paul bf1520b1b4 Fixed NPC recalling logic 2024-01-05 11:03:09 +10:00
Paul 0f22da7ff2 Merge remote-tracking branch 'origin/main' into npcs
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonNetwork.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/battles/ShowdownInterpreter.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/CobblemonClient.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/command/TestCommand.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/data/CobblemonDataProvider.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/util/DataKeys.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/util/MiscUtils.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/util/adapters/MoValueAdapter.kt
2024-01-05 10:20:35 +10:00
dhi_holo fb154ba457 Merge branch 'main' into MoreHoldItems 2024-01-05 08:39:23 +10:00
dhi_holo f7812896a8 Weather Rock Textures
4 down, 36 to go (+6 unimplemented)
2024-01-05 08:38:55 +10:00
Lily b0d57dd875 coin bags and blocks and stuff 2024-01-04 15:56:58 -05:00
Lily 6c09e2b553 Merge remote-tracking branch 'origin/gimmighoul_gholdengo' into gimmighoul_gholdengo 2024-01-04 13:47:21 -05:00
Lily 593104fb0a BIG COIN BAG!! 2024-01-04 13:45:43 -05:00
apion e314664731 Throw some stuff in and hope Hiro can fix it (I need a hero! I'm holding out for a hero...) 2024-01-04 07:31:29 -05:00
apion d0a38a9704 Add chest assets, do some work on getting chest animation working 2024-01-04 06:48:59 -05:00
Lily 6e155d7651 Merge remote-tracking branch 'origin/gimmighoul_gholdengo' into gimmighoul_gholdengo 2024-01-04 00:04:41 -05:00
Lily ae8f8a2fb8 working run button!!! wow!!! 2024-01-04 00:04:26 -05:00
apion 5a6a83aac1 Cleanup, add new model 2024-01-03 23:50:55 -05:00
dhi_holo e8236b55a4 Recipe Fixes plus Information in Description
There are 6 items left unimplemented from the recipe document.
Soothe Bell, due to being an out of battle effect, I don't want to attempt, and Amulet Coin needs design work before implementation.
The four terrain seeds, due to future plans, I'm not sure if need to be set up differently. Beyond those six held items, this branch has all currently requested held items to my knowledge, all should now work as intended, although I have not confirmed all battle dialogue works, in part due to not wanting to find all the documentations of what the lines should be. I might come back to that another day, though.

Commits marked with "No Obtain Method" refer to items which have obtain methods of loot or whatever, which can be handled later by people familiar with those systems. If not, I'm down to learn, just not a thing for today.
2024-01-04 13:52:21 +10:00
dhi_holo 2ea07899ea -Added Sticky Barb
No Obtain Method
2024-01-04 13:01:30 +10:00
dhi_holo d0ce03cd5e -Added Shed Shell
No Obtain Method
2024-01-04 13:00:02 +10:00
dhi_holo 8ae0c409a3 -Added Light Ball
No Obtain Method
2024-01-04 12:58:15 +10:00
dhi_holo 2782cb5f34 -Added Lagging Tail
No Obtain Method
2024-01-04 12:56:09 +10:00
dhi_holo 2f10707211 -Added Grip Claw
No Obtain Method
2024-01-04 12:54:48 +10:00
dhi_holo f40a9d762a -Added Float Stone
No Obtain Method
2024-01-04 12:53:17 +10:00
dhi_holo 17587f97e5 -Added Absorb Bulb
No Obtain Method
2024-01-04 12:51:46 +10:00
dhi_holo 5230820657 -Added Punching Glove 2024-01-04 12:49:01 +10:00
dhi_holo 61c55e136f -Added Throat Spray
need to figure out how to add the potion brewing later, not a huge priority at this stage
2024-01-04 12:45:59 +10:00
dhi_holo 22cced74f5 -Added Luminous Moss 2024-01-04 12:43:40 +10:00
dhi_holo 3cd2dec8e0 -Added Loaded Dice 2024-01-04 12:40:34 +10:00
dhi_holo cea930893a -Added Iron Ball 2024-01-04 10:26:54 +10:00
dhi_holo 8662364ca8 -Added Wide Lens and Zoom Lens 2024-01-04 10:24:00 +10:00
dhi_holo 1fd079b1b4 -Added Weather Rocks
Damp Rock, Heat Rock, Smooth Rock, Icy Rock, terrible items
2024-01-04 10:19:53 +10:00
dhi_holo 244876a26c -Added Weakness Policy 2024-01-04 10:11:52 +10:00
dhi_holo e7790f530f -Added Utility Umbrella 2024-01-04 10:08:56 +10:00
dhi_holo 04a9ab0e67 -Adds Terrain Extender
If someone wants to work out how to make it so we can have a recipe that costs a water bucket, rather than water from a bucket, that'd be good, for now the recipe just costs an empty bucket
2024-01-04 10:06:39 +10:00
dhi_holo 3f338d27c3 -Added Scope Lens 2024-01-04 09:55:46 +10:00
dhi_holo 5da3dfb451 -Added Room Service 2024-01-04 09:54:00 +10:00
dhi_holo fd329e00cd -Added Ring Target 2024-01-04 09:52:00 +10:00
dhi_holo 6da47a8b2c -Added Red Card
Not gonna test this one for now, don't feel like setting up a second instance test. But, given Eject Button works, I'd say decent shot this one also works
2024-01-04 09:49:02 +10:00
dhi_holo 860c73fac9 -Added Protective Pads 2024-01-04 09:45:50 +10:00
dhi_holo e26fdd4bdd -Added Metronome
Deciding I'll ignore all held items with a * next to the name for now, not sure what they mean but hey, makes it easier to work through, and I can come back to them afterwards
2024-01-04 09:42:31 +10:00
dhi_holo 8e642f71b8 Merge branch 'main' into MoreHoldItems 2024-01-04 09:32:19 +10:00
dhi_holo f17884b4e1 Eject Button Lang, Read Description
All of the items added just now by me were tested besides Eviolite (don't feel like crunching those numbers today), Eject Pack is broken in my testing (see https://canary.discord.com/channels/725110639554592879/993671151870017656/1192009424282320957 for details), and ofc no item sprites yet, but that's dev life
2024-01-03 17:53:57 +10:00
dhi_holo c40b456948 -Added Eviolite and Expert Belt
test and finalise this little bit time (also corrected some jsons)
2024-01-03 17:19:31 +10:00
dhi_holo 7e74e85315 -Added Eject Button and Pack
I'm not testing these in game rn, I'll do that at the end of the session, which will probably be in a couple more items. But, these all hit the internet at the same time, so haha
2024-01-03 17:09:13 +10:00
dhi_holo 21fd4d7cbf -Added Covert Cloak 2024-01-03 17:00:58 +10:00
dhi_holo 908bff9892 -Added Cell Battery and Clear Amulet 2024-01-03 16:57:32 +10:00
dhi_holo fa14f70bbb -Added Shell Bell
Bell Go Heal
2024-01-03 15:59:01 +10:00
Lily 188ae2ac85 changes to the gimmighoul evolution system. added relic coins, updated bars, removed NetheriteMaterials and GoldMaterials 2024-01-02 14:09:52 -05:00
dhi_holo 346559f292 Tags on top of Tags
Added a very large amount of tags.
The different tiers of Poké balls, also the Apricorn balls so it's easier for people to see what balls count for that advancement, different healing and battle item types, some evolution item sets which made sense to make tags (may add more later, these ones were just the obvious ones to make thing easier for future), the three colours for tumblestones, machine blocks, as well as adding the fence gate item tag, and adding the new tumblestone stuff to the pickaxe tag (although they can still be mined with an axe, probably something that needs fixing)

Mod loader tags were not tested on Forge, due to a crash involving CobblemonEntities, but Fabric works all nicely
2024-01-02 14:44:01 +10:00
dhi_holo 331b282fcf Decorated sherds tag, and fixed Focus Sash not being named
`focus_Sash` isn't valid, sadly
2024-01-02 12:41:28 +10:00
dhi_holo 7f97eeafed Update is_held_item.json
Reorganized alphabetically, for the most part, roughly matches the registry now.
2024-01-02 11:45:38 +10:00
dhi_holo 51f5a1f5a8 Merge branch 'main' into MoreHoldItems 2024-01-02 11:35:53 +10:00
dhi_holo 7c0535b8bd Merge branch 'main' into MoreHoldItems 2024-01-01 21:08:33 +10:00
dhi_holo 4f15ac0cbc Update CobblemonItems.kt
No More "why are the held items not in alphabetical order" for the time being (besides the three Powders and four Herbs, I left them together at the bottom because nobody cares about them)
2024-01-01 18:37:53 +10:00
JazzMcNade 35a0d8a80d -Added Blunder Policy 2024-01-01 01:31:08 -06:00
JazzMcNade c0270d3ef0 -Added Binding Band 2023-12-31 23:58:24 -06:00
JazzMcNade 82a1eb2a55 -Finished Air Balloon implementation. Fixed white space on recipes for for focus sash and Ability Shield 2023-12-31 21:44:26 -06:00
JazzMcNade a528ea952a -Added Ability Shield and Focus Sash. Begin work on Air Balloon. 2023-12-31 21:20:10 -06:00
Tyzillion af2df51a2a Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon
# Conflicts:
#	CHANGELOG.md
2023-12-30 18:25:27 -05:00
Lily 95a0f9603c gilded chest model stuffs 2023-12-27 14:54:28 -05:00
Paul 90e39874e0 Imports mainly 2023-12-27 11:12:58 +10:00
Paul 2d5796de71 Merge remote-tracking branch 'origin/improved-transformed-parts' into move-animations
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonEntity.kt
2023-12-26 13:32:48 +10:00
Paul 3b152eafac Conflict resolution artifact 2023-12-26 12:12:53 +10:00
Paul 06ed354ebe Merge branch 'improved-transformed-parts' into move-animations
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/api/molang/MoLangFunctions.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/entity/EmptyPokeBallClientDelegate.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/entity/PokemonClientDelegate.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/PoseableEntityState.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonEntity.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonServerDelegate.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/util/MoLangExtensions.kt
2023-12-26 12:09:23 +10:00
Paul caad276cbf Moved NPC's to use modern MC AI 2023-12-25 20:16:41 +10:00
Tyzillion d38aa6b1a2 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-12-24 22:45:50 -05:00
Paul 093ad6329d Merge remote-tracking branch 'origin/main' into npcs 2023-12-25 11:38:58 +10:00
Tyzillion 4566e1b33f Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon
# Conflicts:
#	CHANGELOG.md
2023-12-24 07:07:56 -05:00
Paul 94d216fd7a Corrections from merging in scheduling changes 2023-12-24 21:34:52 +10:00
Paul 04c63145e1 Merge branch 'improved-transformed-parts' into npcs
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonEntities.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/battles/model/PokemonBattle.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/scheduling/SchedulingFunctions.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/battles/ShowdownInterpreter.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/CobblemonClient.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/bedrock/animation/BedrockAnimation.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/bedrock/animation/BedrockStatefulAnimation.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/bedrock/animation/BedrockStatelessAnimation.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/pokemon/PokemonRenderer.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/command/TestCommand.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonEntity.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonServerDelegate.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/pokemon/Pokemon.kt
#	fabric/src/main/kotlin/com/cobblemon/mod/fabric/client/CobblemonFabricClient.kt
#	forge/src/main/kotlin/com/cobblemon/mod/forge/client/CobblemonForgeClient.kt
2023-12-24 15:15:52 +10:00
Tyzillion f2d16ca9b7 Implemented Lileep, Cradily, Tirtouga, Carracosta, Arctovish, Dracovish, Arctozolt, Dracozolt, Shieldon, Bastiodon.
Updated models for Kabuto, Kabutops, Piplup, Prinplup, Elekid, Electabuzz, Cubone, Marowak, Paras, Venonat, Venomoth, Yanma, and Yanmega, and Raboot. Resized Snorlax.
2023-12-23 17:47:44 -05:00
Lily d6fbb70db0 add level ranges to DisguisedPokemonBlock 2023-12-11 16:10:13 -05:00
Lily 150a5c668a redid disguised gimmighouls 2023-12-11 14:55:43 -05:00
Lily 1bf01a2826 more bar stuff 2023-11-30 15:16:32 -05:00
Lily 4d1bf677a1 bar color update 2023-11-29 21:49:06 -05:00
Lily 069f56acfd gholdengo/gimmighoul are basically done, gilded chests still unfinished 2023-11-29 20:32:20 -05:00
Lily 19cdc8fbef Merge remote-tracking branch 'origin/gimmighoul_gholdengo' into gimmighoul_gholdengo 2023-11-27 17:31:27 -05:00
Lily 1408b94f06 started on gilded chests 2023-11-27 17:31:17 -05:00
Paul de081dc514 Added aspects support for int range features 2023-11-27 11:53:06 +10:00
Paul 80b8cebb19 Fully integrated smooth animation transitioning into move animations 2023-11-25 17:19:19 +10:00
Paul b339081128 Merge remote-tracking branch 'origin/improved-transformed-parts' into move-animations
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonNetwork.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/scheduling/SchedulingFunctions.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/entity/PokemonClientDelegate.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/PoseableEntityModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/PoseableEntityState.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen1/CharizardModel.kt
2023-11-24 10:09:32 +10:00
Lily 1538f12934 more gimmighoul changes 2023-11-14 20:59:10 -05:00
Paul 857f67604c Fixed some logic in held item event + gimmighoul item 2023-11-14 19:30:27 +10:00
Paul ae49e3f977 Fixed gold materials data registry not being loaded 2023-11-14 19:18:45 +10:00
Lily ec01a03820 pushed some stuff idk what to put here 2023-11-14 00:47:15 -05:00
Lily 96cc3671da Merge branch 'held_item_event' into gimmighoul_gholdengo 2023-11-13 18:36:09 -05:00
Lily ad7c9c560c add an event for updating a pokemon's held item 2023-11-13 18:33:45 -05:00
Tyzillion ee15ff6b35 Corrected Gimmighoul chest and roaming size. 2023-11-13 16:49:00 -05:00
Tyzillion ca83103703 Bling, bling, every time I come around your city. 2023-11-13 16:33:07 -05:00
Tyzillion 1aeb894b09 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into gimmighoul_gholdengo 2023-11-13 13:42:38 -05:00
Lily 8e9ab26963 json files for gold and netherite materials (doesnt work in-game yet) 2023-11-13 18:09:34 +00:00
Paul 44b4fbcfe3 Minor license thing 2023-11-13 20:04:29 +10:00
Paul 42cc1dd8a9 Upgraded species features so they can be synced and rendered in summary screen 2023-11-13 19:39:17 +10:00
Lily d69310e52c re-do the way the other stats screen draws stuff 2023-11-10 20:15:40 -05:00
Lily a0f89274d1 started work on SummaryValue properties (CW: messy, incomplete systems) 2023-11-10 18:57:11 -05:00
Paul 506e685117 Added q.animation to poseable models molang runtime 2023-11-03 19:07:32 +10:00
Paul eceac5fa81 Substantially implemented system for action effects 2023-10-30 17:01:42 +10:00
Paul a6b5c0bfab Added support for arbitrary animation starting for poseable entities 2023-10-27 15:12:41 +10:00
Paul b1a0d4d5a7 Groundwork for effect animations 2023-10-26 18:47:32 +10:00
Paul 627d31d0cc Merge branch 'spawn-rules' into move-animations 2023-10-21 13:15:32 +10:00
Paul d9f1e3c15f Merge remote-tracking branch 'origin/main' into move-animations 2023-10-21 11:47:14 +10:00
Paul eca52623e8 Merge remote-tracking branch 'origin/main' into npcs
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/pokemon/Pokemon.kt
2023-10-21 10:54:21 +10:00
Paul 10740ac1c8 Merge remote-tracking branch 'origin/main' into move-animations 2023-10-14 17:11:23 +10:00
Paul b9766486db Merge remote-tracking branch 'origin/main' into npcs 2023-10-13 18:07:42 +10:00
Paul bf6a923e2c Tracked data improvements for NPCs 2023-10-13 08:41:38 +10:00
Paul a073886bc5 Merge remote-tracking branch 'origin/main' into npcs 2023-10-09 17:04:40 +10:00
Paul 7c4749ecd1 Added variables listing to NPC class 2023-10-08 17:54:47 +10:00
Paul 76566669c6 Merge remote-tracking branch 'origin/spawn-rules' into npcs
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/api/pokemon/PokemonProperties.kt
2023-10-08 11:10:16 +10:00
Paul 5b8e673e53 Merge remote-tracking branch 'origin/main' into npcs 2023-10-07 21:29:53 +10:00
Paul f0a62d56a9 Merge remote-tracking branch 'origin/main' into move-animations 2023-10-07 14:56:49 +10:00
Paul 565a28de87 Merge remote-tracking branch 'origin/main' into move-animations 2023-10-02 20:16:34 +10:00
Paul de35a54f84 Fixes from merge from main 2023-09-26 18:02:32 +10:00
Paul 2c164685f4 Merge broken 2023-09-25 13:35:48 +10:00
Paul c3789cd620 Testcommand should spawn trainers not in the ground please thank you (also update trainer animations) 2023-08-27 11:02:03 +10:00
Paul 0905b16a48 Fixed instances of NPC Pokémon not being recalled or disappeared when the NPC dies 2023-08-27 11:01:14 +10:00
Paul 7881b14c4d Fixed NPC Pokémon persisting across restarts as if they were wild 2023-08-27 10:50:17 +10:00
Paul 49c8df2cef Polished timing of NPC sendout/recall animations, added win/loss NPC animations 2023-08-26 19:21:49 +10:00
Paul 165b51fde6 Many NPC battle improvements, including sendout/recall animations and scheduling, animation fixes 2023-08-25 22:07:09 +10:00
Paul b020f642f3 Merge branch 'main' into npcs 2023-08-22 19:56:15 +10:00
Paul 88e0bf57c8 Outlined NPC battle logic 2023-08-21 15:57:41 +10:00
Paul 2adb96c6bc Merge remote-tracking branch 'origin/main' into npcs 2023-08-20 19:30:24 +10:00
Paul 4094dfa6de Much more foundation for NPCs configuration 2023-08-19 12:53:25 +10:00
Paul 135ec86291 Basic AI for NPCs, implemented limb swing properties in molang to improve idle/walk for NPCs, fixes 2023-08-16 07:19:45 +10:00
Paul 910a8361ec Licenses 2023-08-13 21:51:15 +10:00
Paul 125f7d679f Much more NPC framework, rendering works, NPC class data registry configured 2023-08-13 21:50:45 +10:00
Paul 04abd73f35 Merge remote-tracking branch 'origin/main' into npcs
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/client/CobblemonClient.kt
2023-08-13 20:40:34 +10:00
Yaseen 65aec87382 mute battle 2023-05-20 16:54:49 +01:00
Yaseen 21198eab29 more forfeit stuff 2023-05-20 16:54:14 +01:00
Paul f3ba33f7ba More outlining for action effects 2023-05-02 19:54:18 +10:00
Yaseen c4c060cbbf Dont wait for action if one of the players has forfeited 2023-04-28 15:36:45 +01:00
Yaseen 6cf7c681d4 Merge branch 'main' into ys/forfeit 2023-04-28 00:28:30 +01:00
Yaseen c420fd4705 Attempt to add forfeit button and showdown action 2023-04-28 00:26:52 +01:00
Yaseen 1278654e9f merge main 2023-04-28 00:26:09 +01:00
Paul ed4dff66b6 Tentative move particle work 2023-04-27 22:45:58 +10:00
Paul 0f16290c34 Merge remote-tracking branch 'origin/1.19.3' into npcs 2023-04-24 21:16:23 +10:00
Paul 9725c46b30 Initial work on NPCs 2023-04-03 21:14:29 +10:00
5942 changed files with 387408 additions and 35721 deletions
+3
View File
@@ -21,6 +21,8 @@ build
# other
eclipse
run
runClient
runServer
# Files from Forge MDK
forge*changelog.txt
@@ -34,6 +36,7 @@ common/src/main/resources/assets/cobblemon/showdown
*/generated/resources/*
/fabric/src/generated/resources/cobblemon-common.accesswidener
/.ignored/
common/.fabric
# MacOS
.DS_Store
+338 -45
View File
@@ -1,78 +1,366 @@
# Changelog
## [1.5.0](#1-5-0)
## [1.6.0 - The Bass Pro Fishing Update (Month Xth, 2024)](#1-6-0)
#### "Now that there's a fishing mechanic, the mod is actually good!"
### Additions
- Added over (number here) ruin structures, where you can find Pokémon-themed Armor Trims and Pottery Sherds, Tumblestones, and more.
- Added (number here) fossil structures, where you can brush Suspicious Sand/Gravel for Fossils.
- Added the Data Monitor, Fossil Compartment, and Restoration Tank. Placed in the correct formation, you can use these to create a Restoration Machine where you can bring fossils back to life.
- Added 3 variants of Tumblestones, which can be planted near Lava or Magma to grow harvestable Tumblestone Clusters.
- Added Pokémon (and item) fishing using modified fishing rods - Poké Rods! You'll need a Poké Rod smithing template, a fishing rod, and some type of Poké Ball. Each Poké Ball makes a differently themed rod. Why not?
- Added Lure Ball functionality, increasing the catch rate of Pokémon that were caught on a fishing rod.
- Added property chaining support for duplicate CustomPokemonPropertyType elements.
- Added aspect and unaspect PokemonProperty arguments (which also includes commands such as /pokemonedit, /spawnpokemon, and /givepokemon) to allow forcing or un-forcing an aspect on a Pokémon.
### Developer
- SpawnCause is now an implementation of SpawningInfluence.
- Added "forcedAspects" to Pokemon to make it easier to easily add basic aspects to a Pokémon in a way that persists. We already know that everyone is going to overuse this.
- Made the Pokemon.aspects setter private. This could technically break sidemods but if you are affected by this then you were using it wrong! Use Pokemon.forcedAspects to fix it.
## [1.5.1](#1-5-1)
### Additions
- Added unique send out particles for Cherish, Dream, Beast, and Ancient Origin balls.
### Changes
- Sounds for Relic Coin Sacks have been correctly renamed. Relic Coin Pouches received new sounds for breaking and placing.
### Fixes
- Fixed a bug in which adding organic material to the fossil tank via right click was adding the full count of the stack currently in hand
- Fixed a niche issue where some properties of entities were not initialized correctly, causing Pokémon that appeared to be level 1 until you battle them.
- Fixed Fossilized Drake being missing from the Fossils item tag.
- Fixed PCStore#resize not allowing PC boxes size reduction.
### Developer
- Changed SpawnAction#complete to return a nullable generic R (the spawn action result) instead of a boolean. More information this way.
### Data Pack & Resource Pack Creators
- Added support for MoLang conditions for quirks and poses.
- Changed the AttackDefenceRatio requirement to StatCompare and StatEqual.
## [1.5.0 - The Ruins and Revival Update (May 12th, 2024)](#1-5-0)
#### "You're telling me that Mojang has added archaeology to the game? Hmm... that gives me an idea."
### Additions
- Added 17 ruin structures, where you can find Pokémon-themed Armor Trims and Pottery Sherds, Tumblestones, and more.
- Added 23 fossil structures, where you can brush Suspicious Sand/Gravel for [Fossils](https://wiki.cobblemon.com/index.php/Fossil). You can add [custom fossils using datapacks](https://wiki.cobblemon.com/index.php/Fossils_File).
- Added the Data Monitor, Fossil Compartment, and Restoration Tank blocks. Placed in the correct formation, you can use these to create a [Restoration Machine](https://wiki.cobblemon.com/index.php/Resurrection_Machine) where you can bring fossils back to life. Use organic material to fill the tank first!
- Added 3 variants of [Tumblestone](https://wiki.cobblemon.com/index.php/Tumblestone), which can be planted near Lava or Magma to grow harvestable Tumblestone Clusters.
- Added Tumblestone Blocks, a storage block crafted from 9 Tumblestones.
- Added Ancient Poké Balls, which are aesthetic variants crafted from Tumblestones.
- Added the Ancient Feather, Wing, and Jet Balls, which fly further than regular Poké Balls.
- Added the Ancient Heavy, Leaden, and Gigaton Balls, which are heavier and don't fly as far as regular Poké Balls. These will receive more functionality in a future update.
- Added Original Trainer functionality. To edit the OT through commands, you must specify originaltrainertype=<Player/NPC>, and originaltrainer=<Username or UUID/NPC Name>
- Added visual effects for many Poké Balls when sending out or capturing Pokémon.
- Added a new send-out ball toss animation that showcases the ball used for the Pokémon.
- Added simple move animations for Pokémon in battle with a proof of concept (Flamethrower) for more complicated animations. More and more specific animations will come in future updates.
- Added Original Trainer to the summary menu. To edit the OT through commands, you must specify originaltrainertype=<Player/NPC>, and originaltrainer=<Username or UUID/NPC Name>
- Added support for planting Apricorn trees, berries, and mints in [Botany Pots](https://modrinth.com/mod/botany-pots)
- Added the hidden "True Vivillionaire" advancement.
- The "Poké Ball" Vivillon variant is now obtainable by evolving a Spewpa after obtaining the "Aspiring Vivillionaire" advancement.
- Added dynamic lighting support for any Species or Forms when using [LambDynamicLights](https://modrinth.com/mod/lambdynamiclights) or [Dynamic Lights Reforged](https://www.curseforge.com/minecraft/mc-mods/dynamiclights-reforged), at this time we don't ship with any defaults for this feature but addon creators can make use of this feature.
- Added 6 Pokémon-themed Pottery Sherds, obtained from ruin structures.
- Added the [Display Case](https://wiki.cobblemon.com/index.php/Display_Case) block. Use it to display your archaeological findings, Poké Balls, or other items.
- Added 6 Pokémon-themed Pottery Sherds, obtained from ruin structures. Sherds... sh-erds. Weird word.
- Added a Pokémon-themed armor trim, obtained from ruin structures.
- You can now find Nether Fire Stone Ore in, surprisingly, the Nether.
- Added effects for many Poké Balls when sending out Pokémon or capturing.
- Added a new send-out ball toss animation that showcases the ball used for the Pokémon.
- Added simple move animations for Pokémon in battle with a proof of concept for more complicated animations.
- Added Nether Fire Stone Ore to, surprisingly, the Nether.
- Added Terracotta Sun Stone Ore to Badlands biomes.
- Added the EV Boosting Feathers.
- Added Type Gems.
- Added various new tags for searchability and better compatibility.
- Added Gilded Chests, available in all Apricorn colors.
- Added Relic Coins, Relic Coin Pouches, and Relic Coin Sacks.
- Added Gimmighoul.
- Added [Gilded Chests](https://wiki.cobblemon.com/index.php/Gilded_Chest), available in all Apricorn colors.
- Added Relic Coins, Relic Coin Pouches, and Relic Coin Sacks. Gimmighoul might be interested in these.
- Added Type Gems. These will have additional uses later, so you should start collecting them.
- Added new held items: Ability Shield, Absorb Bulb, Air Balloon, Binding Band, Blunder Policy, Cell Battery, Covert Cloak, Damp Rock, Eject Button, Eviolite, Expert Belt, Float Stone, Focus Sash, Heat Rock, Icy Rock, Iron Ball, Light Ball, Loaded Dice, Red Card, Shell Bell, Sticky Barb, Smooth Rock, Soothe Bell and Weakness Policy.
- Added Hisui starters to the starter selection menu. They come inside of ancient Poké Balls.
- Added a bubble quirk to Krabby that only plays during clear sunsets. It looks familiar...
- Added forfeit option to PVP battles.
- Added visual changes for entities affected by Illusion, Imposter, or Transform in battle.
- Added shoulder mounting for Squirtle, Ralts, Roggenrola, Charcadet, Sizzlipede, Litwick, Cutiefly, Flabebe, Flittle, and Scatterbug
- Added species data for Hydrapple, Iron Boulder, Iron Crown, Pecharunt, Raging Bolt, and Terapagos
- Added various new tags for search-ability and better mod compatibility.
- Added the [Ability Capsule](https://bulbapedia.bulbagarden.net/wiki/Ability_Capsule) and [Patch](https://bulbapedia.bulbagarden.net/wiki/Ability_Patch). These have no way of getting them (for now) and only work as intended with the traditional ability format of 1 to 2 common abilities and 1 hidden ability.
### Pokémon Added
#### Gen 2
- Sentret
- Furret
- Qwilfish
- Heracross
- Skarmory
- Larvitar
- Pupitar
- Tyranitar
#### Gen 3
- Lileep
- Cradily
- Anorith
- Armaldo
- Tropius
- Roselia
- Aron
- Lairon
- Aggron
- Solrock
- Lunatone
- Makuhita
- Hariyama
- Trapinch
- Vibrava
- Flygon
#### Gen 4
- Shieldon
- Bastiodon
- Cranidos
- Rampardos
- Budew
- Roserade
- Hippopotas
- Hippowdon
#### Gen 5
- Tirtouga
- Carracosta
- Archen
- Archeops
- Zorua
- Zoroark
- Petilil
- Lilligant
- Darumaka
- Darmanitan
- Woobat
- Swoobat
- Sandile
- Krokorok
- Krookodile
- Frillish
- Jellicent
- Cubchoo
- Beartic
- Deino
- Zweilous
- Hydreigon
- Larvesta
- Volcarona
- Alomomola
- Ferroseed
- Ferrothorn
#### Gen 6
- Tyrunt
- Tyrantrum
- Amaura
- Aurorus
- Goomy
- Sliggoo
- Goodra
- Carbink
- Flabébé
- Floette
- Florges
- Klefki
#### Gen 7
- Turtonator
- Fomantis
- Lurantis
- Salandit
- Salazzle
- Jangmo-o
- Hakamo-o
- Kommo-o
- Alolan Diglett
- Alolan Dugtrio
#### Gen 8
- Gossifleur
- Eldegoss
- Arctozolt
- Arctovish
- Dracozolt
- Dracovish
- Basculegion
- Hisuian Decidueye
- Hisuian Typhlosion
- Hisuian Samurott
- Hisuian Lilligant
- Hisuian Sliggoo
- Hisuian Goodra
- Hisuian Zorua
- Hisuian Zoroark
- Hisuian Voltorb
- Hisuian Electrode
- Hisuian Qwilfish
- Overqwil
- Hisuian Sneasel
- Sneasler
- Stonjourner
- Cufant
- Copperajah
- Dreepy
- Drakloak
- Dragapult
- Impidimp
- Morgrem
- Grimmsnarl
#### Gen 9
- Gimmighoul
- Using Relic Coins, you can increase Gimmighoul's Coin Stash. Upon reaching 999, it can be evolved into Gholdengo.
- Additionally, if you give Gimmighoul a Netherite Scrap, you can increase its Netherite Stash. Who knows what might happen if it fills up?
- Additionally, if you give Gimmighoul a Netherite Scrap, you can increase its Netherite Stash. But what will that do to when you evolve it?
- Gholdengo
#### Cobblemon Exclusives
- Hisui Bias Rowlet
- Hisui Bias Dartrix
- Hisui Bias Cyndaquil
- Hisui Bias Quilava
- Hisui Bias Oshawott
- Hisui Bias Dewott
- Hisui Bias Goomy
- Hisui Bias Petilil
These are our compromise for having both regular and Hisuian forms of these Pokémon in the game. Hisui Biased variations will evolve into the Hisuian evolutions under most conditions. They are otherwise purely cosmetic differences.
### Added cries to the following Pokémon
- Alolan Raticate
- Vulpix, Ninetales
- Zubat, Golbat, Crobat
- Meowth, Persian
- Psyduck, Golduck
- Growlithe, Arcanine
- Geodude, Graveler, Golem
- Doduo, Dodrio
- Seel, Dewgong
- Muk, Grimer
- Krabby, Kingler
- Voltorb, Electrode, Hisuian Voltorb, Hisuian Electrode
- Tangela, Tangrowth
- Snorlax
- Cubone, Marowak
- Koffing, Weezing
- Aerodactyl
- Elekid, Electabuzz, Electivire
- Omanyte, Omastar
- Kabuto, Kabutops
- Lapras
- Scyther
- Hisui Bias Cyndaquil, Hisui Bias Quilava
- Igglybuff
- Yanma, Yanmega
- Gligar, Gliscor
- Qwilfish, Hisuian Qwilfish, Overqwil
- Sneasel, Hisuian Sneasel, Weavile, Sneasler
- Larvitar, Pupitar, Tyranitar
- Swinub, Piloswine, Mamoswine
- Aron, Lairon, Aggron
- Trapinch, Vibrava, Flygon
- Cacnea, Cacturne
- Barboach, Whiscash
- Lileep, Cradily
- Anorith, Armaldo
- Tropius
- Chimecho
- Bidoof, Bibarel
- Buizel, Floatzel
- Gible, Gabite, Garchomp
- Hisui Bias Oshawott, Hisui Bias Dewott
- Petilil, Lilligant, Hisui Bias Petilil, Hisuian Lilligant
- Basculin, Basculegion
- Sandile, Krokolok, Krookodile
- Darumaka, Darmanitan
- Archen, Archeops
- Zorua, Zoroark, Hisuian Zorua, Hisuian Zoroark
- Tyrunt, Tyrantrum
- Amaura Aurorus
- Carbink
- Goomy, Sliggoo, Goodra, Hisui Bias Goomy, Hisuian Sliggoo, Hisuian Goodra
- Klefki
- Hisui Bias Rowlet, Hisui Bias Dartrix
- Komala
- Impidimp, Morgrem, Grimmsnarl
- Cufant, Copperajah
- Dreepy, Drakloak, Dragapult
- Dracozolt, Arctozolt, Dracovish, Arctovish
- Lechonk, Oinkologne
- Maushold family of three and four
### Changes
- Alolan Pikachu and Exeggcute changed to Alola Bias.
- Pokémon now transition more smoothly between different poses.
- Updated models for Mimikyu, Alcremie, Squirtle, Wartortle, Blastoise, Pidgey, Pidgeotto, Pidgeot, Omanyte, Omastar, Growlithe, Arcanine, Nidoran Male, Nidoran Female, Lapras, Swinub, Piloswine, Basculin, Rowlet, Dartrix, Decidueye, Kabuto, Kabutops, Piplup, Prinplup, Elekid, Electabuzz, Cubone, Marowak, Paras, Mawile, Drifloon, Drifblim, Venonat, Venomoth, Yanma, Yanmega, Psyduck, Dusknoir, Diglett, Dugtrio, Natu, Xatu, Oshawott, Samurott, Torchic, Grovyle, Sceptile, Sizzlipede, Mismagius, and Raboot.
- Updated animations for Squirtle, Wartortle, Blastoise, Pidgey, Pidgeotto, Diglett, Dugtrio, Magikarp, Dragonite, Omanyte, Omastar, Kabuto, Pinsir, Chinchou, Lanturn, Ralts, Kirlia, Gardevoir, Gallade, Buizel, Garchomp, Pumpkaboo, Falinks, Lechonk, Litwick, Lampent, Chandelure, Carnivine, Galarian Meowth, Galarian Rapidash, Venonat, Venomoth, Phanphy, Donphan, Dratini, Dragonair, Happiny, Chansey, Blissey, Volbeat, Illumise, Numel, Sizzlipede, Centiskorch, Obstagoon, Timburr, Gurdurr, Conkeldurr, Drifloon, and Drifblim.
- Resized Drifloon.
- Added more held items to the held item tag, and Metal Coat to the held item tab.
- Added all ores to the modloader ore tags, and added tags for each ore type to the mod (both blocks and items).
- Changed the Destiny Knot to be crafted with a Ghast Tear, rather than a diamond.
- You can now punch grown apricorns to harvest them.
- Changed the Destiny Knot to be crafted with a Ghast Tear rather than a diamond. We have big plans for the Destiny Knot...
- You can now punch grown apricorns to harvest them. We saw so many content creators breaking apricorns with their fists that it was making us die inside.
- The "Poké Ball" Vivillon variant is now obtainable by evolving a Spewpa after obtaining the "Aspiring Vivillionaire" advancement.
- Renamed the "Vivillionaire" advancement to "Aspiring Vivillionaire"
- Removed the Inferno, Forsaken, Poké Ball, and Void patterns from the Aspiring Vivillionaire advancement.
- Updated movesets to add Gen 9 DLC moves.
- Updated the biome tags for Spewpa's evolutions into the various Vivillon patterns. You should mostly be getting one evolution option at a time now.
- Apricorn Sprouts can now be planted directly on Apricorn leaves to create a new Apricorn of the same color.
- Added tooltips to interaction GUIs to make it clearer what they do.
- Poké Ball recipes now use tags for their center ingredient, rather than specificied Copper Ingot, Iron Ingot, Gold Ingot, and Diamond, allowing for further datapack customisation.
- Poké Ball recipes now use tags for their center ingredient, rather than specifically Copper Ingots, Iron Ingots, Gold Ingots, and Diamonds, allowing for further datapack customisation and mod compatibility.
- Starter Toast now closes once the corresponding button is pressed once.
- Moved some items into the vanilla Food & Drinks category.
- Stacked Cobblemon Potion Bases can now be quick moved into Brewing Stands.
- Changed the Healing Machine recipe to swap the Max Revive for a Revive so that it is a bit easier to craft.
- Upped the rate that Gastly drop Ghast Tears from 2.5% to 5%, further helping the crafting of a Healing Machine.
- Pokémon with a low Blaze Powder drop chance now drop it more frequently in the Nether.
- Reorganised a few advancements.
- Pokémon entity shadows now scale when the Pokémon is being sent out or recalled.
- Remade Torkoal particles, now they only appear when in battle.
- Improved the shiny icon within summary and PC interfaces.
- Changed the Poison Barb sprite so that it doesn't look like a sword when held. It's a Poison Barb, not a Poison Sword. Wait, that gives me an idea.
- Moon Stone ore generates more frequently in Taigas and has been added to Magical and Spooky biomes. Ooo... Sorry.
- Density, Season, and Nether biome tags have been moved and renamed within the biome tags directory.
- Added particles to Lucario when in battle. Lucario is special.
- Movesets updated for Blueberry DLC.
### Fixes
- Re-added the recipe for the Iron Vitamin.
- Cleaned up empty evolutions declaration in species files (no, I'm not listing all 169 by name).
- Fixed Exeggcute not being able to evolve.
- Fixed battle lang for Poison Touch Ability
- Fixed Cubone not being able to evolve into Alolan Marowak.
- Re-added the recipe for the Iron vitamin. Well, technically it's a mineral.
- Fixed Exeggcute and Pikachu not being able to evolve.
- Fixed evolution priority for Exeggcute and Pikachu regional evolutions. Using a thunder stone on Kantonian Pikachu on the beach will give Alolan Raichu. A second thunder stone would then give Kantonian Raichu.
- Fixed battle text for the Poison Touch Ability.
- Finally found Sudowoodo and Bonsly. They were missing spawn data. Same with Drifloon and Litwick. Uh... sorry about that.
- Fixed Squawkabilly forms not being recognized.
- Fixed the bounce animation for Poké Balls being delayed by like, a full second.
- Note blocks now play the correct sound on the Apricorn Plank based blocks.
- Fixed the bounce animation for Poké Balls being delayed by like, a full second. It's enough to drive you mad.
- Note blocks now play the correct sound on the Apricorn Plank-based blocks.
- Fixed an issue with transformed parts in posers causing whacky positional issues.
- Fixed Poké Balls freezing in an open state if you look away when it's meant to close.
- Adds a translation string name to the Empty Pokeball entity.
- Fixed very many issues with Bedrock particle effects.
- Fixed Arbok patterns not being as specific in spawning as they were intended.
- Fixed Poké Balls freezing in an open state if you're looking away at the moment that it's meant to close. This actually fixes some other things but it's hard to explain.
- Fixed thrown Poké Balls technically having no name.
- Fixed very many issues with Bedrock particle effects. There are probably many more. Life goes on.
- Fixed Arbok patterns not being as specific in spawning as they were intended to be.
- Fixed Pokémon not avoiding danger at all when pathfinding.
- Fixed Sobble line not being able to swim or breathe underwater.
- Fixed incompatibility with [Just Enough Resources](https://modrinth.com/mod/just-enough-resources-jer).
- Fixed incompatibility with [Visual Overhaul](https://modrinth.com/mod/visual-overhaul).
- Fixed an issue that allowed Pokemon to spawn on rails.
- Fixed Pokémon pathing over snow layers and carpets.
- Fixed the Sobble line not being able to swim or breathe underwater.
- Fixed mod incompatibility with [Just Enough Resources](https://modrinth.com/mod/just-enough-resources-jer).
- Fixed mod incompatibility with [Visual Overhaul](https://modrinth.com/mod/visual-overhaul).
- Fixed an issue that allowed Pokémon to spawn on rails.
- Fixed the data set on Pokémon when abilities are given via properties such as in ``/spawnpokemon``.
- Fixed Pokémon sometimes losing hidden abilities when evolving. This fix will only take effect for newly created Pokémon because of technical reasons that were explained to me but which I then forgot.
- Fixed capture messages not displaying in battle.
- Fixed the Illusion ability causing the wrong Pokémon to be targeted in battle.
- Fixed battles started with fainted party members causing a soft-lock on defeat.
- Fixed some issues with eyes in the faint animations of Hitmonlee and Phantump
- Fixed missing evolution moves, for example Stone Axe for Kleavor.
- Cleaned up empty evolutions declaration in species data (And no, I'm not listing all 169. No I don't care what you pay me, I'm not doing it).
- Fixed non-consumable held items being consumed or swapped in battle permanently.
### Developer
- Significantly changed the way properties in PokemonEntity work. This could break some plugins (not in a big way, but changes will be needed).
- Rebuilt the scheduling API to more clearly force side choices and temporal frames of reference for tasks.
- Added dialogue API and data registry.
- Significantly changed the way the properties in PokemonEntity work. This could break some plugins (not in a big way, but changes will be needed for some things).
- Rebuilt the scheduling API to more clearly force side choices and temporal frames of reference for tasks. The developers say that how it works is cool but I stopped listening.
- Added dialogue API and data registry. This is powerful, and there is a full example in the Cobblemon mod you can trigger using /opendialogue \<username\> cobblemon:example. The example JSON is inside the data folder of the mod.
- Opened up the ItemDropEntry class to allow for it to be extended.
- Added a new "advancement" evolution variant that takes an advancement identifier and succeeds if the player has the advancement.
- Made spawning API capable of non-entity spawning
- Made PokemonProperties.parse more interoperable with Java.
- Made the spawning API capable of non-entity spawning. You can make it 'spawn' commands if you want. Go nuts.
- Made PokemonProperties.parse more interoperable with Java. Save yourself and stop using Java.
- Added the ``HeldItemEvent``, this comes with 2 implementation ``HeldItemEvent.Pre`` and ``HeldItemEvent.Post``.
- API to support dynamic lighting in any mod that implements this feature has been added to all Species & Forms, see LightingData class for details.
- Added a Mixin for the BrewingStandScreenHandler to fix the incorrect handling of quickMove in Fabric.
- Corrections to the ability implementation have been made that make ``Ability.forced`` function as intended and never reroll an ability for a Pokémon, please check your implementations to ensure the corrected behavior is intended for your use case.
- ``Pokemon.ability`` no longer has a public setter. Please migrate to using ``Pokemon#updateAbility``, this handles the ability coordinate storage for you when necessary.
- ``Ability.forced``, ``Ability.index`` and ``Ability.priority`` have all had their setters internalized, there is no longer any need to manually adjust these migrate to the method mentioned above to handle that process for you.
- ``AbilityChanger`` has been added to API alongside some implementations, this is subject to change as the ability capsule and patch currently only expect the traditional behaviour in the Pokémon games of 1 or 2 regular abilities and 1 hidden ability.
- ``Pokemon#rollAbility`` has been added which rerolls for a legal ability for the Pokémon.
- `docs/cobblemon-tags` tags and spawn-presets can now be auto-generated from the current tags in the Cobblemon mod with the `generateSpawnPresetList.py` and `generateTagList.py` scripts.
- `public_spawns_to_json.py` script has been added to give the powerful spawn.json generator a simplistic UI.
- Updated Showdown with Gen 9 DLC.
- Changed mixins to be Java 17 for compatibility level instead of 16, removing a warning from startup logs.
### Datapack & Resourcepack Creators
- The maximum amount of fossils that can fit in the Fossil Analyzer can be adjusted in the config.
@@ -107,6 +395,8 @@
}
```
- Following up on this change ``light_source`` was removed as a possible shoulder effect due to becoming unnecessary and never having had a default implementation.
- Added the item tag ``cobblemon:ability_changers``, contains the ``cobblemon:ability_capsule`` & ``cobblemon:ability_patch`` by default.
- Added the item tag ``cobblemon:held/is_friendship_booster``, allows items to give the Soothe Bell effect of a boost of 1.5x Friendship gained, contains ``cobblemon:soothe_bell`` by default.
## [1.4.1 (December 23rd, 2023)](#1-4-1)
@@ -240,6 +530,7 @@
Thank you so much to all of our community translators that bring the mod to the rest of the world!
## [1.4.0 - The Friends and Farms Update (October 13th, 2023)](#1-4-0)
#### "No, we don't provide the friends."
### Additions
- Added pasture blocks, used to let your PC Pokémon roam around an area.
- Added nicknaming from the summary menu of a Pokémon (click their name).
@@ -780,6 +1071,7 @@ Thank you so much to all of our community translators that bring the mod to the
- All the translators that contributed are amazing.
## [1.3.0 - The Foundation Update (March 17th, 2023)](#1-3-0)
#### "Now we can start doing the really cool stuff."
### Dependencies
- Upgraded Fabric API dependence to 0.75.1+1.19.2
@@ -929,6 +1221,7 @@ Thank you so much to all of our community translators that bring the mod to the
- Thank you to all of the fantastic volunteer translators for taking the time to help with this!
## [1.2.0 - The Customization Update (January 1st, 2023)](#1-2-0)
#### "There are going to be so many fakemon..."
### Additions
- Added models for Natu and Xatu, Murkrow and Honchkrow, Wailmer and Wailord.
- Added new PC interface and it is beautiful.
-10
View File
@@ -1,10 +0,0 @@
import ca.stellardrift.build.configurate.ConfigFormats
import ca.stellardrift.build.configurate.catalog.PolyglotVersionCatalogExtension
plugins {
id("ca.stellardrift.polyglot-version-catalogs") version "5.0.1"
}
extensions.configure<PolyglotVersionCatalogExtension> {
from(ConfigFormats.YAML, file("../gradle/libs.versions.yml"))
}
@@ -1,32 +0,0 @@
plugins {
id("cobblemon.base-conventions")
id("com.github.johnrengelman.shadow")
}
val bundle: Configuration by configurations.creating {
isCanBeConsumed = false
isCanBeResolved = true
}
tasks {
jar {
archiveBaseName.set("Cobblemon-${project.name}")
archiveClassifier.set("dev-slim")
}
shadowJar {
archiveClassifier.set("dev-shadow")
archiveBaseName.set("Cobblemon-${project.name}")
configurations = listOf(bundle)
mergeServiceFiles()
}
remapJar {
dependsOn(shadowJar)
inputFile.set(shadowJar.flatMap { it.archiveFile })
archiveBaseName.set("Cobblemon-${project.name}")
archiveVersion.set("${rootProject.version}")
}
}
@@ -1,21 +0,0 @@
plugins {
`java-library`
}
tasks {
val collectJars by registering(Copy::class) {
val tasks = subprojects.filter { it.path != ":common" }.map { it.tasks.named("remapJar") }
dependsOn(tasks)
from(tasks)
into(buildDir.resolve("libs"))
}
assemble {
dependsOn(collectJars)
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
+3 -4
View File
@@ -1,13 +1,12 @@
plugins {
base
id("cobblemon.root-conventions")
id ("net.nemerosa.versioning") version "2.8.2"
}
group = "com.cobblemon.mod"
version = "${project.property("mod_version")}+${project.property("mc_version")}"
val isSnapshot = project.property("snapshot")?.equals("true") ?: false
if (isSnapshot) {
version = "$version-SNAPSHOT-${versioning.info.branch}-${versioning.info.build}"
}
val fixedBranchName = versioning.info.branch.substringAfter("/")
version = "$version-${fixedBranchName}-${versioning.info.build}"
}
+55 -21
View File
@@ -1,3 +1,9 @@
import utilities.isSnapshot
import utilities.version
import java.time.OffsetDateTime
import java.time.ZoneOffset
import java.time.format.DateTimeFormatter
/*
*
* * Copyright (C) 2023 Cobblemon Contributors
@@ -11,6 +17,10 @@
plugins {
id("cobblemon.base-conventions")
id("cobblemon.publish-conventions")
id("net.kyori.blossom")
id("org.jetbrains.gradle.plugin.idea-ext")
id("net.nemerosa.versioning") version "2.8.2"
}
architectury {
@@ -24,32 +34,26 @@ repositories {
}
dependencies {
implementation(libs.stdlib)
implementation(libs.reflect)
modImplementation(libs.fabricLoader)
//Flywheel has no common dep so just pick one and don't use any platform specific code in common
// modCompileOnly(libs.flywheelFabric)
implementation(libs.bundles.kotlin)
modImplementation(libs.fabric.loader)
modApi(libs.molang)
compileOnlyApi(libs.jeiApi)
modCompileOnly(libs.adornFabric)
modCompileOnly(libs.lambDynamicLights) { isTransitive = false }
// For Showdown
// Integrations
compileOnlyApi(libs.jei.api)
modCompileOnly(libs.bundles.fabric.integrations.compileOnly) {
isTransitive = false
}
// Flywheel has no common dep so just pick one and don't use any platform specific code in common
// modCompileOnly(libs.flywheelFabric)
// Showdown
modCompileOnly(libs.graal)
//shadowCommon group: 'commons-io', name: 'commons-io', version: '2.6'
// Data Storage
modCompileOnly(libs.bundles.mongo)
// For datastore
modCompileOnly(libs.mongoDriverCore)
modCompileOnly(libs.mongoDriverSync)
testRuntimeOnly(libs.junitEngine)
testImplementation(libs.junitApi)
testImplementation(libs.junitParams)
testImplementation(libs.mockito)
testImplementation(libs.mockk)
testImplementation(libs.classgraph)
// Unit Testing
testImplementation(libs.bundles.unitTesting)
}
tasks.withType<Test> {
@@ -59,3 +63,33 @@ tasks.withType<Test> {
setExceptionFormat("full")
}
}
sourceSets {
main {
blossom {
kotlinSources {
fun generateLicenseHeader() : String {
val builder = StringBuilder()
builder.append("/*\n")
rootProject.file("HEADER").forEachLine {
if(it.isEmpty()) {
builder.append(" *").append("\n")
} else {
builder.append(" * ").append(it).append("\n")
}
}
return builder.append(" */").append("\n").toString()
}
property("license", generateLicenseHeader())
property("modid", "cobblemon")
property("version", project.version())
property("isSnapshot", if(rootProject.isSnapshot()) "true" else "false")
property("gitCommit", versioning.info.commit)
property("branch", versioning.info.branch)
System.getProperty("buildNumber")?.let { property("buildNumber", it) }
}
}
}
}
@@ -0,0 +1,24 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common;
import com.cobblemon.mod.common.entity.npc.NPCEntity;
import net.minecraft.entity.ai.brain.Brain;
import net.minecraft.entity.ai.brain.MemoryModuleType;
import net.minecraft.entity.ai.brain.sensor.Sensor;
import net.minecraft.entity.ai.brain.sensor.SensorType;
import java.util.Collection;
public class GenericsCheatClass {
// For some reason, doing this in the NPCEntity class in Kotlin gives confusing generic errors I could not resolve.
public static Brain.Profile<NPCEntity> createNPCBrain(Collection<MemoryModuleType<?>> memories, Collection<SensorType<? extends Sensor<? super NPCEntity>>> sensors) {
return Brain.createProfile(memories, sensors);
}
}
@@ -0,0 +1,34 @@
/*
* 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.CobblemonBuildDetails;
import net.minecraft.util.crash.CrashReport;
import net.minecraft.util.crash.CrashReportSection;
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(CrashReport.class)
public final class CrashReportMixin {
@Inject(method = "addStackTrace", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/SystemDetails;writeTo(Ljava/lang/StringBuilder;)V"))
public void cobblemon$printCobblemonDetails(StringBuilder builder, CallbackInfo callback) {
CrashReportSection cobblemon = new CrashReportSection("Cobblemon");
cobblemon.add("Version", CobblemonBuildDetails.VERSION);
cobblemon.add("Is Snapshot", CobblemonBuildDetails.SNAPSHOT);
cobblemon.add("Git Commit", CobblemonBuildDetails.INSTANCE.smallCommitHash() + " (" + "https://gitlab.com/cable-mc/cobblemon/-/commit/" + CobblemonBuildDetails.GIT_COMMIT + ")");
cobblemon.add("Branch", CobblemonBuildDetails.BRANCH);
cobblemon.addStackTrace(builder);
builder.append("\n\n");
}
}
@@ -9,18 +9,23 @@
package com.cobblemon.mod.common.mixin;
import com.cobblemon.mod.common.CobblemonItems;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.mob.PiglinEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(PiglinEntity.class)
public class PiglinEntityMixin {
@Redirect(method = "equipToOffHand", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;isOf(Lnet/minecraft/item/Item;)Z"))
public boolean cobblemon$isValidBarteringItem(ItemStack stack, Item item) {
//TODO: Make a tag?
return stack.isOf(item) || stack.isOf(CobblemonItems.RELIC_COIN_POUCH);
public abstract class PiglinEntityMixin {
@Inject(method = "equipToOffHand", at = @At(value = "HEAD"), cancellable = true)
public void cobblemon$isValidBarteringItem(ItemStack stack, CallbackInfo ci) {
PiglinEntity entity = (PiglinEntity)(Object) this;
if (stack.isOf(CobblemonItems.RELIC_COIN_POUCH)) {
entity.equipStack(EquipmentSlot.OFFHAND, stack);
entity.updateDropChances(EquipmentSlot.OFFHAND);
ci.cancel();
}
}
}
@@ -0,0 +1,33 @@
/*
* 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.invoker;
import com.cobblemon.mod.common.integration.adorn.AdornCompatibility;
import java.util.List;
import juuxel.adorn.block.variant.BlockVariantSet;
import juuxel.adorn.block.variant.BlockVariantSets;
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.callback.CallbackInfo;
//This is a yucky hack but better than what we were doing before
@Mixin(BlockVariantSets.class)
public abstract class AdornRegisterInvoker {
@Final
@Shadow(remap = false)
private static List<BlockVariantSet> variantSets;
@Inject(method = "register()V", at = @At("HEAD"), remap = false)
void register(CallbackInfo ci) {
variantSets.add(AdornCompatibility.INSTANCE);
}
}
@@ -0,0 +1,17 @@
{{ license }}
package com.cobblemon.mod.common
object CobblemonBuildDetails {
const val MOD_ID = "{{ modid }}"
const val VERSION = "{{ version }}"
const val SNAPSHOT = {{ isSnapshot }}
const val GIT_COMMIT = "{{ gitCommit | default("Not Specified") }}"
const val BRANCH = "{{ branch | default("Not Specified") }}"
fun smallCommitHash(): String {
return this.GIT_COMMIT.substring(0, 7)
}
}
@@ -8,6 +8,7 @@
package com.cobblemon.mod.common
import com.cobblemon.mod.common.CobblemonBuildDetails.smallCommitHash
import com.cobblemon.mod.common.advancement.CobblemonCriteria
import com.cobblemon.mod.common.advancement.criterion.EvolvePokemonContext
import com.cobblemon.mod.common.api.Priority
@@ -16,16 +17,17 @@ import com.cobblemon.mod.common.api.data.DataProvider
import com.cobblemon.mod.common.api.drop.CommandDropEntry
import com.cobblemon.mod.common.api.drop.DropEntry
import com.cobblemon.mod.common.api.drop.ItemDropEntry
import com.cobblemon.mod.common.api.events.CobblemonEvents
import com.cobblemon.mod.common.api.events.CobblemonEvents.BATTLE_VICTORY
import com.cobblemon.mod.common.api.events.CobblemonEvents.DATA_SYNCHRONIZED
import com.cobblemon.mod.common.api.events.CobblemonEvents.EVOLUTION_COMPLETE
import com.cobblemon.mod.common.api.events.CobblemonEvents.HELD_ITEM_UPDATED
import com.cobblemon.mod.common.api.events.CobblemonEvents.LEVEL_UP_EVENT
import com.cobblemon.mod.common.api.events.CobblemonEvents.POKEMON_CAPTURED
import com.cobblemon.mod.common.api.events.CobblemonEvents.TRADE_COMPLETED
import com.cobblemon.mod.common.api.net.serializers.IdentifierDataSerializer
import com.cobblemon.mod.common.api.net.serializers.PoseTypeDataSerializer
import com.cobblemon.mod.common.api.net.serializers.StringSetDataSerializer
import com.cobblemon.mod.common.api.net.serializers.UUIDSetDataSerializer
import com.cobblemon.mod.common.api.net.serializers.Vec3DataSerializer
import com.cobblemon.mod.common.api.permission.PermissionValidator
import com.cobblemon.mod.common.api.pokeball.catching.calculators.CaptureCalculator
@@ -35,7 +37,10 @@ import com.cobblemon.mod.common.api.pokemon.effect.ShoulderEffectRegistry
import com.cobblemon.mod.common.api.pokemon.experience.ExperienceCalculator
import com.cobblemon.mod.common.api.pokemon.experience.ExperienceGroups
import com.cobblemon.mod.common.api.pokemon.experience.StandardExperienceCalculator
import com.cobblemon.mod.common.api.pokemon.feature.*
import com.cobblemon.mod.common.api.pokemon.feature.ChoiceSpeciesFeatureProvider
import com.cobblemon.mod.common.api.pokemon.feature.FlagSpeciesFeatureProvider
import com.cobblemon.mod.common.api.pokemon.feature.IntSpeciesFeatureProvider
import com.cobblemon.mod.common.api.pokemon.feature.SpeciesFeatures
import com.cobblemon.mod.common.api.pokemon.helditem.HeldItemProvider
import com.cobblemon.mod.common.api.pokemon.stats.EvCalculator
import com.cobblemon.mod.common.api.pokemon.stats.Generation8EvCalculator
@@ -45,8 +50,13 @@ import com.cobblemon.mod.common.api.scheduling.ServerRealTimeTaskTracker
import com.cobblemon.mod.common.api.scheduling.ServerTaskTracker
import com.cobblemon.mod.common.api.spawning.BestSpawner
import com.cobblemon.mod.common.api.spawning.CobblemonSpawningProspector
import com.cobblemon.mod.common.api.spawning.WorldSlice
import com.cobblemon.mod.common.api.spawning.context.AreaContextResolver
import com.cobblemon.mod.common.api.spawning.context.AreaSpawningContext
import com.cobblemon.mod.common.api.spawning.context.calculators.AreaSpawningContextCalculator
import com.cobblemon.mod.common.api.spawning.context.calculators.AreaSpawningInput
import com.cobblemon.mod.common.api.spawning.prospecting.SpawningProspector
import com.cobblemon.mod.common.api.spawning.spawner.Spawner
import com.cobblemon.mod.common.api.starter.StarterHandler
import com.cobblemon.mod.common.api.storage.PokemonStoreManager
import com.cobblemon.mod.common.api.storage.adapter.conversions.ReforgedConversion
@@ -62,6 +72,7 @@ import com.cobblemon.mod.common.api.storage.player.PlayerDataStoreManager
import com.cobblemon.mod.common.api.storage.player.factory.JsonPlayerDataStoreFactory
import com.cobblemon.mod.common.api.storage.player.factory.MongoPlayerDataStoreFactory
import com.cobblemon.mod.common.api.tags.CobblemonEntityTypeTags
import com.cobblemon.mod.common.api.tags.CobblemonItemTags
import com.cobblemon.mod.common.battles.BagItems
import com.cobblemon.mod.common.battles.BattleFormat
import com.cobblemon.mod.common.battles.BattleRegistry
@@ -82,6 +93,7 @@ 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.ServerTickHandler
import com.cobblemon.mod.common.item.PokeBallItem
import com.cobblemon.mod.common.net.messages.client.settings.ServerSettingsPacket
@@ -93,21 +105,16 @@ import com.cobblemon.mod.common.pokemon.aspects.SHINY_ASPECT
import com.cobblemon.mod.common.pokemon.evolution.variants.BlockClickEvolution
import com.cobblemon.mod.common.pokemon.feature.TagSeasonResolver
import com.cobblemon.mod.common.pokemon.helditem.CobblemonHeldItemManager
import com.cobblemon.mod.common.pokemon.misc.GimmighoulStashHandler
import com.cobblemon.mod.common.pokemon.properties.AspectPropertyType
import com.cobblemon.mod.common.pokemon.properties.HiddenAbilityPropertyType
import com.cobblemon.mod.common.pokemon.properties.UnaspectPropertyType
import com.cobblemon.mod.common.pokemon.properties.UncatchableProperty
import com.cobblemon.mod.common.pokemon.properties.tags.PokemonFlagProperty
import com.cobblemon.mod.common.pokemon.stat.CobblemonStatProvider
import com.cobblemon.mod.common.sherds.CobblemonSherds
import com.cobblemon.mod.common.starter.CobblemonStarterHandler
import com.cobblemon.mod.common.trade.TradeManager
import com.cobblemon.mod.common.util.DataKeys
import com.cobblemon.mod.common.util.cobblemonResource
import com.cobblemon.mod.common.util.ifDedicatedServer
import com.cobblemon.mod.common.util.isLaterVersion
import com.cobblemon.mod.common.util.party
import com.cobblemon.mod.common.util.removeAmountIf
import com.cobblemon.mod.common.util.server
import com.cobblemon.mod.common.util.*
import com.cobblemon.mod.common.world.feature.CobblemonPlacedFeatures
import com.cobblemon.mod.common.world.feature.ore.CobblemonOrePlacedFeatures
import com.cobblemon.mod.common.world.gamerules.CobblemonGameRules
@@ -115,31 +122,33 @@ import com.mongodb.ConnectionString
import com.mongodb.MongoClientSettings
import com.mongodb.client.MongoClient
import com.mongodb.client.MongoClients
import java.io.File
import java.io.FileReader
import java.io.FileWriter
import java.io.PrintWriter
import java.util.UUID
import kotlin.properties.Delegates
import kotlin.reflect.full.memberProperties
import kotlin.reflect.jvm.isAccessible
import kotlin.reflect.jvm.javaField
import net.minecraft.client.MinecraftClient
import net.minecraft.command.argument.serialize.ConstantArgumentSerializer
import net.minecraft.entity.data.TrackedDataHandlerRegistry
import net.minecraft.item.Items
import net.minecraft.item.NameTagItem
import net.minecraft.registry.RegistryKey
import net.minecraft.sound.SoundCategory
import net.minecraft.util.WorldSavePath
import net.minecraft.util.math.BlockPos
import net.minecraft.world.World
import org.apache.logging.log4j.LogManager
import org.apache.logging.log4j.Logger
import java.io.File
import java.io.FileReader
import java.io.FileWriter
import java.io.PrintWriter
import java.util.*
import kotlin.properties.Delegates
import kotlin.reflect.full.memberProperties
import kotlin.reflect.jvm.isAccessible
import kotlin.reflect.jvm.javaField
import kotlin.math.roundToInt
object Cobblemon {
const val MODID = "cobblemon"
const val VERSION = "1.4.0"
const val MODID = CobblemonBuildDetails.MOD_ID
const val VERSION = CobblemonBuildDetails.VERSION
const val CONFIG_PATH = "config/$MODID/main.json"
val LOGGER = LogManager.getLogger()
val LOGGER: Logger = LogManager.getLogger()
lateinit var implementation: CobblemonImplementation
@Deprecated("This field is now a config value", ReplaceWith("Cobblemon.config.captureCalculator"))
@@ -169,6 +178,13 @@ object Cobblemon {
fun preInitialize(implementation: CobblemonImplementation) {
this.implementation = implementation
this.LOGGER.info("Launching Cobblemon ${CobblemonBuildDetails.VERSION}${if(CobblemonBuildDetails.SNAPSHOT) "-SNAPSHOT" else ""} ")
if(CobblemonBuildDetails.SNAPSHOT) {
this.LOGGER.info(" - Git Commit: ${smallCommitHash()} (https://gitlab.com/cable-mc/cobblemon/-/commit/${CobblemonBuildDetails.GIT_COMMIT})")
this.LOGGER.info(" - Branch: ${CobblemonBuildDetails.BRANCH}")
}
implementation.registerPermissionValidator()
implementation.registerSoundEvents()
implementation.registerBlocks()
@@ -231,6 +247,9 @@ object Cobblemon {
}
}
// Register the grow_tumblestone advancement
PlatformEvents.RIGHT_CLICK_BLOCK.subscribe { AdvancementHandler.onTumbleStonePlaced(it) }
PlatformEvents.CHANGE_DIMENSION.subscribe {
it.player.party().forEach { pokemon -> pokemon.entity?.recallWithAnimation() }
}
@@ -239,6 +258,18 @@ object Cobblemon {
TrackedDataHandlerRegistry.register(StringSetDataSerializer)
TrackedDataHandlerRegistry.register(PoseTypeDataSerializer)
TrackedDataHandlerRegistry.register(IdentifierDataSerializer)
TrackedDataHandlerRegistry.register(IdentifierDataSerializer)
TrackedDataHandlerRegistry.register(UUIDSetDataSerializer)
// Lowest priority because this applies after luxury ball bonus as of gen 4
CobblemonEvents.FRIENDSHIP_UPDATED.subscribe(Priority.LOWEST) { event ->
var increment = (event.newFriendship - event.pokemon.friendship).toFloat()
// Our Luxury ball spec is diff from official, but we will still assume these stack
if (event.pokemon.heldItemNoCopy().isIn(CobblemonItemTags.IS_FRIENDSHIP_BOOSTER)) {
increment += increment * 0.5F
}
event.newFriendship = event.pokemon.friendship + increment.roundToInt()
}
HeldItemProvider.register(CobblemonHeldItemManager, Priority.LOWEST)
}
@@ -266,6 +297,10 @@ object Cobblemon {
CustomPokemonProperty.register(UncatchableProperty)
CustomPokemonProperty.register(PokemonFlagProperty)
CustomPokemonProperty.register(HiddenAbilityPropertyType)
CustomPokemonProperty.register(AspectPropertyType)
CustomPokemonProperty.register(UnaspectPropertyType)
FlowHandler.setup()
ifDedicatedServer {
isDedicatedServer = true
@@ -13,6 +13,7 @@ import net.minecraft.entity.ai.brain.Activity
object CobblemonActivities {
val activities = mutableListOf<Activity>()
val BATTLING_ACTIVITY = Activity("pokemon_battling")
val NPC_BATTLING = Activity("npc_battling")
fun register(activity: Activity): Activity {
activities.add(activity)
@@ -17,6 +17,7 @@ import com.cobblemon.mod.common.block.entity.FossilMultiblockEntity
import com.cobblemon.mod.common.block.entity.RestorationTankBlockEntity
import com.cobblemon.mod.common.block.multiblock.FossilMultiblockBuilder
import com.cobblemon.mod.common.block.entity.*
import com.cobblemon.mod.common.block.entity.DisplayCaseBlockEntity
import com.cobblemon.mod.common.platform.PlatformRegistry
import net.minecraft.block.entity.BlockEntityType
import net.minecraft.registry.Registries
@@ -77,4 +78,9 @@ object CobblemonBlockEntities : PlatformRegistry<Registry<BlockEntityType<*>>, R
CobblemonBlocks.FOSSIL_ANALYZER
).build(null)
)
@JvmField
val DISPLAY_CASE: BlockEntityType<DisplayCaseBlockEntity> = this.create("display_case",
BlockEntityType.Builder.create(::DisplayCaseBlockEntity, CobblemonBlocks.DISPLAY_CASE).build(null)
)
}
@@ -72,6 +72,8 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, RegistryKey<Registry<
@JvmField
val SUN_STONE_ORE = evolutionStoneOre("sun_stone_ore")
@JvmField
val TERRACOTTA_SUN_STONE_ORE = evolutionStoneOre("terracotta_sun_stone_ore")
@JvmField
val THUNDER_STONE_ORE = evolutionStoneOre("thunder_stone_ore")
@JvmField
val WATER_STONE_ORE = evolutionStoneOre("water_stone_ore")
@@ -158,7 +160,7 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, RegistryKey<Registry<
@JvmField
val BIG_ROOT = this.create("big_root", BigRootBlock(AbstractBlock.Settings.create().pistonBehavior(PistonBehavior.DESTROY).burnable().mapColor(MapColor.DARK_GREEN).noCollision().ticksRandomly().breakInstantly().sounds(CobblemonSounds.BIG_ROOT_SOUNDS)))
@JvmField
val REVIVAL_HERB = this.create("revival_herb", RevivalHerbBlock(AbstractBlock.Settings.create().pistonBehavior(PistonBehavior.DESTROY).mapColor(MapColor.DARK_GREEN).burnable().noCollision().breakInstantly().sounds(BlockSoundGroup.CROP)))
val REVIVAL_HERB = this.create("revival_herb", RevivalHerbBlock(AbstractBlock.Settings.create().pistonBehavior(PistonBehavior.DESTROY).mapColor(MapColor.DARK_GREEN).burnable().noCollision().breakInstantly().sounds(CobblemonSounds.REVIVAL_HERB_SOUNDS)))
@JvmField
val TUMBLESTONE_CLUSTER = tumblestoneBlock("tumblestone_cluster", GrowableStoneBlock.STAGE_3, 7, 3, null)
@@ -232,7 +234,7 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, RegistryKey<Registry<
"relic_coin_pouch",
CoinPouchBlock(
AbstractBlock.Settings.create()
.sounds(CobblemonSounds.COIN_POUCH_SOUNDS)
.sounds(CobblemonSounds.RELIC_COIN_POUCH_SOUNDS)
.pistonBehavior(PistonBehavior.DESTROY)
.strength(0.4f)
.nonOpaque(), true
@@ -243,7 +245,7 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, RegistryKey<Registry<
"relic_coin_sack",
CoinPouchBlock(
AbstractBlock.Settings.create()
.sounds(CobblemonSounds.COIN_POUCH_SOUNDS)
.sounds(CobblemonSounds.RELIC_COIN_SACK_SOUNDS)
.pistonBehavior(PistonBehavior.DESTROY)
.strength(0.4f), false
))
@@ -387,6 +389,18 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, RegistryKey<Registry<
)
@JvmField
val DISPLAY_CASE = create(
"display_case",
DisplayCaseBlock(
AbstractBlock.Settings.create()
.sounds(CobblemonSounds.DISPLAY_CASE_SOUNDS)
.nonOpaque()
.pistonBehavior(PistonBehavior.BLOCK)
.mapColor(MapColor.STONE_GRAY)
.strength(0.3f)
)
)
val RED_MINT = create("red_mint", MintBlock(MintType.RED, AbstractBlock.Settings.create().mapColor(MapColor.RED).noCollision().ticksRandomly().breakInstantly().sounds(CobblemonSounds.MINT_SOUNDS)))
@JvmField
val BLUE_MINT = create("blue_mint", MintBlock(MintType.BLUE, AbstractBlock.Settings.create().mapColor(MapColor.BLUE).noCollision().ticksRandomly().breakInstantly().sounds(CobblemonSounds.MINT_SOUNDS)))
@@ -414,7 +428,7 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, RegistryKey<Registry<
)
@JvmField
val VIVICHOKE_SEEDS = this.create("vivichoke_seeds", VivichokeBlock(AbstractBlock.Settings.create().pistonBehavior(PistonBehavior.DESTROY).burnable().mapColor(MapColor.DARK_GREEN).noCollision().ticksRandomly().breakInstantly().sounds(BlockSoundGroup.CROP)))
val VIVICHOKE_SEEDS = this.create("vivichoke_seeds", VivichokeBlock(AbstractBlock.Settings.create().pistonBehavior(PistonBehavior.DESTROY).burnable().mapColor(MapColor.DARK_GREEN).noCollision().ticksRandomly().breakInstantly().sounds(CobblemonSounds.VIVICHOKE_SOUNDS)))
@JvmField
val PEP_UP_FLOWER = this.create("pep_up_flower", FlowerBlock(StatusEffects.LEVITATION, 10, AbstractBlock.Settings.create().mapColor(MapColor.DARK_GREEN).noCollision().breakInstantly().sounds(BlockSoundGroup.GRASS).offset(AbstractBlock.OffsetType.XZ).pistonBehavior(PistonBehavior.DESTROY)))
@JvmField
@@ -48,5 +48,10 @@ object CobblemonCommands {
PokemonRestartCommand.register(dispatcher)
BedrockParticleCommand.register(dispatcher)
OpenDialogueCommand.register(dispatcher)
NPCEditCommand.register(dispatcher)
// Possibly lock down registration if and only if under dev environment or running in an environment
// with a certain system environment variable set
CobblemonInfoCommand.register(dispatcher)
}
}
@@ -11,6 +11,8 @@ package com.cobblemon.mod.common
import com.cobblemon.mod.common.api.pokeball.PokeBalls
import com.cobblemon.mod.common.entity.boat.CobblemonBoatEntity
import com.cobblemon.mod.common.entity.boat.CobblemonChestBoatEntity
import com.cobblemon.mod.common.entity.fishing.PokeRodFishingBobberEntity
import com.cobblemon.mod.common.entity.npc.NPCEntity
import com.cobblemon.mod.common.entity.generic.GenericBedrockEntity
import com.cobblemon.mod.common.entity.pokeball.EmptyPokeBallEntity
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
@@ -66,6 +68,15 @@ object CobblemonEntities : PlatformRegistry<Registry<EntityType<*>>, RegistryKey
.build(CHEST_BOAT_KEY.toString())
)
@JvmField
val POKE_BOBBER_KEY = cobblemonResource("poke_bobber")
@JvmField
val POKE_BOBBER: EntityType<PokeRodFishingBobberEntity> = this.create(
POKE_BOBBER_KEY.path,
EntityType.Builder.create(::PokeRodFishingBobberEntity, SpawnGroup.MISC).setDimensions(0.5F, 0.5F).maxTrackingRange(10)
.build(POKE_BOBBER_KEY.toString())
)
@JvmField
val GENERIC_BEDROCK_ENTITY_KEY = cobblemonResource("generic_bedrock")
@JvmField
@@ -75,8 +86,16 @@ object CobblemonEntities : PlatformRegistry<Registry<EntityType<*>>, RegistryKey
.build(GENERIC_BEDROCK_ENTITY_KEY.toString())
)
@JvmField
val NPC_KEY = cobblemonResource("npc")
@JvmField
val NPC: EntityType<NPCEntity> = create(
NPC_KEY.path,
EntityType.Builder.create({ _, world -> NPCEntity(world) }, SpawnGroup.CREATURE).build("$NPC_KEY")
)
fun registerAttributes(consumer: (EntityType<out LivingEntity>, DefaultAttributeContainer.Builder) -> Unit) {
consumer(POKEMON, PokemonEntity.createAttributes())
consumer(NPC, NPCEntity.createAttributes())
}
}
@@ -0,0 +1,74 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common
import com.bedrockk.molang.runtime.MoLangRuntime
import com.bedrockk.molang.runtime.value.MoValue
import com.cobblemon.mod.common.api.data.DataRegistry
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.util.asExpressionLike
import com.cobblemon.mod.common.util.cobblemonResource
import com.cobblemon.mod.common.util.endsWith
import java.util.concurrent.ExecutionException
import net.minecraft.resource.ResourceManager
import net.minecraft.resource.ResourceType
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.Identifier
/**
* Holds all the flows that are loaded from the server's data packs. A flow 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>()
override val type = ResourceType.SERVER_DATA
override fun sync(player: ServerPlayerEntity) {}
val runtime by lazy { MoLangRuntime().setup() }
val clientFlows = hashMapOf<Identifier, MutableList<ExpressionLike>>()
val flows = hashMapOf<Identifier, MutableList<ExpressionLike>>()
override fun reload(manager: ResourceManager) {
val folderBeforeNameRegex = ".*\\/([^\\/]+)\\/[^\\/]+\$".toRegex()
manager.findResources("flows") { path -> path.endsWith(CobblemonScripts.MOLANG_EXTENSION) }.forEach { (identifier, resource) ->
resource.inputStream.use { stream ->
stream.bufferedReader().use { reader ->
try {
val expression = reader.readText().asExpressionLike()
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.")
if (identifier.path.startsWith("flows/client/")) {
clientFlows.getOrPut(Identifier(identifier.namespace, event)) { mutableListOf() }.add(expression)
} else {
flows.getOrPut(Identifier(identifier.namespace, event)) { mutableListOf() }.add(expression)
}
} catch (exception: Exception) {
throw ExecutionException("Error loading MoLang script for flow: $identifier", exception)
}
}
}
}
Cobblemon.LOGGER.info("Loaded ${CobblemonScripts.scripts.size} flows and ${CobblemonScripts.clientScripts.size} client flows")
observable.emit(this)
}
fun run(eventIdentifier: Identifier, context: Map<String, MoValue>) {
flows[eventIdentifier]?.forEach { it.resolve(runtime, context) }
}
}
@@ -8,11 +8,14 @@
package com.cobblemon.mod.common
import com.cobblemon.mod.common.api.item.ability.AbilityChanger
import com.cobblemon.mod.common.api.mulch.MulchVariant
import com.cobblemon.mod.common.api.pokeball.PokeBalls
import com.cobblemon.mod.common.api.pokemon.Natures
import com.cobblemon.mod.common.api.pokemon.stats.Stats
import com.cobblemon.mod.common.api.pokemon.status.Statuses
import com.cobblemon.mod.common.api.text.blue
import com.cobblemon.mod.common.api.text.gray
import com.cobblemon.mod.common.block.BerryBlock
import com.cobblemon.mod.common.block.MintBlock
import com.cobblemon.mod.common.block.MintBlock.MintType
@@ -29,6 +32,8 @@ import com.cobblemon.mod.common.item.berry.PortionHealingBerryItem
import com.cobblemon.mod.common.item.berry.StatusCuringBerryItem
import com.cobblemon.mod.common.item.berry.VolatileCuringBerryItem
import com.cobblemon.mod.common.item.interactive.*
import com.cobblemon.mod.common.item.interactive.PotionItem
import com.cobblemon.mod.common.item.interactive.ability.AbilityChangeItem
import com.cobblemon.mod.common.platform.PlatformRegistry
import com.cobblemon.mod.common.pokeball.PokeBall
import com.cobblemon.mod.common.pokemon.helditem.CobblemonHeldItemManager
@@ -37,18 +42,12 @@ import net.minecraft.block.Block
import net.minecraft.entity.LivingEntity
import net.minecraft.entity.effect.StatusEffectInstance
import net.minecraft.entity.effect.StatusEffects
import net.minecraft.item.BlockItem
import net.minecraft.item.FoodComponent
import net.minecraft.item.HangingSignItem
import net.minecraft.item.Item
import net.minecraft.item.ItemStack
import net.minecraft.item.SignItem
import net.minecraft.item.SmithingTemplateItem
import net.minecraft.item.StewItem
import net.minecraft.item.*
import net.minecraft.registry.Registries
import net.minecraft.registry.Registry
import net.minecraft.registry.RegistryKey
import net.minecraft.registry.RegistryKeys
import net.minecraft.text.Text
import net.minecraft.util.Identifier
import net.minecraft.world.World
@@ -258,6 +257,8 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<It
val PC = blockItem("pc", CobblemonBlocks.PC)
@JvmField
val PASTURE = blockItem("pasture", CobblemonBlocks.PASTURE)
@JvmField
val DISPLAY_CASE = blockItem("display_case", CobblemonBlocks.DISPLAY_CASE)
// Evolution items
@JvmField val LINK_CABLE = create("link_cable", LinkCableItem())
@@ -285,6 +286,8 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<It
@JvmField val RIBBON_SWEET = noSettingsItem("ribbon_sweet")
@JvmField val CHIPPED_POT = noSettingsItem("chipped_pot")
@JvmField val CRACKED_POT = noSettingsItem("cracked_pot")
@JvmField val MASTERPIECE_TEACUP = noSettingsItem("masterpiece_teacup")
@JvmField val UNREMARKABLE_TEACUP = noSettingsItem("unremarkable_teacup")
@JvmField val SWEET_APPLE = noSettingsItem("sweet_apple")
@JvmField val TART_APPLE = noSettingsItem("tart_apple")
@JvmField val GALARICA_CUFF = noSettingsItem("galarica_cuff")
@@ -408,7 +411,7 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<It
@JvmField
val CLEVER_FEATHER = create("clever_feather", FeatherItem(Stats.SPECIAL_DEFENCE))
@JvmField
val MEDICINAL_LEEK = create("medicinal_leek", MedicinalLeekItem(CobblemonBlocks.MEDICINAL_LEEK, Item.Settings().food(FoodComponent.Builder().snack().hunger(1).saturationModifier(0.2f).build())))
val MEDICINAL_LEEK = heldItem("medicinal_leek", MedicinalLeekItem(CobblemonBlocks.MEDICINAL_LEEK, Item.Settings().food(FoodComponent.Builder().snack().hunger(1).saturationModifier(0.2f).build())), "leek")
@JvmField
val ROASTED_LEEK = create("roasted_leek", Item(Item.Settings().food(FoodComponent.Builder().snack().hunger(3).saturationModifier(0.3f).build())))
@JvmField
@@ -558,6 +561,11 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<It
@JvmField val ELIXIR = create("elixir", ElixirItem(max = false))
@JvmField val MAX_ELIXIR = create("max_elixir", ElixirItem(max = true))
@JvmField
val ABILITY_CAPSULE = this.create("ability_capsule", AbilityChangeItem(AbilityChanger.COMMON_ABILITY))
@JvmField
val ABILITY_PATCH = this.create("ability_patch", AbilityChangeItem(AbilityChanger.HIDDEN_ABILITY))
/**
* Evolution Ores and Stones
*/
@@ -578,6 +586,8 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<It
@JvmField
val SUN_STONE_ORE = blockItem("sun_stone_ore", CobblemonBlocks.SUN_STONE_ORE)
@JvmField
val TERRACOTTA_SUN_STONE_ORE = blockItem("terracotta_sun_stone_ore", CobblemonBlocks.TERRACOTTA_SUN_STONE_ORE)
@JvmField
val THUNDER_STONE_ORE = blockItem("thunder_stone_ore", CobblemonBlocks.THUNDER_STONE_ORE)
@JvmField
val WATER_STONE_ORE = blockItem("water_stone_ore", CobblemonBlocks.WATER_STONE_ORE)
@@ -629,16 +639,28 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<It
// Held Items
@JvmField
val ABILITY_SHIELD = heldItem("ability_shield")
@JvmField
val ABSORB_BULB = heldItem("absorb_bulb")
@JvmField
val AIR_BALLOON = heldItem("air_balloon")
@JvmField
val ASSAULT_VEST = heldItem("assault_vest")
@JvmField
val BIG_ROOT = blockItem("big_root", CobblemonBlocks.BIG_ROOT)
@JvmField
val BINDING_BAND = heldItem("binding_band")
@JvmField
val BLACK_BELT = heldItem("black_belt")
@JvmField
val BLACK_GLASSES = heldItem("black_glasses")
@JvmField
val BLACK_SLUDGE = heldItem("black_sludge")
@JvmField
val BLUNDER_POLICY = heldItem("blunder_policy")
@JvmField
val CELL_BATTERY = heldItem("cell_battery")
@JvmField
val CHARCOAL = heldItem("charcoal_stick", remappedName = "charcoal")
@JvmField
val CHOICE_BAND = heldItem("choice_band")
@@ -648,26 +670,64 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<It
val CHOICE_SPECS = heldItem("choice_specs")
@JvmField
val CLEANSE_TAG = heldItem("cleanse_tag")
// @JvmField
// val CLEAR_AMULET = heldItem("clear_amulet")
@JvmField
val COVERT_CLOAK = heldItem("covert_cloak")
@JvmField
val DESTINY_KNOT = heldItem("destiny_knot")
@JvmField
val DRAGON_FANG = heldItem("dragon_fang")
@JvmField
val EJECT_BUTTON = heldItem("eject_button")
@JvmField
val EJECT_PACK = heldItem("eject_pack")
@JvmField
val EVERSTONE = heldItem("everstone")
@JvmField
val EVIOLITE = heldItem("eviolite")
@JvmField
val EXP_SHARE = heldItem("exp_share")
@JvmField
val EXPERT_BELT = heldItem("expert_belt")
@JvmField
val FAIRY_FEATHER = heldItem("fairy_feather")
@JvmField
val FLAME_ORB = heldItem("flame_orb")
@JvmField
val FLOAT_STONE = heldItem("float_stone")
@JvmField
val FOCUS_BAND = heldItem("focus_band")
@JvmField
val FOCUS_SASH = heldItem("focus_sash")
// @JvmField
// val GRIP_CLAW = heldItem("grip_claw")
@JvmField
val HARD_STONE = heldItem("hard_stone")
@JvmField
val HEAVY_DUTY_BOOTS = heldItem("heavy_duty_boots")
@JvmField
val IRON_BALL = heldItem("iron_ball")
// @JvmField
// val LAGGING_TAIL = heldItem("lagging_tail")
@JvmField
val LEFTOVERS = heldItem("leftovers")
@JvmField
val LIFE_ORB = heldItem("life_orb")
@JvmField
val LIGHT_BALL = heldItem("light_ball")
@JvmField
val LIGHT_CLAY = heldItem("light_clay")
@JvmField
val LOADED_DICE = heldItem("loaded_dice")
@JvmField
val LUCKY_EGG = heldItem("lucky_egg")
// @JvmField
// val LUMINOUS_MOSS = heldItem("luminous_moss")
@JvmField
val MAGNET = heldItem("magnet")
// @JvmField
// val METRONOME = heldItem("metronome")
@JvmField
val MIRACLE_SEED = heldItem("miracle_seed")
@JvmField
@@ -678,14 +738,42 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<It
val NEVER_MELT_ICE = heldItem("never_melt_ice")
@JvmField
val POISON_BARB = heldItem("poison_barb")
@JvmField
val POWER_ANKLET = heldItem("power_anklet")
@JvmField
val POWER_BAND = heldItem("power_band")
@JvmField
val POWER_BELT = heldItem("power_belt")
@JvmField
val POWER_BRACER = heldItem("power_bracer")
@JvmField
val POWER_LENS = heldItem("power_lens")
@JvmField
val POWER_WEIGHT = heldItem("power_weight")
// @JvmField
// val PROTECTIVE_PADS = heldItem("protective_pads")
// @JvmField
// val PUNCHING_GLOVE = heldItem("punching_glove")
@JvmField
val QUICK_CLAW = heldItem("quick_claw")
@JvmField
val RED_CARD = heldItem("red_card")
@JvmField
val RING_TARGET = heldItem("ring_target")
@JvmField
val ROCKY_HELMET = heldItem("rocky_helmet")
// @JvmField
// val ROOM_SERVICE = heldItem("room_service")
@JvmField
val SAFETY_GOGGLES = heldItem("safety_goggles")
// @JvmField
// val SCOPE_LENS = heldItem("scope_lens")
@JvmField
val SHARP_BEAK = heldItem("sharp_beak")
// @JvmField
// val SHED_SHELL = heldItem("shed_shell")
@JvmField
val SHELL_BELL = heldItem("shell_bell")
@JvmField
val SILK_SCARF = heldItem("silk_scarf")
@JvmField
@@ -695,9 +783,29 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<It
@JvmField
val SPELL_TAG = heldItem("spell_tag")
@JvmField
val SMOKE_BALL = heldItem("smoke_ball")
@JvmField
val SOOTHE_BELL = heldItem("soothe_bell")
@JvmField
val STICKY_BARB = heldItem("sticky_barb")
// @JvmField
// val TERRAIN_EXTENDER = heldItem("terrain_extender")
// @JvmField
// val THROAT_SPRAY = heldItem("throat_spray")
@JvmField
val TOXIC_ORB = heldItem("toxic_orb")
@JvmField
val TWISTED_SPOON = heldItem("twisted_spoon")
// @JvmField
// val UTILITY_UMBRELLA = heldItem("utility_umbrella")
@JvmField
val WEAKNESS_POLICY = heldItem("weakness_policy")
// @JvmField
// val WIDE_LENS = heldItem("wide_lens")
@JvmField
val WISE_GLASSES = heldItem("wise_glasses")
// @JvmField
// val ZOOM_LENS = heldItem("zoom_lens")
@JvmField
val MENTAL_HERB = compostableHeldItem("mental_herb", null, 1F)
@JvmField
@@ -713,29 +821,13 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<It
@JvmField
val QUICK_POWDER = heldItem("quick_powder")
@JvmField
val DESTINY_KNOT = heldItem("destiny_knot")
val DAMP_ROCK = heldItem("damp_rock")
@JvmField
val EVERSTONE = heldItem("everstone")
val HEAT_ROCK = heldItem("heat_rock")
@JvmField
val POWER_ANKLET = heldItem("power_anklet")
val SMOOTH_ROCK = heldItem("smooth_rock")
@JvmField
val POWER_BAND = heldItem("power_band")
@JvmField
val POWER_BELT = heldItem("power_belt")
@JvmField
val POWER_BRACER = heldItem("power_bracer")
@JvmField
val POWER_LENS = heldItem("power_lens")
@JvmField
val POWER_WEIGHT = heldItem("power_weight")
@JvmField
val FLAME_ORB = heldItem("flame_orb")
@JvmField
val LIFE_ORB = heldItem("life_orb")
@JvmField
val TOXIC_ORB = heldItem("toxic_orb")
@JvmField
val SMOKE_BALL = heldItem("smoke_ball")
val ICY_ROCK = heldItem("icy_rock")
// Mulch
@JvmField
@@ -843,12 +935,121 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<It
@JvmField
val BLACK_TUMBLESTONE_BLOCK = blockItem("black_tumblestone_block", CobblemonBlocks.BLACK_TUMBLESTONE_BLOCK)
@JvmField
val POKEROD_SMITHING_TEMPLATE = create("pokerod_smithing_template", SmithingTemplateItem(
Text.translatable("item.minecraft.fishing_rod").blue(),
Text.translatable("item.cobblemon.smithing_template.pokerod.ingredients").blue(),
Text.translatable("upgrade.cobblemon.pokerod").gray(),
Text.translatable("item.cobblemon.smithing_template.pokerod.base_slot_description"),
Text.translatable("item.cobblemon.smithing_template.pokerod.additions_slot_description"),
listOf(cobblemonResource("item/empty_slot_fishing_rod")),
listOf(cobblemonResource("item/empty_slot_pokeball"))
))
@JvmField
val AUTOMATON_ARMOR_TRIM_SMITHING_TEMPLATE: SmithingTemplateItem = this.create(
"automaton_armor_trim_smithing_template",
SmithingTemplateItem.of(CobblemonArmorTrims.AUTOMATON)
)
val pokeRods = mutableListOf<PokerodItem>()
@JvmField
val POKE_ROD = pokerodItem(cobblemonResource("poke_rod"))
@JvmField
val CITRINE_ROD = pokerodItem(cobblemonResource("citrine_rod"))
@JvmField
val VERDANT_ROD = pokerodItem(cobblemonResource("verdant_rod"))
@JvmField
val AZURE_ROD = pokerodItem(cobblemonResource("azure_rod"))
@JvmField
val ROSEATE_ROD = pokerodItem(cobblemonResource("roseate_rod"))
@JvmField
val SLATE_ROD = pokerodItem(cobblemonResource("slate_rod"))
@JvmField
val PREMIER_ROD = pokerodItem(cobblemonResource("premier_rod"))
@JvmField
val GREAT_ROD = pokerodItem(cobblemonResource("great_rod"))
@JvmField
val ULTRA_ROD = pokerodItem(cobblemonResource("ultra_rod"))
@JvmField
val SAFARI_ROD = pokerodItem(cobblemonResource("safari_rod"))
@JvmField
val FAST_ROD = pokerodItem(cobblemonResource("fast_rod"))
@JvmField
val LEVEL_ROD = pokerodItem(cobblemonResource("level_rod"))
@JvmField
val LURE_ROD = pokerodItem(cobblemonResource("lure_rod"))
@JvmField
val HEAVY_ROD = pokerodItem(cobblemonResource("heavy_rod"))
@JvmField
val LOVE_ROD = pokerodItem(cobblemonResource("love_rod"))
@JvmField
val FRIEND_ROD = pokerodItem(cobblemonResource("friend_rod"))
@JvmField
val MOON_ROD = pokerodItem(cobblemonResource("moon_rod"))
@JvmField
val SPORT_ROD = pokerodItem(cobblemonResource("sport_rod"))
@JvmField
val PARK_ROD = pokerodItem(cobblemonResource("park_rod"))
@JvmField
val NET_ROD = pokerodItem(cobblemonResource("net_rod"))
@JvmField
val DIVE_ROD = pokerodItem(cobblemonResource("dive_rod"))
@JvmField
val NEST_ROD = pokerodItem(cobblemonResource("nest_rod"))
@JvmField
val REPEAT_ROD = pokerodItem(cobblemonResource("repeat_rod"))
@JvmField
val TIMER_ROD = pokerodItem(cobblemonResource("timer_rod"))
@JvmField
val LUXURY_ROD = pokerodItem(cobblemonResource("luxury_rod"))
@JvmField
val DUSK_ROD = pokerodItem(cobblemonResource("dusk_rod"))
@JvmField
val HEAL_ROD = pokerodItem(cobblemonResource("heal_rod"))
@JvmField
val QUICK_ROD = pokerodItem(cobblemonResource("quick_rod"))
@JvmField
val DREAM_ROD = pokerodItem(cobblemonResource("dream_rod"))
@JvmField
val BEAST_ROD = pokerodItem(cobblemonResource("beast_rod"))
@JvmField
val MASTER_ROD = pokerodItem(cobblemonResource("master_rod"))
@JvmField
val CHERISH_ROD = pokerodItem(cobblemonResource("cherish_rod"))
@JvmField
val ANCIENT_POKE_ROD = pokerodItem(cobblemonResource("ancient_poke_rod"))
@JvmField
val ANCIENT_CITRINE_ROD = pokerodItem(cobblemonResource("ancient_citrine_rod"))
@JvmField
val ANCIENT_VERDANT_ROD = pokerodItem(cobblemonResource("ancient_verdant_rod"))
@JvmField
val ANCIENT_AZURE_ROD = pokerodItem(cobblemonResource("ancient_azure_rod"))
@JvmField
val ANCIENT_ROSEATE_ROD = pokerodItem(cobblemonResource("ancient_roseate_rod"))
@JvmField
val ANCIENT_SLATE_ROD = pokerodItem(cobblemonResource("ancient_slate_rod"))
@JvmField
val ANCIENT_IVORY_ROD = pokerodItem(cobblemonResource("ancient_ivory_rod"))
@JvmField
val ANCIENT_GREAT_ROD = pokerodItem(cobblemonResource("ancient_great_rod"))
@JvmField
val ANCIENT_ULTRA_ROD = pokerodItem(cobblemonResource("ancient_ultra_rod"))
@JvmField
val ANCIENT_FEATHER_ROD = pokerodItem(cobblemonResource("ancient_feather_rod"))
@JvmField
val ANCIENT_WING_ROD = pokerodItem(cobblemonResource("ancient_wing_rod"))
@JvmField
val ANCIENT_JET_ROD = pokerodItem(cobblemonResource("ancient_jet_rod"))
@JvmField
val ANCIENT_HEAVY_ROD = pokerodItem(cobblemonResource("ancient_heavy_rod"))
@JvmField
val ANCIENT_LEADEN_ROD = pokerodItem(cobblemonResource("ancient_leaden_rod"))
@JvmField
val ANCIENT_GIGATON_ROD = pokerodItem(cobblemonResource("ancient_gigaton_rod"))
@JvmField
val ANCIENT_ORIGIN_ROD = pokerodItem(cobblemonResource("ancient_origin_rod"))
// Misc
@JvmField
val POKEMON_MODEL = this.create("pokemon_model", PokemonItem())
@@ -914,6 +1115,13 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<It
private fun candyItem(name: String, calculator: CandyItem.Calculator): CandyItem = this.create(name, CandyItem(calculator))
private fun pokerodItem(pokeRodId: Identifier): PokerodItem {
val settings = Item.Settings().maxCount(1).maxDamage(Items.FISHING_ROD.maxDamage)
val item = create(pokeRodId.path, PokerodItem(pokeRodId, settings))
pokeRods.add(item)
return item
}
private fun heldItem(name: String, remappedName: String? = null): CobblemonItem = create(
name,
CobblemonItem(Item.Settings()).also {
@@ -922,6 +1130,16 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<It
}
}
)
private fun heldItem(name: String, item: Item, remappedName: String? = null) = create(
name = name,
entry = item.also {
if (remappedName != null) {
CobblemonHeldItemManager.registerRemap(it, remappedName)
CobblemonHeldItemManager.registerRemap(Items.BONE, "thickclub")
CobblemonHeldItemManager.registerRemap(Items.SNOWBALL, "snowball")
}
}
)
private fun compostable(item: Item, increaseLevelChance: Float) = Cobblemon.implementation.registerCompostable(item, increaseLevelChance)
@@ -10,11 +10,13 @@ package com.cobblemon.mod.common
import com.bedrockk.molang.Expression
import com.cobblemon.mod.common.api.data.DataRegistry
import com.cobblemon.mod.common.api.molang.ExpressionLike
import com.cobblemon.mod.common.api.reactive.SimpleObservable
import com.cobblemon.mod.common.mechanics.BerriesMechanic
import com.cobblemon.mod.common.mechanics.PotionsMechanic
import com.cobblemon.mod.common.mechanics.RemediesMechanic
import com.cobblemon.mod.common.util.adapters.ExpressionAdapter
import com.cobblemon.mod.common.util.adapters.ExpressionLikeAdapter
import com.cobblemon.mod.common.util.cobblemonResource
import com.google.gson.GsonBuilder
import net.minecraft.resource.ResourceManager
@@ -29,6 +31,7 @@ object CobblemonMechanics : DataRegistry {
val gson = GsonBuilder()
.setPrettyPrinting()
.registerTypeAdapter(Expression::class.java, ExpressionAdapter)
.registerTypeAdapter(ExpressionLike::class.java, ExpressionLikeAdapter)
.create()
var remedies = RemediesMechanic()
@@ -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
import com.mojang.serialization.Codec
import com.mojang.serialization.codecs.ListCodec
import com.mojang.serialization.codecs.PrimitiveCodec
import java.util.Optional
import net.minecraft.entity.ai.brain.MemoryModuleType
import net.minecraft.util.Uuids
object CobblemonMemories {
val memories = mutableMapOf<String, MemoryModuleType<*>>()
val BATTLING_POKEMON = register("battling_pokemon", ListCodec(Uuids.INT_STREAM_CODEC))
val NPC_BATTLING = register("npc_battling", PrimitiveCodec.BOOL)
fun <U> register(id: String, codec: Codec<U>): MemoryModuleType<U> {
val memoryModule = MemoryModuleType(Optional.of(codec))
memories[id] = memoryModule
return memoryModule
}
fun <U> register(id: String): MemoryModuleType<U> {
val memoryModule = MemoryModuleType<U>(Optional.empty())
memories[id] = memoryModule
return memoryModule
}
}
@@ -14,37 +14,21 @@ import com.cobblemon.mod.common.api.net.ServerNetworkPacketHandler
import com.cobblemon.mod.common.client.net.PlayerInteractOptionsHandler
import com.cobblemon.mod.common.client.net.SetClientPlayerDataHandler
import com.cobblemon.mod.common.client.net.animation.PlayPoseableAnimationHandler
import com.cobblemon.mod.common.client.net.battle.BattleApplyPassResponseHandler
import com.cobblemon.mod.common.client.net.battle.BattleCaptureEndHandler
import com.cobblemon.mod.common.client.net.battle.BattleCaptureShakeHandler
import com.cobblemon.mod.common.client.net.battle.BattleCaptureStartHandler
import com.cobblemon.mod.common.client.net.battle.BattleChallengeExpiredHandler
import com.cobblemon.mod.common.client.net.battle.BattleChallengeNotificationHandler
import com.cobblemon.mod.common.client.net.battle.BattleEndHandler
import com.cobblemon.mod.common.client.net.battle.BattleFaintHandler
import com.cobblemon.mod.common.client.net.battle.BattleHealthChangeHandler
import com.cobblemon.mod.common.client.net.battle.BattleInitializeHandler
import com.cobblemon.mod.common.client.net.battle.BattleMadeInvalidChoiceHandler
import com.cobblemon.mod.common.client.net.battle.BattleMakeChoiceHandler
import com.cobblemon.mod.common.client.net.battle.BattleMessageHandler
import com.cobblemon.mod.common.client.net.battle.BattleMusicHandler
import com.cobblemon.mod.common.client.net.battle.BattlePersistentStatusHandler
import com.cobblemon.mod.common.client.net.battle.BattleQueueRequestHandler
import com.cobblemon.mod.common.client.net.battle.BattleSetTeamPokemonHandler
import com.cobblemon.mod.common.client.net.battle.BattleSwitchPokemonHandler
import com.cobblemon.mod.common.client.net.battle.BattleUpdateTeamPokemonHandler
import com.cobblemon.mod.common.client.net.battle.*
import com.cobblemon.mod.common.client.net.callback.move.OpenMoveCallbackHandler
import com.cobblemon.mod.common.client.net.callback.party.OpenPartyCallbackHandler
import com.cobblemon.mod.common.client.net.callback.partymove.OpenPartyMoveCallbackHandler
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.effect.RunPosableMoLangHandler
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.RunPosableMoLangHandler
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
import com.cobblemon.mod.common.client.net.gui.SummaryUIPacketHandler
import com.cobblemon.mod.common.client.net.npc.CloseNPCEditorHandler
import com.cobblemon.mod.common.client.net.npc.OpenNPCEditorHandler
import com.cobblemon.mod.common.client.net.pasture.ClosePastureHandler
import com.cobblemon.mod.common.client.net.pasture.OpenPastureHandler
import com.cobblemon.mod.common.client.net.pasture.PokemonPasturedHandler
@@ -82,13 +66,16 @@ import com.cobblemon.mod.common.net.messages.client.callback.OpenPartyCallbackPa
import com.cobblemon.mod.common.net.messages.client.callback.OpenPartyMoveCallbackPacket
import com.cobblemon.mod.common.net.messages.client.data.AbilityRegistrySyncPacket
import com.cobblemon.mod.common.net.messages.client.data.BerryRegistrySyncPacket
import com.cobblemon.mod.common.net.messages.client.data.FlowRegistrySyncPacket
import com.cobblemon.mod.common.net.messages.client.data.GlobalSpeciesFeatureSyncPacket
import com.cobblemon.mod.common.net.messages.client.data.MovesRegistrySyncPacket
import com.cobblemon.mod.common.net.messages.client.data.NPCRegistrySyncPacket
import com.cobblemon.mod.common.net.messages.client.data.PropertiesCompletionRegistrySyncPacket
import com.cobblemon.mod.common.net.messages.client.data.SpeciesFeatureAssignmentSyncPacket
import com.cobblemon.mod.common.net.messages.client.data.SpeciesRegistrySyncPacket
import com.cobblemon.mod.common.net.messages.client.data.StandardSpeciesFeatureSyncPacket
import com.cobblemon.mod.common.net.messages.client.data.UnlockReloadPacket
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.RunPosableMoLangPacket
@@ -96,6 +83,8 @@ import com.cobblemon.mod.common.net.messages.client.effect.SpawnSnowstormEntityP
import com.cobblemon.mod.common.net.messages.client.effect.SpawnSnowstormParticlePacket
import com.cobblemon.mod.common.net.messages.client.fossil.FossilRegistrySyncPacket
import com.cobblemon.mod.common.net.messages.client.fossil.NaturalMaterialRegistrySyncPacket
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.pasture.ClosePasturePacket
import com.cobblemon.mod.common.net.messages.client.pasture.OpenPasturePacket
import com.cobblemon.mod.common.net.messages.client.pasture.PokemonPasturedPacket
@@ -133,7 +122,12 @@ import com.cobblemon.mod.common.net.messages.client.trade.TradeStartedPacket
import com.cobblemon.mod.common.net.messages.client.trade.TradeUpdatedPacket
import com.cobblemon.mod.common.net.messages.client.ui.InteractPokemonUIPacket
import com.cobblemon.mod.common.net.messages.client.ui.SummaryUIPacket
import com.cobblemon.mod.common.net.messages.server.*
import com.cobblemon.mod.common.net.messages.server.BattleChallengePacket
import com.cobblemon.mod.common.net.messages.server.BenchMovePacket
import com.cobblemon.mod.common.net.messages.server.RequestMoveSwapPacket
import com.cobblemon.mod.common.net.messages.server.RequestPlayerInteractionsPacket
import com.cobblemon.mod.common.net.messages.server.SelectStarterPacket
import com.cobblemon.mod.common.net.messages.server.SendOutPokemonPacket
import com.cobblemon.mod.common.net.messages.server.battle.BattleSelectActionsPacket
import com.cobblemon.mod.common.net.messages.server.battle.RemoveSpectatorPacket
import com.cobblemon.mod.common.net.messages.server.battle.SpectateBattlePacket
@@ -145,6 +139,7 @@ import com.cobblemon.mod.common.net.messages.server.callback.partymove.PartyMove
import com.cobblemon.mod.common.net.messages.server.callback.partymove.PartyPokemonMoveSelectedPacket
import com.cobblemon.mod.common.net.messages.server.dialogue.EscapeDialoguePacket
import com.cobblemon.mod.common.net.messages.server.dialogue.InputToDialoguePacket
import com.cobblemon.mod.common.net.messages.server.npc.SaveNPCPacket
import com.cobblemon.mod.common.net.messages.server.pasture.PasturePokemonPacket
import com.cobblemon.mod.common.net.messages.server.pasture.UnpastureAllPokemonPacket
import com.cobblemon.mod.common.net.messages.server.pasture.UnpasturePokemonPacket
@@ -181,6 +176,7 @@ import com.cobblemon.mod.common.net.serverhandling.callback.partymove.PartyPokem
import com.cobblemon.mod.common.net.serverhandling.dialogue.EscapeDialogueHandler
import com.cobblemon.mod.common.net.serverhandling.dialogue.InputToDialogueHandler
import com.cobblemon.mod.common.net.serverhandling.evolution.AcceptEvolutionHandler
import com.cobblemon.mod.common.net.serverhandling.npc.SaveNPCHandler
import com.cobblemon.mod.common.net.serverhandling.pasture.PasturePokemonHandler
import com.cobblemon.mod.common.net.serverhandling.pasture.UnpastureAllPokemonHandler
import com.cobblemon.mod.common.net.serverhandling.pasture.UnpasturePokemonHandler
@@ -207,12 +203,12 @@ import com.cobblemon.mod.common.net.serverhandling.trade.ChangeTradeAcceptanceHa
import com.cobblemon.mod.common.net.serverhandling.trade.OfferTradeHandler
import com.cobblemon.mod.common.net.serverhandling.trade.UpdateTradeOfferHandler
import com.cobblemon.mod.common.util.server
import kotlin.reflect.KClass
import net.minecraft.network.PacketByteBuf
import net.minecraft.network.listener.ClientPlayPacketListener
import net.minecraft.network.packet.Packet
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.Identifier
import kotlin.reflect.KClass
/**
* Registers Cobblemon network packets.
@@ -305,6 +301,8 @@ object CobblemonNetwork : NetworkManager {
this.createClientBound(BattleMadeInvalidChoicePacket.ID, BattleMadeInvalidChoicePacket::decode, BattleMadeInvalidChoiceHandler)
this.createClientBound(BattleMusicPacket.ID, BattleMusicPacket::decode, BattleMusicHandler)
this.createClientBound(BattleChallengeExpiredPacket.ID, BattleChallengeExpiredPacket::decode, BattleChallengeExpiredHandler)
this.createClientBound(BattleReplacePokemonPacket.ID, BattleReplacePokemonPacket::decode, BattleReplacePokemonHandler)
this.createClientBound(BattleTransformPokemonPacket.ID, BattleTransformPokemonPacket::decode, BattleTransformPokemonHandler)
@@ -316,6 +314,7 @@ object CobblemonNetwork : NetworkManager {
this.createClientBound(MovesRegistrySyncPacket.ID, MovesRegistrySyncPacket::decode, DataRegistrySyncPacketHandler())
this.createClientBound(SpeciesRegistrySyncPacket.ID, SpeciesRegistrySyncPacket::decode, DataRegistrySyncPacketHandler())
this.createClientBound(PropertiesCompletionRegistrySyncPacket.ID, PropertiesCompletionRegistrySyncPacket::decode, DataRegistrySyncPacketHandler())
this.createClientBound(NPCRegistrySyncPacket.ID, NPCRegistrySyncPacket::decode, DataRegistrySyncPacketHandler())
this.createClientBound(UnlockReloadPacket.ID, UnlockReloadPacket::decode, UnlockReloadPacketHandler)
this.createClientBound(BerryRegistrySyncPacket.ID, BerryRegistrySyncPacket::decode, DataRegistrySyncPacketHandler())
this.createClientBound(StandardSpeciesFeatureSyncPacket.ID, StandardSpeciesFeatureSyncPacket::decode, DataRegistrySyncPacketHandler())
@@ -323,6 +322,8 @@ object CobblemonNetwork : NetworkManager {
this.createClientBound(SpeciesFeatureAssignmentSyncPacket.ID, SpeciesFeatureAssignmentSyncPacket::decode, DataRegistrySyncPacketHandler())
this.createClientBound(NaturalMaterialRegistrySyncPacket.ID, NaturalMaterialRegistrySyncPacket::decode, DataRegistrySyncPacketHandler())
this.createClientBound(FossilRegistrySyncPacket.ID, FossilRegistrySyncPacket::decode, DataRegistrySyncPacketHandler())
this.createClientBound(PokeRodRegistrySyncPacket.ID, PokeRodRegistrySyncPacket::decode, DataRegistrySyncPacketHandler())
this.createClientBound(FlowRegistrySyncPacket.ID, FlowRegistrySyncPacket::decode, DataRegistrySyncPacketHandler())
// Effects
this.createClientBound(SpawnSnowstormParticlePacket.ID, SpawnSnowstormParticlePacket::decode, SpawnSnowstormParticleHandler)
@@ -366,6 +367,10 @@ object CobblemonNetwork : NetworkManager {
// Dialogue packets
this.createClientBound(DialogueClosedPacket.ID, DialogueClosedPacket::decode, DialogueClosedHandler)
this.createClientBound(DialogueOpenedPacket.ID, DialogueOpenedPacket::decode, DialogueOpenedHandler)
// NPCs
this.createClientBound(CloseNPCEditorPacket.ID, CloseNPCEditorPacket::decode, CloseNPCEditorHandler)
this.createClientBound(OpenNPCEditorPacket.ID, OpenNPCEditorPacket::decode, OpenNPCEditorHandler)
}
override fun registerServerBound() {
@@ -435,6 +440,9 @@ object CobblemonNetwork : NetworkManager {
// Dialogue packets
this.createServerBound(EscapeDialoguePacket.ID, EscapeDialoguePacket::decode, EscapeDialogueHandler)
this.createServerBound(InputToDialoguePacket.ID, InputToDialoguePacket::decode, InputToDialogueHandler)
// NPC packets
this.createServerBound(SaveNPCPacket.ID, SaveNPCPacket::decode, SaveNPCHandler)
}
private inline fun <reified T : NetworkPacket<T>> createClientBound(identifier: Identifier, noinline decoder: (PacketByteBuf) -> T, handler: ClientNetworkPacketHandler<T>) {
@@ -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
import com.cobblemon.mod.common.entity.sensor.BattlingPokemonSensor
import com.cobblemon.mod.common.entity.sensor.NPCBattlingSensor
import java.util.function.Supplier
import net.minecraft.entity.Entity
import net.minecraft.entity.ai.brain.sensor.Sensor
import net.minecraft.entity.ai.brain.sensor.SensorType
object CobblemonSensors {
val sensors = mutableMapOf<String, SensorType<*>>()
val NPC_BATTLING = register("npc_battling", ::NPCBattlingSensor)
val BATTLING_POKEMON = register("battling_pokemon", ::BattlingPokemonSensor)
fun <E : Entity, U : Sensor<E>> register(id: String, supplier: Supplier<U>): SensorType<U> {
val sensor = SensorType(supplier)
sensors[id] = sensor
return sensor
}
}
@@ -99,36 +99,49 @@ object CobblemonSounds : PlatformRegistry<Registry<SoundEvent>, RegistryKey<Regi
val MULCH_REMOVE = this.create("mulch.remove")
@JvmField
val FOSSIL_MACHINE_ACTIVATE = this.create("fossilmachine.activate")
val FOSSIL_MACHINE_ACTIVATE = this.create("fossil_machine.activate")
@JvmField
val FOSSIL_MACHINE_ACTIVE_LOOP = this.create("fossilmachine.active_loop")
val FOSSIL_MACHINE_ACTIVE_LOOP = this.create("fossil_machine.active_loop")
@JvmField
val FOSSIL_MACHINE_ASSEMBLE = this.create("fossilmachine.assemble")
val FOSSIL_MACHINE_ASSEMBLE = this.create("fossil_machine.assemble")
@JvmField
val FOSSIL_MACHINE_DNA_FULL = this.create("fossilmachine.dna_full")
val FOSSIL_MACHINE_DNA_FULL = this.create("fossil_machine.dna_full")
@JvmField
val FOSSIL_MACHINE_FINISHED = this.create("fossilmachine.finished")
val FOSSIL_MACHINE_FINISHED = this.create("fossil_machine.finished")
@JvmField
val FOSSIL_MACHINE_INSERT_DNA = this.create("fossilmachine.insert_dna")
val FOSSIL_MACHINE_INSERT_DNA = this.create("fossil_machine.insert_dna")
@JvmField
val FOSSIL_MACHINE_INSERT_DNA_SMALL = this.create("fossilmachine.insert_dna_small")
val FOSSIL_MACHINE_INSERT_DNA_SMALL = this.create("fossil_machine.insert_dna_small")
@JvmField
val FOSSIL_MACHINE_INSERT_FOSSIL = this.create("fossilmachine.insert_fossil")
val FOSSIL_MACHINE_INSERT_FOSSIL = this.create("fossil_machine.insert_fossil")
@JvmField
val FOSSIL_MACHINE_RETRIEVE_FOSSIL = this.create("fossilmachine.retrieve_fossil")
val FOSSIL_MACHINE_RETRIEVE_FOSSIL = this.create("fossil_machine.retrieve_fossil")
@JvmField
val FOSSIL_MACHINE_RETRIEVE_POKEMON = this.create("fossilmachine.retrieve_pokemon")
val FOSSIL_MACHINE_RETRIEVE_POKEMON = this.create("fossil_machine.retrieve_pokemon")
@JvmField
val FOSSIL_MACHINE_UNPROTECTED = this.create("fossilmachine.unprotected")
val FOSSIL_MACHINE_UNPROTECTED = this.create("fossil_machine.unprotected")
@JvmField
val COIN_POUCH_BREAK = this.create("coin_pouch.break")
val RELIC_COIN_SACK_BREAK = this.create("relic_coin_sack.break")
@JvmField
val COIN_POUCH_HIT = this.create("coin_pouch.hit")
val RELIC_COIN_SACK_HIT = this.create("relic_coin_sack.hit")
@JvmField
val COIN_POUCH_STEP = this.create("coin_pouch.step")
val RELIC_COIN_SACK_STEP = this.create("relic_coin_sack.step")
@JvmField
val COIN_POUCH_PLACE = this.create("coin_pouch.place")
val RELIC_COIN_SACK_PLACE = this.create("relic_coin_sack.place")
@JvmField
val RELIC_COIN_POUCH_BREAK = this.create("relic_coin_pouch.break")
@JvmField
val RELIC_COIN_POUCH_PLACE = this.create("relic_coin_pouch.place")
@JvmField
val FISHING_NOTIFICATION = this.create("fishing.notification")
@JvmField
val FISHING_SPLASH_BIG = this.create("fishing.splash_big")
@JvmField
val FISHING_SPLASH_SMALL = this.create("fishing.splash_small")
@JvmField
val FISHING_BOBBER_LAND = this.create("fishing.bobber_land")
@JvmField
val TUMBLESTONE_BREAK = this.create("tumblestone.break")
@JvmField
@@ -155,11 +168,21 @@ object CobblemonSounds : PlatformRegistry<Registry<SoundEvent>, RegistryKey<Regi
@JvmField
val ENERGY_ROOT_PLACE = this.create("energy_root.place")
@JvmField
val VIVICHOKE_BREAK = this.create("vivichoke.break")
@JvmField
val VIVICHOKE_PLACE = this.create("vivichoke.place")
@JvmField
val MINT_BREAK = this.create("mint.break")
@JvmField
val MINT_PLACE = this.create("mint.place")
@JvmField
val REVIVAL_HERB_BREAK = this.create("revival_herb.break")
@JvmField
val REVIVAL_HERB_PLACE = this.create("revival_herb.place")
@JvmField
val MEDICINAL_LEEK_BREAK = this.create("medicinal_leek.break")
@JvmField
@@ -179,13 +202,22 @@ object CobblemonSounds : PlatformRegistry<Registry<SoundEvent>, RegistryKey<Regi
val GILDED_CHEST_PLACE = this.create("gilded_chest.place")
@JvmField
val COIN_POUCH_SOUNDS = BlockSoundGroup(1f, 1f,
COIN_POUCH_BREAK,
COIN_POUCH_STEP,
COIN_POUCH_PLACE,
COIN_POUCH_HIT,
COIN_POUCH_STEP
val RELIC_COIN_SACK_SOUNDS = BlockSoundGroup(1f, 1f,
RELIC_COIN_SACK_BREAK,
RELIC_COIN_SACK_STEP,
RELIC_COIN_SACK_PLACE,
RELIC_COIN_SACK_HIT,
RELIC_COIN_SACK_STEP
)
@JvmField
val RELIC_COIN_POUCH_SOUNDS = BlockSoundGroup(1f, 1f,
RELIC_COIN_POUCH_BREAK,
RELIC_COIN_SACK_STEP,
RELIC_COIN_POUCH_PLACE,
RELIC_COIN_SACK_HIT,
RELIC_COIN_SACK_STEP
)
@JvmField
val IMPACT_NORMAL = this.create("impact.normal")
@JvmField
@@ -277,6 +309,15 @@ object CobblemonSounds : PlatformRegistry<Registry<SoundEvent>, RegistryKey<Regi
SoundEvents.BLOCK_GRASS_FALL
)
@JvmField
val VIVICHOKE_SOUNDS = BlockSoundGroup(1f, 1f,
VIVICHOKE_BREAK,
SoundEvents.BLOCK_GRASS_STEP,
VIVICHOKE_PLACE,
SoundEvents.BLOCK_GRASS_HIT,
SoundEvents.BLOCK_GRASS_FALL
)
@JvmField
val MINT_SOUNDS = BlockSoundGroup(1f, 1f,
MINT_BREAK,
@@ -286,6 +327,15 @@ object CobblemonSounds : PlatformRegistry<Registry<SoundEvent>, RegistryKey<Regi
SoundEvents.BLOCK_GRASS_FALL
)
@JvmField
val REVIVAL_HERB_SOUNDS = BlockSoundGroup(1f, 1f,
REVIVAL_HERB_BREAK,
SoundEvents.BLOCK_GRASS_STEP,
REVIVAL_HERB_PLACE,
SoundEvents.BLOCK_GRASS_HIT,
SoundEvents.BLOCK_GRASS_FALL
)
@JvmField
val GILDED_CHEST_SOUNDS = BlockSoundGroup(1f, 1f,
GILDED_CHEST_BREAK,
@@ -295,5 +345,27 @@ object CobblemonSounds : PlatformRegistry<Registry<SoundEvent>, RegistryKey<Regi
GILDED_CHEST_STEP
)
@JvmField
val DISPLAY_CASE_ADD_ITEM = this.create("display_case.add_item")
@JvmField
val DISPLAY_CASE_REMOVE_ITEM = this.create("display_case.remove_item")
@JvmField
val DISPLAY_CASE_BREAK = this.create("display_case.break")
@JvmField
val DISPLAY_CASE_HIT = this.create("display_case.hit")
@JvmField
val DISPLAY_CASE_PLACE = this.create("display_case.place")
@JvmField
val DISPLAY_CASE_STEP = this.create("display_case.step")
@JvmField
val DISPLAY_CASE_SOUNDS = BlockSoundGroup(1f, 1f,
DISPLAY_CASE_BREAK,
DISPLAY_CASE_STEP,
DISPLAY_CASE_PLACE,
DISPLAY_CASE_HIT,
DISPLAY_CASE_STEP
)
private fun create(name: String): SoundEvent = this.create(name, SoundEvent.of(cobblemonResource(name)))
}
@@ -32,7 +32,14 @@ object CobblemonTradeOffers {
* @return The resulting list.
*/
fun tradeOffersFor(profession: VillagerProfession): List<VillagerTradeOffer> = when (profession) {
VillagerProfession.FARMER -> listOf(VillagerTradeOffer(VillagerProfession.FARMER, 3, listOf(TradeOffers.SellItemFactory(CobblemonItems.VIVICHOKE_SEEDS, 24, 1, 1, 6))))
VillagerProfession.FARMER -> listOf(
VillagerTradeOffer(VillagerProfession.FARMER, 3, listOf(TradeOffers.SellItemFactory(CobblemonItems.VIVICHOKE_SEEDS, 24, 1, 1, 6)))
)
VillagerProfession.FISHERMAN -> listOf(
VillagerTradeOffer(VillagerProfession.FISHERMAN, 5, listOf(
TradeOffers.SellItemFactory(CobblemonItems.POKEROD_SMITHING_TEMPLATE, 12, 3, 30)
))
)
else -> emptyList()
}
@@ -113,6 +113,21 @@ object CobblemonCriteria {
)
)
val CAST_POKE_ROD = this.create(
SimpleCriterionTrigger(
cobblemonResource("cast_poke_rod"),
CastPokeRodCriterionCondition::class.java
)
)
// Advancement criteria for [grow_tumblestone.json]
val PLANT_TUMBLESTONE = this.create(
SimpleCriterionTrigger(
cobblemonResource("plant_tumblestone"),
PlantTumblestoneCriterionCondition::class.java
)
)
private fun <T : Criterion<*>> create(criteria: T): T = Cobblemon.implementation.registerCriteria(criteria)
}
@@ -0,0 +1,30 @@
/*
* 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.advancement.criterion
import com.google.gson.JsonObject
import net.minecraft.predicate.entity.LootContextPredicate
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.Identifier
class CastPokeRodCriterionCondition(id: Identifier, predicate: LootContextPredicate): SimpleCriterionCondition<Boolean>(id, predicate) {
var hasBait: Boolean = false
override fun toJson(json: JsonObject) {
json.addProperty("hasBait", hasBait)
}
override fun fromJson(json: JsonObject) {
hasBait = json.get("hasBait").asBoolean
}
override fun matches(player: ServerPlayerEntity, context: Boolean): Boolean {
return hasBait == context
}
}
@@ -0,0 +1,52 @@
/*
* 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.advancement.criterion
import com.cobblemon.mod.common.block.TumblestoneBlock
import com.google.gson.JsonObject
import net.minecraft.predicate.entity.LootContextPredicate
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.Identifier
import net.minecraft.util.math.BlockPos
/**
* A criterion condition for when a tumblestone block is planted
* @param id The identifier of the criterion
* @param predicate The predicate for the criterion
*
* @author Aethen
* @since 02/28/2024
*/
class PlantTumblestoneCriterionCondition(id: Identifier, predicate: LootContextPredicate) :
SimpleCriterionCondition<PlantTumblestoneContext>(id, predicate) {
override fun toJson(json: JsonObject) {
// Add properties to json if needed. None needed for this criterion
}
override fun fromJson(json: JsonObject) {
// Parse properties from json if needed. None needed for this criterion
}
/**
* Checks if the tumblestone block can grow at the given position
* @param player The player that planted the tumblestone block
* @param context The context of the criterion
* @return True if the tumblestone block can grow at the given position, false otherwise
*/
override fun matches(player: ServerPlayerEntity, context: PlantTumblestoneContext): Boolean {
return context.tumbleStoneBlock.canGrow(context.pos, player.world)
}
}
/**
* The context of the [PlantTumblestoneCriterionCondition]
* @param pos The position of the tumblestone block
* @param tumbleStoneBlock The tumblestone block
*/
open class PlantTumblestoneContext(var pos: BlockPos, var tumbleStoneBlock: TumblestoneBlock)
@@ -9,6 +9,7 @@
package com.cobblemon.mod.common.api.abilities
import com.cobblemon.mod.common.api.Priority
import com.cobblemon.mod.common.pokemon.Pokemon
import com.cobblemon.mod.common.util.DataKeys
import com.google.gson.JsonObject
import net.minecraft.nbt.NbtCompound
@@ -21,7 +22,7 @@ import net.minecraft.nbt.NbtCompound
* @author Qu
* @since January 9th, 2022
*/
open class Ability internal constructor(var template: AbilityTemplate, var forced: Boolean) {
open class Ability internal constructor(var template: AbilityTemplate, forced: Boolean) {
val name: String
get() = template.name
@@ -34,16 +35,26 @@ open class Ability internal constructor(var template: AbilityTemplate, var force
/**
* This represents the last known index of this backing ability in the species data.
* If -1 the ability will attempt to find the correct index or reroll itself, this is done in order to be compatible with existing data
* The value can be mutated however this is not recommended by API users.
* @see [Pokemon.updateAbility].
*/
var forced: Boolean = forced
internal set
/**
* This represents the last known index of this backing ability in the species data.
*
* @see [Pokemon.updateAbility].
*/
var index: Int = -1
internal set
/**
* The last known priority of this ability in the species data.
* The value can be mutated however this is not recommended by API users.
*
* @see [Pokemon.updateAbility].
*/
var priority = Priority.LOWEST
internal set
open fun saveToNBT(nbt: NbtCompound): NbtCompound {
nbt.putString(DataKeys.POKEMON_ABILITY_NAME, name)
@@ -62,19 +73,23 @@ open class Ability internal constructor(var template: AbilityTemplate, var force
}
open fun loadFromNBT(nbt: NbtCompound): Ability {
forced = nbt.getBoolean(DataKeys.POKEMON_ABILITY_FORCED)
this.template = Abilities.getOrException(nbt.getString(DataKeys.POKEMON_ABILITY_NAME))
this.forced = nbt.getBoolean(DataKeys.POKEMON_ABILITY_FORCED)
if (nbt.contains(DataKeys.POKEMON_ABILITY_INDEX) && nbt.contains(DataKeys.POKEMON_ABILITY_PRIORITY)) {
this.index = nbt.getInt(DataKeys.POKEMON_ABILITY_INDEX)
this.priority = Priority.valueOf(nbt.getString(DataKeys.POKEMON_ABILITY_PRIORITY))
}
return this
}
open fun loadFromJSON(json: JsonObject): Ability {
forced = json.get(DataKeys.POKEMON_ABILITY_FORCED)?.asBoolean ?: false
this.template = Abilities.getOrException(json.get(DataKeys.POKEMON_ABILITY_NAME).asString)
this.forced = json.get(DataKeys.POKEMON_ABILITY_FORCED)?.asBoolean ?: false
if (json.has(DataKeys.POKEMON_ABILITY_INDEX) && json.has(DataKeys.POKEMON_ABILITY_PRIORITY)) {
this.index = json.get(DataKeys.POKEMON_ABILITY_INDEX).asInt
this.priority = Priority.valueOf(json.get(DataKeys.POKEMON_ABILITY_PRIORITY).asString)
}
return this
}
}
@@ -28,7 +28,6 @@ class AbilityTemplate(
*/
fun create(forced: Boolean = false) = builder(this, forced)
/**
* Returns the Ability and loads the given NBT Tag into it.
*
@@ -42,4 +41,5 @@ class AbilityTemplate(
* Ability extensions need to write and read their needed data from here.
*/
fun create(json: JsonObject) = create().loadFromJSON(json)
}
@@ -135,28 +135,31 @@ class BattleMessage(rawMessage: String) {
return this.actorAndActivePokemon(pnx, battle)
}
/*
Example:
|-curestatus|p1: a8e5710e-6835-4387-99d3-331b45f848e6|slp|[msg]
|-curestatus|p1: 0686b20d-3019-4167-92e2-786834245743|slp|[msg]
// Function used to grab BattlePokemon (As we need to be able to grab non active pokemon to cure their status)
// by using playerNumber(actorID) and pokemon uuid(pokemonID)
/**
* Queries an argument at the given [index] for a 'pnx' and uuid that will be parsed into a [BattlePokemon].
*
* @param index The index of the argument referencing the [BattlePokemon].
* @param battle The [PokemonBattle] being queried.
* @return The [BattlePokemon] if the argument exists and is successfully parsed; otherwise null.
*/
fun getBattlePokemon(index: Int, battle: PokemonBattle): BattlePokemon? {
val actorAndPokemonID = this.argumentAt(index)?.takeIf { it.length >= 2 }?.split(": ") ?: return null
if (actorAndPokemonID.count() < 2) return null
val actorID = actorAndPokemonID[0]
val pokemonID = actorAndPokemonID[1]
return this.getBattlePokemon(actorID, pokemonID, battle)
fun battlePokemon(index: Int, battle: PokemonBattle): BattlePokemon? {
val (actorID, pokemonID) = this.pnxAndUuid(index) ?: return null
return this.battlePokemon(actorID, pokemonID, battle)
}
fun getSourceBattlePokemon(battle: PokemonBattle): BattlePokemon? {
val sourcePokemonArgument = this.optionalArguments.get("of") ?: return null
val actorAndPokemonID = sourcePokemonArgument.takeIf { it.length >= 2 }?.split(": ") ?: return null
if (actorAndPokemonID.count() < 2) return null
val actorID = actorAndPokemonID[0]
val pokemonID = actorAndPokemonID[1]
return this.getBattlePokemon(actorID, pokemonID, battle)
/**
* Queries an optional argument identified by [optionalArg] for a 'pnx' and uuid that will be parsed into a [BattlePokemon].
*
* @param optionalArg The id of the optional argument referencing the [BattlePokemon].
* @param battle The [PokemonBattle] being queried.
* @return The [BattlePokemon] if the argument exists and is successfully parsed; otherwise null.
*/
fun battlePokemonFromOptional(battle: PokemonBattle, optionalArg: String = "of"): BattlePokemon? {
val optional = this.optionalArguments.get(optionalArg) ?: return null
val pokemonID = optional.takeIf { it.length >= 2 }?.split(":")?.takeIf { it.size == 2 } ?: return null
val pnx = pokemonID[0].takeIf { it.matches(PNX_MATCHER) || it.matches(PN_MATCHER) } ?: return null
val uuid = pokemonID[1].trim()
return this.battlePokemon(pnx, uuid, battle)
}
/**
@@ -167,7 +170,7 @@ class BattleMessage(rawMessage: String) {
*/
fun pnxAndUuid(index: Int): Pair<String, String>? {
val argument = this.argumentAt(index)?.takeIf { it.length >= 2 }?.split(":")?.takeIf { it.size == 2 } ?: return null
val pnx = argument[0].takeIf { it.matches(PNX_MATCHER) } ?: return null
val pnx = argument[0].takeIf { it.matches(PNX_MATCHER) || it.matches(PN_MATCHER) } ?: return null
val uuid = argument[1].trim()
return pnx to uuid
}
@@ -234,7 +237,7 @@ class BattleMessage(rawMessage: String) {
null
}
private fun getBattlePokemon(pnx: String, pokemonID: String, battle: PokemonBattle): BattlePokemon? = try {
private fun battlePokemon(pnx: String, pokemonID: String, battle: PokemonBattle): BattlePokemon? = try {
battle.getBattlePokemon(pnx, pokemonID)
} catch (_: Exception) {
null
@@ -8,13 +8,12 @@
package com.cobblemon.mod.common.api.battles.model
import com.bedrockk.molang.runtime.MoLangEnvironment
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.Cobblemon.LOGGER
import com.cobblemon.mod.common.CobblemonNetwork
import com.cobblemon.mod.common.Environment
import com.cobblemon.mod.common.api.battles.interpreter.BattleMessage
import com.cobblemon.mod.common.api.battles.model.actor.ActorType
import com.cobblemon.mod.common.api.battles.model.actor.BattleActor
@@ -22,7 +21,7 @@ import com.cobblemon.mod.common.api.battles.model.actor.EntityBackedBattleActor
import com.cobblemon.mod.common.api.battles.model.actor.FleeableBattleActor
import com.cobblemon.mod.common.api.events.CobblemonEvents
import com.cobblemon.mod.common.api.events.battles.BattleFledEvent
import com.cobblemon.mod.common.api.molang.MoLangFunctions.addFunction
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asMoLangValue
import com.cobblemon.mod.common.api.molang.MoLangFunctions.getQueryStruct
import com.cobblemon.mod.common.api.net.NetworkPacket
import com.cobblemon.mod.common.api.tags.CobblemonItemTags
@@ -41,17 +40,19 @@ import com.cobblemon.mod.common.battles.dispatch.WaitDispatch
import com.cobblemon.mod.common.battles.interpreter.ContextManager
import com.cobblemon.mod.common.battles.pokemon.BattlePokemon
import com.cobblemon.mod.common.battles.runner.ShowdownService
import com.cobblemon.mod.common.battles.ForfeitActionResponse
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.net.messages.client.battle.BattleEndPacket
import com.cobblemon.mod.common.net.messages.client.battle.BattleMessagePacket
import com.cobblemon.mod.common.net.messages.client.battle.BattleMusicPacket
import com.cobblemon.mod.common.pokemon.evolution.progress.DefeatEvolutionProgress
import com.cobblemon.mod.common.pokemon.evolution.progress.LastBattleCriticalHitsEvolutionProgress
import com.cobblemon.mod.common.pokemon.evolution.requirements.DefeatRequirement
import com.cobblemon.mod.common.util.battleLang
import com.cobblemon.mod.common.util.getPlayer
import com.cobblemon.mod.common.util.withQueryValue
import java.io.File
import java.util.UUID
import java.util.concurrent.CompletableFuture
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.text.Text
import java.util.concurrent.ConcurrentLinkedDeque
@@ -70,6 +71,10 @@ open class PokemonBattle(
) {
/** Whether logging will be silenced for this battle. */
var mute = true
val struct = this.asMoLangValue()
val runtime = MoLangRuntime().also { it.environment.structs["query"] = struct }
val onEndHandlers: MutableList<(PokemonBattle) -> Unit> = mutableListOf()
init {
side1.battle = this
@@ -101,12 +106,19 @@ open class PokemonBattle(
val battleLog = mutableListOf<String>()
val chatLog = mutableListOf<Text>()
var started = false
var winners = listOf<BattleActor>()
var losers = listOf<BattleActor>()
var ended = false
// TEMP battle showcase stuff
var announcingRules = false
var turn: Int = 1
private set
private var ticks: Int = 0
set(value) { field = value.coerceAtMost(Int.MAX_VALUE) } // go outside
/** The current duration of the battle in seconds. */
val time: Int get() = ticks % 20
var dispatchResult = GO
val dispatches = ConcurrentLinkedDeque<BattleDispatch>()
@@ -166,7 +178,7 @@ open class PokemonBattle(
fun getActor(player: ServerPlayerEntity) = actors.firstOrNull { it.isForPlayer(player) }
/**
* Gets a BattleActor and an [ActiveBattlePokemon] from a pnx key, e.g. p2a
* Gets a [BattleActor] and an [ActiveBattlePokemon] from a pnx key, e.g. p2a
*
* Returns null if either the pn or x is invalid.
*/
@@ -179,6 +191,11 @@ open class PokemonBattle(
return actor to pokemon
}
/**
* Gets a [BattlePokemon] from a pnx key and uuid.
*
* Returns null if the pnx key is invalid or the uuid does not exist.
*/
fun getBattlePokemon(pnx: String, pokemonID: String): BattlePokemon {
val actor = actors.find { it.showdownId == pnx.substring(0, 2) }
?: throw IllegalStateException("Invalid pnx: $pnx - unknown actor")
@@ -260,6 +277,7 @@ open class PokemonBattle(
}
sendUpdate(BattleEndPacket())
BattleRegistry.closeBattle(this)
onEndHandlers.forEach { it(this) }
}
fun finishCaptureAction(captureAction: BattleCaptureAction) {
@@ -347,6 +365,14 @@ open class PokemonBattle(
}
}
fun dispatchFuture(future: () -> CompletableFuture<*>) {
val dispatch = BattleDispatch {
val generatedFuture = future()
return@BattleDispatch DispatchResult { generatedFuture.isDone }
}
dispatches.add(dispatch)
}
fun dispatchInsert(dispatcher: () -> Iterable<BattleDispatch>) {
dispatch {
val newDispatches = dispatcher()
@@ -390,8 +416,9 @@ open class PokemonBattle(
return
}
if (started && isPvW && !ended && dispatches.isEmpty()) {
checkFlee()
if (started) {
ticks++
if (isPvW && !ended && dispatches.isEmpty()) checkFlee()
}
}
@@ -433,13 +460,24 @@ open class PokemonBattle(
}
fun checkForInputDispatch() {
val readyToInput = actors.any { !it.mustChoose && it.responses.isNotEmpty() } && actors.none { it.mustChoose }
if (checkForfeit()) return // ignore actors that are still choosing, their choices don't matter anymore
val readyToInput = (actors.any { !it.mustChoose && it.responses.isNotEmpty() } && actors.none { it.mustChoose })
if (readyToInput && captureActions.isEmpty()) {
actors.filter { it.responses.isNotEmpty() }.forEach { it.writeShowdownResponse() }
actors.forEach { it.responses.clear() ; it.request = null }
}
}
/** Forces Showdown to end the battle when a [BattleActor] chooses to forfeit. */
private fun checkForfeit(): Boolean {
val forfeit = actors.find { it.responses.any { it is ForfeitActionResponse } }
return forfeit?.let {
this.dispatchWaiting { this.broadcastChatMessage(battleLang("forfeit", it.getName()).red()) }
writeShowdownAction(">forcelose ${it.showdownId}")
true
} ?: false
}
/**
* Creates a [Text] representation of an error to interpret a battle message.
* This also logs the error, the goal of this function is to make sure users see missing interpretations and report them to us.
@@ -145,4 +145,7 @@ abstract class BattleActor(
}
open fun awardExperience(battlePokemon: BattlePokemon, experience: Int) {}
open fun sendUpdate(packet: NetworkPacket<*>) {}
open fun win(otherWinners: List<BattleActor>, losers: List<BattleActor>) {}
open fun lose(winners: List<BattleActor>, otherLosers: List<BattleActor>) {}
}
@@ -27,10 +27,13 @@ object DialogueManager {
val activeDialogues = mutableMapOf<UUID, ActiveDialogue>()
fun startDialogue(playerEntity: ServerPlayerEntity, dialogue: Dialogue) {
val activeDialogue = ActiveDialogue(playerEntity, dialogue)
activeDialogues[playerEntity.uuid] = activeDialogue
val packet = DialogueOpenedPacket(activeDialogue, includeFaces = true)
playerEntity.sendPacket(packet)
startDialogue(ActiveDialogue(playerEntity, dialogue))
}
fun startDialogue(activeDialogue: ActiveDialogue) {
activeDialogues[activeDialogue.playerEntity.uuid] = activeDialogue
val packet = DialogueOpenedPacket(activeDialogue, true)
activeDialogue.playerEntity.sendPacket(packet)
}
fun stopDialogue(playerEntity: ServerPlayerEntity) {
@@ -12,6 +12,7 @@ import com.google.gson.JsonDeserializationContext
import com.google.gson.JsonDeserializer
import com.google.gson.JsonElement
import com.google.gson.JsonObject
import com.google.gson.JsonPrimitive
import com.google.gson.JsonSerializationContext
import com.google.gson.JsonSerializer
import java.lang.reflect.Type
@@ -28,6 +29,10 @@ object EntityDimensionsAdapter : JsonSerializer<EntityDimensions>, JsonDeseriali
const val WIDTH = "width"
const val HEIGHT = "height"
val templates = mutableMapOf(
"player" to { EntityDimensions(0.6F, 1.8F, false) }
)
override fun serialize(dimensions: EntityDimensions, type: Type, ctx: JsonSerializationContext): JsonElement {
val json = JsonObject()
json.addProperty(WIDTH, dimensions.width)
@@ -36,6 +41,9 @@ object EntityDimensionsAdapter : JsonSerializer<EntityDimensions>, JsonDeseriali
}
override fun deserialize(json: JsonElement, type: Type, ctx: JsonDeserializationContext): EntityDimensions {
if (json is JsonPrimitive) {
return templates[json.asString]?.invoke() ?: throw IllegalStateException("Dimensions provided by template name $json but no such template is set.")
}
json as JsonObject
return EntityDimensions(json.get(WIDTH).asFloat, json.get(HEIGHT).asFloat, false)
}
@@ -8,6 +8,7 @@
package com.cobblemon.mod.common.api.entity
import com.bedrockk.molang.runtime.struct.QueryStruct
import net.minecraft.entity.Entity
import net.minecraft.entity.data.TrackedData
@@ -18,4 +19,5 @@ interface EntitySideDelegate<T : Entity> {
fun initialize(entity: T) {}
fun tick(entity: T) {}
fun onTrackedDataSet(data: TrackedData<*>) {}
fun addToStruct(struct: QueryStruct) {}
}
@@ -0,0 +1,19 @@
/*
* 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.entity
import com.cobblemon.mod.common.entity.npc.NPCEntity
/**
* A delegate for some actions that can be different for an NPC on client versus server.
*
* @author Hiroku
* @since August 25th, 2023
*/
interface NPCSideDelegate : EntitySideDelegate<NPCEntity>
@@ -0,0 +1,25 @@
/*
* 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.entity
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import java.util.concurrent.CompletableFuture
/**
* Interface for custom entities that can send out and recall Pokémon. They get notified
* when either of those actions are occurring.
*
* @author Hiroku
* @since August 25th, 2023
*
*/
interface PokemonSender {
fun sendingOut(): CompletableFuture<Unit>
fun recalling(pokemonEntity: PokemonEntity): CompletableFuture<Unit>
}
@@ -0,0 +1,97 @@
/*
* 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.entity.pokemon
import com.cobblemon.mod.common.api.pokemon.PokemonProperties
import com.cobblemon.mod.common.api.pokemon.PokemonSpecies
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.entity.pokemon.effects.IllusionEffect
import com.cobblemon.mod.common.entity.pokemon.effects.TransformEffect
import com.cobblemon.mod.common.pokemon.FormData
import com.cobblemon.mod.common.pokemon.Species
import com.cobblemon.mod.common.util.DataKeys
import com.cobblemon.mod.common.util.asIdentifierDefaultingNamespace
import net.minecraft.nbt.NbtCompound
import java.util.concurrent.CompletableFuture
import kotlin.reflect.KClass
/**
* Represents a temporary alteration to how a [PokemonEntity] is rendered and behaves. May include a temporary visual effect
* when applied.
*
* @author Segfault Guy
* @since March 5th, 2024
*/
interface EntityEffect {
/**
* Starts this effect for the provided [PokemonEntity].
*
* @return A [CompletableFuture] that completes after the effect has been applied. Or null if the effect failed to start.
*/
fun start(entity: PokemonEntity): CompletableFuture<PokemonEntity>?
/**
* Ends this effect for the provided [PokemonEntity].
*
* @return A [CompletableFuture] that completes after the effect has been reverted. Or null if the effect failed to end.
*/
fun end(entity: PokemonEntity): CompletableFuture<PokemonEntity>?
/** Saves this effect to NBT. */
fun saveToNbt(): NbtCompound
/** Loads this effect from NBT. */
fun loadFromNBT(nbt: NbtCompound)
companion object {
private val effects = mutableMapOf<String, KClass<out EntityEffect>>()
private val defaults = mutableMapOf<String, () -> EntityEffect>()
init {
register(IllusionEffect.ID, IllusionEffect::class, ::IllusionEffect)
register(TransformEffect.ID, TransformEffect::class, ::TransformEffect)
}
fun <T : EntityEffect> register(id: String, type: KClass<T>, default: () -> T) {
effects[id] = type
defaults[id] = default
}
fun createDefault(id: String): EntityEffect? = defaults[id]?.invoke()
fun loadFromNbt(nbt: NbtCompound): EntityEffect? {
if (nbt.contains(DataKeys.ENTITY_EFFECT_ID)) {
val id = nbt.getString(DataKeys.ENTITY_EFFECT_ID)
return createDefault(id)?.also { it.loadFromNBT(nbt) }
}
return null
}
}
}
/** An [EntityEffect] that modifies the dimensions of a [PokemonEntity]. */
interface PhysicalEffect : EntityEffect {
val scale: Float
}
/** An [EntityEffect] that alters the physical appearance of a [PokemonEntity] to match a [mock]. */
interface MocKEffect : PhysicalEffect {
val mock: PokemonProperties
val exposedSpecies: Species?
get() = this.mock.species?.let { PokemonSpecies.getByIdentifier(it.asIdentifierDefaultingNamespace()) }
val exposedForm: FormData?
get() = this.mock.form?.let {
formID -> this.exposedSpecies?.forms?.firstOrNull { it.formOnlyShowdownId().equals(formID, true) } }
?: this.exposedSpecies?.standardForm
}
@@ -8,12 +8,23 @@
package com.cobblemon.mod.common.api.events.pokemon
import com.bedrockk.molang.runtime.value.MoValue
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asMoLangValue
import com.cobblemon.mod.common.entity.pokeball.EmptyPokeBallEntity
import com.cobblemon.mod.common.pokemon.Pokemon
import com.cobblemon.mod.common.util.itemRegistry
import net.minecraft.registry.RegistryKeys
import net.minecraft.server.network.ServerPlayerEntity
data class PokemonCapturedEvent (
val pokemon: Pokemon,
val player: ServerPlayerEntity,
val pokeBallEntity: EmptyPokeBallEntity
)
) {
val context = mapOf<String, MoValue>(
"pokemon" to pokemon.struct,
"player" to player.asMoLangValue(),
"poke_ball" to pokeBallEntity.struct,
"item" to player.world.itemRegistry.getEntry(pokeBallEntity.pokeBall.item).asMoLangValue(RegistryKeys.ITEM)
)
}
@@ -0,0 +1,84 @@
/*
* 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.fishing
import com.cobblemon.mod.common.util.cobblemonResource
import net.minecraft.util.Identifier
import net.minecraft.nbt.NbtCompound
import net.minecraft.nbt.NbtList
import net.minecraft.nbt.NbtString
data class FishingBait(
val item: Identifier,
val effects: List<Effect>,
) {
data class Effect(
val type: Identifier,
val subcategory: Identifier?,
val chance: Double = 0.0,
val value: Double = 0.0
) {
fun toNbt(): NbtCompound {
val nbt = NbtCompound()
nbt.putString("Type", type.toString())
subcategory?.let { nbt.putString("Subcategory", it.toString()) }
nbt.putDouble("Chance", chance)
nbt.putDouble("Value", value)
return nbt
}
companion object {
fun fromNbt(nbt: NbtCompound): Effect {
val type = Identifier(nbt.getString("Type"))
val subcategory = if (nbt.contains("Subcategory")) Identifier(nbt.getString("Subcategory")) else null
val chance = nbt.getDouble("Chance")
val value = nbt.getDouble("Value")
return Effect(type, subcategory, chance, value)
}
}
}
fun toNbt(): NbtCompound {
val nbt = NbtCompound()
nbt.putString("Item", item.toString())
val effectsList = NbtList()
effects.forEach { effectsList.add(it.toNbt()) }
nbt.put("Effects", effectsList)
return nbt
}
companion object {
fun fromNbt(nbt: NbtCompound): FishingBait {
val item = Identifier(nbt.getString("Item"))
val effectsList = nbt.getList("Effects", 10) // 10 is the type for NbtCompound
val effects = mutableListOf<Effect>()
for (i in 0 until effectsList.size) {
effects.add(Effect.fromNbt(effectsList.getCompound(i)))
}
return FishingBait(item, effects)
}
}
object Effects {
val NATURE = cobblemonResource("nature")
val IV = cobblemonResource("iv")
val EV = cobblemonResource("ev")
val BITE_TIME = cobblemonResource("bite_time")
val GENDER_CHANCE = cobblemonResource("gender_chance")
val LEVEL_RAISE = cobblemonResource("level_raise")
val TERA = cobblemonResource("tera")
val SHINY_REROLL = cobblemonResource("shiny_reroll")
val HIDDEN_ABILITY_CHANCE = cobblemonResource("ha_chance")
val POKEMON_CHANCE = cobblemonResource("pokemon_chance")
val FRIENDSHIP = cobblemonResource("friendship")
val INERT = cobblemonResource("inert")
}
}
@@ -0,0 +1,105 @@
/*
* 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.fishing
import com.cobblemon.mod.common.api.data.JsonDataRegistry
import com.cobblemon.mod.common.api.reactive.SimpleObservable
import com.cobblemon.mod.common.net.messages.client.fishing.FishingBaitRegistrySyncPacket
import com.cobblemon.mod.common.util.adapters.IdentifierAdapter
import com.cobblemon.mod.common.util.cobblemonResource
import com.google.gson.Gson
import com.google.gson.GsonBuilder
import com.google.gson.reflect.TypeToken
import net.minecraft.item.ItemStack
import net.minecraft.registry.Registries
import net.minecraft.resource.ResourceType
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.Identifier
object FishingBaits : JsonDataRegistry<FishingBait>{
override val id = cobblemonResource("fishing_baits")
override val type = ResourceType.SERVER_DATA
override val observable = SimpleObservable<FishingBaits>()
override val typeToken: TypeToken<FishingBait> = TypeToken.get(FishingBait::class.java)
override val resourcePath = "fishing_baits"
override val gson: Gson = GsonBuilder()
.registerTypeAdapter(Identifier::class.java, IdentifierAdapter)
.setPrettyPrinting()
.create()
private val itemMap = mutableMapOf<Identifier, FishingBait>()
override fun sync(player: ServerPlayerEntity) {
FishingBaitRegistrySyncPacket(this.itemMap.values.toList()).sendToPlayer(player)
}
override fun reload(data: Map<Identifier, FishingBait>) {
itemMap.clear()
data.forEach { id, bait ->
itemMap[bait.item] = bait
}
}
fun getFromItemStack(stack: ItemStack): FishingBait? {
return itemMap[Registries.ITEM.getId(stack.item)]
}
fun isFishingBait(stack: ItemStack) = itemMap.containsKey(Registries.ITEM.getId(stack.item))
//
//
// fun getBaitSubcategory(item: ItemStack): String? {
// val itemId = Registries.ITEM.getId(item.item)
// if (itemId in itemMap.keys) {
// return itemMap[itemId]?.subcategory
// }
// val tag = tagMap.keys.firstOrNull { it.fits(item.item, Registries.ITEM) }
// if (tag != null) {
// return tagMap[tag]?.subcategory
// }
// return null
// }
//
// fun getBaitSuccessChance(item: ItemStack): Double? {
// val itemId = Registries.ITEM.getId(item.item)
// if (itemId in itemMap.keys) {
// return itemMap[itemId]?.chance
// }
// val tag = tagMap.keys.firstOrNull { it.fits(item.item, Registries.ITEM) }
// if (tag != null) {
// return tagMap[tag]?.chance
// }
// return null
// }
//
// fun getBaitEffectValue(item: ItemStack): Double? {
// val itemId = Registries.ITEM.getId(item.item)
// if (itemId in itemMap.keys) {
// return itemMap[itemId]?.value
// }
// val tag = tagMap.keys.firstOrNull { it.fits(item.item, Registries.ITEM) }
// if (tag != null) {
// return tagMap[tag]?.value
// }
// return null
// }
//
//
// fun getBaitNote(item: ItemStack): String? {
// val itemId = Registries.ITEM.getId(item.item)
// if (itemId in itemMap.keys) {
// return itemMap[itemId]?.note
// }
// val tag = tagMap.keys.firstOrNull { it.fits(item.item, Registries.ITEM) }
// if (tag != null) {
// return tagMap[tag]?.note
// }
// return null
// }
}
@@ -0,0 +1,48 @@
/*
* 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.fishing
import com.cobblemon.mod.common.api.pokeball.PokeBalls
import com.cobblemon.mod.common.pokeball.PokeBall
import net.minecraft.network.PacketByteBuf
import net.minecraft.util.Identifier
/**
* Base poke rod object
* It is intended that there is one poke rod object initialized for a given poke rod type.
*
* @property name the poke rod registry name
* @property pokeBallId The [Identifier] of the pokeball that is used as the bobber for this rod
* @property lineColor list of [RGB] values that apply to the fishing line of the Pokérod
*/
data class PokeRod(
val pokeBallId: Identifier,
//Hex string of color
val lineColor: String,
var name: Identifier?
) {
internal fun encode(buffer: PacketByteBuf) {
buffer.writeIdentifier(name)
buffer.writeIdentifier(pokeBallId)
buffer.writeString(lineColor)
}
companion object {
internal fun decode(buffer: PacketByteBuf): PokeRod {
val name = buffer.readIdentifier()
val pokeBallId = buffer.readIdentifier()
val lineColor = buffer.readString()
return PokeRod(pokeBallId, lineColor, name)
}
}
fun getPokeBall(): PokeBall? {
return PokeBalls.getPokeBall(pokeBallId)
}
}
@@ -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.api.fishing
import com.cobblemon.mod.common.api.data.JsonDataRegistry
import com.cobblemon.mod.common.api.reactive.SimpleObservable
import com.cobblemon.mod.common.net.messages.client.data.PokeRodRegistrySyncPacket
import com.cobblemon.mod.common.util.adapters.IdentifierAdapter
import com.cobblemon.mod.common.util.cobblemonResource
import com.google.gson.Gson
import com.google.gson.GsonBuilder
import com.google.gson.reflect.TypeToken
import net.minecraft.resource.ResourceType
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.Identifier
/**
* The data registry for [PokeRod]s.
* All the pokerod fields are guaranteed to exist
*/
object PokeRods : JsonDataRegistry<PokeRod> {
override val id = cobblemonResource("pokerods")
override val type = ResourceType.SERVER_DATA
override val observable = SimpleObservable<PokeRods>()
// ToDo once datapack pokerod is implemented add required adapters here
override val gson: Gson = GsonBuilder()
.disableHtmlEscaping()
.registerTypeAdapter(Identifier::class.java, IdentifierAdapter)
.setPrettyPrinting()
.create()
override val typeToken: TypeToken<PokeRod> = TypeToken.get(PokeRod::class.java)
override val resourcePath = "pokerods"
private val rods = mutableMapOf<Identifier, PokeRod>()
override fun reload(data: Map<Identifier, PokeRod>) {
data.forEach {
it.value.name = it.key
rods[it.key] = it.value
}
this.observable.emit(this)
}
override fun sync(player: ServerPlayerEntity) {
PokeRodRegistrySyncPacket(rods.values).sendToPlayer(player)
}
/**
* Gets a Pokerod from registry name.
* @return the pokerod object if found otherwise null.
*/
fun getPokeRod(name : Identifier): PokeRod? = rods[name]
}
@@ -10,12 +10,11 @@ package com.cobblemon.mod.common.api.gui
import com.cobblemon.mod.common.api.text.font
import com.cobblemon.mod.common.client.gui.battle.BattleOverlay.Companion.PORTRAIT_DIAMETER
import com.cobblemon.mod.common.client.render.models.blockbench.PoseableEntityModel
import com.cobblemon.mod.common.client.render.models.blockbench.PoseableEntityState
import com.cobblemon.mod.common.client.render.models.blockbench.repository.PokemonModelRepository
import com.cobblemon.mod.common.client.render.models.blockbench.repository.RenderContext
import com.cobblemon.mod.common.client.render.models.blockbench.repository.VaryingModelRepository
import com.cobblemon.mod.common.entity.PoseType
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.pokemon.Species
import com.mojang.blaze3d.platform.GlStateManager
import com.mojang.blaze3d.systems.RenderSystem
import net.minecraft.client.MinecraftClient
@@ -29,14 +28,17 @@ import net.minecraft.client.render.Tessellator
import net.minecraft.client.render.VertexFormat
import net.minecraft.client.render.VertexFormats
import net.minecraft.client.util.math.MatrixStack
import net.minecraft.entity.Entity
import net.minecraft.text.MutableText
import net.minecraft.text.OrderedText
import net.minecraft.text.Text
import net.minecraft.util.Identifier
import net.minecraft.util.math.RotationAxis
import org.joml.Matrix4f
import org.joml.Quaternionf
import org.joml.Vector3f
@JvmOverloads
fun blitk(
matrixStack: MatrixStack,
texture: Identifier? = null,
@@ -100,6 +102,7 @@ fun drawRectangle(
BufferRenderer.drawWithGlobalProgram(bufferbuilder.end())
}
@JvmOverloads
fun drawCenteredText(
context: DrawContext,
font: Identifier? = null,
@@ -114,6 +117,7 @@ fun drawCenteredText(
context.drawText(textRenderer, comp, x.toInt() - textRenderer.getWidth(comp) / 2, y.toInt(), colour, shadow)
}
@JvmOverloads
fun drawText(
context: DrawContext,
font: Identifier? = null,
@@ -145,6 +149,7 @@ fun drawText(
return isHovered
}
@JvmOverloads
fun drawText(
context: DrawContext,
text: OrderedText,
@@ -163,6 +168,7 @@ fun drawText(
context.drawText(textRenderer, text, tweakedX.toInt(), y.toInt(), colour, shadow)
}
@JvmOverloads
fun drawString(
context: DrawContext,
text: String,
@@ -181,22 +187,30 @@ fun drawString(
context.drawText(textRenderer, comp, x.toInt(), y.toInt(), colour, shadow)
}
fun drawPortraitPokemon(
species: Species,
@JvmOverloads
fun <T : Entity, M : PoseableEntityModel<T>> drawPoseablePortrait(
identifier: Identifier,
aspects: Set<String>,
matrixStack: MatrixStack,
scale: Float = 13F,
contextScale: Float = 1F,
reversed: Boolean = false,
state: PoseableEntityState<PokemonEntity>? = null,
partialTicks: Float
state: PoseableEntityState<T>? = null,
repository: VaryingModelRepository<T, M>,
partialTicks: Float,
limbSwing: Float = 0F,
limbSwingAmount: Float = 0F,
ageInTicks: Float = 0F,
headYaw: Float = 0F,
headPitch: Float = 0F
) {
val model = PokemonModelRepository.getPoser(species.resourceIdentifier, aspects)
val texture = PokemonModelRepository.getTexture(species.resourceIdentifier, aspects, state?.animationSeconds ?: 0F)
val model = repository.getPoser(identifier, aspects)
val texture = repository.getTexture(identifier, aspects, state?.animationSeconds ?: 0F)
val context = RenderContext()
PokemonModelRepository.getTextureNoSubstitute(species.resourceIdentifier, aspects, 0f).let { it -> context.put(RenderContext.TEXTURE, it) }
context.put(RenderContext.SCALE, species.getForm(aspects).baseScale)
context.put(RenderContext.SPECIES, species.resourceIdentifier)
repository.getTextureNoSubstitute(identifier, aspects, 0f).let { context.put(RenderContext.TEXTURE, it) }
context.put(RenderContext.SCALE, contextScale)
context.put(RenderContext.SPECIES, identifier)
context.put(RenderContext.ASPECTS, aspects)
val renderType = model.getLayer(texture)
@@ -212,7 +226,7 @@ fun drawPortraitPokemon(
model.getPose(PoseType.PORTRAIT)?.let { state.setPose(it.poseName) }
state.timeEnteredPose = 0F
state.updatePartialTicks(partialTicks)
model.setupAnimStateful(null, state, 0F, 0F, 0F, 0F, 0F)
model.setupAnimStateful(null, state, limbSwing, limbSwingAmount, ageInTicks, headYaw, headPitch)
originalPose?.let { state.setPose(it) }
}
@@ -234,7 +248,7 @@ fun drawPortraitPokemon(
val buffer = immediate.getBuffer(renderType)
val packedLight = LightmapTextureManager.pack(11, 7)
model.withLayerContext(immediate, state, PokemonModelRepository.getLayers(species.resourceIdentifier, aspects)) {
model.withLayerContext(immediate, state, repository.getLayers(identifier, aspects)) {
model.render(context, matrixStack, buffer, packedLight, OverlayTexture.DEFAULT_UV, 1F, 1F, 1F, 1F)
immediate.draw()
}
@@ -242,5 +256,58 @@ fun drawPortraitPokemon(
matrixStack.pop()
model.setDefault()
DiffuseLighting.enableGuiDepthLighting()
}
fun <E : Entity, M : PoseableEntityModel<E>> drawProfile(
repository: VaryingModelRepository<E, M>,
resourceIdentifier: Identifier,
aspects: Set<String>,
matrixStack: MatrixStack,
state: PoseableEntityState<E>,
partialTicks: Float,
scale: Float = 20F
) {
val model = repository.getPoser(resourceIdentifier, aspects)
val texture = repository.getTexture(resourceIdentifier, aspects, state.animationSeconds)
val context = RenderContext()
repository.getTextureNoSubstitute(resourceIdentifier, aspects, 0f).let { context.put(RenderContext.TEXTURE, it) }
context.put(RenderContext.SCALE, 1F)
context.put(RenderContext.SPECIES, resourceIdentifier)
context.put(RenderContext.ASPECTS, aspects)
val renderType = model.getLayer(texture)
RenderSystem.applyModelViewMatrix()
matrixStack.scale(scale, scale, -scale)
model.getPose(PoseType.PROFILE)?.let { state.setPose(it.poseName) }
state.timeEnteredPose = 0F
state.updatePartialTicks(partialTicks)
model.setupAnimStateful(null, state, 0F, 0F, 0F, 0F, 0F)
matrixStack.translate(model.profileTranslation.x, model.profileTranslation.y, model.profileTranslation.z - 4.0)
matrixStack.scale(model.profileScale, model.profileScale, 1 / model.profileScale)
// matrixStack.multiply(rotation)
val quaternion1 = RotationAxis.POSITIVE_Y.rotationDegrees(-32F * if (false) -1F else 1F)
val quaternion2 = RotationAxis.POSITIVE_X.rotationDegrees(5F)
matrixStack.multiply(quaternion1)
matrixStack.multiply(quaternion2)
DiffuseLighting.method_34742()
val entityRenderDispatcher = MinecraftClient.getInstance().entityRenderDispatcher
entityRenderDispatcher.setRenderShadows(true)
val bufferSource = MinecraftClient.getInstance().bufferBuilders.entityVertexConsumers
val buffer = bufferSource.getBuffer(renderType)
val light1 = Vector3f(-1F, 1F, 1.0F)
val light2 = Vector3f(1.3F, -1F, 1.0F)
RenderSystem.setShaderLights(light1, light2)
val packedLight = LightmapTextureManager.pack(11, 7)
model.withLayerContext(bufferSource, state, repository.getLayers(resourceIdentifier, aspects)) {
model.render(context, matrixStack, buffer, packedLight, OverlayTexture.DEFAULT_UV, 1F, 1F, 1F, 1F)
bufferSource.draw()
}
model.setDefault()
entityRenderDispatcher.setRenderShadows(true)
DiffuseLighting.enableGuiDepthLighting()
}
@@ -0,0 +1,74 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.item.ability
import com.cobblemon.mod.common.api.abilities.*
import com.cobblemon.mod.common.item.interactive.ability.AbilityTypeChanger
import com.cobblemon.mod.common.pokemon.Pokemon
import com.cobblemon.mod.common.pokemon.abilities.HiddenAbility
import com.cobblemon.mod.common.pokemon.abilities.HiddenAbilityType
/**
* Represents a change operation for a [Pokemon.ability].
* This is backed by the associated [PotentialAbility].
*
* @param T The type of [PotentialAbility].
*/
interface AbilityChanger<T : PotentialAbility> {
/**
* The [PotentialAbilityType] of type [T].
*/
val type: PotentialAbilityType<T>
/**
* Collects all the possible targets for the [type] and the given [pokemon].
*
* @param pokemon The [Pokemon] being queried.
* @return A set containing all their legal abilities associated with [type], can be empty.
*/
fun queryPossible(pokemon: Pokemon): Set<AbilityTemplate>
/**
* Attempts to update the ability of the given [pokemon].
*
* @param pokemon The [Pokemon] attempting to change an ability.
* @return If the operation was successful.
*/
fun performChange(pokemon: Pokemon): Boolean
/**
* Checks if the current [PotentialAbilityType] of a [Pokemon.ability] is possible to swap from with this.
*
* @param type The [PotentialAbilityType] or null if the ability is forced and/or illegal.
* @return If the operation can be performed.
*/
fun canChangeFrom(type: PotentialAbilityType<*>?): Boolean
companion object {
/**
* An implementation of [AbilityChanger] for [CommonAbility].
*
* While this can be used in custom data scenarios this functions most "game-like" if the Pokémon only has 2 common abilities.
*/
@JvmStatic
val COMMON_ABILITY: AbilityChanger<CommonAbility> = AbilityTypeChanger(CommonAbilityType) { other -> other == CommonAbilityType }
/**
* An implementation of [AbilityChanger] for [HiddenAbility].
*
* While this can be used in custom data scenarios this functions most "game-like" if the Pokémon only has 1 hidden ability.
*/
@JvmStatic
val HIDDEN_ABILITY: AbilityChanger<HiddenAbility> = AbilityTypeChanger(HiddenAbilityType) { other -> other == CommonAbilityType || other == HiddenAbilityType }
}
}
@@ -19,8 +19,10 @@ import com.bedrockk.molang.runtime.value.MoValue
* @since October 22nd, 2023
*/
interface ExpressionLike {
override fun toString(): String
/** Produces a [MoValue] for a [MoLangRuntime] to supply an environment. */
fun resolve(runtime: MoLangRuntime): MoValue
fun resolve(runtime: MoLangRuntime, context: Map<String, MoValue> = emptyMap()): MoValue
fun getString(): String = toString()
fun resolveDouble(runtime: MoLangRuntime) = resolve(runtime).asDouble()
fun resolveFloat(runtime: MoLangRuntime) = resolveDouble(runtime).toFloat()
@@ -28,4 +30,5 @@ interface ExpressionLike {
fun resolveInt(runtime: MoLangRuntime) = resolveDouble(runtime).toInt()
fun resolveBoolean(runtime: MoLangRuntime) = resolveDouble(runtime) == 1.0
fun resolveObject(runtime: MoLangRuntime) = resolve(runtime) as ObjectValue<*>
}
@@ -10,6 +10,8 @@ package com.cobblemon.mod.common.api.molang
import com.bedrockk.molang.Expression
import com.bedrockk.molang.runtime.MoLangRuntime
import com.bedrockk.molang.runtime.value.MoValue
import com.cobblemon.mod.common.util.getString
import com.cobblemon.mod.common.util.resolve
/**
@@ -19,5 +21,6 @@ import com.cobblemon.mod.common.util.resolve
* @since October 22nd, 2023
*/
class ListExpression(val exprs: List<Expression>): ExpressionLike {
override fun resolve(runtime: MoLangRuntime) = exprs.resolve(runtime)
override fun toString() = exprs.joinToString("\n") { it.getString().let { if (it.endsWith(";")) it else "$it;" } }
override fun resolve(runtime: MoLangRuntime, context: Map<String, MoValue>) = exprs.resolve(runtime, context)
}
@@ -18,12 +18,27 @@ import com.bedrockk.molang.runtime.value.DoubleValue
import com.bedrockk.molang.runtime.value.MoValue
import com.bedrockk.molang.runtime.value.StringValue
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.api.battles.model.PokemonBattle
import com.cobblemon.mod.common.api.dialogue.PlayerDialogueFaceProvider
import com.cobblemon.mod.common.client.render.models.blockbench.wavefunction.WaveFunction
import com.cobblemon.mod.common.api.dialogue.ReferenceDialogueFaceProvider
import com.cobblemon.mod.common.api.scripting.CobblemonScripts
import com.cobblemon.mod.common.api.text.text
import com.cobblemon.mod.common.client.render.models.blockbench.wavefunction.WaveFunctions
import com.cobblemon.mod.common.entity.npc.NPCEntity
import com.cobblemon.mod.common.net.messages.client.effect.RunPosableMoLangPacket
import com.cobblemon.mod.common.util.asIdentifierDefaultingNamespace
import com.cobblemon.mod.common.util.getBooleanOrNull
import com.cobblemon.mod.common.util.getDoubleOrNull
import com.cobblemon.mod.common.util.isInt
import com.cobblemon.mod.common.util.itemRegistry
import com.cobblemon.mod.common.util.server
import com.cobblemon.mod.common.util.worldRegistry
import com.mojang.datafixers.util.Either
import net.minecraft.block.Block
import net.minecraft.entity.LivingEntity
import net.minecraft.entity.damage.DamageSource
import net.minecraft.entity.damage.DamageTypes
import net.minecraft.entity.player.PlayerEntity
import net.minecraft.nbt.NbtCompound
import net.minecraft.nbt.NbtDouble
import net.minecraft.nbt.NbtElement
@@ -35,6 +50,7 @@ import net.minecraft.registry.RegistryKeys
import net.minecraft.registry.entry.RegistryEntry
import net.minecraft.registry.tag.TagKey
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.server.world.ServerWorld
import net.minecraft.util.Identifier
import net.minecraft.world.World
import net.minecraft.world.biome.Biome
@@ -48,6 +64,11 @@ import net.minecraft.world.dimension.DimensionType
*/
object MoLangFunctions {
val generalFunctions = hashMapOf<String, java.util.function.Function<MoParams, Any>>(
"run_command" to java.util.function.Function { params ->
val command = params.getString(0)
val server = server() ?: return@Function DoubleValue(0)
server.commandManager.executeWithPrefix(server.commandSource, command)
},
"is_int" to java.util.function.Function { params -> DoubleValue(params.get<MoValue>(0).asString().isInt()) },
"is_number" to java.util.function.Function { params -> DoubleValue(params.get<MoValue>(0).asString().toDoubleOrNull() != null) },
"to_number" to java.util.function.Function { params -> DoubleValue(params.get<MoValue>(0).asString().toDoubleOrNull() ?: 0.0) },
@@ -75,23 +96,134 @@ object MoLangFunctions {
val array = ArrayStruct(hashMapOf())
values.forEachIndexed { index, moValue -> array.setDirectly("$index", moValue) }
return@Function array
},
"run_script" to java.util.function.Function { params ->
val runtime = MoLangRuntime()
runtime.environment.structs.putAll(params.environment.structs)
val script = params.getString(0).asIdentifierDefaultingNamespace()
CobblemonScripts.run(script, runtime) ?: DoubleValue(0)
}
)
val biomeFunctions = hashMapOf<String, java.util.function.Function<MoParams, Any>>()
val worldFunctions = hashMapOf<String, java.util.function.Function<MoParams, Any>>()
val dimensionTypeFunctions = hashMapOf<String, java.util.function.Function<MoParams, Any>>()
val blockFunctions = hashMapOf<String, java.util.function.Function<MoParams, Any>>()
val playerFunctions = mutableListOf<(ServerPlayerEntity) -> HashMap<String, java.util.function.Function<MoParams, Any>>>(
val playerFunctions = mutableListOf<(PlayerEntity) -> HashMap<String, java.util.function.Function<MoParams, Any>>>(
{ player ->
hashMapOf(
"username" to java.util.function.Function { _ -> StringValue(player.gameProfile.name) },
"uuid" to java.util.function.Function { _ -> StringValue(player.gameProfile.id.toString()) },
"data" to java.util.function.Function { _ -> return@Function Cobblemon.molangData.load(player.uuid) },
"save_data" to java.util.function.Function { _ -> Cobblemon.molangData.save(player.uuid) },
"main_held_item" to java.util.function.Function { _ -> player.world.itemRegistry.getEntry(player.mainHandStack.item).asMoLangValue(RegistryKeys.ITEM) },
"off_held_item" to java.util.function.Function { _ -> player.world.itemRegistry.getEntry(player.offHandStack.item).asMoLangValue(RegistryKeys.ITEM) },
"face" to java.util.function.Function { _ -> ObjectValue(PlayerDialogueFaceProvider(player.uuid)) }
)
val map = hashMapOf<String, java.util.function.Function<MoParams, Any>>()
map.put("username") { _ -> StringValue(player.gameProfile.name) }
map.put("uuid") { _ -> StringValue(player.gameProfile.id.toString()) }
map.put("data") { _ -> return@put if (player is ServerPlayerEntity) Cobblemon.molangData.load(player.uuid) else DoubleValue(0) }
map.put("save_data") { _ -> if (player is ServerPlayerEntity) Cobblemon.molangData.save(player.uuid) else DoubleValue(0) }
map.put("main_held_item") { _ -> player.world.itemRegistry.getEntry(player.mainHandStack.item).asMoLangValue(RegistryKeys.ITEM) }
map.put("off_held_item") { _ -> player.world.itemRegistry.getEntry(player.offHandStack.item).asMoLangValue(RegistryKeys.ITEM) }
map.put("face") { _ -> ObjectValue(PlayerDialogueFaceProvider(player.uuid)) }
map.put("swing_hand") { _ -> player.swingHand(player.activeHand) }
map.put("food_level") { _ -> DoubleValue(player.hungerManager.foodLevel) }
map.put("saturation_level") { _ -> DoubleValue(player.hungerManager.saturationLevel) }
map.put("tell") { params ->
val message = params.getString(0).text()
val overlay = params.getBooleanOrNull(1) ?: false
player.sendMessage(message, overlay)
}
map.put("teleport") { params ->
val x = params.getDouble(0)
val y = params.getDouble(1)
val z = params.getDouble(2)
player.teleport(x, y, z)
}
map.put("heal") { params ->
val amount = params.getDoubleOrNull(0) ?: player.maxHealth
player.heal(amount.toFloat())
}
map.put("environment") {
val environment = MoLangEnvironment()
environment.structs["query"] = player.asMoLangValue()
environment
}
map.put("run_command") { params ->
val command = params.getString(0)
val server = server() ?: return@put DoubleValue(0)
server.commandManager.executeWithPrefix(player.commandSource, command)
}
map
}
)
val entityFunctions = mutableListOf<(LivingEntity) -> HashMap<String, java.util.function.Function<MoParams, Any>>>(
{ entity ->
val map = hashMapOf<String, java.util.function.Function<MoParams, Any>>()
map.put("damage") { params ->
val amount = params.getDouble(0)
val source = DamageSource(entity.world.registryManager.get(RegistryKeys.DAMAGE_TYPE).getEntry(DamageTypes.GENERIC).get())
entity.damage(source, amount.toFloat())
}
map.put("is_sneaking") { _ -> DoubleValue(entity.isSneaking) }
map.put("is_sprinting") { _ -> DoubleValue(entity.isSprinting) }
map.put("is_flying") { _ -> DoubleValue(entity.isFallFlying) }
map.put("is_in_water") { _ -> DoubleValue(entity.isSubmergedInWater) }
map.put("is_touching_water_or_rain") { _ -> DoubleValue(entity.isWet) }
map.put("is_touching_water") { _ -> DoubleValue(entity.isTouchingWater) }
map.put("is_in_lava") { _ -> DoubleValue(entity.isInLava) }
map.put("is_on_fire") { _ -> DoubleValue(entity.isOnFire) }
map.put("is_invisible") { _ -> DoubleValue(entity.isInvisible) }
map.put("is_sleeping") { _ -> DoubleValue(entity.isSleeping) }
map.put("is_riding") { _ -> DoubleValue(entity.hasVehicle()) }
map.put("health") { _ -> DoubleValue(entity.health) }
map.put("max_health") { _ -> DoubleValue(entity.maxHealth) }
map.put("name") { _ -> StringValue(entity.entityName) }
map.put("yaw") { _ -> DoubleValue(entity.yaw.toDouble()) }
map.put("pitch") { _ -> DoubleValue(entity.pitch.toDouble()) }
map.put("x") { _ -> DoubleValue(entity.x) }
map.put("y") { _ -> DoubleValue(entity.y) }
map.put("z") { _ -> DoubleValue(entity.z) }
map.put("velocity_x") { _ -> DoubleValue(entity.velocity.x) }
map.put("velocity_y") { _ -> DoubleValue(entity.velocity.y) }
map.put("velocity_z") { _ -> DoubleValue(entity.velocity.z) }
map.put("horizontal_velocity") { _ -> DoubleValue(entity.velocity.horizontalLength()) }
map.put("is_on_ground") { _ -> DoubleValue(entity.isOnGround) }
map.put("world") { _ -> entity.world.worldRegistry.getEntry(entity.world).asWorldMoLangValue() }
map.put("biome") { _ -> entity.world.getBiome(entity.blockPos).asBiomeMoLangValue() }
map
}
)
val npcFunctions = mutableListOf<(NPCEntity) -> HashMap<String, java.util.function.Function<MoParams, Any>>>(
{ npc ->
val map = hashMapOf<String, java.util.function.Function<MoParams, Any>>()
map.put("class") { StringValue(npc.npc.resourceIdentifier.toString()) }
map.put("name") { StringValue(npc.name.string) }
map.put("face") { ObjectValue(ReferenceDialogueFaceProvider(npc.id)) }
map.put("in_battle") { DoubleValue(npc.isInBattle()) }
map.put("run_script_on_client") { params ->
val world = npc.world
if (world is ServerWorld) {
val script = params.getString(0)
val packet = RunPosableMoLangPacket(npc.id, setOf("q.run_script('$script')"))
packet.sendToPlayers(world.players.toList())
}
Unit
}
map.put("run_script") { params ->
val script = params.getString(0).asIdentifierDefaultingNamespace()
val environment = params.environment
val runtime = MoLangRuntime()
runtime.environment.structs.putAll(environment.structs)
CobblemonScripts.run(script, runtime) ?: DoubleValue(0)
}
map.put("environment") { _ -> npc.runtime.environment }
map
}
)
val battleFunctions = mutableListOf<(PokemonBattle) -> HashMap<String, java.util.function.Function<MoParams, Any>>>(
{ battle ->
val map = hashMapOf<String, java.util.function.Function<MoParams, Any>>()
map.put("battle_id") { StringValue(battle.battleId.toString()) }
map.put("is_pvn") { DoubleValue(battle.isPvN) }
map.put("is_pvp") { DoubleValue(battle.isPvP) }
map.put("is_pvw") { DoubleValue(battle.isPvW) }
map.put("battle_type") { StringValue(battle.format.toString()) }
map.put("environment") { battle.runtime.environment }
map
}
)
@@ -99,15 +231,35 @@ object MoLangFunctions {
fun RegistryEntry<World>.asWorldMoLangValue() = asMoLangValue(RegistryKeys.WORLD).addFunctions(worldFunctions)
fun RegistryEntry<Block>.asBlockMoLangValue() = asMoLangValue(RegistryKeys.BLOCK).addFunctions(blockFunctions)
fun RegistryEntry<DimensionType>.asDimensionTypeMoLangValue() = asMoLangValue(RegistryKeys.DIMENSION_TYPE).addFunctions(dimensionTypeFunctions)
fun ServerPlayerEntity.asMoLangValue(): ObjectValue<ServerPlayerEntity> {
fun PlayerEntity.asMoLangValue(): ObjectValue<PlayerEntity> {
val value = ObjectValue(
obj = this,
stringify = { it.entityName }
)
value.addFunctions(entityFunctions.flatMap { it(this).entries.map { it.key to it.value } }.toMap())
value.addFunctions(playerFunctions.flatMap { it(this).entries.map { it.key to it.value } }.toMap())
return value
}
fun NPCEntity.asMoLangValue(): ObjectValue<NPCEntity> {
val value = ObjectValue(
obj = this,
stringify = { it.name.string }
)
value.addFunctions(entityFunctions.flatMap { it(this).entries.map { it.key to it.value } }.toMap())
value.addFunctions(npcFunctions.flatMap { it(this).entries.map { it.key to it.value } }.toMap())
return value
}
fun PokemonBattle.asMoLangValue(): ObjectValue<PokemonBattle> {
val value = ObjectValue(
obj = this,
stringify = { it.battleId.toString() }
)
value.addFunctions(battleFunctions.flatMap { it(this).entries.map { it.key to it.value } }.toMap())
return value
}
fun <T> RegistryEntry<T>.asMoLangValue(key: RegistryKey<Registry<T>>): ObjectValue<RegistryEntry<T>> {
val value = ObjectValue(
obj = this,
@@ -134,11 +286,6 @@ object MoLangFunctions {
return this
}
fun <T : QueryStruct> T.addFunction(name: String, function: java.util.function.Function<MoParams, Any>): T {
this.functions[name] = function
return this
}
fun MoLangEnvironment.getQueryStruct(name: String = "query") = structs.getOrPut(name) { QueryStruct(hashMapOf()) } as QueryStruct
fun MoLangRuntime.setup(): MoLangRuntime {
@@ -193,4 +340,6 @@ object MoLangFunctions {
else -> null
} ?: throw IllegalArgumentException("Invalid NBT element type: ${nbt.type}")
}
}
}
fun Either<Identifier, ExpressionLike>.runScript(runtime: MoLangRuntime) = map({ CobblemonScripts.run(it, runtime) }, { it.resolve(runtime) })
@@ -10,6 +10,8 @@ package com.cobblemon.mod.common.api.molang
import com.bedrockk.molang.Expression
import com.bedrockk.molang.runtime.MoLangRuntime
import com.bedrockk.molang.runtime.value.MoValue
import com.cobblemon.mod.common.util.getString
import com.cobblemon.mod.common.util.resolve
/**
@@ -20,5 +22,6 @@ import com.cobblemon.mod.common.util.resolve
* @since October 22nd, 2023
*/
class SingleExpression(val expr: Expression) : ExpressionLike {
override fun resolve(runtime: MoLangRuntime) = runtime.resolve(expr)
override fun toString() = expr.getString()
override fun resolve(runtime: MoLangRuntime, context: Map<String, MoValue>) = runtime.resolve(expr, context)
}
@@ -12,7 +12,6 @@ import com.bedrockk.molang.runtime.struct.MoStruct
import com.bedrockk.molang.runtime.struct.QueryStruct
import com.bedrockk.molang.runtime.value.DoubleValue
import com.bedrockk.molang.runtime.value.StringValue
import com.cobblemon.mod.common.api.molang.MoLangFunctions.addFunction
import com.cobblemon.mod.common.api.moves.animations.ActionEffectTimeline
import com.cobblemon.mod.common.api.moves.categories.DamageCategories
import com.cobblemon.mod.common.api.moves.categories.DamageCategory
@@ -11,9 +11,11 @@ package com.cobblemon.mod.common.api.moves.animations
import com.bedrockk.molang.Expression
import com.bedrockk.molang.runtime.MoLangRuntime
import com.bedrockk.molang.runtime.struct.VariableStruct
import com.cobblemon.mod.common.api.molang.ExpressionLike
import com.cobblemon.mod.common.api.moves.animations.keyframes.ActionEffectKeyframe
import com.cobblemon.mod.common.api.scheduling.ScheduledTask
import com.cobblemon.mod.common.util.asExpression
import com.cobblemon.mod.common.util.asExpressionLike
import com.cobblemon.mod.common.util.asExpressions
import com.cobblemon.mod.common.util.resolveBoolean
import java.util.concurrent.CompletableFuture
import net.minecraft.entity.Entity
@@ -29,7 +31,7 @@ import net.minecraft.entity.Entity
*/
class ActionEffectTimeline(
val timeline: List<ActionEffectKeyframe> = mutableListOf(),
val condition: Expression = "true".asExpression()
val condition: ExpressionLike = "true".asExpressionLike()
) {
companion object {
val NONE = ActionEffectTimeline()
@@ -49,6 +49,6 @@ class AnimationActionEffectKeyframe : ConditionalActionEffectKeyframe(), EntityC
players.forEach { it.sendPacket(pkt) }
}
return delayedFuture(seconds = delay.resolveFloat(context.runtime), serverThread = true)
return delayedFuture(seconds = delay.resolveFloat(context.runtime))
}
}
@@ -46,6 +46,6 @@ class EntityMoLangActionEffectKeyframe : ConditionalActionEffectKeyframe(), Enti
players.forEach { it.sendPacket(pkt) }
}
return delayedFuture(seconds = delay.resolveFloat(context.runtime), serverThread = true)
return delayedFuture(seconds = delay.resolveFloat(context.runtime))
}
}
@@ -51,6 +51,6 @@ class EntityParticlesActionEffectKeyframe : ConditionalActionEffectKeyframe(), E
packet.sendToPlayers(players)
}
return delayedFuture(seconds = delay.resolveFloat(context.runtime), serverThread = true)
return delayedFuture(seconds = delay.resolveFloat(context.runtime))
}
}
@@ -45,6 +45,6 @@ class EntitySoundActionEffectKeyframe : ConditionalActionEffectKeyframe(), Entit
entity.playSound(soundEvent, 1f, 1f)
}
return delayedFuture(seconds = delay.resolveFloat(context.runtime), serverThread = true)
return delayedFuture(seconds = delay.resolveFloat(context.runtime))
}
}
@@ -25,6 +25,6 @@ class MoLangActionEffectKeyframe : ActionEffectKeyframe {
val delay: ExpressionLike = "0".asExpressionLike()
override fun play(context: ActionEffectContext): CompletableFuture<Unit> {
expressions.resolve(context.runtime)
return delayedFuture(seconds = delay.resolveFloat(context.runtime), serverThread = true)
return delayedFuture(seconds = delay.resolveFloat(context.runtime))
}
}
@@ -14,5 +14,5 @@ import com.cobblemon.mod.common.util.asExpressionLike
class PauseActionEffectKeyframe : ConditionalActionEffectKeyframe() {
val pause = "1".asExpressionLike()
override fun playWhenTrue(context: ActionEffectContext) = delayedFuture(seconds = pause.resolveFloat(context.runtime), serverThread = true)
override fun playWhenTrue(context: ActionEffectContext) = delayedFuture(seconds = pause.resolveFloat(context.runtime))
}
@@ -24,7 +24,7 @@ class RemoveHoldsActionEffectKeyframe : ActionEffectKeyframe {
val delay = 0F
val holds = mutableSetOf<String>()
override fun play(context: ActionEffectContext): CompletableFuture<Unit> {
return delayedFuture(seconds = delay, serverThread = true).thenApply {
return delayedFuture(seconds = delay).thenApply {
if (holds.isEmpty()) {
context.holds.clear()
} else {
@@ -56,7 +56,7 @@ class ReturnToPositionActionEffectKeyframe : ActionEffectKeyframe {
}
)
after(seconds = timeout.resolveFloat(context.runtime), serverThread = true) {
after(seconds = timeout.resolveFloat(context.runtime)) {
if (!future.isDone && !timedOut) {
timedOut = true
timeoutEffect.run(context).thenApply { future.complete(Unit) }
@@ -35,8 +35,8 @@ abstract class MultiblockBlock(properties: Settings) : BlockWithEntity(propertie
itemStack: ItemStack?
) {
if (world is ServerWorld) {
val multiblockEntity = world.getBlockEntity(pos) as MultiblockEntity
multiblockEntity.multiblockBuilder?.validate(world)
val multiblockEntity = world.getBlockEntity(pos) as? MultiblockEntity
multiblockEntity?.multiblockBuilder?.validate(world)
}
super.onPlaced(world, pos, state, placer, itemStack)
}
@@ -52,8 +52,8 @@ abstract class MultiblockBlock(properties: Settings) : BlockWithEntity(propertie
if(hand == Hand.OFF_HAND) {
return ActionResult.SUCCESS
}
val entity = world.getBlockEntity(pos) as MultiblockEntity
if (entity.multiblockStructure != null) {
val entity = world.getBlockEntity(pos) as MultiblockEntity?
if (entity?.multiblockStructure != null) {
return entity.multiblockStructure!!.onUse(state, world, pos, player, hand, hit)
}
return super.onUse(state, world, pos, player, hand, hit)
@@ -29,5 +29,4 @@ object StringSetDataSerializer : TrackedDataHandler<Set<String>> {
}
override fun copy(set: Set<String>) = set.toSet()
}
@@ -0,0 +1,33 @@
/*
* 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.net.serializers
import com.cobblemon.mod.common.net.IntSize
import com.cobblemon.mod.common.util.readSizedInt
import com.cobblemon.mod.common.util.writeSizedInt
import java.util.UUID
import net.minecraft.entity.data.TrackedDataHandler
import net.minecraft.network.PacketByteBuf
object UUIDSetDataSerializer : TrackedDataHandler<Set<UUID>> {
override fun write(buffer: PacketByteBuf, set: Set<UUID>) {
buffer.writeSizedInt(IntSize.U_BYTE, set.size)
set.forEach(buffer::writeUuid)
}
override fun read(buffer: PacketByteBuf): Set<UUID> {
val set = mutableSetOf<UUID>()
repeat(times = buffer.readSizedInt(IntSize.U_BYTE)) {
set.add(buffer.readUuid())
}
return set
}
override fun copy(set: Set<UUID>) = set.toSet()
}
@@ -0,0 +1,82 @@
/*
* 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.npc
import com.bedrockk.molang.runtime.value.DoubleValue
import com.bedrockk.molang.runtime.value.MoValue
import com.bedrockk.molang.runtime.value.StringValue
import com.cobblemon.mod.common.api.molang.ExpressionLike
import com.cobblemon.mod.common.api.npc.configuration.NPCBattleConfiguration
import com.cobblemon.mod.common.net.IntSize
import com.cobblemon.mod.common.util.asExpressionLike
import com.cobblemon.mod.common.util.lang
import com.cobblemon.mod.common.util.readMapK
import com.cobblemon.mod.common.util.writeMapK
import com.mojang.datafixers.util.Either
import net.minecraft.entity.EntityDimensions
import net.minecraft.network.PacketByteBuf
import net.minecraft.text.MutableText
import net.minecraft.util.Identifier
/**
* A class of NPC. This can contain a lot of preset information about the NPC's behaviour. Consider this the Pokémon
* species but for NPCs.
*
* @author Hiroku
* @since August 14th, 2023
*/
class NPCClass {
@Transient
lateinit var resourceIdentifier: Identifier
var names = mutableListOf<MutableText>(lang("npc.name.default"))
var hitbox = EntityDimensions(0.6F, 1.8F, false)
var battleConfiguration = NPCBattleConfiguration()
var interaction: Either<Identifier, ExpressionLike>? = null
var variables = mutableMapOf<String, MoValue>()
fun encode(buffer: PacketByteBuf) {
buffer.writeCollection(names, PacketByteBuf::writeText)
buffer.writeFloat(this.hitbox.width)
buffer.writeFloat(this.hitbox.height)
buffer.writeBoolean(this.hitbox.fixed)
battleConfiguration.encode(buffer)
buffer.writeNullable(interaction) { _, value ->
buffer.writeBoolean(value.map({ true }, { false }))
buffer.writeString(value.map({ it.toString() }, { it.toString() }))
}
buffer.writeMapK(size = IntSize.U_BYTE, map = variables) { (key, value) ->
buffer.writeString(key)
buffer.writeString(value.asString())
}
}
fun decode(buffer: PacketByteBuf) {
names = buffer.readList { buffer.readText().copy() }.toMutableList()
hitbox = EntityDimensions(buffer.readFloat(), buffer.readFloat(), buffer.readBoolean())
battleConfiguration = NPCBattleConfiguration()
battleConfiguration.decode(buffer)
interaction = buffer.readNullable {
if (buffer.readBoolean()) {
Either.left(Identifier(buffer.readString()))
} else {
Either.right(buffer.readString().asExpressionLike())
}
}
buffer.readMapK(size = IntSize.U_BYTE, map = variables) {
val key = buffer.readString()
val value = buffer.readString()
if (value.toDoubleOrNull() != null) {
return@readMapK key to DoubleValue(value.toDouble())
} else {
return@readMapK key to StringValue(value)
}
}
}
}
@@ -0,0 +1,128 @@
/*
* 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.npc
import com.bedrockk.molang.runtime.value.MoValue
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.api.ai.SleepDepth
import com.cobblemon.mod.common.api.conditional.RegistryLikeCondition
import com.cobblemon.mod.common.api.data.JsonDataRegistry
import com.cobblemon.mod.common.api.drop.DropEntry
import com.cobblemon.mod.common.api.drop.ItemDropMethod
import com.cobblemon.mod.common.api.entity.EntityDimensionsAdapter
import com.cobblemon.mod.common.api.molang.ExpressionLike
import com.cobblemon.mod.common.api.pokemon.PokemonProperties
import com.cobblemon.mod.common.api.reactive.SimpleObservable
import com.cobblemon.mod.common.api.spawning.TimeRange
import com.cobblemon.mod.common.net.messages.client.data.NPCRegistrySyncPacket
import com.cobblemon.mod.common.pokemon.Species
import com.cobblemon.mod.common.util.adapters.*
import com.cobblemon.mod.common.util.cobblemonResource
import com.google.gson.Gson
import com.google.gson.GsonBuilder
import com.google.gson.reflect.TypeToken
import com.mojang.datafixers.util.Either
import net.minecraft.block.Block
import net.minecraft.entity.EntityDimensions
import net.minecraft.item.Item
import net.minecraft.nbt.NbtCompound
import net.minecraft.resource.ResourceType
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.Identifier
import net.minecraft.util.math.Box
import net.minecraft.world.biome.Biome
object NPCClasses : JsonDataRegistry<NPCClass> {
override val id = cobblemonResource("npc")
override val type = ResourceType.SERVER_DATA
override val gson: Gson = GsonBuilder()
.registerTypeAdapter(EntityDimensions::class.java, EntityDimensionsAdapter)
.registerTypeAdapter(Box::class.java, BoxAdapter)
.registerTypeAdapter(IntRange::class.java, IntRangeAdapter)
.registerTypeAdapter(PokemonProperties::class.java, pokemonPropertiesShortAdapter)
.registerTypeAdapter(Identifier::class.java, IdentifierAdapter)
.registerTypeAdapter(TimeRange::class.java, IntRangesAdapter(TimeRange.timeRanges) { TimeRange(*it) })
.registerTypeAdapter(ItemDropMethod::class.java, ItemDropMethod.adapter)
.registerTypeAdapter(SleepDepth::class.java, SleepDepth.adapter)
.registerTypeAdapter(DropEntry::class.java, DropEntryAdapter)
.registerTypeAdapter(NbtCompound::class.java, NbtCompoundAdapter)
.registerTypeAdapter(NPCPartyProvider::class.java, NPCPartyProviderAdapter)
.registerTypeAdapter(MoValue::class.java, MoValueAdapter)
.registerTypeAdapter(TypeToken.getParameterized(RegistryLikeCondition::class.java, Biome::class.java).type, BiomeLikeConditionAdapter)
.registerTypeAdapter(TypeToken.getParameterized(RegistryLikeCondition::class.java, Block::class.java).type, BlockLikeConditionAdapter)
.registerTypeAdapter(TypeToken.getParameterized(RegistryLikeCondition::class.java, Item::class.java).type, ItemLikeConditionAdapter)
.registerTypeAdapter(TypeToken.getParameterized(Either::class.java, Identifier::class.java, ExpressionLike::class.java).type, NPCScriptAdapter)
.disableHtmlEscaping()
.enableComplexMapKeySerialization()
.create()
override val typeToken: TypeToken<NPCClass> = TypeToken.get(NPCClass::class.java)
override val resourcePath = "npcs"
override val observable = SimpleObservable<NPCClasses>()
private val npcClassesByIdentifier = hashMapOf<Identifier, NPCClass>()
val classes: Collection<NPCClass>
get() = this.npcClassesByIdentifier.values
init {
// NPC additions would be useful
// SpeciesAdditions.observable.subscribe {
// this.species.forEach(Species::initialize)
// this.species.forEach(Species::resolveEvolutionMoves)
// }
}
/**
* Finds an NPC class by the pathname of their [Identifier].
* This method exists for the convenience of finding Cobble default NPC classes.
* This uses [getByIdentifier] using the [Cobblemon.MODID] as the namespace and the [name] as the path.
*
* @param name The path of the NPC class asset.
* @return The [NPCClass] if existing.
*/
fun getByName(name: String) = this.getByIdentifier(cobblemonResource(name))
/**
* Finds an [NPCClass] by its unique [Identifier].
*
* @param identifier The unique [NPCClass.resourceIdentifier] of the [NPCClass].
* @return The [NPCClass] if existing.
*/
fun getByIdentifier(identifier: Identifier) = this.npcClassesByIdentifier[identifier]
/**
* Counts the currently loaded NPC classes.
*
* @return The loaded NPC class amount.
*/
fun count() = this.npcClassesByIdentifier.size
/**
* Picks a random [NPCClass].
*
* @throws [NoSuchElementException] if there are no NPC classes loaded.
*
* @return A randomly selected [Species].
*/
fun random(): NPCClass = this.npcClassesByIdentifier.values.random()
override fun reload(data: Map<Identifier, NPCClass>) {
this.npcClassesByIdentifier.clear()
data.forEach { (identifier, species) ->
species.resourceIdentifier = identifier
this.npcClassesByIdentifier[identifier] = species
}
}
override fun sync(player: ServerPlayerEntity) {
NPCRegistrySyncPacket(npcClassesByIdentifier.values.toList()).sendToPlayer(player)
}
}
@@ -0,0 +1,30 @@
/*
* 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.npc
import com.cobblemon.mod.common.api.npc.configuration.NPCBattleConfiguration
import com.cobblemon.mod.common.entity.npc.NPCEntity
/**
* An NPC configuration is like a snapshot of an NPC setup. It can be taken from an existing NPC and loaded onto
* others. Useful as a backup mechanism or as shorthand for copying an NPC's configuration without building an
* entire class for them.
*
* @author Hiroku
* @since August 16th, 2023
*/
class NPCConfiguration {
var battle: NPCBattleConfiguration? = null
fun applyTo(npc: NPCEntity) {
}
fun loadFrom(npc: NPCEntity) {
}
}
@@ -0,0 +1,41 @@
/*
* 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.npc
import com.cobblemon.mod.common.api.npc.partyproviders.SimplePartyProvider
import com.cobblemon.mod.common.api.storage.party.PartyStore
import com.cobblemon.mod.common.entity.npc.NPCEntity
import com.google.gson.JsonElement
import net.minecraft.nbt.NbtCompound
import net.minecraft.network.PacketByteBuf
import net.minecraft.server.network.ServerPlayerEntity
/**
* A provider of a party for battling the NPC. Completely custom party providers will only display
* as text labels in any GUIs.
*
* @author Hiroku
* @since August 16th, 2023
*/
interface NPCPartyProvider {
companion object {
val types = mutableMapOf<String, (String) -> NPCPartyProvider>(
SimplePartyProvider.TYPE to { SimplePartyProvider() }
)
}
val type: String
fun provide(npc: NPCEntity, challengers: List<ServerPlayerEntity>): PartyStore
fun encode(buffer: PacketByteBuf)
fun decode(buffer: PacketByteBuf)
fun saveToNBT(nbt: NbtCompound)
fun loadFromNBT(nbt: NbtCompound)
fun loadFromJSON(json: JsonElement)
}
@@ -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.api.npc
import net.minecraft.util.Identifier
class NPCPreset {
lateinit var id: Identifier
var aspects: Set<String>? = null
var party: NPCPartyProvider? = null
// var mergeMode = MergeMode.KEEP
}
@@ -0,0 +1,70 @@
/*
* 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.npc.configuration
import com.cobblemon.mod.common.api.npc.NPCPartyProvider
import com.cobblemon.mod.common.util.DataKeys
import net.minecraft.nbt.NbtCompound
import net.minecraft.network.PacketByteBuf
class NPCBattleConfiguration {
var canChallenge = false
var party: NPCPartyProvider? = null
var simultaneousBattles = false
var healAfterwards = true
fun encode(buffer: PacketByteBuf) {
buffer.writeBoolean(canChallenge)
buffer.writeBoolean(simultaneousBattles)
buffer.writeBoolean(healAfterwards)
buffer.writeNullable(party) { _, provider ->
buffer.writeString(provider.type)
provider.encode(buffer)
}
}
fun decode(buffer: PacketByteBuf) {
canChallenge = buffer.readBoolean()
simultaneousBattles = buffer.readBoolean()
healAfterwards = buffer.readBoolean()
party = buffer.readNullable {
val type = buffer.readString()
val providerBuilder = NPCPartyProvider.types[type]
?: throw IllegalArgumentException("Failed to load NPC party provider of type: $type")
providerBuilder(type)
}
}
fun saveToNBT(nbt: NbtCompound) {
nbt.putBoolean(DataKeys.NPC_CAN_CHALLENGE, canChallenge)
nbt.putBoolean(DataKeys.NPC_SIMULTANEOUS_BATTLES, simultaneousBattles)
nbt.putBoolean(DataKeys.NPC_HEAL_AFTERWARDS, healAfterwards)
val party = party
if (party != null) {
val partyNBT = NbtCompound()
partyNBT.putString(DataKeys.NPC_PARTY_TYPE, party.type)
party.saveToNBT(partyNBT)
nbt.put(DataKeys.NPC_PARTY, partyNBT)
}
}
fun loadFromNBT(nbt: NbtCompound) {
canChallenge = nbt.getBoolean(DataKeys.NPC_CAN_CHALLENGE)
simultaneousBattles = nbt.getBoolean(DataKeys.NPC_SIMULTANEOUS_BATTLES)
healAfterwards = nbt.getBoolean(DataKeys.NPC_HEAL_AFTERWARDS)
val partyNBT = nbt.getCompound(DataKeys.NPC_PARTY)
if (!partyNBT.isEmpty) {
val type = partyNBT.getString(DataKeys.NPC_PARTY_TYPE)
val providerBuilder = NPCPartyProvider.types[type]
?: throw IllegalArgumentException("Failed to load NPC party provider of type: $type")
party = providerBuilder(type).also { it.loadFromNBT(partyNBT) }
}
}
}
@@ -0,0 +1,32 @@
/*
* 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.npc.configuration
import net.minecraft.nbt.NbtCompound
import net.minecraft.network.PacketByteBuf
class NPCBehaviourConfiguration {
var canBeHurt = true
fun encode(buffer: PacketByteBuf) {
}
fun decode(buffer: PacketByteBuf) {
}
fun saveToNBT(nbt: NbtCompound) {
}
fun loadFromNBT(nbt: NbtCompound) {
}
}
@@ -0,0 +1,22 @@
/*
* 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.npc.configuration
import net.minecraft.server.network.ServerPlayerEntity
/**
* A type of interaction handler for when a player right clicks the NPC.
*
* @author Hiroku
* @since August 19th, 2023
*/
interface NPCInteractConfiguration {
val type: String
fun interact(player: ServerPlayerEntity): Boolean
}
@@ -0,0 +1,77 @@
/*
* 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.npc.partyproviders
import com.cobblemon.mod.common.api.npc.NPCPartyProvider
import com.cobblemon.mod.common.api.pokemon.PokemonProperties
import com.cobblemon.mod.common.api.storage.party.NPCPartyStore
import com.cobblemon.mod.common.api.storage.party.PartyStore
import com.cobblemon.mod.common.entity.npc.NPCEntity
import com.cobblemon.mod.common.net.IntSize
import com.cobblemon.mod.common.util.DataKeys
import com.cobblemon.mod.common.util.readSizedInt
import com.cobblemon.mod.common.util.writeSizedInt
import com.google.gson.JsonElement
import com.google.gson.JsonObject
import net.minecraft.nbt.NbtCompound
import net.minecraft.network.PacketByteBuf
import net.minecraft.server.network.ServerPlayerEntity
class SimplePartyProvider : NPCPartyProvider {
companion object {
const val TYPE = "simple"
}
@Transient
override val type = TYPE
val pokemon = mutableListOf<PokemonProperties>()
override fun encode(buffer: PacketByteBuf) {
buffer.writeSizedInt(IntSize.U_BYTE, pokemon.size)
for (pokemon in this.pokemon) {
buffer.writeString(pokemon.originalString)
}
}
override fun decode(buffer: PacketByteBuf) {
repeat(times = buffer.readSizedInt(IntSize.U_BYTE)) {
pokemon.add(PokemonProperties.parse(buffer.readString()))
}
}
override fun saveToNBT(nbt: NbtCompound) {
for ((index, pokemon) in this.pokemon.withIndex()) {
nbt.putString(DataKeys.NPC_PARTY_POKEMON + index, pokemon.originalString)
}
}
override fun loadFromNBT(nbt: NbtCompound) {
var index = 0
while (nbt.contains(DataKeys.NPC_PARTY_POKEMON + index)) {
this.pokemon.add(PokemonProperties.parse(nbt.getString(DataKeys.POKEMON_PROPERTIES + index)))
index++
}
}
override fun loadFromJSON(json: JsonElement) {
json as JsonObject
if (json.has(DataKeys.NPC_PARTY_POKEMON.lowercase())) {
json.get(DataKeys.NPC_PARTY_POKEMON.lowercase()).asJsonArray.forEach { pokemon.add(PokemonProperties.parse(it.asString)) }
}
}
override fun provide(npc: NPCEntity, challengers: List<ServerPlayerEntity>): PartyStore {
return NPCPartyStore(npc).apply {
for (properties in pokemon) {
add(properties.create())
}
}
}
}
@@ -70,6 +70,8 @@ object CobblemonPermissions {
val CLEAR_PARTY = this.create("${COMMAND_PREFIX}clearparty", PermissionLevel.CHEAT_COMMANDS_AND_COMMAND_BLOCKS)
val CLEAR_PC = this.create("${COMMAND_PREFIX}clearpc", PermissionLevel.CHEAT_COMMANDS_AND_COMMAND_BLOCKS)
val NPC_EDIT = this.create("${COMMAND_PREFIX}npcedit", PermissionLevel.CHEAT_COMMANDS_AND_COMMAND_BLOCKS)
fun all(): Iterable<Permission> = this.permissions
private fun create(node: String, level: PermissionLevel): Permission {
@@ -168,7 +168,7 @@ object PokeBalls : JsonDataRegistry<PokeBall> {
createDefault("fast_ball", BaseStatModifier(Stats.SPEED, { it >= 100 }, 4F))
createDefault("level_ball", CatchRateModifiers.LEVEL)
// ToDo we will need fishing context here once fishing is implemented for a multiplier
createDefault("lure_ball", CatchRateModifiers.typeBoosting(2F, ElementalTypes.WATER))
createDefault("lure_ball", CatchRateModifiers.LURE)
createDefault("heavy_ball", CatchRateModifiers.WEIGHT_BASED)
createDefault("love_ball", CatchRateModifiers.LOVE)
createDefault("friend_ball", effects = listOf(CaptureEffects.friendshipSetter(150)))
@@ -205,8 +205,8 @@ object PokeBalls : JsonDataRegistry<PokeBall> {
createDefault("ancient_wing_ball", throwPower = 2.5f, ancient = true)
createDefault("ancient_jet_ball", throwPower = 2.5f, ancient = true)
createDefault("ancient_origin_ball", GuaranteedModifier(), ancient = true)
// Luxury ball effect
CobblemonEvents.FRIENDSHIP_UPDATED.subscribe(priority = Priority.LOWEST) { event ->
// Luxury ball effect, low priority as it must be triggered before soothe bell as of gen 4
CobblemonEvents.FRIENDSHIP_UPDATED.subscribe(priority = Priority.LOW) { event ->
var increment = (event.newFriendship - event.pokemon.friendship).toFloat()
if (increment <= 1F) {
event.pokemon.caughtBall.effects.filterIsInstance<FriendshipEarningBoostEffect>()
@@ -11,6 +11,7 @@ package com.cobblemon.mod.common.api.pokeball.catching.modifiers
import com.cobblemon.mod.common.api.pokeball.PokeBalls
import com.cobblemon.mod.common.api.pokeball.catching.CatchRateModifier
import com.cobblemon.mod.common.api.pokemon.status.Status
import com.cobblemon.mod.common.api.spawning.fishing.FishingSpawnCause
import com.cobblemon.mod.common.api.tags.CobblemonBiomeTags
import com.cobblemon.mod.common.api.types.ElementalType
import com.cobblemon.mod.common.battles.BattleRegistry
@@ -121,6 +122,18 @@ object CatchRateModifiers {
1F
}
/**
* Used by [PokeBalls.LURE_BALL].
* Checks if the entity has an aspect for being spawned from fishing.
* If yes boosts the catch rate by *4
*/
val LURE = WorldStateModifier { _, entity ->
if (FishingSpawnCause.FISHED_ASPECT in entity.aspects)
4f
else
1F
}
/**
* Used by [PokeBalls.HEAVY_BALL].
* The base implementation of the heavy ball modifier mechanics.
@@ -13,12 +13,14 @@ import com.bedrockk.molang.runtime.value.DoubleValue
import com.bedrockk.molang.runtime.value.StringValue
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.api.abilities.Abilities
import com.cobblemon.mod.common.api.abilities.Ability
import com.cobblemon.mod.common.api.pokeball.PokeBalls
import com.cobblemon.mod.common.api.pokemon.aspect.AspectProvider
import com.cobblemon.mod.common.api.pokemon.stats.Stats
import com.cobblemon.mod.common.api.pokemon.status.Statuses
import com.cobblemon.mod.common.api.properties.CustomPokemonProperty
import com.cobblemon.mod.common.api.types.ElementalTypes
import com.cobblemon.mod.common.api.types.tera.TeraTypes
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.pokemon.*
import com.cobblemon.mod.common.pokemon.status.PersistentStatus
@@ -57,9 +59,9 @@ open class PokemonProperties {
val props = PokemonProperties()
props.originalString = string
val keyPairs = string.splitMap(delimiter, assigner)
props.customProperties = CustomPokemonProperty.properties.mapNotNull { property ->
val matchedKeyPair = keyPairs.find { it.first.lowercase() in property.keys }
if (matchedKeyPair == null) {
props.customProperties = CustomPokemonProperty.properties.flatMap { property ->
val matchedKeyPairs = keyPairs.filter { it.first.lowercase() in property.keys }
if (matchedKeyPairs.isEmpty()) {
if (!property.needsKey) {
var savedProperty: CustomPokemonProperty? = null
val keyPair = keyPairs.find { keyPair ->
@@ -69,13 +71,20 @@ open class PokemonProperties {
if (keyPair != null) {
keyPairs.remove(keyPair)
}
return@mapNotNull savedProperty
return@flatMap savedProperty?.let { listOf(it) } ?: emptyList()
} else {
return@mapNotNull null
return@flatMap emptyList()
}
} else {
keyPairs.remove(matchedKeyPair)
return@mapNotNull property.fromString(matchedKeyPair.second)
val properties = mutableListOf<CustomPokemonProperty>()
for ((customKey, customValue) in matchedKeyPairs) {
val property = property.fromString(customValue)
keyPairs.remove(customKey to customValue)
if (property != null) {
properties.add(property)
}
}
return@flatMap properties
}
}.toMutableList()
props.gender = Gender.values().toList().parsePropertyOfCollection(keyPairs, listOf("gender"), labelsOptional = true) { it.name.lowercase() }
@@ -294,6 +303,18 @@ open class PokemonProperties {
)
fun apply(pokemon: Pokemon) {
// Custom properties check could be duplicated but can't assume 3rd party hasn't done anything type specific
this.customProperties.forEach { it.apply(pokemon) }
this.commonApply(pokemon)
}
fun apply(pokemonEntity: PokemonEntity) {
// Custom properties check could be duplicated but can't assume 3rd party hasn't done anything type specific
this.customProperties.forEach { it.apply(pokemonEntity) }
this.commonApply(pokemonEntity.pokemon)
}
private fun commonApply(pokemon: Pokemon) {
species?.let {
return@let try {
if (it == "random") {
@@ -313,8 +334,8 @@ open class PokemonProperties {
friendship?.let { pokemon.setFriendship(it) }
pokeball?.let { PokeBalls.getPokeBall(it.asIdentifierDefaultingNamespace())?.let { pokeball -> pokemon.caughtBall = pokeball } }
nature?.let { Natures.getNature(it.asIdentifierDefaultingNamespace())?.let { nature -> pokemon.nature = nature } }
ability?.let { Abilities.getOrException(it).create(true).let { ability -> pokemon.ability = ability } }
status?.let { Statuses.getStatus(it)?.let { pokemon.applyStatus(it as PersistentStatus) } }
ability?.let { this.createAbility(it, pokemon.form)?.let(pokemon::updateAbility) }
status?.let { Statuses.getStatus(it)?.let { status -> if (status is PersistentStatus) pokemon.applyStatus(status) } }
customProperties.forEach { it.apply(pokemon) }
ivs?.let { ivs ->
ivs.forEach { stat ->
@@ -326,7 +347,7 @@ open class PokemonProperties {
pokemon.setEV(stat.key, stat.value)
}
}
teraType?.let { ElementalTypes.get(it)?.let { type -> pokemon.teraType = type } }
teraType?.let { TeraTypes.get(it.asIdentifierDefaultingNamespace())?.let { type -> pokemon.teraType = type } }
dmaxLevel?.let { pokemon.dmaxLevel = it }
gmaxFactor?.let { pokemon.gmaxFactor = it }
tradeable?.let { pokemon.tradeable = it }
@@ -355,69 +376,17 @@ open class PokemonProperties {
pokemon.updateAspects()
}
fun apply(pokemonEntity: PokemonEntity) {
species?.let {
return@let try {
if (it == "random") {
PokemonSpecies.species.random()
} else {
PokemonSpecies.getByIdentifier(it.asIdentifierDefaultingNamespace())
}
} catch (e: InvalidIdentifierException) {
null
}
}?.let { pokemonEntity.pokemon.species = it }
nickname?.let { pokemonEntity.pokemon.nickname = it }
form?.let { formID -> pokemonEntity.pokemon.species.forms.firstOrNull { it.formOnlyShowdownId().equals(formID, true) } }?.let { form -> pokemonEntity.pokemon.form = form }
level?.let { pokemonEntity.pokemon.level = it }
shiny?.let { pokemonEntity.pokemon.shiny = it }
gender?.let { pokemonEntity.pokemon.gender = it }
friendship?.let { pokemonEntity.pokemon.setFriendship(it) }
pokeball?.let { PokeBalls.getPokeBall(it.asIdentifierDefaultingNamespace())?.let { pokeball -> pokemonEntity.pokemon.caughtBall = pokeball } }
nature?.let { Natures.getNature(it.asIdentifierDefaultingNamespace())?.let { nature -> pokemonEntity.pokemon.nature = nature } }
ability?.let { Abilities.getOrException(it).create(true).let { ability -> pokemonEntity.pokemon.ability = ability } }
status?.let { Statuses.getStatus(it)?.let { pokemonEntity.pokemon.applyStatus(it as PersistentStatus) } }
customProperties.forEach { it.apply(pokemonEntity) }
ivs?.let { ivs ->
ivs.forEach { stat ->
pokemonEntity.pokemon.setIV(stat.key, stat.value)
}
}
evs?.let { evs ->
evs.forEach { stat ->
pokemonEntity.pokemon.setEV(stat.key, stat.value)
}
}
teraType?.let { ElementalTypes.get(it)?.let { type -> pokemonEntity.pokemon.teraType = type } }
dmaxLevel?.let { pokemonEntity.pokemon.dmaxLevel = it }
gmaxFactor?.let { pokemonEntity.pokemon.gmaxFactor = it }
tradeable?.let { pokemonEntity.pokemon.tradeable = it }
// If it has been explicitly set to NONE, clear the stored information, including the originalTrainer property
originalTrainerType?.let {
if (it == OriginalTrainerType.NONE) {
pokemonEntity.pokemon.removeOriginalTrainer()
originalTrainer = null
}
}
originalTrainer?.let { ot ->
val type = originalTrainerType ?: pokemonEntity.pokemon.originalTrainerType
when (type) {
OriginalTrainerType.PLAYER -> {
when (ot.length) {
in 3..16 -> server()?.userCache?.findByName(ot)?.get()?.id // OT is a Username
36 -> UUID.fromString(ot) // OT is a UUID
else -> null // OT is invalid
}?.let { uuid -> pokemonEntity.pokemon.setOriginalTrainer(uuid) }
}
OriginalTrainerType.NPC -> pokemonEntity.pokemon.setOriginalTrainer(ot)
else -> {}
}
pokemonEntity.pokemon.refreshOriginalTrainer()
}
pokemonEntity.pokemon.updateAspects()
fun matches(pokemon: Pokemon): Boolean {
// Custom properties check could be duplicated but can't assume 3rd party hasn't done anything type specific
return this.commonMatches(pokemon) && this.customProperties.none { !it.matches(pokemon) }
}
fun matches(pokemon: Pokemon): Boolean {
fun matches(pokemonEntity: PokemonEntity): Boolean {
// Custom properties check could be duplicated but can't assume 3rd party hasn't done anything type specific
return this.commonMatches(pokemonEntity.pokemon) && this.customProperties.none { !it.matches(pokemonEntity) }
}
private fun commonMatches(pokemon: Pokemon): Boolean {
level?.takeIf { it != pokemon.level }?.let { return false }
shiny?.takeIf { it != pokemon.shiny }?.let { return false }
gender?.takeIf { it != pokemon.gender }?.let { return false }
@@ -435,7 +404,7 @@ open class PokemonProperties {
return false
}
}
nickname?.takeIf { it != pokemon.nickname }?.let { return false }
nickname?.takeIf { it.string != pokemon.nickname?.string }?.let { return false }
form?.takeIf { !it.equals(pokemon.form.name, true) }?.let { return false }
friendship?.takeIf { it != pokemon.friendship }?.let { return false }
pokeball?.takeIf { it != pokemon.caughtBall.name.toString() }?.let { return false }
@@ -448,59 +417,23 @@ open class PokemonProperties {
evs?.forEach{ stat ->
if (stat.value != pokemon.evs[stat.key]) { return false }
}
teraType?.takeIf { it != pokemon.teraType.name }?.let { return false }
teraType?.takeIf { it.asIdentifierDefaultingNamespace() != pokemon.teraType.id }?.let { return false }
dmaxLevel?.takeIf { it != pokemon.dmaxLevel }?.let { return false }
gmaxFactor?.takeIf { it != pokemon.gmaxFactor }?.let { return false }
tradeable?.takeIf { it != pokemon.tradeable }?.let { return false }
originalTrainer?.takeIf { it != pokemon.originalTrainer }?.let{ return false }
originalTrainerType?.takeIf { it != pokemon.originalTrainerType }?.let{ return false }
return customProperties.none { !it.matches(pokemon) }
}
fun matches(pokemonEntity: PokemonEntity): Boolean {
level?.takeIf { it != pokemonEntity.pokemon.level }?.let { return false }
shiny?.takeIf { it != ("shiny" in pokemonEntity.pokemon.aspects) }?.let { return false }
gender?.takeIf { it != pokemonEntity.pokemon.gender }?.let { return false }
species?.run {
try {
val species = if (this == "random") {
PokemonSpecies.species.random()
} else {
PokemonSpecies.getByIdentifier(this.asIdentifierDefaultingNamespace()) ?: return@run
}
if (pokemonEntity.pokemon.species != species) {
return false
}
} catch (e: InvalidIdentifierException) {}
}
nickname?.takeIf { it != pokemonEntity.pokemon.nickname }?.let { return false }
form?.takeIf { !it.equals(pokemonEntity.pokemon.form.name, true) }?.let { return false }
friendship?.takeIf { it != pokemonEntity.pokemon.friendship }?.let { return false }
pokeball?.takeIf { it != pokemonEntity.pokemon.caughtBall.name.toString() }?.let { return false }
nature?.takeIf { it != pokemonEntity.pokemon.nature.name.toString() }?.let { return false }
ability?.takeIf { it != pokemonEntity.pokemon.ability.name }?.let { return false }
status?.takeIf { it != pokemonEntity.pokemon.status?.status?.showdownName }?.let { return false }
ivs?.forEach{ stat ->
if (stat.value != pokemonEntity.pokemon.ivs[stat.key]) { return false }
}
evs?.forEach{ stat ->
if (stat.value != pokemonEntity.pokemon.evs[stat.key]) { return false }
}
teraType?.takeIf { it != pokemonEntity.pokemon.teraType.name }?.let { return false }
dmaxLevel?.takeIf { it != pokemonEntity.pokemon.dmaxLevel }?.let { return false }
gmaxFactor?.takeIf { it != pokemonEntity.pokemon.gmaxFactor }?.let { return false }
tradeable?.takeIf { it != pokemonEntity.pokemon.tradeable }?.let { return false }
originalTrainer?.takeIf { it != pokemonEntity.pokemon.originalTrainer }?.let{ return false }
originalTrainerType?.takeIf { it != pokemonEntity.pokemon.originalTrainerType }?.let{ return false }
return customProperties.none { !it.matches(pokemonEntity) }
return true
}
// TODO Review the need for this, usage for us is in commands that deviate from the behavior established by multiple Pokémon query equivalent
fun isSubSetOf(properties: PokemonProperties): Boolean {
level?.takeIf { it != properties.level }?.let { return false }
shiny?.takeIf { it != ("shiny" in properties.aspects) }?.let { return false }
gender?.takeIf { it != properties.gender }?.let { return false }
species?.run {
try {
// TODO get context on this bit, it's highly unlikely two randoms would result in the same Pokémon, doesn't mean the prop is not equal?
val species = if (this == "random") {
PokemonSpecies.species.random()
} else {
@@ -509,9 +442,9 @@ open class PokemonProperties {
if (properties.species != species.toString()) {
return false
}
} catch (e: InvalidIdentifierException) {}
} catch (_: InvalidIdentifierException) {}
}
nickname?.takeIf { it != properties.nickname }?.let { return false }
nickname?.takeIf { it.string != properties.nickname?.string }?.let { return false }
form?.takeIf { !it.equals(properties.form, true) }?.let { return false }
friendship?.takeIf { it != properties.friendship }?.let { return false }
pokeball?.takeIf { it != properties.pokeball }?.let { return false }
@@ -551,20 +484,18 @@ open class PokemonProperties {
// TEST YOUR LUCK!
fun roll(pokemon: Pokemon) {
val baseTypes = pokemon.species.types.toList()
val baseTypes = pokemon.form.types.toList()
if (this.shiny == null) pokemon.shiny = Cobblemon.config.shinyRate.checkRate()
if (this.teraType == null) pokemon.teraType =
if (Cobblemon.config.teraTypeRate.checkRate()) ElementalTypes.all().filter { !baseTypes.contains(it) }.random()
else baseTypes.random()
if (Cobblemon.config.teraTypeRate.checkRate()) TeraTypes.random(true)
else TeraTypes.forElementalType(baseTypes.random())
}
// If the config value is at least 1, then do 1/x and use that as the property chance
private fun Float.checkRate(): Boolean = this >= 1 && (Random.Default.nextFloat() < 1 / this)
fun createEntity(world: World): PokemonEntity {
return PokemonEntity(world, create())
}
// TODO Codecs at some point
fun saveToNBT(): NbtCompound {
val nbt = NbtCompound()
originalString.let { nbt.putString(DataKeys.POKEMON_PROPERTIES_ORIGINAL_TEXT, it) }
@@ -593,6 +524,7 @@ open class PokemonProperties {
return nbt
}
// TODO Codecs at some point
fun loadFromNBT(tag: NbtCompound): PokemonProperties {
originalString = tag.getString(DataKeys.POKEMON_PROPERTIES_ORIGINAL_TEXT)
level = if (tag.contains(DataKeys.POKEMON_LEVEL)) tag.getInt(DataKeys.POKEMON_LEVEL) else null
@@ -621,6 +553,7 @@ open class PokemonProperties {
return this
}
// TODO Codecs at some point
fun saveToJSON(): JsonObject {
val json = JsonObject()
originalString.let { json.addProperty(DataKeys.POKEMON_PROPERTIES_ORIGINAL_TEXT, it) }
@@ -650,6 +583,7 @@ open class PokemonProperties {
return json
}
// TODO Codecs at some point
fun loadFromJSON(json: JsonObject): PokemonProperties {
originalString = json.get(DataKeys.POKEMON_PROPERTIES_ORIGINAL_TEXT)?.asString ?: ""
level = json.get(DataKeys.POKEMON_LEVEL)?.asInt
@@ -727,4 +661,21 @@ open class PokemonProperties {
fun copy(): PokemonProperties {
return PokemonProperties().loadFromJSON(saveToJSON())
}
// If the config value is at least 1, then do 1/x and use that as the property chance
private fun Float.checkRate(): Boolean = this >= 1 && (Random.Default.nextFloat() < 1 / this)
/**
* Attempts to find an ability by ID and resolve if it should be forced or if it's legal for the given form.
*
* @param id The literal ID of the [Ability] being mapped.
* @param form The [FormData] whose [FormData.abilities] is queried for legality.
* @return The [Ability] with the [Ability.forced] state necessary for the given [form].
*/
private fun createAbility(id: String, form: FormData): Ability? {
val ability = Abilities.get(id) ?: return null
val potentialAbility = form.abilities.firstOrNull { potential -> potential.template == ability } ?: return ability.create(true)
return potentialAbility.template.create(false)
}
}
@@ -48,6 +48,11 @@ fun interface PokemonPropertyExtractor {
@JvmField
val STATUS = add { pokemon, properties -> properties.status = pokemon.status?.status?.showdownName }
@JvmField
val ILLUSION = mutableListOf(SPECIES, FORM, ASPECTS, GENDER, NICKNAME, SHINY)
@JvmField
val TRANSFORM = mutableListOf(SPECIES, FORM, ASPECTS, GENDER)
fun add(extractor: PokemonPropertyExtractor): PokemonPropertyExtractor {
ALL.add(extractor)
return extractor
@@ -96,7 +96,7 @@ object PokemonSpecies : JsonDataRegistry<Species> {
.registerTypeAdapter(TypeToken.getParameterized(RegistryLikeCondition::class.java, Item::class.java).type, ItemLikeConditionAdapter)
.registerTypeAdapter(TypeToken.getParameterized(RegistryLikeCondition::class.java, Structure::class.java).type, StructureLikeConditionAdapter)
.registerTypeAdapter(EggGroup::class.java, EggGroupAdapter)
.registerTypeAdapter(StatusEffect::class.java, RegistryElementAdapter<StatusEffect> { Registries.STATUS_EFFECT })
.registerTypeAdapter(StatusEffect::class.java, RegistryElementAdapter<StatusEffect>(Registries::STATUS_EFFECT))
.registerTypeAdapter(NbtItemPredicate::class.java, NbtItemPredicateAdapter)
.disableHtmlEscaping()
.enableComplexMapKeySerialization()
@@ -49,6 +49,26 @@ enum class Stats(override val identifier: Identifier, override val displayName:
*/
val BATTLE_ONLY: Set<Stat> = EnumSet.of(EVASION, ACCURACY)
/** Gets the [Stat] from the respective Showdown id. */
fun getStat(statKey: String) = when(statKey) {
"hp" -> HP
"atk" -> ATTACK
"def" -> DEFENCE
"spa" -> SPECIAL_ATTACK
"spd" -> SPECIAL_DEFENCE
"spe" -> SPEED
"evasion" -> EVASION
else -> ACCURACY
}
/** Gets the severity lang key from the respective boost/unboost stage. */
fun getSeverity(stages: Int) = when(stages) {
0 -> "cap.single"
1 -> "slight"
2 -> "sharp"
else -> "severe"
}
}
}
@@ -8,6 +8,8 @@
package com.cobblemon.mod.common.api.scheduling
import java.util.concurrent.CompletableFuture
/**
* An interface for which an implementation must provide a [SchedulingTracker] so that the standard scheduling
* functions can be executed.
@@ -52,5 +54,13 @@ interface Schedulable {
}
}
fun delayedFuture(seconds: Float): CompletableFuture<Unit> {
val future = CompletableFuture<Unit>()
after(seconds = seconds) {
future.complete(Unit)
}
return future
}
fun taskBuilder(): ScheduledTask.Builder = ScheduledTask.Builder().tracker(schedulingTracker)
}
@@ -9,6 +9,7 @@
package com.cobblemon.mod.common.api.scheduling
import java.util.concurrent.CompletableFuture
import com.cobblemon.mod.common.util.runOnServer
@Deprecated("Use afterOnServer or afterOnClient; ambiguous side is not good for your health")
@JvmOverloads
@@ -45,4 +46,12 @@ fun lerp(seconds: Float = 0F, serverThread: Boolean = false, action: (Float) ->
fun lerpOnServer(seconds: Float = 0F, action: (Float) -> Unit) = ServerTaskTracker.lerp(seconds = seconds, action = action)
@JvmOverloads
fun lerpOnClient(seconds: Float = 0F, action: (Float) -> Unit) = ClientTaskTracker.lerp(seconds = seconds, action = action)
fun taskBuilder() = ScheduledTask.Builder()
fun taskBuilder() = ScheduledTask.Builder()
fun delayedFuture(seconds: Float): CompletableFuture<Unit> {
val future = CompletableFuture<Unit>()
afterOnServer(seconds = seconds) {
future.complete(Unit)
}
return future
}
@@ -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.api.scripting
import com.bedrockk.molang.runtime.MoLangRuntime
import com.bedrockk.molang.runtime.value.MoValue
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.CobblemonNetwork.sendPacket
import com.cobblemon.mod.common.api.data.DataRegistry
import com.cobblemon.mod.common.api.molang.ExpressionLike
import com.cobblemon.mod.common.api.reactive.SimpleObservable
import com.cobblemon.mod.common.net.messages.client.data.ScriptRegistrySyncPacket
import com.cobblemon.mod.common.util.asExpressionLike
import com.cobblemon.mod.common.util.cobblemonResource
import com.cobblemon.mod.common.util.endsWith
import java.io.File
import java.util.concurrent.ExecutionException
import net.minecraft.resource.ResourceManager
import net.minecraft.resource.ResourceType
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.Identifier
object CobblemonScripts : DataRegistry {
const val MOLANG_EXTENSION = ".molang"
override val id = cobblemonResource("molang")
override val type = ResourceType.SERVER_DATA
override val observable = SimpleObservable<CobblemonScripts>()
val clientScripts = mutableMapOf<Identifier, ExpressionLike>()
val scripts = mutableMapOf<Identifier, ExpressionLike>()
override fun reload(manager: ResourceManager) {
manager.findResources("molang") { path -> path.endsWith(MOLANG_EXTENSION) }.forEach { (identifier, resource) ->
resource.inputStream.use { stream ->
stream.bufferedReader().use { reader ->
val resolvedIdentifier = Identifier(identifier.namespace, File(identifier.path).nameWithoutExtension)
try {
val expression = reader.readText().asExpressionLike()
if (identifier.path.startsWith("molang/client/")) {
clientScripts[resolvedIdentifier] = expression
} else {
scripts[resolvedIdentifier] = expression
}
} catch (exception: Exception) {
throw ExecutionException("Error loading MoLang script: $identifier", exception)
}
}
}
}
Cobblemon.LOGGER.info("Loaded ${scripts.size} server scripts and ${clientScripts.size} client scripts")
observable.emit(this)
}
override fun sync(player: ServerPlayerEntity) {
player.sendPacket(ScriptRegistrySyncPacket(clientScripts.entries))
}
fun run(identifier: Identifier, runtime: MoLangRuntime): MoValue? {
return scripts[identifier]?.resolve(runtime)
}
}
@@ -20,7 +20,6 @@ import com.mojang.serialization.codecs.PrimitiveCodec
import com.mojang.serialization.codecs.RecordCodecBuilder
import net.minecraft.network.PacketByteBuf
import net.minecraft.util.Identifier
import net.minecraft.util.math.Vec3d
/**
* Effect details for the actual particles of a particle effect.
@@ -44,48 +43,106 @@ class BedrockParticle(
var cameraMode: ParticleCameraMode = RotateXYZCameraMode(),
var tinting: ParticleTinting = ExpressionParticleTinting(),
var collision: ParticleCollision = ParticleCollision(),
var environmentLighting: Boolean = false
var environmentLighting: Boolean = false,
var creationEvents: MutableList<SimpleEventTrigger> = mutableListOf(),
var expirationEvents: MutableList<SimpleEventTrigger> = mutableListOf(),
var timeline: EventTriggerTimeline = EventTriggerTimeline(mutableMapOf())
) {
class ExpressionSet(
val sizeX: Expression,
val sizeY: Expression,
val maxAge: Expression,
val killExpression: Expression,
val updateExpressions: MutableList<Expression>,
val renderExpressions: MutableList<Expression>
)
/*
"creation_event": "event_sendspark",
"expiration_event": ["event_spark", "event_afterspark", "event_capturestar"],
"timeline": {
"21.00": "event_spark"
}
*/
class EventSet(
val creationEvents: MutableList<SimpleEventTrigger>,
val expirationEvents: MutableList<SimpleEventTrigger>,
val timeline: EventTriggerTimeline
)
// kill plane maybe
companion object {
val CODEC: Codec<BedrockParticle> = RecordCodecBuilder.create { instance ->
val EXPRESSION_SET_CODEC = RecordCodecBuilder.create<ExpressionSet> { instance ->
instance.group(
Identifier.CODEC.fieldOf("texture").forGetter { it.texture },
PrimitiveCodec.STRING.fieldOf("material").forGetter { it.material.name },
ParticleUVMode.codec.fieldOf("uvMode").forGetter { it.uvMode },
EXPRESSION_CODEC.fieldOf("sizeX").forGetter { it.sizeX },
EXPRESSION_CODEC.fieldOf("sizeY").forGetter { it.sizeY },
EXPRESSION_CODEC.fieldOf("maxAge").forGetter { it.maxAge },
EXPRESSION_CODEC.fieldOf("killExpression").forGetter { it.killExpression },
ListCodec(EXPRESSION_CODEC).fieldOf("updateExpressions").forGetter { it.updateExpressions },
ListCodec(EXPRESSION_CODEC).fieldOf("renderExpressions").forGetter { it.renderExpressions },
ListCodec(EXPRESSION_CODEC).fieldOf("renderExpressions").forGetter { it.renderExpressions }
).apply(instance, ::ExpressionSet)
}
val EVENT_SET_CODEC = RecordCodecBuilder.create<EventSet> { instance ->
instance.group(
ListCodec(SimpleEventTrigger.CODEC).fieldOf("creationEvents").forGetter { it.creationEvents },
ListCodec(SimpleEventTrigger.CODEC).fieldOf("expirationEvents").forGetter { it.expirationEvents },
EventTriggerTimeline.CODEC.fieldOf("timeline").forGetter { it.timeline }
).apply(instance, ::EventSet)
}
val CODEC: Codec<BedrockParticle> = RecordCodecBuilder.create { instance ->
instance.group(
Identifier.CODEC.fieldOf("texture").forGetter { it.texture },
PrimitiveCodec.STRING.fieldOf("material").forGetter { it.material.name },
ParticleUVMode.codec.fieldOf("uvMode").forGetter { it.uvMode },
EXPRESSION_SET_CODEC.fieldOf("expressionSet").forGetter {
ExpressionSet(
it.sizeX,
it.sizeY,
it.maxAge,
it.killExpression,
it.updateExpressions,
it.renderExpressions
)
},
ParticleMotion.codec.fieldOf("motion").forGetter { it.motion },
ParticleRotation.codec.fieldOf("rotation").forGetter { it.rotation },
ParticleViewDirection.codec.fieldOf("viewDirection").forGetter { it.viewDirection },
ParticleCameraMode.codec.fieldOf("cameraMode").forGetter { it.cameraMode },
ParticleTinting.codec.fieldOf("tinting").forGetter { it.tinting },
ParticleCollision.CODEC.fieldOf("collision").forGetter { it.collision },
PrimitiveCodec.BOOL.fieldOf("environmentLighting").forGetter { it.environmentLighting }
PrimitiveCodec.BOOL.fieldOf("environmentLighting").forGetter { it.environmentLighting },
EVENT_SET_CODEC.fieldOf("eventSet").forGetter {
EventSet(
it.creationEvents,
it.expirationEvents,
it.timeline
)
}
).apply(instance) {
texture, materialStr, uvMode, sizeX, sizeY, maxAge, killExpression, updateExpressions,
renderExpressions, motion, rotation, viewDirection, cameraMode, tinting, collision, environmentLighting ->
texture, materialStr, uvMode, expressionSet, motion, rotation, viewDirection, cameraMode, tinting, collision, environmentLighting, eventSet ->
BedrockParticle(
texture = texture,
material = ParticleMaterial.valueOf(materialStr),
uvMode = uvMode,
sizeX = sizeX,
sizeY = sizeY,
maxAge = maxAge,
killExpression = killExpression,
updateExpressions = updateExpressions,
renderExpressions = renderExpressions,
sizeX = expressionSet.sizeX,
sizeY = expressionSet.sizeY,
maxAge = expressionSet.maxAge,
killExpression = expressionSet.killExpression,
updateExpressions = expressionSet.updateExpressions,
renderExpressions = expressionSet.renderExpressions,
motion = motion,
rotation = rotation,
viewDirection = viewDirection,
cameraMode = cameraMode,
tinting = tinting,
collision = collision,
environmentLighting = environmentLighting
environmentLighting = environmentLighting,
creationEvents = eventSet.creationEvents,
expirationEvents = eventSet.expirationEvents,
timeline = eventSet.timeline
)
}
}
@@ -108,6 +165,9 @@ class BedrockParticle(
ParticleTinting.writeToBuffer(buffer, tinting)
collision.writeToBuffer(buffer)
buffer.writeBoolean(environmentLighting)
buffer.writeCollection(creationEvents) { pb, event -> event.encode(pb) }
buffer.writeCollection(expirationEvents) { pb, event -> event.encode(pb) }
timeline.encode(buffer)
}
fun readFromBuffer(buffer: PacketByteBuf) {
@@ -127,5 +187,8 @@ class BedrockParticle(
tinting = ParticleTinting.readFromBuffer(buffer)
collision.readFromBuffer(buffer)
environmentLighting = buffer.readBoolean()
creationEvents = buffer.readList { SimpleEventTrigger("").also { it.decode(buffer) } }
expirationEvents = buffer.readList { SimpleEventTrigger("").also { it.decode(buffer) } }
timeline.decode(buffer)
}
}
@@ -10,7 +10,9 @@ package com.cobblemon.mod.common.api.snowstorm
import com.mojang.serialization.Codec
import com.mojang.serialization.codecs.ListCodec
import com.mojang.serialization.codecs.PrimitiveCodec
import com.mojang.serialization.codecs.RecordCodecBuilder
import com.mojang.serialization.codecs.UnboundedMapCodec
import net.minecraft.network.PacketByteBuf
import net.minecraft.util.Identifier
@@ -27,7 +29,8 @@ class BedrockParticleEffect(
var emitter: BedrockParticleEmitter = BedrockParticleEmitter(),
var particle: BedrockParticle = BedrockParticle(),
var curves: MutableList<MoLangCurve> = mutableListOf(),
var space: ParticleSpace = ParticleSpace()
var space: ParticleSpace = ParticleSpace(),
var events: MutableMap<String, ParticleEvent> = mutableMapOf()
) {
companion object {
val CODEC: Codec<BedrockParticleEffect> = RecordCodecBuilder.create { instance ->
@@ -36,14 +39,16 @@ class BedrockParticleEffect(
BedrockParticleEmitter.CODEC.fieldOf("emitter").forGetter { it.emitter },
BedrockParticle.CODEC.fieldOf("particle").forGetter { it.particle },
ListCodec(MoLangCurve.codec).fieldOf("curves").forGetter { it.curves },
ParticleSpace.CODEC.fieldOf("space").forGetter { it.space }
).apply(instance) { id, emitter, particle, curves, space ->
ParticleSpace.CODEC.fieldOf("space").forGetter { it.space },
UnboundedMapCodec(PrimitiveCodec.STRING, ParticleEvent.CODEC).fieldOf("events").forGetter { it.events }
).apply(instance) { id, emitter, particle, curves, space, events ->
BedrockParticleEffect(
id = id,
emitter = emitter,
particle = particle,
curves = curves.toMutableList(),
space = space
space = space,
events = events
)
}
}
@@ -55,6 +60,7 @@ class BedrockParticleEffect(
particle.writeToBuffer(buffer)
buffer.writeCollection(curves) { pb, curve -> MoLangCurve.writeToBuffer(buffer, curve) }
space.writeToBuffer(buffer)
buffer.writeMap(events, { _, v -> buffer.writeString(v) }) { _, event -> event.encode(buffer) }
}
fun readFromBuffer(buffer: PacketByteBuf) {
@@ -63,5 +69,6 @@ class BedrockParticleEffect(
particle.readFromBuffer(buffer)
curves = buffer.readList { MoLangCurve.readFromBuffer(buffer) }
space.readFromBuffer(buffer)
events = buffer.readMap({ buffer.readString() }) { ParticleEvent().also { it.decode(buffer) } }
}
}
@@ -29,7 +29,12 @@ class BedrockParticleEmitter(
var updateExpressions: MutableList<Expression> = mutableListOf(),
var rate: ParticleEmitterRate = InstantParticleEmitterRate(),
var shape: ParticleEmitterShape = SphereParticleEmitterShape(),
var lifetime: ParticleEmitterLifetime = OnceEmitterLifetime(NumberExpression(1.0))
var lifetime: ParticleEmitterLifetime = OnceEmitterLifetime(NumberExpression(1.0)),
var eventTimeline: EventTriggerTimeline = EventTriggerTimeline(mutableMapOf()),
var creationEvents: MutableList<SimpleEventTrigger> = mutableListOf(),
var expirationEvents: MutableList<SimpleEventTrigger> = mutableListOf(),
var travelDistanceEvents: EventTriggerTimeline = EventTriggerTimeline(mutableMapOf()),
var loopingTravelDistanceEvents: MutableList<LoopingTravelDistanceEventTrigger> = mutableListOf()
) {
companion object {
val CODEC: Codec<BedrockParticleEmitter> = RecordCodecBuilder.create { instance ->
@@ -38,14 +43,24 @@ class BedrockParticleEmitter(
ListCodec(EXPRESSION_CODEC).fieldOf("updateExpressions").forGetter { it.updateExpressions },
ParticleEmitterRate.codec.fieldOf("rate").forGetter { it.rate },
ParticleEmitterShape.codec.fieldOf("shape").forGetter { it.shape },
ParticleEmitterLifetime.codec.fieldOf("lifetime").forGetter { it.lifetime }
).apply(instance) { startExpressions, updateExpressions, rate, shape, lifetime ->
ParticleEmitterLifetime.codec.fieldOf("lifetime").forGetter { it.lifetime },
EventTriggerTimeline.CODEC.fieldOf("eventTimeline").forGetter { it.eventTimeline },
ListCodec(SimpleEventTrigger.CODEC).fieldOf("creationEvents").forGetter { it.creationEvents },
ListCodec(SimpleEventTrigger.CODEC).fieldOf("expirationEvents").forGetter { it.expirationEvents },
EventTriggerTimeline.CODEC.fieldOf("travelDistanceEvents").forGetter { it.travelDistanceEvents },
ListCodec(LoopingTravelDistanceEventTrigger.CODEC).fieldOf("loopingTravelDistanceEvents").forGetter { it.loopingTravelDistanceEvents }
).apply(instance) { startExpressions, updateExpressions, rate, shape, lifetime, eventTimeline, creationEvents, expirationEvents, travelDistanceEvents, loopingTravelDistanceEvents ->
BedrockParticleEmitter(
startExpressions = startExpressions,
updateExpressions = updateExpressions,
shape = shape,
rate = rate,
lifetime = lifetime
lifetime = lifetime,
eventTimeline = eventTimeline,
creationEvents = creationEvents,
expirationEvents = expirationEvents,
travelDistanceEvents = travelDistanceEvents,
loopingTravelDistanceEvents = loopingTravelDistanceEvents
)
}
}
@@ -57,6 +72,11 @@ class BedrockParticleEmitter(
ParticleEmitterRate.writeToBuffer(buffer, rate)
ParticleEmitterShape.writeToBuffer(buffer, shape)
ParticleEmitterLifetime.writeToBuffer(buffer, lifetime)
eventTimeline.encode(buffer)
buffer.writeCollection(creationEvents) { pb, event -> event.encode(pb) }
buffer.writeCollection(expirationEvents) { pb, event -> event.encode(pb) }
travelDistanceEvents.encode(buffer)
buffer.writeCollection(loopingTravelDistanceEvents) { pb, event -> event.encode(pb) }
}
fun readFromBuffer(buffer: PacketByteBuf) {
@@ -65,5 +85,10 @@ class BedrockParticleEmitter(
rate = ParticleEmitterRate.readFromBuffer(buffer)
shape = ParticleEmitterShape.readFromBuffer(buffer)
lifetime = ParticleEmitterLifetime.readFromBuffer(buffer)
eventTimeline.decode(buffer)
creationEvents = buffer.readList { SimpleEventTrigger("").also { it.decode(buffer) } }
expirationEvents = buffer.readList { SimpleEventTrigger("").also { it.decode(buffer) } }
travelDistanceEvents.decode(buffer)
loopingTravelDistanceEvents = buffer.readList { LoopingTravelDistanceEventTrigger(0.0, mutableListOf()).also { it.decode(buffer) } }
}
}
@@ -123,10 +123,8 @@ class RotateYCameraMode : ParticleCameraMode {
viewDirection: Vec3d
): Quaternionf {
val i = if (angle == 0F) 0F else MathHelper.lerp(deltaTicks, prevAngle, angle)
val q2 = RotationAxis.POSITIVE_Y.rotationDegrees(/*180 - */cameraYaw)
val q2 = RotationAxis.POSITIVE_Y.rotationDegrees(-cameraYaw)
q2.hamiltonProduct(RotationAxis.POSITIVE_Z.rotationDegrees(i))
return q2
}
@@ -191,9 +189,10 @@ class LookAtY : ParticleCameraMode {
cameraPitch: Float,
viewDirection: Vec3d
): Quaternionf {
val rotation = Quaternionf(0F, 0F, 0F, 1F)
rotation.hamiltonProduct(RotationAxis.POSITIVE_Y.rotationDegrees(-cameraYaw))
return rotation
val i = if (angle == 0F) 0F else MathHelper.lerp(deltaTicks, prevAngle, angle)
val q2 = RotationAxis.POSITIVE_Y.rotationDegrees(-cameraYaw)
q2.hamiltonProduct(RotationAxis.POSITIVE_Z.rotationDegrees(i))
return q2
}
override fun <T> encode(ops: DynamicOps<T>) = CODEC.encodeStart(ops, this)
@@ -136,6 +136,11 @@ class LoopingEmitterLifetime(var activeTime: Expression = 1.0.asExpression(), va
val interval = activeTimeValue + sleepTime
val displacement = emitterAge % interval
runtime.environment.setSimpleVariable("emitter_lifetime", activeTime)
if (emitterAge > activeTimeValue && sleepTime == 0.0) {
return ParticleEmitterAction.STOP
}
return if (displacement < activeTimeValue) {
ParticleEmitterAction.GO
} else {
@@ -145,7 +145,7 @@ class PointParticleEmitterShape(
override val type = ParticleEmitterShapeType.POINT
override fun getNewParticlePosition(runtime: MoLangRuntime, entity: Entity?) = runtime.resolveVec3d(offset)
override fun getCenter(runtime: MoLangRuntime, entity: Entity?): Vec3d {
return getNewParticlePosition(runtime, entity) // Questionable
return Vec3d.ZERO
}
override fun <T> encode(ops: DynamicOps<T>) = CODEC.encodeStart(ops, this)
@@ -0,0 +1,174 @@
/*
* 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.snowstorm
import com.bedrockk.molang.runtime.MoLangRuntime
import com.cobblemon.mod.common.api.molang.ExpressionLike
import com.cobblemon.mod.common.api.molang.MoLangFunctions.getQueryStruct
import com.cobblemon.mod.common.api.molang.MoLangFunctions.setup
import com.cobblemon.mod.common.api.net.Decodable
import com.cobblemon.mod.common.api.net.Encodable
import com.cobblemon.mod.common.client.particle.BedrockParticleEffectRepository
import com.cobblemon.mod.common.client.particle.ParticleStorm
import com.cobblemon.mod.common.client.render.MatrixWrapper
import com.cobblemon.mod.common.client.render.SnowstormParticle
import com.cobblemon.mod.common.util.asExpressionLike
import com.mojang.serialization.Codec
import com.mojang.serialization.codecs.PrimitiveCodec
import com.mojang.serialization.codecs.RecordCodecBuilder
import net.minecraft.network.PacketByteBuf
import net.minecraft.sound.SoundCategory
import net.minecraft.sound.SoundEvent
import net.minecraft.util.Identifier
import net.minecraft.util.math.Vec3d
/**
* An event that can be referenced from various particle event triggers. The events are not necessarily particles,
* but can be combinations of particles, sounds, and MoLang expressions.
*
* @author Hiroku
* @since March 2nd, 2024
*/
class ParticleEvent(
var particleEffect: EventParticleEffect? = null,
var soundEffect: EventSoundEffect? = null,
var expression: ExpressionLike? = null
): Encodable, Decodable {
companion object {
val CODEC: Codec<ParticleEvent> = RecordCodecBuilder.create { instance ->
instance.group(
EventParticleEffect.CODEC.optionalFieldOf("particle_effect", null).forGetter { it.particleEffect },
EventSoundEffect.CODEC.optionalFieldOf("sound_effect", null).forGetter { it.soundEffect },
PrimitiveCodec.STRING.optionalFieldOf("expression", null).forGetter { it.expression?.toString() }
).apply(instance) { particleEffect, soundEffect, expression ->
ParticleEvent(
particleEffect,
soundEffect,
expression?.asExpressionLike()
)
}
}
}
override fun encode(buffer: PacketByteBuf) {
buffer.writeNullable(particleEffect) { pb, effect ->
pb.writeIdentifier(effect.effect)
pb.writeEnumConstant(effect.type)
pb.writeNullable(effect.expression) { pb, expr -> pb.writeString(expr.toString()) }
}
buffer.writeNullable(soundEffect) { pb, effect -> pb.writeIdentifier(effect.sound) }
buffer.writeNullable(expression) { pb, expr -> pb.writeString(expr.toString()) }
}
override fun decode(buffer: PacketByteBuf) {
particleEffect = buffer.readNullable { pb -> EventParticleEffect(
pb.readIdentifier(),
pb.readEnumConstant(EventParticleEffect.EventParticleType::class.java),
pb.readNullable { pb.readString().asExpressionLike() }
) }
soundEffect = buffer.readNullable { pb -> EventSoundEffect(pb.readIdentifier()) }
expression = buffer.readNullable { pb -> pb.readString().asExpressionLike() }
}
fun run(storm: ParticleStorm, particle: SnowstormParticle?) {
particleEffect?.let { effect ->
val bedrockParticleEffect = BedrockParticleEffectRepository.getEffect(effect.effect) ?: return@let
val rootMatrix = when (effect.type) {
EventParticleEffect.EventParticleType.EMITTER -> MatrixWrapper().updatePosition(storm.matrixWrapper.getOrigin())
EventParticleEffect.EventParticleType.EMITTER_BOUND -> storm.matrixWrapper
EventParticleEffect.EventParticleType.PARTICLE,
EventParticleEffect.EventParticleType.PARTICLE_WITH_VELOCITY -> (particle?.let { Vec3d(it.getX(), it.getY(), it.getZ()) } ?: Vec3d(storm.getX(), storm.getY(), storm.getZ())).let { MatrixWrapper().updatePosition(it) }
}
val sourceVelocity = when (effect.type) {
EventParticleEffect.EventParticleType.EMITTER -> storm.sourceVelocity().let { { it } }
EventParticleEffect.EventParticleType.EMITTER_BOUND -> storm.sourceVelocity
EventParticleEffect.EventParticleType.PARTICLE -> { { Vec3d.ZERO } }
EventParticleEffect.EventParticleType.PARTICLE_WITH_VELOCITY -> (particle?.let { Vec3d(it.getVelocityX(), it.getVelocityY(), it.getVelocityZ()) } ?: Vec3d.ZERO).let { { it } }
}
val newStorm = ParticleStorm(
effect = bedrockParticleEffect,
matrixWrapper = rootMatrix,
world = storm.world,
sourceVelocity = sourceVelocity,
sourceAlive = storm.sourceAlive,
sourceVisible = storm.sourceVisible,
onDespawn = {},
runtime = MoLangRuntime().setup().also { it.environment.structs["query"] = storm.runtime.environment.getQueryStruct() },
entity = storm.entity
)
effect.expression?.resolve(newStorm.runtime)
newStorm.spawn()
}
soundEffect?.let { effect ->
val position = particle?.let { Vec3d(it.getX(), it.getY(), it.getZ()) } ?: Vec3d(storm.getX(), storm.getY(), storm.getZ())
val world = storm.world
val soundEvent = SoundEvent.of(effect.sound)
world.playSound(position.x, position.y, position.z, soundEvent, SoundCategory.NEUTRAL, 1F, 1F, true)
}
expression?.resolve(storm.runtime)
}
}
/**
* A particle component of a [ParticleEvent]. It contains the effect to play, the spawning type, and a pre-run
* expression to run in the new storm's runtime.
*
* @author Hiroku
* @since March 2nd, 2024
*/
class EventParticleEffect(
val effect: Identifier,
val type: EventParticleType,
val expression: ExpressionLike? = null
) {
companion object {
val CODEC = RecordCodecBuilder.create<EventParticleEffect> { instance ->
instance.group(
Identifier.CODEC.fieldOf("effect").forGetter { it.effect },
PrimitiveCodec.STRING.fieldOf("type").forGetter { it.type.name },
PrimitiveCodec.STRING.optionalFieldOf("expression", null).forGetter { it.expression?.toString() }
).apply(instance) { effect, type, expression ->
EventParticleEffect(
effect,
EventParticleType.valueOf(type),
expression?.asExpressionLike()
)
}
}
}
enum class EventParticleType {
EMITTER,
EMITTER_BOUND,
PARTICLE,
PARTICLE_WITH_VELOCITY
}
}
/**
* A simple sound effect component of a [ParticleEvent]. Plays a sound at the particle location, or if run from an
* emitter event, at the emitter's location.
*
* @author Hiroku
* @since March 2nd, 2024
*/
class EventSoundEffect(
val sound: Identifier,
) {
companion object {
val CODEC = RecordCodecBuilder.create<EventSoundEffect> { instance ->
instance.group(
Identifier.CODEC.fieldOf("sound").forGetter { it.sound }
).apply(instance, ::EventSoundEffect)
}
}
}
@@ -0,0 +1,118 @@
/*
* 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.snowstorm
import com.cobblemon.mod.common.api.net.Decodable
import com.cobblemon.mod.common.api.net.Encodable
import com.cobblemon.mod.common.client.particle.ParticleStorm
import com.cobblemon.mod.common.client.render.SnowstormParticle
import com.mojang.serialization.codecs.PrimitiveCodec
import com.mojang.serialization.codecs.RecordCodecBuilder
import com.mojang.serialization.codecs.UnboundedMapCodec
import net.minecraft.network.PacketByteBuf
/*
* The different references to events that can be triggered by an effect.
*/
/**
* It really is simple.
*
* @author Hiroku
* @since March 2nd, 2024
*/
class SimpleEventTrigger(var event: String): Encodable, Decodable {
companion object {
val CODEC = RecordCodecBuilder.create<SimpleEventTrigger> { instance ->
instance.group(
PrimitiveCodec.STRING.fieldOf("event").forGetter { it.event }
).apply(instance, ::SimpleEventTrigger)
}
}
override fun encode(buffer: PacketByteBuf) {
buffer.writeString(event)
}
override fun decode(buffer: PacketByteBuf) {
event = buffer.readString()
}
fun trigger(storm: ParticleStorm, particle: SnowstormParticle?) {
val event = storm.effect.events[event] ?: return
event.run(storm, particle)
}
}
/**
* An event trigger that outlines specific times at which point groups of effects will play. This can be used
* on the basis of time but is also used in the case of travel distance.
*
* @author Hiroku
* @since March 2nd, 2024
*/
class EventTriggerTimeline(var map: MutableMap<Double, MutableList<String>>): Encodable, Decodable {
companion object {
val CODEC = RecordCodecBuilder.create<EventTriggerTimeline> { instance ->
instance.group(
UnboundedMapCodec(PrimitiveCodec.DOUBLE, PrimitiveCodec.STRING.listOf()).fieldOf("map").forGetter { it.map }
).apply(instance, ::EventTriggerTimeline)
}
}
override fun encode(buffer: PacketByteBuf) {
buffer.writeMap(map, { pb, k -> pb.writeDouble(k) }, { pb, v -> pb.writeCollection(v) { _, s -> pb.writeString(s) } })
}
override fun decode(buffer: PacketByteBuf) {
map = buffer.readMap({ pb -> pb.readDouble() }, { pb -> pb.readList { pb.readString() } })
}
fun check(storm: ParticleStorm, particle: SnowstormParticle?, previousTime: Double, newTime: Double) {
val events = map.entries.filter { it.key in previousTime..newTime }.flatMap { it.value }
events.forEach { event ->
val event = storm.effect.events[event] ?: return
event.run(storm, particle)
}
}
}
/**
* An event trigger that takes the total distance travelled by the emitter and modulos it across [distance] to know
* if we need to play it again.
*
* @author Hiroku
* @since March 2nd, 2024
*/
class LoopingTravelDistanceEventTrigger(var distance: Double, var events: MutableList<String>): Encodable, Decodable {
companion object {
val CODEC = RecordCodecBuilder.create<LoopingTravelDistanceEventTrigger> { instance ->
instance.group(
PrimitiveCodec.DOUBLE.fieldOf("distance").forGetter { it.distance },
PrimitiveCodec.STRING.listOf().fieldOf("events").forGetter { it.events }
).apply(instance, ::LoopingTravelDistanceEventTrigger)
}
}
override fun encode(buffer: PacketByteBuf) {
buffer.writeDouble(distance)
buffer.writeCollection(events) { _, s -> buffer.writeString(s) }
}
override fun decode(buffer: PacketByteBuf) {
distance = buffer.readDouble()
events = buffer.readList { buffer.readString() }
}
fun check(storm: ParticleStorm, particle: SnowstormParticle?, previousDistance: Double, currentDistance: Double) {
if (previousDistance < distance && currentDistance >= distance) {
events.mapNotNull { storm.effect.events[it] }.forEach { it.run(storm, particle) }
}
}
}
@@ -140,7 +140,7 @@ class InwardsMotionDirection : ParticleMotionDirection {
return if (particlePos == emitterPos) {
Vec3d(storm.world.random.nextDouble() - 0.5, storm.world.random.nextDouble() - 0.5, storm.world.random.nextDouble() - 0.5)
} else {
particlePos.subtract(emitterPos)
emitterPos.subtract(particlePos)
}.normalize()
}
override fun <T> encode(ops: DynamicOps<T>) = CODEC.encodeStart(ops, this)
@@ -65,7 +65,7 @@ class DynamicParticleRotation(
override val type = ParticleRotationType.DYNAMIC
override fun <T> encode(ops: DynamicOps<T>) = CODEC.encodeStart(ops, this)
override fun getInitialRotation(runtime: MoLangRuntime) = runtime.resolveDouble(startRotation)
override fun getInitialAngularVelocity(runtime: MoLangRuntime) = runtime.resolveDouble(speed)
override fun getInitialAngularVelocity(runtime: MoLangRuntime) = runtime.resolveDouble(speed) / 20
override fun getAngularAcceleration(runtime: MoLangRuntime, angularVelocity: Double): Double {
val acceleration = runtime.resolveDouble(acceleration)
val nextVelocity = angularVelocity + acceleration
@@ -12,11 +12,13 @@ import com.cobblemon.mod.common.Cobblemon.LOGGER
import com.cobblemon.mod.common.api.entity.Despawner
import com.cobblemon.mod.common.api.spawning.condition.AreaSpawningCondition
import com.cobblemon.mod.common.api.spawning.condition.BasicSpawningCondition
import com.cobblemon.mod.common.api.spawning.condition.FishingSpawningCondition
import com.cobblemon.mod.common.api.spawning.condition.GroundedSpawningCondition
import com.cobblemon.mod.common.api.spawning.condition.SpawningCondition
import com.cobblemon.mod.common.api.spawning.condition.SubmergedSpawningCondition
import com.cobblemon.mod.common.api.spawning.condition.SurfaceSpawningCondition
import com.cobblemon.mod.common.api.spawning.context.AreaContextResolver
import com.cobblemon.mod.common.api.spawning.context.FishingSpawningContext
import com.cobblemon.mod.common.api.spawning.context.GroundedSpawningContext
import com.cobblemon.mod.common.api.spawning.context.LavafloorSpawningContext
import com.cobblemon.mod.common.api.spawning.context.SeafloorSpawningContext
@@ -29,9 +31,11 @@ import com.cobblemon.mod.common.api.spawning.context.calculators.SeafloorSpawnin
import com.cobblemon.mod.common.api.spawning.context.calculators.SpawningContextCalculator
import com.cobblemon.mod.common.api.spawning.context.calculators.SubmergedSpawningContextCalculator
import com.cobblemon.mod.common.api.spawning.context.calculators.SurfaceSpawningContextCalculator
import com.cobblemon.mod.common.api.spawning.detail.NPCSpawnDetail
import com.cobblemon.mod.common.api.spawning.detail.PokemonSpawnDetail
import com.cobblemon.mod.common.api.spawning.detail.SpawnAction
import com.cobblemon.mod.common.api.spawning.detail.SpawnDetail
import com.cobblemon.mod.common.api.spawning.fishing.FishingSpawner
import com.cobblemon.mod.common.api.spawning.influence.SpawningInfluence
import com.cobblemon.mod.common.api.spawning.preset.BasicSpawnDetailPreset
import com.cobblemon.mod.common.api.spawning.preset.BestSpawnerConfig
@@ -83,6 +87,7 @@ object BestSpawner {
var config = BestSpawnerConfig()
val spawnerManagers = mutableListOf<SpawnerManager>(CobblemonWorldSpawnerManager)
var defaultPokemonDespawner: Despawner<PokemonEntity> = CobblemonAgingDespawner(getAgeTicks = { it.ticksLived })
lateinit var fishingSpawner: FishingSpawner
fun loadConfig() {
LOGGER.info("Starting the Best Spawner...")
@@ -91,6 +96,7 @@ object BestSpawner {
SpawningCondition.register(SubmergedSpawningCondition.NAME, SubmergedSpawningCondition::class.java)
SpawningCondition.register(GroundedSpawningCondition.NAME, GroundedSpawningCondition::class.java)
SpawningCondition.register(SurfaceSpawningCondition.NAME, SurfaceSpawningCondition::class.java)
SpawningCondition.register(FishingSpawningCondition.NAME, FishingSpawningCondition::class.java)
LOGGER.info("Loaded ${SpawningCondition.conditionTypes.size} spawning condition types.")
SpawningContextCalculator.register(GroundedSpawningContextCalculator)
@@ -104,10 +110,12 @@ object BestSpawner {
SpawningContext.register(name = "lavafloor", clazz = LavafloorSpawningContext::class.java, defaultCondition = GroundedSpawningCondition.NAME)
SpawningContext.register(name = "submerged", clazz = SubmergedSpawningContext::class.java, defaultCondition = SubmergedSpawningCondition.NAME)
SpawningContext.register(name = "surface", clazz = SurfaceSpawningContext::class.java, defaultCondition = SurfaceSpawningCondition.NAME)
SpawningContext.register(name = "fishing", clazz = FishingSpawningContext::class.java, defaultCondition = FishingSpawningCondition.NAME)
LOGGER.info("Loaded ${SpawningContext.contexts.size} spawning context types.")
SpawnDetail.registerSpawnType(name = PokemonSpawnDetail.TYPE, PokemonSpawnDetail::class.java)
SpawnDetail.registerSpawnType(name = NPCSpawnDetail.TYPE, NPCSpawnDetail::class.java)
LOGGER.info("Loaded ${SpawnDetail.spawnDetailTypes.size} spawn detail types.")
config = BestSpawnerConfig.load()
@@ -118,5 +126,6 @@ object BestSpawner {
fun onServerStarted() {
spawnerManagers.forEach(SpawnerManager::onServerStarted)
fishingSpawner = FishingSpawner()
}
}
@@ -12,6 +12,8 @@ import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.api.spawning.spawner.PlayerSpawner
import com.cobblemon.mod.common.api.spawning.spawner.PlayerSpawnerFactory
import com.cobblemon.mod.common.platform.events.PlatformEvents
import com.cobblemon.mod.common.util.server
import com.cobblemon.mod.common.world.gamerules.CobblemonGameRules
import java.util.UUID
import net.minecraft.server.network.ServerPlayerEntity
@@ -34,7 +36,7 @@ object CobblemonWorldSpawnerManager : SpawnerManager() {
fun onPlayerLogin(player: ServerPlayerEntity) {
// Disables spawning
if (!Cobblemon.config.enableSpawning) {
if (!Cobblemon.config.enableSpawning || server()?.gameRules?.getBoolean(CobblemonGameRules.DO_POKEMON_SPAWNING) == false) {
return;
}
@@ -10,6 +10,7 @@ package com.cobblemon.mod.common.api.spawning
import com.bedrockk.molang.Expression
import com.cobblemon.mod.common.api.data.JsonDataRegistry
import com.cobblemon.mod.common.api.molang.ExpressionLike
import com.cobblemon.mod.common.api.reactive.SimpleObservable
import com.cobblemon.mod.common.api.spawning.condition.SpawningCondition
import com.cobblemon.mod.common.api.spawning.influence.SpawningInfluence
@@ -24,6 +25,7 @@ import com.cobblemon.mod.common.api.spawning.rules.selector.ExpressionSpawningCo
import com.cobblemon.mod.common.api.spawning.rules.selector.SpawnDetailSelector
import com.cobblemon.mod.common.api.spawning.rules.selector.SpawningContextSelector
import com.cobblemon.mod.common.util.adapters.ExpressionAdapter
import com.cobblemon.mod.common.util.adapters.ExpressionLikeAdapter
import com.cobblemon.mod.common.util.adapters.SpawnDetailSelectorAdapter
import com.cobblemon.mod.common.util.adapters.SpawnRuleComponentAdapter
import com.cobblemon.mod.common.util.adapters.SpawningConditionAdapter
@@ -50,6 +52,7 @@ object CobblemonSpawnRules : JsonDataRegistry<SpawnRule> {
.registerTypeAdapter(SpawningContextSelector::class.java, SpawningContextSelectorAdapter)
.registerTypeAdapter(SpawningCondition::class.java, SpawningConditionAdapter)
.registerTypeAdapter(Expression::class.java, ExpressionAdapter)
.registerTypeAdapter(ExpressionLike::class.java, ExpressionLikeAdapter)
.registerTypeAdapter(Text::class.java, TextAdapter)
.create()
@@ -8,11 +8,22 @@
package com.cobblemon.mod.common.api.spawning
import com.cobblemon.mod.common.api.spawning.influence.SpawningInfluence
import com.cobblemon.mod.common.api.spawning.spawner.Spawner
import com.cobblemon.mod.common.util.server
import net.minecraft.entity.Entity
import net.minecraft.entity.EntityType
open class SpawnCause(
val spawner: Spawner,
val bucket: SpawnBucket,
val entity: Entity? = null
)
entity: Entity? = null
): SpawningInfluence {
val entityWorldId = entity?.world?.registryKey
val entityId = entity?.id
val entityUUID = entity?.uuid
val entityType = entity?.type
val entity: Entity?
get() = if (entityType == EntityType.PLAYER) server()?.playerManager?.getPlayer(entityUUID) else server()?.getWorld(entityWorldId)?.getEntityById(entityId!!)
}
@@ -12,6 +12,8 @@ import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.api.spawning.influence.SpawningInfluence
import com.cobblemon.mod.common.api.spawning.spawner.Spawner
import com.cobblemon.mod.common.api.spawning.spawner.TickingSpawner
import com.cobblemon.mod.common.util.server
import com.cobblemon.mod.common.world.gamerules.CobblemonGameRules.DO_POKEMON_SPAWNING
/**
* A manager of various spawners. This is a class in which you should register
@@ -49,7 +51,7 @@ open class SpawnerManager {
open fun onServerTick() {
// Disables spawning
if (!Cobblemon.config.enableSpawning) {
if (!Cobblemon.config.enableSpawning || server()?.gameRules?.getBoolean(DO_POKEMON_SPAWNING) == false) {
return
}
influences.removeIf { it.isExpired() }
@@ -35,11 +35,13 @@ class TimeRange : IntRanges {
"night" to TimeRange(12542..23459),
"noon" to TimeRange(5000..6999),
"midnight" to TimeRange(17000..18999),
"dawn" to TimeRange(22300..23999, 0..166),
"dawn" to TimeRange(22300..23999, 0..999),
"dusk" to TimeRange(11834..13701),
"twilight" to TimeRange(11834..13701, 22300..23999, 0..166),
"morning" to TimeRange(0..4999),
"afternoon" to TimeRange(7000..12039)
"morning" to TimeRange(23000..23999, 0..4999),
"afternoon" to TimeRange(7000..12999),
"predawn" to TimeRange(19000..22999),
"evening" to TimeRange(13000..16999)
)
}
@@ -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.api.spawning.condition
import com.cobblemon.mod.common.api.conditional.RegistryLikeCondition
import com.cobblemon.mod.common.api.spawning.context.FishingSpawningContext
import com.cobblemon.mod.common.util.itemRegistry
import net.minecraft.block.Block
import net.minecraft.item.Item
/**
* A spawning condition that applies to [FishingSpawningContext]s.
*
* @author Hiroku
* @since February 3rd, 2024
*/
class FishingSpawningCondition: SpawningCondition<FishingSpawningContext>() {
override fun contextClass() = FishingSpawningContext::class.java
var rod: RegistryLikeCondition<Item>? = null
var neededNearbyBlocks: MutableList<RegistryLikeCondition<Block>>? = null
override fun fits(ctx: FishingSpawningContext): Boolean {
if (!super.fits(ctx)) {
return false
} else if (rod != null && !rod!!.fits(ctx.rodItem ?: return false, ctx.world.itemRegistry)) {
return false
} else if (neededNearbyBlocks != null && neededNearbyBlocks!!.none { cond -> ctx.nearbyBlockTypes.any { cond.fits(it, ctx.blockRegistry) } }) {
return false
} else {
return true
}
}
companion object {
const val NAME = "fishing"
}
}

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