Compare commits

...
760 Commits
Author SHA1 Message Date
Hiroku d6c543e965 Fixed Porygon evolution 2023-05-28 01:04:26 +00:00
Hiroku 505eb06406 Merge branch '1.3.2-dupe-fix' into '1.3.2-dupe-fix'
Fix a crash introduced by issue !482

See merge request cable-mc/cobblemon!483
2023-05-28 00:59:56 +00:00
Neovitalism 83963d038d Clean my unused imports 2023-05-23 20:01:37 -04:00
Neovitalism cedcf1aacf Only force recall when the player teleports
Sadly teleporting the mon caused too many issues and crashes
2023-05-23 16:41:54 -04:00
Neovitalism 5613726acd Merge branch '1.3.2-dupe-fix' of https://gitlab.com/Neovitalism/cobblemon into 1.3.2-dupe-fix 2023-05-23 06:23:43 -04:00
Neovitalism 4be346d96d Make pokemon being manually recalled not trigger onStoppedTrackingBy 2023-05-23 06:23:27 -04:00
Neovitalism 29e6861f88 Merge branch '1.3.2-dupe-fix' into '1.3.2-dupe-fix'
# Conflicts:
#   common/src/main/kotlin/com/cobblemon/mod/common/util/EntityExtensions.kt
2023-05-23 01:42:03 +00:00
Neovitalism 6deb272ec3 Change to teleport since teleport loads the chunk 2023-05-22 21:33:36 -04:00
Neovitalism 18caae05ca Load the chunk the PokemonEntity is being recalled from 2023-05-21 20:35:28 -04:00
Hiroku 1bb4692273 Merge branch '1.3.2-dupe-fix' into '1.3.2-dupe-fix'
Change ticking the GoalSelector to our own teleportToOwner attempt

See merge request cable-mc/cobblemon!482
2023-05-21 12:32:40 +00:00
NeovitalismandHiroku 6a4bd4dfa6 Change ticking the GoalSelector to our own teleportToOwner attempt 2023-05-21 12:32:40 +00:00
Neovitalism 28ff02cc3e Merge branch '1.3.2-dupe-fix' of https://gitlab.com/Neovitalism/cobblemon into 1.3.2-dupe-fix 2023-05-21 08:00:53 -04:00
Neovitalism b8378bf11c Move teleport methods to EntityExtensions.kt
This also moves the larger part of the methods to TameableEntity instead of PokemonEntity, allowing for more vanilla use, as well. (Not that it's a huge change lol)
2023-05-21 08:00:49 -04:00
Neovitalism 8d8cf6d071 Merge branch '1.3.2-dupe-fix' into '1.3.2-dupe-fix'
# Conflicts:
#   common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonEntity.kt
2023-05-20 20:30:37 +00:00
Neovitalism 6b2b9fb064 Change ticking the GoalSelector to our own teleportToOwner attempt
This just moves the methods we need instead of ticking the GoalSelector, this not only saves all goals from ticking but allows us to do custom logic when the teleport fails (recall)
2023-05-20 16:16:27 -04:00
Hiroku 2c151ddcec Merge branch '1.3.1' into '1.3.2-dupe-fix'
Fix owned PokemonEntity from not returning to the player when left in unloaded chunks

See merge request cable-mc/cobblemon!481
2023-05-20 12:03:43 +00:00
NeovitalismandHiroku 1b4584557d Fix owned PokemonEntity from not returning to the player when left in unloaded chunks 2023-05-20 12:03:42 +00:00
Neovitalism 6773084212 Fix owned PokemonEntity from not returning to the player when left in unloaded chunks
This just ticks the pokemon's goal once when the owning player stops loading the mon, so this works in unloaded chunks and does nothing different in loaded chunks
2023-05-19 14:00:50 -04:00
Paul fead7cc367 changelog for 1.3.1 [skip-ci] 2023-04-01 11:16:02 +10:00
Paul 622b06b68b 1.3.1 non-snapshot [skip-ci] 2023-04-01 11:04:28 +10:00
Hiroku af7645feb4 Merge branch 'ys/no-target-pokemon-fix' into 'main'
No target pokemon fix (for moves like Aromatherapy)

See merge request cable-mc/cobblemon!431
2023-04-01 00:38:43 +00:00
YaseenandHiroku ccf7218cfc No target pokemon fix (for moves like Aromatherapy) 2023-04-01 00:38:43 +00:00
Hiroku 9b767f5170 Merge branch 'aromatherapy_crash_&_link_cable_inconsistency' into 'main'
Aromatherapy crash & Link Cable fix

See merge request cable-mc/cobblemon!430
2023-03-31 23:07:30 +00:00
LiciousandHiroku fcb4861e94 Aromatherapy crash & Link Cable fix 2023-03-31 23:07:30 +00:00
Hiroku aa8b0d3fbb Merge branch 'server-client-resource-fix' into 'main'
server crash fix for resource reload fix

See merge request cable-mc/cobblemon!429
2023-03-31 23:07:19 +00:00
MoeBoy76 d4fa5255ec server crash fix for resource reload fix 2023-04-01 09:01:31 +11:00
Hiroku 4f3e874e70 Merge branch 'bucket-influence' into 'main'
Influences can now modify bucket weight

See merge request cable-mc/cobblemon!428
2023-03-31 13:16:16 +00:00
DeltricandHiroku 6df0f17798 Influences can now modify bucket weight 2023-03-31 13:16:16 +00:00
Paul a9e3115b46 Merge remote-tracking branch 'origin/main' 2023-03-31 22:48:12 +10:00
Paul bef8e064f1 1.3.1 in the Cobblemon object 2023-03-31 22:47:18 +10:00
Hiroku 79873c44e7 Merge branch 'GDWR/pokebox_command' into 'main'
Add `pokebox` and `pokeboxall` commands

Closes #169

See merge request cable-mc/cobblemon!401
2023-03-31 12:01:15 +00:00
Paul d4abf9f2b5 Merge remote-tracking branch 'home/main' into GDWR/pokebox_command
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonCommands.kt
#	common/src/main/resources/assets/cobblemon/lang/en_us.json
2023-03-31 22:00:00 +10:00
Hiroku fd8b6c50a5 Merge branch 'qol-switch-to-last-pokemon' into 'main'
Switch selected party Pokemon to the last Pokemon used after a battle

See merge request cable-mc/cobblemon!394
2023-03-31 11:35:10 +00:00
chandler05andHiroku 2b872d85cf Switch selected party Pokemon to the last Pokemon used after a battle 2023-03-31 11:35:10 +00:00
Hiroku d98908b91d Merge branch '206-instant-flee' into 'main'
Added check for fleeDistance == -1 in checkFlee()

Closes #206

See merge request cable-mc/cobblemon!418
2023-03-31 11:34:08 +00:00
selfdotandHiroku f592e6bc05 Added check for fleeDistance == -1 in checkFlee() 2023-03-31 11:34:07 +00:00
Hiroku dad86f3692 Merge branch 'GDWR/add_spawn_pokemon_from_pool' into 'main'
Add `SpawnPokemonFromPool` command

Closes #170

See merge request cable-mc/cobblemon!407
2023-03-31 11:22:54 +00:00
Hiroku 817b55407c Merge branch 'main' into 'GDWR/add_spawn_pokemon_from_pool'
# Conflicts:
#   CHANGELOG.md
2023-03-31 11:10:11 +00:00
Hiroku b2167a9902 Merge branch 'misc-fixes' into 'main'
Misc Fixes

See merge request cable-mc/cobblemon!425
2023-03-31 11:09:36 +00:00
TyzillionandHiroku d3f5ce42a8 Misc Fixes 2023-03-31 11:09:36 +00:00
Hiroku 0eababd67a Merge branch 'more-recipes-already' into 'main'
A few recipes

See merge request cable-mc/cobblemon!427
2023-03-31 09:22:30 +00:00
dhi_holoandHiroku 103f65800f A few recipes 2023-03-31 09:22:30 +00:00
Veraxiel 55925fc4a4 Update BestSpawnerConfig.kt 2023-03-31 08:19:47 +00:00
Paul 63d4176e86 Merge remote-tracking branch 'origin/main' 2023-03-31 13:56:08 +10:00
Hiroku 4709d0f766 Merge branch 'showdownInterpreter' into 'main'
add interpretation for yawn and fixed a bug in silent message interpretation

See merge request cable-mc/cobblemon!422
2023-03-31 03:55:05 +00:00
BobbyandHiroku e1ef1d9bb0 add interpretation for yawn and fixed a bug in silent message interpretation 2023-03-31 03:55:04 +00:00
Paul 5745b394b5 Updated all the translations 2023-03-31 13:53:51 +10:00
Paul 335f6f7104 Merge remote-tracking branch 'origin/main' 2023-03-31 11:33:41 +10:00
Hiroku 2de001f61c Merge branch 'mjkim__-main-patch-41166' into 'main'
Updated Korean Translations

See merge request cable-mc/cobblemon!424
2023-03-31 01:33:11 +00:00
KY4LUandHiroku 9739ed917a Updated Korean Translations 2023-03-31 01:33:11 +00:00
Paul e9e699c60b Merge remote-tracking branch 'origin/main' 2023-03-31 11:32:06 +10:00
Paul 4dd78d5755 Update Showdown with a merge from showdown/master and misc data order fix 2023-03-31 11:27:16 +10:00
Hiroku 1e67385f15 Merge branch 'GDWR/patch_friendship_based_attacks' into 'main'
Correctly format misc data in Showdown team packet

Closes #201

See merge request cable-mc/cobblemon!417
2023-03-31 01:16:35 +00:00
Hiroku f29a26869b Merge branch '191-investigate-crash-with-showdown-move-action-interpretation' into 'main'
Migrated HandleMoveInstruction to use BattleMessage

Closes #191

See merge request cable-mc/cobblemon!423
2023-03-31 01:08:01 +00:00
Hiroku aefdbfcce3 Merge branch 'ys/recall-shoulder-pokemon-on-heal-and-evolve' into 'main'
Recall shoulder pokemon on healer use

See merge request cable-mc/cobblemon!419
2023-03-31 00:13:33 +00:00
YaseenandHiroku 05bce3c058 Recall shoulder pokemon on healer use 2023-03-31 00:13:33 +00:00
Renaissance 8ba622a635 Migrated HandleMoveInstruction to use BattleMessage 2023-03-30 01:47:18 +00:00
GDWR 3b1e8f1624 Correctly format misc data in Showdown team packet 2023-03-29 20:04:52 +01:00
Village eae49b0f7e Merge branch 'main' of https://gitlab.com/cable-mc/pokemon-cobbled 2023-03-29 01:00:06 -04:00
Village 9af141e9cd fix lava particles 2023-03-29 00:59:04 -04:00
Hiroku 061a418c90 Merge branch 'showdownInterpreter' into 'main'
add interpretation for -activate -end and -damage instructions for the move wrap

See merge request cable-mc/cobblemon!414
2023-03-29 03:32:32 +00:00
Hiroku bb52d55c80 Merge branch 'feature/add_missing_extractors' into 'main'
feat: amend PokemonPropertyExtractors to match what PokemonProperties can parse from string

See merge request cable-mc/cobblemon!411
2023-03-28 23:56:34 +00:00
PolymetaandHiroku 416affb1c3 feat: amend PokemonPropertyExtractors to match what PokemonProperties can parse from string 2023-03-28 23:56:34 +00:00
RobertLudwick 7061d58333 add interpretation for -activate -end and -damage instructions for the move wrap 2023-03-28 18:41:12 -04:00
Nick b59aab557f Merge branch 'fix-benched-moves-sync' into 'main'
Fix benched moves not syncing correctly on the Pokemon DTO

See merge request cable-mc/cobblemon!413
2023-03-28 20:35:04 +00:00
LiciousandNick 1f98355bec Fix benched moves not syncing correctly on the Pokemon DTO 2023-03-28 20:35:03 +00:00
Licious17 ad6b63055c Add en_us description for all gen 9 moves and abilities. 2023-03-28 19:50:44 +01:00
GDWR 96611b04dc Add SpawnPokemonFromPool command 2023-03-28 19:26:30 +01:00
GDWR 49d1015104 Operate on the party pokemon backwards so the "lead" is kept 2023-03-28 19:25:14 +01:00
GDWR 0eeb992724 If pokebox command would move a Player's last poke while preventCompletePartyDeposit is set, stop and error 2023-03-28 19:25:14 +01:00
GDWR 9e9921098a Add Lang entries for error messages 2023-03-28 19:25:14 +01:00
GDWR 0b23e68786 Add pokebox and pokeboxall commands 2023-03-28 19:25:12 +01:00
Licious 0ce309c37c Merge branch 'thorium-mod-compatibility' into 'main'
Fix incompatibility with the Thorium mod.

See merge request cable-mc/cobblemon!408
2023-03-28 14:23:39 +00:00
Licious 75527fdf40 Fix incompatibility with the Thorium mod. 2023-03-28 14:23:39 +00:00
Licious 2389bdf25d Merge branch 'any_evolution-requirement' into 'main'
Add utility evolution requirement for any match of children requirements

See merge request cable-mc/cobblemon!405
2023-03-28 09:56:34 +00:00
Licious 24c9073c4c Add utility evolution requirement for any match of children requirements 2023-03-28 09:56:34 +00:00
Hiroku b33e2118b4 Merge branch 'showdown-unbundle-tweak' into 'main'
Don't run mkdirs on the zip target, but rather its parent. Fixes an IO exception

See merge request cable-mc/cobblemon!410
2023-03-28 09:01:26 +00:00
Nick 993ca68a5a Don't run mkdirs on the zip target, but rather its parent. Fixes an IO exception 2023-03-27 22:24:05 -07:00
Nick f0d47055c4 Merge branch 'transitive-access-wideners' into 'main'
Use transitive access wideners in favor of side-mod/plugin development

See merge request cable-mc/cobblemon!409
2023-03-28 04:57:49 +00:00
Nick bf331a7471 Use transitive access wideners in favor of side-mod/plugin development 2023-03-28 04:57:48 +00:00
Hiroku f74ba3dc77 Merge branch 'more-poke' into 'main'
Implement Nosepass & Slugma line

Closes #168

See merge request cable-mc/cobblemon!406
2023-03-27 23:49:40 +00:00
LiciousandHiroku 063b627043 Implement Nosepass & Slugma line 2023-03-27 23:49:39 +00:00
Licious17 85335d14ed The great shoulder nerf. 2023-03-27 23:08:16 +01:00
Licious 358b544583 Merge branch 'misc_texture_fixes' into 'main'
Misc Fixes

See merge request cable-mc/cobblemon!403
2023-03-27 19:06:49 +00:00
TyzillionandLicious ac945b4597 Misc Fixes 2023-03-27 19:06:48 +00:00
Paul 8733085232 Fixed all pokemon being lava resistant 2023-03-27 14:33:33 +10:00
Hiroku cbc484a611 Merge branch 'return-before-heal' into 'main'
Return Pokemon to their pokeballs when healing them in a healing machine

See merge request cable-mc/cobblemon!395
2023-03-27 03:35:27 +00:00
chandler05andHiroku e5412a9c3b Return Pokemon to their pokeballs when healing them in a healing machine 2023-03-27 03:35:27 +00:00
Hiroku 3ac325a22e Merge branch '192-disconnecting-from-dedicated-server-causes-pokeballs-to-not-finish-capture-attempt' into 'main'
Fix Pokeballs being able to go through portals & sometimes getting stuck on...

Closes #40 and #192

See merge request cable-mc/cobblemon!400
2023-03-27 03:34:51 +00:00
LiciousandHiroku 6775e30f87 Fix Pokeballs being able to go through portals & sometimes getting stuck on... 2023-03-27 03:34:51 +00:00
Paul 5d30990eb6 Clean duplicate pokemon from data on load 2023-03-27 13:30:38 +10:00
Paul c8917ff02e Fixed best-spawner-config.json being .json.json 2023-03-27 12:00:22 +10:00
Hiroku de151442cd Merge branch 'GDWR/sound_arrow_keys_in_pc' into 'main'
Make GUI click sound when using arrow keys to navigate PC

Closes #198

See merge request cable-mc/cobblemon!402
2023-03-27 00:22:35 +00:00
Paul b09e553557 Added ru_ru.json, applied selfdot's fix for pokemon navigation (they had merge conflicts) 2023-03-27 10:19:07 +10:00
GDWR 11e150e6aa Make GUI click sound when using arrow keys to navigate PC 2023-03-26 19:14:07 +01:00
Licious17 85afe85150 Minor tweak on TeachCommand 2023-03-26 18:29:38 +01:00
Licious 4f73361565 Merge branch 'GDWR/teach_command_bug' into 'main'
Make /teach correctly use player argument

Closes #181

See merge request cable-mc/cobblemon!388
2023-03-26 17:01:46 +00:00
GDWRandLicious 34d2de0319 Make /teach correctly use player argument 2023-03-26 17:01:46 +00:00
Test e8be1c9ccf Merge branch '196-apricorn-leaves-cannot-be-composted' into 'main'
Resolve "Apricorn Leaves cannot be Composted"

Closes #196

See merge request cable-mc/cobblemon!399
2023-03-26 14:50:12 +00:00
LiciousandTest 9c36b9449c Resolve "Apricorn Leaves cannot be Composted" 2023-03-26 14:50:12 +00:00
Licious17 1a7695f844 Fix data for Pokémon who have a gender requirement behind their evolution. 2023-03-26 13:53:16 +01:00
Hiroku 134ebe1c2f Merge branch 'exp_yield_fix' into 'main'
Fix for exp yield 0 Pokémon

Closes #184

See merge request cable-mc/cobblemon!393
2023-03-26 05:04:25 +00:00
MoeBoy76andHiroku 923ef08db4 Fix for exp yield 0 Pokémon 2023-03-26 05:04:25 +00:00
Licious17 c962aceed2 Backport fix to clientside Pokémon locating. 2023-03-25 22:44:51 +00:00
Licious ebeebeeee7 Merge branch 'GDWR/capture_poke_sprite_bug' into 'main'
Update state on client side when capture fails

Closes #188

See merge request cable-mc/cobblemon!391
2023-03-25 22:03:37 +00:00
GDWRandLicious 6d6867fb09 Update state on client side when capture fails 2023-03-25 22:03:37 +00:00
Licious e98084343d Merge branch 'pc-command-fix' into 'main'
Need to throw exception to stop flow

See merge request cable-mc/cobblemon!390
2023-03-25 11:34:37 +00:00
DeltricandLicious 19dad2daa7 Need to throw exception to stop flow 2023-03-25 11:34:36 +00:00
Hiroku f513475267 Merge branch 'spawns-and-drops' into 'main'
Added and fixed spawns and drops.

See merge request cable-mc/cobblemon!389
2023-03-25 11:24:40 +00:00
VeraxielandHiroku 80fbf4a300 Added and fixed spawns and drops. 2023-03-25 11:24:40 +00:00
Paul 6904e302ff Added fr_ca translation, updated ja_jp and removed dead line 2023-03-25 20:09:46 +10:00
Paul faf3858a5e Added th_th translation 2023-03-25 19:52:08 +10:00
Paul 501dd51e29 Merge remote-tracking branch 'origin/main' 2023-03-25 19:50:43 +10:00
Licious 7b23ce055c Merge branch '177-investigate-reload-preventing-moves-from-being-learnt' into 'main'
Resolve "Investigate /reload preventing moves from being learnt"

Closes #177

See merge request cable-mc/cobblemon!385
2023-03-25 09:13:06 +00:00
Licious ec8b9be4f6 Resolve "Investigate /reload preventing moves from being learnt" 2023-03-25 09:13:06 +00:00
Paul e62e08aafb Added ja_jp translation 2023-03-25 17:50:34 +10:00
Paul db6a60d3cb Fixed Pokémon not looking at each other in battle 2023-03-25 14:21:35 +10:00
Paul 94ca3808ed Maybe fixed particle effect issues where they overlap or occur after death 2023-03-25 14:21:00 +10:00
Hiroku 9eec283036 Merge branch 'feature/release_events' into 'main'
feat(api): implement ReleasePokemon pre and post event

See merge request cable-mc/cobblemon!380
2023-03-24 23:05:38 +00:00
PolymetaandHiroku 3a0c801ffd feat(api): implement ReleasePokemon pre and post event 2023-03-24 23:05:38 +00:00
Test ab795a4c6c Merge branch '178-disable-psysical-collision-on-1st-stage-apricorn-buds' into 'main'
Resolve "Disable psysical collision on 1st stage apricorn buds"

Closes #178

See merge request cable-mc/cobblemon!384
2023-03-24 18:49:54 +00:00
LiciousandTest 0db41c1f9b Resolve "Disable psysical collision on 1st stage apricorn buds" 2023-03-24 18:49:54 +00:00
Hiroku 2d315920f8 Merge branch 'icon-fix' into 'main'
Fixed Advancement Branch Icon

See merge request cable-mc/cobblemon!374
2023-03-24 06:56:39 +00:00
dhi_holoandHiroku 7449bc2377 Fixed Advancement Branch Icon 2023-03-24 06:56:39 +00:00
Paul 15065e621f Protect pokeballs from causing duplicate Pokemon 2023-03-24 16:22:19 +10:00
Hiroku 59fdd41c46 Merge branch 'Added-ShowdownInterpreter-Instructions' into 'main'
Added ShowdownInterpreter Instructions

Closes #179 and #165

See merge request cable-mc/cobblemon!383
2023-03-24 06:08:01 +00:00
RenaissanceandHiroku fa04e168ac Added ShowdownInterpreter Instructions 2023-03-24 06:08:00 +00:00
Test 94b28c025a Merge branch '176-prevent-pokemon-entity-travel-between-dimensions' into 'main'
Resolve "Prevent Pokémon entity travel between dimensions"

Closes #176

See merge request cable-mc/cobblemon!382
2023-03-23 22:13:10 +00:00
LiciousandTest 6ed4938028 Resolve "Prevent Pokémon entity travel between dimensions" 2023-03-23 22:13:10 +00:00
Licious 99d03b16b2 Merge branch 'teach-command-expansion' into 'main'
Expand teach command functionality

See merge request cable-mc/cobblemon!381
2023-03-22 20:31:57 +00:00
Licious f70f7fe354 Expand teach command functionality 2023-03-22 20:31:56 +00:00
Hiroku 878c31fac7 Merge branch 'held-item-full-inv-fix' into 'main'
Held item give/remove fixes

See merge request cable-mc/cobblemon!379
2023-03-22 11:03:57 +00:00
LiciousandHiroku 9945143dd9 Held item give/remove fixes 2023-03-22 11:03:56 +00:00
Licious17 770d248b3a Merge remote-tracking branch 'origin/main' 2023-03-21 23:07:03 +00:00
Licious17 345dd60e11 Fix lack of healing message with the black sludge 2023-03-21 23:06:53 +00:00
Licious 7b48ddf418 Merge branch 'Fixing-various-shinies' into 'main'
Fixed various shinies and a couple misc. bugs

See merge request cable-mc/cobblemon!377
2023-03-21 22:12:50 +00:00
JMMCPandLicious e8ea697caa Fixed various shinies and a couple misc. bugs 2023-03-21 22:12:50 +00:00
Licious 33021e2cb8 Merge branch 'json-bug-fixes' into 'main'
Fixes wrongly-formatted JSON files

See merge request cable-mc/cobblemon!378
2023-03-21 20:48:28 +00:00
MelonSpeedrunsandLicious d577687a87 Fixes wrongly-formatted JSON files 2023-03-21 20:48:28 +00:00
Hiroku e603238339 Merge branch 'misc-fixes' into 'main'
Misc fixes & additions

See merge request cable-mc/cobblemon!376
2023-03-20 21:32:57 +00:00
LiciousandHiroku a62f1fe560 Misc fixes & additions 2023-03-20 21:32:57 +00:00
Paul 96dd007db9 Merge remote-tracking branch 'origin/main' 2023-03-19 21:18:49 +10:00
Paul c339e36f9a Fixed custom Pokémon not being usable in battle by properly fixing ground type moves hitting flying types etc 2023-03-19 21:17:56 +10:00
Hiroku 2798487106 Merge branch 'modify-global-influences' into 'main'
Updated Global Influences

See merge request cable-mc/cobblemon!375
2023-03-19 11:05:41 +00:00
DeltricandHiroku 252139d07f Updated Global Influences 2023-03-19 11:05:40 +00:00
Paul e55c54fb24 Fixed log spam when rendering pokemon model items 2023-03-18 17:25:42 +10:00
Paul 74c4e2ae04 Fixed a crash when killing Dodrio 2023-03-18 14:10:59 +10:00
Paul 49671f7867 1.3.0 finalising 2023-03-18 12:35:04 +10:00
Hiroku 70b1431c44 Merge branch 'advancement-quick-fix' into 'main'
Update craft_poke_ball.json

See merge request cable-mc/cobblemon!373
2023-03-18 00:50:39 +00:00
dhi_holoandHiroku 90a0135f94 Update craft_poke_ball.json 2023-03-18 00:50:39 +00:00
Paul 1a3790a071 Fixed held item crash with Fling 2023-03-18 10:48:34 +10:00
Paul f62a875c52 Merge remote-tracking branch 'origin/main' 2023-03-18 10:23:48 +10:00
Paul c11d8f7d84 Fixed Showdown mechanics being botched again, the true problem is Showdown battle instances not having gen: 9 2023-03-18 10:22:56 +10:00
Hiroku f49c4c0b6c Merge branch 'dependency-updates' into 'main'
Update architectury + fabric API dependency requirements

See merge request cable-mc/cobblemon!372
2023-03-17 23:25:32 +00:00
NickandHiroku e633c5f1b0 Update architectury + fabric API dependency requirements 2023-03-17 23:25:32 +00:00
Paul 30d2c4ddfc Merge remote-tracking branch 'origin/main'
# Conflicts:
#	common/src/main/resources/data/cobblemon/species/generation3/carvanha.json
2023-03-18 08:44:49 +10:00
Paul 14e721c81f Fixed Carvanha + Sharpedo swimming AI and made surface slightly rarer to counteract Gyarados spawns 2023-03-18 08:44:04 +10:00
Hiroku 4675a47bc6 Merge branch 'hide-tooltip-tag' into 'main'
Add Hide Tooltip tag for pokeballs

See merge request cable-mc/cobblemon!370
2023-03-17 22:23:22 +00:00
Hiroku de55ec98a0 Merge branch 'drops' into 'main'
Drops

See merge request cable-mc/cobblemon!369
2023-03-17 22:21:51 +00:00
XylopiaandHiroku 2e6d7509a6 Drops 2023-03-17 22:21:51 +00:00
Hiroku e30ca8bc23 Merge branch 'lang-fix' into 'main'
Lang fixes

See merge request cable-mc/cobblemon!366
2023-03-17 22:20:11 +00:00
LiciousandHiroku 9b485ee8ad Lang fixes 2023-03-17 22:20:11 +00:00
Licious 631d6ab776 Merge branch 'model-fixes-for-1.3' into 'main'
Model fixes for 1.3

See merge request cable-mc/cobblemon!368
2023-03-17 22:06:58 +00:00
XylopiaandLicious ccacd18a23 Model fixes for 1.3 2023-03-17 22:06:58 +00:00
Licious17 bca0812d0c Fix Nature sync packet interpreting identifiers incorrectly. 2023-03-17 22:04:53 +00:00
Deltric 5518b5c66c Add Hide Tooltip tag for pokeballs 2023-03-17 16:57:59 -05:00
Licious17 fef2db118e Fix Miltank milking implementation. 2023-03-17 16:43:42 +00:00
Paul cbcc9c65d9 More changelog [skip-ci] 2023-03-17 20:20:43 +10:00
Paul 3d3ce6fa0f Merge remote-tracking branch 'origin/main' 2023-03-17 20:08:22 +10:00
Paul b5d05c4c55 Loads of changelog updates, fix for beam rendering of PokeBalls, @JvmStatic on PokemonItem functions 2023-03-17 20:07:28 +10:00
Hiroku ec6dcdb21a Merge branch 'quick-fixes' into 'main'
Fixed Advancement and Added Item to Tag

See merge request cable-mc/cobblemon!365
2023-03-17 08:45:16 +00:00
dhi_holoandHiroku b5f2e260ea Fixed Advancement and Added Item to Tag 2023-03-17 08:45:15 +00:00
Hiroku 60c0c97722 Merge branch 'spawn_fixes' into 'main'
Added Spawn files for all newly implemented Pokemon.

See merge request cable-mc/cobblemon!364
2023-03-17 04:06:19 +00:00
TyzillionandHiroku ddb78d1467 Added Spawn files for all newly implemented Pokemon. 2023-03-17 04:06:19 +00:00
Hiroku 0878abc9f4 Merge branch 'Starter_Implementation' into 'main'
Implemented Gen 5,6,7, and 8 starters.

See merge request cable-mc/cobblemon!363
2023-03-17 03:54:54 +00:00
TyzillionandHiroku c466d5e0cb Implemented Gen 5,6,7, and 8 starters. 2023-03-17 03:54:54 +00:00
Hiroku 0778014d80 Merge branch 'leftover-fix' into 'main'
Leftovers now drop on the floor if the players inventory is full.

See merge request cable-mc/cobblemon!357
2023-03-17 03:46:38 +00:00
amoandHiroku 3f9cb4037a Leftovers now drop on the floor if the players inventory is full. 2023-03-17 03:46:37 +00:00
Paul 8794dcf0cd Changelog for langs [skip-ci] 2023-03-17 12:33:08 +10:00
Paul 161d3acf0c Merge remote-tracking branch 'origin/main' 2023-03-17 12:27:05 +10:00
Paul f914d1e38e Updated heaps of langs 2023-03-17 12:26:13 +10:00
Hiroku 47282fcf82 Merge branch 'healer-patch' into 'main'
clamp healing machine config values

See merge request cable-mc/cobblemon!362
2023-03-17 02:15:47 +00:00
TestandHiroku 54a719da91 clamp healing machine config values 2023-03-17 02:15:47 +00:00
Paul 890c6c94d9 Minor English correction to held item lang 2023-03-17 11:59:26 +10:00
Paul d23363e427 Fixed moving a Pokémon to an empty later space in the party causing a crash 2023-03-17 11:38:10 +10:00
Hiroku f17fb5da25 Merge branch 'implemented_new_pokemon' into 'main'
Multiple fixes and changes to various Pokemon and implemented 2.

See merge request cable-mc/cobblemon!360
2023-03-17 00:53:42 +00:00
TyzillionandHiroku 8d091d905f Multiple fixes and changes to various Pokemon and implemented 2. 2023-03-17 00:53:42 +00:00
Hiroku 6bc413f4d6 Merge branch 'drag-scroll' into 'main'
Fix not being able to drag scrollbar

See merge request cable-mc/cobblemon!361
2023-03-16 11:52:51 +00:00
TestandHiroku 59768de4d6 Fix not being able to drag scrollbar 2023-03-16 11:52:51 +00:00
Hiroku b1b435c464 Merge branch 'scaled-difficulty-calc' into 'main'
Scale difficulty on configurable max pokemon level + limit difficulty to a max of 1 bonus

See merge request cable-mc/cobblemon!358
2023-03-15 21:30:15 +00:00
Nick 5fe7bb0097 Scale difficulty on configurable max pokemon level + limit difficulty to a max of 1 bonus 2023-03-14 19:50:02 -07:00
Hiroku 2f1f33f802 Fix dragon fang recipe 2023-03-13 11:58:40 +00:00
Hiroku 51f6cf1ed3 Merge branch 'recipe-sprint' into 'main'
Held Item Recipes

See merge request cable-mc/cobblemon!352
2023-03-12 06:15:09 +00:00
dhi_holoandHiroku e487dd2cde Held Item Recipes 2023-03-12 06:15:09 +00:00
Paul bfef29b11a Added Razor Fang 2023-03-12 12:36:19 +10:00
Paul e22bcd9fb3 Fixed model items not rendering layers 2023-03-12 12:19:34 +10:00
Paul 167b70d237 Added tooltip to healing machine 2023-03-12 11:14:23 +10:00
Hiroku e60fd588f8 Merge branch 'socket-showdown-fix' into 'main'
Fix socket showdown for changes in MR 353

See merge request cable-mc/cobblemon!355
2023-03-11 23:23:30 +00:00
LandonandHiroku 90f446455f Fix socket showdown for changes in MR 353 2023-03-11 23:23:30 +00:00
Hiroku 1368f1ed76 Merge branch 'more-player-extensions' into 'main'
Added player extensions for PC and extra data

See merge request cable-mc/cobblemon!354
2023-03-11 22:53:44 +00:00
DeltricandHiroku ef10c62114 Added player extensions for PC and extra data 2023-03-11 22:53:44 +00:00
Hiroku fb01cd0302 Merge branch 'showdown-species-fixes' into 'main'
Showdown species fixes

See merge request cable-mc/cobblemon!353
2023-03-11 13:11:01 +00:00
LiciousandHiroku 2fae30206c Showdown species fixes 2023-03-11 13:11:01 +00:00
Paul ea3a1f16f3 Fixed apple eating mixin on Forge 2023-03-11 18:51:46 +10:00
Paul 20b6f44e63 Updated Showdown version 2023-03-11 17:53:04 +10:00
Paul d61656afe9 Licenses 2023-03-11 14:13:12 +10:00
Paul cc69f04afa Merge remote-tracking branch 'origin/main' 2023-03-11 14:10:19 +10:00
Paul 397e9a2b5f Added leftovers from eating apples 2023-03-11 14:09:25 +10:00
Hiroku dbd7714a26 Merge branch 'Added-Razor-Claw' into 'main'
Added Razor Claw item.

See merge request cable-mc/cobblemon!351
2023-03-11 03:49:48 +00:00
JMMCPandHiroku 33cfe3b981 Added Razor Claw item. 2023-03-11 03:49:48 +00:00
Hiroku 391283a604 Merge branch 'Fixed-incorrect-luxury-ball-recipe' into 'main'
Fixed incorrect Luxury Ball crafting recipe.

See merge request cable-mc/cobblemon!350
2023-03-11 02:26:42 +00:00
JMMCPandHiroku a56f313957 Fixed incorrect Luxury Ball crafting recipe. 2023-03-11 02:26:42 +00:00
Paul 93261ada2b Fixed move names not being translated in battle messages 2023-03-11 12:20:16 +10:00
Hiroku 6f3797a8db Merge branch 'showdown-interpreter-held-item-additions' into 'main'
Added ShowdownInterpreter support for activation of Leftovers and Quick Claw held items.

See merge request cable-mc/cobblemon!349
2023-03-11 02:03:39 +00:00
JMMCPandHiroku 73751c083d Added ShowdownInterpreter support for activation of Leftovers and Quick Claw held items. 2023-03-11 02:03:38 +00:00
Hiroku f9aa09c654 Merge branch 'walking-leaves' into 'main'
Add Walking Wake and Iron Leaves

See merge request cable-mc/cobblemon!334
2023-03-11 01:23:54 +00:00
LiciousandHiroku 1e92ac4603 Add Walking Wake and Iron Leaves 2023-03-11 01:23:54 +00:00
Paul fb1c1170b3 Corrected mistaken spaces in some lang entries 2023-03-10 23:00:30 +10:00
Licious 5ec7c0f16e Merge branch 'kotlin4forge-compat' into 'main'
Kotlin4forge compat

See merge request cable-mc/cobblemon!340
2023-03-10 12:15:32 +00:00
HirokuandLicious 1e33b4fc1d Kotlin4forge compat 2023-03-10 12:15:32 +00:00
Paul 9d4251ac98 Merge remote-tracking branch 'origin/main' into added-held-items 2023-03-10 21:33:33 +10:00
Paul 07b182f044 Fixed capture calculator bugs 2023-03-10 21:30:39 +10:00
Licious 1619cc117f Merge branch 'added-held-items' into 'main'
Added/Updated many held items.

See merge request cable-mc/cobblemon!348
2023-03-10 11:29:40 +00:00
JMMCPandLicious 574f0cfe1c Added/Updated many held items. 2023-03-10 11:29:40 +00:00
Paul d3e51c9211 Added remapping from charcoal stick to charcoal for Showdown 2023-03-10 20:21:15 +10:00
Paul 6dbaba2895 Removed auspicious armour from is_held_item tag since item was removed 2023-03-10 19:40:34 +10:00
jmmcp 036f1af99f Added held items Leftovers, Light Clay, Magnet, Miracle Seed, Mystic Water, Never-Melt Ice, Poison Barb, Quick Claw, Sharp Beak, Silver Powder, Soft Sand, Spell Tag, and Twisted Spoon.
Updated item sprites for Muscle Band, Safety Goggles, and Wise Glasses.
Changed Charcoal to Charcoal Stick.
2023-03-10 00:59:02 -05:00
Hiroku c3592183fb Merge branch '#145-pokemon-damage-changes' into 'main'
Pokemon invulnerability adjustments

See merge request cable-mc/cobblemon!346
2023-03-10 02:16:19 +00:00
DeltricandHiroku bf322930e7 Pokemon invulnerability adjustments 2023-03-10 02:16:19 +00:00
Paul 9a9885adef Merge remote-tracking branch 'origin/main'
# Conflicts:
#	CHANGELOG.md
2023-03-10 11:46:05 +10:00
Paul 0e22e56ca8 Added block tag support for neededBaseBlocks 2023-03-10 11:45:24 +10:00
Hiroku 0d9b639247 Merge branch 'apricorn-event' into 'main'
Apricorn harvest event

See merge request cable-mc/cobblemon!345
2023-03-10 01:44:45 +00:00
DeltricandHiroku c59733b8ae Apricorn harvest event 2023-03-10 01:44:45 +00:00
Hiroku c3f28b01f9 Merge branch 'summary-screen-cleanup' into 'main'
Summary screen safety and clean up

See merge request cable-mc/cobblemon!344
2023-03-10 01:25:37 +00:00
LiciousandHiroku 7707530b2f Summary screen safety and clean up 2023-03-10 01:25:37 +00:00
Hiroku e7774a2737 Merge branch '#109-config-pokemon-damage' into 'main'
Config option to disable pokemon player damage

See merge request cable-mc/cobblemon!347
2023-03-10 01:24:53 +00:00
DeltricandHiroku fc3c01aac6 Config option to disable pokemon player damage 2023-03-10 01:24:53 +00:00
Licious 0b5fffae3d Merge branch 'even-more-items' into 'main'
Add/change various evolution items

See merge request cable-mc/cobblemon!343
2023-03-07 21:15:17 +00:00
Licious 2f0f9e9f9a Add/change various evolution items 2023-03-07 21:15:17 +00:00
Hiroku c3201effc7 Merge branch 'nametag-disabling' into 'main'
Handle name tags in the context of the mod

See merge request cable-mc/cobblemon!341
2023-03-07 11:44:56 +00:00
LiciousandHiroku c11074b828 Handle name tags in the context of the mod 2023-03-07 11:44:55 +00:00
Hiroku cb62ebb524 Update CHANGELOG.md [skip-ci] 2023-03-07 09:07:37 +00:00
Hiroku 1eda4884b3 Merge branch 'milk' into 'main'
milk

See merge request cable-mc/cobblemon!342
2023-03-07 09:03:44 +00:00
Village 52ead1d48a milk 2023-03-06 20:22:57 -05:00
Paul 8eabd03a2b Fixed more instances of capture calculator not doing the division correctly 2023-03-06 17:31:10 +10:00
Paul 4ec1e27b09 Changelog [skip-ci] 2023-03-06 17:29:43 +10:00
Paul 5a6671e988 Merge branch 'main' into milky-capture-calculator
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen6/HonedgeModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/repository/PokemonModelRepository.kt
2023-03-06 17:25:54 +10:00
Paul ae6def9d5f A bunch of fixes to capture calculation, use gen9 but with difficulty scaler and halving of catch when outside of battle 2023-03-06 17:25:18 +10:00
Paul cadb313ff8 Wooloo and Dubwool eat animations, fixed some pokemon sleeping on beds when they shouldn't, shadow size tweak 2023-03-06 12:50:17 +10:00
Paul 2826bea987 Swapped recall and send out beam colours again 2023-03-05 12:15:36 +10:00
Licious a698725324 Merge branch 'misc-fixes' into 'main'
Misc fixes

See merge request cable-mc/cobblemon!335
2023-03-04 09:07:57 +00:00
HirokuandLicious e6b3b6fae1 Misc fixes 2023-03-04 09:07:57 +00:00
Paul 06c5eae339 Merge remote-tracking branch 'origin/main' 2023-03-04 17:05:28 +10:00
Hiroku d70f0d2b8a Merge branch 'implemented_new_pokemon' into 'main'
Framings fixed, emissives added, and model tweaks.

See merge request cable-mc/cobblemon!339
2023-03-04 07:04:29 +00:00
TyzillionandHiroku b2e56130cf Framings fixed, emissives added, and model tweaks. 2023-03-04 07:04:28 +00:00
Paul 6ce1288506 Improve safe-positioning of spawning Pokémon 2023-03-04 16:41:31 +10:00
Hiroku b32a949c56 Merge branch 'implementing-missing-shinies' into 'main'
Added/Updated shinies and models for many Pokemon.

See merge request cable-mc/cobblemon!337
2023-03-04 04:45:58 +00:00
JMMCPandHiroku 3f994e761a Added/Updated shinies and models for many Pokemon. 2023-03-04 04:45:57 +00:00
Paul 7891c3e9d8 Fixed water counting as air for spawning 2023-03-04 12:28:42 +10:00
Hiroku e2d6933f8a Merge branch 'more-held-items' into 'main'
Update existing assets and add new held items

See merge request cable-mc/cobblemon!336
2023-03-04 00:59:27 +00:00
LiciousandHiroku d78fda0b9d Update existing assets and add new held items 2023-03-04 00:59:27 +00:00
Hiroku 64d910e10b Merge branch 'pokemon-property-additions' into 'main'
Added the Ability property in PokemonProperties as well as suggestions for values of abilities.

See merge request cable-mc/cobblemon!331
2023-03-03 10:05:38 +00:00
RenaissanceandHiroku f1e83aa039 Added the Ability property in PokemonProperties as well as suggestions for values of abilities. 2023-03-03 10:05:38 +00:00
Hiroku f2fc1b234d Merge branch 'showdown-tech-debt' into 'main'
Improve Showdown Debuggability

See merge request cable-mc/cobblemon!329
2023-03-03 07:17:06 +00:00
LandonandHiroku 9bc4648807 Improve Showdown Debuggability 2023-03-03 07:17:05 +00:00
Paul 0a07058511 Compile error fix 2023-03-03 12:25:38 +10:00
Paul 09cbe63a94 Moved CobblemonItemTags to use public static fields in bytecode 2023-03-03 12:23:05 +10:00
Hiroku 52c4f65927 Merge branch 'main-patch-48f2' into 'main'
Added evolution stones & items tags

See merge request cable-mc/cobblemon!332
2023-03-03 02:21:41 +00:00
GioandHiroku f67a1e1784 Added evolution stones & items tags 2023-03-03 02:21:41 +00:00
Hiroku 55cddf8ded Merge branch 'further-ability-changes' into 'main'
More ability data struc changes

See merge request cable-mc/cobblemon!330
2023-03-03 02:15:31 +00:00
LiciousandHiroku 6879b7ce1a More ability data struc changes 2023-03-03 02:15:31 +00:00
Paul fb40bc0d3c Merge remote-tracking branch 'origin/main' 2023-03-03 12:12:58 +10:00
Paul a8429018ea Made CobblemonEvents etc compile to public static fields instead of getter crap 2023-03-03 12:12:39 +10:00
Paul c445b26639 Fix Deerling/Sawsbuck not appearing with the right season during world spawning 2023-03-03 12:11:28 +10:00
Licious17 715d7643b7 Merge remote-tracking branch 'origin/main' 2023-03-02 21:41:48 +00:00
Licious17 a937b842e9 Remove LA moves learnset blocker, these are now implemented in Showdown. 2023-03-02 21:41:33 +00:00
Emmett de Bruin 0f978ade5a Attempted linearly increasing capture calculator 2023-03-02 13:33:35 -08:00
Paul 9bd5866ef7 Potential fix for old PC blocks causing crashes 2023-03-02 22:15:19 +10:00
Paul 1ec94b0ebe Probable fix for pokeball animation issues with high ping 2023-03-02 22:15:06 +10:00
Paul 8974769f87 Don't spawn particles for entities that are invisible 2023-03-02 22:14:54 +10:00
Paul c20d147838 Fixed absurdly large Turtwig shadow 2023-03-02 21:00:20 +10:00
Paul e28d590dc3 Fixed bidoof spawn file loading a non-contexted preset with conditions before the contexted preset 2023-03-02 20:04:55 +10:00
Veraxiel fe3dbdcdd8 Update 0399_bidoof.json 2023-02-28 18:50:37 +00:00
Veraxiel 77828008fa Fixed spawn files. 2023-02-28 10:36:23 -05:00
Hiroku fd13d9400c Merge branch 'ability-evolution-fix' into 'main'
Ability structure fix

See merge request cable-mc/cobblemon!326
2023-02-28 11:12:01 +00:00
LiciousandHiroku 9603713fcb Ability structure fix 2023-02-28 11:12:01 +00:00
Hiroku cc6ba92d42 Merge branch 'ball_models' into 'main'
Updated Poké Ball mechanics and visuals

See merge request cable-mc/cobblemon!325
2023-02-28 09:36:55 +00:00
Hiroku 8316537e90 Updated Poké Ball mechanics and visuals 2023-02-28 09:36:55 +00:00
Paul 6b396c4fc8 Fixed the shift click thing but for real 2023-02-27 18:56:03 +10:00
Hiroku e5fe46eb4d Merge branch 'implemented_new_pokemon' into 'main'
Implemented many Pokemon.

See merge request cable-mc/cobblemon!324
2023-02-27 08:54:24 +00:00
TyzillionandHiroku f2cbf78144 Implemented many Pokemon. 2023-02-27 08:54:24 +00:00
Hiroku 8aafbd54f5 Merge branch 'new-ball-recipes' into 'main'
updated three balls and added a cable

See merge request cable-mc/cobblemon!322
2023-02-24 05:17:11 +00:00
dhi_holoandHiroku 169145656a updated three balls and added a cable 2023-02-24 05:17:11 +00:00
Hiroku 97bb85e9f5 Merge branch 'zerobreaker000-main-patch-48926' into 'main'
Adopted a portion of Yyiyun's translations for zh_cn.json

See merge request cable-mc/cobblemon!323
2023-02-24 02:27:21 +00:00
Paul 7f35f46705 Fixed potential issue when making a Showdown backup folder 2023-02-23 23:57:20 +10:00
Hiroku 2164a59a84 Merge branch 'advancements-reboot' into 'main'
Advancement Reboot

See merge request cable-mc/cobblemon!320
2023-02-22 04:22:09 +00:00
dhi_holoandHiroku 6a65035823 Advancement Reboot 2023-02-22 04:22:09 +00:00
Paul f0fb20f701 Made bones optional in animations so one can add temporary animation files 2023-02-21 10:46:04 +10:00
Paul 7ed179edd2 Added license adding script to utilityscripts because woops I didn't add this [skip-ci] 2023-02-20 22:40:16 +10:00
Paul 2d242af211 Fixed rendering of layers on shoulders 2023-02-20 22:38:34 +10:00
Paul c1f5b6e2b9 Fixed Pokémon kicking their legs super fast 2023-02-20 22:29:35 +10:00
Zero Breaker f8521fe238 Adopted a portion of Yyiyun's translations for zh_cn.json 2023-02-20 12:14:04 +00:00
Hiroku ca66e1e0a7 Merge branch 'Fixed-players-using-multiple-healers-at-once' into 'main'
Fixed issues caused by players being able to use multiple healer machines at once.

See merge request cable-mc/cobblemon!315
2023-02-20 06:47:12 +00:00
JMMCPandHiroku fc2a23ebf4 Fixed issues caused by players being able to use multiple healer machines at once. 2023-02-20 06:47:12 +00:00
Hiroku 7df91c2608 Merge branch 'ys/heal-on-sleep' into 'main'
Heal party on sleep

Closes #143

See merge request cable-mc/cobblemon!317
2023-02-20 05:55:59 +00:00
Yaseen SultanandHiroku 5b67155112 Heal party on sleep 2023-02-20 05:55:59 +00:00
Hiroku a241ac5653 Merge branch 'zerobreaker000-main-patch-82306' into 'main'
Reverted changes to colored pokeball names in zh_cn.json

See merge request cable-mc/cobblemon!321
2023-02-20 03:04:29 +00:00
Zero Breaker ac743f9f43 Reverted changes to colored pokeball names in zh_cn.json 2023-02-20 03:01:58 +00:00
Hiroku a703687bed Merge branch 'IseFallen-main-patch-07712' into 'main'
Update zh_cn.json

See merge request cable-mc/cobblemon!318
2023-02-20 02:58:44 +00:00
Fallen IseandHiroku 16dd7d6fa2 Update zh_cn.json 2023-02-20 02:58:44 +00:00
Hiroku d1da3aee57 Merge branch 'charmander_line_particles' into 'main'
Added texture animation to Charmander line and added new translucent option for layers.

See merge request cable-mc/cobblemon!319
2023-02-20 02:29:42 +00:00
TyzillionandHiroku e4818da893 Added texture animation to Charmander line and added new translucent option for layers. 2023-02-20 02:29:42 +00:00
Hiroku 85c3582d78 Merge branch 'zerobreaker000-main-patch-41538' into 'main'
Changed advancement translations in zh_cn.json to Kinoshita's versions with modification

See merge request cable-mc/cobblemon!312
2023-02-19 11:39:51 +00:00
Zero BreakerandHiroku 95b11cae28 Changed advancement translations in zh_cn.json to Kinoshita's versions with modification 2023-02-19 11:39:51 +00:00
Hiroku 809718a89b Merge branch 'switch-move-battle-lock' into 'main'
Force switch battle lock fix

See merge request cable-mc/cobblemon!313
2023-02-19 11:39:19 +00:00
LiciousandHiroku 0dd87a8ac4 Force switch battle lock fix 2023-02-19 11:39:19 +00:00
Hiroku 82a9ad7756 Merge branch 'further-apricorn-changes' into 'main'
Update Apricorn block to use loot tables instead

See merge request cable-mc/cobblemon!310
2023-02-18 10:40:52 +00:00
LiciousandHiroku 99e326a720 Update Apricorn block to use loot tables instead 2023-02-18 10:40:52 +00:00
Licious 15d034bb60 Merge branch 'spawning-held-items' into 'main'
Added held item support to spawning

See merge request cable-mc/cobblemon!309
2023-02-18 10:39:12 +00:00
Hiroku 100ba9cff3 Merge branch 'zerobreaker000-main-patch-53499' into 'main'
Update zh_cn.json based off draft version by mask868

See merge request cable-mc/cobblemon!311
2023-02-18 08:15:23 +00:00
Zero BreakerandHiroku f86d88a7b9 Update zh_cn.json based off draft version by mask868 2023-02-18 08:15:23 +00:00
Village eac4afb1c4 standardize texture resolutions 2023-02-17 11:06:49 -05:00
Licious17 c94e176b06 Label render position offset fix 2023-02-17 12:19:51 +00:00
Paul 009a5c554b Added held item support to spawning 2023-02-17 14:43:40 +10:00
Hiroku 6829b65f5e Merge branch 'gastly-particles' into 'main'
Added Gastly animations and particle effects, fixed various particle issues

See merge request cable-mc/cobblemon!307
2023-02-17 01:27:49 +00:00
Hiroku 1ea27c6c4c Added Gastly animations and particle effects, fixed various particle issues 2023-02-17 01:27:49 +00:00
Hiroku 36e0fb8ca0 Merge branch 'milky-pokemon-implementation' into 'main'
Implemented honedge

See merge request cable-mc/cobblemon!301
2023-02-17 00:55:47 +00:00
EmmettandHiroku 690615b39b Implemented honedge 2023-02-17 00:55:46 +00:00
Hiroku b31352e229 Merge branch 'Pokemon-Implementation' into 'main'
Implemented Spiritomb

See merge request cable-mc/cobblemon!300
2023-02-17 00:24:13 +00:00
XylopiaandHiroku c08e683e32 Implemented Spiritomb 2023-02-17 00:24:13 +00:00
Hiroku 4a7ef9170d Merge branch 'Implementing-many-sleep-animations' into 'main'
Implementing many sleep animations

See merge request cable-mc/cobblemon!308
2023-02-16 14:00:08 +00:00
JMMCPandHiroku d0d5db4327 Implementing many sleep animations 2023-02-16 14:00:07 +00:00
Hiroku 328c682b08 Merge branch 'evo-notify' into 'main'
Evolution Notification Sounds

Closes #105

See merge request cable-mc/cobblemon!231
2023-02-16 13:48:00 +00:00
Paul 83024e9451 Removed unused can_evolve.ogg 2023-02-16 23:13:13 +10:00
Hiroku 59339775ac Merge branch 'carry-on-disable' into 'main'
Disable Carry On mod interaction

See merge request cable-mc/cobblemon!304
2023-02-16 13:03:32 +00:00
LiciousandHiroku c4b7fad8e8 Disable Carry On mod interaction 2023-02-16 13:03:31 +00:00
Hiroku f289c7945b Merge branch 'apricorn-harvest-changes' into 'main'
Apricorn harvest changes

See merge request cable-mc/cobblemon!305
2023-02-16 13:02:41 +00:00
LiciousandHiroku d7b29c6938 Apricorn harvest changes 2023-02-16 13:02:41 +00:00
Paul 08e94d23ea Fixed turn number declaration not being a lang line 2023-02-16 23:01:19 +10:00
Licious 0f59920a3f Merge branch 'Added-Belly-Drum-Message' into 'main'
Added an instruction for -setboost messages in battle (used for Belly Drum)...

See merge request cable-mc/cobblemon!299
2023-02-16 09:49:47 +00:00
RenaissanceandLicious 2f58fc530f Added an instruction for -setboost messages in battle (used for Belly Drum)... 2023-02-16 09:49:47 +00:00
Hiroku e64294a71a Merge branch 'showdown-update-fix' into 'main'
Fix showdown updating failing due to moved target directory, rewrite some of the loading logic

See merge request cable-mc/cobblemon!306
2023-02-16 02:47:39 +00:00
NickandHiroku 8512c13e6d Fix showdown updating failing due to moved target directory, rewrite some of the loading logic 2023-02-16 02:47:39 +00:00
Hiroku 4b4534aea1 Merge branch 'zero_breaker000-zh_cn' into 'main'
Update zh_cn.json

See merge request cable-mc/cobblemon!303
2023-02-15 14:16:03 +00:00
Zero BreakerandHiroku 63bd6d8d08 Update zh_cn.json 2023-02-15 14:16:03 +00:00
Emmett de Bruin 2ea661a6ea Implemented honedge 2023-02-14 21:44:23 -08:00
Hiroku 6d931c6a8a Merge branch 'pokemon-particles' into 'main'
Particle keyframe support for Bedrock animations

See merge request cable-mc/cobblemon!298
2023-02-14 12:44:33 +00:00
Hiroku ad71a445ba Particle keyframe support for Bedrock animations 2023-02-14 12:44:32 +00:00
Hiroku a77d74c352 Merge branch 'Fixed-Crashes-with-empty-party-summaries' into 'main'
Fixed crashes involving opening the Pokémon summary with an empty party.

See merge request cable-mc/cobblemon!297
2023-02-12 23:50:27 +00:00
Hiroku bda35d6bbd Merge branch 'label-render-fix' into 'main'
Fix Pokémon label constantly rendering

See merge request cable-mc/cobblemon!296
2023-02-12 23:50:00 +00:00
LiciousandHiroku 8852752c07 Fix Pokémon label constantly rendering 2023-02-12 23:50:00 +00:00
jmmcp 788009e14a Fixed crashes involving opening the Pokémon summary with an empty party. 2023-02-12 14:37:46 -05:00
Paul 296c618377 Merge remote-tracking branch 'origin/main'
# Conflicts:
#	CHANGELOG.md
2023-02-12 18:48:40 +10:00
Hiroku 47fa5bda68 Merge branch 'showdown-priority' into 'main'
Showdown Launch Priority

See merge request cable-mc/cobblemon!295
2023-02-12 08:47:50 +00:00
NickandHiroku a0e18a6037 Showdown Launch Priority 2023-02-12 08:47:50 +00:00
Paul 2522a87a22 Merge remote-tracking branch 'origin/main' 2023-02-12 17:22:05 +10:00
Paul 99db2e8f24 Fixed Showdown insertions happening exactly as many times as you've joined a world in this session 2023-02-12 17:21:05 +10:00
Paul 6a53bb2ecb Fixed soft-dupe from boats and other vehicles 2023-02-12 17:19:50 +10:00
Hiroku e40ff82366 Merge branch 'Truly_Fixed_Pokemon_in_Trees' into 'main'
Fixed Pokemon spawning in trees

See merge request cable-mc/cobblemon!294
2023-02-12 05:29:27 +00:00
jmmcp bec0d11fcb Fixed Pokemon spawning in trees 2023-02-12 00:13:45 -05:00
Hiroku 0d9f49af52 Merge branch 'pikachu_fix' into 'main'
Fixed Pikachu's animation.

See merge request cable-mc/cobblemon!293
2023-02-12 00:52:28 +00:00
TyzillionandHiroku b6c6cd855c Fixed Pikachu's animation. 2023-02-12 00:52:28 +00:00
MoeBoy76 f15d4ae709 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into evo-notify
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/api/pokemon/evolution/Evolution.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/pokemon/evolution/controller/ServerEvolutionController.kt
#	common/src/main/resources/assets/cobblemon/sounds.json
2023-02-12 07:56:24 +11:00
MoeBoy76 76738cfd26 Updated sounds 2023-02-12 07:46:09 +11:00
Hiroku ef60725cfa Merge branch 'locators' into 'main'
Added locators support to Bedrock models

See merge request cable-mc/cobblemon!292
2023-02-11 02:17:42 +00:00
Hiroku 639571f139 Added locators support to Bedrock models 2023-02-11 02:17:42 +00:00
Hiroku 94b14c6c36 Merge branch 'we-were-too-hasty' into 'main'
Bad Blinks Disabled and Invalid Animation Handling

See merge request cable-mc/cobblemon!291
2023-02-10 03:31:23 +00:00
NickandHiroku 3fdd9fcb3c Bad Blinks Disabled and Invalid Animation Handling 2023-02-10 03:31:23 +00:00
Paul 16bc02528e Fixed shiny Gyarados not using the shiny texture 2023-02-10 10:49:57 +10:00
Hiroku e742f8f4ab Merge branch 'snowstorm-particles' into 'main'
Snowstorm particles

See merge request cable-mc/cobblemon!274
2023-02-09 23:57:36 +00:00
Paul 40dfe91f18 Updated licenses 2023-02-10 09:28:42 +10:00
Paul 6a9632731c Merge remote-tracking branch 'origin/main' into snowstorm-particles
# Conflicts:
#	CHANGELOG.md
2023-02-10 09:23:29 +10:00
Hiroku 1a12cd7fb7 Merge branch 'pokemon-label-changes' into 'main'
Pokemon entity display name changes

See merge request cable-mc/cobblemon!287
2023-02-09 23:22:40 +00:00
Hiroku 43d5be4825 Merge branch 'Create-Dripstone-Fix' into 'main'
Fix our dripstone mixin being broken by Create's overwrite

See merge request cable-mc/cobblemon!290
2023-02-09 23:21:13 +00:00
NickandHiroku 2ffe69cae2 Fix our dripstone mixin being broken by Create's overwrite 2023-02-09 23:21:13 +00:00
Hiroku 7b07ffdb7f Merge branch 'no-wheat-allowed' into 'main'
No more breeding

See merge request cable-mc/cobblemon!289
2023-02-09 23:17:59 +00:00
Hiroku 30a658e54d Merge branch 'species-encode-decode-fix' into 'main'
Species encoding/decoding fixes

See merge request cable-mc/cobblemon!288
2023-02-09 23:17:42 +00:00
Licious17 aed8e08a0c No more breeding 2023-02-09 17:35:26 +00:00
Licious17 c0302a69c1 Fix up stuff 2023-02-09 17:27:06 +00:00
Licious17 b69a09c5ab Touch up inconsistencies in the entity display name implementation to better suit our needs and keep expected compatibility with other mods 2023-02-09 17:21:00 +00:00
Hiroku 1f84f38f6c Merge branch 'command-block-support' into 'main'
Pokespawn non player CommandExecutor support

See merge request cable-mc/cobblemon!283
2023-02-09 11:45:37 +00:00
Licious a22f427988 Merge branch 'main' into 'command-block-support'
# Conflicts:
#   CHANGELOG.md
2023-02-09 11:11:56 +00:00
Hiroku 17490019b1 Merge branch 'pokeheal-in-battle-fix' into 'main'
Fix Pokeheal in battle and switching into fainted party members

See merge request cable-mc/cobblemon!285
2023-02-09 11:09:24 +00:00
Hiroku 510ddd5850 Merge branch 'Fixed-Drastic-Stat-Bonuses' into 'main'
Updated the getSeverity method to have a fallback for any boost above 3

See merge request cable-mc/cobblemon!286
2023-02-09 11:00:39 +00:00
Hiroku d061e3fa60 Merge branch 'main' into 'Fixed-Drastic-Stat-Bonuses'
# Conflicts:
#   CHANGELOG.md
2023-02-09 10:29:51 +00:00
nlingebretson ed43a0a414 Updated the getSeverity method to have a fallback for any boost above 3 i.e. having the ability Simple or if custom moves were to be added 2023-02-08 18:53:44 -06:00
nlingebretson 17c917b4eb Updated the getSeverity method to have a fallback for any boost above 3 i.e. having the ability Simple or if custom moves were to be added 2023-02-08 18:47:23 -06:00
Licious bf48b04efe Merge branch 'main' into 'command-block-support'
# Conflicts:
#   CHANGELOG.md
2023-02-08 21:59:42 +00:00
Licious ea48eefc9f Merge branch 'main' into 'pokeheal-in-battle-fix'
# Conflicts:
#   CHANGELOG.md
2023-02-08 21:58:57 +00:00
Hiroku a91cabab11 Merge branch 'fix-experience-load' into 'main'
Fix Pokemon experience loading

See merge request cable-mc/cobblemon!284
2023-02-08 21:35:26 +00:00
Licious17 e98dc35224 Fix & changelog 2023-02-08 16:33:07 +00:00
Licious17 1e9e17d32c Fix & changelog 2023-02-08 16:02:29 +00:00
Licious17 d4958c362f Changelog 2023-02-08 15:34:21 +00:00
Licious17 84a0a504f2 Add compatibility with any command source for the pokemon spawn command, add secondary command for specific spawn coordinates 2023-02-08 15:31:52 +00:00
Hiroku a16e5ea8b7 Merge branch 'move-sourced-healing-display-fix' into 'main'
Fix heal related battle action interpretation

See merge request cable-mc/cobblemon!282
2023-02-08 12:23:36 +00:00
Licious17 8f145b8565 Merge branch 'main' into move-sourced-healing-display-fix
# Conflicts:
#	CHANGELOG.md
2023-02-08 12:09:53 +00:00
Licious17 8fce820e22 Disable battle dev logging 2023-02-08 12:07:25 +00:00
Licious17 b82f9ec790 Wrap exceptions in interpreter to prevent ctd 2023-02-08 12:03:40 +00:00
Licious17 01b424994c Added interpretation for -sethp battle action 2023-02-08 11:55:25 +00:00
Hiroku a11ce41e11 Merge branch 'blink_implementation' into 'main'
Added blink animations to many Pokemon.

See merge request cable-mc/cobblemon!281
2023-02-08 11:16:53 +00:00
Paul 36f8b695c1 Update Showdown for fix of wrong gen of scripts being used (ground hitting flying) 2023-02-08 21:14:51 +10:00
Licious17 c021b76700 Fix crash with fieldstart interpretation, added fieldend interpretation and other interpretations connected to field effects. 2023-02-08 10:48:26 +00:00
tyzillion 8765a8a5e5 Added blink animations to the rest of the Pokemon that Bro had made and gave those Pokemon the blink quirk. 2023-02-07 18:10:14 -05:00
tyzillion 87fa04c6b3 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into blink_implementation
# Conflicts:
#	common/src/main/resources/data/cobblemon/species/generation4/grotle.json
#	common/src/main/resources/data/cobblemon/species/generation4/torterra.json
2023-02-07 12:09:48 -05:00
Hiroku d997e03829 Merge branch 'Impemented-more-pokemon' into 'main'
Implemented Pokemon

See merge request cable-mc/cobblemon!279
2023-02-07 13:33:24 +00:00
Paul 4ef0b4ea85 Merge remote-tracking branch 'origin/main' into Impemented-more-pokemon
# Conflicts:
#	CHANGELOG.md
2023-02-07 22:49:49 +10:00
Hiroku bf2ecb3080 Merge branch 'Fixed_Pokemon_not_spawning_on_snow_and_others' into 'main'
Fixed issues with Pokémon not spawning on blocks such as snow layers

See merge request cable-mc/cobblemon!280
2023-02-07 12:01:37 +00:00
jmmcp 566dbb0e33 Fixed issues with Pokémon not spawning in blocks such as snow layers, as well as Pokémon spawning inside of trees. 2023-02-07 01:30:43 -05:00
Test 168e40034d Merge branch 'animated-textures' into 'main'
Added animated textures

Closes #6

See merge request cable-mc/cobblemon!278
2023-02-07 04:24:32 +00:00
Xylopia 554914fc30 Added in Galvantula, and updated Joltik's resource files 2023-02-06 22:12:30 -05:00
tyzillion cfd1e234dc Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into blink_implementation 2023-02-06 18:57:59 -05:00
tyzillion 374ab5f40c Fixed aerodactyls frame, framed all new Pokemon added by Xylopia, added saturation shoulder effect, allowed Alcremie and Milcery to shoulder. No effect, for now. 2023-02-06 18:30:05 -05:00
Licious17 ebb92d4771 Finish healing lang 2023-02-06 21:51:00 +00:00
tyzillion a179ca4091 Merge remote-tracking branch 'origin/Impemented-more-pokemon' into Impemented-more-pokemon 2023-02-06 16:25:53 -05:00
Licious17 1d01f3fffe Licenses 2023-02-06 20:38:54 +00:00
Licious17 7644b49a32 Implement lang for some healing sources. 2023-02-06 20:38:08 +00:00
tyzillion 673cbffbbe Merge remote-tracking branch 'origin/Impemented-more-pokemon' into Impemented-more-pokemon
# Conflicts:
#	CHANGELOG.md
2023-02-06 12:44:38 -05:00
Licious17 71e1462897 Implement heal instruction, update hp values networking to prevent cheating 2023-02-06 15:38:22 +00:00
Xylopia e97f7cecd7 Forgot to add Turtwig, Grotle, and Torterra to the Changelog 2023-02-06 07:17:29 -05:00
Xylopia 2ec4fd8aeb Fixed Missing Copyright in Grotle, Torterra, and Turtwig 2023-02-06 07:16:39 -05:00
Xylopia 25ba62eb31 Implemented Joltik
Added New Haste and Water Breathing effects
Changed HitBoxes and Size definitions for Dhelmise
Updated Changelog
2023-02-06 06:54:34 -05:00
Paul d5888935b3 Merge remote-tracking branch 'origin/main' into snowstorm-particles 2023-02-06 17:28:14 +10:00
Paul 553a633451 Cleared some redundant comments 2023-02-06 17:28:06 +10:00
Paul 0b7719946e Added animated textures 2023-02-06 17:02:55 +10:00
Xylopia fa94d60505 Added Shiinotic and Morelull, aswell as adjusted sizes and hitboxes for pokemon, and decluttered the 'PokemonModelReposity.kt' by replacing all the individually imported mons with just importing their gen file and calling all of the files within. 2023-02-05 23:43:49 -05:00
tyzillion dc4a9d9392 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into Impemented-more-pokemon 2023-02-05 23:26:59 -05:00
tyzillion c1e51ffd72 Merge branch 'Impemented-more-pokemon' of https://gitlab.com/cable-mc/cobblemon into Impemented-more-pokemon 2023-02-05 23:26:24 -05:00
tyzillion 711901cda2 Added blink animations to all Pokemon that had blink animations available.
Implemented blink quirks to all gen 1 Pokemon that had blink animations.
2023-02-05 23:24:52 -05:00
Paul c4137d179a Fixed PokemonProperties[random] not using the implemented flag 2023-02-06 14:03:07 +10:00
Hiroku 1441d870b6 Merge branch '#138-pokeballs-midair' into 'main'
Pokeballs Falling Forever

See merge request cable-mc/cobblemon!277
2023-02-06 04:01:59 +00:00
Xylopia f962cde3a9 Changed branch name cause the misstype was finnaly getting to me
Added the Klink line and it's animations
Fixed hitboxes for newly added pokemon aswell as scaling where it was needed.
2023-02-05 22:09:46 -05:00
Xylopia 91fa0fb73e fixed push issue of xerneas missing from 'PokemonModelReposity' 2023-02-05 20:27:39 -05:00
jmmcp 48b5999337 Fixed issues with Pokeballs falling forever 2023-02-05 20:20:20 -05:00
jmmcp 39e03173e0 Fixed issues with Pokeballs falling forever 2023-02-05 20:06:59 -05:00
tyzillion febac0bec6 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into Impemented-more-pokemon 2023-02-05 14:44:05 -05:00
Test 4fcc2c386e Merge branch 'healer-single-charge' into 'main'
Disable healer consuming charge after the first full charge

Closes #139

See merge request cable-mc/cobblemon!276
2023-02-05 15:59:56 +00:00
LiciousandTest d5b71cd4ab Disable healer consuming charge after the first full charge 2023-02-05 15:59:56 +00:00
Test dca38c3ad3 Merge branch 'friendship-reset-fix' into 'main'
Fix friendship being capped to the max level defined in config instead of friendship value between Pokémon loads

Closes #136

See merge request cable-mc/cobblemon!275
2023-02-05 15:46:44 +00:00
LiciousandTest 7c084aeca2 Fix friendship being capped to the max level defined in config instead of friendship value between Pokémon loads 2023-02-05 15:46:43 +00:00
Licious17 867cf0faab Fix client side evolution display. 2023-02-05 13:55:52 +00:00
Licious17 42ab6ce174 Fix Grotle evolutions, add item tag to API class, move up feature related data registries loading, fixed SpeciesFeatureAssignments not firing their observable. 2023-02-05 13:43:09 +00:00
tyzillion f924034fab Implemented Turtwig, Grotle, and Torterra. As well as all of Torterra's Minecraft tree forms. 2023-02-05 07:13:04 -05:00
Paul 9fcb767743 CI fixes 2023-02-05 19:28:53 +10:00
Paul 9a4beb597f Update copyright 2023-02-05 19:23:57 +10:00
Paul 8309c60154 Resolve merge conflict issues 2023-02-05 19:20:49 +10:00
Paul 01a82c5e74 Merge remote-tracking branch 'origin/main' into snowstorm-particles
# Conflicts:
#	CHANGELOG.md
#	common/build.gradle.kts
#	common/src/main/kotlin/com/cobblemon/mod/common/Cobblemon.kt
2023-02-05 19:17:04 +10:00
Paul ed55dd21af Final fixes to particles, updated copyright to 2023 2023-02-05 19:02:37 +10:00
tyzillion 96be99880c Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into Impemented-more-pokemon 2023-02-05 01:53:40 -05:00
tyzillion 9099781c86 Added Milcery and Alcremie. Added Alcremie forms. 2023-02-05 00:53:50 -05:00
tyzillion 9065420d61 Added Milcery and Alcremie. Added Alcremie forms. 2023-02-05 00:52:14 -05:00
Xylopia 9c4accaa55 Added Copyright to xerneas 2023-02-04 23:54:01 -05:00
Xylopia 596ddd0391 went ahead and added the copyright to the models, aswell as implemented Naclstack.
Added Xerneas, and updated some models to have blinking animations.
2023-02-04 23:19:26 -05:00
Hiroku 2de7076156 Merge branch 'more-Langed-moves' into 'main'
more-move-lang

See merge request cable-mc/cobblemon!266
2023-02-05 03:07:27 +00:00
Hiroku 93895a5e1a Merge branch 'framed-pokemon' into 'main'
Fixed ui frames for all pokemon currently modeled in game.

See merge request cable-mc/cobblemon!273
2023-02-05 02:55:06 +00:00
tyzillion 09c38b71b5 Fixed Frames for Abra, Beedrill, Bellsprout,and Magikarp. Fixed Frames for current Pokemon from gen 2,3,4,5,6,7,8. 2023-02-04 20:30:54 -05:00
Xylopia 3767d3f770 went ahead and added the copyright to the models, aswell as implemented Naclstack. 2023-02-04 20:27:54 -05:00
Village 97e4fd55f5 update type icons 2023-02-04 19:05:07 -05:00
jmmcp 0368c79a28 Updated type icons 2023-02-04 18:19:48 -05:00
Licious17 29f1319834 Fix compile errors in models 2023-02-04 09:13:41 +00:00
Hiroku 35ed67be98 Merge branch 'modding' into 'main'
Restructure publishing logic, provide forge/fabric modules for debugging

See merge request cable-mc/cobblemon!271
2023-02-04 08:28:05 +00:00
NickandHiroku 3991a52f3e Restructure publishing logic, provide forge/fabric modules for debugging 2023-02-04 08:28:05 +00:00
Hiroku acd04e6451 Merge branch 'framed-pokemon' into 'main'
Framed Gen 1 Pokemon

See merge request cable-mc/cobblemon!272
2023-02-04 08:13:55 +00:00
Tyler Astry f0afeb6647 Framed Gen 1 Pokemon 2023-02-04 08:04:20 +00:00
Paul d2a38ca33c Added quirks to Json posers 2023-02-04 12:01:38 +10:00
Hiroku 150e132ad6 Merge branch 'pc-fix' into 'main'
Various things

See merge request cable-mc/cobblemon!268
2023-02-03 11:19:36 +00:00
TestandHiroku b81e262998 Various things 2023-02-03 11:19:36 +00:00
Hiroku 93a5c81aa0 Merge branch 'item-interaction-fix' into 'main'
Fix experience candies interactions

See merge request cable-mc/cobblemon!269
2023-02-03 11:16:28 +00:00
Hiroku 9eec02cd23 Merge branch 'fix-label-display' into 'main'
Fix label rendering

See merge request cable-mc/cobblemon!270
2023-02-03 11:15:29 +00:00
Licious17 e4e209437d Fix label rendering 2023-02-03 10:40:46 +00:00
Licious17 f8bfb5ad4d Fix experience group deserialization 2023-02-03 10:31:10 +00:00
Xylopia eb91dc7eed went ahead and added the copyright to the models, aswell as implemented Naclstack. 2023-02-02 22:03:02 -05:00
Xylopia 76fad53bbf Implemented the start of Sprigatito, Fuecoco, and Quaxly
Fully Implemented Nacli with its animations and emissive textures.
2023-02-02 21:18:08 -05:00
Paul 13e3ba28a0 Fixed held items in survival mode 2023-02-03 11:34:35 +10:00
Paul ee01de09e7 Removed broken AT 2023-02-03 10:39:39 +10:00
Licious17 851591de3f Fix some evolution requirements in data. 2023-02-01 20:09:34 +00:00
Xylopia f5b10c8cb6 Fully implemented Charcadet, missing some basic animation atm however, it requires a proper idle and walking animation, however it's blinking animation does work.
pidgey animation updated to including it's blinking animation.
Note for others - This is simply so others can see what i've done, i shall not make a merge request untill i update alot more models (cause this is super easy for me todo)
2023-02-01 05:45:57 -05:00
Xylopia edba5a6633 Began the initial process of learning the implementation, needed to sync to a branch to get inteliJ to stop yelling at me 2023-02-01 04:43:59 -05:00
Hiroku 98c4baad5e Merge branch 'main' into 'more-Langed-moves'
# Conflicts:
#   CHANGELOG.md
2023-02-01 09:28:23 +00:00
Xylopia ca66fc3fc2 updated changelog and fixed my acedently push of the edited 'pokemonbattle.kt' which allows the viewage of non langed moves 2023-02-01 03:49:52 -05:00
Xylopia 5efefe9ceb Change the interpretation a little and added an else fallback, can't figure out that 'battlemessage' will need assistance 2023-02-01 03:46:32 -05:00
Paul d2b9949b29 Merge remote-tracking branch 'origin/main' into snowstorm-particles
# Conflicts:
#	CHANGELOG.md
#	common/src/main/kotlin/com/cobblemon/mod/common/Cobblemon.kt
2023-02-01 08:31:08 +10:00
Paul 17c6608203 Pretty much completed Snowstorm particle implementation 2023-02-01 08:30:12 +10:00
Hiroku b8c287e48f Merge branch 'moveset-init' into 'main'
Moveset initialization fix

Closes #135

See merge request cable-mc/cobblemon!267
2023-01-31 21:41:16 +00:00
Licious17 c5c448a5ed Update changelog 2023-01-31 16:10:52 +00:00
Licious17 1cd2254958 Fix lack of moveset initialization on PokemonProperties#create 2023-01-31 16:06:38 +00:00
Hiroku d0feab0830 Merge branch 'catch-rate-fix' into 'main'
Capture Calculator improvements

See merge request cable-mc/cobblemon!262
2023-01-31 13:18:19 +00:00
LiciousandHiroku 922a1420e2 Capture Calculator improvements 2023-01-31 13:18:19 +00:00
Xylopia 321ccacdb3 Added Interpretation for 'FieldStart' and Interpretation of abilities that activate while in battle, also added lang for some field moves and 'speed boost' in for the battle 'ability' 2023-01-31 03:03:01 -05:00
Hiroku 61a84eb039 Merge branch 'custom-pokemon-battle-fix' into 'main'
Custom Pokémon Showdown conversion fix

See merge request cable-mc/cobblemon!265
2023-01-30 21:39:57 +00:00
LiciousandHiroku 224d2b38b7 Custom Pokémon Showdown conversion fix 2023-01-30 21:39:56 +00:00
Hiroku 059dc4ce95 Merge branch 'pokemon-entity-display-fix' into 'main'
PokemonEntity names fix.

See merge request cable-mc/cobblemon!263
2023-01-30 13:12:09 +00:00
Hiroku d846ad6545 Merge branch 'pokedex-entry-fix' into 'main'
Fix pokedex entries

See merge request cable-mc/cobblemon!264
2023-01-30 13:05:06 +00:00
Licious17 bb68cea310 Fix pokedex entries 2023-01-30 12:28:25 +00:00
Licious17 3882b26d93 Fix display name of the Pokémon entity 2023-01-30 11:46:50 +00:00
Hiroku 41906f6b1c Merge branch 'species-data-appending' into 'main'
Species data appending

See merge request cable-mc/cobblemon!254
2023-01-29 11:03:09 +00:00
Licious17 1e862be75a Update standard form automatic assignment to work with new form IDs 2023-01-29 10:37:36 +00:00
Licious17 117048ea37 Merge branch 'main' into species-data-appending
# Conflicts:
#	CHANGELOG.md
2023-01-29 10:35:58 +00:00
Hiroku 30cf97e2fe Merge branch 'bind-lang' into 'main'
bide-lang

See merge request cable-mc/cobblemon!261
2023-01-29 09:40:47 +00:00
Xylopia a4e7b53d71 text fix 2023-01-28 23:59:47 -05:00
Xylopia 071b797e51 text fix 2023-01-28 23:52:01 -05:00
Xylopia b15decd5c5 bide lang interprited 2023-01-28 23:46:58 -05:00
Hiroku a584db1445 Merge branch 'gen9-data-prep' into 'main'
Generation 9 data

See merge request cable-mc/cobblemon!260
2023-01-29 02:08:01 +00:00
Licious17 936c95e188 Updated changelog 2023-01-28 17:36:31 +00:00
Licious17 00ca1dcbab Updated data to accommodate for Species.name and FormData.name changes. 2023-01-28 17:21:15 +00:00
Licious17 fe016f4ffa Implement ShowdownIdentifiable and redo usages of Species.name and FormData.name to use it instead. 2023-01-28 17:09:34 +00:00
Licious17 10ff034801 Remove unnecessary check. 2023-01-28 12:48:00 +00:00
Licious17 50eda62025 Implement WalkedStepsRequirement. 2023-01-28 12:46:54 +00:00
Licious17 fab6aed2d5 Implement DefeatRequirement and DefeatEvolutionProgress. 2023-01-28 12:09:34 +00:00
Licious17 41bb92d4d4 Updated DamageTakenRequirement. 2023-01-28 11:57:18 +00:00
Licious17 d00bdc3d21 Updated UseMoveRequirement. 2023-01-28 11:29:16 +00:00
Licious17 d72801facc Updated BattleCriticalHitsRequirement. 2023-01-28 11:14:13 +00:00
Licious17 65dbb4baca Implement EvolutionProgress system, add RecoilRequirement. 2023-01-28 11:00:56 +00:00
Licious17 5977827b06 Revert MoveTarget changes. 2023-01-28 00:05:25 +00:00
Licious17 466567eec1 Add lang for species names, abilities and moves for all new data and update existing entries. 2023-01-27 22:30:21 +00:00
Licious17 363dcd31c5 Remove invalid japanese with kanji lang. 2023-01-27 21:41:49 +00:00
Licious17 3d3ffe3c10 Fix issue due to inconsistency in showdown data structure. 2023-01-27 15:03:33 +00:00
Licious17 85b17bb8ff Add effect chances to moves. 2023-01-27 14:46:13 +00:00
Licious17 ed14ddb4a3 Updated CobblemonPokemonLabels documentation to better reflect the usage of the generation label. 2023-01-27 14:14:13 +00:00
Licious17 17bd787d9f Remake Moves registry to dynamically take values from Showdown. 2023-01-27 13:46:19 +00:00
Licious17 a19fb83337 Various species data fixes to use showdown IDs correctly. 2023-01-27 12:56:53 +00:00
Licious17 34023187ef Remake Abilities registry to dynamically take values from Showdown. 2023-01-27 12:49:31 +00:00
Licious17 cb4e4ee071 Fix Basculin having typo aspects. 2023-01-27 12:09:07 +00:00
Licious17 859c041a6c Add in penguin lost to the war. 2023-01-27 00:34:16 +00:00
Licious17 e212c113c5 Added generation 9 Pokémon species data, updated generation 1 to 8 Pokémon species data 2023-01-27 00:29:53 +00:00
Licious17 df9852fcc5 Added species features for hisuian Basculin, paldean forms, and paldean Tauros breeds 2023-01-25 12:58:35 +00:00
Licious17 3d383151be Implement MoonPhaseRequirement 2023-01-25 12:08:06 +00:00
Licious17 8304009c47 Implement the necessary stuff for UseMoveCountRequirement. 2023-01-25 11:53:57 +00:00
Licious17 44947814ba Fix GlobalSpeciesFeatures#getCodeFeature and GlobalSpeciesFeatures#getResourceFeature accessing the opposite mapping. 2023-01-25 10:06:14 +00:00
Licious17 8747f46f5e Implement Evolution#consumeHeldItem 2023-01-25 09:36:02 +00:00
Licious17 370c08fa31 Updated HeldItemRequirement to function as intended. 2023-01-25 09:34:43 +00:00
Licious17 e3732ef15f Updated Pokémon labels. 2023-01-25 09:22:28 +00:00
Hiroku 0c651cc4f0 Merge branch 'Pancakes0228-main-patch-60421' into 'main'
Update zh_tw

See merge request cable-mc/cobblemon!259
2023-01-25 09:08:11 +00:00
李 煎餅 e08cfc493f Update zh_tw.json 2023-01-24 19:55:08 +00:00
李 煎餅 21035fa445 Delete zh_tw.json 2023-01-24 19:51:51 +00:00
李 煎餅 2de7f98190 Update zh_tw 2023-01-24 19:48:56 +00:00
Hiroku d497a72088 Merge branch 'exp-gain-fix' into 'main'
Experience gain fix

See merge request cable-mc/cobblemon!258
2023-01-22 11:44:54 +00:00
Licious17 453e31931f Fixed every Pokémon gaining experience at the end of a battle. 2023-01-22 11:17:55 +00:00
Hiroku 46dc76e6a2 Merge branch 'exordium-fix' into 'main'
Fix incompatibilty with Exordium

See merge request cable-mc/cobblemon!257
2023-01-22 00:09:36 +00:00
Licious17 91923f3ba7 Fix incompat with Exordium 2023-01-21 13:36:10 +00:00
Paul 8907f0f091 Fixed forms displaying incorrectly on servers 2023-01-21 10:46:32 +10:00
Paul e58b0e8347 A lot more Snowstorm stuff 2023-01-21 10:41:00 +10:00
Hiroku 689da5bd5c Merge branch 'machines' into 'main'
Machines

See merge request cable-mc/cobblemon!256
2023-01-20 01:56:16 +00:00
TestandHiroku 948ffbc404 Machines 2023-01-20 01:56:16 +00:00
Paul 196cae58dd Merge remote-tracking branch 'origin/main' into snowstorm-particles
# Conflicts:
#	CHANGELOG.md
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/bedrock/animation/BedrockAnimation.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/util/math/SimpleMathExtensions.kt
2023-01-16 18:16:17 +10:00
Hiroku a1bba3cb61 Merge branch 'pokeedit-other-fix' into 'main'
Pokeedit other fix

See merge request cable-mc/cobblemon!255
2023-01-15 13:25:12 +00:00
Licious17 deb9088d94 Changelog update 2023-01-15 13:01:34 +00:00
Licious17 0b7e671527 Update to use PartySlotArgumentType#getPokemonOf 2023-01-15 13:00:27 +00:00
Licious17 3349bc81be Merge branch 'main' into pokeedit-other-fix 2023-01-15 12:59:45 +00:00
Licious17 9b113a4a3e Changelog update 2023-01-15 12:55:19 +00:00
Licious17 de81a0b165 Merge branch 'main' into species-data-appending
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/api/pokemon/PokemonSpecies.kt
2023-01-15 12:23:17 +00:00
Hiroku 35a1e57bd9 Merge branch 'gen9-battles' into 'main'
Gen9 battles

See merge request cable-mc/cobblemon!252
2023-01-15 09:24:35 +00:00
Test 22d33a23a5 Merge branch 'party-item' into 'main'
Party item

See merge request cable-mc/cobblemon!253
2023-01-15 09:07:11 +00:00
HirokuandTest 026af46945 Party item 2023-01-15 09:07:11 +00:00
Paul 741b4afe8a Merge remote-tracking branch 'origin/main' into gen9-battles 2023-01-15 13:57:07 +10:00
Paul f006880586 Added gen9 moves and abilities 2023-01-15 13:56:51 +10:00
Hiroku dacb0c920a Merge branch 'pokelabel-&-remap' into 'main'
Viewbobbing fix, Remap extension functions, potential camera rotation query.

See merge request cable-mc/cobblemon!245
2023-01-15 02:24:30 +00:00
Hiroku d5579fb75c Merge branch 'pokeball-tag-fixes' into 'main'
Pokéball tag fixes

See merge request cable-mc/cobblemon!251
2023-01-15 01:55:07 +00:00
Paul 161263846d Merge conflict resolution 2023-01-15 10:08:37 +10:00
Paul b32f13cdbf Merge remote-tracking branch 'origin/main' into pokeball-tag-fixes
# Conflicts:
#	CHANGELOG.md
2023-01-15 10:08:20 +10:00
Hiroku fd200e2400 Merge branch 'pokemon-items' into 'main'
Pokemon Model Items (Server Utility)

See merge request cable-mc/cobblemon!250
2023-01-15 00:07:45 +00:00
NickandHiroku e0da4b8535 Pokemon Model Items (Server Utility) 2023-01-15 00:07:45 +00:00
Hiroku 502fe10713 Merge branch 'held-items' into 'main'
Held Item functionality

See merge request cable-mc/cobblemon!247
2023-01-14 23:20:14 +00:00
Village 47730b9bb1 update changelog 2023-01-14 15:09:14 -05:00
Village 9bdc2c881b Merge remote-tracking branch 'origin/held-items' into held-items 2023-01-14 14:42:28 -05:00
Village fc41f8ecc3 update interact assets 2023-01-14 14:41:33 -05:00
Licious17 a9012d0205 Fixed the not all Pokéballs being associated with the cobblemon:pokeballs item tag 2023-01-14 10:22:27 +00:00
Licious17 7aa712b574 Clarify Pokemon#swapHeldItem, add optional property to prevent stack decrement. 2023-01-14 10:18:05 +00:00
Licious17 6f3b569b04 Correct EVs being given to the original Pokémon instead of effected in battle. 2023-01-14 09:46:49 +00:00
Licious17 b08a60fc4f Remove unnecessary filter every iteration 2023-01-14 09:45:38 +00:00
Licious17 f8548c6f33 Merge remote-tracking branch 'origin/held-items' into held-items 2023-01-14 09:41:27 +00:00
Licious17 9e201122ea Revert PokemonBattle#onFaint experience awarding to PokemonBattle#end 2023-01-14 09:41:16 +00:00
Paul f0de0d1177 Fixed Pokémon battles instantly fleeing, improve held item lang 2023-01-14 15:16:27 +10:00
Paul 58b90c71be Fixed shoulder mounts 2023-01-14 13:58:08 +10:00
Paul 563842f392 Merge remote-tracking branch 'origin/main' into snowstorm-particles 2023-01-14 12:01:38 +10:00
Paul f8cf70a42c Much more work on Snowstorm effects 2023-01-14 12:01:20 +10:00
Licious17 1c3def7ae8 Merge branch 'main' into held-items
# Conflicts:
#	CHANGELOG.md
2023-01-13 11:19:25 +00:00
Hiroku 60b82b436d Merge branch 'redstone-support' into 'main'
Redstone Support

See merge request cable-mc/cobblemon!249
2023-01-12 20:24:05 +00:00
Licious17 ae4cb1c771 Add dispenser support for Apricorn harvesting with shears, allow apricorn seeds to be compostable, add comparator compatibility for the healing machine. 2023-01-12 19:27:18 +00:00
Licious17 0dbe65fcc1 Remove debug log, fix experience being awarded to wrong actor, trigger PokemonBattle#onFaint from ShowdownInterpreter 2023-01-11 11:32:22 +00:00
Licious17 d764f05dc7 Partial fix await held item merge 2023-01-11 11:14:15 +00:00
Licious17 e51b6e432b Exp. Share implementation. 2023-01-10 15:13:21 +00:00
Licious17 e46d54d5ae Fixed missing multiplier on the experience calculator based on Pokémon affection 2023-01-10 13:11:04 +00:00
Licious17 873307cc41 Move tag classes to API, mark no longer existing tags as deprecated, add missing tags, add Lucky Egg. 2023-01-10 13:09:27 +00:00
Licious17 1a47712541 Create CobblemonItemTags, add misc held item related item tags. 2023-01-09 17:25:30 +00:00
Licious17 6ed9cd9111 Added missing experience multiplier based on pending evolution. 2023-01-09 17:17:35 +00:00
Licious17 647a9df2ef Changelog contents added 2023-01-09 15:21:13 +00:00
Licious17 a7178ac0a0 Merge branch 'main' into held-items
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonCommands.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/battles/ShowdownInterpreter.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonEntity.kt
2023-01-09 15:10:37 +00:00
Licious 21b84f487c Kill evil mac file skip-ci 2023-01-09 15:05:02 +00:00
Licious 85ea797064 Kill evil mac file skip-ci 2023-01-09 15:01:36 +00:00
Licious17 b408b208ed Fixed magician, pickpocket, covet and bestow not having manual item removal. 2023-01-09 14:52:06 +00:00
Licious17 2d4da2c44b Implement various default HeldItemManagers. 2023-01-08 14:22:11 +00:00
Licious17 06c212a313 Add Pokemon#removeHeldItem 2023-01-08 14:07:46 +00:00
Licious17 5cd4fe72dd Update pokeball ID fetching on Battle Registry. 2023-01-08 14:03:29 +00:00
Licious17 c188db7ac6 Add check if Pokemon can be mounted on the shoulder in InteractPokemonHandler, improve held item already holding check 2023-01-08 13:24:26 +00:00
Village ef74e16949 add license 2023-01-08 04:34:27 -05:00
Paul dbe6363d96 Merge remote-tracking branch 'origin/main' into snowstorm-particles
# Conflicts:
#	CHANGELOG.md
2023-01-08 14:27:37 +10:00
Paul ea6f46503c Sped up PokéBall capture process 2023-01-08 14:20:32 +10:00
Paul f9a6da8b0c Applied a cap of Pokémon per region to prevent super clustering 2023-01-08 14:04:59 +10:00
Paul f0fdb65557 Added config mechanism for changing our defaults 2023-01-08 14:00:40 +10:00
Village d15816bbb5 update interact menu 2023-01-07 14:23:01 -05:00
Village 76e0e02c02 menu assets 2023-01-07 04:58:05 -05:00
Village 2d6c40deea basic interact menu 2023-01-07 04:48:25 -05:00
Paul 0ab9e52b3d Fixed nether portal soft-dupe, improved world save logic for Pokémon so wild Pokémon save to the world (+config) 2023-01-07 17:51:44 +10:00
Paul 498fc013dc Added /giveallpokemon 2023-01-07 12:01:40 +10:00
Village 9143a52da5 move slot renders up to match profile renders a bit more 2023-01-06 16:41:00 -05:00
Licious17 4b4623ac53 Updated unnecessary usages of Pokemon#heldItem to Pokemon#heldItemNoCopy 2023-01-06 10:47:54 +00:00
Licious17 bac71d9267 Add held item to PokemonDTO 2023-01-06 10:45:47 +00:00
Village 0bf42d14cf show items in PC/Summary slots 2023-01-05 23:59:39 -05:00
Paul 0e955824d7 Fixed GL scissors on some Macs 2023-01-06 10:47:06 +10:00
Paul 2b74b23bf1 Missed a little of the aspect fix stuff 2023-01-06 10:35:31 +10:00
Paul 8f2df565d2 Possible fix for optional aspects not saving and loading properly 2023-01-06 10:24:28 +10:00
Paul 334b03b6dd Used a different GL scissor technique for parties as a test 2023-01-06 09:29:55 +10:00
Village 2620ad51ad item overlay 2023-01-05 18:05:19 -05:00
Village 6c5e7adb03 UI 2023-01-05 17:05:24 -05:00
Licious17 d28ba6d85e Implement held item give/take/swap 2023-01-04 12:03:15 +00:00
Paul e273e4228e Fixed forms not being able to unset the secondary type of a Pokémon in the stat JSON 2023-01-04 21:13:33 +10:00
Paul 7ce03ad732 Fixed Sliggoo and Goodra not having conditions on their Hisuian form 2023-01-04 21:00:14 +10:00
Paul 5f4748d82f Fixed poison damage underflowing HP updates and making them appear on full health on the client 2023-01-04 20:47:18 +10:00
Paul fd209a3892 Probable fix for issues with model texture layers 2023-01-04 20:29:41 +10:00
Paul 6cc03a5d0b More definitions and structure for Snowstorm support 2023-01-04 20:00:42 +10:00
Licious17 01fcc9271c Docs and movement of BattleMessage and Effect to the API package 2023-01-02 13:16:34 +00:00
Paul e81ab88909 Fixed the minimumDistanceBetweenEntities config option effectively being half of what it's set as 2023-01-02 19:48:50 +10:00
Paul 00f2420e09 Migrated to better molang library 2023-01-02 12:37:23 +10:00
Paul cd4e83da8c Merge remote-tracking branch 'origin/main' into snowstorm-particles
# Conflicts:
#	CHANGELOG.md
2023-01-02 12:21:11 +10:00
Licious17 331371128a Added some held items 2023-01-01 21:08:13 +00:00
Licious17 5716e609da Implemented all '-enditem' action interpretations 2023-01-01 20:31:55 +00:00
Test f70322d479 fix header format [skip-ci] 2023-01-01 04:18:39 +00:00
Test d5771a5802 update changelog [skip-ci] 2023-01-01 04:11:00 +00:00
Paul 30137a9308 When referring to a discretely counted thing, 'less' is actually meant to be 'fewer'. [skip-ci] 2023-01-01 14:04:26 +10:00
Paul c853644c16 Changelog for 1.2.0 [skip-ci] 2023-01-01 13:59:52 +10:00
Paul 794d1b391d Non-snapshot 1.2.0 2023-01-01 13:44:51 +10:00
Paul 3ac2687f1e Merge remote-tracking branch 'origin/main' 2023-01-01 11:19:29 +10:00
Paul 511fd00652 Add last saved Cobblemon version to Pokemon data so we can do data migrations 2023-01-01 11:19:18 +10:00
Licious17 b36e93fa9b Implemented all '-item' action interpretations 2022-12-31 19:08:04 +00:00
Test 405d3fd774 fix framing for Beedrill/Butterfree line 2022-12-31 15:20:55 +00:00
Licious17 e6d3bbac3a Start of BattleMessage, lang for '-item' action interpretation 2022-12-31 14:14:41 +00:00
Paul 7a26d613fd Fixed zero PP turning into max-maxPP when entering battle 2022-12-31 20:16:34 +10:00
Paul 0a02edf6f3 Fixed hitboxes not changing when a Pokémon evolves 2022-12-31 19:22:30 +10:00
Paul e8c7b31144 Added explicit dependency on Architectury so we get fewer crash reports 2022-12-31 18:59:35 +10:00
Paul d6f6742658 Fixed Eevee positioning on shoulders 2022-12-31 13:16:35 +10:00
Paul c76dfe9e96 Doubled default charge rate of healers 2022-12-31 13:16:06 +10:00
Paul 3ba88265eb Fixed variations not showing in battle tiles, start battles with choice menu open 2022-12-31 13:04:57 +10:00
Hiroku dcc8975757 Fixed pyu size 2022-12-31 02:22:44 +00:00
Licious17 9d930b9ff1 Misc stuff 2022-12-30 23:39:11 +00:00
Hiroku e824234057 Merge branch 'hit-count-interpret' into 'main'
Add support for '-hitcount' to ShowdownInterpreter

See merge request cable-mc/cobblemon!244
2022-12-30 23:32:41 +00:00
Licious 0cc8bd6e0f Remove unused import 2022-12-30 18:22:52 +00:00
Licious17 1e45ff34f0 Added support for '-hitcount' to ShowdownInterpreter 2022-12-30 17:20:38 +00:00
Licious17 bca83a8cdc Start battle interpret 2022-12-30 17:09:52 +00:00
Licious17 bdb5afde9d Attach HeldItemManager to BattlePokemon when packing the team in the BattleRegistry 2022-12-30 16:27:20 +00:00
Licious17 7e8b448f48 Implemented CobblemonHeldItemManager 2022-12-30 16:09:06 +00:00
amo 697dee2f28 Rewrote PokemonRenderer.renderLabel, potentially added q.camera_rotation to MolangBoneValue.resolve, added remap functions to SimpleMathExtensions.kt 2022-12-30 14:14:36 +00:00
Licious17 00e746adc7 Updated Pokemon#loadFromJSON and Pokemon#saveToJSON to use the ItemStack Codec, added held item manager and provider 2022-12-30 13:16:03 +00:00
Hiroku 2532511d53 Merge branch 'fix-capture-effects' into 'main'
Fix capture effects

See merge request cable-mc/cobblemon!243
2022-12-30 12:39:12 +00:00
Licious17 14f7c5ecc3 Fixed CaptureEffect not triggering after a successful capture 2022-12-30 12:14:09 +00:00
Licious17 3b62b7773b Added HeldItemCommand 2022-12-30 00:22:48 +00:00
Licious17 06d9d06bab Implemented held item stack in Pokemon 2022-12-29 23:40:48 +00:00
Hiroku 1ec6af6d34 Merge branch 'pokemon-cry-fixes' into 'main'
Fix connection to server with cries

See merge request cable-mc/cobblemon!242
2022-12-29 21:04:19 +00:00
Licious17 e472ee5fbd Fixed S2C crash due to missing cry sound events, made the sound event identifier adapt to the namespace of the registered species for better expected datapack functionality, added the ability to create sounds for every form. 2022-12-29 20:50:11 +00:00
Paul 7fc651c947 Outlining snowstorm particle stuff 2022-12-29 17:42:59 +10:00
Test 7b4f43fd12 update labels 2022-12-28 21:45:36 +00:00
Hiroku 8a49b88c7a Merge branch 'spawn-pos-change' into 'main'
Fix ModifiableWorld#spawnEntity and Entity#setPosition inconsistencies

See merge request cable-mc/cobblemon!241
2022-12-28 13:02:15 +00:00
Licious17 2138022f6d Fixed usages of ModifiableWorld#spawnEntity before Entity#setPosition 2022-12-28 12:38:31 +00:00
Paul fd3bc667a9 Changelog for cry change [skip-ci] 2022-12-28 17:46:21 +10:00
Paul 4db5e54d88 Added blank sounds for Pokémon ambient cries so they can be set via RP 2022-12-28 17:41:07 +10:00
Paul 62748437de Corrected evo displays I think 2022-12-28 14:17:27 +10:00
Paul 163b2df7f6 Fixed many bugged forms that didn't have aspect conditions 2022-12-28 14:17:04 +10:00
Paul 386bad2c1c More missed stuff from last commit (illegal abilities) 2022-12-28 14:15:32 +10:00
Paul d304028389 Missed stuff from last commit (illegal abilities) 2022-12-28 14:14:53 +10:00
Paul 964894f376 Fixed abilities being illegal when they shouldn't be illegal 2022-12-28 14:14:33 +10:00
Paul ec8dfd746d Fixed moves that only work in double battles not being selectable at all 2022-12-28 13:47:09 +10:00
Hiroku 732547213a Merge branch 'mod-menu-compat' into 'main'
Added necessary data

See merge request cable-mc/cobblemon!239
2022-12-27 22:03:01 +00:00
Hiroku df888a7f36 Merge branch 'graal-relocation' into 'main'
Relocate IBM package, add pipes for Graal logging

See merge request cable-mc/cobblemon!240
2022-12-27 22:02:29 +00:00
Nick bd01b9d682 Relocate IBM package, add pipes for Graal logging 2022-12-27 13:10:38 -08:00
Licious17 ab390703da Updated mods.toml and fabric.mod.json with our new website. 2022-12-27 17:38:09 +00:00
Licious17 28cd8f0265 Added necessary data 2022-12-27 17:33:46 +00:00
Licious17 9fb91f8f6a Merge branch 'main' into species-data-appending 2022-12-27 13:37:17 +00:00
Paul ca47636ffe Merge remote-tracking branch 'origin/main' into snowstorm-particles 2022-12-27 21:14:31 +10:00
Paul a852b8e535 Fixed multiple variant JSON issues 2022-12-27 21:14:13 +10:00
Test fa6f52d305 update click.ogg 2022-12-26 22:27:20 +00:00
Paul 3e8d8daa9b Merge remote-tracking branch 'origin/main' into snowstorm-particles 2022-12-26 21:32:21 +10:00
Paul 8196a686df Fixed arbok variants, other variants need restoring ): 2022-12-26 21:31:59 +10:00
Veraxiel da157a1b28 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon 2022-12-26 02:17:14 -05:00
Veraxiel 167191a135 Added spawn files for Natu, Murkrow, and Wailord families. Updated spawn files of the Gen 1 fossil Pokémon. 2022-12-26 02:16:31 -05:00
Paul e6f881df6e Merge remote-tracking branch 'origin/main' into snowstorm-particles
# Conflicts:
#	CHANGELOG.md
2022-12-26 14:35:35 +10:00
Paul 53f82b1971 Fixed form and alolan stuff 2022-12-26 14:25:18 +10:00
Hiroku 9f775f2c92 Merge branch 'model-fix-balls-healmach' into 'main'
Fixes In Hand Pokeball and Healing Machine Display Settings

See merge request cable-mc/cobblemon!238
2022-12-25 08:57:15 +00:00
dhi_holo 07f89dc691 Update CHANGELOG.md 2022-12-25 18:33:19 +10:00
dhi_holo 0c70a5cbac Fixes In Hand Pokeball and Healing Machine Display Settings
The rendering of the pokeball and healing machine items, mainly when dropped but in other places, were not matching to how other things in Minecraft work, so were brought slightly more inline. Slight model tweak to the Pokeball In Hand model to make the visuals cleaner, but every change directly links to the display settings.
2022-12-25 18:26:15 +10:00
Paul 3ceda765c9 Updated framing for starters, pichu line, zubat 2022-12-25 17:16:51 +10:00
Paul e3360e2d18 Updated various models and textures, fixed Rattata + Nidoqueen texture, updated Sableye animations 2022-12-25 14:33:19 +10:00
Licious17 6fbd4c16e3 Licenses 2022-12-24 12:11:47 +00:00
Paul b4e2ecc8f1 Added Wailmer, Wailord, Murkrow, Honchkrow, and fixed various framings 2022-12-24 22:04:45 +10:00
Paul bdd6ea48a0 Added scissoring of pokemon renders in PC GUI, update click sound to be a bit quieter 2022-12-24 11:44:26 +10:00
Licious17 64b624c1a7 Merge branch 'main' into species-data-appending 2022-12-23 14:00:01 +00:00
Licious17 ffd3afb8d9 Added addition system 2022-12-23 13:59:15 +00:00
Paul 84244c0376 Added Natu and Xatu 2022-12-23 19:03:38 +10:00
Paul 6fec1417b1 Don't despawn a pokemon that has a vehicle 2022-12-23 16:13:04 +10:00
Paul 142c47de1c Changelog for pokemon look change during battle 2022-12-23 13:13:35 +10:00
Paul e796883660 Merge remote-tracking branch 'origin/main' into pc 2022-12-23 13:13:03 +10:00
Paul c6779385a7 Added emissive texture support to Pokémon render layers 2022-12-23 13:12:44 +10:00
Hiroku 1a0ea5db72 Merge branch 'pc' into 'main'
PC

See merge request cable-mc/cobblemon!237
2022-12-23 03:07:36 +00:00
TestandHiroku 342a1ceb6d PC 2022-12-23 03:07:36 +00:00
Hiroku 0e7d3438a5 Merge branch 'main' into 'main'
Pokémon look at eachother in battle & halt all other goals.

Closes #131

See merge request cable-mc/cobblemon!233
2022-12-23 02:55:25 +00:00
amo cadcdab39b fix bug 2022-12-23 02:52:08 +00:00
Paul 0bc7614809 Merge remote-tracking branch 'origin/pc' into pc 2022-12-23 12:42:56 +10:00
Paul ecbde40aa6 Fixed production issue on Forge caused by Graal 2022-12-23 12:42:46 +10:00
Village 672ed74309 rm unused imports 2022-12-22 21:25:12 -05:00
Village 469e9e9065 set preview on hover, remove debounce for grab 2022-12-22 21:20:50 -05:00
Paul 2dba103c14 Fixed text glitching on ability and nature 2022-12-23 10:37:15 +10:00
Village be7c0220d4 update sounds 2022-12-22 15:01:23 -05:00
MoeBoy76 feaf87f615 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into evo-notify 2022-12-22 22:00:30 +11:00
Village 14f9640556 Merge branch 'main' of https://gitlab.com/cable-mc/pokemon-cobbled into pc 2022-12-22 02:59:05 -05:00
Village 3b2940ac59 rm unused imports 2022-12-22 02:58:46 -05:00
Village 036d9c5e6b PC 2022-12-22 02:34:25 -05:00
Paul 76cdecbb94 Fixed Mewtwo always being Mega Mewtwo X actually 2022-12-21 22:15:02 +10:00
Paul 1d6317b5d6 Fixed an instance of using CheckedRandom unsafely 2022-12-21 22:13:07 +10:00
Paul 26f963f9b9 Improved initializing logic so we don't get nasty invis pokemon again 2022-12-21 22:06:20 +10:00
Paul 9ee90508ed Changelog update [skip-ci] 2022-12-21 17:44:03 +10:00
Hiroku 9b6da631ee Merge branch 'stat-calculation-fix' into 'main'
Apply level multiplier in correct location, fixes invalid stats outside of HP calculation

See merge request cable-mc/cobblemon!236
2022-12-21 07:38:00 +00:00
Hiroku c26edc55f5 Merge branch 'spawn-validator' into 'main'
Fix Magmortar spawn definitions and add validator for future default configurations

See merge request cable-mc/cobblemon!235
2022-12-21 07:37:50 +00:00
Nick f1c306051c Apply level multiplier in correct location, fixes invalid stats outside of HP calculation 2022-12-20 19:18:32 -08:00
Nick dacb16044d License 2022-12-20 18:04:51 -08:00
Nick 68478f84d8 Fix Magmortar spawn definitions and add validator for future default configurations 2022-12-20 18:01:59 -08:00
Hiroku 6272bfe2d6 Merge branch 'battle-engine' into 'main'
Replaced Javet with Graal

See merge request cable-mc/cobblemon!234
2022-12-20 19:52:14 +00:00
Paul e561bfd148 Fixed bad directory reference in PokemonSpecies showdown export 2022-12-20 07:06:59 +10:00
amo 2f9cc2b41c pokemon look at eachother in battle & dont move 2022-12-19 16:08:12 +00:00
Paul 8d39e2536b Fixed graal issue in production jars 2022-12-19 22:08:45 +10:00
Paul 17fa80e752 Upped compile-time RAM requisition to 4gb 2022-12-19 21:59:10 +10:00
Paul 4d2641308a licenses 2022-12-19 21:02:34 +10:00
Paul 27e02963eb Implemented Showdown messaging using Graal 2022-12-19 21:01:12 +10:00
Paul d71c03e48a Merge remote-tracking branch 'origin/main' into battle-engine 2022-12-19 18:28:09 +10:00
Paul 43b69ba860 Merge remote-tracking branch 'origin/main' 2022-12-17 10:08:36 +10:00
Paul 64bfb72c53 Documentation correction 2022-12-17 10:08:25 +10:00
Paul 6810232183 Updated licenses 2022-12-17 10:08:03 +10:00
Licious17 6e25c2591e Changed the default Apricorn seed chance config value from 6% to 10% 2022-12-16 12:42:22 +00:00
Paul 0be43ec28c Added waning and waxing moonphase ranges 2022-12-16 21:08:20 +10:00
Paul 78f0f572b2 Added range support to moon phase conditions and allowed single-value interpretation for time range 2022-12-16 21:05:10 +10:00
Paul 6d99c7e643 Fixed showdown shutting down after logging out of singleplayer 2022-12-16 12:56:03 +10:00
Paul c6f4fc8992 Prevent all motion on dying pokemon 2022-12-16 12:37:40 +10:00
Paul 320c471b4e Changelog for chunk load fix 2022-12-16 12:33:10 +10:00
Paul 0ea8d8932e Merge branch '1.1.1-log-world-gen' of gitlab.com:cable-mc/pokemon-cobbled
# Conflicts:
#	gradle.properties
2022-12-16 12:32:27 +10:00
Hiroku 7325f4b6ac Merge branch 'surface-spawning' into 'main'
Added surface spawning context

See merge request cable-mc/cobblemon!232
2022-12-16 02:21:57 +00:00
Paul 4fd035aa16 Merge branch 'main' of gitlab.com:cable-mc/pokemon-cobbled into surface-spawning 2022-12-16 00:21:15 +10:00
Licious 5f1038d7a4 Merge branch 'animations-in-resource-packs' into 'main'
Animations in resource packs

See merge request cable-mc/cobblemon!230
2022-12-15 13:36:17 +00:00
HirokuandLicious 6449cb7295 Animations in resource packs 2022-12-15 13:36:17 +00:00
Paul 1fa0e81b8e Added surface spawning context 2022-12-15 22:34:09 +10:00
Hiroku b243a0a098 Merge branch 'starter-config-maintainability' into 'main'
Starter config maintainability

See merge request cable-mc/cobblemon!229
2022-12-14 21:58:09 +00:00
Paul 139253454c Merge branch 'main' of gitlab.com:cable-mc/pokemon-cobbled into starter-config-maintainability
# Conflicts:
#	CHANGELOG.md
2022-12-15 07:42:26 +10:00
MoeBoy76 f05f586a8e Moved completed sound notification out of AdvancementHandler and into Evolution 2022-12-15 07:43:38 +11:00
MoeBoy76 9da71000d2 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into evo-notify 2022-12-15 07:40:00 +11:00
Paul 7224ac123f Better protect save file loading using the .temps 2022-12-14 22:29:28 +10:00
Paul c53018942b Changelog [skip-ci] 2022-12-13 19:50:34 +10:00
MoeBoy76 56dffd9790 Added placeholder sound files and registered sounds 2022-12-11 18:38:41 +11:00
MoeBoy76 c5c3afc4f0 Added code for Evolution notification on both availability and completion 2022-12-11 17:23:28 +11:00
Paul 45eaf6fb3b Likely fix for world chunk gen hanging 2022-12-10 17:00:26 +10:00
Paul 8e4141ccc1 Merge branch 'main' of gitlab.com:cable-mc/pokemon-cobbled into starter-config-maintainability 2022-12-10 15:23:58 +10:00
Paul 41c6accc16 Improved starter config handling so it is opt-in for it to export to a file 2022-12-10 15:23:50 +10:00
Paul 2302d6e59f 1.1.1 non-snapshot 2022-11-28 13:35:08 +10:00
Paul 5848e7b21c Added more stuff 2022-11-13 13:57:45 +10:00
Paul 2a2c0da200 Starting some global type definitions for engine 2022-11-11 19:50:41 +10:00
7332 changed files with 401678 additions and 191914 deletions
+2 -1
View File
@@ -31,4 +31,5 @@ forge*changelog.txt
common/src/main/resources/assets/cobblemon/showdown
# Generated files
*/generated/resources/*
*/generated/resources/*
/fabric/src/generated/resources/cobblemon-common.accesswidener
+6 -6
View File
@@ -10,7 +10,7 @@ stages:
build-job:
stage: build
script:
- export GRADLE_OPTS="-Xmx3G -Xms3G"
- export GRADLE_OPTS="-Xmx4G -Xms4G"
- chmod +x ./gradlew
- ./gradlew build
cache:
@@ -32,12 +32,12 @@ deploy-job:
- fabric/build/libs/*.jar
script:
- echo "Collecting artifacts..."
- mv forge/build/libs/*-remap.jar ./
- mv fabric/build/libs/*-remap.jar ./
- for f in *.jar; do mv "$f" "$(echo "$f" | sed s/+/b$CI_PIPELINE_IID+/ | sed s/-remap//)"; done
- mv forge/build/libs/*+*.jar ./
- mv fabric/build/libs/*+*.jar ./
- for f in *.jar; do mv "$f" "$(echo "$f" | sed s/+/b$CI_PIPELINE_IID+/)"; done
artifacts:
expire_in: 28 days
paths:
- ./*.jar
# - forge/build/libs/*-forge.jar
# - fabric/build/libs/*-remap.jar
# - forge/build/libs/*+*.jar
# - fabric/build/libs/*+*.jar
+289 -13
View File
@@ -1,30 +1,305 @@
# Changelog
## [1.3.1 (March 31st, 2023)](#1-3-1)
## 1.1.2
### Additions
- Reworked customisation of models, textures, and animations to make fakemon very easy to create.
- Added 'nature' and 'pokeball' options to commands such as /spawnpokemon and /givepokemon.
- Added support for datapack spawn files and spawn file presets.
- Added Slugma, Magcargo, Nosepass, and Probopass.
- Elgyem family now drops Chorus Fruit, Geodude family now drops Black Augurite.
- Added missing spawn files for Golett and Bergmite family.
- Apricorns can now be smelted into dyes.
- Added animations to Staryu line and Porygon line.
- Added faint animations to Klink line.
- Add lava surface spawn preset.
- Added an ``any`` evolution requirement allowing you to define ``possibilities`` of other evolution requirements, for example, this allows you to create an evolution that requires the Pokémon to be shiny or a female.
- Added the `/spawnpokemonfrompool [amount]` or `/forcespawn [amount]` command to spawn Pokémon(s) in the surrounding area using the natural spawn rates/pool of that area, this will be a cheat command in the Minecraft permission system or use the permission `cobblemon.command.spawnpokemon` if a permission mod is present. On a successful execution of the command, the amount of Pokémon spawned will be the output.
- Added the `/pokebox` and `/pokeboxall` commands to move Pokemon(s) to the PC from a Player's party, this will be a cheat command in the Minecraft permission system or use the permission `cobblemon.command.pokebox` if a permission mod is present. On a successful execution of the command the output will be the number of pokemon moved to the Player's PC.
- Added the `/pc` command which opens up the PC UI the same way interacting with the block would, this will be a cheat command in the Minecraft permission system or use the permission `cobblemon.command.pc` if a permission mod is present.
### Changes
- You can now click the portraits of other Pokémon in the starter selection screen to navigate directly to them.
- You can now click the right and left arrow keys to navigate PC boxes.
- Link Cables will now require Pokémon to hold any held item normally required for their evolution.
- After a battle, the last Pokémon used now becomes the selected one in your party.
- The `/teach` command can now only allow the Pokémon to be given moves in their learnset, this can be controlled with the permission `cobblemon.command.teach.bypass`, to account for that change the base command now requires the permission `cobblemon.command.teach.base`, this change is meant only for people using a mod capable of providing permissions such as [LuckPerms](https://luckperms.net/).
- Apricorns will no longer collide with their block form when picked, this should improve the experience in automatic farms.
- Increased spawn chances for many Pokémon requiring specific blocks to be nearby.
- Put Cryogonal in more snowy biomes.
- Ditto as well as the Eevee, Gible, and Riolu families have been made more common.
- Lowered spawn rate of Gyarados on the surface of water.
- Apricorn leaves can now be used in the [Composter](https://minecraft.fandom.com/wiki/Composter) block, these have the same chance to raise the compost pile the Minecraft leaves do.
- Updated Gengar's model and texture.
- Updated Swinub line model and animations.
- Tweaked portrait frames for the Pidgey line and for Walking Wake.
- Changed all buff shoulder effects to only give a level 1 buff instead of level 2.
- Made Weavile a little bigger.
- Changed the recipes for Mystic Water, Miracle Seed, and Charcoal Stick to utilise the evolution stones, as well as Never-Melt Ice having an alternate recipe using the Ice Stone.
- Replaced the `Failed to handle` battle messages to `Missing interpretation` to make it more clear that mechanics do work just still pending dedicated messages.
### Fixes
- Fixed killing a Dodrio killing your game. Dodrio will never look the same to us.
- Fixed non-Fire-type Pokémon being immune to lava.
- Fixed custom Pokémon not being usable in battle, properly. A last minute fix caused this to break again; what are these devs not paid for?
- Fixed being locked in an endless healing queue if you broke the healing machine during use.
- Fixed an issue with the experience calculation when the Exp. Share is held.
- Fixed Friendship-based attacks not using friendship values from your Pokémon.
- Fixed Link Cables consuming held items they shouldn't due to not validating the held item of a Pokémon.
- Fixed a crash when Aromatherapy cured the status of party members.
- Fixed moves learnt on evolution not being given when said evolution happens. If you were affected by this issue your existing Pokémon will now be able to relearn those moves.
- Fixed console spam when rendering Pokémon model items.
- Fixed battle messages for 50+ moves and abilities and items.
- Fixed the possible duplicate when capturing Pokémon (probably, this one's hard to reproduce to confirm it's fixed).
- Previously duplicated Pokémon are cleaned from PCs and parties on restart.
- Fixed an issue with some particle effects applying after a Pokémon has died or on top of the wrong Pokémon when using specific mods.
- Fixed Pokémon not looking at each other in battle.
- Fixed Experience Candy and Experience Share attempting to bring Pokémon above level cap causing crashes.
- Fixed level 100 Pokémon having experience go over the cap total amount they should have.
- Fixed `/pokemonspawnat` having the argument positions reverted making it impossible for Brigadier to understand when to suggest coordinates. It is now the intended `/spawnpokemonat <pos> <properties>`.
- Fixed performance issues with shouldered Pokémon in certain systems.
- Fixed learnset issues for Pokémon whose only modern debut was LGPE/BDSP/LA.
- Fixed shiny Zubat, Grimer, Omanyte, Elgyem, Delphox and Aegislash displaying their normal texture.
- Fixed sleeping in beds allowing fainted Pokémon to receive experience after a battle ends somehow.
- Fixed an issue where a Pokémon will claim to have learnt a new move they already have in their moveset when learnt at an earlier level in their previous evolution. I realize that's confusing.
- Fixed Dispensers not being able to shear Wooloo. This will also extend to other mods that check if an entity is valid to shear.
- Fixed the currently held item of your Pokémon not dropping to the ground when removing it if your inventory was full.
- Fixed creative mode allowing you to make your Pokémon hold more than 1 of the same item.
- Fixed a Pokémon duplication glitch when teleporting between worlds.
- Fixed dedicated servers being able to reload Cobblemon data with the vanilla `/reload` command causing unintended behavior for clients.
- Fixed underground Pokémon spawning above ground.
- Fixed Pokémon portrait not reverting back to the Pokémon after a failed capture during battle.
- Fixed edge texture artifacts on pane elements for Tentacool and Tentacruel models.
- Fixed crash caused by Pokémon pathing
- Fixed Pokémon not returning to their balls when being healed in a healing machine
- Fixed all Gen IX Pokémon as well as forms added in PLA and Wyrdeer, Kleavor, Ursaluna, Basculegion, Sneasler, Overqwil, and Enamorus having 0 exp yields.
- Fixed Irons Leaves having bluetooth back legs. If you saw it, you know what I mean.
- Fixed Golurk not having shoulder plates on its shoulders.
- Fixed some water Pokémon walking onto land from the water even though they are fish.
- Fixed Porygon2 and PorygonZ being too small.
- Fixed Snivy line head look animation.
- Fixed Staryu line not being able to swim.
- Fixed an incompatibility with [Thorium](https://modrinth.com/mod/thorium) patch for [MC-84873](https://bugs.mojang.com/browse/MC-84873).
- Fixed Pidgeotto wings when walking.
- Fixed Delphox walk animation.
- Fixed Froakie line sleep animations in battle.
- Fixed Pokémon missing the non-level up moves they could relearn when rejoining a world until a new move was added to their relearn list.
- Fixed instantly fleeing from Pokémon set to be unfleeable.
- Fixed Pumpkaboo line forms not working. (Currently sizes aren't visual but check base stats to see which size you have.)
- Fixed a bug that caused already interpreted messages for moves to be mistaken as uninterpreted.
### Developer
- Add events that are fired just before and after a Pokémon is released (ReleasePokemonEvent.Pre and .Post)
### Localization
- Added complete translations for Japanese, Thai, and Canadian French.
- Added partial translations for Russian, Ukrainian, Mexican Spanish, and Korean.
- Updated every existing language's translation.
- All the translators that contributed are amazing.
## [1.3.0 - The Foundation Update (March 17th, 2023)](#1-3-0)
### Dependencies
- Upgraded Fabric API dependence to 0.75.1+1.19.2
- Upgraded Architectury API dependence to 6.5.69
- Cobblemon Forge now depends on Kotlin for Forge.
### Additions
- Added new models and animations for Poké Balls and reworked their mechanics to feel much smoother instead of being pure frustration.
- Added party scrolling via holding R and using the mouse wheel so you don't need to take your hand off your mouse.
- Added a cap of Pokémon spawns in an area because waiting a while made things insane. This is controlled by a new `pokemonPerChunk` config option.
- Added models and animations for heaps of Pokémon (101): Riolu, Lucario, Chimchar, Monferno, Infernape, Turtwig, Grotle, Torterra, Popplio, Brionne, Primarina, Treeko, Grovyle, Sceptile, Snivy, Servine, Serperior, Tepig, Pignite, Emboar, Oshawott, Dewott, Samurott, Grookey, Thwackey, Rillaboom, Scorbunny, Raboot, Cinderace, Sobble, Drizzile, Inteleon, Fennekin, Braixen, Delphox, Froakie, Frogadier, Greninja, Chespin, Quilladin, Chesnaught, Miltank, Torkoal, Kricketot, Kricketune, Heatmor, Durant, Wooloo, Dubwool, Pumpkaboo, Gourgeist, Sigilyph, Cryogonal, Whismur, Loudred, Exploud, Misdreavus, Mismagius, Tatsugiri, Eiscue, Luvdisc, Stantler, Wyrdeer, Gible, Gabite, Garchomp, Sneasel, Weavile, Elgyem, Beheeyem, Baltoy, Claydol, Nacli, Naclstack, Alcremie, Milcery, Dhelmise, Morelull, Shiinotic, Xerneas, Klink, Klang, Klinklang, Joltik, Galvantula, Honedge, Duoblade, Aegislash, Spiritomb, Mawile, Carvanha, Sharpedo, Seedot, Nuzleaf, Shiftry, Lotad, Lombre, Ludicolo, Pineco, Forretress, and Spinda.
- Added generation 3, 4, 5, 6, 7, and 8 Starter Pokémon to the starter select screen.
- Added particle effect support for model animations
- Added particle effect and animation for Gastly.
- Added sleep and faint animations to many Pokémon.
- Added item holding for Pokémon. Any Minecraft item can be given to a Pokémon by holding shift and right-clicking them. Traditional Pokémon held items will have their expected battle effects.
- Added heaps of held items with crafting recipes: Assault Vest, Big Root, Black Belt, Black Sludge, Charcoal, Choice Band, Choice Scarf, Choice Specs, Dragon Fang, Exp. Share, Focus Band, Hard Stone, Heavy-Duty Boots, Leftovers, Light Clay, Lucky Egg, Magnet, Miracle Seed, Muscle Band, Mystic Water, Never-Melt Ice, Poison Barb, Quick Claw, Rocky Helmet, Safety Goggles, Sharp Beak, Silk Scarf, Silver Powder, Soft Sand, Spell Tag, Twisted Spoon, and Wise Glasses.
- Added heaps of evolution items with crafting recipes: Milcery's sweets items, Chipped Pot, Cracked Pot, Deep Sea Scale, Deep Sea Tooth, Dragon Scale, Galarica Cuff, Galarica Wreath, Peat Block, Prism Scale, Razor Claw, Razor Fang, Reaper Cloth, Sachet, Sweet Apple, Tart Apple, and Whipped Dream.
- Existing evolution items all now either have a crafting recipe or drop from Pokémon.
- Added the Item [tags](https://minecraft.fandom.com/wiki/Tag) `cobblemon:held/experience_share` and `cobblemon:held/lucky_egg` allowing you to mark any items you desire to have the effects implied in the tag name.
- Added an interface that appears when interacting with your Pokémon while sneaking. The interface allows for interactive options such as shouldering and exchanging held items.
- Added blinking animations to many Pokémon.
- Added animated texture support.
- Added translucent option for aspect layers.
- Added glowing textures to many Pokémon and it looks amazing.
- Added the Saturation shoulder effect.
- Added the Haste shoulder effect, initially for Joltik.
- Added the Water Breathing shoulder effect, initially for Wooper.
- Added the Speed shoulder effect, initially for Pichu and Pikachu.
- [Dispensers](https://minecraft.fandom.com/wiki/Dispenser) can now use shears to automatically harvest fully grown Apricorns.
- Added milking to Miltank.
- Added shearing to Wooloo and Dubwool.
- Added data for generation 9 Pokémon species, moves, and ability data. They're all still Substitute models, but their moves and abilities work.
- Added support for custom Pokémon to implement 'quirks' such as blinks.
- Added sound effect for harvesting Apricorns.
- Added icon to summary and PC interfaces to indicated if a Pokémon is shiny.
- Added the ``/spawnpokemonat <pos> <properties>`` command, the ``pos`` argument uses the same syntax as the Minecraft [summon](https://minecraft.fandom.com/wiki/Commands/summon) command.
- Added the `/giveallpokemon` command which is definitely safe and not insane.
- Added compatibility with Carry On by preventing the mod being able to interact with Cobblemon entities, the mod caused too many gameplay detrimental features to stay enabled.
- Added healing to your party when you sleep in a bed.
- Added the 'ability' Pokémon Property so commands can specify the ability.
- Added block tag support to the 'neededBaseBlocks' and 'neededNearbyBlocks' spawn condition.
- Added a config option for disallowing players from damaging Pokémon by hand.
- Apricorn seeds can now be used with the [Composter](https://minecraft.fandom.com/wiki/Composter), these have the layer increase chance of 65% like Apricorns and various Minecraft crops.
- Added support for Pokémon species data appending making it so datapack developers no longer need to overwrite files.
- Added an implementation of every [catch rate](https://bulbapedia.bulbagarden.net/wiki/Catch_rate) from generation 1 to 9, these can be used by changing the ``captureCalculator`` config value:
- ``generation_1`` Sets the calculator to the generation 1 implementation.
- ``generation_2`` Sets the calculator to the generation 2 implementation.
- ``generation_2_fixed`` Sets the calculator to the generation 2 implementation with the status multiplier bug fixed.
- ``generation_3_4`` Sets the calculator to the generation 3 and 4 implementation.
- ``generation_5`` Sets the calculator to the generation 5 implementation.
- ``generation_6`` Sets the calculator to the generation 6 implementation.
- ``generation_7`` Sets the calculator to the generation 7 implementation.
- ``generation_8`` Sets the calculator to the generation 8 implementation.
- ``generation_9`` Sets the calculator to the generation 9 implementation.
- ``cobblemon`` Sets the calculator to the custom Cobblemon implementation. This is the default value.
- ``debug`` Sets the calculator to the debug/cheat implementation, every attempt will be a successful critical capture.
### Changes
- Pokémon now save to the world by default, meaning the same Pokémon will remain in the world and not disappear after you log out and log back in. They still despawn over time though.
- Significantly sped up the Poké Ball shake animation so it takes less time to try to catch Pokémon.
- Update the PC and Healing Machine models and bounding boxes.
- The Healing Machine and PC now emit light when fully charged or when turned on respectively.
- The PC block screen will now turn on when being used.
- The Healing Machine will now visually display its charge level using 6 stages.
- The Healing Machine will now emit a redstone signal with the strength of 1 for every 10% charge it has when attached to a [Redstone Comparator](https://minecraft.fandom.com/wiki/Redstone_Comparator).
- Made it so that particles are not shown whenever you have a shoulder Pokémon that gives potion effects.
- Changed hitbox and size definitions for Decidueye, Blastoise, and Magmortar
- Apricorns can now be harvested with Axes, the speed will scale with enchantments and tool material, only dropping the Apricorn if fully grown, these will still destroy the Apricorn so the manual harvest still is recommended unless you're just keen on destroying trees.
- Apricorns are now a part of the vanilla tag ``minecraft:blocks/mineable/axe``.
- Apricorns are now compatible with any mod that breaks a whole tree at once.
- Apricorns no longer have a config value for the seed drop chance these are now a part of their loot table which can be found in ``cobblemon/loot_tables/blocks/<color>_apricorn.json``.
- Advancements were redone to be slightly more interesting, with improved names, descriptions, and sorting.
- Updated models and textures for Tentacool line, Gengar, Slowpoke line, Tyrogue line, Doduo line, Dratini, Dragonair, Quagsire, and Piplup line. There were probably others, the team lost track.
- Improved sending out Pokémon at the start of battle so that they are positioned in a less annoying way.
- Name Tags will no longer be used on Pokémon and Poke Ball entities, this prevents the item from being wasted.
- Lowered spawn rate of Tauros.
- Sableye now spawns near gem ores as well as amethyst.
- Added evolution stones and items to item tags
### Fixes
- Fixed catch rates being entirely too difficult.
- Fixed various strange battle issues such as Flying types being vulnerable to Ground type moves and status effects hitting despite vulnerabilities.
- Fixed shiny Gyarados not using the red Gyarados texture.
- Improved the framing of all in-game Pokémon in the party and PC GUIs so they aren't halfway out of the screen or something else crazy.
- Fixed incompatibility with Kotlin for Forge (by depending on Kotlin for Forge ourselves)
- Fixed Gengar, Goodra, and many other Pokémon showing the types of an alternate form despite those not being modelled yet.
- Fixed datapack Pokémon not being able to battle.
- Fixed Pokémon always being created with a moveset as if they're level 1 instead of their current level.
- Fixed an issue of Pokémon not rendering in GUIs on some Mac displays.
- Fixed a soft-duplicate that could occur when a party Pokémon is pushed through a Nether Portal or left in a boat.
- Fixed Pokémon that faint from poison appearing to be on full health and suckering you into false hope.
- Fixed incorrect spawns of Tentacool, Tentacruel, Dragonite, Politoed, Tangrowth, Lickilicky, Electivire, and Magmortar.
- Fixed crashes involving opening the Pokémon summary GUI with an empty party.
- Fixed lower brightness settings causing Pokémon to appear much too dark in menus such as the party and PC.
- Fixed Showdown sometimes failing to start, causing crashes.
- Fixed Showdown initialization happening several times when you login, more depending on how many times you have relogged this session.
- Fixed Showdown failing to update on first attempt. We totally weren't accidentally deleting our target directory or anything, nope.
- Fixed HP recovery related battle actions not animating for the client nor updating the in-game Pokémon HP.
- Fixed moves that force a switch such as Teleport and U-Turn soft locking battles.
- Fixed missing battle text for Bide, Speed Boost, Belly Drum, Anger Point, and Haze.
- Fixed battle messages for many field effects starting, ending, and actions caused by them such as blocking certain moves.
- Improved battle messages for effects that prevent a move from being executed such as a Taunt, requiring a recharge, flinched, etc.
- Fixed move names not being translated in battle messages.
- Fixed stat change messages for boosts over 3 stages.
- Fixed experience calculation not being completely accurate.
- Fixed positioning of Poké Balls when rendered in Healing Machines.
- Fixed a desync issue on servers where all Pokémon seemed like they were special forms when they weren't.
- Fixed an incompatibility with [Exordium](https://www.curseforge.com/minecraft/mc-mods/exordium).
- Fixed datapack Pokémon language key generation. A Pokémon under the namespace ``example`` named ``Pogemon`` will now correctly look for the lang key ``example.species.pogemon.name``.
- Fixed client not receiving messages for the different "stages" for the move Bide.
- Fixed the Medium Slow and Medium Fast experience group IDs, they're now ```medium_slow``` and ``medium_fast``. Any custom datapack Pokémon will require an update.
- Fixed Pokémon friendship being capped to the maximum level config value instead of the friendship one when loading Pokémon data.
- Fixed Poké Balls taking forever to capture Pokémon if you are underwater or up in the air where it takes a long time to hit the ground.
- Fixed Pokémon being unable to spawn on blocks such as snow layers.
- Fixed Pokémon spawning inside of trees.
- Fixed Pokémon experience not loading after a restart and instead going back to the minimal amount for the current level.
- Fixed being able to use ``/healpokemon`` in battle.
- Fixed being able to select fainted party members in the switch menu causing the battle to lock.
- Fixed ``/spawnpokemon`` command not supporting any command source other than players.
- Fixed issues with Charizard's sleep pose.
- Fixed players being able to use multiple healer machines at once.
- Fixed Pokémon layers not rendering when a Pokémon is on your shoulder.
- Fixed Caterpie and Weedle not moving or looking at players. That was meant to be Metapod and Kakuna; how embarrassing.
- Fixed Pokémon not carrying over the correct equivalent original ability when evolving from stages that only had one ability.
- Fixed Deerling and Sawsbuck not spawning with the correct season.
- Fixed issue of not being able to drag the scroll bar in summary and battle interfaces.
- Fixed optional aspects not saving and loading properly.
- Fixed layering logic so multiple texture layers can exist on a Pokémon (probably).
- Fixed not all Poké Balls being associated with the `cobblemon:pokeballs` item tag.
- Fixed the `/pokemoneditother` command not working.
- Fixed ambient sound file path for Porygon2.
- Fixed forms not being able to unset the secondary type of a Pokémon in the stat JSON.
- Fixed moves that haven't carried over from generation 8 onwards having the description they did in the generation 8 games instead of their last valid one.
- Fixed shoulder mounted pokemon not returning to party on healer use and on evolution
### Developer
- Reworked CatchRateModifier, as such, existing implementations need to be updated.
- Fixed minimumDistanceBetweenEntities option being half of what it's set as.
- Fixed the contents of CobblemonEvents, CobblemonBlocks etc having getters instead of just being public static properties.
- Added ApricornHarvestEvent.
- Added a new item for representing Pokémon within native UI menus or item frames which display as the Pokémon's model. It's called a PokemonItem, with static functions to build one.
### Localization
- Added complete translations for French, German, Simplified Mandarin, Brazilian Portuguese, and Pirate English.
- Added partial translations for Traditional Mandarin, Italian, and Spanish. We'd love more help with this!
- 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)
### Additions
- Added models for Natu and Xatu, Murkrow and Honchkrow, Wailmer and Wailord.
- Added new PC interface and it is beautiful.
- Reworked the battle system so that battles load faster, cause fewer bugs, and can run on shared server hosts. This is a very big change that also reduced the size of the mod by 50mb!
- Added full resource pack / data pack customization of models, textures, animations, spawning, and spawn file presets to make custom Pokémon species and variations very easy to create. You can find the guide for creating custom Pokémon on [our website](https://cobblemon.com/guides/custompokemon.html)!
- Added water surface spawning for Pokémon like Lapras.
- Added emissive texture support to Pokémon render layers.
- Added compatibility for Mod Menu ([CurseForge](https://www.curseforge.com/minecraft/mc-mods/modmenu), [Modrinth](https://modrinth.com/mod/modmenu)).
- Added blank ambient Pokémon cries so cries can be added via resource packs.
- Added new sounds for GUIs and item uses.
- Added `nature` and `pokeball` options to commands such as `/spawnpokemon` and `/givepokemon`.
### Changes
- Reinforced party and PC saving to make data corruption from crashes less bad.
- Added a config option for whether the starter config will be exported, making it more maintainable as we add starter Pokémon.
- Battles now start with the options menu open for convenience.
- Doubled the default charge rate of healers. You'd need to reset your config under `./config/cobblemon/main.json` to see this change!
- Changed the default Apricorn seed chance config value from 6% to 10%.
- The mod now correctly reports our dependency on Architectury API so people don't get super confused when things don't work.
- Pokémon now look at their opponents during battle.
- Updated Sableye's animations to be super freaky.
- Changed the healer advancements to make the healing machine's mechanics more obvious.
### Fixes
- Fixed an incompatibility with [Porting Lib](https://github.com/Fabricators-of-Create/Porting-Lib) used by Fabric ports of mods such as Create or Twilight Forest.
- Fixed HP and max HP values in the battle GUI not being correct.
- Fixed some animations on snake-type Pokémon being mega slow.
- Fixed some animations on snake-type Pokémon being super slow.
- Fixed a typo in the English name for Calcium. Calcuim.
- Fixed Pokémon gradually becoming rarer around you if you move long distances.
- Fixed a shoulder mount crash on Fabric.
- Fixed a rare issue where chunks would take a really long time to generate.
- Fixed a singleplayer bug where battles wouldn't work after leaving then rejoining a world.
- Fixed stat calculations for everything except HP. HP was fine though :).
- Fixed a randomized Pokémon spawning in mountains that corrupted the data of whatever party or PC it got into. Yikes.
- Fixed a rare crash involving literally random number generation. A random crash involving random numbers.
- Fixed all regular Mewtwo having the stats and types of Mega Mewtwo X - same deal with many other Pokémon.
- Fixed the framing of many Pokémon in GUIs.
- Fixed texture glitches with Rattata and Nidoqueen (again!).
- Fixed dropped item forms of all Pokéballs and the Healing Machine, and slightly adjusted all other display settings
- Fixed issues with forms not showing the correct evolution in the evolution menu.
- Fixed some alternate forms not having the alternate stats and types.
- Fixed moves that only work in double battles not being selectable at all (such as Helping Hand and Aromatic Mist).
- Fixed abilities not remaining legal in some forms.
- Fixed Poké Ball capture effects not triggering after a successful capture, such as the Heal Ball's healing effect.
- Fixed multiple-hit moves sending gibberish into the battle chat.
- Fixed Pyukumuku not being appropriately scaled.
- Fixed shiny and other variations of Pokémon not showing in the battle GUI.
- Fixed Eevee being poorly positioned and un-animated on shoulders.
- Fixed a Pokémon's hitbox not updating when it evolves while sent out.
- Fixed a Pokémon's PP going from zero to above the maximum when entering another battle.
## 1.1.1 (November 27th, 2022)
## [1.1.1 (November 27th, 2022)](#1-1-1)
### Fixes
- Fixed a critical issue with servers where Pokémon data didn't properly synchronize and so you couldn't see any.
## 1.1.0 - The Swim and Sleep Update (November 27th, 2022)
## [1.1.0 - The Swim and Sleep Update (November 27th, 2022)](#1-1-0)
#### "Ideally not at the same time."
### Additions
- Added a new GUI for viewing party information, rearranging moves, and evolving Pokémon. It looks too good.
- Starter Pokémon will sleep on top of you if sent out when you get on a bed.
@@ -78,6 +353,7 @@
- Statuses like sleep and frozen no longer last forever if it was carried over from a previous battle.
### Localization
- Added species, ability, and move translations for ko_ko, jp_jp, fr_fr, es_es, it_it, and zh_cn.
## 1.0.0 (2022-11-12)
- Initial release.
- 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.
+1 -1
View File
@@ -1,4 +1,4 @@
Copyright (C) 2022 Cobblemon Contributors
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
@@ -39,7 +39,6 @@ loom {
dependencies {
minecraft("net.minecraft:minecraft:${rootProject.property("mc_version")}")
mappings("net.fabricmc:yarn:${rootProject.property("yarn_version")}")
}
tasks {
@@ -19,13 +19,14 @@ tasks {
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}")
archiveClassifier.set("${rootProject.version}-remap")
archiveVersion.set("${rootProject.version}")
}
}
@@ -0,0 +1,37 @@
plugins {
java
`java-library`
id("maven-publish")
id("dev.architectury.loom")
}
java {
withSourcesJar()
withJavadocJar()
}
publishing {
repositories {
maven("https://maven.impactdev.net/repository/development/") {
name = "ImpactDev-Public"
credentials {
username = System.getenv("NEXUS_USER")
password = System.getenv("NEXUS_PW")
}
}
}
publications {
create<MavenPublication>(project.name) {
artifact(tasks.remapJar)
artifact(tasks.remapSourcesJar)
@Suppress("UnstableApiUsage")
loom.disableDeprecatedPomGeneration(this)
groupId = "com.cobblemon"
artifactId = project.findProperty("maven.artifactId")?.toString() ?: project.name
version = rootProject.version.toString()
}
}
}
-1
View File
@@ -1,4 +1,3 @@
plugins {
base
id("cobblemon.root-conventions")
+8 -30
View File
@@ -1,6 +1,6 @@
plugins {
id("cobblemon.base-conventions")
id("maven-publish")
id("cobblemon.publish-conventions")
}
architectury {
@@ -8,7 +8,8 @@ architectury {
}
repositories {
maven(url = "https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/")
maven(url = "${rootProject.projectDir}/deps")
mavenLocal()
}
dependencies {
@@ -18,14 +19,13 @@ dependencies {
modImplementation(libs.fabricLoader)
modApi(libs.architectury)
modApi(libs.molang)
modApi(libs.mclib)
// For Showdown
modCompileOnly(libs.javet) // Linux or Windows
modCompileOnly(libs.javetMac) // Mac OS (x86_64 Only)
modCompileOnly(libs.graal)
//shadowCommon group: 'commons-io', name: 'commons-io', version: '2.6'
testRuntimeOnly(libs.junitEngine)
testImplementation(libs.junitApi)
testImplementation(libs.junitParams)
@@ -33,30 +33,8 @@ dependencies {
testImplementation(libs.mockk)
compileOnly("net.luckperms:api:${rootProject.property("luckperms_version")}")
// For Showdown
// modCompileOnly 'com.caoccao.javet:javet:1.0.6' // Linux or Windows
// modCompileOnly 'com.caoccao.javet:javet-macos:1.0.6' // Mac OS (x86_64 Only)
// modCompileOnly group: 'commons-io', name: 'commons-io', version: '2.6'
}
publishing {
repositories {
maven("https://maven.impactdev.net/repository/development/") {
name = "ImpactDev-Public"
credentials {
username = System.getenv("NEXUS_USER")
password = System.getenv("NEXUS_PW")
}
}
}
publications {
create<MavenPublication>("mod") {
from(components["java"])
groupId = "com.cobblemon"
artifactId = "mod"
version = rootProject.version.toString()
}
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
+1
View File
@@ -0,0 +1 @@
maven.artifactId = mod
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -0,0 +1,35 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.mixin;
import com.cobblemon.mod.common.client.render.item.CobblemonBuiltinItemRenderer;
import com.cobblemon.mod.common.client.render.item.CobblemonBuiltinItemRendererRegistry;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.item.BuiltinModelItemRenderer;
import net.minecraft.client.render.model.json.ModelTransformation;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(BuiltinModelItemRenderer.class)
public class BuiltinModelItemRendererMixin {
@Inject(method = "render", at = @At("HEAD"), cancellable = true)
private void cobblemon$useDynamicItemRenderer(ItemStack stack, ModelTransformation.Mode mode, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay, CallbackInfo ci) {
CobblemonBuiltinItemRenderer renderer = CobblemonBuiltinItemRendererRegistry.INSTANCE.rendererOf(stack.getItem());
if (renderer != null) {
renderer.render(stack, mode, matrices, vertexConsumers, light, overlay);
ci.cancel();
}
}
}
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -0,0 +1,53 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.mixin;
import com.cobblemon.mod.common.client.CobblemonClient;
import com.cobblemon.mod.common.client.keybind.keybinds.PartySendBinding;
import net.minecraft.client.Mouse;
import org.objectweb.asm.Opcodes;
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;
@Mixin(Mouse.class)
public class PartyScrollMixin {
@Shadow
private double eventDeltaWheel;
@Inject(
method = "onMouseScroll",
at = @At(
value = "FIELD",
target="Lnet/minecraft/client/Mouse;eventDeltaWheel:D",
opcode = Opcodes.PUTFIELD,
ordinal = 2,
shift = At.Shift.BEFORE
),
cancellable = true
)
public void onMouseScroll(long window, double horizontal, double vertical, CallbackInfo ci) {
if (PartySendBinding.INSTANCE.getWasDown()) {
int i = (int)eventDeltaWheel;
if (i > 0) {
while (i-- > 0) CobblemonClient.INSTANCE.getStorage().shiftSelected(false);
ci.cancel();
eventDeltaWheel = 0;
PartySendBinding.INSTANCE.actioned();
} else if (i < 0) {
while (i++ < 0) CobblemonClient.INSTANCE.getStorage().shiftSelected(true);
ci.cancel();
eventDeltaWheel = 0;
PartySendBinding.INSTANCE.actioned();
}
}
}
}
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -9,15 +9,25 @@
package com.cobblemon.mod.common.mixin;
import com.cobblemon.mod.common.Cobblemon;
import com.cobblemon.mod.common.CobblemonItems;
import com.cobblemon.mod.common.api.events.CobblemonEvents;
import com.cobblemon.mod.common.api.events.item.LeftoversCreatedEvent;
import com.cobblemon.mod.common.api.storage.NoPokemonStoreException;
import com.cobblemon.mod.common.api.storage.party.PartyStore;
import com.cobblemon.mod.common.pokemon.Pokemon;
import com.cobblemon.mod.common.util.CompoundTagExtensionsKt;
import com.cobblemon.mod.common.util.DataKeys;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.ItemEntity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.sound.SoundEvent;
import net.minecraft.sound.SoundEvents;
import net.minecraft.text.Text;
import net.minecraft.world.World;
import org.objectweb.asm.Opcodes;
import org.spongepowered.asm.mixin.Mixin;
@@ -25,9 +35,13 @@ 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;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.util.Objects;
import java.util.UUID;
import static com.cobblemon.mod.common.util.LocalizationUtilsKt.lang;
@Mixin(PlayerEntity.class)
public abstract class PlayerMixin extends LivingEntity {
@@ -43,6 +57,11 @@ public abstract class PlayerMixin extends LivingEntity {
@Shadow public abstract boolean isSpectator();
@Shadow public abstract boolean giveItemStack(ItemStack stack);
@Shadow public abstract void sendMessage(Text message, boolean overlay);
protected PlayerMixin(EntityType<? extends LivingEntity> p_20966_, World p_20967_) {
super(p_20966_, p_20967_);
}
@@ -115,4 +134,32 @@ public abstract class PlayerMixin extends LivingEntity {
return CompoundTagExtensionsKt.isPokemonEntity(nbt);
}
@Inject(
method = "eatFood",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/entity/player/PlayerEntity;getHungerManager()Lnet/minecraft/entity/player/HungerManager;",
shift = At.Shift.AFTER
)
)
public void onEatFood(World world, ItemStack stack, CallbackInfoReturnable<ItemStack> cir) {
if (!getWorld().isClient) {
if (stack.getItem() == Items.APPLE && getWorld().random.nextDouble() < Cobblemon.config.getAppleLeftoversChance()) {
ItemStack leftovers = new ItemStack(CobblemonItems.LEFTOVERS.get());
ServerPlayerEntity player = Objects.requireNonNull(getServer()).getPlayerManager().getPlayer(uuid);
assert player != null;
CobblemonEvents.LEFTOVERS_CREATED.postThen(
new LeftoversCreatedEvent(player, leftovers),
leftoversCreatedEvent -> null,
leftoversCreatedEvent -> {
if(!player.giveItemStack(leftoversCreatedEvent.getLeftovers())) {
var itemPos = player.getRotationVector().multiply(0.5).add(getPos());
getWorld().spawnEntity(new ItemEntity(getWorld(), itemPos.getX(), itemPos.getY(), itemPos.getZ(), leftoversCreatedEvent.getLeftovers()));
}
return null;
}
);
}
}
}
}
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -8,20 +8,25 @@
package com.cobblemon.mod.common.mixin;
import com.cobblemon.mod.common.tags.CobblemonBlockTags;
import com.cobblemon.mod.common.api.tags.CobblemonBlockTags;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.PointedDripstoneBlock;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.Slice;
@Mixin(PointedDripstoneBlock.class)
public abstract class PointedDripstoneBlockMixin {
@Redirect(method = "canGrow(Lnet/minecraft/block/BlockState;Lnet/minecraft/block/BlockState;)Z", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/BlockState;isOf(Lnet/minecraft/block/Block;)Z", ordinal = 0))
@Redirect(
method = "canGrow(Lnet/minecraft/block/BlockState;Lnet/minecraft/block/BlockState;)Z",
at = @At(value = "INVOKE", target = "Lnet/minecraft/block/BlockState;isOf(Lnet/minecraft/block/Block;)Z", ordinal = 0),
slice = @Slice(from = @At(value = "FIELD", target = "Lnet/minecraft/block/Blocks;DRIPSTONE_BLOCK:Lnet/minecraft/block/Block;"))
)
private static boolean cobblemon$validateMoonStoneDripstone(BlockState instance, Block block) {
return instance.isIn(CobblemonBlockTags.INSTANCE.getDRIPSTONE_GROWABLE());
return instance.isIn(CobblemonBlockTags.DRIPSTONE_GROWABLE);
}
}
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -0,0 +1,39 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.mixin;
import com.cobblemon.mod.common.block.ApricornBlock;
import net.minecraft.block.BlockState;
import net.minecraft.block.dispenser.ShearsDispenserBehavior;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.event.GameEvent;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(ShearsDispenserBehavior.class)
public abstract class ShearsDispenserBehaviorMixin {
// This exists so we can execute our custom interaction only if no one redirected shears interactions to overwrite the vanilla ones.
@Inject(method = "tryShearBlock", at = @At("HEAD"), cancellable = true)
private static void cobblemon$tryApricornHarvest(ServerWorld world, BlockPos pos, CallbackInfoReturnable<Boolean> cir) {
final BlockState state = world.getBlockState(pos);
if (state.getBlock() instanceof ApricornBlock apricornBlock && state.get(ApricornBlock.Companion.getAGE()) == ApricornBlock.MAX_AGE) {
world.playSound(null, pos, SoundEvents.ENTITY_SHEEP_SHEAR, SoundCategory.BLOCKS, 1F, 1F);
apricornBlock.harvest(world, state, pos);
world.emitGameEvent(null, GameEvent.SHEAR, pos);
cir.setReturnValue(true);
}
}
}
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -29,7 +29,7 @@ import com.cobblemon.mod.common.api.net.serializers.StringSetDataSerializer
import com.cobblemon.mod.common.api.net.serializers.Vec3DataSerializer
import com.cobblemon.mod.common.api.permission.PermissionValidator
import com.cobblemon.mod.common.api.pokeball.catching.calculators.CaptureCalculator
import com.cobblemon.mod.common.api.pokeball.catching.calculators.CobblemonGen348CaptureCalculator
import com.cobblemon.mod.common.api.pokeball.catching.calculators.CaptureCalculators
import com.cobblemon.mod.common.api.pokemon.PokemonSpecies
import com.cobblemon.mod.common.api.pokemon.effect.ShoulderEffectRegistry
import com.cobblemon.mod.common.api.pokemon.experience.ExperienceCalculator
@@ -37,18 +37,16 @@ import com.cobblemon.mod.common.api.pokemon.experience.ExperienceGroups
import com.cobblemon.mod.common.api.pokemon.experience.StandardExperienceCalculator
import com.cobblemon.mod.common.api.pokemon.feature.ChoiceSpeciesFeatureProvider
import com.cobblemon.mod.common.api.pokemon.feature.FlagSpeciesFeatureProvider
import com.cobblemon.mod.common.api.pokemon.feature.GlobalSpeciesFeatures
import com.cobblemon.mod.common.api.pokemon.feature.SpeciesFeatures
import com.cobblemon.mod.common.api.pokemon.helditem.HeldItemProvider
import com.cobblemon.mod.common.api.pokemon.stats.EvCalculator
import com.cobblemon.mod.common.api.pokemon.stats.Generation8EvCalculator
import com.cobblemon.mod.common.api.pokemon.stats.StatProvider
import com.cobblemon.mod.common.api.properties.CustomPokemonProperty
import com.cobblemon.mod.common.api.reactive.Observable.Companion.filter
import com.cobblemon.mod.common.api.reactive.Observable.Companion.map
import com.cobblemon.mod.common.api.reactive.Observable.Companion.takeFirst
import com.cobblemon.mod.common.api.scheduling.ScheduledTaskTracker
import com.cobblemon.mod.common.api.spawning.BestSpawner
import com.cobblemon.mod.common.api.spawning.CobblemonSpawnPools
import com.cobblemon.mod.common.api.spawning.CobblemonSpawningProspector
import com.cobblemon.mod.common.api.spawning.context.AreaContextResolver
import com.cobblemon.mod.common.api.spawning.prospecting.SpawningProspector
@@ -62,14 +60,16 @@ import com.cobblemon.mod.common.api.storage.factory.FileBackedPokemonStoreFactor
import com.cobblemon.mod.common.api.storage.pc.PCStore
import com.cobblemon.mod.common.api.storage.pc.link.PCLinkManager
import com.cobblemon.mod.common.api.storage.player.PlayerDataStoreManager
import com.cobblemon.mod.common.api.tags.CobblemonEntityTypeTags
import com.cobblemon.mod.common.battles.BattleFormat
import com.cobblemon.mod.common.battles.BattleRegistry
import com.cobblemon.mod.common.battles.BattleSide
import com.cobblemon.mod.common.battles.ShowdownThread
import com.cobblemon.mod.common.battles.actor.PokemonBattleActor
import com.cobblemon.mod.common.battles.pokemon.BattlePokemon
import com.cobblemon.mod.common.battles.runner.ShowdownConnection
import com.cobblemon.mod.common.battles.runner.ShowdownService
import com.cobblemon.mod.common.config.CobblemonConfig
import com.cobblemon.mod.common.config.LastChangedVersion
import com.cobblemon.mod.common.config.constraint.IntConstraint
import com.cobblemon.mod.common.config.starter.StarterConfig
import com.cobblemon.mod.common.data.CobblemonDataProvider
@@ -78,14 +78,14 @@ import com.cobblemon.mod.common.events.ServerTickHandler
import com.cobblemon.mod.common.item.PokeBallItem
import com.cobblemon.mod.common.net.messages.client.settings.ServerSettingsPacket
import com.cobblemon.mod.common.net.serverhandling.ServerPacketRegistrar
import com.cobblemon.mod.common.particle.CobblemonParticles
import com.cobblemon.mod.common.permission.LaxPermissionValidator
import com.cobblemon.mod.common.pokemon.Pokemon
import com.cobblemon.mod.common.pokemon.aspects.GENDER_ASPECT
import com.cobblemon.mod.common.pokemon.aspects.SHINY_ASPECT
import com.cobblemon.mod.common.pokemon.evolution.variants.BlockClickEvolution
import com.cobblemon.mod.common.pokemon.feature.BattleCriticalHitsFeature
import com.cobblemon.mod.common.pokemon.feature.DamageTakenFeature
import com.cobblemon.mod.common.pokemon.feature.TagSeasonResolver
import com.cobblemon.mod.common.pokemon.feature.*
import com.cobblemon.mod.common.pokemon.helditem.CobblemonHeldItemManager
import com.cobblemon.mod.common.pokemon.properties.HiddenAbilityPropertyType
import com.cobblemon.mod.common.pokemon.properties.UncatchableProperty
import com.cobblemon.mod.common.pokemon.properties.UntradeableProperty
@@ -93,17 +93,20 @@ import com.cobblemon.mod.common.pokemon.properties.tags.PokemonFlagProperty
import com.cobblemon.mod.common.pokemon.stat.CobblemonStatProvider
import com.cobblemon.mod.common.registry.CompletableRegistry
import com.cobblemon.mod.common.starter.CobblemonStarterHandler
import com.cobblemon.mod.common.util.DataKeys
import com.cobblemon.mod.common.util.cobblemonResource
import com.cobblemon.mod.common.util.getServer
import com.cobblemon.mod.common.util.ifDedicatedServer
import com.cobblemon.mod.common.util.isLaterVersion
import com.cobblemon.mod.common.util.party
import com.cobblemon.mod.common.util.removeAmountIf
import com.cobblemon.mod.common.world.CobblemonGameRules
import com.cobblemon.mod.common.world.gamerules.CobblemonGameRules
import com.cobblemon.mod.common.world.feature.CobblemonOrePlacedFeatures
import com.cobblemon.mod.common.world.placement.CobblemonPlacementTypes
import dev.architectury.event.EventResult
import dev.architectury.event.events.common.CommandRegistrationEvent
import dev.architectury.event.events.common.InteractionEvent
import dev.architectury.event.events.common.PlayerEvent
import dev.architectury.hooks.item.tool.AxeItemHooks
import java.io.File
import java.io.FileReader
@@ -111,10 +114,12 @@ import java.io.FileWriter
import java.io.PrintWriter
import java.util.UUID
import kotlin.properties.Delegates
import kotlin.reflect.KMutableProperty
import kotlin.reflect.full.memberProperties
import kotlin.reflect.jvm.isAccessible
import kotlin.reflect.jvm.javaField
import net.minecraft.client.MinecraftClient
import net.minecraft.entity.data.TrackedDataHandlerRegistry
import net.minecraft.item.NameTagItem
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.WorldSavePath
import net.minecraft.util.registry.RegistryKey
@@ -123,18 +128,22 @@ import org.apache.logging.log4j.LogManager
object Cobblemon {
const val MODID = "cobblemon"
const val VERSION = "1.2.0"
const val VERSION = "1.3.1"
const val CONFIG_PATH = "config/$MODID/main.json"
val LOGGER = LogManager.getLogger()
lateinit var implementation: CobblemonImplementation
lateinit var showdown: ShowdownConnection
var captureCalculator: CaptureCalculator = CobblemonGen348CaptureCalculator
@Deprecated("This field is now a config value", ReplaceWith("Cobblemon.config.captureCalculator"))
var captureCalculator: CaptureCalculator
get() = this.config.captureCalculator
set(value) {
this.config.captureCalculator = value
}
var experienceCalculator: ExperienceCalculator = StandardExperienceCalculator
var evYieldCalculator: EvCalculator = Generation8EvCalculator
var starterHandler: StarterHandler = CobblemonStarterHandler()
var isDedicatedServer = false
var showdownThread = ShowdownThread()
val showdownThread = ShowdownThread()
lateinit var config: CobblemonConfig
var prospector: SpawningProspector = CobblemonSpawningProspector
var areaContextResolver: AreaContextResolver = object : AreaContextResolver {}
@@ -148,11 +157,12 @@ object Cobblemon {
var statProvider: StatProvider = CobblemonStatProvider
var seasonResolver: SeasonResolver = TagSeasonResolver
fun preinitialize(implementation: CobblemonImplementation) {
fun preInitialize(implementation: CobblemonImplementation) {
DropEntry.register("command", CommandDropEntry::class.java)
DropEntry.register("item", ItemDropEntry::class.java, isDefault = true)
ExperienceGroups.registerDefaults()
CaptureCalculators.registerDefaults()
this.loadConfig()
this.implementation = implementation
@@ -166,6 +176,7 @@ object Cobblemon {
CobblemonSounds.register()
CobblemonFeatures.register()
CobblemonGameRules.register()
CobblemonParticles.register()
ShoulderEffectRegistry.register()
@@ -180,9 +191,16 @@ object Cobblemon {
BattleRegistry.getBattleByParticipatingPlayer(it)?.stop()
}
LIVING_DEATH.pipe(filter { it is ServerPlayerEntity }, map { it as ServerPlayerEntity }).subscribe {
PCLinkManager.removeLink(it.uuid)
battleRegistry.getBattleByParticipatingPlayer(it)?.stop()
}
InteractionEvent.INTERACT_ENTITY.register(InteractionEvent.InteractEntity { player, entity, hand ->
if (player.getStackInHand(hand).item is NameTagItem && entity.type.isIn(CobblemonEntityTypeTags.CANNOT_HAVE_NAME_TAG))
EventResult.interruptTrue()
else
EventResult.pass()
})
InteractionEvent.RIGHT_CLICK_BLOCK.register(InteractionEvent.RightClickBlock { pl, _, pos, _ ->
val player = pl as? ServerPlayerEntity ?: return@RightClickBlock EventResult.pass()
val block = player.world.getBlockState(pos).block
@@ -195,13 +213,20 @@ object Cobblemon {
}
return@RightClickBlock EventResult.pass()
})
PlayerEvent.CHANGE_DIMENSION.register(PlayerEvent.ChangeDimension{ player, _, _ ->
player.party().forEach { pokemon -> pokemon.entity?.recallWithAnimation() }
})
TrackedDataHandlerRegistry.register(Vec3DataSerializer)
TrackedDataHandlerRegistry.register(StringSetDataSerializer)
TrackedDataHandlerRegistry.register(PoseTypeDataSerializer)
HeldItemProvider.register(CobblemonHeldItemManager, Priority.LOWEST)
}
fun initialize() {
showdownThread.start()
showdownThread.launch()
CompletableRegistry.allRegistriesCompleted.thenAccept {
LOGGER.info("All registries loaded.")
@@ -219,8 +244,12 @@ object Cobblemon {
SpeciesFeatures.types["choice"] = ChoiceSpeciesFeatureProvider::class.java
SpeciesFeatures.types["flag"] = FlagSpeciesFeatureProvider::class.java
GlobalSpeciesFeatures.register(DamageTakenFeature.ID) { DamageTakenFeature() }
GlobalSpeciesFeatures.register(BattleCriticalHitsFeature.ID) { BattleCriticalHitsFeature() }
SpeciesFeatures.register(
DataKeys.CAN_BE_MILKED,
FlagSpeciesFeatureProvider(keys = listOf(DataKeys.CAN_BE_MILKED), default = true))
SpeciesFeatures.register(
DataKeys.HAS_BEEN_SHEARED,
FlagSpeciesFeatureProvider(keys = listOf(DataKeys.HAS_BEEN_SHEARED), default = false))
CustomPokemonProperty.register(UntradeableProperty)
CustomPokemonProperty.register(UncatchableProperty)
@@ -261,7 +290,6 @@ object Cobblemon {
SERVER_STOPPED.subscribe {
storage.unregisterAll()
playerData.saveAll()
showdown.close()
}
SERVER_STARTED.subscribe {
bestSpawner.onServerStarted()
@@ -289,15 +317,13 @@ object Cobblemon {
}
}
showdownThread.showdownStarted.thenAccept {
PokemonSpecies.observable.pipe(takeFirst()).subscribe {
LOGGER.info("Starting dummy Showdown battle to force it to pre-load data.")
battleRegistry.startBattle(
BattleFormat.GEN_8_SINGLES,
BattleSide(PokemonBattleActor(UUID.randomUUID(), BattlePokemon(Pokemon().initialize()), -1F)),
BattleSide(PokemonBattleActor(UUID.randomUUID(), BattlePokemon(Pokemon().initialize()), -1F))
).apply { mute = true }
}
PokemonSpecies.observable.subscribe {
LOGGER.info("Starting dummy Showdown battle to force it to pre-load data.")
battleRegistry.startBattle(
BattleFormat.GEN_9_SINGLES,
BattleSide(PokemonBattleActor(UUID.randomUUID(), BattlePokemon(Pokemon().initialize()), -1F)),
BattleSide(PokemonBattleActor(UUID.randomUUID(), BattlePokemon(Pokemon().initialize()), -1F))
).apply { mute = true }
}
}
@@ -326,44 +352,59 @@ object Cobblemon {
exception.printStackTrace()
}
this.config::class.memberProperties.forEach {
// Member must have annotations and must be mutable
if (it.annotations.isEmpty() || it !is KMutableProperty<*>) return@forEach
val defaultConfig = CobblemonConfig()
var value = it.getter.call(config)
for (annotation in it.annotations) {
when (annotation) {
CobblemonConfig::class.memberProperties.forEach {
val field = it.javaField!!
it.isAccessible = true
field.annotations.forEach {
when (it) {
is LastChangedVersion -> {
val defaultChangedVersion = it.version
val lastSavedVersion = config.lastSavedVersion
if (defaultChangedVersion.isLaterVersion(lastSavedVersion)) {
field.set(config, field.get(defaultConfig))
}
}
is IntConstraint -> {
if (value !is Int) break
value = value.coerceIn(annotation.min, annotation.max)
it.setter.call(config, value)
var value = field.get(config)
if (value is Int) {
value = value.coerceIn(it.min, it.max)
field.set(config, value)
}
}
}
}
}
} else {
this.config = CobblemonConfig()
this.saveConfig()
}
config.lastSavedVersion = VERSION
this.saveConfig()
bestSpawner.loadConfig()
PokemonSpecies.observable.subscribe { starterConfig = this.loadStarterConfig() }
}
fun loadStarterConfig(): StarterConfig {
val file = File("config/cobblemon/starters.json")
file.parentFile.mkdirs()
if (!file.exists()) {
val config = StarterConfig()
val pw = PrintWriter(file)
StarterConfig.GSON.toJson(config, pw)
pw.close()
if (config.exportStarterConfig) {
val file = File("config/cobblemon/starters.json")
file.parentFile.mkdirs()
if (!file.exists()) {
val config = StarterConfig()
val pw = PrintWriter(file)
StarterConfig.GSON.toJson(config, pw)
pw.close()
return config
}
val reader = FileReader(file)
val config = StarterConfig.GSON.fromJson(reader, StarterConfig::class.java)
reader.close()
return config
} else {
return StarterConfig()
}
val reader = FileReader(file)
val config = StarterConfig.GSON.fromJson(reader, StarterConfig::class.java)
reader.close()
return config
}
fun saveConfig() {
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -9,8 +9,8 @@
package com.cobblemon.mod.common
import com.cobblemon.mod.common.registry.CompletableRegistry
import com.cobblemon.mod.common.world.block.entity.HealingMachineBlockEntity
import com.cobblemon.mod.common.world.block.entity.PCBlockEntity
import com.cobblemon.mod.common.block.entity.HealingMachineBlockEntity
import com.cobblemon.mod.common.block.entity.PCBlockEntity
import dev.architectury.registry.registries.RegistrySupplier
import java.util.function.Supplier
import net.minecraft.block.entity.BlockEntityType
@@ -21,12 +21,14 @@ object CobblemonBlockEntities : CompletableRegistry<BlockEntityType<*>>(Registry
return queue(name, blockEntityType)
}
@JvmField
val HEALING_MACHINE = com.cobblemon.mod.common.CobblemonBlockEntities.register("healing_machine") {
BlockEntityType.Builder.create(
::HealingMachineBlockEntity,
CobblemonBlocks.HEALING_MACHINE.get()
).build(null)
}
@JvmField
val PC = com.cobblemon.mod.common.CobblemonBlockEntities.register("pc") {
BlockEntityType.Builder.create(
::PCBlockEntity,
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -10,132 +10,170 @@ package com.cobblemon.mod.common
import com.cobblemon.mod.common.api.apricorn.Apricorn
import com.cobblemon.mod.common.registry.CompletableRegistry
import com.cobblemon.mod.common.world.block.ApricornBlock
import com.cobblemon.mod.common.world.block.ApricornSaplingBlock
import com.cobblemon.mod.common.world.block.HealingMachineBlock
import com.cobblemon.mod.common.world.block.PCBlock
import com.cobblemon.mod.common.block.ApricornBlock
import com.cobblemon.mod.common.block.ApricornSaplingBlock
import com.cobblemon.mod.common.block.HealingMachineBlock
import com.cobblemon.mod.common.block.PCBlock
import dev.architectury.registry.registries.RegistrySupplier
import net.minecraft.block.AbstractBlock
import net.minecraft.block.Block
import net.minecraft.block.BlockState
import net.minecraft.block.Blocks
import net.minecraft.block.DoorBlock
import net.minecraft.block.FenceBlock
import net.minecraft.block.FenceGateBlock
import net.minecraft.block.LeavesBlock
import net.minecraft.block.MapColor
import net.minecraft.block.Material
import net.minecraft.block.OreBlock
import net.minecraft.block.PillarBlock
import net.minecraft.block.PressurePlateBlock
import net.minecraft.block.SlabBlock
import net.minecraft.block.StairsBlock
import net.minecraft.block.TrapdoorBlock
import net.minecraft.block.WoodenButtonBlock
import net.minecraft.block.*
import net.minecraft.entity.EntityType
import net.minecraft.sound.BlockSoundGroup
import net.minecraft.util.math.Direction
import net.minecraft.util.math.intprovider.UniformIntProvider
import net.minecraft.util.registry.Registry
import java.util.function.ToIntFunction
object CobblemonBlocks : CompletableRegistry<Block>(Registry.BLOCK_KEY) {
/**
* Evolution Ores
*/
@JvmField
val DAWN_STONE_ORE = this.evolutionStoneOre("dawn_stone_ore")
@JvmField
val DUSK_STONE_ORE = this.evolutionStoneOre("dusk_stone_ore")
@JvmField
val FIRE_STONE_ORE = this.evolutionStoneOre("fire_stone_ore")
@JvmField
val ICE_STONE_ORE = this.evolutionStoneOre("ice_stone_ore")
@JvmField
val LEAF_STONE_ORE = this.evolutionStoneOre("leaf_stone_ore")
@JvmField
val MOON_STONE_ORE = this.evolutionStoneOre("moon_stone_ore")
@JvmField
val DRIPSTONE_MOON_STONE_ORE = this.evolutionStoneOre("dripstone_moon_stone_ore")
@JvmField
val SHINY_STONE_ORE = this.evolutionStoneOre("shiny_stone_ore")
@JvmField
val SUN_STONE_ORE = this.evolutionStoneOre("sun_stone_ore")
@JvmField
val THUNDER_STONE_ORE = this.evolutionStoneOre("thunder_stone_ore")
@JvmField
val WATER_STONE_ORE = this.evolutionStoneOre("water_stone_ore")
/**
* Deepslate separator
*/
@JvmField
val DEEPSLATE_DAWN_STONE_ORE = this.deepslateEvolutionStoneOre("deepslate_dawn_stone_ore")
@JvmField
val DEEPSLATE_DUSK_STONE_ORE = this.deepslateEvolutionStoneOre("deepslate_dusk_stone_ore")
@JvmField
val DEEPSLATE_FIRE_STONE_ORE = this.deepslateEvolutionStoneOre("deepslate_fire_stone_ore")
@JvmField
val DEEPSLATE_ICE_STONE_ORE = this.deepslateEvolutionStoneOre("deepslate_ice_stone_ore")
@JvmField
val DEEPSLATE_LEAF_STONE_ORE = this.deepslateEvolutionStoneOre("deepslate_leaf_stone_ore")
@JvmField
val DEEPSLATE_MOON_STONE_ORE = this.deepslateEvolutionStoneOre("deepslate_moon_stone_ore")
@JvmField
val DEEPSLATE_SHINY_STONE_ORE = this.deepslateEvolutionStoneOre("deepslate_shiny_stone_ore")
@JvmField
val DEEPSLATE_SUN_STONE_ORE = this.deepslateEvolutionStoneOre("deepslate_sun_stone_ore")
@JvmField
val DEEPSLATE_THUNDER_STONE_ORE = this.deepslateEvolutionStoneOre("deepslate_thunder_stone_ore")
@JvmField
val DEEPSLATE_WATER_STONE_ORE = this.deepslateEvolutionStoneOre("deepslate_water_stone_ore")
/**
* Apricorns
*/
@JvmField
val APRICORN_LOG = queue("apricorn_log") {
log(
MapColor.DIRT_BROWN,
MapColor.BROWN
)
}
@JvmField
val STRIPPED_APRICORN_LOG = queue("stripped_apricorn_log") {
log(
MapColor.DIRT_BROWN,
MapColor.DIRT_BROWN
)
}
@JvmField
val APRICORN_WOOD = queue("apricorn_wood") {
log(
MapColor.DIRT_BROWN,
MapColor.DIRT_BROWN
)
}
@JvmField
val STRIPPED_APRICORN_WOOD = queue("stripped_apricorn_wood") {
log(
MapColor.DIRT_BROWN,
MapColor.DIRT_BROWN
)
}
@JvmField
val APRICORN_PLANKS = queue("apricorn_planks") { Block(AbstractBlock.Settings.of(Material.WOOD, MapColor.DIRT_BROWN).strength(2.0f, 3.0f).sounds(BlockSoundGroup.WOOD)) }
@JvmField
val APRICORN_LEAVES = queue("apricorn_leaves") { com.cobblemon.mod.common.CobblemonBlocks.leaves(BlockSoundGroup.GRASS) }
@JvmField
val APRICORN_FENCE = queue("apricorn_fence") { FenceBlock(AbstractBlock.Settings.of(Material.WOOD, APRICORN_PLANKS.get().defaultMapColor).strength(2.0f, 3.0f).sounds(BlockSoundGroup.WOOD)) }
@JvmField
val APRICORN_FENCE_GATE = queue("apricorn_fence_gate") { FenceGateBlock(AbstractBlock.Settings.of(Material.WOOD, APRICORN_PLANKS.get().defaultMapColor).strength(2.0f, 3.0f).sounds(BlockSoundGroup.WOOD)) }
@JvmField
val APRICORN_BUTTON = queue("apricorn_button") { WoodenButtonBlock(AbstractBlock.Settings.of(Material.DECORATION).noCollision().strength(0.5f).sounds(BlockSoundGroup.WOOD)) }
@JvmField
val APRICORN_PRESSURE_PLATE = queue("apricorn_pressure_plate") { PressurePlateBlock(PressurePlateBlock.ActivationRule.EVERYTHING, AbstractBlock.Settings.of(Material.WOOD, APRICORN_PLANKS.get().defaultMapColor).noCollision().strength(0.5f).sounds(BlockSoundGroup.WOOD)) }
// Tag was removed be sure to add it back when implemented
//val APRICORN_SIGN = queue("apricorn_sign") { StandingSignBlock(AbstractBlock.Settings.of(Material.WOOD).noCollission().strength(1.0f).sounds(BlockSoundGroup.WOOD), APRICORN_WOOD_TYPE) }
//val APRICORN_WALL_SIGN = queue("apricorn_wall_sign") { WallSignBlock(AbstractBlock.Settings.of(Material.WOOD).noCollission().strength(1.0f).sounds(BlockSoundGroup.WOOD).dropsLike(APRICORN_SIGN), APRICORN_WOOD_TYPE) }
// @JvmField
// val APRICORN_SIGN = queue("apricorn_sign") { StandingSignBlock(AbstractBlock.Settings.of(Material.WOOD).noCollission().strength(1.0f).sounds(BlockSoundGroup.WOOD), APRICORN_WOOD_TYPE) }
//@JvmField
// val APRICORN_WALL_SIGN = queue("apricorn_wall_sign") { WallSignBlock(AbstractBlock.Settings.of(Material.WOOD).noCollission().strength(1.0f).sounds(BlockSoundGroup.WOOD).dropsLike(APRICORN_SIGN), APRICORN_WOOD_TYPE) }
@JvmField
val APRICORN_SLAB = queue("apricorn_slab") { SlabBlock(AbstractBlock.Settings.of(Material.WOOD, MapColor.OAK_TAN).strength(2.0f, 3.0f).sounds(BlockSoundGroup.WOOD)) }
@JvmField
val APRICORN_STAIRS = queue("apricorn_stairs") { StairsBlock(
APRICORN_PLANKS.get().defaultState, AbstractBlock.Settings.copy(
APRICORN_PLANKS.get())) }
@JvmField
val APRICORN_DOOR = queue("apricorn_door") { DoorBlock(AbstractBlock.Settings.of(Material.WOOD, APRICORN_PLANKS.get().defaultMapColor).strength(3.0F).sounds(BlockSoundGroup.WOOD).nonOpaque()) }
@JvmField
val APRICORN_TRAPDOOR = queue("apricorn_trapdoor") { TrapdoorBlock(AbstractBlock.Settings.of(Material.WOOD, MapColor.OAK_TAN).strength(3.0F).sounds(BlockSoundGroup.WOOD).nonOpaque().allowsSpawning { _, _, _, _ -> false }) }
private val PLANT_PROPERTIES = AbstractBlock.Settings.of(Material.PLANT).noCollision().ticksRandomly().breakInstantly().sounds(BlockSoundGroup.GRASS)
@JvmField
val BLACK_APRICORN_SAPLING = queue("black_apricorn_sapling") { ApricornSaplingBlock(PLANT_PROPERTIES, Apricorn.BLACK) }
@JvmField
val BLUE_APRICORN_SAPLING = queue("blue_apricorn_sapling") { ApricornSaplingBlock(PLANT_PROPERTIES, Apricorn.BLUE) }
@JvmField
val GREEN_APRICORN_SAPLING = queue("green_apricorn_sapling") { ApricornSaplingBlock(PLANT_PROPERTIES, Apricorn.GREEN) }
@JvmField
val PINK_APRICORN_SAPLING = queue("pink_apricorn_sapling") { ApricornSaplingBlock(PLANT_PROPERTIES, Apricorn.PINK) }
@JvmField
val RED_APRICORN_SAPLING = queue("red_apricorn_sapling") { ApricornSaplingBlock(PLANT_PROPERTIES, Apricorn.RED) }
@JvmField
val WHITE_APRICORN_SAPLING = queue("white_apricorn_sapling") { ApricornSaplingBlock(PLANT_PROPERTIES, Apricorn.WHITE) }
@JvmField
val YELLOW_APRICORN_SAPLING = queue("yellow_apricorn_sapling") { ApricornSaplingBlock(PLANT_PROPERTIES, Apricorn.YELLOW) }
@JvmField
val BLACK_APRICORN = registerApricornBlock("black_apricorn", Apricorn.BLACK)
@JvmField
val BLUE_APRICORN = registerApricornBlock("blue_apricorn", Apricorn.BLUE)
@JvmField
val GREEN_APRICORN = registerApricornBlock("green_apricorn", Apricorn.GREEN)
@JvmField
val PINK_APRICORN = registerApricornBlock("pink_apricorn", Apricorn.PINK)
@JvmField
val RED_APRICORN = registerApricornBlock("red_apricorn", Apricorn.RED)
@JvmField
val WHITE_APRICORN = registerApricornBlock("white_apricorn", Apricorn.WHITE)
@JvmField
val YELLOW_APRICORN = registerApricornBlock("yellow_apricorn", Apricorn.YELLOW)
val HEALING_MACHINE = queue("healing_machine") { HealingMachineBlock(AbstractBlock.Settings.of(Material.METAL, MapColor.IRON_GRAY).sounds(BlockSoundGroup.METAL).strength(2f).nonOpaque()) }
val PC = queue("pc") { PCBlock(AbstractBlock.Settings.of(Material.METAL, MapColor.IRON_GRAY).sounds(BlockSoundGroup.METAL).strength(2F).nonOpaque()) }
@JvmField
val HEALING_MACHINE = queue("healing_machine") { HealingMachineBlock(AbstractBlock.Settings.of(Material.METAL, MapColor.IRON_GRAY).sounds(BlockSoundGroup.METAL).strength(2f).nonOpaque().luminance(ToIntFunction { state: BlockState -> if (state.get(HealingMachineBlock.CHARGE_LEVEL) >= HealingMachineBlock.MAX_CHARGE_LEVEL) 7 else 2 })) }
@JvmField
val PC = queue("pc") { PCBlock(AbstractBlock.Settings.of(Material.METAL, MapColor.IRON_GRAY).sounds(BlockSoundGroup.METAL).strength(2F).nonOpaque().luminance(ToIntFunction { state: BlockState -> if ((state.get(
PCBlock.ON) as Boolean) && (state.get(PCBlock.PART) == PCBlock.PCPart.TOP)) 10 else 0 })) }
private fun registerApricornBlock(id: String, apricorn: Apricorn): RegistrySupplier<ApricornBlock> {
return queue(id) { ApricornBlock(AbstractBlock.Settings.of(Material.PLANT).ticksRandomly().strength(0.2f, 3.0f).sounds(BlockSoundGroup.WOOD).nonOpaque(), apricorn) }
return queue(id) { ApricornBlock(AbstractBlock.Settings.of(Material.PLANT, apricorn.mapColor()).ticksRandomly().strength(Blocks.OAK_LOG.hardness, Blocks.OAK_LOG.blastResistance).sounds(BlockSoundGroup.WOOD).nonOpaque(), apricorn) }
}
/**
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -10,8 +10,16 @@ package com.cobblemon.mod.common
import java.util.function.Supplier
import net.minecraft.client.model.TexturedModelData
import net.minecraft.client.particle.ParticleFactory
import net.minecraft.client.particle.SpriteProvider
import net.minecraft.client.render.entity.model.EntityModelLayer
import net.minecraft.particle.ParticleEffect
import net.minecraft.particle.ParticleType
interface CobblemonClientImplementation {
fun registerLayer(modelLayer: EntityModelLayer, supplier: Supplier<TexturedModelData>)
fun <T : ParticleEffect> registerParticleFactory(
type: ParticleType<T>,
factory: (SpriteProvider) -> ParticleFactory<T>
)
}
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -8,22 +8,7 @@
package com.cobblemon.mod.common
import com.cobblemon.mod.common.command.ChangeScaleAndSize
import com.cobblemon.mod.common.command.CheckSpawnsCommand
import com.cobblemon.mod.common.command.ClickTextCommand
import com.cobblemon.mod.common.command.FriendshipCommand
import com.cobblemon.mod.common.command.GetNBT
import com.cobblemon.mod.common.command.GivePokemon
import com.cobblemon.mod.common.command.HealPokemonCommand
import com.cobblemon.mod.common.command.LevelUp
import com.cobblemon.mod.common.command.OpenStarterScreenCommand
import com.cobblemon.mod.common.command.PokemonEditCommand
import com.cobblemon.mod.common.command.SpawnAllPokemon
import com.cobblemon.mod.common.command.SpawnPokemon
import com.cobblemon.mod.common.command.StopBattleCommand
import com.cobblemon.mod.common.command.TakePokemon
import com.cobblemon.mod.common.command.TeachCommand
import com.cobblemon.mod.common.command.TestCommand
import com.cobblemon.mod.common.command.*
import com.mojang.brigadier.CommandDispatcher
import net.minecraft.command.CommandRegistryAccess
import net.minecraft.server.command.CommandManager
@@ -36,6 +21,7 @@ object CobblemonCommands {
TakePokemon.register(dispatcher)
ChangeScaleAndSize.register(dispatcher)
TestCommand.register(dispatcher)
ReloadShowdownCommand.register(dispatcher)
ClickTextCommand.register(dispatcher)
PokemonEditCommand.register(dispatcher)
TeachCommand.register(dispatcher)
@@ -47,5 +33,10 @@ object CobblemonCommands {
OpenStarterScreenCommand.register(dispatcher)
SpawnAllPokemon.register(dispatcher)
FriendshipCommand.register(dispatcher)
GiveAllPokemon.register(dispatcher)
HeldItemCommand.register(dispatcher, registry)
PcCommand.register(dispatcher)
SpawnPokemonFromPool.register(dispatcher)
PokeboxCommand.register(dispatcher)
}
}
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -11,6 +11,7 @@ package com.cobblemon.mod.common
import com.cobblemon.mod.common.api.events.CobblemonEvents
import com.cobblemon.mod.common.api.events.entity.EntityAttributeEvent
import com.cobblemon.mod.common.api.pokeball.PokeBalls
import com.cobblemon.mod.common.entity.data.CobblemonTrackedDataHandlerRegistry
import com.cobblemon.mod.common.entity.pokeball.EmptyPokeBallEntity
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.registry.CompletableRegistry
@@ -21,14 +22,14 @@ import net.minecraft.entity.Entity
import net.minecraft.entity.EntityType
import net.minecraft.entity.LivingEntity
import net.minecraft.entity.SpawnGroup
import net.minecraft.entity.attribute.DefaultAttributeContainer
import net.minecraft.entity.attribute.EntityAttributes
import net.minecraft.util.registry.Registry
object CobblemonEntities : CompletableRegistry<EntityType<*>>(Registry.ENTITY_TYPE_KEY) {
override fun register() {
super.register()
CobblemonTrackedDataHandlerRegistry.register()
EntityAttributeRegistry.register(
{ POKEMON.get() },
{
@@ -52,6 +53,7 @@ object CobblemonEntities : CompletableRegistry<EntityType<*>>(Registry.ENTITY_TY
return queue(name) { entityTypeBuilder.build(cobblemonResource("pokemon").toString()) }
}
@JvmField
val POKEMON = livingEntity(
name = "pokemon",
entityTypeBuilder = EntityType.Builder.create<PokemonEntity>(
@@ -60,6 +62,7 @@ object CobblemonEntities : CompletableRegistry<EntityType<*>>(Registry.ENTITY_TY
)
)
@JvmField
val EMPTY_POKEBALL = entity(
name = "empty_pokeball",
entityTypeBuilder = EntityType.Builder.create<EmptyPokeBallEntity>(
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -21,5 +21,6 @@ object CobblemonFeatures : CompletableRegistry<Feature<*>>(Registry.FEATURE_KEY)
return queue(name, feature)
}
@JvmField
val APRICORN_TREE_FEATURE = register("apricorn_tree_feature") { ApricornTreeFeature(SingleStateFeatureConfig.CODEC) }
}
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -12,9 +12,15 @@ import com.cobblemon.mod.common.api.net.NetworkPacket
import net.minecraft.server.network.ServerPlayerEntity
interface CobblemonImplementation {
val modAPI: ModAPI
fun isModInstalled(id: String): Boolean
}
enum class ModAPI {
FABRIC,
FORGE
}
interface NetworkDelegate {
fun sendPacketToPlayer(player: ServerPlayerEntity, packet: NetworkPacket)
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -9,158 +9,367 @@
package com.cobblemon.mod.common
import com.cobblemon.mod.common.api.pokeball.PokeBalls
import com.cobblemon.mod.common.api.pokemon.helditem.HeldItemProvider
import com.cobblemon.mod.common.api.pokemon.stats.Stats
import com.cobblemon.mod.common.item.ApricornItem
import com.cobblemon.mod.common.item.CobblemonItem
import com.cobblemon.mod.common.item.CobblemonItemGroups
import com.cobblemon.mod.common.item.PokeBallItem
import com.cobblemon.mod.common.item.*
import com.cobblemon.mod.common.item.interactive.CandyItem
import com.cobblemon.mod.common.item.interactive.LinkCableItem
import com.cobblemon.mod.common.item.interactive.VitaminItem
import com.cobblemon.mod.common.pokeball.PokeBall
import com.cobblemon.mod.common.pokemon.helditem.CobblemonHeldItemManager
import com.cobblemon.mod.common.registry.CompletableRegistry
import dev.architectury.registry.registries.RegistrySupplier
import net.minecraft.block.Block
import net.minecraft.item.AliasedBlockItem
import net.minecraft.item.BlockItem
import net.minecraft.item.Item
import net.minecraft.item.ItemGroup
import net.minecraft.block.ComposterBlock
import net.minecraft.item.*
import net.minecraft.util.registry.Registry
object CobblemonItems : CompletableRegistry<Item>(Registry.ITEM_KEY) {
init {
this.completed.thenRun {
val compostChance = ComposterBlock.ITEM_TO_LEVEL_INCREASE_CHANCE.getFloat(Items.OAK_LEAVES)
// Should always pass unless Mojang reworks leaves to no longer work in the Composter, in that case we already updated w.o doing anything
if (compostChance != ComposterBlock.ITEM_TO_LEVEL_INCREASE_CHANCE.defaultReturnValue()) {
ComposterBlock.ITEM_TO_LEVEL_INCREASE_CHANCE[APRICORN_LEAVES.get()] = compostChance
}
}
}
private val pokeballs = mutableListOf<RegistrySupplier<PokeBallItem>>()
@JvmField
val POKE_BALL = pokeballItem(PokeBalls.POKE_BALL)
@JvmField
val CITRINE_BALL = pokeballItem(PokeBalls.CITRINE_BALL)
@JvmField
val VERDANT_BALL = pokeballItem(PokeBalls.VERDANT_BALL)
@JvmField
val AZURE_BALL = pokeballItem(PokeBalls.AZURE_BALL)
@JvmField
val ROSEATE_BALL = pokeballItem(PokeBalls.ROSEATE_BALL)
@JvmField
val SLATE_BALL = pokeballItem(PokeBalls.SLATE_BALL)
@JvmField
val PREMIER_BALL = pokeballItem(PokeBalls.PREMIER_BALL)
@JvmField
val GREAT_BALL = pokeballItem(PokeBalls.GREAT_BALL)
@JvmField
val ULTRA_BALL = pokeballItem(PokeBalls.ULTRA_BALL)
@JvmField
val SAFARI_BALL = pokeballItem(PokeBalls.SAFARI_BALL)
@JvmField
val FAST_BALL = pokeballItem(PokeBalls.FAST_BALL)
@JvmField
val LEVEL_BALL = pokeballItem(PokeBalls.LEVEL_BALL)
@JvmField
val LURE_BALL = pokeballItem(PokeBalls.LURE_BALL)
@JvmField
val HEAVY_BALL = pokeballItem(PokeBalls.HEAVY_BALL)
@JvmField
val LOVE_BALL = pokeballItem(PokeBalls.LOVE_BALL)
@JvmField
val FRIEND_BALL = pokeballItem(PokeBalls.FRIEND_BALL)
@JvmField
val MOON_BALL = pokeballItem(PokeBalls.MOON_BALL)
@JvmField
val SPORT_BALL = pokeballItem(PokeBalls.SPORT_BALL)
@JvmField
val PARK_BALL = pokeballItem(PokeBalls.PARK_BALL)
@JvmField
val NET_BALL = pokeballItem(PokeBalls.NET_BALL)
@JvmField
val DIVE_BALL = pokeballItem(PokeBalls.DIVE_BALL)
@JvmField
val NEST_BALL = pokeballItem(PokeBalls.NEST_BALL)
@JvmField
val REPEAT_BALL = pokeballItem(PokeBalls.REPEAT_BALL)
@JvmField
val TIMER_BALL = pokeballItem(PokeBalls.TIMER_BALL)
@JvmField
val LUXURY_BALL = pokeballItem(PokeBalls.LUXURY_BALL)
@JvmField
val DUSK_BALL = pokeballItem(PokeBalls.DUSK_BALL)
@JvmField
val HEAL_BALL = pokeballItem(PokeBalls.HEAL_BALL)
@JvmField
val QUICK_BALL = pokeballItem(PokeBalls.QUICK_BALL)
@JvmField
val DREAM_BALL = pokeballItem(PokeBalls.DREAM_BALL)
@JvmField
val BEAST_BALL = pokeballItem(PokeBalls.BEAST_BALL)
@JvmField
val MASTER_BALL = pokeballItem(PokeBalls.MASTER_BALL)
@JvmField
val CHERISH_BALL = pokeballItem(PokeBalls.CHERISH_BALL)
@JvmField
val RED_APRICORN = queue("red_apricorn") { ApricornItem(CobblemonBlocks.RED_APRICORN.get()) }
@JvmField
val YELLOW_APRICORN = queue("yellow_apricorn") { ApricornItem(CobblemonBlocks.YELLOW_APRICORN.get()) }
@JvmField
val GREEN_APRICORN = queue("green_apricorn") { ApricornItem(CobblemonBlocks.GREEN_APRICORN.get()) }
@JvmField
val BLUE_APRICORN = queue("blue_apricorn") { ApricornItem(CobblemonBlocks.BLUE_APRICORN.get()) }
@JvmField
val PINK_APRICORN = queue("pink_apricorn") { ApricornItem(CobblemonBlocks.PINK_APRICORN.get()) }
@JvmField
val BLACK_APRICORN = queue("black_apricorn") { ApricornItem(CobblemonBlocks.BLACK_APRICORN.get()) }
@JvmField
val WHITE_APRICORN = queue("white_apricorn") { ApricornItem(CobblemonBlocks.WHITE_APRICORN.get()) }
val RED_APRICORN_SEED = queue("red_apricorn_seed") { itemNameBlockItem(CobblemonBlocks.RED_APRICORN_SAPLING.get(), ItemGroup.MISC) }
val YELLOW_APRICORN_SEED = queue("yellow_apricorn_seed") { itemNameBlockItem(CobblemonBlocks.YELLOW_APRICORN_SAPLING.get(), ItemGroup.MISC) }
val GREEN_APRICORN_SEED = queue("green_apricorn_seed") { itemNameBlockItem(CobblemonBlocks.GREEN_APRICORN_SAPLING.get(), ItemGroup.MISC) }
val BLUE_APRICORN_SEED = queue("blue_apricorn_seed") { itemNameBlockItem(CobblemonBlocks.BLUE_APRICORN_SAPLING.get(), ItemGroup.MISC) }
val PINK_APRICORN_SEED = queue("pink_apricorn_seed") { itemNameBlockItem(CobblemonBlocks.PINK_APRICORN_SAPLING.get(), ItemGroup.MISC) }
val BLACK_APRICORN_SEED = queue("black_apricorn_seed") { itemNameBlockItem(CobblemonBlocks.BLACK_APRICORN_SAPLING.get(), ItemGroup.MISC) }
val WHITE_APRICORN_SEED = queue("white_apricorn_seed") { itemNameBlockItem(CobblemonBlocks.WHITE_APRICORN_SAPLING.get(), ItemGroup.MISC) }
@JvmField
val RED_APRICORN_SEED = queue("red_apricorn_seed") { ApricornSeedItem(CobblemonBlocks.RED_APRICORN_SAPLING.get(), ItemGroup.MISC) }
@JvmField
val YELLOW_APRICORN_SEED = queue("yellow_apricorn_seed") { ApricornSeedItem(CobblemonBlocks.YELLOW_APRICORN_SAPLING.get(), ItemGroup.MISC) }
@JvmField
val GREEN_APRICORN_SEED = queue("green_apricorn_seed") { ApricornSeedItem(CobblemonBlocks.GREEN_APRICORN_SAPLING.get(), ItemGroup.MISC) }
@JvmField
val BLUE_APRICORN_SEED = queue("blue_apricorn_seed") { ApricornSeedItem(CobblemonBlocks.BLUE_APRICORN_SAPLING.get(), ItemGroup.MISC) }
@JvmField
val PINK_APRICORN_SEED = queue("pink_apricorn_seed") { ApricornSeedItem(CobblemonBlocks.PINK_APRICORN_SAPLING.get(), ItemGroup.MISC) }
@JvmField
val BLACK_APRICORN_SEED = queue("black_apricorn_seed") { ApricornSeedItem(CobblemonBlocks.BLACK_APRICORN_SAPLING.get(), ItemGroup.MISC) }
@JvmField
val WHITE_APRICORN_SEED = queue("white_apricorn_seed") { ApricornSeedItem(CobblemonBlocks.WHITE_APRICORN_SAPLING.get(), ItemGroup.MISC) }
@JvmField
val APRICORN_LOG = queue("apricorn_log") { blockItem(CobblemonBlocks.APRICORN_LOG.get(), ItemGroup.BUILDING_BLOCKS) }
@JvmField
val STRIPPED_APRICORN_LOG = queue("stripped_apricorn_log") { blockItem(CobblemonBlocks.STRIPPED_APRICORN_LOG.get(), ItemGroup.BUILDING_BLOCKS) }
@JvmField
val APRICORN_WOOD = queue("apricorn_wood") { blockItem(CobblemonBlocks.APRICORN_WOOD.get(), ItemGroup.BUILDING_BLOCKS) }
@JvmField
val STRIPPED_APRICORN_WOOD = queue("stripped_apricorn_wood") { blockItem(CobblemonBlocks.STRIPPED_APRICORN_WOOD.get(), ItemGroup.BUILDING_BLOCKS) }
@JvmField
val APRICORN_PLANKS = queue("apricorn_planks") { blockItem(CobblemonBlocks.APRICORN_PLANKS.get(), ItemGroup.BUILDING_BLOCKS) }
@JvmField
val APRICORN_LEAVES = queue("apricorn_leaves") { blockItem(CobblemonBlocks.APRICORN_LEAVES.get(), ItemGroup.BUILDING_BLOCKS) }
@JvmField
val APRICORN_DOOR = queue("apricorn_door") { blockItem(CobblemonBlocks.APRICORN_DOOR.get(), ItemGroup.REDSTONE) }
@JvmField
val APRICORN_TRAPDOOR = queue("apricorn_trapdoor") { blockItem(CobblemonBlocks.APRICORN_TRAPDOOR.get(), ItemGroup.REDSTONE) }
@JvmField
val APRICORN_FENCE = queue("apricorn_fence") { blockItem(CobblemonBlocks.APRICORN_FENCE.get(), ItemGroup.DECORATIONS) }
@JvmField
val APRICORN_FENCE_GATE = queue("apricorn_fence_gate") { blockItem(CobblemonBlocks.APRICORN_FENCE_GATE.get(), ItemGroup.REDSTONE) }
@JvmField
val APRICORN_BUTTON = queue("apricorn_button") { blockItem(CobblemonBlocks.APRICORN_BUTTON.get(), ItemGroup.REDSTONE) }
@JvmField
val APRICORN_PRESSURE_PLATE = queue("apricorn_pressure_plate") { blockItem(CobblemonBlocks.APRICORN_PRESSURE_PLATE.get(), ItemGroup.REDSTONE) }
//val APRICORN_SIGN = queue("apricorn_sign", SignItem(Item.Properties().stacksTo(16).tab(CreativeModeTab.TAB_DECORATIONS), CobblemonBlocks.APRICORN_SIGN, CobblemonBlocks.APRICORN_WALL_SIGN))
//@JvmField
// val APRICORN_SIGN = queue("apricorn_sign", SignItem(Item.Properties().stacksTo(16).tab(CreativeModeTab.TAB_DECORATIONS), CobblemonBlocks.APRICORN_SIGN, CobblemonBlocks.APRICORN_WALL_SIGN))
@JvmField
val APRICORN_SLAB = queue("apricorn_slab") { blockItem(CobblemonBlocks.APRICORN_SLAB.get(), ItemGroup.BUILDING_BLOCKS) }
@JvmField
val APRICORN_STAIRS = queue("apricorn_stairs") { blockItem(CobblemonBlocks.APRICORN_STAIRS.get(), ItemGroup.BUILDING_BLOCKS) }
@JvmField
val HEALING_MACHINE = queue("healing_machine") { blockItem(CobblemonBlocks.HEALING_MACHINE.get(), ItemGroup.REDSTONE) }
@JvmField
val PC = queue("pc") { blockItem(CobblemonBlocks.PC.get(), ItemGroup.REDSTONE) }
// Evolution items
val LINK_CABLE = queue("link_cable") { LinkCableItem() }
val KINGS_ROCK = queue("kings_rock") { evolutionItem() }
val METAL_COAT = queue("metal_coat") { evolutionItem() }
val BLACK_AUGURITE = queue("black_augurite") { evolutionItem() }
val PROTECTOR = queue("protector") { evolutionItem() }
val OVAL_STONE = queue("oval_stone") { evolutionItem() }
val DRAGON_SCALE = queue("dragon_scale") { evolutionItem() }
val ELECTIRIZER = queue("electirizer") { evolutionItem() }
val MAGMARIZER = queue("magmarizer") { evolutionItem() }
val UPGRADE = queue("upgrade") { evolutionItem() }
val DUBIOUS_DISC = queue("dubious_disc") { evolutionItem() }
@JvmField val LINK_CABLE = this.queue("link_cable") { LinkCableItem() }
@JvmField val DRAGON_SCALE = this.evolutionItem("dragon_scale")
@JvmField val KINGS_ROCK = this.evolutionItem("kings_rock")
@JvmField val METAL_COAT = this.evolutionItem("metal_coat")
@JvmField val UPGRADE = this.evolutionItem("upgrade")
@JvmField val DUBIOUS_DISC = this.evolutionItem("dubious_disc")
@JvmField val DEEP_SEA_SCALE = this.evolutionItem("deep_sea_scale")
@JvmField val DEEP_SEA_TOOTH = this.evolutionItem("deep_sea_tooth")
@JvmField val ELECTIRIZER = this.evolutionItem("electirizer")
@JvmField val MAGMARIZER = this.evolutionItem("magmarizer")
@JvmField val OVAL_STONE = this.evolutionItem("oval_stone")
@JvmField val PROTECTOR = this.evolutionItem("protector")
@JvmField val REAPER_CLOTH = this.evolutionItem("reaper_cloth")
@JvmField val PRISM_SCALE = this.evolutionItem("prism_scale")
@JvmField val SACHET = this.evolutionItem("sachet")
@JvmField val WHIPPED_DREAM = this.evolutionItem("whipped_dream")
@JvmField val STRAWBERRY_SWEET = this.evolutionItem("strawberry_sweet")
@JvmField val LOVE_SWEET = this.evolutionItem("love_sweet")
@JvmField val BERRY_SWEET = this.evolutionItem("berry_sweet")
@JvmField val CLOVER_SWEET = this.evolutionItem("clover_sweet")
@JvmField val FLOWER_SWEET = this.evolutionItem("flower_sweet")
@JvmField val STAR_SWEET = this.evolutionItem("star_sweet")
@JvmField val RIBBON_SWEET = this.evolutionItem("ribbon_sweet")
@JvmField val CHIPPED_POT = this.evolutionItem("chipped_pot")
@JvmField val CRACKED_POT = this.evolutionItem("cracked_pot")
@JvmField val SWEET_APPLE = this.evolutionItem("sweet_apple")
@JvmField val TART_APPLE = this.evolutionItem("tart_apple")
@JvmField val GALARICA_CUFF = this.evolutionItem("galarica_cuff")
@JvmField val GALARICA_WREATH = this.evolutionItem("galarica_wreath")
@JvmField val BLACK_AUGURITE = this.evolutionItem("black_augurite")
@JvmField val PEAT_BLOCK = this.evolutionItem("peat_block")
@JvmField val RAZOR_CLAW = this.evolutionItem("razor_claw")
@JvmField val RAZOR_FANG = this.evolutionItem("razor_fang")
// ToDo enable me when malicious armor goes in the game
//@JvmField val AUSPICIOUS_ARMOR = this.heldItem("auspicious_armor")
// Medicine
@JvmField
val RARE_CANDY = queue("rare_candy") { CandyItem { _, pokemon -> pokemon.getExperienceToNextLevel() } }
@JvmField
val EXPERIENCE_CANDY_XS = queue("exp_candy_xs") { CandyItem { _, _ -> CandyItem.DEFAULT_XS_CANDY_YIELD } }
@JvmField
val EXPERIENCE_CANDY_S = queue("exp_candy_s") { CandyItem { _, _ -> CandyItem.DEFAULT_S_CANDY_YIELD } }
@JvmField
val EXPERIENCE_CANDY_M = queue("exp_candy_m") { CandyItem { _, _ -> CandyItem.DEFAULT_M_CANDY_YIELD } }
@JvmField
val EXPERIENCE_CANDY_L = queue("exp_candy_l") { CandyItem { _, _ -> CandyItem.DEFAULT_L_CANDY_YIELD } }
@JvmField
val EXPERIENCE_CANDY_XL = queue("exp_candy_xl") { CandyItem { _, _ -> CandyItem.DEFAULT_XL_CANDY_YIELD } }
@JvmField
val CALCIUM = queue("calcium") { VitaminItem(Stats.SPECIAL_ATTACK) }
@JvmField
val CARBOS = queue("carbos") { VitaminItem(Stats.SPEED) }
@JvmField
val HP_UP = queue("hp_up") { VitaminItem(Stats.HP) }
@JvmField
val IRON = queue("iron") { VitaminItem(Stats.DEFENCE) }
@JvmField
val PROTEIN = queue("protein") { VitaminItem(Stats.ATTACK) }
@JvmField
val ZINC = queue("zinc") { VitaminItem(Stats.SPECIAL_DEFENCE) }
/**
* Evolution Ores and Stones
*/
@JvmField
val DAWN_STONE_ORE = queue("dawn_stone_ore") { blockItem(CobblemonBlocks.DAWN_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
@JvmField
val DUSK_STONE_ORE = queue("dusk_stone_ore") { blockItem(CobblemonBlocks.DUSK_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
@JvmField
val FIRE_STONE_ORE = queue("fire_stone_ore") { blockItem(CobblemonBlocks.FIRE_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
@JvmField
val ICE_STONE_ORE = queue("ice_stone_ore") { blockItem(CobblemonBlocks.ICE_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
@JvmField
val LEAF_STONE_ORE = queue("leaf_stone_ore") { blockItem(CobblemonBlocks.LEAF_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
@JvmField
val MOON_STONE_ORE = queue("moon_stone_ore") { blockItem(CobblemonBlocks.MOON_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
@JvmField
val SHINY_STONE_ORE = queue("shiny_stone_ore") { blockItem(CobblemonBlocks.SHINY_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
@JvmField
val SUN_STONE_ORE = queue("sun_stone_ore") { blockItem(CobblemonBlocks.SUN_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
@JvmField
val THUNDER_STONE_ORE = queue("thunder_stone_ore") { blockItem(CobblemonBlocks.THUNDER_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
@JvmField
val WATER_STONE_ORE = queue("water_stone_ore") { blockItem(CobblemonBlocks.WATER_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
@JvmField
val DEEPSLATE_DAWN_STONE_ORE = queue("deepslate_dawn_stone_ore") { blockItem(CobblemonBlocks.DEEPSLATE_DAWN_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
@JvmField
val DEEPSLATE_DUSK_STONE_ORE = queue("deepslate_dusk_stone_ore") { blockItem(CobblemonBlocks.DEEPSLATE_DUSK_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
@JvmField
val DEEPSLATE_FIRE_STONE_ORE = queue("deepslate_fire_stone_ore") { blockItem(CobblemonBlocks.DEEPSLATE_FIRE_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
@JvmField
val DEEPSLATE_ICE_STONE_ORE = queue("deepslate_ice_stone_ore") { blockItem(CobblemonBlocks.DEEPSLATE_ICE_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
@JvmField
val DEEPSLATE_LEAF_STONE_ORE = queue("deepslate_leaf_stone_ore") { blockItem(CobblemonBlocks.DEEPSLATE_LEAF_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
@JvmField
val DEEPSLATE_MOON_STONE_ORE = queue("deepslate_moon_stone_ore") { blockItem(CobblemonBlocks.DEEPSLATE_MOON_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
@JvmField
val DEEPSLATE_SHINY_STONE_ORE = queue("deepslate_shiny_stone_ore") { blockItem(CobblemonBlocks.DEEPSLATE_SHINY_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
@JvmField
val DEEPSLATE_SUN_STONE_ORE = queue("deepslate_sun_stone_ore") { blockItem(CobblemonBlocks.DEEPSLATE_SUN_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
@JvmField
val DEEPSLATE_THUNDER_STONE_ORE = queue("deepslate_thunder_stone_ore") { blockItem(CobblemonBlocks.DEEPSLATE_THUNDER_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
@JvmField
val DEEPSLATE_WATER_STONE_ORE = queue("deepslate_water_stone_ore") { blockItem(CobblemonBlocks.DEEPSLATE_WATER_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
@JvmField
val DRIPSTONE_MOON_STONE_ORE = queue("dripstone_moon_stone_ore") { blockItem(CobblemonBlocks.DRIPSTONE_MOON_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
val DAWN_STONE = queue("dawn_stone") { evolutionItem() }
val DUSK_STONE = queue("dusk_stone") { evolutionItem() }
val FIRE_STONE = queue("fire_stone") { evolutionItem() }
val ICE_STONE = queue("ice_stone") { evolutionItem() }
val LEAF_STONE = queue("leaf_stone") { evolutionItem() }
val MOON_STONE = queue("moon_stone") { evolutionItem() }
val SHINY_STONE = queue("shiny_stone") { evolutionItem() }
val SUN_STONE = queue("sun_stone") { evolutionItem() }
val THUNDER_STONE = queue("thunder_stone") { evolutionItem() }
val WATER_STONE = queue("water_stone") { evolutionItem() }
@JvmField
val DAWN_STONE = this.evolutionItem("dawn_stone")
@JvmField
val DUSK_STONE = this.evolutionItem("dusk_stone")
@JvmField
val FIRE_STONE = this.evolutionItem("fire_stone")
@JvmField
val ICE_STONE = this.evolutionItem("ice_stone")
@JvmField
val LEAF_STONE = this.evolutionItem("leaf_stone")
@JvmField
val MOON_STONE = this.evolutionItem("moon_stone")
@JvmField
val SHINY_STONE = this.evolutionItem("shiny_stone")
@JvmField
val SUN_STONE = this.evolutionItem("sun_stone")
@JvmField
val THUNDER_STONE = this.evolutionItem("thunder_stone")
@JvmField
val WATER_STONE = this.evolutionItem("water_stone")
// Held Items
@JvmField
val ASSAULT_VEST = this.heldItem("assault_vest")
@JvmField
val BIG_ROOT = this.heldItem("big_root")
@JvmField
val BLACK_BELT = this.heldItem("black_belt")
@JvmField
val BLACK_GLASSES = this.heldItem("black_glasses")
@JvmField
val BLACK_SLUDGE = this.heldItem("black_sludge")
@JvmField
val CHARCOAL = this.heldItem("charcoal_stick", remappedName = "charcoal")
@JvmField
val CHOICE_BAND = this.heldItem("choice_band")
@JvmField
val CHOICE_SCARF = this.heldItem("choice_scarf")
@JvmField
val CHOICE_SPECS = this.heldItem("choice_specs")
@JvmField
val DRAGON_FANG = this.heldItem("dragon_fang")
@JvmField
val EXP_SHARE = this.heldItem("exp_share")
@JvmField
val FOCUS_BAND = this.heldItem("focus_band")
@JvmField
val HARD_STONE = this.heldItem("hard_stone")
@JvmField
val HEAVY_DUTY_BOOTS = this.heldItem("heavy_duty_boots")
@JvmField
val LEFTOVERS = this.heldItem("leftovers")
@JvmField
val LIGHT_CLAY = this.heldItem("light_clay")
@JvmField
val LUCKY_EGG = this.heldItem("lucky_egg")
@JvmField
val MAGNET = this.heldItem("magnet")
@JvmField
val MIRACLE_SEED = this.heldItem("miracle_seed")
@JvmField
val MUSCLE_BAND = this.heldItem("muscle_band")
@JvmField
val MYSTIC_WATER = this.heldItem("mystic_water")
@JvmField
val NEVER_MELT_ICE = this.heldItem("never_melt_ice")
@JvmField
val POISON_BARB = this.heldItem("poison_barb")
@JvmField
val QUICK_CLAW = this.heldItem("quick_claw")
@JvmField
val ROCKY_HELMET = this.heldItem("rocky_helmet")
@JvmField
val SAFETY_GOGGLES = this.heldItem("safety_goggles")
@JvmField
val SHARP_BEAK = this.heldItem("sharp_beak")
@JvmField
val SILK_SCARF = this.heldItem("silk_scarf")
@JvmField
val SILVER_POWDER = this.heldItem("silver_powder")
@JvmField
val SOFT_SAND = this.heldItem("soft_sand")
@JvmField
val SPELL_TAG = this.heldItem("spell_tag")
@JvmField
val TWISTED_SPOON = this.heldItem("twisted_spoon")
@JvmField
val WISE_GLASSES = this.heldItem("wise_glasses")
// Misc
@JvmField
val POKEMON_MODEL = queue("pokemon_model") { PokemonItem() }
fun pokeballs(): List<RegistrySupplier<PokeBallItem>> = this.pokeballs
@@ -172,9 +381,7 @@ object CobblemonItems : CompletableRegistry<Item>(Registry.ITEM_KEY) {
return AliasedBlockItem(block, Item.Settings().group(tab))
}
private fun evolutionItem(): CobblemonItem {
return CobblemonItem(Item.Settings().group(CobblemonItemGroups.EVOLUTION_ITEM_GROUP))
}
private fun evolutionItem(name: String) = queue(name) { CobblemonItem(Item.Settings().group(CobblemonItemGroups.EVOLUTION_ITEM_GROUP)) }
private fun pokeballItem(pokeBall: PokeBall): RegistrySupplier<PokeBallItem> {
val supplier = this.queue(pokeBall.name.path) { PokeBallItem(pokeBall) }
@@ -183,4 +390,11 @@ object CobblemonItems : CompletableRegistry<Item>(Registry.ITEM_KEY) {
return supplier
}
private fun heldItem(name: String, remappedName: String? = null): RegistrySupplier<CobblemonItem> = queue(name) {
val item = CobblemonItem(Item.Settings().group(CobblemonItemGroups.HELD_ITEM_GROUP))
if (remappedName != null) {
CobblemonHeldItemManager.registerRemap(item, remappedName)
}
return@queue item
}
}
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -28,30 +28,15 @@ import com.cobblemon.mod.common.net.messages.client.battle.BattleSetTeamPokemonP
import com.cobblemon.mod.common.net.messages.client.battle.BattleSwitchPokemonPacket
import com.cobblemon.mod.common.net.messages.client.battle.BattleUpdateTeamPokemonPacket
import com.cobblemon.mod.common.net.messages.client.battle.ChallengeNotificationPacket
import com.cobblemon.mod.common.net.messages.client.data.AbilityRegistrySyncPacket
import com.cobblemon.mod.common.net.messages.client.data.MovesRegistrySyncPacket
import com.cobblemon.mod.common.net.messages.client.data.*
import com.cobblemon.mod.common.net.messages.client.data.PropertiesCompletionRegistrySyncPacket
import com.cobblemon.mod.common.net.messages.client.data.SpeciesRegistrySyncPacket
import com.cobblemon.mod.common.net.messages.client.pokemon.update.AbilityUpdatePacket
import com.cobblemon.mod.common.net.messages.client.pokemon.update.AspectsUpdatePacket
import com.cobblemon.mod.common.net.messages.client.pokemon.update.BenchedMovesUpdatePacket
import com.cobblemon.mod.common.net.messages.client.pokemon.update.CaughtBallUpdatePacket
import com.cobblemon.mod.common.net.messages.client.pokemon.update.EVsUpdatePacket
import com.cobblemon.mod.common.net.messages.client.pokemon.update.ExperienceUpdatePacket
import com.cobblemon.mod.common.net.messages.client.pokemon.update.FriendshipUpdatePacket
import com.cobblemon.mod.common.net.messages.client.pokemon.update.GenderUpdatePacket
import com.cobblemon.mod.common.net.messages.client.pokemon.update.HealthUpdatePacket
import com.cobblemon.mod.common.net.messages.client.pokemon.update.IVsUpdatePacket
import com.cobblemon.mod.common.net.messages.client.pokemon.update.MoveSetUpdatePacket
import com.cobblemon.mod.common.net.messages.client.pokemon.update.NatureUpdatePacket
import com.cobblemon.mod.common.net.messages.client.pokemon.update.PokemonStateUpdatePacket
import com.cobblemon.mod.common.net.messages.client.pokemon.update.ShinyUpdatePacket
import com.cobblemon.mod.common.net.messages.client.pokemon.update.SpeciesUpdatePacket
import com.cobblemon.mod.common.net.messages.client.pokemon.update.StatusUpdatePacket
import com.cobblemon.mod.common.net.messages.client.effect.SpawnSnowstormParticlePacket
import com.cobblemon.mod.common.net.messages.client.pokemon.update.*
import com.cobblemon.mod.common.net.messages.client.pokemon.update.evolution.AddEvolutionPacket
import com.cobblemon.mod.common.net.messages.client.pokemon.update.evolution.ClearEvolutionsPacket
import com.cobblemon.mod.common.net.messages.client.pokemon.update.evolution.RemoveEvolutionPacket
import com.cobblemon.mod.common.net.messages.client.settings.ServerSettingsPacket
import com.cobblemon.mod.common.net.messages.client.sound.UnvalidatedPlaySoundS2CPacket
import com.cobblemon.mod.common.net.messages.client.starter.OpenStarterUIPacket
import com.cobblemon.mod.common.net.messages.client.starter.SetClientPlayerDataPacket
import com.cobblemon.mod.common.net.messages.client.storage.RemoveClientPokemonPacket
@@ -66,6 +51,7 @@ import com.cobblemon.mod.common.net.messages.client.storage.pc.MoveClientPCPokem
import com.cobblemon.mod.common.net.messages.client.storage.pc.OpenPCPacket
import com.cobblemon.mod.common.net.messages.client.storage.pc.SetPCBoxPokemonPacket
import com.cobblemon.mod.common.net.messages.client.storage.pc.SetPCPokemonPacket
import com.cobblemon.mod.common.net.messages.client.ui.InteractPokemonUIPacket
import com.cobblemon.mod.common.net.messages.client.ui.SummaryUIPacket
import com.cobblemon.mod.common.net.messages.server.BattleChallengePacket
import com.cobblemon.mod.common.net.messages.server.BenchMovePacket
@@ -73,17 +59,14 @@ import com.cobblemon.mod.common.net.messages.server.RequestMoveSwapPacket
import com.cobblemon.mod.common.net.messages.server.SelectStarterPacket
import com.cobblemon.mod.common.net.messages.server.SendOutPokemonPacket
import com.cobblemon.mod.common.net.messages.server.battle.BattleSelectActionsPacket
import com.cobblemon.mod.common.net.messages.server.pokemon.interact.InteractPokemonPacket
import com.cobblemon.mod.common.net.messages.server.pokemon.update.evolution.AcceptEvolutionPacket
import com.cobblemon.mod.common.net.messages.server.starter.RequestStarterScreenPacket
import com.cobblemon.mod.common.net.messages.server.storage.SwapPCPartyPokemonPacket
import com.cobblemon.mod.common.net.messages.server.storage.party.MovePartyPokemonPacket
import com.cobblemon.mod.common.net.messages.server.storage.party.ReleasePartyPokemonPacket
import com.cobblemon.mod.common.net.messages.server.storage.party.SwapPartyPokemonPacket
import com.cobblemon.mod.common.net.messages.server.storage.pc.MovePCPokemonPacket
import com.cobblemon.mod.common.net.messages.server.storage.pc.MovePCPokemonToPartyPacket
import com.cobblemon.mod.common.net.messages.server.storage.pc.MovePartyPokemonToPCPacket
import com.cobblemon.mod.common.net.messages.server.storage.pc.ReleasePCPokemonPacket
import com.cobblemon.mod.common.net.messages.server.storage.pc.SwapPCPokemonPacket
import com.cobblemon.mod.common.net.messages.server.storage.pc.*
import com.cobblemon.mod.common.util.getServer
import java.util.concurrent.CompletableFuture
import net.minecraft.server.network.ServerPlayerEntity
@@ -148,6 +131,7 @@ object CobblemonNetwork {
buildClientMessage<AbilityUpdatePacket>()
buildClientMessage<EVsUpdatePacket>()
buildClientMessage<IVsUpdatePacket>()
buildClientMessage<HeldItemUpdatePacket>()
// Evolution start
buildClientMessage<AddEvolutionPacket>()
@@ -175,6 +159,7 @@ object CobblemonNetwork {
// UI Packets
buildClientMessage<SummaryUIPacket>()
buildClientMessage<InteractPokemonUIPacket>()
// Starter packets
buildClientMessage<OpenStarterUIPacket>()
@@ -202,11 +187,18 @@ object CobblemonNetwork {
buildClientMessage<ServerSettingsPacket>()
// Data registries
buildClientMessage<UnlockReloadPacket>()
buildClientMessage<AbilityRegistrySyncPacket>()
buildClientMessage<MovesRegistrySyncPacket>()
buildClientMessage<SpeciesRegistrySyncPacket>()
buildClientMessage<PropertiesCompletionRegistrySyncPacket>()
// Effects
buildClientMessage<SpawnSnowstormParticlePacket>()
// Hax
buildClientMessage<UnvalidatedPlaySoundS2CPacket>()
/**
* Server Packets
*/
@@ -216,6 +208,9 @@ object CobblemonNetwork {
buildServerMessage<AcceptEvolutionPacket>()
// Evolution End
// Interaction Packets
buildServerMessage<InteractPokemonPacket>()
// Storage Packets
buildServerMessage<SendOutPokemonPacket>()
buildServerMessage<RequestMoveSwapPacket>()
@@ -226,6 +221,7 @@ object CobblemonNetwork {
buildServerMessage<MovePartyPokemonToPCPacket>()
buildServerMessage<ReleasePartyPokemonPacket>()
buildServerMessage<ReleasePCPokemonPacket>()
buildServerMessage<UnlinkPlayerFromPCPacket>()
// Starter packets
buildServerMessage<SelectStarterPacket>()
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -16,12 +16,42 @@ import net.minecraft.util.registry.Registry
object CobblemonSounds : CompletableRegistry<SoundEvent>(Registry.SOUND_EVENT_KEY) {
private fun queue(name: String) = queue(name) { SoundEvent(cobblemonResource(name)) }
@JvmField
val GUI_CLICK = queue("gui.click")
@JvmField
val PC_ON = queue("pc.on")
@JvmField
val PC_OFF = queue("pc.off")
@JvmField
val PC_GRAB = queue("pc.grab")
@JvmField
val PC_DROP = queue("pc.drop")
@JvmField
val PC_RELEASE = queue("pc.release")
@JvmField
val HEALING_MACHINE_ACTIVE = queue("healing_machine.active")
@JvmField
val POKE_BALL_CAPTURE_STARTED = queue("poke_ball.capture_started")
@JvmField
val POKE_BALL_CAPTURE_SUCCEEDED = queue("poke_ball.capture_succeeded")
@JvmField
val POKE_BALL_SHAKE = queue("poke_ball.shake")
@JvmField
val POKE_BALL_OPEN = queue("poke_ball.open")
@JvmField
val POKE_BALL_HIT = queue("poke_ball.hit")
@JvmField
val POKE_BALL_SEND_OUT = queue("poke_ball.send_out")
@JvmField
val POKE_BALL_RECALL = queue("poke_ball.recall")
@JvmField
val ITEM_USE = queue("item.use")
@JvmField
val CAN_EVOLVE = queue("pokemon.can_evolve")
@JvmField
val EVOLVING = queue("pokemon.evolving")
}
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -18,7 +18,8 @@ package com.cobblemon.mod.common.api
*/
open class PrioritizedList<T> : Iterable<T> {
protected val priorityMap = mutableMapOf<Priority, MutableList<T>>()
protected val ordered = mutableListOf<T>()
// Please don't change arraylist, we need insertion order
protected val ordered = arrayListOf<T>()
val mapping: Map<Priority, List<T>>
get() = priorityMap.toMap()
@@ -31,7 +32,8 @@ open class PrioritizedList<T> : Iterable<T> {
}
fun add(priority: Priority, value: T) {
priorityMap.putIfAbsent(priority, mutableListOf())
// Please don't change arraylist, we need insertion order
priorityMap.putIfAbsent(priority, arrayListOf())
priorityMap[priority]?.add(value)
reorder()
}
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -9,64 +9,41 @@
package com.cobblemon.mod.common.api.abilities
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.api.data.JsonDataRegistry
import com.cobblemon.mod.common.api.data.DataRegistry
import com.cobblemon.mod.common.api.reactive.SimpleObservable
import com.cobblemon.mod.common.battles.runner.ShowdownService
import com.cobblemon.mod.common.net.messages.client.data.AbilityRegistrySyncPacket
import com.cobblemon.mod.common.pokemon.abilities.HiddenAbilityType
import com.cobblemon.mod.common.util.asTranslated
import com.cobblemon.mod.common.util.cobblemonResource
import com.google.gson.Gson
import com.google.gson.GsonBuilder
import com.google.gson.JsonDeserializationContext
import com.google.gson.JsonDeserializer
import com.google.gson.JsonElement
import com.google.gson.reflect.TypeToken
import java.lang.reflect.Type
import kotlin.io.path.Path
import net.minecraft.resource.ResourceManager
import net.minecraft.resource.ResourceType
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.text.MutableText
import net.minecraft.util.Identifier
/**
* Registry for all known Abilities
*/
object Abilities : JsonDataRegistry<AbilityTemplate> {
object Abilities : DataRegistry {
override val id = cobblemonResource("abilities")
override val type = ResourceType.SERVER_DATA
override val observable = SimpleObservable<Abilities>()
override val typeToken: TypeToken<AbilityTemplate> = TypeToken.get(AbilityTemplate::class.java)
override val resourcePath = "abilities"
override val gson: Gson = GsonBuilder()
.disableHtmlEscaping()
.setLenient()
.setPrettyPrinting()
.registerTypeAdapter(MutableText::class.java, MutableTextAdapter)
.create()
val DUMMY = AbilityTemplate(name = "dummy")
private val allAbilities = mutableListOf<AbilityTemplate>()
private val abilityMap = mutableMapOf<String, AbilityTemplate>()
object MutableTextAdapter : JsonDeserializer<MutableText> {
override fun deserialize(json: JsonElement, type: Type, ctx: JsonDeserializationContext) = json.asString.asTranslated()
}
override fun reload(data: Map<Identifier, AbilityTemplate>) {
override fun reload(manager: ResourceManager) {
PotentialAbility.types.clear()
PotentialAbility.types.add(CommonAbilityType)
PotentialAbility.types.add(HiddenAbilityType)
allAbilities.clear()
abilityMap.clear()
data.forEach { (identifier, abilityTemplate) ->
allAbilities.add(abilityTemplate)
abilityMap[identifier.path] = abilityTemplate
this.abilityMap.clear()
val abilitiesJson = ShowdownService.get().getAbilityIds()
for (i in 0 until abilitiesJson.size()) {
val id = abilitiesJson[i].asString
val ability = AbilityTemplate(id)
this.register(ability)
}
Cobblemon.LOGGER.info("Loaded {} abilities", this.allAbilities.size)
Cobblemon.LOGGER.info("Loaded {} abilities", this.abilityMap.size)
this.observable.emit(this)
}
@@ -75,14 +52,19 @@ object Abilities : JsonDataRegistry<AbilityTemplate> {
}
fun register(ability: AbilityTemplate): AbilityTemplate {
abilityMap[ability.name.lowercase()] = ability
allAbilities.add(ability)
this.abilityMap[ability.name.lowercase()] = ability
return ability
}
fun all() = allAbilities.toList()
fun first() = allAbilities.first()
fun all() = this.abilityMap.values.toList()
fun first() = this.abilityMap.values.first()
fun get(name: String) = abilityMap[name.lowercase()]
fun getOrException(name: String) = get(name)!!
fun count() = allAbilities.size
fun getOrException(name: String) = get(name) ?: throw IllegalArgumentException("Unable to find ability of name: $name")
fun count() = this.abilityMap.size
internal fun receiveSyncPacket(abilities: Collection<AbilityTemplate>) {
this.abilityMap.clear()
abilities.forEach { ability -> this.register(ability) }
}
}
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -8,10 +8,10 @@
package com.cobblemon.mod.common.api.abilities
import com.cobblemon.mod.common.api.Priority
import com.cobblemon.mod.common.util.DataKeys
import com.google.gson.JsonObject
import net.minecraft.nbt.NbtCompound
import net.minecraft.text.MutableText
/**
* Representing an Ability with all its attributes
@@ -21,27 +21,60 @@ import net.minecraft.text.MutableText
* @author Qu
* @since January 9th, 2022
*/
open class Ability internal constructor(var template: AbilityTemplate) {
open class Ability internal constructor(var template: AbilityTemplate, var forced: Boolean) {
val name: String
get() = template.name
val displayName: MutableText
val displayName: String
get() = template.displayName
val description: MutableText
val description: String
get() = template.description
/**
* This represents the last known index of this backing ability in the species data.
* If -1 the ability will attempt to find the correct index or reroll itself, this is done in order to be compatible with existing data
* The value can be mutated however this is not recommended by API users.
*/
var index: Int = -1
/**
* The last known priority of this ability in the species data.
* The value can be mutated however this is not recommended by API users.
*/
var priority = Priority.LOWEST
open fun saveToNBT(nbt: NbtCompound): NbtCompound {
nbt.putString(DataKeys.POKEMON_ABILITY_NAME, name)
nbt.putBoolean(DataKeys.POKEMON_ABILITY_FORCED, forced)
nbt.putInt(DataKeys.POKEMON_ABILITY_INDEX, index)
nbt.putString(DataKeys.POKEMON_ABILITY_PRIORITY, priority.name)
return nbt
}
open fun saveToJSON(json: JsonObject): JsonObject {
json.addProperty(DataKeys.POKEMON_ABILITY_NAME, name)
json.addProperty(DataKeys.POKEMON_ABILITY_FORCED, forced)
json.addProperty(DataKeys.POKEMON_ABILITY_INDEX, index)
json.addProperty(DataKeys.POKEMON_ABILITY_PRIORITY, priority.name)
return json
}
open fun loadFromNBT(nbt: NbtCompound) = this
open fun loadFromJSON(json: JsonObject) = this
open fun loadFromNBT(nbt: NbtCompound): Ability {
forced = nbt.getBoolean(DataKeys.POKEMON_ABILITY_FORCED)
if (nbt.contains(DataKeys.POKEMON_ABILITY_INDEX) && nbt.contains(DataKeys.POKEMON_ABILITY_PRIORITY)) {
this.index = nbt.getInt(DataKeys.POKEMON_ABILITY_INDEX)
this.priority = Priority.valueOf(nbt.getString(DataKeys.POKEMON_ABILITY_PRIORITY))
}
return this
}
open fun loadFromJSON(json: JsonObject): Ability {
forced = json.get(DataKeys.POKEMON_ABILITY_FORCED)?.asBoolean ?: false
if (json.has(DataKeys.POKEMON_ABILITY_INDEX) && json.has(DataKeys.POKEMON_ABILITY_PRIORITY)) {
this.index = json.get(DataKeys.POKEMON_ABILITY_INDEX).asInt
this.priority = Priority.valueOf(json.get(DataKeys.POKEMON_ABILITY_PRIORITY).asString)
}
return this
}
}
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -22,15 +22,17 @@ import com.cobblemon.mod.common.pokemon.Species
* @since July 28th, 2022
*/
open class AbilityPool : PrioritizedList<PotentialAbility>() {
fun select(species: Species, aspects: Set<String>): Ability {
fun select(species: Species, aspects: Set<String>): Pair<Ability, Priority> {
for (priority in Priority.values()) {
val potentialAbilities = priorityMap[priority]?.filter { it.isSatisfiedBy(aspects) } ?: continue
if (potentialAbilities.isNotEmpty()) {
return potentialAbilities.random().template.create()
return potentialAbilities.random().template.create() to priority
}
}
LOGGER.error("Unable to select an ability from the pool for $species and aspects: ${aspects.joinToString()}")
return Abilities.first().create()
LOGGER.error("Usually this happens when a client is doing logic it shouldn't. Please show this to the Cobblemon developers!")
Exception().printStackTrace()
return Abilities.first().create() to Priority.LOWEST
}
}
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -8,10 +8,8 @@
package com.cobblemon.mod.common.api.abilities
import com.cobblemon.mod.common.util.lang
import com.google.gson.JsonObject
import net.minecraft.nbt.NbtCompound
import net.minecraft.text.MutableText
/**
* This represents the base of an Ability.
@@ -21,14 +19,14 @@ import net.minecraft.text.MutableText
*/
class AbilityTemplate(
val name: String = "",
var builder: (AbilityTemplate) -> Ability = { Ability(it) },
val displayName: MutableText = lang("ability.$name"),
val description: MutableText = lang("ability.$name.desc")
var builder: (AbilityTemplate, forced: Boolean) -> Ability = { template, forced -> Ability(template, forced) },
val displayName: String = "cobblemon.ability.$name",
val description: String = "cobblemon.ability.$name.desc"
) {
/**
* Returns the Ability or if applicable the extension connected to this template
*/
fun create() = builder(this)
fun create(forced: Boolean = false) = builder(this, forced)
/**
@@ -36,12 +34,12 @@ class AbilityTemplate(
*
* Ability extensions need to write and read their needed data from here.
*/
fun create(nbt: NbtCompound) = builder(this).loadFromNBT(nbt)
fun create(nbt: NbtCompound) = create().loadFromNBT(nbt)
/**
* Returns the Ability and loads the given JSON object into it.
*
* Ability extensions need to write and read their needed data from here.
*/
fun create(json: JsonObject) = builder(this).loadFromJSON(json)
fun create(json: JsonObject) = create().loadFromJSON(json)
}
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -11,8 +11,9 @@ package com.cobblemon.mod.common.api.apricorn
import com.cobblemon.mod.common.CobblemonBlocks
import com.cobblemon.mod.common.CobblemonItems
import com.cobblemon.mod.common.item.ApricornItem
import com.cobblemon.mod.common.world.block.ApricornBlock
import com.cobblemon.mod.common.world.block.ApricornSaplingBlock
import com.cobblemon.mod.common.block.ApricornBlock
import com.cobblemon.mod.common.block.ApricornSaplingBlock
import net.minecraft.block.MapColor
import net.minecraft.item.BlockItem
/**
@@ -71,4 +72,14 @@ enum class Apricorn {
YELLOW -> CobblemonBlocks.YELLOW_APRICORN_SAPLING.get()
}
fun mapColor(): MapColor = when(this) {
BLACK -> MapColor.BLACK
BLUE -> MapColor.BLUE
GREEN -> MapColor.GREEN
PINK -> MapColor.PINK
RED -> MapColor.RED
WHITE -> MapColor.WHITE
YELLOW -> MapColor.YELLOW
}
}
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -0,0 +1,194 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.battles.interpreter
import com.cobblemon.mod.common.api.battles.model.PokemonBattle
import com.cobblemon.mod.common.api.battles.model.actor.BattleActor
import com.cobblemon.mod.common.battles.ActiveBattlePokemon
/**
* A class responsible for parsing a raw simulator protocol message received from Showdown.
* For more information see the [Showdown protocol](https://github.com/smogon/pokemon-showdown/blob/master/sim/SIM-PROTOCOL.md).
*
* @constructor Creates a battle message with the given raw message.
*
* @param rawMessage The raw message received from Showdown.
*
* @author Licious
* @since December 31st, 2022
*/
class BattleMessage(rawMessage: String) {
/**
* The ID of the action received in the message.
*/
var id = ""
private set
/**
* The raw message received.
*/
var rawMessage: String = rawMessage
private set
/**
* A collection of the individual arguments the message had.
*/
private val args = arrayListOf<String>()
/**
* A collection of the optional arguments the message had.
*/
private val optionalArguments = hashMapOf<String, String>()
/**
* Pattern to match the start of an optional argument.
*/
private val optionalArgumentMatcher = Regex("^\\$OPTIONAL_ARG_START([^]]+)$OPTIONAL_ARG_END")
init {
this.parse(rawMessage)
}
/**
* Get an argument at the given [index].
*
* @param index The index of the expected argument.
* @return The argument if existing or null.
*/
fun argumentAt(index: Int): String? = this.args.getOrNull(index)
/**
* Get an optional argument with the given [name].
* This returns the data of the argument only.
*
* @param name The name of the optional argument.
* @return The argument data if existing or null.
*/
fun optionalArgument(name: String): String? = this.optionalArguments[name.lowercase()]
/**
* Checks if an optional argument is present.
* [optionalArgument] is null safe, this method is meant as a way to check 'flags' as some optional arguments contain no data.
*
* @param name The name of the optional argument.
* @return True if the argument is present.
*/
fun hasOptionalArgument(name: String): Boolean = this.optionalArgument(name) != null
/**
* Clears the parsed arguments and parses the message again with the new given [rawMessage].
*
* @param rawMessage The raw message received from Showdown.
* @return This instance of the battle message updated.
*/
fun parse(rawMessage: String): BattleMessage {
var message = rawMessage.trim()
this.id = ""
this.args.clear()
this.optionalArguments.clear()
this.rawMessage = message
if (!message.startsWith(SEPARATOR) || message == SEPARATOR) {
return this
}
message = this.push(message)
this.id = message.substringBefore(SEPARATOR)
message = this.push(message)
while (message.isNotBlank()) {
val currentData = message.substringBefore(SEPARATOR)
val optionalArgumentID = this.optionalArgumentMatcher.find(currentData)
if (optionalArgumentID != null) {
val id = optionalArgumentID.value.removePrefix(OPTIONAL_ARG_START).removeSuffix(OPTIONAL_ARG_END).lowercase()
val value = currentData.substringAfter(optionalArgumentID.value).trim()
this.optionalArguments[id] = value
}
else {
this.args.add(currentData)
}
message = this.push(message)
}
return this
}
/**
* Queries an argument at the given [index] for a 'pnx' that will be parsed into a [BattleActor] and [ActiveBattlePokemon].
*
* @param index The index of the argument containing the [BattleActor] and [ActiveBattlePokemon].
* @param battle The [PokemonBattle] being queried.
* @return A pair of [BattleActor] and [ActiveBattlePokemon] if the argument exists and successfully parses them otherwise null.
*/
fun actorAndActivePokemon(index: Int, battle: PokemonBattle): Pair<BattleActor, ActiveBattlePokemon>? {
val pnx = this.argumentAt(index)?.takeIf { it.length >= 3 }?.substring(0, 3) ?: return null
return this.actorAndActivePokemon(pnx, battle)
}
/**
* Attempts to parse an [Effect] from an argument at the given [index].
*
* @param index The index of the expected argument.
* @return The parsed [Effect] or null.
*/
fun effectAt(index: Int): Effect? {
val data = this.argumentAt(index) ?: return null
return Effect.parse(data)
}
/**
* Attempts to parse an [Effect] from an optional argument.
*
* @param argumentName The name of the optional argument.
* @return The parsed [Effect] or null.
*/
fun effect(argumentName: String = "from"): Effect? {
val data = this.optionalArgument(argumentName) ?: return null
return Effect.parse(data)
}
/**
* Queries an optional argument with given [argumentName] for a 'pnx' that will be parsed into a [BattleActor] and [ActiveBattlePokemon].
*
* @param battle The [PokemonBattle] being queried.
* @param argumentName The name of the optional argument.
* @return A pair of [BattleActor] and [ActiveBattlePokemon] if the argument exists and successfully parses them otherwise null.
*/
fun actorAndActivePokemonFromOptional(battle: PokemonBattle, argumentName: String = "of"): Pair<BattleActor, ActiveBattlePokemon>? {
val pnx = this.optionalArgument(argumentName)?.substring(0, 3) ?: return null
return this.actorAndActivePokemon(pnx, battle)
}
/**
* Pushes the given string down into the next argument.
*
* @param message The current state of the message.
* @return A substring of [message] after the first [SEPARATOR] or empty if no [SEPARATOR] remains.
*/
private fun push(message: String): String = message.substringAfter(SEPARATOR, "")
/**
* A utility to wrap [PokemonBattle.getActorAndActiveSlotFromPNX] to make it nullable instead of throwing an exception.
*
* @param pnx The raw pnx.
* @param battle The [PokemonBattle] being queried.
* @returnA pair of [BattleActor] and [ActiveBattlePokemon] if [PokemonBattle.getActorAndActiveSlotFromPNX] executes without any exception being thrown or else null.
*/
private fun actorAndActivePokemon(pnx: String, battle: PokemonBattle): Pair<BattleActor, ActiveBattlePokemon>? = try {
battle.getActorAndActiveSlotFromPNX(pnx)
} catch (_: Exception) {
null
}
companion object {
private const val SEPARATOR = "|"
private const val OPTIONAL_ARG_START = "["
private const val OPTIONAL_ARG_END = "]"
}
}
@@ -0,0 +1,145 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.battles.interpreter
import com.cobblemon.mod.common.api.abilities.Abilities
import com.cobblemon.mod.common.api.data.ShowdownIdentifiable
import com.cobblemon.mod.common.api.moves.Moves
import com.cobblemon.mod.common.battles.interpreter.CobblemonEffect
/**
* A representation of an effect received from Showdown inside a [BattleMessage].
*
* @author Licious
* @since December 31st, 2022
*/
interface Effect {
/**
* The literal ID of this [Effect].
*/
val id: String
/**
* The [Effect.Type] of this [Effect].
*/
val type: Type
/**
* The raw literal data received when parsing this [Effect].
*/
val rawData: String
/**
* Represents the type of the [Effect].
*
* @property prefix The literal prefix used to identify the type by the Showdown simulator protocol.
*
* @author Licious
* @since December 31st, 2022
*/
enum class Type(val prefix: String) {
ABILITY("ability:"),
ITEM("item:"),
MOVE("move:"),
PURE(""),
}
companion object {
/**
* Creates an [Effect].
*
* @param id The ID of the effect, this may be validated
* @param type The [Effect.Type].
* @param rawData The received string in the battle message.
* @return An [Effect] containing the given data of the given [type].
*/
private fun of(id: String, type: Type, rawData: String): Effect = CobblemonEffect(id, type, rawData)
/**
* Creates an [Effect] with type [Effect.Type.ABILITY].
*
* @param id The ID of the effect, meant to be present in [Abilities].
* @param rawData The received string in the battle message.
* @return An [Effect] containing the given data of [Effect.Type.ABILITY].
*
* @throws IllegalArgumentException If the [id] cannot be found in the [Abilities] registry.
*/
fun ability(id: String, rawData: String): Effect {
if (Abilities.get(id) == null) {
throw IllegalArgumentException("Cannot instance ability effect with ID $id")
}
return of(id, Type.ABILITY, rawData)
}
/**
* Creates an [Effect] with type [Effect.Type.ITEM].
*
* @param id The ID of the effect. This should be trusted as Showdown keeps the held items on their end.
* @param rawData The received string in the battle message.
* @return An [Effect] containing the given data of [Effect.Type.ITEM].
*/
fun item(id: String, rawData: String): Effect = of(id, Type.ITEM, rawData)
/**
* Creates an [Effect] with type [Effect.Type.MOVE].
*
* @param id The ID of the effect, meant to be present in [Moves].
* @param rawData The received string in the battle message.
* @return An [Effect] containing the given data of [Effect.Type.MOVE].
*
* @throws IllegalArgumentException If the [id] cannot be found in the [Moves] registry.
*/
fun move(id: String, rawData: String): Effect {
if (Moves.getByName(id) == null) {
throw IllegalArgumentException("Cannot instance move effect with ID $id")
}
return of(id, Type.MOVE, rawData)
}
/**
* Creates a "pure" [Effect].
* This is the representation of a purely literal effect by Showdown.
*
* @param id The ID of the effect.
* @param rawData The received string in the battle message.
* @return An [Effect] containing the given data of [Effect.Type.PURE].
*/
fun pure(id: String, rawData: String): Effect = of(id, Type.PURE, rawData)
/**
* Parses an [Effect] from the given [rawData].
*
* @param rawData The raw data expecting to create an [Effect].
* @return The parsed [Effect] or null if the raw data is blank or the parsed effect throws an [IllegalArgumentException].
*
* @throws IllegalArgumentException if the parsed type doesn't allow the resulting ID.
*/
fun parse(rawData: String): Effect? {
if (rawData.isBlank()) {
return null
}
return try {
when {
rawData.startsWith(Type.ABILITY.prefix) -> ability(rawData.lowercase().substringAfter(Type.ABILITY.prefix).replace(ShowdownIdentifiable.REGEX, ""), rawData)
rawData.startsWith(Type.ITEM.prefix) -> item(rawData.lowercase().substringAfter(Type.ITEM.prefix).replace(ShowdownIdentifiable.REGEX, ""), rawData)
rawData.startsWith(Type.MOVE.prefix) -> move(rawData.lowercase().substringAfter(Type.MOVE.prefix).replace(ShowdownIdentifiable.REGEX, ""), rawData)
else -> pure(rawData.lowercase().replace(ShowdownIdentifiable.REGEX, ""), rawData)
}
} catch (_: Exception) {
null
}
}
}
}
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -10,29 +10,33 @@ package com.cobblemon.mod.common.api.battles.model
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.Cobblemon.LOGGER
import com.cobblemon.mod.common.Cobblemon.showdown
import com.cobblemon.mod.common.CobblemonNetwork
import com.cobblemon.mod.common.api.battles.interpreter.BattleMessage
import com.cobblemon.mod.common.api.battles.model.actor.ActorType
import com.cobblemon.mod.common.api.battles.model.actor.BattleActor
import com.cobblemon.mod.common.api.battles.model.actor.EntityBackedBattleActor
import com.cobblemon.mod.common.api.battles.model.actor.FleeableBattleActor
import com.cobblemon.mod.common.api.net.NetworkPacket
import com.cobblemon.mod.common.api.tags.CobblemonItemTags
import com.cobblemon.mod.common.api.text.red
import com.cobblemon.mod.common.api.text.yellow
import com.cobblemon.mod.common.battles.ActiveBattlePokemon
import com.cobblemon.mod.common.battles.BattleCaptureAction
import com.cobblemon.mod.common.battles.BattleFormat
import com.cobblemon.mod.common.battles.BattleRegistry
import com.cobblemon.mod.common.battles.BattleSide
import com.cobblemon.mod.common.battles.actor.PlayerBattleActor
import com.cobblemon.mod.common.battles.dispatch.BattleDispatch
import com.cobblemon.mod.common.battles.dispatch.DispatchResult
import com.cobblemon.mod.common.battles.dispatch.GO
import com.cobblemon.mod.common.battles.dispatch.WaitDispatch
import com.cobblemon.mod.common.battles.runner.ShowdownService
import com.cobblemon.mod.common.net.messages.client.battle.BattleEndPacket
import com.cobblemon.mod.common.pokemon.feature.BattleCriticalHitsFeature
import com.cobblemon.mod.common.util.DataKeys
import com.cobblemon.mod.common.pokemon.evolution.progress.DefeatEvolutionProgress
import com.cobblemon.mod.common.util.battleLang
import com.cobblemon.mod.common.util.getPlayer
import com.google.gson.JsonArray
import com.google.gson.JsonObject
import com.cobblemon.mod.common.util.party
import net.minecraft.server.network.ServerPlayerEntity
import java.util.UUID
import java.util.concurrent.ConcurrentLinkedQueue
import net.minecraft.text.Text
@@ -50,12 +54,13 @@ open class PokemonBattle(
) {
/** Whether or not logging will be silenced for this battle. */
var mute = true
init {
side1.battle = this
side2.battle = this
this.actors.forEach { actor ->
actor.pokemonList.forEach { battlePokemon ->
battlePokemon.effectedPokemon.getFeature<BattleCriticalHitsFeature>(BattleCriticalHitsFeature.ID)?.reset()
battlePokemon.criticalHits = 0
}
}
}
@@ -84,6 +89,7 @@ open class PokemonBattle(
var dispatchResult = GO
val dispatches = ConcurrentLinkedQueue<BattleDispatch>()
val afterDispatches = mutableListOf<() -> Unit>()
val captureActions = mutableListOf<BattleCaptureAction>()
@@ -148,17 +154,8 @@ open class PokemonBattle(
}
fun writeShowdownAction(vararg messages: String) {
val jsonArray = JsonArray()
for (message in messages) {
jsonArray.add(message)
}
val request = JsonObject()
request.addProperty(DataKeys.REQUEST_TYPE, DataKeys.REQUEST_BATTLE_SEND_MESSAGE)
request.addProperty(DataKeys.REQUEST_BATTLE_ID, battleId.toString())
request.add(DataKeys.REQUEST_MESSAGES, jsonArray)
val json = BattleRegistry.gson.toJson(request)
log(json)
showdown.write(json)
log(messages.joinToString("\n"))
ShowdownService.get().send(battleId, messages.toList().toTypedArray())
}
fun turn(newTurnNumber: Int) {
@@ -175,15 +172,33 @@ open class PokemonBattle(
fun end() {
ended = true
for (actor in actors) {
for (pokemon in actor.pokemonList.filter { it.health > 0 }) {
if (pokemon.facedOpponents.isNotEmpty() /* TODO exp share held item check */) {
val experience = Cobblemon.experienceCalculator.calculate(pokemon)
if (experience > 0) {
actor.awardExperience(pokemon, (experience * Cobblemon.config.experienceMultiplier).toInt())
}
Cobblemon.evYieldCalculator.calculate(pokemon).forEach { (stat, amount) ->
pokemon.originalPokemon.evs.add(stat, amount)
this.actors.forEach { actor ->
val faintedPokemons = actor.pokemonList.filter { it.health <= 0 }
actor.getSide().getOppositeSide().actors.forEach { opponent ->
val opponentNonFaintedPokemons = opponent.pokemonList.filter { it.health > 0 }
faintedPokemons.forEach { faintedPokemon ->
for (opponentPokemon in opponentNonFaintedPokemons) {
val facedFainted = opponentPokemon.facedOpponents.contains(faintedPokemon)
val defeatProgress = DefeatEvolutionProgress()
val pokemon = opponentPokemon.effectedPokemon
if (facedFainted && defeatProgress.shouldKeep(pokemon)) {
val progress = pokemon.evolutionProxy.current().progressFirstOrCreate({ it is DefeatEvolutionProgress && it.currentProgress().target.matches(faintedPokemon.effectedPokemon) }) { defeatProgress }
progress.updateProgress(DefeatEvolutionProgress.Progress(progress.currentProgress().target, progress.currentProgress().amount + 1))
}
val multiplier = when {
// ToDo when Exp. All is implement if enabled && !facedFainted return 2.0, probably should be a configurable value too, this will have priority over the Exp. Share
!facedFainted && pokemon.heldItemNoCopy().isIn(CobblemonItemTags.EXPERIENCE_SHARE) -> Cobblemon.config.experienceShareMultiplier
// ToDo when Exp. All is implemented the facedFainted and else can be collapsed into the 1.0 return value
facedFainted -> 1.0
else -> continue
}
val experience = Cobblemon.experienceCalculator.calculate(opponentPokemon, faintedPokemon, multiplier)
if (experience > 0) {
opponent.awardExperience(opponentPokemon, experience)
}
Cobblemon.evYieldCalculator.calculate(opponentPokemon).forEach { (stat, amount) ->
pokemon.evs.add(stat, amount)
}
}
}
}
@@ -208,6 +223,20 @@ open class PokemonBattle(
sendSpectatorUpdate(packet)
}
/**
* Sends a packet depending on the side of an actor.
*
* @param source The actor that triggered the necessity for this update.
* @param allyPacket The packet sent to the [source] and their allies.
* @param opponentPacket The packet sent to the opposing actors.
* @param spectatorsAsAlly If the spectators receive the [allyPacket] or the [opponentPacket], default is false.
*/
fun sendSidedUpdate(source: BattleActor, allyPacket: NetworkPacket, opponentPacket: NetworkPacket, spectatorsAsAlly: Boolean = false) {
source.getSide().actors.forEach { it.sendUpdate(allyPacket) }
source.getSide().getOppositeSide().actors.forEach { it.sendUpdate(opponentPacket) }
sendSpectatorUpdate(if (spectatorsAsAlly) allyPacket else opponentPacket)
}
fun sendToActors(packet: NetworkPacket) {
CobblemonNetwork.sendToPlayers(actors.flatMap { it.getPlayerUUIDs().mapNotNull { it.getPlayer() } }, packet)
}
@@ -232,6 +261,13 @@ open class PokemonBattle(
}
}
fun dispatchWaiting(delaySeconds: Float = 1F, dispatcher: () -> Unit) {
dispatch {
dispatcher()
WaitDispatch(delaySeconds)
}
}
fun dispatchInsert(dispatcher: () -> Iterable<BattleDispatch>) {
dispatch {
val newDispatches = dispatcher()
@@ -247,12 +283,21 @@ open class PokemonBattle(
dispatches.add(dispatcher)
}
fun doWhenClear(action: () -> Unit) {
afterDispatches.add(action)
}
fun tick() {
while (dispatchResult.canProceed()) {
val dispatch = dispatches.poll() ?: break
dispatchResult = dispatch(this)
}
if (dispatches.isEmpty()) {
afterDispatches.toList().forEach { it() }
afterDispatches.clear()
}
if (started && isPvW && !ended) {
checkFlee()
}
@@ -264,15 +309,18 @@ open class PokemonBattle(
.filterIsInstance<FleeableBattleActor>()
.filter { it.getWorldAndPosition() != null }
.none { pokemonActor ->
val (world, pos) = pokemonActor.getWorldAndPosition()!!
val nearestPlayerActorDistance = actors
.filter { it.type == ActorType.PLAYER }
.filterIsInstance<EntityBackedBattleActor<*>>()
.mapNotNull { it.entity }
.filter { it.world == world }
.minOfOrNull { pos.distanceTo(it.pos) }
if (pokemonActor.fleeDistance == -1F) true
else {
val (world, pos) = pokemonActor.getWorldAndPosition()!!
val nearestPlayerActorDistance = actors.asSequence()
.filter { it.type == ActorType.PLAYER }
.filterIsInstance<EntityBackedBattleActor<*>>()
.mapNotNull { it.entity }
.filter { it.world == world }
.minOfOrNull { pos.distanceTo(it.pos) }
nearestPlayerActorDistance != null && nearestPlayerActorDistance < pokemonActor.fleeDistance
nearestPlayerActorDistance != null && nearestPlayerActorDistance < pokemonActor.fleeDistance
}
}
if (wildPokemonOutOfRange) {
@@ -293,4 +341,36 @@ open class PokemonBattle(
actors.forEach { it.responses.clear() ; it.request = null }
}
}
/**
* Creates a [Text] representation of an error to interpret a battle message.
* This also logs the error, the goal of this function is to make sure users see missing interpretations and report them to us.
* Logging is independent of [mute].
*
* @param message The [BattleMessage] that wasn't able to find a lang interpretation.
* @return The generated [Text] meant to notify the client.
*/
internal fun createUnimplemented(message: BattleMessage): Text {
LOGGER.error("Missing interpretation on '{}' action {}", message.id, message.rawMessage)
return Text.literal("Missing interpretation on '${message.id}' action ${message.rawMessage}").red()
}
/**
* A variant of [createUnimplemented].
* This will log both the public and private message however the clients will no longer receive the full raw message in order to prevent extra information they shouldn't see.
*
* @param publicMessage The public variant of [BattleMessage] that wasn't able to find a lang interpretation.
* @param privateMessage The private variant of [BattleMessage] that wasn't able to find a lang interpretation.
* @return The generated [Text] meant to notify the client.
*
* @throws IllegalArgumentException if the [publicMessage] and [privateMessage] don't have a matching [BattleMessage.id].
*/
internal fun createUnimplementedSplit(publicMessage: BattleMessage, privateMessage: BattleMessage): Text {
if (publicMessage.id != privateMessage.id) {
throw IllegalArgumentException("Messages do not match")
}
LOGGER.error("Missing interpretation on '{}' action: \nPublic » {}\nPrivate » {}", publicMessage.id, publicMessage.rawMessage, privateMessage.rawMessage)
return Text.literal("Missing interpretation on '${publicMessage.id}' action please report to the developers").red()
}
}
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -115,6 +115,16 @@ abstract class BattleActor(
}
abstract fun getName(): MutableText
/**
* Appends the given name to this owner as the prefix.
* NPC and player actors expect to append their [getName] while wild Pokémon append nothing.
*
* @param name The name of an object being appended, typically a Pokémon nickname received from showdown.
* @return A [MutableText] of the [name] append with owner prefix.
*/
abstract fun nameOwned(name: String): MutableText
open fun sendMessage(component: Text) {
sendUpdate(BattleMessagePacket(component))
}
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -0,0 +1,47 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.codec
import com.mojang.datafixers.util.Pair
import com.mojang.serialization.Codec
import com.mojang.serialization.DataResult
import com.mojang.serialization.DynamicOps
import com.mojang.serialization.codecs.PrimitiveCodec
import com.mojang.serialization.codecs.RecordCodecBuilder
import net.minecraft.network.PacketByteBuf
class MappedCodec<A : CodecMapped, K>(
val codecRetriever: (K) -> Codec<out A>,
val keyName: String = "type",
val keyFromString: (String) -> K
) : Codec<A> {
override fun <T> encode(input: A, ops: DynamicOps<T>, prefix: T): DataResult<T> {
return input.encode(ops)
}
override fun <T> decode(ops: DynamicOps<T>, input: T): DataResult<Pair<A, T>> {
val thingCodec: Codec<ThingWithType> = RecordCodecBuilder.create { instance ->
instance
.group(PrimitiveCodec.STRING.fieldOf(keyName).forGetter { it.string })
.apply(instance, ::ThingWithType)
}
val thingWithType = thingCodec.decode(ops, input).map { it.first }
val key = thingWithType.get().left().get().string
val codec = codecRetriever(keyFromString(key))
return codec.decode(ops, input).map { Pair(it.first, it.second) }
}
}
private class ThingWithType(val string: String)
interface CodecMapped {
fun <T> encode(ops: DynamicOps<T>): DataResult<T>
fun readFromBuffer(buffer: PacketByteBuf)
fun writeToBuffer(buffer: PacketByteBuf)
}
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -0,0 +1,50 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.data
import com.cobblemon.mod.common.api.codec.CodecMapped
import com.cobblemon.mod.common.api.codec.MappedCodec
import com.mojang.serialization.Codec
import java.lang.IllegalArgumentException
import net.minecraft.network.PacketByteBuf
/**
* A utility class to help give Codec support for map adapted class hierarchies.
*
* @author Hiroku
* @since January 21st, 2023
*/
abstract class ArbitrarilyMappedSerializableCompanion<T : CodecMapped, K>(
val keyFromString: (String) -> K,
val stringFromKey: (K) -> String,
val keyFromValue: (T) -> K
) {
val codec: MappedCodec<T, K> = MappedCodec(codecRetriever = { subtypes[it]!!.codec }, keyFromString = keyFromString)
private val subtypes = mutableMapOf<K, RegisteredSubtype<out T>>()
fun <E : T> registerSubtype(key: K, clazz: Class<E>, codec: Codec<E>) {
subtypes[key] = RegisteredSubtype(clazz, codec)
}
fun writeToBuffer(buffer: PacketByteBuf, value: T) {
val typeString = stringFromKey(keyFromValue(value))
buffer.writeString(typeString)
value.writeToBuffer(buffer)
}
fun readFromBuffer(buffer: PacketByteBuf): T {
val typeString = buffer.readString()
val clazz = subtypes[keyFromString(typeString)]?.clazz ?: throw IllegalArgumentException("Unrecognized subtype: $typeString")
val value = clazz.getDeclaredConstructor().newInstance()
value.readFromBuffer(buffer)
return value
}
}
class RegisteredSubtype<T>(val clazz: Class<out T>, val codec: Codec<out T>)
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -0,0 +1,32 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.data
/**
* Represents an object that has a showdown ID attached to itself.
*
* @author Licious
* @since January 28th, 2022
*/
interface ShowdownIdentifiable {
/**
* Converts the implementation to literal Showdown ID.
*
* @return The literal Showdown ID.
*/
fun showdownId(): String
companion object {
internal val REGEX = Regex("[^a-z0-9]+")
}
}
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -16,4 +16,5 @@ interface PokemonSideDelegate : EntitySideDelegate<PokemonEntity> {
fun changePokemon(pokemon: Pokemon)
fun drop(source: DamageSource?) {}
fun updatePostDeath() {}
fun handleStatus(status: Byte) {}
}
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -11,6 +11,11 @@ package com.cobblemon.mod.common.api.events
import com.cobblemon.mod.common.api.events.battles.BattleVictoryEvent
import com.cobblemon.mod.common.api.events.drops.LootDroppedEvent
import com.cobblemon.mod.common.api.events.entity.EntityAttributeEvent
import com.cobblemon.mod.common.api.events.entity.PokemonEntityLoadEvent
import com.cobblemon.mod.common.api.events.entity.PokemonEntitySaveEvent
import com.cobblemon.mod.common.api.events.entity.PokemonEntitySaveToWorldEvent
import com.cobblemon.mod.common.api.events.farming.ApricornHarvestEvent
import com.cobblemon.mod.common.api.events.item.LeftoversCreatedEvent
import com.cobblemon.mod.common.api.events.net.MessageBuiltEvent
import com.cobblemon.mod.common.api.events.pokemon.ExperienceGainedPostEvent
import com.cobblemon.mod.common.api.events.pokemon.ExperienceGainedPreEvent
@@ -24,6 +29,7 @@ import com.cobblemon.mod.common.api.events.pokemon.evolution.EvolutionCompleteEv
import com.cobblemon.mod.common.api.events.pokemon.evolution.EvolutionDisplayEvent
import com.cobblemon.mod.common.api.events.pokemon.interaction.ExperienceCandyUseEvent
import com.cobblemon.mod.common.api.events.starter.StarterChosenEvent
import com.cobblemon.mod.common.api.events.storage.ReleasePokemonEvent
import com.cobblemon.mod.common.api.reactive.CancelableObservable
import com.cobblemon.mod.common.api.reactive.EventObservable
import com.cobblemon.mod.common.api.reactive.SimpleObservable
@@ -42,41 +48,86 @@ import net.minecraft.entity.LivingEntity
import net.minecraft.server.network.ServerPlayerEntity
object CobblemonEvents {
@JvmField
val MESSAGE_BUILT = EventObservable<MessageBuiltEvent<*>>()
@JvmField
val DATA_SYNCHRONIZED = SimpleObservable<ServerPlayerEntity>()
@JvmField
val ENTITY_ATTRIBUTE = EventObservable<EntityAttributeEvent>()
@JvmField
val SHOULDER_MOUNT = CancelableObservable<ShoulderMountEvent>()
@JvmField
val FRIENDSHIP_UPDATED = EventObservable<FriendshipUpdatedEvent>()
@JvmField
val POKEMON_FAINTED = EventObservable<PokemonFaintedEvent>()
@JvmField
val EVOLUTION_ACCEPTED = CancelableObservable<EvolutionAcceptedEvent>()
@JvmField
val EVOLUTION_DISPLAY = EventObservable<EvolutionDisplayEvent>()
@JvmField
val EVOLUTION_COMPLETE = EventObservable<EvolutionCompleteEvent>()
@JvmField
val POKEMON_CAPTURED = EventObservable<PokemonCapturedEvent>()
// @JvmField
// val EGG_HATCH = EventObservable<HatchEggEvent>()
@JvmField
val BATTLE_VICTORY = EventObservable<BattleVictoryEvent>()
@JvmField
val LEVEL_UP_EVENT = EventObservable<LevelUpEvent>()
@JvmField
val POKEMON_ENTITY_SAVE = EventObservable<PokemonEntitySaveEvent>()
@JvmField
val POKEMON_ENTITY_LOAD = CancelableObservable<PokemonEntityLoadEvent>()
@JvmField
val POKEMON_ENTITY_SAVE_TO_WORLD = CancelableObservable<PokemonEntitySaveToWorldEvent>()
@JvmField
val EXPERIENCE_GAINED_EVENT_PRE = CancelableObservable<ExperienceGainedPreEvent>()
@JvmField
val EXPERIENCE_GAINED_EVENT_POST = EventObservable<ExperienceGainedPostEvent>()
@JvmField
val EXPERIENCE_CANDY_USE_PRE = CancelableObservable<ExperienceCandyUseEvent.Pre>()
@JvmField
val EXPERIENCE_CANDY_USE_POST = EventObservable<ExperienceCandyUseEvent.Post>()
@JvmField
val POKEMON_RELEASED_EVENT_PRE = CancelableObservable<ReleasePokemonEvent.Pre>()
@JvmField
val POKEMON_RELEASED_EVENT_POST = EventObservable<ReleasePokemonEvent.Post>()
@JvmField
val LOOT_DROPPED = CancelableObservable<LootDroppedEvent>()
@JvmField
val STARTER_CHOSEN = CancelableObservable<StarterChosenEvent>()
@JvmField
val APRICORN_HARVESTED = EventObservable<ApricornHarvestEvent>()
@JvmField
val LEFTOVERS_CREATED = CancelableObservable<LeftoversCreatedEvent>()
@JvmField
val SERVER_STARTING = LifecycleEvent.SERVER_STARTING.asServerObservable()
@JvmField
val SERVER_STOPPING = LifecycleEvent.SERVER_STOPPING.asServerObservable()
@JvmField
val SERVER_STARTED = LifecycleEvent.SERVER_STARTED.asServerObservable()
@JvmField
val SERVER_STOPPED = LifecycleEvent.SERVER_STOPPED.asServerObservable()
@JvmField
val TICK_PRE = TickEvent.SERVER_PRE.asTickObservable()
@JvmField
val TICK_POST = TickEvent.SERVER_POST.asTickObservable()
@JvmField
val PLAYER_JOIN = PlayerEvent.PLAYER_JOIN.asObservable<PlayerJoin, ServerPlayerEntity> { obs -> PlayerJoin { obs.emit(it) } }
@JvmField
val PLAYER_QUIT = PlayerEvent.PLAYER_QUIT.asObservable<PlayerQuit, ServerPlayerEntity> { obs -> PlayerQuit { obs.emit(it) } }
@JvmField
val LIVING_DEATH = EntityEvent.LIVING_DEATH.asObservable<LivingDeath, LivingEntity> { obs -> LivingDeath { entity, source -> obs.emit(entity); EventResult.pass() } }
}
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -0,0 +1,29 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.events.entity
import com.cobblemon.mod.common.api.events.Cancelable
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import net.minecraft.nbt.NbtCompound
/**
* An event fired when a [PokemonEntity] is being loaded from NBT. This could be from sending a Pokémon
* through a portal or saved into the world. Subscribers to this event should read from the NBT and apply
* any changes that are relevant to the entity.
*
* Cancelling this event will dispose of the Pokémon after it loads. Use this when the existence of this
* entity is no longer appropriate, such as if it was an event Pokémon that has expired.
*
* @property pokemonEntity The entity being loaded from NBT. All other native loading has been done by this time.
* @property nbt The NBT the entity is being loaded from.
*
* @author Hiroku
* @since January 7th, 2022
*/
data class PokemonEntityLoadEvent(val pokemonEntity: PokemonEntity, val nbt: NbtCompound) : Cancelable()
@@ -0,0 +1,34 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.events.entity
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import net.minecraft.nbt.NbtCompound
/**
* Event fired when a Pokémon is being saved to NBT. This could be for
* teleporting across worlds or for saving to the world or probably other
* things.
*
* This event exists so that you can save additional information about a
* Pokémon into entity NBT so that you can handle the [PokemonEntityLoadEvent]
* later and restore that unique state. For example, an entity might be some
* kind of boss, and you want to restore those properties after a world
* reload.
*
* @property pokemonEntity The Pokémon entity being saved.
* @property nbt The [NbtCompound] that the Pokémon is being saved to.
* You should add or remove from this for whatever you
* want to accomplish. The existing contents will be all
* of what Cobblemon saves natively.
*
* @author Hiroku
* @since January 6th, 2023
*/
data class PokemonEntitySaveEvent(val pokemonEntity: PokemonEntity, val nbt: NbtCompound)
@@ -0,0 +1,21 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.events.entity
import com.cobblemon.mod.common.api.events.Cancelable
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
/**
* Event fired when a Pokémon is about to be saved to the world. Cancel this event if the Pokémon
* should not be saved to the world.
*
* @author Hiroku
* @since January 7th, 2022
*/
class PokemonEntitySaveToWorldEvent(val pokemonEntity: PokemonEntity) : Cancelable()
@@ -0,0 +1,27 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.events.farming
import net.minecraft.block.BlockState
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.server.world.ServerWorld
import net.minecraft.util.math.BlockPos
/**
* Event fired when an Apricorn is harvested.
*/
class ApricornHarvestEvent(
val player: ServerPlayerEntity,
val world: ServerWorld,
val pos: BlockPos
) {
fun getBlock(): BlockState {
return world.getBlockState(pos)
}
}
@@ -0,0 +1,22 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.events.item
import com.cobblemon.mod.common.api.events.Cancelable
import net.minecraft.item.ItemStack
import net.minecraft.server.network.ServerPlayerEntity
/**
* Fired when eating an apple triggers the creation of a Leftovers. The stack that will be given
* can be changed via [leftovers]. Cancelling the event will prevent a Leftovers from being given.
*
* @author Hiroku
* @since March 11th, 2023
*/
class LeftoversCreatedEvent(val playerEntity: ServerPlayerEntity, var leftovers: ItemStack) : Cancelable()
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -15,7 +15,7 @@ import com.cobblemon.mod.common.pokemon.Pokemon
/**
* Event fired when experience is about to be gained. Cancelling this event prevents
* any experience being added, and the amount of experience cna be hcanged from [experience].
* any experience being added, and the amount of experience can be changed from [experience].
*
* @author Hiroku
* @since August 5th, 2022
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Cobblemon Contributors
* 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

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