Compare commits

...
Author SHA1 Message Date
Charzard4261 52133711ad Added a check before setting the Monitor's Block State, as it was causing a crash for some people. Unsure on the root cause, but this should prevent the crash. 2024-05-22 22:53:34 +01:00
Hiroku 4e1b82917b Merge branch 'Roaming-Gholdengo-Request' into 'main'
Lets Gholdengo maintain its roaming aspect

See merge request cable-mc/cobblemon!1025
2024-05-20 00:11:17 +00:00
Frank The FarmerandHiroku 3b1d257241 Lets Gholdengo maintain its roaming aspect 2024-05-20 00:11:16 +00:00
Hiroku 0b8f916648 Merge branch 'dimension-condition-uses-id-not-effects' into 'main'
Change dimension spawn condition to check with IDs not effects

See merge request cable-mc/cobblemon!1026
2024-05-20 00:11:02 +00:00
David Sadler 5ad7d5406a Change dimension spawn condition to check with IDs not effects 2024-05-19 18:45:34 +01:00
Paul 6ec008ee83 Merge remote-tracking branch 'origin/main' into 1.5-fixy
# Conflicts:
#	CHANGELOG.md
2024-05-19 11:19:13 +10:00
Hiroku f4d2226ec2 Merge branch '1.5.1' into 'main'
Moar 🐛🔫

Closes #847 and #799

See merge request cable-mc/cobblemon!1023
2024-05-18 01:50:12 +00:00
apion 0fc5d5e9d7 Fixed bad null handling 2024-05-17 21:41:58 -04:00
Hiroku 972c0f6430 Merge branch 'dubwool-dye' into 'main'
Make wooloos dyable

Closes #824

See merge request cable-mc/cobblemon!1021
2024-05-18 01:40:13 +00:00
ApionandHiroku 86db95a7dc Make wooloos dyable 2024-05-18 01:40:13 +00:00
apion be95b79e4d Removed unnecessary override 2024-05-17 21:20:20 -04:00
apion 5753443ab2 Optimized a player lookup 2024-05-17 20:39:27 -04:00
apion c6b7186032 Merge branch 'refs/heads/main' into 1.5.1
# Conflicts:
#	CHANGELOG.md
2024-05-17 20:35:50 -04:00
apion 32f3be2687 Changelog 2024-05-17 20:33:24 -04:00
apion 9012d78806 Apparently Kotlin uses .equals when using ==, === is Java == behavior 2024-05-17 20:30:18 -04:00
apion fffdfb7654 Fixes bug with InvMove, closes #847 2024-05-17 20:28:57 -04:00
Hiroku b314733f0b Merge branch 'Frank's-Bug-Fixing-Farm' into 'main'
Frank's bug fixing farm

See merge request cable-mc/cobblemon!1019
2024-05-17 10:44:01 +00:00
Frank The FarmerandHiroku d5aa07fe91 Frank's bug fixing farm 2024-05-17 10:44:00 +00:00
apion 27bedc2d2c Closes #799 2024-05-16 21:59:36 -04:00
Hiroku 86744c23a5 Merge branch '1.5.1' into 'main'
Fix recoil evo bug

Closes #844

See merge request cable-mc/cobblemon!1022
2024-05-17 01:41:41 +00:00
apion 8d1a64136f Fix recoil evo bug 2024-05-16 20:33:19 -04:00
Paul bc550dd32c Fixed unlocked evolutions getting re-checked and eating held items, fixes #843 2024-05-17 10:04:54 +10:00
Paul 3009af8c42 Fixed missing cant.nopp lang key, fixes #842 2024-05-17 08:52:23 +10:00
Hiroku bfd34eb621 Merge branch '1.5.1' into 'main'
Fixes a few issues

Closes #827, #828, #826, and #832

See merge request cable-mc/cobblemon!1012
2024-05-16 22:46:10 +00:00
Hiroku 2dc2c96176 Update CHANGELOG.md [skip-ci] 2024-05-16 22:44:00 +00:00
Hiroku df4db17cfd Removed println 2024-05-16 22:40:56 +00:00
apion 45bec488f1 Fixed bug with pasture block 2024-05-15 20:41:32 -04:00
apion 9287374504 Merge branch 'refs/heads/main' into 1.5.1 2024-05-15 18:24:56 -04: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
apion f2a36cd74a Merge branch 'refs/heads/main' into 1.5.1
# Conflicts:
#	CHANGELOG.md
2024-05-15 14:51:45 -04: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
MoeBoy76 68c4acf0eb Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon 2024-05-15 09:21:22 +10:00
broccoli 5b5e7109f5 fix: resolve mapping issues by downgrading loom
fixes regression in fd7b82dbe3
2024-05-14 23:17:16 +01: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
tmetcalfe89 eb80c20dbf updated readme 2024-05-14 09:11:16 -07:00
apion 7ab3951613 Fix gilded chest item drops 2024-05-14 11:16:33 -04:00
apion e6d51c4d56 A little more fossil machine clean up 2024-05-14 10:26:25 -04: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
apion b9364304ca Changelog teehee 2024-05-14 09:47:35 -04: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 8236c6fb11 Merge branch 'refs/heads/main' into 1.5.1 2024-05-14 04:13:40 -04:00
apion 2041d43db4 Hopefully fixed some other bugs 2024-05-14 03:53:35 -04: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
JazzMcNade 94d92b6fc0 Fixes #827
Jade can now view the contents of the analyzer block
2024-05-14 01:53:56 -05: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
apion 4a4d292228 Fixes #828 2024-05-13 17:01:38 -04:00
apion 0fef9eec3d Fixes #826 2024-05-13 17:01:27 -04:00
apion 5f3dc395ec Fixes #832 2024-05-13 12:17:47 -04: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 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 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
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
1365 changed files with 7294 additions and 3783 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
+118 -71
View File
@@ -1,42 +1,80 @@
# Changelog
## [1.5.0](#1-5-0)
## [1.5.1](#1-5-1)
### Additions
- Added unique send out particles for Cherish, Dream, Beast, and Ancient Origin balls.
- Made Wooloo and Dubwool dye-able like sheep
### Changes
- Sounds for Relic Coin Sacks have been correctly renamed. Relic Coin Pouches received new sounds for breaking and placing.
- Readjusted Petilil portraits
- Changed "dimensions" spawn condition to check with dimension IDs instead of effects, so custom dimension IDs can be used.
### 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 Gilded Chest block entity not being cleared on block break
- Fixed sherd brokenness on Forge/Supplementaries incompat
- Fixed Fossil Compartment crash with Jade / WAILA forks
- Fixed PCStore#resize not allowing PC boxes size reduction.
- Fixed pasture block PC lookups when the player is offline.
- Fixed an untranslated battle message that occurs when using a move that just ran out of PP (e.g. Fire Blast that just got spited mid-turn).
- Fixed held items being eaten even when the held item evolutions are already unlocked.
- Fixed Hisuian Decidueye not being Grass/Fighting
- Fixed both Decidueye forms learning both Triple Arrows and Spirit Shackle
- Fixed Pineco being unable to evolve into Shulker Forretress
- Fixed Kabutops T-posing when underwater. It still does not have proper swimming animations yet though.
- Fixed Pidgey's missing walk animation.
- Fixed recoil evo condition.
- Fixed issue where poser debug tools didnt work on JSON posers
- Fixed issue where gilded chests dont close when going far away
### 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 22 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 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 a Display Case block! Use it to display your archaeological findings, or other items.
- 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.
- You'll also find Terracotta Sun Stone Ore in Badlands biomes.
- 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 various new tags for searchability and better compatibility.
- Added the [Ability Capsule](https://bulbapedia.bulbagarden.net/wiki/Ability_Capsule) and [Patch](https://bulbapedia.bulbagarden.net/wiki/Ability_Patch), these have no acquisition method for now and only work as intended with the traditional ability format of 1 to 2 common abilities and 1 hidden ability.
- Added Gilded Chests, available in all Apricorn colors.
- Added Relic Coins, Relic Coin Pouches, and Relic Coin Sacks.
- Added Type Gems. These items hold no functionality for now. Start collecting though...
- Added cries to Meowth, Alolan Meowth, Galaraian Meowth,
- Completed the advancement for placing a Tumblestone near Lava or Magma to make it grow.
- 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.
- Added bubble quirk to Krabby that only play during clear sunset's.
- 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
@@ -167,7 +205,7 @@
#### 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
@@ -180,6 +218,8 @@
- 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
@@ -245,82 +285,86 @@
### Changes
- Alolan Pikachu and Exeggcute changed to Alola bias.
- 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, and Raboot.
- 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.
- Starter Toast now closes once corresponding button is pressed once.
- Moved some items in the vanilla Food & Drinks category.
- 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 Healer recipe to swap the Max Revive for a Revive.
- Upped the rate that Gastly drop Ghast Tears from 2.5% to 5%.
- 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.
- Updated shiny icon within summary and PC interfaces.
- Changed the Poison Barb sprite so that it doesn't look like a sword when held.
- Moon Stone ore generates more frequently in Taigas and has been added to Magical and Spooky biomes.
- 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.
- Added particles to Lucario when in battle. Lucario is special.
- Movesets updated for Blueberry DLC.
### Fixes
- Resized Snorlax
- 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).
- Re-added the recipe for the Iron vitamin. Well, technically it's a mineral.
- Fixed Exeggcute and Pikachu not being able to evolve.
- Fixed battle lang for Poison Touch Ability
- Fixed Cubone not being able to evolve into Alolan Marowak.
- 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 Pokémon pathing over snow layers and carpets.
- 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 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 sometimes Pokémon losing hidden abilities when evolving, this fix will only take effect to newly created Pokémon.
- Fixed capture messages not displaying.
- Fixed illusion ability causing the wrong Pokémon to be targeted in battle.
- Battles starting with fainted party members no longer cause a softlock on defeat.
- Fixed some issues with eyes in the faint animations for Hitmonlee and Phantump
- 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.
- ``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 to 2 regular abilities and 1 hidden.
- ``Pokemon#rollAbility`` has been added, this rerolls 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.
- ``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.
- 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.
@@ -490,6 +534,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).
@@ -1030,6 +1075,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
@@ -1179,6 +1225,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.
@@ -1292,4 +1339,4 @@ Thank you so much to all of our community translators that bring the mod to the
- Added species, ability, and move translations for `ko_ko`, `jp_jp`, `fr_fr`, `es_es`, `it_it`, and `zh_cn`.
## [1.0.0 (November 12th, 2022)](#1-0-0)
- Initial release.
- Initial release.
-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()
}
+2 -3
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-${versioning.info.branch}-${versioning.info.build}"
val fixedBranchName = versioning.info.branch.substringAfter("/")
version = "$version-${fixedBranchName}-${versioning.info.build}"
}
+18 -24
View File
@@ -1,5 +1,5 @@
import extensions.isSnapshot
import extensions.version
import utilities.isSnapshot
import utilities.version
import java.time.OffsetDateTime
import java.time.ZoneOffset
import java.time.format.DateTimeFormatter
@@ -20,7 +20,7 @@ plugins {
id("net.kyori.blossom")
id("org.jetbrains.gradle.plugin.idea-ext")
id ("net.nemerosa.versioning") version "2.8.2"
id("net.nemerosa.versioning") version "2.8.2"
}
architectury {
@@ -34,31 +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)
testImplementation(libs.fabricJunit)
testImplementation(libs.junitParams)
testImplementation(libs.mockito)
testImplementation(libs.mockk)
testImplementation(libs.classgraph)
// Unit Testing
testImplementation(libs.bundles.unitTesting)
}
tasks.withType<Test> {
@@ -94,7 +89,6 @@ sourceSets {
property("gitCommit", versioning.info.commit)
property("branch", versioning.info.branch)
System.getProperty("buildNumber")?.let { property("buildNumber", it) }
property("timestamp", OffsetDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ofPattern("MM/dd/yyyy hh:mm:ss")) + " UTC")
}
}
}
@@ -26,7 +26,6 @@ public final class CrashReportMixin {
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.add("Timestamp", CobblemonBuildDetails.TIMESTAMP);
cobblemon.addStackTrace(builder);
builder.append("\n\n");
@@ -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);
}
}
@@ -10,7 +10,6 @@ object CobblemonBuildDetails {
const val GIT_COMMIT = "{{ gitCommit | default("Not Specified") }}"
const val BRANCH = "{{ branch | default("Not Specified") }}"
const val TIMESTAMP = "{{ timestamp }}"
fun smallCommitHash(): String {
return this.GIT_COMMIT.substring(0, 7)
@@ -102,7 +102,6 @@ import com.cobblemon.mod.common.pokemon.properties.HiddenAbilityPropertyType
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
@@ -179,7 +178,6 @@ object Cobblemon {
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}")
this.LOGGER.info(" - Timestamp: ${CobblemonBuildDetails.TIMESTAMP}")
}
implementation.registerPermissionValidator()
@@ -236,7 +234,7 @@ object Cobblemon {
val player = event.player
val block = player.world.getBlockState(event.pos).block
player.party().forEach { pokemon ->
pokemon.evolutions
pokemon.lockedEvolutions
.filterIsInstance<BlockClickEvolution>()
.forEach { evolution ->
evolution.attemptEvolution(pokemon, BlockClickEvolution.BlockInteractionContext(block, player.world))
@@ -417,7 +415,6 @@ object Cobblemon {
).ifSuccessful { it.mute = true }
}
CobblemonSherds.registerSherds()
}
fun getLevel(dimension: RegistryKey<World>): World? {
@@ -234,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
@@ -245,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
))
@@ -667,8 +667,8 @@ 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 CLEAR_AMULET = heldItem("clear_amulet")
@JvmField
val COVERT_CLOAK = heldItem("covert_cloak")
@JvmField
@@ -697,16 +697,16 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<It
val FOCUS_BAND = heldItem("focus_band")
@JvmField
val FOCUS_SASH = heldItem("focus_sash")
@JvmField
val GRIP_CLAW = heldItem("grip_claw")
// @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 LAGGING_TAIL = heldItem("lagging_tail")
@JvmField
val LEFTOVERS = heldItem("leftovers")
@JvmField
@@ -719,12 +719,12 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<It
val LOADED_DICE = heldItem("loaded_dice")
@JvmField
val LUCKY_EGG = heldItem("lucky_egg")
@JvmField
val LUMINOUS_MOSS = heldItem("luminous_moss")
// @JvmField
// val LUMINOUS_MOSS = heldItem("luminous_moss")
@JvmField
val MAGNET = heldItem("magnet")
@JvmField
val METRONOME = heldItem("metronome")
// @JvmField
// val METRONOME = heldItem("metronome")
@JvmField
val MIRACLE_SEED = heldItem("miracle_seed")
@JvmField
@@ -747,10 +747,10 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<It
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 PROTECTIVE_PADS = heldItem("protective_pads")
// @JvmField
// val PUNCHING_GLOVE = heldItem("punching_glove")
@JvmField
val QUICK_CLAW = heldItem("quick_claw")
@JvmField
@@ -759,16 +759,16 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<It
val RING_TARGET = heldItem("ring_target")
@JvmField
val ROCKY_HELMET = heldItem("rocky_helmet")
@JvmField
val ROOM_SERVICE = heldItem("room_service")
// @JvmField
// val ROOM_SERVICE = heldItem("room_service")
@JvmField
val SAFETY_GOGGLES = heldItem("safety_goggles")
@JvmField
val SCOPE_LENS = heldItem("scope_lens")
// @JvmField
// val SCOPE_LENS = heldItem("scope_lens")
@JvmField
val SHARP_BEAK = heldItem("sharp_beak")
@JvmField
val SHED_SHELL = heldItem("shed_shell")
// @JvmField
// val SHED_SHELL = heldItem("shed_shell")
@JvmField
val SHELL_BELL = heldItem("shell_bell")
@JvmField
@@ -785,24 +785,24 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<It
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 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 UTILITY_UMBRELLA = heldItem("utility_umbrella")
@JvmField
val WEAKNESS_POLICY = heldItem("weakness_policy")
@JvmField
val WIDE_LENS = heldItem("wide_lens")
// @JvmField
// val WIDE_LENS = heldItem("wide_lens")
@JvmField
val WISE_GLASSES = heldItem("wise_glasses")
@JvmField
val ZOOM_LENS = heldItem("zoom_lens")
// @JvmField
// val ZOOM_LENS = heldItem("zoom_lens")
@JvmField
val MENTAL_HERB = compostableHeldItem("mental_herb", null, 1F)
@JvmField
@@ -122,13 +122,18 @@ object CobblemonSounds : PlatformRegistry<Registry<SoundEvent>, RegistryKey<Regi
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 TUMBLESTONE_BREAK = this.create("tumblestone.break")
@JvmField
@@ -189,13 +194,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
@@ -226,7 +226,7 @@ open class PokemonBattle(
val facedFainted = opponentPokemon.facedOpponents.contains(faintedPokemon)
val pokemon = opponentPokemon.effectedPokemon
if (facedFainted) {
pokemon.evolutions.forEach { evolution ->
pokemon.lockedEvolutions.forEach { evolution ->
evolution.requirements.filterIsInstance<DefeatRequirement>().forEach { defeatRequirement ->
if (defeatRequirement.target.matches(faintedPokemon.effectedPokemon)) {
val progress = pokemon.evolutionProxy.current().progressFirstOrCreate({ it is DefeatEvolutionProgress && it.currentProgress().target == defeatRequirement.target }) { DefeatEvolutionProgress() }
@@ -52,21 +52,24 @@ 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) {
return entity.multiblockStructure!!.onUse(state, world, pos, player, hand, hit)
if (!world.isClient) {
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)
}
override fun onBreak(world: World, pos: BlockPos, state: BlockState, player: PlayerEntity?) {
super.onBreak(world, pos, state, player)
if (!world.isClient) {
val entity = world.getBlockEntity(pos)
if (entity is MultiblockEntity && entity.multiblockStructure != null) {
entity.multiblockStructure!!.onBreak(world, pos, state, player)
}
entity?.markRemoved()
}
super.onBreak(world, pos, state, player)
}
override fun createBlockEntity(pos: BlockPos, state: BlockState): BlockEntity? {
@@ -78,6 +81,7 @@ abstract class MultiblockBlock(properties: Settings) : BlockWithEntity(propertie
return BlockRenderType.MODEL
}
//This is done so a block picked with NBT doesnt absolutely DESTROY multiblocks
override fun getPickStack(world: BlockView, pos: BlockPos, state: BlockState): ItemStack {
val blockEntity = world.getBlockEntity(pos) as? MultiblockEntity ?: return ItemStack.EMPTY
return if (blockEntity.multiblockStructure == null) super.getPickStack(world, pos, state) else ItemStack.EMPTY
@@ -153,7 +153,7 @@ interface Evolution : EvolutionLike {
pokemon.getOwnerPlayer()?.sendMessage(lang("experience.learned_move", pokemon.getDisplayName(), move.displayName))
}
// we want to instantly tick for example you might only evolve your Bulbasaur at level 34 so Venusaur should be immediately available
pokemon.evolutions.filterIsInstance<PassiveEvolution>().forEach { evolution -> evolution.attemptEvolution(pokemon) }
pokemon.lockedEvolutions.filterIsInstance<PassiveEvolution>().forEach { evolution -> evolution.attemptEvolution(pokemon) }
pokemon.getOwnerPlayer()?.playSound(CobblemonSounds.EVOLVING, SoundCategory.NEUTRAL, 1F, 1F)
CobblemonEvents.EVOLUTION_COMPLETE.post(EvolutionCompleteEvent(pokemon, this))
}
@@ -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)
)
}
@@ -78,7 +78,7 @@ abstract class SpawningCondition<T : SpawningContext> {
return false
} else if (ctx.position.z < minZ.orMin() || ctx.position.z > maxZ.orMax()) {
return false
} else if (dimensions != null && dimensions!!.isNotEmpty() && ctx.world.dimension.effects !in dimensions!!) {
} else if (dimensions != null && dimensions!!.isNotEmpty() && ctx.world.dimensionKey.value !in dimensions!!) {
return false
} else if (moonPhase != null && ctx.moonPhase !in moonPhase!!) {
return false
@@ -30,8 +30,8 @@ import net.minecraft.server.world.ServerWorld
*/
interface SpawningContextCalculator<I : SpawningContextInput, O : SpawningContext> {
companion object {
val isAirCondition: (BlockState) -> Boolean = { it.isAir || (!it.isSolid && !it.isLiquid) }
val isSolidCondition: (BlockState) -> Boolean = { it.isSolid && !it.isIn(BlockTags.LEAVES) }
val isAirCondition: (BlockState) -> Boolean = { it.isAir || (!it.isSolid && !it.fluidState.isIn(FluidTags.WATER)) }
val isSolidCondition: (BlockState) -> Boolean = { it.isSolid }
val isWaterCondition: (BlockState) -> Boolean = { it.fluidState.isIn(FluidTags.WATER) && it.fluidState.isStill }
val isLavaCondition: (BlockState) -> Boolean = { it.fluidState.isIn(FluidTags.LAVA) && it.fluidState.isStill }
@@ -34,15 +34,19 @@ abstract class SpawnAction<R>(
/**
* Runs the spawn action and processes any non-null result.
*/
open fun complete(): Boolean {
open fun complete(): R? {
if (future.isDone) {
return null
}
ctx.influences.forEach { it.affectAction(this) }
val result = run()
return if (result != null) {
if (result != null) {
future.complete(result)
true
} else {
future.completeExceptionally(Exception("Nothing was spawned."))
false
}
return result
}
}
@@ -48,7 +48,7 @@ abstract class SpawnDetailPreset {
var weightMultipliers: MutableList<WeightMultiplier>? = null
var weight: Float? = null
var percentage: Float? = null
var mergeMode = MergeMode.KEEP
var mergeMode = MergeMode.INSERT
open fun apply(spawnDetail: SpawnDetail) {
bucket?.let { spawnDetail.bucket = it }
@@ -124,7 +124,7 @@ open class PlayerPartyStore(
}
// Passive evolutions
pokemon.evolutions.filterIsInstance<PassiveEvolution>().forEach { it.attemptEvolution(pokemon) }
pokemon.lockedEvolutions.filterIsInstance<PassiveEvolution>().forEach { it.attemptEvolution(pokemon) }
val removeList = mutableListOf<Evolution>()
pokemon.evolutionProxy.server().forEach {
if (!it.test(pokemon) && it is LevelUpEvolution && !it.permanent)
@@ -99,7 +99,7 @@ open class PCStore(
this.lockedSize = lockNewSize
if (boxes.size > newSize) {
// reduce
val slicedBoxes = boxes.slice(boxes.size until newSize)
val slicedBoxes = boxes.slice(newSize until boxes.size)
boxes.removeAll(slicedBoxes)
slicedBoxes.flatMap { it.asIterable() }.forEach(overflowHandler)
} else {
@@ -71,7 +71,6 @@ object BattleBuilder {
player1Actor.battleTheme = player2.getBattleTheme()
player2Actor.battleTheme = player1.getBattleTheme()
}
errors
} else {
errors
}
@@ -140,7 +139,6 @@ object BattleBuilder {
}
playerActor.battleTheme = pokemonEntity.getBattleTheme()
}
errors
} else {
errors
}
@@ -35,7 +35,7 @@ class BoostInstruction(val instructionSet: InstructionSet, val message: BattleMe
val severity = Stats.getSeverity(stages)
val rootKey = if (isBoost) "boost" else "unboost"
battle.dispatchWaiting(1.5F) {
battle.dispatchWaiting {
val lang = when {
message.hasOptionalArgument("zeffect") -> battleLang("$rootKey.$severity.zeffect", pokemon.getName(), stat)
else -> battleLang("$rootKey.$severity", pokemon.getName(), stat)
@@ -54,8 +54,8 @@ class DamageInstruction(
if (recoiling) {
battlePokemon.effectedPokemon.let { pokemon ->
if (RecoilEvolutionProgress.supports(pokemon)) {
val newPercentage = privateMessage.argumentAt(1)?.split("/")?.getOrNull(0)?.toIntOrNull() ?: 0
val newHealth = (pokemon.hp * (newPercentage / 100.0)).roundToInt()
val healthStr = privateMessage.argumentAt(1) ?: throw UnsupportedOperationException("Cant get recoil string")
val newHealth = "([0-9]+).*".toRegex().find(healthStr)?.groups?.get(1)?.value?.toIntOrNull() ?: throw UnsupportedOperationException("Cant get recoil string")
val difference = pokemon.currentHealth - newHealth
if (difference > 0) {
val progress = pokemon.evolutionProxy.current().progressFirstOrCreate({ it is RecoilEvolutionProgress }) { RecoilEvolutionProgress() }
@@ -38,6 +38,7 @@ import net.minecraft.util.shape.VoxelShapes
import net.minecraft.world.BlockView
import net.minecraft.world.World
import net.minecraft.world.WorldAccess
import net.minecraft.world.WorldEvents
import net.minecraft.world.WorldView
@@ -72,10 +73,12 @@ class RestorationTankBlock(properties: Settings) : MultiblockBlock(properties),
override fun onBreak(world: World, pos: BlockPos, state: BlockState, player: PlayerEntity?) {
super.onBreak(world, pos, state, player)
val otherPart = world.getBlockState(getPositionOfOtherPart(state, pos))
if (otherPart.block is RestorationTankBlock) {
world.setBlockState(getPositionOfOtherPart(state, pos), Blocks.AIR.defaultState, 35)
world.syncWorldEvent(player, 2001, getPositionOfOtherPart(state, pos), getRawIdFromState(otherPart))
if (!world.isClient) {
val otherPart = world.getBlockState(getPositionOfOtherPart(state, pos))
if (otherPart.block is RestorationTankBlock) {
world.setBlockState(getPositionOfOtherPart(state, pos), Blocks.AIR.defaultState, Block.NOTIFY_ALL)
world.syncWorldEvent(player, WorldEvents.BLOCK_BROKEN, getPositionOfOtherPart(state, pos), getRawIdFromState(otherPart))
}
}
}
@@ -87,9 +90,9 @@ class RestorationTankBlock(properties: Settings) : MultiblockBlock(properties),
itemStack: ItemStack?
) {
//Place the full block before we call to super to validate the multiblock
world.setBlockState(pos.up(), state.with(PART, TankPart.TOP) as BlockState, 3)
world.setBlockState(pos.up(), state.with(PART, TankPart.TOP) as BlockState, Block.NOTIFY_ALL)
world.updateNeighbors(pos, Blocks.AIR)
state.updateNeighbors(world, pos, 3)
state.updateNeighbors(world, pos, Block.NOTIFY_ALL)
super.onPlaced(world, pos, state, placer, itemStack)
}
@@ -100,7 +103,7 @@ class RestorationTankBlock(properties: Settings) : MultiblockBlock(properties),
val tankBottomPos = pos.down()
val tankBottomState = world.getBlockState(tankBottomPos)
if(tankBottomState.block.equals(CobblemonBlocks.RESTORATION_TANK.asBlock()) && tankBottomState.get(PART) == TankPart.BOTTOM) {
return super.onUse(tankBottomState, world, tankBottomPos, player, hand, hit)
return onUse(tankBottomState, world, tankBottomPos, player, hand, hit)
}
}
return super.onUse(state, world, pos, player, hand, hit)
@@ -27,6 +27,7 @@ import net.minecraft.item.ItemPlacementContext
import net.minecraft.item.ItemStack
import net.minecraft.screen.ScreenHandler
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.server.world.ServerWorld
import net.minecraft.sound.SoundCategory
import net.minecraft.state.StateManager
import net.minecraft.state.property.BooleanProperty
@@ -37,6 +38,7 @@ import net.minecraft.util.*
import net.minecraft.util.hit.BlockHitResult
import net.minecraft.util.math.BlockPos
import net.minecraft.util.math.Direction
import net.minecraft.util.math.random.Random
import net.minecraft.util.shape.VoxelShape
import net.minecraft.util.shape.VoxelShapes
import net.minecraft.world.BlockView
@@ -125,11 +127,13 @@ class GildedChestBlock(settings: Settings, val type: Type = Type.RED) : BlockWit
fun isFake() = (type == Type.FAKE)
override fun onBreak(world: World, pos: BlockPos, state: BlockState, player: PlayerEntity) {
if (isFake()) {
if (player is ServerPlayerEntity) {
if (!world.isClient) {
if (isFake() && (player is ServerPlayerEntity)) {
spawnPokemon(world, pos, state, player)
}
world.setBlockState(pos, if (state.fluidState.isOf(Fluids.WATER)) Blocks.WATER.defaultState else Blocks.AIR.defaultState)
val bEntity = world.getBlockEntity(pos) as? GildedChestBlockEntity
bEntity?.markRemoved()
} else super.onBreak(world, pos, state, player)
}
@@ -197,9 +201,11 @@ class GildedChestBlock(settings: Settings, val type: Type = Type.RED) : BlockWit
newState: BlockState,
moved: Boolean
) {
if (!state.isOf(newState.block)) {
val chest = world.getBlockEntity(pos) as GildedChestBlockEntity
ItemScatterer.spawn(world, pos, chest.inventoryContents)
if (!state.isOf(newState.block) && !world.isClient) {
val chest = world.getBlockEntity(pos) as? GildedChestBlockEntity
chest?.let {
ItemScatterer.spawn(world, pos, chest.inventoryContents)
}
}
}
@@ -261,4 +267,14 @@ class GildedChestBlock(settings: Settings, val type: Type = Type.RED) : BlockWit
}
}
override fun scheduledTick(
state: BlockState?,
world: ServerWorld?,
pos: BlockPos?,
random: Random?
) {
val blockEntity = world?.getBlockEntity(pos) as? GildedChestBlockEntity ?: return
blockEntity.onScheduledTick()
}
}
@@ -29,11 +29,17 @@ class FossilAnalyzerBlockEntity(
class FossilAnalyzerInventory(val analyzerEntity: FossilAnalyzerBlockEntity) : SidedInventory {
override fun clear() {
TODO("Not yet implemented")
if(analyzerEntity.multiblockStructure != null && analyzerEntity.multiblockStructure is FossilMultiblockStructure) {
val fossilMultiblockStructure = analyzerEntity.multiblockStructure as FossilMultiblockStructure
fossilMultiblockStructure.fossilInventory.clear()
}
}
override fun size(): Int {
TODO("Not yet implemented")
if (analyzerEntity.multiblockStructure != null) {
return 3
}
return 0
}
override fun isEmpty(): Boolean {
@@ -41,19 +47,34 @@ class FossilAnalyzerBlockEntity(
}
override fun getStack(slot: Int): ItemStack {
if (analyzerEntity.multiblockStructure != null && analyzerEntity.multiblockStructure is FossilMultiblockStructure) {
val fossilMultiblockStructure = analyzerEntity.multiblockStructure as FossilMultiblockStructure
if (fossilMultiblockStructure.fossilInventory.size > slot) {
return fossilMultiblockStructure.fossilInventory[slot]
}
}
return ItemStack.EMPTY
}
//Unimplemented since no extract
override fun removeStack(slot: Int, amount: Int): ItemStack {
return ItemStack.EMPTY
return removeStack(slot)
}
override fun removeStack(slot: Int): ItemStack {
// if(analyzerEntity.multiblockStructure is FossilMultiblockStructure) {
// val fossilMultiblockStructure = analyzerEntity.multiblockStructure as FossilMultiblockStructure
// if (fossilMultiblockStructure.fossilInventory.size > slot) {
// val itemStack = fossilMultiblockStructure.fossilInventory.removeAt(slot)
// markDirty()
// return itemStack
// }
// }
return ItemStack.EMPTY
}
override fun setStack(slot: Int, stack: ItemStack) {
if (analyzerEntity.multiblockStructure != null) {
if (analyzerEntity.multiblockStructure != null && analyzerEntity.multiblockStructure is FossilMultiblockStructure) {
val struct = analyzerEntity.multiblockStructure as FossilMultiblockStructure
analyzerEntity.world?.let {
struct.insertFossil(stack, it)
@@ -72,7 +93,10 @@ class FossilAnalyzerBlockEntity(
}
override fun getAvailableSlots(side: Direction?): IntArray {
return IntArray(1)
if(analyzerEntity.multiblockStructure != null && analyzerEntity.multiblockStructure is FossilMultiblockStructure) {
return intArrayOf(0,1,2)
}
return IntArray(0)
}
override fun canInsert(slot: Int, stack: ItemStack?, dir: Direction?): Boolean {
@@ -87,8 +111,8 @@ class FossilAnalyzerBlockEntity(
}
override fun canExtract(slot: Int, stack: ItemStack?, dir: Direction?): Boolean {
// return analyzerEntity.multiblockStructure != null && analyzerEntity.multiblockStructure is FossilMultiblockStructure && dir == Direction.DOWN
return false
}
}
}
@@ -20,6 +20,7 @@ import net.minecraft.entity.player.PlayerEntity
import net.minecraft.entity.player.PlayerInventory
import net.minecraft.inventory.DoubleInventory
import net.minecraft.inventory.Inventories
import net.minecraft.inventory.Inventory
import net.minecraft.inventory.SidedInventory
import net.minecraft.item.ItemStack
import net.minecraft.nbt.NbtCompound
@@ -58,9 +59,7 @@ class GildedChestBlockEntity(pos: BlockPos, state: BlockState, val type: Type =
override fun isPlayerViewing(player: PlayerEntity): Boolean {
if (player.currentScreenHandler is GenericContainerScreenHandler) {
val inventory = (player.currentScreenHandler as GenericContainerScreenHandler).inventory
return inventory === this@GildedChestBlockEntity || inventory is DoubleInventory && inventory.isPart(
this@GildedChestBlockEntity
)
return inventory === this@GildedChestBlockEntity
}
return false
}
@@ -86,7 +85,7 @@ class GildedChestBlockEntity(pos: BlockPos, state: BlockState, val type: Type =
}
override fun getAvailableSlots(side: Direction): IntArray {
return if (type == Type.FAKE) IntArray(0) else IntArray(NUM_SLOTS)
return if (type == Type.FAKE) IntArray(0) else IntArray(NUM_SLOTS) { it }
}
override fun canInsert(slot: Int, stack: ItemStack?, dir: Direction?): Boolean {
@@ -99,8 +98,6 @@ class GildedChestBlockEntity(pos: BlockPos, state: BlockState, val type: Type =
return dir == Direction.DOWN
}
override fun canPlayerUse(player: PlayerEntity) = !player.isSpectator
override fun getInvStackList(): DefaultedList<ItemStack> = inventoryContents
override fun setInvStackList(list: DefaultedList<ItemStack>) {
@@ -164,4 +161,10 @@ class GildedChestBlockEntity(pos: BlockPos, state: BlockState, val type: Type =
Inventories.readNbt(nbt, inventoryContents)
}
}
fun onScheduledTick() {
if (!this.removed) {
stateManager.updateViewerCount(this.getWorld(), this.getPos(), this.cachedState)
}
}
}
@@ -36,8 +36,8 @@ import net.minecraft.util.math.BlockPos
@Suppress("MemberVisibilityCanBePrivate", "unused")
class HealingMachineBlockEntity(
val blockPos: BlockPos,
val blockState: BlockState
blockPos: BlockPos,
blockState: BlockState
) : BlockEntity(CobblemonBlockEntities.HEALING_MACHINE, blockPos, blockState) {
var currentUser: UUID? = null
private set
@@ -114,7 +114,7 @@ class HealingMachineBlockEntity(
this.setUser(player.uuid)
alreadyHealing.add(player.uuid)
updateBlockChargeLevel(HealingMachineBlock.MAX_CHARGE_LEVEL + 1)
if (world != null && !world!!.isClient) world!!.playSoundServer(position = blockPos.toVec3d(), sound = CobblemonSounds.HEALING_MACHINE_ACTIVE, volume = 1F, pitch = 1F)
if (world != null && !world!!.isClient) world!!.playSoundServer(position = pos.toVec3d(), sound = CobblemonSounds.HEALING_MACHINE_ACTIVE, volume = 1F, pitch = 1F)
}
fun completeHealing() {
@@ -217,10 +217,10 @@ class HealingMachineBlockEntity(
else floor((healingCharge / maxCharge) * HealingMachineBlock.MAX_CHARGE_LEVEL).toInt()
).coerceIn(0..HealingMachineBlock.MAX_CHARGE_LEVEL + 1)
val state = world!!.getBlockState(blockPos)
val state = world!!.getBlockState(pos)
if (state != null && state.block is HealingMachineBlock) {
val currentCharge = state.get(HealingMachineBlock.CHARGE_LEVEL).toInt()
if (chargeLevel != currentCharge) world!!.setBlockState(blockPos, state.with(HealingMachineBlock.CHARGE_LEVEL, chargeLevel))
if (chargeLevel != currentCharge) world!!.setBlockState(pos, state.with(HealingMachineBlock.CHARGE_LEVEL, chargeLevel))
}
}
}
@@ -26,24 +26,24 @@ import net.minecraft.util.math.Box
import net.minecraft.world.World
class PCBlockEntity(
val blockPos: BlockPos,
val blockState: BlockState
blockPos: BlockPos,
blockState: BlockState
) : BlockEntity(CobblemonBlockEntities.PC, blockPos, blockState) {
companion object {
internal val TICKER = BlockEntityTicker<PCBlockEntity> { world, _, _, blockEntity ->
if (world.isClient) return@BlockEntityTicker
blockEntity.togglePCOn(blockEntity.getInRangeViewerCount(world, blockEntity.blockPos) > 0)
blockEntity.togglePCOn(blockEntity.getInRangeViewerCount(world, blockEntity.pos) > 0)
}
}
private fun togglePCOn(on: Boolean) {
val pcBlock = blockState.block as PCBlock
val pcBlock = cachedState.block as PCBlock
if (world != null && !world!!.isClient) {
val world = world!!
val posBottom = pcBlock.getBasePosition(blockState, blockPos)
val posBottom = pcBlock.getBasePosition(cachedState, pos)
val stateBottom = world.getBlockState(posBottom)
val posTop = pcBlock.getPositionOfOtherPart(stateBottom, posBottom)
@@ -71,7 +71,7 @@ class PCBlockEntity(
val pcLink = PCLinkManager.getLink(player.uuid)
return pcLink != null
&& pcLink is ProximityPCLink
&& pcLink.pos == blockPos
&& pcLink.pos == pos
&& pcLink.world!!.dimension == player.world.dimension
}
@@ -48,7 +48,7 @@ import net.minecraft.world.World
import java.util.*
import kotlin.math.ceil
class PokemonPastureBlockEntity(pos: BlockPos, val state: BlockState) : BlockEntity(CobblemonBlockEntities.PASTURE, pos, state) {
class PokemonPastureBlockEntity(pos: BlockPos, state: BlockState) : BlockEntity(CobblemonBlockEntities.PASTURE, pos, state) {
open class Tethering(
val minRoamPos: BlockPos,
val maxRoamPos: BlockPos,
@@ -173,11 +173,11 @@ class PokemonPastureBlockEntity(pos: BlockPos, val state: BlockState) : BlockEnt
}
private fun togglePastureOn(on: Boolean) {
val pastureBlock = state.block as PastureBlock
val pastureBlock = cachedState.block as PastureBlock
if (world != null && !world!!.isClient) {
val world = world!!
val posBottom = pastureBlock.getBasePosition(state, pos)
val posBottom = pastureBlock.getBasePosition(cachedState, pos)
val stateBottom = world.getBlockState(posBottom)
val posTop = pastureBlock.getPositionOfOtherPart(stateBottom, posBottom)
@@ -12,13 +12,16 @@ import com.cobblemon.mod.common.CobblemonBlockEntities
import com.cobblemon.mod.common.api.fossil.NaturalMaterials
import com.cobblemon.mod.common.api.multiblock.builder.MultiblockStructureBuilder
import com.cobblemon.mod.common.block.multiblock.FossilMultiblockStructure
import net.minecraft.block.Block
import net.minecraft.block.BlockState
import net.minecraft.entity.player.PlayerEntity
import net.minecraft.inventory.Inventories
import net.minecraft.inventory.SidedInventory
import net.minecraft.inventory.SimpleInventory
import net.minecraft.item.Item
import net.minecraft.item.ItemStack
import net.minecraft.nbt.NbtCompound
import net.minecraft.nbt.NbtList
import net.minecraft.registry.Registries
import net.minecraft.util.collection.DefaultedList
import net.minecraft.util.math.BlockPos
@@ -27,88 +30,71 @@ import net.minecraft.util.math.Direction
class RestorationTankBlockEntity(
pos: BlockPos, state: BlockState,
multiblockBuilder: MultiblockStructureBuilder
) : FossilMultiblockEntity(pos, state, multiblockBuilder, CobblemonBlockEntities.RESTORATION_TANK) {
) : FossilMultiblockEntity(pos, state, multiblockBuilder, CobblemonBlockEntities.RESTORATION_TANK) {
val inv = RestorationTankInventory(this)
override fun writeNbt(nbt: NbtCompound) {
super.writeNbt(nbt)
Inventories.writeNbt(nbt, inv.items)
nbt.put("inventory", inv.toNbtList())
}
override fun readNbt(nbt: NbtCompound) {
super.readNbt(nbt)
Inventories.readNbt(nbt, inv.items)
if (nbt.contains("Items")) {
// Old format
val items = DefaultedList.ofSize(inv.size(), ItemStack.EMPTY)
Inventories.readNbt(nbt, items)
RestorationTankInventory(this, *items.toTypedArray())
} else if (nbt.contains("inventory")) {
// New format
inv.readNbtList(nbt.get("inventory") as NbtList)
}
}
class RestorationTankInventory(val tankEntity: RestorationTankBlockEntity) : SidedInventory {
class RestorationTankInventory(val tankEntity: RestorationTankBlockEntity, vararg items: ItemStack) : SimpleInventory(*items), SidedInventory {
val items: DefaultedList<ItemStack> = DefaultedList.ofSize(8, ItemStack.EMPTY)
constructor(tankEntity: RestorationTankBlockEntity) : this(tankEntity, *Array(8) { ItemStack.EMPTY })
override fun clear() {
for (i in items.indices) {
items[i] = ItemStack.EMPTY
}
}
override fun size(): Int {
return 8
}
override fun isEmpty(): Boolean {
return items.all { it == ItemStack.EMPTY }
}
override fun getStack(slot: Int): ItemStack {
if(slot == -1 || slot >= size()) {
return ItemStack.EMPTY
}
return items[slot]
}
override fun removeStack(slot: Int, amount: Int): ItemStack {
if(slot < 0 || slot >= size()) {
return ItemStack.EMPTY
}
val result = items[slot].split(amount)
if(items[slot].count == 0) {
items[slot] = ItemStack.EMPTY
}
return result
}
override fun removeStack(slot: Int): ItemStack {
return removeStack(slot, 1)
}
override fun setStack(slot: Int, stack: ItemStack) {
val struct = tankEntity.multiblockStructure as? FossilMultiblockStructure
tankEntity.world?.let {
struct?.insertOrganicMaterial(stack, it)
val returnIdentifier = NaturalMaterials.getReturnItem((stack))
if(returnIdentifier != null ) {
// Store the return item
val returnItem = Registries.ITEM.get(returnIdentifier)
storeReturnItem(returnItem, stack.count)
}
}
}
private fun storeReturnItem(returnItem: Item, count: Int) {
val destStack = items.withIndex().firstOrNull {
it.value == ItemStack.EMPTY || (it.value.count < it.value.maxCount && it.value.item == returnItem)
}
if (destStack != null) {
if(destStack.value == ItemStack.EMPTY) {
items[destStack.index] = ItemStack(returnItem, 1)
} else {
destStack.value.increment(count)
}
}
}
override fun markDirty() {
super.markDirty()
for(i in 0 until size()) { // iterate over inventory, consume items, generate and place return items
val itemStack : ItemStack = this.getStack(i)
if(!itemStack.isEmpty) {
val struct = tankEntity.multiblockStructure as? FossilMultiblockStructure
val returnIdentifier = NaturalMaterials.getReturnItem(itemStack)
if(tankEntity.world != null) {
if(struct?.insertOrganicMaterial(itemStack, tankEntity.world!!) == true) {
removeStack(i)
if (returnIdentifier != null) {
val returnItem = Registries.ITEM.get(returnIdentifier)
val returnStack = ItemStack(returnItem, itemStack.count)
var done = false
if (returnStack.maxCount > 1) { // Only search for a merge if merging could be possible
for(j in 0 until size()) {
// Look for a inventory slot to merge with
val existingStack : ItemStack = getStack(j)
if (Registries.ITEM.getId(existingStack.item) == returnIdentifier && existingStack.count + returnStack.count < existingStack.maxCount) {
setStack(j, ItemStack(returnItem, existingStack.count + returnStack.count))
done = true
}
}
}
if (!done) {
setStack(i, ItemStack(returnItem, itemStack.count))
}
}
}
}
}
}
tankEntity.world?.let {
// tankEntity.world!!.updateListeners(tankEntity.pos, tankEntity.cachedState, tankEntity.cachedState, Block.NOTIFY_ALL)
// tankEntity.world!!.updateComparators(tankEntity.pos, tankEntity.world!!.getBlockState(tankEntity.pos).block)
tankEntity.markDirty()
tankEntity.multiblockStructure?.markDirty(it)
}
}
@@ -118,7 +104,7 @@ class RestorationTankBlockEntity(
}
override fun getAvailableSlots(side: Direction?): IntArray {
return if(side == Direction.DOWN) intArrayOf(0,1,2,3,4,5,6,7) else intArrayOf(-1)
return intArrayOf(0,1,2,3,4,5,6,7)
}
override fun canInsert(slot: Int, stack: ItemStack?, dir: Direction?): Boolean {
@@ -129,12 +115,26 @@ class RestorationTankBlockEntity(
&& structure.organicMaterialInside < FossilMultiblockStructure.MATERIAL_TO_START
&& structure.createdPokemon == null
val returnItem = NaturalMaterials.getReturnItem(stack!!) ?: return canUtilize
if(canUtilize) {
// See if there's room
for (i in items.indices ) {
if(items[i] == ItemStack.EMPTY || (items[i].count < items[i].maxCount
&& items[i].item == Registries.ITEM.get(returnItem))) {
return true
val returnStack = ItemStack(Registries.ITEM.get(returnItem), stack.count)
if(canUtilize && super.canInsert(returnStack)) {
// See if there's room for the return
if(returnStack == ItemStack.EMPTY) {
return true
}
var emptyCount = 0
for(i in 0 until size()) {
val existingStack : ItemStack = getStack(i)
if(existingStack == ItemStack.EMPTY) {
emptyCount += 1
if(emptyCount > 1) {
// 2 empty slots, safe to insert
return true
}
} else if(returnStack.maxCount > 1) {
if(Registries.ITEM.getId(existingStack.item) == returnItem && existingStack.count + returnStack.count < existingStack.maxCount) {
// Return item can merge with an item already in the inventory
return true
}
}
}
return false
@@ -188,7 +188,7 @@ class FossilMultiblockStructure (
// Check if the player is holding a natural material and if so, feed it to the machine.
if (NaturalMaterials.isNaturalMaterial(stack)) {
if (!this.isRunning() && this.createdPokemon == null && this.organicMaterialInside < MATERIAL_TO_START && insertOrganicMaterial(stack, world)) {
if (!this.isRunning() && this.createdPokemon == null && this.organicMaterialInside < MATERIAL_TO_START && insertOrganicMaterial(ItemStack(stack.item, 1), world)) {
this.lastInteraction = world.time
if (!player.isCreative) {
val returnItem = NaturalMaterials.getReturnItem(stack)
@@ -331,11 +331,9 @@ class FossilMultiblockStructure (
}
}
if(tankBaseEntity is RestorationTankBlockEntity) {
tankBaseEntity.inv.items.forEach {
val stack = ItemStack(it.item, 1)
ItemScatterer.spawn(world, pos.x.toDouble(), pos.y.toDouble(), pos.z.toDouble(), stack)
tankBaseEntity.inv.clearToList().forEach {
ItemScatterer.spawn(world, pos.x.toDouble(), pos.y.toDouble(), pos.z.toDouble(), it)
}
tankBaseEntity.inv.clear()
}
@@ -482,15 +480,19 @@ class FossilMultiblockStructure (
}
fun updateProgress(world: World) {
val screenID = if(protectionTime > 0F ) {
val screenID = if (protectionTime > 0F) {
MonitorBlock.MonitorScreen.GREEN_PROGRESS_9
} else if (timeRemaining <= 0) {
MonitorBlock.MonitorScreen.OFF
} else {
getProgressScreen((TIME_TO_TAKE - timeRemaining) / TIME_PER_STAGE)
}
val monitorState = world.getBlockState(monitorPos)
world.setBlockState(monitorPos, monitorState.with(MonitorBlock.SCREEN, screenID))
if (monitorState.contains(MonitorBlock.SCREEN)) {
world.setBlockState(monitorPos, monitorState.with(MonitorBlock.SCREEN, screenID))
}
}
fun getProgressScreen(progress:Int) : MonitorBlock.MonitorScreen {
@@ -533,12 +535,13 @@ class FossilMultiblockStructure (
//Returns false if material wasnt inserted
fun insertOrganicMaterial(stack: ItemStack, world: World): Boolean {
val natureValue = NaturalMaterials.getContent(stack)
var natureValue = NaturalMaterials.getContent(stack)
if (timeRemaining > 0 || this.organicMaterialInside >= MATERIAL_TO_START || natureValue == null) {
return false
}
natureValue *= stack.count
if (natureValue < 0 && organicMaterialInside == 0) return false
if (natureValue <= 0 && organicMaterialInside == 0) return false
val oldFillStage = organicMaterialInside * 8 / MATERIAL_TO_START
// to prevent over/under filling the tank causing a crash
@@ -14,6 +14,7 @@ import com.bedrockk.molang.runtime.value.MoValue
import com.bedrockk.molang.runtime.value.StringValue
import com.cobblemon.mod.common.api.molang.MoLangFunctions.addFunctions
import com.cobblemon.mod.common.api.molang.MoLangFunctions.getQueryStruct
import com.cobblemon.mod.common.api.text.text
import com.cobblemon.mod.common.util.asIdentifierDefaultingNamespace
import net.minecraft.client.MinecraftClient
import net.minecraft.client.sound.PositionedSoundInstance
@@ -31,6 +32,13 @@ object ClientMoLangFunctions {
MinecraftClient.getInstance().soundManager.play(PositionedSoundInstance.master(soundEvent, pitch))
}
},
"is_time" to java.util.function.Function { params ->
val time = (MinecraftClient.getInstance().world?.timeOfDay ?: 0) % 24000
val min = params.getInt(0)
val max = params.getInt(1)
time in min..max
},
"say" to java.util.function.Function { params -> MinecraftClient.getInstance().player?.sendMessage(params.getString(0).text()) ?: Unit },
)
fun MoLangRuntime.setupClient(): MoLangRuntime {
@@ -272,6 +272,9 @@ class PokemonClientDelegate : PoseableEntityState<PokemonEntity>(), PokemonSideD
},
"weight" to java.util.function.Function {
return@Function DoubleValue(currentEntity.pokemon.species.weight.toDouble())
},
"friendship" to java.util.function.Function {
return@Function DoubleValue(currentEntity.pokemon.friendship.toDouble())
}
))
}
@@ -318,7 +318,6 @@ class PCGUI(
centered = true,
shadow = true,
scale = SCALE,
colour = 0x32CBFF,
pMouseX = mouseX,
pMouseY = mouseY
)
@@ -20,7 +20,10 @@ import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFram
import com.cobblemon.mod.common.client.render.models.blockbench.quirk.SimpleQuirk
import com.cobblemon.mod.common.entity.PoseType
import com.cobblemon.mod.common.util.asExpressionLike
import com.cobblemon.mod.common.util.normalizeToArray
import com.cobblemon.mod.common.util.resolveBoolean
import com.cobblemon.mod.common.util.resolveObject
import com.cobblemon.mod.common.util.singularToPluralList
import com.google.gson.JsonArray
import com.google.gson.JsonObject
import com.google.gson.JsonPrimitive
@@ -34,6 +37,8 @@ class JsonPose<T : Entity>(model: PoseableEntityModel<T>, json: JsonObject) {
it.environment.getQueryStruct().addFunctions(model.functions.functions)
}
val condition: ExpressionLike = json.singularToPluralList("condition").get("condition")?.normalizeToArray()?.map { it.asString }?.asExpressionLike() ?: "true".asExpressionLike()
val poseName = json.get("poseName")?.asString ?: "pose"
val poseTypes = (json.get("poseTypes")?.asJsonArray?.map { name ->
PoseType.values().find { it.name.lowercase() == name.asString.lowercase() }
@@ -81,8 +86,9 @@ class JsonPose<T : Entity>(model: PoseableEntityModel<T>, json: JsonObject) {
}
json as JsonObject
json.singularToPluralList("animation")
val animations: (state: PoseableEntityState<T>) -> List<StatefulAnimation<T, *>> = { _ ->
(json.get("animations")?.asJsonArray ?: JsonArray()).map { animJson ->
(json.get("animations")?.normalizeToArray()?.asJsonArray ?: JsonArray()).map { animJson ->
try {
val expr = animJson.asString.asExpressionLike()
runtime.resolveObject(expr).obj as StatefulAnimation<T, *>
@@ -97,10 +103,11 @@ class JsonPose<T : Entity>(model: PoseableEntityModel<T>, json: JsonObject) {
val loopTimes = json.get("loopTimes")?.asInt ?: 1
val minSeconds = json.get("minSecondsBetweenOccurrences")?.asFloat ?: 8F
val maxSeconds = json.get("maxSecondsBetweenOccurrences")?.asFloat ?: 30F
val condition = json.get("condition")?.asString?.asExpressionLike() ?: "true".asExpressionLike()
model.quirkMultiple(
secondsBetweenOccurrences = minSeconds to maxSeconds,
condition = { true },
condition = { it.runtime.resolveBoolean(condition) },
loopTimes = 1..loopTimes,
animations = animations
)
@@ -46,6 +46,7 @@ import com.cobblemon.mod.common.util.asExpressionLike
import com.cobblemon.mod.common.util.getDoubleOrNull
import com.cobblemon.mod.common.util.getStringOrNull
import com.cobblemon.mod.common.util.plus
import com.cobblemon.mod.common.util.resolveBoolean
import net.minecraft.client.model.ModelPart
import net.minecraft.client.render.OverlayTexture
import net.minecraft.client.render.RenderLayer
@@ -154,6 +155,7 @@ abstract class PoseableEntityModel<T : Entity>(
val maxPitch = params.getDoubleOrNull(3) ?: 70F
val minPitch = params.getDoubleOrNull(4) ?: -45F
val maxYaw = params.getDoubleOrNull(5) ?: 45F
val minYaw = params.getDoubleOrNull(6) ?: -45F
ObjectValue(
SingleBoneLookAnimation<T>(
frame = this,
@@ -162,7 +164,8 @@ abstract class PoseableEntityModel<T : Entity>(
yawMultiplier = yawMultiplier.toFloat(),
maxPitch = maxPitch.toFloat(),
minPitch = minPitch.toFloat(),
maxYaw = maxYaw.toFloat()
maxYaw = maxYaw.toFloat(),
minYaw = minYaw.toFloat()
)
)
}
@@ -876,6 +879,18 @@ abstract class PoseableEntityModel<T : Entity>(
animations = { listOf(animation(it)) }
)
fun quirkMoLangCondition(
secondsBetweenOccurrences: Pair<Float, Float> = 8F to 30F,
loopTimes: IntRange = 1..1,
conditionExpression: ExpressionLike = "true".asExpressionLike(),
animation: (state: PoseableEntityState<T>) -> StatefulAnimation<T, *>
) = SimpleQuirk<T>(
secondsBetweenOccurrences = secondsBetweenOccurrences,
loopTimes = loopTimes,
condition = { it.runtime.resolveBoolean(conditionExpression) },
animations = { listOf(animation(it)) }
)
fun quirkMultiple(
secondsBetweenOccurrences: Pair<Float, Float> = 8F to 30F,
loopTimes: IntRange = 1..1,
@@ -78,7 +78,7 @@ abstract class PoseableEntityState<T : Entity> : Schedulable {
"anim_time" to java.util.function.Function { return@Function reusableAnimTime.also { it.value = animationSeconds.toDouble() } },
"pose_type" to java.util.function.Function { return@Function StringValue((getEntity() as Poseable).getCurrentPoseType().name) },
"pose" to java.util.function.Function { _ -> return@Function StringValue(currentPose ?: "") },
"say" to java.util.function.Function { params -> MinecraftClient.getInstance().player?.sendMessage(params.getString(0).text()) ?: Unit },
"has_entity" to java.util.function.Function { _ -> return@Function DoubleValue(getEntity() != null) },
"sound" to java.util.function.Function { params ->
val entity = getEntity() ?: return@Function Unit
if (params.get<MoValue>(0) !is StringValue) {
@@ -33,7 +33,7 @@ class SingleBoneLookAnimation<T : Entity>(
val pitchMultiplier: Float = 1F,
val yawMultiplier: Float = 1F,
val maxPitch: Float = 70F,
val minPitch: Float = 45F,
val minPitch: Float = -45F,
val maxYaw: Float = 45F,
val minYaw: Float = -45F,
) : StatelessAnimation<T, ModelFrame>(frame) {
@@ -54,8 +54,8 @@ class SingleBoneLookAnimation<T : Entity>(
bone = frame.head,
pitchMultiplier = pitchMultiplier ?: if (disableX) 0F else if (invertX) -1F else 1F,
yawMultiplier = yawMultiplier ?: if (disableY) 0F else if (invertY) -1F else 1F,
maxPitch = maxPitch ?: 45F,
minPitch = minPitch ?: -70F,
maxPitch = maxPitch ?: 70F,
minPitch = minPitch ?: -45F,
maxYaw = maxYaw ?: 45F,
minYaw = minYaw ?: -45F,
)
@@ -9,6 +9,7 @@
package com.cobblemon.mod.common.client.render.models.blockbench.pokemon
import com.cobblemon.mod.common.api.molang.ExpressionLike
import com.cobblemon.mod.common.client.entity.PokemonClientDelegate
import com.cobblemon.mod.common.client.render.models.blockbench.JsonPose
import com.cobblemon.mod.common.client.render.models.blockbench.JsonPoseableEntityModel
import com.cobblemon.mod.common.client.render.models.blockbench.PoseableEntityState
@@ -20,6 +21,11 @@ import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.util.adapters.ExpressionLikeAdapter
import com.cobblemon.mod.common.util.adapters.Vec3dAdapter
import com.cobblemon.mod.common.util.isDusk
import com.cobblemon.mod.common.util.isStandingOnRedSand
import com.cobblemon.mod.common.util.isStandingOnSand
import com.cobblemon.mod.common.util.isStandingOnSandOrRedSand
import com.cobblemon.mod.common.util.resolveBoolean
import com.google.gson.ExclusionStrategy
import com.google.gson.FieldAttributes
import com.google.gson.GsonBuilder
@@ -80,30 +86,12 @@ class JsonPokemonPoseableModel(override val rootPart: Bone) : PokemonPoseableMod
override val head: Bone by lazy { headJoint?.let { getPart(it) } ?: rootPart }
@SerializedName("portraitScale")
private val _portraitScale: Float? = null
@SerializedName("portraitTranslation")
private val _portraitTranslation: Vec3d? = null
@SerializedName("profileScale")
private val _profileScale: Float? = null
@SerializedName("profileTranslation")
private val _profileTranslation: Vec3d? = null
//Some weirdness going on here, vars have to be initialized, gson doesn't like multiple fields with the same name
@Transient
//Idk, works fine with Blastoise
override var portraitScale = 1F
get() = _portraitScale ?: 1F
@Transient
override var portraitTranslation = Vec3d.ZERO
get() = _portraitTranslation ?: Vec3d(0.0, 0.0, 0.0)
@Transient
override var profileScale = 1F
get() = _profileScale ?: 1F
@Transient
override var profileTranslation = Vec3d.ZERO
get() = _profileTranslation ?: Vec3d(0.0, 0.0, 0.0)
val faint: Supplier<StatefulAnimation<PokemonEntity, ModelFrame>>? = null
@@ -163,6 +151,32 @@ class JsonPokemonPoseableModel(override val rootPart: Bone) : PokemonPoseableMod
if (mustBeTouchingWater != null) {
conditionsList.add { mustBeTouchingWater == it.isTouchingWater }
}
val mustBeTouchingWaterOrRain = json.get("isTouchingWaterOrRain")?.asBoolean
if (mustBeTouchingWaterOrRain != null) {
conditionsList.add { mustBeTouchingWaterOrRain == it.isTouchingWaterOrRain }
}
val mustBeSubmergedInWater = json.get("isSubmergedInWater")?.asBoolean
if (mustBeSubmergedInWater != null) {
conditionsList.add { mustBeSubmergedInWater == it.isSubmergedInWater }
}
val mustBeStandingOnRedSand = json.get("isStandingOnRedSand")?.asBoolean
if (mustBeStandingOnRedSand != null) {
conditionsList.add { mustBeStandingOnRedSand == it.isStandingOnRedSand() }
}
val mustBeStandingOnSand = json.get("isStandingOnSand")?.asBoolean
if (mustBeStandingOnSand != null) {
conditionsList.add { mustBeStandingOnSand == it.isStandingOnSand() }
}
val mustBeStandingOnSandOrRedSand = json.get("isStandingOnSandOrRedSand")?.asBoolean
if (mustBeStandingOnSandOrRedSand != null) {
conditionsList.add { mustBeStandingOnSandOrRedSand == it.isStandingOnSandOrRedSand() }
}
val mustBeDusk = json.get("isDusk")?.asBoolean
if (mustBeDusk != null) {
conditionsList.add { mustBeDusk == it.isDusk() }
}
conditionsList.add { (it.delegate as PokemonClientDelegate).runtime.resolveBoolean(pose.condition) }
val poseCondition: ((PokemonEntity) -> Boolean)? = if (conditionsList.isEmpty()) null else conditionsList.reduce { acc, function -> { acc(it) && function(it) } }
@@ -8,13 +8,14 @@
package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen1
import com.cobblemon.mod.common.client.render.models.blockbench.animation.BipedWalkAnimation
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BipedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPose
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPoseableModel
import com.cobblemon.mod.common.entity.PoseType
import com.cobblemon.mod.common.entity.PoseType.Companion.MOVING_POSES
import com.cobblemon.mod.common.entity.PoseType.Companion.STATIONARY_POSES
import com.cobblemon.mod.common.entity.PoseType.Companion.UI_POSES
import net.minecraft.client.model.ModelPart
import net.minecraft.util.math.Vec3d
@@ -56,7 +57,7 @@ class KabutopsModel(root: ModelPart) : PokemonPoseableModel(), HeadedFrame, Bipe
standing = registerPose(
poseName = "standing",
poseTypes = UI_POSES + PoseType.STAND,
poseTypes = UI_POSES + STATIONARY_POSES,
condition = { !it.isBattling },
quirks = arrayOf(blink),
idleAnimations = arrayOf(
@@ -67,7 +68,7 @@ class KabutopsModel(root: ModelPart) : PokemonPoseableModel(), HeadedFrame, Bipe
walk = registerPose(
poseName = "walk",
poseType = PoseType.WALK,
poseTypes = MOVING_POSES,
quirks = arrayOf(blink),
idleAnimations = arrayOf(
singleBoneLook(),
@@ -8,21 +8,14 @@
package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen1
import com.cobblemon.mod.common.client.render.models.blockbench.animation.WingFlapIdleAnimation
import com.cobblemon.mod.common.client.render.models.blockbench.createTransformation
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BiWingedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BipedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPose
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPoseableModel
import com.cobblemon.mod.common.client.render.models.blockbench.pose.ModelPartTransformation
import com.cobblemon.mod.common.client.render.models.blockbench.wavefunction.parabolaFunction
import com.cobblemon.mod.common.client.render.models.blockbench.wavefunction.sineFunction
import com.cobblemon.mod.common.entity.PoseType
import com.cobblemon.mod.common.entity.PoseType.Companion.SHOULDER_POSES
import com.cobblemon.mod.common.entity.PoseType.Companion.UI_POSES
import com.cobblemon.mod.common.util.math.geometry.toRadians
import net.minecraft.client.model.ModelPart
import net.minecraft.util.math.Vec3d
@@ -66,7 +59,7 @@ class PidgeyModel(root: ModelPart) : PokemonPoseableModel(), HeadedFrame {
stand = registerPose(
poseName = "standing",
poseTypes = SHOULDER_POSES + UI_POSES + PoseType.STANDING_POSES,
poseTypes = SHOULDER_POSES + UI_POSES + PoseType.STATIONARY_POSES - PoseType.HOVER,
transformTicks = 10,
transformedParts = arrayOf(
wingClosedLeft.createTransformation().withVisibility(visibility = true),
@@ -58,7 +58,6 @@ class RattataAlolanModel(root: ModelPart) : PokemonPoseableModel(), HeadedFrame,
poseTypes = setOf(PoseType.NONE, PoseType.PROFILE, PoseType.STAND, PoseType.FLOAT, PoseType.PORTRAIT, PoseType.SHOULDER_LEFT, PoseType.SHOULDER_RIGHT),
transformTicks = 10,
quirks = arrayOf(blink),
condition = { !it.dataTracker.get(PokemonEntity.MOVING) },
idleAnimations = arrayOf(
singleBoneLook(),
bedrock("rattata_alolan", "ground_idle")
@@ -69,7 +68,6 @@ class RattataAlolanModel(root: ModelPart) : PokemonPoseableModel(), HeadedFrame,
poseType = PoseType.WALK,
transformTicks = 10,
quirks = arrayOf(blink),
condition = { it.dataTracker.get(PokemonEntity.MOVING) },
idleAnimations = arrayOf(
singleBoneLook(),
bedrock("rattata_alolan", "ground_walk")
@@ -57,7 +57,6 @@ class RattataModel(root: ModelPart) : PokemonPoseableModel(), HeadedFrame, Quadr
poseTypes = setOf(PoseType.NONE, PoseType.PROFILE, PoseType.STAND, PoseType.FLOAT, PoseType.PORTRAIT, PoseType.SHOULDER_LEFT, PoseType.SHOULDER_RIGHT),
transformTicks = 10,
quirks = arrayOf(blink),
condition = { !it.dataTracker.get(PokemonEntity.MOVING) },
idleAnimations = arrayOf(
singleBoneLook(),
bedrock("rattata", "ground_idle")
@@ -68,7 +67,6 @@ class RattataModel(root: ModelPart) : PokemonPoseableModel(), HeadedFrame, Quadr
poseType = PoseType.WALK,
transformTicks = 10,
quirks = arrayOf(blink),
condition = { it.dataTracker.get(PokemonEntity.MOVING) },
idleAnimations = arrayOf(
singleBoneLook(),
bedrock("rattata", "ground_walk")
@@ -46,7 +46,7 @@ class SudowoodoModel(root: ModelPart) : PokemonPoseableModel(), HeadedFrame, Bip
poseTypes = STATIONARY_POSES + UI_POSES,
quirks = arrayOf(blink),
idleAnimations = arrayOf(
singleBoneLook(),
singleBoneLook(yawMultiplier = 0F),
bedrock("sudowoodo", "ground_idle")
)
)
@@ -56,7 +56,7 @@ class SudowoodoModel(root: ModelPart) : PokemonPoseableModel(), HeadedFrame, Bip
poseTypes = MOVING_POSES,
quirks = arrayOf(blink),
idleAnimations = arrayOf(
singleBoneLook(),
singleBoneLook(yawMultiplier = 0F),
bedrock("sudowoodo", "ground_idle"),
BipedWalkAnimation(this, periodMultiplier = 0.6F, amplitudeMultiplier = 0.9F),
BimanualSwingAnimation(this, swingPeriodMultiplier = 0.6F, amplitudeMultiplier = 0.9F)
@@ -9,6 +9,7 @@
package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen3
import com.cobblemon.mod.common.client.render.models.blockbench.animation.QuadrupedWalkAnimation
import com.cobblemon.mod.common.client.render.models.blockbench.createTransformation
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.frame.QuadrupedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPose
@@ -34,6 +35,12 @@ class ZigzagoonGalarianModel (root: ModelPart) : PokemonPoseableModel(), HeadedF
lateinit var standing: PokemonPose
lateinit var walk: PokemonPose
lateinit var shoulderLeft: PokemonPose
lateinit var shoulderRight: PokemonPose
val shoulderOffsetX = 0
val shoulderOffsetY = 0
val shoulderOffsetZ = -0.5
override fun registerPoses() {
val blink = quirk { bedrockStateful("zigzagoon_galarian", "blink") }
@@ -57,6 +64,30 @@ class ZigzagoonGalarianModel (root: ModelPart) : PokemonPoseableModel(), HeadedF
bedrock("zigzagoon_galarian", "ground_idle")
)
)
shoulderLeft = registerPose(
poseType = PoseType.SHOULDER_LEFT,
quirks = arrayOf(blink),
idleAnimations = arrayOf(
singleBoneLook(),
bedrock("zigzagoon", "shoulder_left")
),
transformedParts = arrayOf(
rootPart.createTransformation().addPosition(shoulderOffsetX, shoulderOffsetY, shoulderOffsetZ)
)
)
shoulderRight = registerPose(
poseType = PoseType.SHOULDER_RIGHT,
quirks = arrayOf(blink),
idleAnimations = arrayOf(
singleBoneLook(),
bedrock("zigzagoon", "shoulder_right")
),
transformedParts = arrayOf(
rootPart.createTransformation().addPosition(-shoulderOffsetX, shoulderOffsetY, shoulderOffsetZ)
)
)
}
// override fun getFaintAnimation(
@@ -35,7 +35,7 @@ class MismagiusModel (root: ModelPart) : PokemonPoseableModel(), HeadedFrame {
poseTypes = PoseType.STATIONARY_POSES + PoseType.UI_POSES,
quirks = arrayOf(blink),
idleAnimations = arrayOf(
singleBoneLook(),
singleBoneLook(yawMultiplier = 0.5F),
bedrock("mismagius", "ground_idle")
)
)
@@ -45,7 +45,7 @@ class MismagiusModel (root: ModelPart) : PokemonPoseableModel(), HeadedFrame {
poseTypes = PoseType.MOVING_POSES,
quirks = arrayOf(blink),
idleAnimations = arrayOf(
singleBoneLook(),
singleBoneLook(yawMultiplier = 0.5F),
bedrock("mismagius", "ground_idle")
//bedrock("mismagius", "ground_walk")
)
@@ -8,15 +8,12 @@
package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen5
import com.cobblemon.mod.common.client.render.models.blockbench.PoseableEntityState
import com.cobblemon.mod.common.client.render.models.blockbench.animation.BipedWalkAnimation
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BipedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPose
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPoseableModel
import com.cobblemon.mod.common.entity.PoseType
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import net.minecraft.client.model.ModelPart
import net.minecraft.util.math.Vec3d
@@ -25,8 +25,8 @@ class PetililHisuiBiasModel (root: ModelPart) : PokemonPoseableModel(), HeadedFr
val leaf_left = getPart("leaf_left_rotation")
val leaf_right = getPart("leaf_right_rotation")
override var portraitScale = 1.75F
override var portraitTranslation = Vec3d(0.01, -0.39, 0.0)
override var portraitScale = 1.52F
override var portraitTranslation = Vec3d(0.1, -0.25, 0.0)
override var profileScale = 0.8F
override var profileTranslation = Vec3d(0.0, 0.5, 0.0)
@@ -22,8 +22,8 @@ class PetililModel (root: ModelPart) : PokemonPoseableModel(), HeadedFrame {
override val rootPart = root.registerChildWithAllChildren("petilil")
override val head = getPart("head")
override var portraitScale = 2.0F
override var portraitTranslation = Vec3d(-0.3, -1.2, 0.0)
override var portraitScale = 1.52F
override var portraitTranslation = Vec3d(0.1, -0.25, 0.0)
override var profileScale = 0.8F
override var profileTranslation = Vec3d(0.0, 0.5, 0.0)
@@ -8,13 +8,11 @@
package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen6
import com.cobblemon.mod.common.client.render.models.blockbench.PoseableEntityState
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPose
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPoseableModel
import com.cobblemon.mod.common.entity.PoseType
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import net.minecraft.client.model.ModelPart
import net.minecraft.util.math.Vec3d
@@ -51,7 +49,7 @@ class AurorusModel (root: ModelPart) : PokemonPoseableModel(), HeadedFrame {
condition = { !it.isBattling },
quirks = arrayOf(blink),
idleAnimations = arrayOf(
singleBoneLook(),
singleBoneLook(minPitch = -15F),
bedrock("aurorus", "ground_idle")
)
)
@@ -63,7 +61,7 @@ class AurorusModel (root: ModelPart) : PokemonPoseableModel(), HeadedFrame {
quirks = arrayOf(blink),
condition = { it.isBattling },
idleAnimations = arrayOf(
singleBoneLook(),
singleBoneLook(minPitch = -15F),
bedrock("aurorus", "battle_idle")
)
)
@@ -74,7 +72,7 @@ class AurorusModel (root: ModelPart) : PokemonPoseableModel(), HeadedFrame {
transformTicks = 10,
quirks = arrayOf(blink),
idleAnimations = arrayOf(
singleBoneLook(),
singleBoneLook(minPitch = -15F),
bedrock("aurorus", "ground_walk")
)
)
@@ -36,7 +36,7 @@ class KlefkiModel(root: ModelPart) : PokemonPoseableModel(), HeadedFrame {
val blink = quirk { bedrockStateful("klefki", "blink") }
standing = registerPose(
poseName = "standing",
poseTypes = PoseType.STATIONARY_POSES + PoseType.UI_POSES,
poseTypes = PoseType.STATIONARY_POSES + PoseType.UI_POSES + PoseType.SLEEP,
quirks = arrayOf(blink),
condition = { !it.isBattling },
idleAnimations = arrayOf(
@@ -47,7 +47,7 @@ class KlefkiModel(root: ModelPart) : PokemonPoseableModel(), HeadedFrame {
battleidle = registerPose(
poseName = "battle_idle",
poseTypes = PoseType.STATIONARY_POSES,
poseTypes = PoseType.STATIONARY_POSES + PoseType.SLEEP,
transformTicks = 10,
quirks = arrayOf(blink),
condition = { it.isBattling },
@@ -20,7 +20,7 @@ import net.minecraft.util.math.Vec3d
class ArctozoltModel (root: ModelPart) : PokemonPoseableModel(), HeadedFrame {
override val rootPart = root.registerChildWithAllChildren("arctozolt")
override val head = getPart("head")
override val head = getPart("head_ai")
override var portraitTranslation = Vec3d(-0.45, 2.15, 0.0)
override var portraitScale = 0.85F
@@ -85,6 +85,7 @@ class ArctozoltModel (root: ModelPart) : PokemonPoseableModel(), HeadedFrame {
transformTicks = 10,
quirks = arrayOf(blink, quirk),
idleAnimations = arrayOf(
singleBoneLook(),
bedrock("arctozolt", "ground_idle")
)
)
@@ -96,6 +97,7 @@ class ArctozoltModel (root: ModelPart) : PokemonPoseableModel(), HeadedFrame {
transformTicks = 10,
quirks = arrayOf(blink),
idleAnimations = arrayOf(
singleBoneLook(),
bedrock("arctozolt", "ground_walk")
)
)
@@ -107,6 +109,7 @@ class ArctozoltModel (root: ModelPart) : PokemonPoseableModel(), HeadedFrame {
transformTicks = 10,
quirks = arrayOf(blink),
idleAnimations = arrayOf(
singleBoneLook(),
bedrock("arctozolt", "water_idle")
)
)
@@ -118,6 +121,7 @@ class ArctozoltModel (root: ModelPart) : PokemonPoseableModel(), HeadedFrame {
transformTicks = 10,
quirks = arrayOf(blink),
idleAnimations = arrayOf(
singleBoneLook(),
bedrock("arctozolt", "water_swim")
)
)
@@ -129,6 +133,7 @@ class ArctozoltModel (root: ModelPart) : PokemonPoseableModel(), HeadedFrame {
transformTicks = 10,
quirks = arrayOf(blink, quirk),
idleAnimations = arrayOf(
singleBoneLook(),
bedrock("arctozolt", "surfacewater_idle")
)
)
@@ -140,6 +145,7 @@ class ArctozoltModel (root: ModelPart) : PokemonPoseableModel(), HeadedFrame {
transformTicks = 10,
quirks = arrayOf(blink),
idleAnimations = arrayOf(
singleBoneLook(),
bedrock("arctozolt", "surfacewater_swim")
)
)
@@ -151,6 +157,7 @@ class ArctozoltModel (root: ModelPart) : PokemonPoseableModel(), HeadedFrame {
transformTicks = 10,
quirks = arrayOf(blink, quirk),
idleAnimations = arrayOf(
singleBoneLook(),
bedrock("arctozolt", "battle_idle")
)
)
@@ -18,9 +18,9 @@ import net.minecraft.util.math.Vec3d
class DracovishModel (root: ModelPart) : PokemonPoseableModel(), HeadedFrame {
override val rootPart = root.registerChildWithAllChildren("dracovish")
override val head = getPart("head")
override val head = getPart("head_ai")
override var portraitTranslation = Vec3d(-0.25, 2.15, 0.0)
override var portraitTranslation = Vec3d(-0.25, 1.90, 0.0)
override var portraitScale = 0.55F
override var profileScale = 0.3F
@@ -74,6 +74,7 @@ class DracovishModel (root: ModelPart) : PokemonPoseableModel(), HeadedFrame {
transformTicks = 10,
quirks = arrayOf(blink),
idleAnimations = arrayOf(
singleBoneLook(),
bedrock("dracovish", "ground_idle")
)
)
@@ -84,6 +85,7 @@ class DracovishModel (root: ModelPart) : PokemonPoseableModel(), HeadedFrame {
transformTicks = 10,
quirks = arrayOf(blink),
idleAnimations = arrayOf(
singleBoneLook(),
bedrock("dracovish", "ground_walk")
)
)
@@ -94,6 +96,7 @@ class DracovishModel (root: ModelPart) : PokemonPoseableModel(), HeadedFrame {
transformTicks = 10,
quirks = arrayOf(blink),
idleAnimations = arrayOf(
singleBoneLook(),
bedrock("dracovish", "water_idle")
)
)
@@ -104,6 +107,7 @@ class DracovishModel (root: ModelPart) : PokemonPoseableModel(), HeadedFrame {
transformTicks = 10,
quirks = arrayOf(blink),
idleAnimations = arrayOf(
singleBoneLook(),
bedrock("dracovish", "water_swim")
)
)
@@ -115,6 +119,7 @@ class DracovishModel (root: ModelPart) : PokemonPoseableModel(), HeadedFrame {
transformTicks = 10,
quirks = arrayOf(blink),
idleAnimations = arrayOf(
singleBoneLook(),
bedrock("dracovish", "battle_idle")
)
)
@@ -126,6 +131,7 @@ class DracovishModel (root: ModelPart) : PokemonPoseableModel(), HeadedFrame {
transformTicks = 10,
quirks = arrayOf(blink),
idleAnimations = arrayOf(
singleBoneLook(),
bedrock("dracovish", "water_battle_idle")
)
)
@@ -18,7 +18,7 @@ import net.minecraft.util.math.Vec3d
class DracozoltModel (root: ModelPart) : PokemonPoseableModel(), HeadedFrame {
override val rootPart = root.registerChildWithAllChildren("dracozolt")
override val head = getPart("head")
override val head = getPart("head_ai")
override var portraitScale = 0.85F
override var portraitTranslation = Vec3d(-0.55, 1.45, 0.0)
@@ -53,6 +53,7 @@ class DracozoltModel (root: ModelPart) : PokemonPoseableModel(), HeadedFrame {
transformTicks = 10,
quirks = arrayOf(blink),
idleAnimations = arrayOf(
singleBoneLook(),
bedrock("dracozolt", "ground_idle")
)
)
@@ -63,6 +64,7 @@ class DracozoltModel (root: ModelPart) : PokemonPoseableModel(), HeadedFrame {
transformTicks = 10,
quirks = arrayOf(blink),
idleAnimations = arrayOf(
singleBoneLook(),
bedrock("dracozolt", "ground_walk")
)
)
@@ -74,6 +76,7 @@ class DracozoltModel (root: ModelPart) : PokemonPoseableModel(), HeadedFrame {
transformTicks = 10,
quirks = arrayOf(blink),
idleAnimations = arrayOf(
singleBoneLook(),
bedrock("dracozolt", "battle_idle")
)
)
@@ -28,8 +28,8 @@ class DubwoolModel(root: ModelPart) : PokemonPoseableModel(), HeadedFrame, Quadr
override val foreRightLeg = getPart("leg_front_right")
override val hindLeftLeg = getPart("leg_back_left")
override val hindRightLeg = getPart("leg_back_right")
val wool = getPart("wool")
val neckWool = getPart("neck_wool")
val wool = getPart("wool_shearable")
val neckWool = getPart("neck_wool_shearable")
override var portraitScale = 3.1F
override var portraitTranslation = Vec3d(-1.2, -0.7, 0.0)
@@ -28,7 +28,7 @@ class WoolooModel(root: ModelPart) : PokemonPoseableModel(), HeadedFrame, Quadru
override val foreRightLeg = getPart("leg_front_right")
override val hindLeftLeg = getPart("leg_back_left")
override val hindRightLeg = getPart("leg_back_right")
val wool = getPart("wool")
val wool = getPart("wool_shearable")
override var portraitScale = 3.1F
override var portraitTranslation = Vec3d(-0.85, -1.8, 0.0)
@@ -41,7 +41,6 @@ import net.minecraft.client.render.entity.model.EntityModel
import net.minecraft.client.render.item.ItemRenderer
import net.minecraft.client.util.math.MatrixStack
import net.minecraft.entity.Entity
import net.minecraft.entity.player.PlayerEntity
import net.minecraft.text.Text
import net.minecraft.util.Identifier
import net.minecraft.util.math.MathConstants.PI
@@ -153,7 +152,6 @@ class PokemonRenderer(
var beamSourcePosition = if (phaseTarget is EmptyPokeBallEntity) {
(phaseTarget.delegate as PokeBallPoseableState).locatorStates["beam"]?.getOrigin() ?: phaseTarget.pos
} else {
phaseTarget as PlayerEntity
if (phaseTarget.uuid == MinecraftClient.getInstance().player?.uuid) {
val lookVec = phaseTarget.rotationVector.rotateY(PI / 2).multiply(1.0, 0.0, 1.0).normalize()
phaseTarget.getCameraPosVec(partialTicks).subtract(0.0, 0.4, 0.0).subtract(lookVec.multiply(0.3))
@@ -65,12 +65,6 @@ object CobblemonInfoCommand {
.append(this.SPACE)
.append(CobblemonBuildDetails.BRANCH)
message.append(this.NEW_LINE)
.append(this.INDENT)
.append(Text.literal("Timestamp:").styled { it.withColor(Formatting.GRAY) })
.append(this.SPACE)
.append(CobblemonBuildDetails.TIMESTAMP)
ctx.source.sendMessage(message)
0
}
@@ -109,9 +109,9 @@ class StarterConfig {
name = "Hisui Bias",
displayName = "cobblemon.starterselection.category.hisui_bias",
pokemon = mutableListOf(
PokemonProperties.parse("Rowlet region_bias=hisui level=10"),
PokemonProperties.parse("Cyndaquil region_bias=hisui level=10"),
PokemonProperties.parse("Oshawott region_bias=hisui level=10"),
PokemonProperties.parse("Rowlet region_bias=hisui level=10 pokeball=ancient_poke_ball"),
PokemonProperties.parse("Cyndaquil region_bias=hisui level=10 pokeball=ancient_poke_ball"),
PokemonProperties.parse("Oshawott region_bias=hisui level=10 pokeball=ancient_poke_ball"),
)
),
StarterCategory(
@@ -21,7 +21,9 @@ import com.cobblemon.mod.common.api.interaction.PokemonEntityInteraction
import com.cobblemon.mod.common.api.net.serializers.PoseTypeDataSerializer
import com.cobblemon.mod.common.api.net.serializers.StringSetDataSerializer
import com.cobblemon.mod.common.api.pokemon.PokemonProperties
import com.cobblemon.mod.common.api.pokemon.feature.ChoiceSpeciesFeatureProvider
import com.cobblemon.mod.common.api.pokemon.feature.FlagSpeciesFeature
import com.cobblemon.mod.common.api.pokemon.feature.StringSpeciesFeature
import com.cobblemon.mod.common.api.pokemon.status.Statuses
import com.cobblemon.mod.common.api.reactive.ObservableSubscription
import com.cobblemon.mod.common.api.reactive.SimpleObservable
@@ -59,7 +61,6 @@ import com.cobblemon.mod.common.pokemon.evolution.variants.ItemInteractionEvolut
import com.cobblemon.mod.common.pokemon.misc.GimmighoulStashHandler
import com.cobblemon.mod.common.util.*
import com.cobblemon.mod.common.world.gamerules.CobblemonGameRules
import net.minecraft.block.Blocks
import java.util.EnumSet
import java.util.Optional
import java.util.UUID
@@ -82,6 +83,7 @@ import net.minecraft.entity.passive.PassiveEntity
import net.minecraft.entity.passive.TameableShoulderEntity
import net.minecraft.entity.player.PlayerEntity
import net.minecraft.fluid.FluidState
import net.minecraft.item.DyeItem
import net.minecraft.item.ItemStack
import net.minecraft.item.ItemUsage
import net.minecraft.item.Items
@@ -102,8 +104,11 @@ import net.minecraft.sound.SoundEvents
import net.minecraft.text.Text
import net.minecraft.text.TextContent
import net.minecraft.util.ActionResult
import net.minecraft.util.Colors
import net.minecraft.util.DyeColor
import net.minecraft.util.Hand
import net.minecraft.util.Identifier
import net.minecraft.util.Util
import net.minecraft.util.math.BlockPos
import net.minecraft.util.math.Box
import net.minecraft.util.math.Vec3d
@@ -136,6 +141,7 @@ open class PokemonEntity(
@JvmStatic val UNBATTLEABLE = DataTracker.registerData(PokemonEntity::class.java, TrackedDataHandlerRegistry.BOOLEAN)
@JvmStatic val COUNTS_TOWARDS_SPAWN_CAP = DataTracker.registerData(PokemonEntity::class.java, TrackedDataHandlerRegistry.BOOLEAN)
@JvmStatic val SPAWN_DIRECTION = DataTracker.registerData(PokemonEntity::class.java, TrackedDataHandlerRegistry.FLOAT)
@JvmStatic val FRIENDSHIP = DataTracker.registerData(PokemonEntity::class.java, TrackedDataHandlerRegistry.INTEGER)
const val BATTLE_LOCK = "battle"
@@ -181,6 +187,8 @@ open class PokemonEntity(
set(value) = dataTracker.set(BATTLE_ID, Optional.ofNullable(value))
val isBattling: Boolean
get() = dataTracker.get(BATTLE_ID).isPresent
val friendship: Int
get() = dataTracker.get(FRIENDSHIP)
var drops: DropTable? = null
@@ -246,7 +254,9 @@ open class PokemonEntity(
dataTracker.startTracking(LABEL_LEVEL, 1)
dataTracker.startTracking(HIDE_LABEL, false)
dataTracker.startTracking(UNBATTLEABLE, false)
dataTracker.startTracking(COUNTS_TOWARDS_SPAWN_CAP, true)
dataTracker.startTracking(SPAWN_DIRECTION, world.random.nextFloat() * 360F)
dataTracker.startTracking(FRIENDSHIP, 0)
}
override fun onTrackedDataSet(data: TrackedData<*>) {
@@ -326,6 +336,21 @@ open class PokemonEntity(
this.tethering = null
this.pokemon.recall()
}
//This is so that pokemon in the pasture block are ALWAYS in sync with the pokemon box
//Before, pokemon entities in pastures would hold an old ref to a pokemon obj and changes to that would not appear to the underlying file
if (this.tethering != null) {
//Only for online players
if (world.getPlayerByUuid(ownerUuid) != null){
this.ownerUuid?.let {
val actualPokemon = Cobblemon.storage.getPC(it)[this.pokemon.uuid]
actualPokemon?.let {
if (it !== pokemon) {
pokemon = it
}
}
}
}
}
schedulingTracker.update(1/20F)
}
@@ -590,6 +615,7 @@ open class PokemonEntity(
override fun interactMob(player: PlayerEntity, hand: Hand) : ActionResult {
val itemStack = player.getStackInHand(hand)
val colorFeature = pokemon.getFeature<StringSpeciesFeature>(DataKeys.CAN_BE_COLORED)
if (itemStack.isOf(Items.SHEARS) && this.isShearable) {
this.sheared(SoundCategory.PLAYERS)
@@ -655,7 +681,6 @@ open class PokemonEntity(
pokemon.lastFlowerFed = ItemStack.EMPTY
return ActionResult.success(world.isClient)
}
else {
val mushroomStew = ItemUsage.exchangeStack(itemStack, player, Items.MUSHROOM_STEW.defaultStack)
player.setStackInHand(hand, mushroomStew)
@@ -696,6 +721,22 @@ open class PokemonEntity(
return ActionResult.SUCCESS
}
}
else if (itemStack.item is DyeItem && colorFeature != null) {
val item = itemStack.item as DyeItem
if (item.color.name.lowercase() != colorFeature.value.lowercase()) {
itemStack.decrement(1)
colorFeature.value = item.color.name.lowercase()
this.pokemon.markFeatureDirty(colorFeature)
this.pokemon.updateAspects()
}
}
else if (itemStack.item.equals(Items.WATER_BUCKET) && colorFeature != null) {
itemStack.decrement(1)
player.giveOrDropItemStack(Items.BUCKET.defaultStack)
colorFeature.value = ""
this.pokemon.markFeatureDirty(colorFeature)
this.pokemon.updateAspects()
}
if (hand == Hand.MAIN_HAND && player is ServerPlayerEntity && pokemon.getOwnerPlayer() == player) {
@@ -824,7 +865,7 @@ open class PokemonEntity(
// Check evolution item interaction
if (pokemon.getOwnerPlayer() == player) {
val context = ItemInteractionEvolution.ItemInteractionContext(stack, player.world)
pokemon.evolutions
pokemon.lockedEvolutions
.filterIsInstance<ItemInteractionEvolution>()
.forEach { evolution ->
if (evolution.attemptEvolution(pokemon, context)) {
@@ -1122,8 +1163,26 @@ open class PokemonEntity(
this.pokemon.markFeatureDirty(feature)
this.pokemon.updateAspects()
val i = this.random.nextInt(3) + 1
for (j in 0 until i) {
val itemEntity = this.dropItem(Items.WHITE_WOOL, 1) ?: return
for (j in 0 .. i) {
val color = this.pokemon.getFeature<StringSpeciesFeature>(DataKeys.CAN_BE_COLORED)?.value ?: "white"
val woolItem = when (color) {
"black" -> Items.BLACK_WOOL
"blue" -> Items.BLUE_WOOL
"brown" -> Items.BROWN_WOOL
"cyan" -> Items.CYAN_WOOL
"gray" -> Items.GRAY_WOOL
"green" -> Items.GREEN_WOOL
"light-blue" -> Items.LIGHT_BLUE_WOOL
"light-gray" -> Items.LIGHT_GRAY_WOOL
"lime" -> Items.LIME_WOOL
"magenta" -> Items.MAGENTA_WOOL
"orange" -> Items.ORANGE_WOOL
"purple" -> Items.PURPLE_WOOL
"red" -> Items.RED_WOOL
"yellow" -> Items.YELLOW_WOOL
else -> Items.WHITE_WOOL
}
val itemEntity = this.dropItem(woolItem, 1) ?: return
itemEntity.velocity = itemEntity.velocity.add(
((this.random.nextFloat() - this.random.nextFloat()) * 0.1f).toDouble(),
(this.random.nextFloat() * 0.05f).toDouble(),
@@ -1137,6 +1196,8 @@ open class PokemonEntity(
return !this.isBusy && !this.pokemon.isFainted() && !feature.enabled
}
override fun canUsePortals() = false
override fun setAir(air: Int) {
@@ -92,10 +92,28 @@ class PokemonServerDelegate : PokemonSideDelegate {
speed = 0.1F
entity.despawner.beginTracking(this)
}
updateTrackedValues()
}
fun getBattle() = entity.battleId?.let(BattleRegistry::getBattle)
fun updateTrackedValues() {
val trackedSpecies = mock?.species ?: entity.pokemon.species.resourceIdentifier.toString()
val trackedNickname = mock?.nickname ?: entity.pokemon.nickname ?: Text.empty()
val trackedAspects = mock?.aspects ?: entity.pokemon.aspects
entity.dataTracker.set(PokemonEntity.SPECIES, trackedSpecies)
if (entity.dataTracker.get(PokemonEntity.NICKNAME) != trackedNickname) {
entity.dataTracker.set(PokemonEntity.NICKNAME, trackedNickname)
}
entity.dataTracker.set(PokemonEntity.ASPECTS, trackedAspects)
entity.dataTracker.set(PokemonEntity.LABEL_LEVEL, entity.pokemon.level)
entity.dataTracker.set(PokemonEntity.MOVING, entity.velocity.multiply(1.0, if (entity.isOnGround) 0.0 else 1.0, 1.0).length() > 0.005F)
entity.dataTracker.set(PokemonEntity.FRIENDSHIP, entity.pokemon.friendship)
updatePoseType()
}
override fun onTrackedDataSet(data: TrackedData<*>) {
super.onTrackedDataSet(data)
if (this::entity.isInitialized) {
@@ -162,24 +180,12 @@ class PokemonServerDelegate : PokemonSideDelegate {
entity.remove(Entity.RemovalReason.DISCARDED)
}
val trackedSpecies = mock?.species ?: entity.pokemon.species.resourceIdentifier.toString()
val trackedNickname = mock?.nickname ?: entity.pokemon.nickname ?: Text.empty()
val trackedAspects = mock?.aspects ?: entity.pokemon.aspects
entity.dataTracker.set(PokemonEntity.SPECIES, trackedSpecies)
if (entity.dataTracker.get(PokemonEntity.NICKNAME) != trackedNickname) {
entity.dataTracker.set(PokemonEntity.NICKNAME, trackedNickname)
}
entity.dataTracker.set(PokemonEntity.ASPECTS, trackedAspects)
entity.dataTracker.set(PokemonEntity.LABEL_LEVEL, entity.pokemon.level)
entity.dataTracker.set(PokemonEntity.MOVING, !entity.navigation.isIdle)
updatePoseType()
updateTrackedValues()
}
fun updatePoseType() {
val isSleeping = entity.pokemon.status?.status == Statuses.SLEEP && entity.behaviour.resting.canSleep
val isMoving = entity.velocity.multiply(1.0, if (entity.isOnGround) 0.0 else 1.0, 1.0).length() > 0.005F
val isMoving = entity.dataTracker.get(PokemonEntity.MOVING)
val isPassenger = entity.hasVehicle()
val isUnderwater = entity.getIsSubmerged()
val isFlying = entity.getBehaviourFlag(PokemonBehaviourFlag.FLYING)
@@ -87,9 +87,7 @@ object AdvancementHandler {
event.battle.actors.forEach { battleActor ->
if (!event.winners.contains(battleActor) && battleActor.type == ActorType.WILD) {
battleActor.pokemonList.forEach { battlePokemon ->
battlePokemon.entity?.pokemon?.let {
advancementData.updateTotalDefeatedCount(it)
}
advancementData.updateTotalDefeatedCount(battlePokemon.originalPokemon)
}
}
}
@@ -10,6 +10,7 @@ package com.cobblemon.mod.common.integration.adorn
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.ResourcePackActivationBehaviour
import com.cobblemon.mod.common.mixin.invoker.AdornRegisterInvoker
import com.cobblemon.mod.common.util.cobblemonResource
import juuxel.adorn.block.variant.BlockKind
import juuxel.adorn.block.variant.BlockVariant
@@ -20,29 +21,7 @@ import org.jetbrains.annotations.ApiStatus
@ApiStatus.Internal
object AdornCompatibility : BlockVariantSet {
override val woodVariants: List<BlockVariant> = listOf(
BlockVariant.Wood("${Cobblemon.MODID}/apricorn")
)
private val registerMethod by lazy {
BlockVariantSets::class.java.getDeclaredMethod("register", BlockKind::class.java, BlockVariant::class.java).apply { isAccessible = true }
}
@ApiStatus.Internal
fun register() {
var count = 0
Cobblemon.implementation.registerBuiltinResourcePack(cobblemonResource("adorncompatibility"), Text.literal("Adorn Compatibility"), ResourcePackActivationBehaviour.ALWAYS_ENABLED)
BlockKind.values().forEach { kind ->
this.woodVariants.forEach { variant ->
// We use this hack because we can't just call BlockVariantSets#register
// This would attempt to register blocks and items multiple times
// Unfortunately Adorn does all these registrations on mod initialization on all implementations making it impossible to "correctly" add our things
this.registerMethod.invoke(BlockVariantSets, kind, variant)
count++
}
}
Cobblemon.LOGGER.info("Registered {} blocks to Adorn", count)
}
}
@@ -19,7 +19,7 @@ class LinkCableItem : CobblemonItem(Settings()), PokemonEntityInteraction {
override val accepted = setOf(PokemonEntityInteraction.Ownership.OWNER)
override fun processInteraction(player: ServerPlayerEntity, entity: PokemonEntity, stack: ItemStack): Boolean {
val pokemon = entity.pokemon
pokemon.evolutions.filterIsInstance<TradeEvolution>().forEach { evolution ->
pokemon.lockedEvolutions.filterIsInstance<TradeEvolution>().forEach { evolution ->
// If an evolution is possible non-optional or has been successfully queued we will consume the item and stop
// validate requirements to respect required held items and such.
if (evolution.requirements.all { it.check(pokemon) } && evolution.evolve(pokemon)) {
@@ -117,7 +117,7 @@ class PokemonDTO : Encodable, Decodable {
this.featuresBuffer = PacketByteBuf(Unpooled.buffer())
val visibleFeatures = pokemon.features
.filterIsInstance<SynchronizedSpeciesFeature>()
.filter { (SpeciesFeatures.getFeature(it.name)!! as SynchronizedSpeciesFeatureProvider<*>).visible }
.filter { (SpeciesFeatures.getFeature(it.name) as? SynchronizedSpeciesFeatureProvider<*>)?.visible == true }
featuresBuffer.writeCollection(visibleFeatures) { _, value ->
featuresBuffer.writeString(value.name)
value.encode(featuresBuffer)
@@ -39,6 +39,7 @@ class SpawnPokemonPacket(
private val hideLabel: Boolean,
private val caughtBall: Identifier,
private val spawnYaw: Float,
private val friendship: Int,
vanillaSpawnPacket: EntitySpawnS2CPacket
) : SpawnExtraDataEntityPacket<SpawnPokemonPacket, PokemonEntity>(vanillaSpawnPacket) {
@@ -60,6 +61,7 @@ class SpawnPokemonPacket(
entity.dataTracker.get(PokemonEntity.HIDE_LABEL),
entity.pokemon.caughtBall.name,
entity.dataTracker.get(PokemonEntity.SPAWN_DIRECTION),
entity.dataTracker.get(PokemonEntity.FRIENDSHIP),
vanillaSpawnPacket
)
@@ -79,6 +81,7 @@ class SpawnPokemonPacket(
buffer.writeBoolean(this.hideLabel)
buffer.writeIdentifier(this.caughtBall)
buffer.writeFloat(this.spawnYaw)
buffer.writeInt(this.friendship)
}
override fun applyData(entity: PokemonEntity) {
@@ -101,6 +104,7 @@ class SpawnPokemonPacket(
entity.dataTracker.set(PokemonEntity.UNBATTLEABLE, unbattlable)
entity.dataTracker.set(PokemonEntity.HIDE_LABEL, hideLabel)
entity.dataTracker.set(PokemonEntity.SPAWN_DIRECTION, spawnYaw)
entity.dataTracker.set(PokemonEntity.FRIENDSHIP, friendship)
}
override fun checkType(entity: Entity): Boolean = entity is PokemonEntity
@@ -124,9 +128,10 @@ class SpawnPokemonPacket(
val hideLabel = buffer.readBoolean()
val caughtBall = buffer.readIdentifier()
val spawnAngle = buffer.readFloat()
val friendship = buffer.readInt()
val vanillaPacket = decodeVanillaPacket(buffer)
return SpawnPokemonPacket(ownerId, scaleModifier, species, form, aspects, battleId, phasingTargetId, beamModeEmitter, nickname, labelLevel, poseType, unbattlable, hideLabel, caughtBall, spawnAngle, vanillaPacket)
return SpawnPokemonPacket(ownerId, scaleModifier, species, form, aspects, battleId, phasingTargetId, beamModeEmitter, nickname, labelLevel, poseType, unbattlable, hideLabel, caughtBall, spawnAngle, friendship, vanillaPacket)
}
}
@@ -426,6 +426,8 @@ open class Pokemon : ShowdownIdentifiable {
// We want non-optional evolutions to trigger first to avoid unnecessary packets and any cost associate with an optional one that would just be lost
val evolutions: Iterable<Evolution> get() = this.form.evolutions.sortedBy { evolution -> evolution.optional }
val lockedEvolutions: Iterable<Evolution>
get() = evolutions.filter { it !in evolutionProxy.current() }
val preEvolution: PreEvolution? get() = this.form.preEvolution
@@ -43,7 +43,8 @@ object CobblemonRequirementAdapter : RequirementAdapter {
this.registerType(TimeRangeRequirement.ADAPTER_VARIANT, TimeRangeRequirement::class)
this.registerType(LevelRequirement.ADAPTER_VARIANT, LevelRequirement::class)
this.registerType(WeatherRequirement.ADAPTER_VARIANT, WeatherRequirement::class)
this.registerType(AttackDefenceRatioRequirement.ADAPTER_VARIANT, AttackDefenceRatioRequirement::class)
this.registerType(StatCompareRequirement.ADAPTER_VARIANT, StatCompareRequirement::class)
this.registerType(StatEqualRequirement.ADAPTER_VARIANT, StatEqualRequirement::class)
this.registerType(BattleCriticalHitsRequirement.ADAPTER_VARIANT, BattleCriticalHitsRequirement::class)
this.registerType(DamageTakenRequirement.ADAPTER_VARIANT, DamageTakenRequirement::class)
this.registerType(UseMoveRequirement.ADAPTER_VARIANT, UseMoveRequirement::class)
@@ -9,24 +9,18 @@
package com.cobblemon.mod.common.pokemon.evolution.requirements
import com.cobblemon.mod.common.api.pokemon.evolution.requirement.EvolutionRequirement
import com.cobblemon.mod.common.api.pokemon.stats.Stats
import com.cobblemon.mod.common.pokemon.Pokemon
class AttackDefenceRatioRequirement : EvolutionRequirement {
class StatCompareRequirement : EvolutionRequirement {
companion object {
const val ADAPTER_VARIANT = "attack_defence_ratio"
}
enum class AttackDefenceRatio {
ATTACK_HIGHER,
DEFENCE_HIGHER,
EQUAL
const val ADAPTER_VARIANT = "stat_compare"
}
val ratio = AttackDefenceRatio.ATTACK_HIGHER
val highStat = Stats.ATTACK.name
val lowStat = Stats.DEFENCE.name
override fun check(pokemon: Pokemon): Boolean {
return when (ratio) {
AttackDefenceRatio.ATTACK_HIGHER -> pokemon.attack > pokemon.defence
AttackDefenceRatio.DEFENCE_HIGHER -> pokemon.defence > pokemon.attack
AttackDefenceRatio.EQUAL -> pokemon.attack == pokemon.defence
}
return pokemon.getStat(Stats.getStat(highStat)) > pokemon.getStat(Stats.getStat(lowStat))
}
}
@@ -0,0 +1,26 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.pokemon.evolution.requirements
import com.cobblemon.mod.common.api.pokemon.evolution.requirement.EvolutionRequirement
import com.cobblemon.mod.common.api.pokemon.stats.Stats
import com.cobblemon.mod.common.pokemon.Pokemon
class StatEqualRequirement : EvolutionRequirement {
companion object {
const val ADAPTER_VARIANT = "stat_equal"
}
val statOne = Stats.ATTACK.name
val statTwo = Stats.DEFENCE.name
override fun check(pokemon: Pokemon): Boolean {
return pokemon.getStat(Stats.getStat(statOne)) == pokemon.getStat(Stats.getStat(statTwo))
}
}
@@ -24,10 +24,11 @@ import net.minecraft.world.gen.structure.Structure
*/
class StructureRequirement : EntityQueryRequirement {
val structureCondition: RegistryLikeCondition<Structure>? = null
val structureAnticondition: RegistryLikeCondition<Structure>? = null
override fun check(pokemon: Pokemon, queriedEntity: LivingEntity): Boolean {
val structures = queriedEntity.world.getChunk(queriedEntity.blockPos).structureReferences
val registry = queriedEntity.world.registryManager.get(RegistryKeys.STRUCTURE)
return (structureCondition == null || structures.any { structureCondition.fits(it.key, registry) })
return (structureCondition == null || structures.any { structureCondition.fits(it.key, registry) }) && (structureAnticondition == null || !structures.any { structureAnticondition.fits(it.key, registry) })
}
companion object {
@@ -13,6 +13,7 @@ import com.cobblemon.mod.common.api.battles.interpreter.BattleMessage
import com.cobblemon.mod.common.api.battles.model.PokemonBattle
import com.cobblemon.mod.common.api.pokemon.helditem.HeldItemManager
import com.cobblemon.mod.common.api.tags.CobblemonItemTags
import com.cobblemon.mod.common.battles.actor.PlayerBattleActor
import com.cobblemon.mod.common.battles.pokemon.BattlePokemon
import com.cobblemon.mod.common.pokemon.Pokemon
import com.cobblemon.mod.common.util.battleLang
@@ -87,7 +88,7 @@ object CobblemonHeldItemManager : BaseCobblemonHeldItemManager() {
val battlerName = pokemon.getName()
// Airballoon is the only item using the null effect gimmick
if (effect == null) {
battle.broadcastChatMessage(battleLang("item.$itemID.start", battlerName))
battle.broadcastChatMessage(battleLang("item.$itemID", battlerName))
return
}
val sourceName = battleMessage.battlePokemonFromOptional(battle)?.getName() ?: Text.of("UNKNOWN")
@@ -104,26 +105,33 @@ object CobblemonHeldItemManager : BaseCobblemonHeldItemManager() {
if (this.takeItemEffect.contains(effectId) && this.giveItemEffect.contains(effectId) && !consumeHeldItems) {
return
}
if (this.giveItemEffect.contains(effectId)) {
// Block item swapping in PVP until we have a rule
if (battle.isPvP && !consumeHeldItems) {
return
}
// if items aren't consumed, then we don't want to give them to wild pokemon (dupe)
if (this.giveItemEffect.contains(effectId) && (pokemon.actor is PlayerBattleActor || consumeHeldItems)) {
this.give(pokemon, itemID)
}
if (this.takeItemEffect.contains(effectId)) {
// allow players to steal wild held items
if (this.takeItemEffect.contains(effectId) && (pokemon.actor !is PlayerBattleActor || consumeHeldItems)) {
battleMessage.actorAndActivePokemonFromOptional(battle)?.second?.battlePokemon?.let { this.take(it, itemID) }
}
}
override fun handleEndInstruction(pokemon: BattlePokemon, battle: PokemonBattle, battleMessage: BattleMessage) {
val itemID = battleMessage.effectAt(1)?.id ?: return
val consumeHeldItems = this.shouldConsumeItem(pokemon, battle, itemID)
// These are sent when showdown wants the client to animate something but not produce any text
if (battleMessage.hasOptionalArgument("silent")) {
this.take(pokemon, itemID)
if (consumeHeldItems) this.take(pokemon, itemID)
return
}
val battlerName = pokemon.getName()
val itemName = this.nameOf(itemID)
if (battleMessage.hasOptionalArgument("eat")) {
battle.broadcastChatMessage(battleLang("item.eat", battlerName, itemName))
this.take(pokemon, itemID)
if (consumeHeldItems) this.take(pokemon, itemID)
return
}
val sourceName = battleMessage.battlePokemonFromOptional(battle)?.getName() ?: Text.of("UNKNOWN")
@@ -135,7 +143,7 @@ object CobblemonHeldItemManager : BaseCobblemonHeldItemManager() {
else -> battleLang("enditem.$itemID", battlerName)
}
}
this.take(pokemon, itemID)
if (consumeHeldItems) this.take(pokemon, itemID)
battle.broadcastChatMessage(text)
}
@@ -98,11 +98,11 @@ object TradeManager {
party2.add(pokemon1)
party1.add(pokemon2)
pokemon1.evolutions.filterIsInstance<TradeEvolution>().firstOrNull {
pokemon1.lockedEvolutions.filterIsInstance<TradeEvolution>().firstOrNull {
it.attemptEvolution(pokemon1, pokemon2)
}
pokemon2.evolutions.filterIsInstance<TradeEvolution>().firstOrNull {
pokemon2.lockedEvolutions.filterIsInstance<TradeEvolution>().firstOrNull {
it.attemptEvolution(pokemon2, pokemon1)
}
CobblemonEvents.TRADE_COMPLETED.post(TradeCompletedEvent(player1, pokemon2, player2, pokemon1))
@@ -134,6 +134,7 @@ object DataKeys {
// Features
const val CAN_BE_MILKED = "milkable"
const val HAS_BEEN_SHEARED = "sheared"
const val CAN_BE_COLORED = "color"
// Variants
const val IS_MOOSHTANK = "mooshtank"
@@ -24,7 +24,7 @@ inline fun <reified T> Gson.fromJson(string: String) = fromJson(string, T::class
* the list value identified by the plural name. During runtime only the plural exists, but when
* configuring the JSON the user can use the singular form for a cleaner document.
*/
fun JsonObject.singularToPluralList(rootName: String, pluralName: String = "${rootName}s") {
fun JsonObject.singularToPluralList(rootName: String, pluralName: String = "${rootName}s"): JsonObject {
if (has(rootName)) {
if (!has(pluralName)) {
add(pluralName, JsonArray())
@@ -32,6 +32,7 @@ fun JsonObject.singularToPluralList(rootName: String, pluralName: String = "${ro
get(pluralName).asJsonArray.add(get(rootName))
remove(rootName)
}
return this
}
fun JsonElement.normalizeToArray(): JsonArray {
@@ -5,30 +5,32 @@
"identifier": "cobblemon:ancientoriginball/ballsparkle",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsparkle"
"texture": "textures/particles/balls/originball/originballsparkle"
}
},
"components": {
"minecraft:emitter_rate_steady": {
"spawn_rate": 16,
"max_particles": 16
"spawn_rate": 22,
"max_particles": 24
},
"minecraft:emitter_lifetime_once": {
"active_time": 0.5
},
"minecraft:emitter_shape_sphere": {
"offset": [0, 1.5, 0],
"offset": [0, 2, 0],
"radius": "math.random(0.5,1.5)*1.5",
"surface_only": true,
"direction": [0, 1, 0]
"direction": ["math.random(-9,9)", "math.random(4,7)", "math.random(-9,9)"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": 0.75,
"minecraft:particle_motion_dynamic": {},
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, 2, 0]
},
"minecraft:particle_appearance_billboard": {
"size": [0.2, 0.2],
"size": [0.175, 0.175],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 36,
@@ -5,25 +5,30 @@
"identifier": "cobblemon:ancientoriginball/battle/ballsendsparkle",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsendsparkle"
"texture": "textures/particles/balls/originball/originballsendsparkle"
}
},
"components": {
"minecraft:emitter_rate_instant": {
"num_particles": 8
"minecraft:emitter_initialization": {
"per_update_expression": "variable.radius = 0.6;"
},
"minecraft:emitter_rate_steady": {
"spawn_rate": 100,
"max_particles": 16
},
"minecraft:emitter_lifetime_once": {
"active_time": 1
},
"minecraft:emitter_shape_sphere": {
"direction": ["math.random(-10,10)", "math.random(-0.05,4)*4+0.5", "math.random(-10,10)"]
"radius": "variable.radius*math.cos(variable.emitter_age*2080)",
"direction": ["math.random(-5,5)*1.75", "math.random(-0.05,6)*3+0.5", "math.random(-5,5)*1.75"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": "math.random(4,7)*3",
"minecraft:particle_initial_speed": "math.random(3,7)*4",
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, -5, 0],
"linear_acceleration": [0, "-math.random(5,8)", 0],
"linear_drag_coefficient": 4
},
"minecraft:particle_appearance_billboard": {
@@ -5,38 +5,52 @@
"identifier": "cobblemon:ancientoriginball/battle/ballsparks",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsparks"
"texture": "textures/particles/balls/originball/originballsparks"
}
},
"curves": {
"variable.sizefunny": {
"type": "linear",
"input": "v.particle_age",
"horizontal_range": "v.particle_lifetime",
"nodes": [1, 1, 1, 0.98, 0.93, 0.83, 0.58, -0.01, 0, 0]
}
},
"components": {
"minecraft:emitter_rate_instant": {
"num_particles": 10
"num_particles": 20
},
"minecraft:emitter_lifetime_once": {
"active_time": 1
"active_time": 0.5
},
"minecraft:emitter_shape_sphere": {
"direction": ["math.random(-10,10)", "math.random(-0.1,4)*3+0.5", "math.random(-10,10)"]
"direction": ["math.random(-10,10)", "math.random(-0.1,4)*3+0.25", "math.random(-10,10)"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": "math.random(4,7)*3.5",
"minecraft:particle_initial_speed": "math.random(3.1,4.8)*3.5",
"minecraft:particle_motion_dynamic": {
"linear_drag_coefficient": 4.5
"linear_acceleration": ["math.random(-3.5,3.5)*10", "math.random(-2.5,2.5)*10", "math.random(-3.5,3.5)*10"],
"linear_drag_coefficient": 3.5
},
"minecraft:particle_appearance_billboard": {
"size": [0.15, 0.15],
"size": ["(0.225-(variable.particle_random_3*0.1))*v.sizefunny", "(0.225-(variable.particle_random_3*0.1))*v.sizefunny"],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 80,
"texture_height": 8,
"flipbook": {
"base_UV": [0, 0],
"size_UV": [8, 8],
"step_UV": [8, 0],
"frames_per_second": 18,
"max_frame": 10
"texture_width": 90,
"texture_height": 9,
"uv": ["math.floor(v.particle_random_3*10)*9", 0],
"uv_size": [9, 9]
}
},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.particle_age / v.particle_lifetime",
"gradient": {
"0.14": "#ffffffff",
"0.43": "#FFFF0000",
"0.71": "#FF7B0000"
}
}
}
@@ -5,7 +5,7 @@
"identifier": "cobblemon:ancientoriginball/battle/sendflash",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/battle/sendflash"
"texture": "textures/particles/balls/originball/battle/originsendflash"
}
},
"components": {
@@ -27,14 +27,14 @@
"size": [2.25, 2.25],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 1024,
"texture_width": 1088,
"texture_height": 64,
"flipbook": {
"base_UV": [0, 0],
"size_UV": [64, 64],
"step_UV": [64, 0],
"frames_per_second": 24,
"max_frame": 16
"max_frame": 17
}
}
}
@@ -5,12 +5,12 @@
"identifier": "cobblemon:ancientoriginball/casual/ballsendsparkle",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsendsparkle"
"texture": "textures/particles/balls/originball/originballsendsparkle"
}
},
"components": {
"minecraft:emitter_rate_instant": {
"num_particles": 4
"num_particles": 6
},
"minecraft:emitter_lifetime_once": {
"active_time": 1
@@ -21,7 +21,7 @@
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": "math.random(4,6)*2.5",
"minecraft:particle_initial_speed": "math.random(3,6)*3",
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, -6, 0],
"linear_drag_coefficient": 4
@@ -5,38 +5,52 @@
"identifier": "cobblemon:ancientoriginball/casual/ballsparks",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsparks"
"texture": "textures/particles/balls/originball/originballsparks"
}
},
"curves": {
"variable.sizefunny": {
"type": "linear",
"input": "v.particle_age",
"horizontal_range": "v.particle_lifetime",
"nodes": [1, 1, 1, 0.98, 0.93, 0.83, 0.58, -0.01, 0, 0, 0]
}
},
"components": {
"minecraft:emitter_rate_instant": {
"num_particles": 5
"num_particles": 10
},
"minecraft:emitter_lifetime_once": {
"active_time": 1
"active_time": 0.5
},
"minecraft:emitter_shape_sphere": {
"direction": ["math.random(-10,10)", "math.random(-0.1,4)*3+0.5", "math.random(-10,10)"]
"direction": ["math.random(-10,10)", "math.random(-0.1,4)*3+0.25", "math.random(-10,10)"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": "math.random(4,7)*2.1",
"minecraft:particle_initial_speed": "math.random(3.1,4.8)*2.5",
"minecraft:particle_motion_dynamic": {
"linear_acceleration": ["math.random(-3.5,3.5)*10", "math.random(-2.5,2.5)*10", "math.random(-3.5,3.5)*10"],
"linear_drag_coefficient": 3.5
},
"minecraft:particle_appearance_billboard": {
"size": [0.1, 0.1],
"size": ["(0.225-(variable.particle_random_3*0.1))*v.sizefunny", "(0.225-(variable.particle_random_3*0.1))*v.sizefunny"],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 80,
"texture_height": 8,
"flipbook": {
"base_UV": [0, 0],
"size_UV": [8, 8],
"step_UV": [8, 0],
"frames_per_second": 18,
"max_frame": 10
"texture_width": 90,
"texture_height": 9,
"uv": ["math.floor(v.particle_random_3*10)*9", 0],
"uv_size": [9, 9]
}
},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.particle_age / v.particle_lifetime",
"gradient": {
"0.14": "#ffffffff",
"0.33": "#FFFF0000",
"0.61": "#FF7B0000"
}
}
}
@@ -5,7 +5,7 @@
"identifier": "cobblemon:ancientoriginball/casual/sendflash",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/casual/sendcasual"
"texture": "textures/particles/balls/originball/casual/originsendcasual"
}
},
"components": {
@@ -27,14 +27,14 @@
"size": [1.25, 1.25],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 384,
"texture_width": 416,
"texture_height": 32,
"flipbook": {
"base_UV": [0, 0],
"size_UV": [32, 32],
"step_UV": [32, 0],
"frames_per_second": 24,
"max_frame": 12
"max_frame": 13
}
}
}
@@ -5,30 +5,32 @@
"identifier": "cobblemon:beastball/ballsparkle",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsparkle"
"texture": "textures/particles/balls/beastball/beastballsparkle"
}
},
"components": {
"minecraft:emitter_rate_steady": {
"spawn_rate": 16,
"max_particles": 16
"spawn_rate": 24,
"max_particles": 18
},
"minecraft:emitter_lifetime_once": {
"active_time": 0.5
},
"minecraft:emitter_shape_sphere": {
"offset": [0, 1.5, 0],
"radius": "math.random(0.5,1.5)*1.5",
"offset": [0, 1.75, 0],
"radius": 1.25,
"surface_only": true,
"direction": [0, 1, 0]
"direction": ["math.random(-9,9)", "math.random(4,7)", "math.random(-9,9)"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": 0.75,
"minecraft:particle_motion_dynamic": {},
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, 2, 0]
},
"minecraft:particle_appearance_billboard": {
"size": [0.2, 0.2],
"size": [0.15, 0.15],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 36,
@@ -5,12 +5,12 @@
"identifier": "cobblemon:beastball/battle/ballsendsparkle",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsendsparkle"
"texture": "textures/particles/balls/beastball/beastballsendsparkle"
}
},
"components": {
"minecraft:emitter_rate_instant": {
"num_particles": 8
"num_particles": 14
},
"minecraft:emitter_lifetime_once": {
"active_time": 1
@@ -21,13 +21,13 @@
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": "math.random(4,7)*3",
"minecraft:particle_initial_speed": "math.random(4,7)*4.5",
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, -5, 0],
"linear_drag_coefficient": 4
"linear_acceleration": [0, -6, 0],
"linear_drag_coefficient": 5
},
"minecraft:particle_appearance_billboard": {
"size": [0.15, 0.15],
"size": [0.125, 0.125],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 99,
@@ -5,28 +5,32 @@
"identifier": "cobblemon:beastball/battle/ballsparks",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsparks"
"texture": "textures/particles/balls/beastball/beastballsparks"
}
},
"components": {
"minecraft:emitter_rate_instant": {
"num_particles": 10
"num_particles": 20
},
"minecraft:emitter_lifetime_once": {
"active_time": 1
},
"minecraft:emitter_shape_sphere": {
"direction": ["math.random(-10,10)", "math.random(-0.1,4)*3+0.5", "math.random(-10,10)"]
"direction": ["math.random(-10,10)", "math.random(-0.5,5)*5+0.5", "math.random(-10,10)"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": "math.random(4,7)*3.5",
"minecraft:particle_initial_spin": {
"rotation": "math.random_integer(0,3)*90"
},
"minecraft:particle_initial_speed": "math.random(3,6)*3",
"minecraft:particle_motion_dynamic": {
"linear_drag_coefficient": 4.5
"linear_acceleration": [0, -20, 0],
"linear_drag_coefficient": 2
},
"minecraft:particle_appearance_billboard": {
"size": [0.15, 0.15],
"size": ["0.075+0.075*v.particle_random_2", "0.075+0.075*v.particle_random_2"],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 80,
@@ -5,7 +5,7 @@
"identifier": "cobblemon:beastball/battle/sendflash",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/battle/sendflash"
"texture": "textures/particles/balls/beastball/battle/beastsendflash"
}
},
"components": {
@@ -27,14 +27,14 @@
"size": [2.25, 2.25],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 1024,
"texture_width": 1088,
"texture_height": 64,
"flipbook": {
"base_UV": [0, 0],
"size_UV": [64, 64],
"step_UV": [64, 0],
"frames_per_second": 24,
"max_frame": 16
"max_frame": 17
}
}
}
@@ -5,12 +5,12 @@
"identifier": "cobblemon:beastball/casual/ballsendsparkle",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsendsparkle"
"texture": "textures/particles/balls/beastball/beastballsendsparkle"
}
},
"components": {
"minecraft:emitter_rate_instant": {
"num_particles": 4
"num_particles": 6
},
"minecraft:emitter_lifetime_once": {
"active_time": 1
@@ -21,7 +21,7 @@
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": "math.random(4,6)*2.5",
"minecraft:particle_initial_speed": "math.random(3,6)*3",
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, -6, 0],
"linear_drag_coefficient": 4
@@ -5,28 +5,32 @@
"identifier": "cobblemon:beastball/casual/ballsparks",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsparks"
"texture": "textures/particles/balls/beastball/beastballsparks"
}
},
"components": {
"minecraft:emitter_rate_instant": {
"num_particles": 5
"num_particles": 12
},
"minecraft:emitter_lifetime_once": {
"active_time": 1
},
"minecraft:emitter_shape_sphere": {
"direction": ["math.random(-10,10)", "math.random(-0.1,4)*3+0.5", "math.random(-10,10)"]
"direction": ["math.random(-10,10)", "math.random(-0.5,5)*5+0.5", "math.random(-10,10)"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": "math.random(4,7)*2.1",
"minecraft:particle_initial_spin": {
"rotation": "math.random_integer(0,3)*90"
},
"minecraft:particle_initial_speed": "math.random(3,7)*2",
"minecraft:particle_motion_dynamic": {
"linear_drag_coefficient": 3.5
"linear_acceleration": [0, -15, 0],
"linear_drag_coefficient": 2
},
"minecraft:particle_appearance_billboard": {
"size": [0.1, 0.1],
"size": ["0.05+0.075*v.particle_random_2", "0.05+0.075*v.particle_random_2"],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 80,
@@ -5,7 +5,7 @@
"identifier": "cobblemon:beastball/casual/sendflash",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/casual/sendcasual"
"texture": "textures/particles/balls/beastball/casual/beastsendcasual"
}
},
"components": {
@@ -5,30 +5,32 @@
"identifier": "cobblemon:cherishball/ballsparkle",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsparkle"
"texture": "textures/particles/balls/cherishball/cherishballsparkle"
}
},
"components": {
"minecraft:emitter_rate_steady": {
"spawn_rate": 16,
"max_particles": 16
"spawn_rate": 24,
"max_particles": 18
},
"minecraft:emitter_lifetime_once": {
"active_time": 0.5
},
"minecraft:emitter_shape_sphere": {
"offset": [0, 1.5, 0],
"radius": "math.random(0.5,1.5)*1.5",
"offset": [0, 1.75, 0],
"radius": 1.25,
"surface_only": true,
"direction": [0, 1, 0]
"direction": ["math.random(-9,9)", "math.random(4,7)", "math.random(-9,9)"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": 0.75,
"minecraft:particle_motion_dynamic": {},
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, 2, 0]
},
"minecraft:particle_appearance_billboard": {
"size": [0.2, 0.2],
"size": [0.15, 0.15],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 36,
@@ -41,6 +43,15 @@
"max_frame": 4
}
}
},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.particle_age / v.particle_lifetime",
"gradient": {
"0.0": "#FFFFFFFF",
"0.19": "#FFFF8845"
}
}
}
}
}
@@ -5,12 +5,12 @@
"identifier": "cobblemon:cherishball/battle/ballsendsparkle",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsendsparkle"
"texture": "textures/particles/balls/cherishball/cherishballsendsparkle"
}
},
"components": {
"minecraft:emitter_rate_instant": {
"num_particles": 8
"num_particles": 14
},
"minecraft:emitter_lifetime_once": {
"active_time": 1
@@ -21,13 +21,13 @@
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": "math.random(4,7)*3",
"minecraft:particle_initial_speed": "math.random(4,7)*4.5",
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, -5, 0],
"linear_drag_coefficient": 4
"linear_acceleration": [0, -6, 0],
"linear_drag_coefficient": 5
},
"minecraft:particle_appearance_billboard": {
"size": [0.15, 0.15],
"size": [0.125, 0.125],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 99,
@@ -40,6 +40,17 @@
"max_frame": 11
}
}
},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.particle_age / v.particle_lifetime",
"gradient": {
"0.0": "#FF8DFFC6",
"0.2": "#ffffffff",
"0.35": "#ffffffff",
"0.53": "#FFFF8845"
}
}
}
}
}
@@ -5,12 +5,12 @@
"identifier": "cobblemon:cherishball/battle/ballsparks",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsparks"
"texture": "textures/particles/balls/cherishball/cherishballsparks"
}
},
"components": {
"minecraft:emitter_rate_instant": {
"num_particles": 10
"num_particles": 8
},
"minecraft:emitter_lifetime_once": {
"active_time": 1
@@ -21,9 +21,9 @@
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": "math.random(4,7)*3.5",
"minecraft:particle_initial_speed": "math.random(3,6)*3.75",
"minecraft:particle_motion_dynamic": {
"linear_drag_coefficient": 4.5
"linear_drag_coefficient": 5
},
"minecraft:particle_appearance_billboard": {
"size": [0.15, 0.15],
@@ -39,6 +39,17 @@
"max_frame": 10
}
}
},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.particle_age / v.particle_lifetime",
"gradient": {
"0.0": "#FF8DFFC6",
"0.2": "#ffffffff",
"0.35": "#ffffffff",
"0.53": "#FFFF8845"
}
}
}
}
}
@@ -5,7 +5,7 @@
"identifier": "cobblemon:cherishball/battle/sendflash",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/battle/sendflash"
"texture": "textures/particles/balls/cherishball/battle/cherishsendflash"
}
},
"components": {
@@ -27,14 +27,25 @@
"size": [2.25, 2.25],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 1024,
"texture_width": 1088,
"texture_height": 64,
"flipbook": {
"base_UV": [0, 0],
"size_UV": [64, 64],
"step_UV": [64, 0],
"frames_per_second": 24,
"max_frame": 16
"max_frame": 17
}
}
},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.particle_age / v.particle_lifetime",
"gradient": {
"0.0": "#FF8DFFC6",
"0.2": "#ffffffff",
"0.35": "#ffffffff",
"0.53": "#FFFF8845"
}
}
}
@@ -5,12 +5,12 @@
"identifier": "cobblemon:cherishball/casual/ballsendsparkle",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsendsparkle"
"texture": "textures/particles/balls/cherishball/cherishballsendsparkle"
}
},
"components": {
"minecraft:emitter_rate_instant": {
"num_particles": 4
"num_particles": 6
},
"minecraft:emitter_lifetime_once": {
"active_time": 1
@@ -21,7 +21,7 @@
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": "math.random(4,6)*2.5",
"minecraft:particle_initial_speed": "math.random(3,6)*3",
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, -6, 0],
"linear_drag_coefficient": 4
@@ -40,6 +40,17 @@
"max_frame": 11
}
}
},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.particle_age / v.particle_lifetime",
"gradient": {
"0.0": "#FF8DFFC6",
"0.2": "#ffffffff",
"0.35": "#ffffffff",
"0.53": "#FFFF8845"
}
}
}
}
}
@@ -5,7 +5,7 @@
"identifier": "cobblemon:cherishball/casual/ballsparks",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsparks"
"texture": "textures/particles/balls/cherishball/cherishballsparks"
}
},
"components": {
@@ -21,9 +21,9 @@
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": "math.random(4,7)*2.1",
"minecraft:particle_initial_speed": "math.random(3,7)*2",
"minecraft:particle_motion_dynamic": {
"linear_drag_coefficient": 3.5
"linear_drag_coefficient": 3
},
"minecraft:particle_appearance_billboard": {
"size": [0.1, 0.1],
@@ -39,6 +39,17 @@
"max_frame": 10
}
}
},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.particle_age / v.particle_lifetime",
"gradient": {
"0.0": "#FF8DFFC6",
"0.2": "#ffffffff",
"0.35": "#ffffffff",
"0.53": "#FFFF8845"
}
}
}
}
}

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