Compare commits

...
990 Commits
Author SHA1 Message Date
Paul 8b5231d6f0 Alternative way to fix dupe issue to not crash (huge) 2023-12-01 12:07:00 +10:00
Hiroku e01bc2eeab Merge branch 'nickname_invalid_format' into '1.4.0'
Resolves a bug in the format in which the nickname is saved in JSON.

See merge request cable-mc/cobblemon!797
2023-11-26 23:19:50 +00:00
Pedro Souza f6f3070b8e changelog 2023-11-26 20:18:37 -03:00
Pedro Souza 0f2301e668 Resolved nickname invalid format bug 2023-11-26 12:24:54 -03:00
Paul e077a5d453 Not snapshot 2023-10-14 10:32:40 +10:00
Paul e7208ed396 Changelog polish 2 [skip-ci] 2023-10-14 10:31:27 +10:00
Paul 27f8bbf029 Changelog polish 2023-10-14 10:29:36 +10:00
Hiroku 2f97a69b8c Merge branch 'implement_pokemon' into 'main'
LAST MERGE REQUEST FOR ME TONIGHT? LAST MINUTE?

See merge request cable-mc/cobblemon!690
2023-10-13 23:44:13 +00:00
tyzillion 79d67389ba Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2023-10-13 19:36:11 -04:00
tyzillion 61f2150f2e Fixed Exeggcute looping faint. Fixed Baltoy texture zfighting. Fixed Wishiwashi framing. 2023-10-13 19:36:00 -04:00
tyzillion 5d63c8fe06 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-10-13 19:35:16 -04:00
Hiroku 0d109a64fd Merge branch 'scriptedDropsCSVtoJson' into 'main'
Automating the manual Drop Json editing

See merge request cable-mc/cobblemon!686
2023-10-13 23:34:54 +00:00
Hiroku 5daef700e7 Merge branch 'gimmick_data_fix' into 'main'
Remove gmax factor from natural spawns.

See merge request cable-mc/cobblemon!689
2023-10-13 23:15:18 +00:00
Paul 21bd1550f0 Fixed exeggcute and pikachu evolutions to kanto forms not undoing alolan flag 2023-10-14 09:13:28 +10:00
Segfault Guy 0d4f63ba01 Remove gmax factor from natural spawns. 2023-10-13 19:12:22 -04:00
Paul 946cff21fb Merge remote-tracking branch 'origin/main' into implement_pokemon 2023-10-14 08:43:40 +10:00
Paul 8a2291cd6e Fixed form order for exeggcute and pikachu 2023-10-14 08:43:33 +10:00
Hiroku 304ac0e07a Merge branch '1.4-fixes' into 'main'
Fixed underscores not really working as species names, fixed recalls not working (that was close)

See merge request cable-mc/cobblemon!688
2023-10-13 22:27:46 +00:00
tyzillion 3cac1138fb 😂😂😂 ˙sǝxᴉɟ uoᴉʇnloʌǝ ǝʇnuᴉɯ ʇsɐl 2023-10-13 18:05:33 -04:00
Paul b19a11f8ab Merge remote-tracking branch 'origin/main' into 1.4-fixes 2023-10-14 07:41:25 +10:00
Hiroku cad64ae24b Merge branch 'shedninja-evolution-fixes' into 'main'
Shedinja fixes

Closes #561

See merge request cable-mc/cobblemon!687
2023-10-13 21:40:23 +00:00
Paul 9036909968 Fixed underscores not really working as species names, fixed recalls not working (that was close) 2023-10-14 07:40:08 +10:00
MoeBoy76 53b98e8008 order of operations 2023-10-14 08:31:34 +11:00
MoeBoy76 574fd92827 added trigger to Shedinja evolution code and made Creative not care about Pokeballs 2023-10-14 08:06:31 +11:00
Waldleufer e6d7513c20 Merge branch 'main' into 'scriptedDropsCSVtoJson'
# Conflicts:
#   common/src/main/resources/data/cobblemon/species/generation1/golem.json
#   common/src/main/resources/data/cobblemon/species/generation1/graveler.json
#   common/src/main/resources/data/cobblemon/species/generation5/boldore.json
#   common/src/main/resources/data/cobblemon/species/generation5/gigalith.json
2023-10-13 20:47:11 +00:00
Waldleufer e36252318a Removed dangling Import. 2023-10-13 22:37:58 +02:00
Waldleufer 5d5dbb9e79 Fruits of the labor. 100% Datasheet and code consistency. 2023-10-13 22:28:04 +02:00
Hiroku 4036592c9a Merge branch 'go-to-sleep-flywheel' into 'main'
Remove flywheel, for now

See merge request cable-mc/cobblemon!684
2023-10-13 20:27:23 +00:00
Waldleufer c0ddbad4f5 Pulling fresh data from spreadsheet
Also added a printout for Troublesome IDs. (missing in the natural language to IDs map)
2023-10-13 22:19:50 +02:00
Paul fa1f485cd2 Merge remote-tracking branch 'origin/main' into go-to-sleep-flywheel
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/block/BerryEntityInstance.kt
2023-10-14 06:18:35 +10:00
Waldleufer b5aeb0e5f7 Removed debug logs. 2023-10-13 22:18:13 +02:00
Paul 9c2680783a Reapply a fix from main for when flywheel is turned back on 2023-10-14 06:09:33 +10:00
Hiroku b7ed72241b Merge branch 'berry_bugfixes' into 'main'
No longer just berry bugfixes

Closes #568

See merge request cable-mc/cobblemon!685
2023-10-13 20:07:54 +00:00
Hiroku 689f9eabc0 Merge branch 'lang-updates' into 'main'
Updated heaps of lang

See merge request cable-mc/cobblemon!670
2023-10-13 20:07:02 +00:00
Hiroku 4fd24be1d3 Merge branch '1.4-fixes' into 'main'
1.4 fixes

Closes #564, #569, #578, #573, and #576

See merge request cable-mc/cobblemon!683
2023-10-13 20:06:57 +00:00
Paul 7579203527 Merge remote-tracking branch 'origin/main' into berry_bugfixes
# Conflicts:
#	common/src/main/resources/data/cobblemon/species/generation5/boldore.json
#	common/src/main/resources/data/cobblemon/species/generation5/gigalith.json
#	common/src/main/resources/data/cobblemon/species/generation5/roggenrola.json
2023-10-14 06:04:24 +10:00
Martin Wagner 9e3dd9373c Use correct indent (2). 2023-10-13 21:44:18 +02:00
Martin Wagner c9b9ac7d07 If the spreadsheet does not contain drop data, then remove any drops. 2023-10-13 21:26:53 +02:00
Martin Wagner dddae893cd Polishing of csv to json skript 2023-10-13 19:42:17 +02:00
Lily 86508801d3 Update destiny_knot.json 2023-10-13 17:24:48 +00:00
Lily de44411ad2 added everstone drop to geodude and roggenrola lines 2023-10-13 17:17:26 +00:00
Waldleufer e59aa01345 Logging some info for testing 2023-10-13 17:46:36 +02:00
Waldleufer 3f3e8b5747 Parsing Drops from spreadsheet 2023-10-13 15:36:45 +02:00
Waldleufer bb769fa165 get list of all files we need to change. 2023-10-13 14:15:14 +02:00
Waldleufer 163218c0a8 Creation of a python script to automate drop configuration 2023-10-13 14:07:16 +02:00
Paul e61eadb834 Will this make the license thing shut up no.2 2023-10-13 20:21:19 +10:00
Paul 29c8bbe9e9 Will this make the license thing shut up 2023-10-13 18:27:38 +10:00
Paul 7c42390515 Keep the license bit in here mate that's alright 2023-10-13 18:06:33 +10:00
Paul ff84ca69cd Updated pt_br and zh_cn 2023-10-13 15:33:22 +10:00
Paul dda3c4e981 Merge branch 'main' into lang-updates 2023-10-13 15:28:30 +10:00
Paul 072ad5ff12 Fixed Haban hitbox, fixed one weird Pomeg berry placement 2023-10-13 15:27:22 +10:00
Paul 1570bbf42b Remove flywheel, for now 2023-10-13 14:59:23 +10:00
Paul 41cfe79b0e Updated mutations for Haban, Sitrus, Hopo. Closes #576 2023-10-13 09:28:57 +10:00
Paul dc4e3dc39c Added 'biomeAnticondition' to BiomeRequirement, closes #573 2023-10-13 09:18:31 +10:00
Paul d100537d41 Changed hide overlay default keybind from P to O, closes #578 2023-10-13 09:06:10 +10:00
Paul fe218399e2 Fixed possible stack overflow removing owned pokemon from the world, closes #569 2023-10-13 09:05:31 +10:00
Paul 8f4a4a7e45 Fixed flower models not showing, closes #564 2023-10-13 08:58:38 +10:00
Hiroku b3757113ac Merge branch 'pokemon-drops' into 'main'
Pokemon drops

Closes #552

See merge request cable-mc/cobblemon!678
2023-10-12 21:29:06 +00:00
Nick 3bb17ffc6e Merge branch 'pokemon-removing-fix' into 'main'
Fixes owned Pokemon not being removed, when they should.

See merge request cable-mc/cobblemon!682
2023-10-12 18:15:32 +00:00
Deltric f37924fb0c Fixes owned Pokemon not being removed, when they should. 2023-10-12 10:44:16 -05:00
Hiroku 6e2765902e Merge branch '1.4-Spawns' into 'main'
lAsT miNuTE Spawn edits.

See merge request cable-mc/cobblemon!681
2023-10-12 11:02:30 +00:00
tyzillion d7c32e4ad8 A few spawns updated. 2023-10-11 18:12:24 -04:00
tyzillion 8732094c28 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into 1.4-Spawns
# Conflicts:
#	common/src/main/resources/data/cobblemon/spawn_detail_presets/shipwreck.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0025_pikachu.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0026_raichu.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0037_vulpix.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0038_ninetales.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0043_oddish.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0044_gloom.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0052_meowth.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0053_persian.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0058_growlithe.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0059_arcanine.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0063_abra.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0064_kadabra.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0065_alakazam.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0072_tentacool.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0073_tentacruel.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0077_ponyta.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0078_rapidash.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0083_farfetchd.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0088_grimer.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0089_muk.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0090_shellder.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0091_cloyster.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0092_gastly.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0096_drowzee.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0097_hypno.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0100_voltorb.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0101_electrode.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0102_exeggcute.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0103_exeggutor.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0109_koffing.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0110_weezing.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0113_chansey.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0116_horsea.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0117_seadra.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0122_mrmime.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0124_jynx.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0132_ditto.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0133_eevee.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0134_vaporeon.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0135_jolteon.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0136_flareon.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0147_dratini.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0148_dragonair.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0149_dragonite.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0152_chikorita.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0153_bayleef.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0154_meganium.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0167_spinarak.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0168_ariados.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0170_chinchou.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0171_lanturn.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0177_natu.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0178_xatu.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0190_aipom.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0193_yanma.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0196_espeon.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0197_umbreon.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0209_snubbull.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0210_granbull.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0216_teddiursa.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0217_ursaring.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0230_kingdra.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0238_smoochum.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0241_miltank.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0242_blissey.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0261_poochyena.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0262_mightyena.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0278_wingull.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0279_pelipper.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0280_ralts.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0281_kirlia.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0282_gardevoir.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0283_surskit.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0284_masquerain.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0290_nincada.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0293_whismur.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0294_loudred.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0295_exploud.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0313_volbeat.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0314_illumise.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0343_baltoy.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0344_claydol.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0355_duskull.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0356_dusclops.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0366_clamperl.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0367_huntail.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0368_gorebyss.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0369_relicanth.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0374_beldum.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0375_metang.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0376_metagross.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0396_starly.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0397_staravia.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0398_staraptor.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0415_combee.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0416_vespiquen.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0424_ambipom.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0427_buneary.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0428_lopunny.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0439_mimejr.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0440_happiny.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0442_spiritomb.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0469_yanmega.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0470_leafeon.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0471_glaceon.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0475_gallade.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0477_dusknoir.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0506_lillipup.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0507_herdier.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0508_stoutland.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0519_pidove.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0520_tranquill.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0521_unfezant.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0532_timburr.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0533_gurdurr.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0534_conkeldurr.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0561_sigilyph.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0562_yamask.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0563_cofagrigus.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0622_golett.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0623_golurk.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0664_scatterbug.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0665_spewpa.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0666_vivillon.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0679_honedge.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0681_aegislash.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0700_sylveon.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0742_cutiefly.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0743_ribombee.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0764_comfey.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0767_wimpod.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0768_golisopod.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0778_mimikyu.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0835_yamper.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0836_boltund.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0863_perrserker.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0868_milcery.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0869_alcremie.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0870_falinks.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0901_ursaluna.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0924_tandemaus.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0925_maushold.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0926_fidough.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0927_dachsbun.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0931_squawkabilly.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0935_charcadet.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0936_armarouge.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0937_ceruledge.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0942_maschiff.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0943_mabosstiff.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0944_shroodle.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0945_grafaiai.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0974_cetoddle.json
#	common/src/main/resources/data/cobblemon/spawn_pool_world/0975_cetitan.json
#	common/src/main/resources/data/cobblemon/species/generation6/spewpa.json
#	common/src/main/resources/data/cobblemon/tags/worldgen/biome/is_beach.json
#	common/src/main/resources/data/cobblemon/tags/worldgen/biome/is_cold.json
#	common/src/main/resources/data/cobblemon/tags/worldgen/biome/is_cold_ocean.json
#	common/src/main/resources/data/cobblemon/tags/worldgen/biome/is_deep.json
#	common/src/main/resources/data/cobblemon/tags/worldgen/biome/is_desert.json
#	common/src/main/resources/data/cobblemon/tags/worldgen/biome/is_frozen.json
#	common/src/main/resources/data/cobblemon/tags/worldgen/biome/is_jungle.json
#	common/src/main/resources/data/cobblemon/tags/worldgen/biome/is_lush.json
#	common/src/main/resources/data/cobblemon/tags/worldgen/biome/is_mountain.json
#	common/src/main/resources/data/cobblemon/tags/worldgen/biome/is_mushroom.json
#	common/src/main/resources/data/cobblemon/tags/worldgen/biome/is_nether_basalt.json
#	common/src/main/resources/data/cobblemon/tags/worldgen/biome/is_nether_crimson.json
#	common/src/main/resources/data/cobblemon/tags/worldgen/biome/is_nether_fungus.json
#	common/src/main/resources/data/cobblemon/tags/worldgen/biome/is_nether_quartz.json
#	common/src/main/resources/data/cobblemon/tags/worldgen/biome/is_nether_soul_sand.json
#	common/src/main/resources/data/cobblemon/tags/worldgen/biome/is_nether_wasteland.json
#	common/src/main/resources/data/cobblemon/tags/worldgen/biome/is_ocean.json
#	common/src/main/resources/data/cobblemon/tags/worldgen/biome/is_peak.json
#	common/src/main/resources/data/cobblemon/tags/worldgen/biome/is_plains.json
#	common/src/main/resources/data/cobblemon/tags/worldgen/biome/is_plateau.json
#	common/src/main/resources/data/cobblemon/tags/worldgen/biome/is_spooky.json
#	common/src/main/resources/data/cobblemon/tags/worldgen/biome/is_spring.json
#	common/src/main/resources/data/cobblemon/tags/worldgen/biome/is_swamp.json
#	common/src/main/resources/data/cobblemon/tags/worldgen/biome/is_taiga.json
2023-10-11 18:05:10 -04:00
Hiroku 38fecf337e Merge branch 'implement_pokemon' into 'main'
Last minute Pokemon fixes and updates.

See merge request cable-mc/cobblemon!679
2023-10-11 20:44:18 +00:00
tyzillion 3c7c640217 Last minute changes? More like last minute bugs. Amiright? 2023-10-10 23:58:38 -04:00
tyzillion b7e8cad3bd Fixed Pokemon not playing faint animations if fainted while asleep. Also fixed Alolan Raichu T-posing while battling. 2023-10-10 21:34:59 -04:00
tyzillion d553332017 Fixed Icy snow and High plains Vivillon not spawning as Meadow. Also fixed Spewpa evolving into Meadow instead of Icy and High Plains. Updated Alolan Exeggutor model, animations, and texture. Updated Boltund animation, updated Raticate models and animations. Added Stufful and Bewears shiny textures. 2023-10-10 20:46:14 -04:00
Lily de04379297 fixed broken advancement for getting an apricorn sprout 2023-10-10 20:23:56 -04:00
Lily 10bf9d1abd berries will now drop when broken. Closes #568 2023-10-10 19:49:22 -04:00
Lily 03b0bb9937 a bunch of missed pokemon drops 2023-10-10 18:23:58 +00:00
Lily 51a3d686ff gen 6 drops done 2023-10-10 15:47:42 +00:00
Lily 267c14cdd5 and here's 14 more because my IDE broke again somehow 2023-10-10 15:45:39 +00:00
Lily c9367f63b4 only 6 pokemon drops because my IDE broke and i dont wanna lose these 2023-10-10 15:30:15 +00:00
Lily 48f8561662 fixed typos 2023-10-10 14:44:16 +00:00
Lily 951a36f82e gen 9 drops 2023-10-10 14:22:51 +00:00
Lily e9edd7a1e9 gen 8 drops 2023-10-10 13:52:18 +00:00
Paul cb407bb649 Convenience dataTracker function [skip-ci] 2023-10-09 16:59:00 +10:00
Hiroku 5e28612d99 Actually the dip should probably still max at 1 2023-10-09 06:07:23 +00:00
Hiroku ea007d21db Fixed braised vivichokes and vivichoke dip not stacking, closes #560 2023-10-09 06:05:09 +00:00
Paul dc1a035dae Merge remote-tracking branch 'origin/main' into 1.4-fixes-5 2023-10-09 15:12:49 +10:00
Hiroku 71db46d86b Merge branch '1.4-Spawn-Fixes' into 'main'
1.4 spawn fixes

See merge request cable-mc/cobblemon!677
2023-10-09 05:12:13 +00:00
Paul a61b71205b Struck down by licenses again 2023-10-09 14:36:42 +10:00
Paul 63b14aa4ba Fixed pokemon selection GUIs not showing aspects, closes #547 2023-10-09 11:12:42 +10:00
Hiroku fb23e3961c Merge branch '1.4-fixes-4' into 'main'
Fixed animation stacking with cries and battle animations that made Typhlosion horrifying

See merge request cable-mc/cobblemon!675
2023-10-09 00:55:23 +00:00
Paul bdf9606d61 Fixed pasture click sounds not playing / playing when they shouldn't, fixes #404 2023-10-09 10:55:07 +10:00
Paul bf5b03398c Fix fakemon breaking PCs when the addon is removed 2023-10-09 10:41:16 +10:00
Hiroku 3a824b1971 Merge branch 'mongdb-datastore' into 'main'
Implemented MongoDB support for new PlayerData props.

See merge request cable-mc/cobblemon!674
2023-10-09 00:34:44 +00:00
Paul 0bbecc5951 Fixed Ninjask T-posing in battle, closes #555 2023-10-09 10:10:23 +10:00
Paul c60fb253cd Fixed no-fallback texture situations causing crashing, closes #557 2023-10-09 09:59:18 +10:00
navneetset 34240a101a Fixed paddlin' 2023-10-09 01:58:24 +02:00
Paul c6a4db47f4 Fixed animation stacking with cries and battle animations that made Typhlosion horrifying 2023-10-09 09:33:22 +10:00
Hiroku ac2dbde41e Merge branch '1.4-fixes-3' into 'main'
1.4 fixes 3

See merge request cable-mc/cobblemon!673
2023-10-08 23:20:06 +00:00
navneetset b8d19b3c4c Added support for new additional PlayerData props. 2023-10-09 01:10:17 +02:00
Paul 747aedca27 Fixed battle tile animations having the zoomies in Forge 2023-10-09 08:45:10 +10:00
Paul 9540bc9394 Fixed Forewarn message being silly 2023-10-09 08:44:59 +10:00
miasmus a7fed0d042 gen 5 drops, edits for consistency 2023-10-08 18:38:57 -04:00
Paul aedb0755f9 Added sleeping to Mareep line 2023-10-09 08:19:37 +10:00
Paul 23eb10f5ea Fixed sleeping pokemon in the wild never waking up 2023-10-09 08:19:28 +10:00
Paul 2c134c5e1b More shoulder effect backcompat (slow falling) 2023-10-09 07:05:40 +10:00
Paul f7f70f14bc Spawning JSON syntax fixes 2023-10-09 06:22:02 +10:00
Paul d3834b0bb7 Merge remote-tracking branch 'origin/main' into 1.4-Spawn-Fixes 2023-10-09 06:04:37 +10:00
Veraxiel 2033240b83 Added missing evo moves for gen 9 and some starters. 2023-10-08 15:49:49 -04:00
Veraxiel 1400505757 Made changes to spawn files, presets, tags, and loot tables. 2023-10-08 14:35:56 -04:00
miasmus 9da0459793 its not bonemeal its bone_meal silly 2023-10-07 20:20:16 -04:00
miasmus 7ac41e2f68 rearrange some json to be more consistent (gen 4) 2023-10-07 20:14:39 -04:00
miasmus e0cdc08cd3 gen 4 drops 2023-10-07 20:14:20 -04:00
Hiroku 438e502a5a Merge branch 'mongdb-datastore' into 'main'
Added MongoDB datastore piggybacking off JSON store. Fixed package typo.

See merge request cable-mc/cobblemon!601
2023-10-08 00:02:00 +00:00
navneetset d7b344cff8 Added to changelog. 2023-10-08 01:47:43 +02:00
Pebbles 249c305474 Merge branch 'main' into 'mongdb-datastore'
# Conflicts:
#   common/src/main/kotlin/com/cobblemon/mod/common/Cobblemon.kt
2023-10-07 23:16:29 +00:00
Lily 5b6ed359a3 gen 1, 2, 3, and 7 drops (i spent 4 hours on this :3) 2023-10-07 18:59:12 -04:00
Hiroku d14e16fe5b Merge branch 'battle-builder-fix' into 'main'
Missing returns for SuccessfulBattleStart

See merge request cable-mc/cobblemon!672
2023-10-07 22:45:42 +00:00
Deltric 65dd132081 Missing returns for SuccessfulBattleStart 2023-10-07 17:24:45 -05:00
Paul 54cd0ba700 Updated ru_ru 2023-10-08 07:58:01 +10:00
Hiroku 7f8b241695 Merge branch 'shoulder-back-arm-leg-compat' into 'main'
Added light backwards compatibility for shoulder mount effects

See merge request cable-mc/cobblemon!671
2023-10-07 12:20:54 +00:00
Paul 0b824fe4c1 Added light backwards compatibility for shoulder mount effects 2023-10-07 21:23:02 +10:00
Paul 46b4bfa7ea Updated pt_pt 2023-10-07 20:59:04 +10:00
Hiroku c9fc2ce95d Merge branch 'datapack-fix' into 'main'
Switched to findAllResources instead of findResources

See merge request cable-mc/cobblemon!667
2023-10-07 10:56:21 +00:00
Deltric 91eff015dc Ordered loading alphabetically 2023-10-07 04:03:13 -05:00
Deltric a9c8825b3c Forgot to change method parameters 2023-10-07 03:06:42 -05:00
Hiroku 9d64b0f06a Merge branch 'untradeable-rework' into 'main'
Untradeable rework

See merge request cable-mc/cobblemon!669
2023-10-07 04:10:53 +00:00
Paul f5a308e579 Updated heaps of lang 2023-10-07 13:21:28 +10:00
Deltric 2b3c2358a5 Merge remote-tracking branch 'origin/datapack-fix' into datapack-fix 2023-10-06 22:11:00 -05:00
Deltric a84a2aac58 Progress on resource fix 2023-10-06 22:10:51 -05:00
Deltric fe86d644ad Switched to findAllResources instead of findResources 2023-10-06 22:10:51 -05:00
Deltric 9eb8d5e832 Progress on resource fix 2023-10-06 22:10:07 -05:00
Hiroku 5d2e877176 Merge branch 'berry-with-flywheel' into 'main'
Make berries render with flywheel, improve perf 100x

Closes #444

See merge request cable-mc/cobblemon!665
2023-10-07 03:08:28 +00:00
apion b2b08ac098 Rollback apricorn plank model change (but fr this time) 2023-10-06 22:08:19 -04:00
Lily ae8e4a4f3a gen 1 drops updated 2023-10-06 22:03:52 -04:00
apion e5f0911b83 Rollback apricorn plank model change 2023-10-06 21:52:29 -04:00
Paul e1ae600419 Properly implemented tradeable property in trade GUI 2023-10-07 11:13:59 +10:00
Paul 34315d9f1d Added a bunch of license files 2023-10-07 09:32:58 +10:00
Paul 773cef8e46 Forgot sprout texture 2023-10-07 09:32:25 +10:00
Paul 282a15b1b2 Updated Touga, Coba, Kelpsy, flower, and sprout assets 2023-10-07 09:30:48 +10:00
Hiroku 3b17ad4f54 Merge branch 'leaf-me-alone' into 'main'
Apricorn Leaf Update

See merge request cable-mc/cobblemon!668
2023-10-06 06:57:17 +00:00
dhi_holo 04c5b698c2 New colour, who this?
All the leaves are different again
2023-10-06 16:55:39 +10:00
Paul 123029199c Fixed UV rotations not being applied to berry models 2023-10-06 16:05:38 +10:00
Deltric 8f70bd5eaf Switched to findAllResources instead of findResources 2023-10-06 00:57:55 -05:00
Hiroku 24310d5144 Merge branch 'mulch-fix' into 'main'
Modified mulch code

Closes #550

See merge request cable-mc/cobblemon!666
2023-10-06 03:04:02 +00:00
Deltric b4b5d62632 Modified mulch code 2023-10-05 21:22:36 -05:00
apion d550d775a6 Fix dependency notation for flywheel 2023-10-05 22:05:01 -04:00
apion e572584dbf Remove render caching stuff from BerryBlockEntities 2023-10-05 22:02:03 -04:00
apion 6ac58cf7c2 Added fallback to vanilla renderer 2023-10-05 21:56:04 -04:00
apion e8a1e66658 Merge branch 'main' into berry-with-flywheel 2023-10-05 21:44:55 -04:00
apion 9c67d0ad6f Fixed forge build 2023-10-05 21:42:00 -04:00
apion 0747d08a90 Forge build not working, pushing to compare 2023-10-05 21:17:11 -04:00
apion 299ab3d5f7 Merge branch 'main' into berry-with-flywheel 2023-10-05 21:05:32 -04:00
Hiroku 7e0f48ea54 Merge branch 'main' into 'main'
Update aspects when applying PokemonProperties to a Pokemon or PokemonEntity

See merge request cable-mc/cobblemon!655
2023-10-05 21:06:06 +00:00
Xander Forrest 49a5090903 Merge branch cobblemon:main into main 2023-10-05 17:55:12 +00:00
Xander Forrest 7e0e55d126 Undo setting FormData changes on PokemonProperties 2023-10-05 17:13:10 +01:00
Hiroku f3fa765890 Merge branch 'fix-double-dipping' into 'main'
Items are double consumed

See merge request cable-mc/cobblemon!658
2023-10-05 09:08:31 +00:00
Hiroku a9a91a813a Merge branch 'nickname-fix' into 'main'
Fix nickname updates not applying when returning to species name.

See merge request cable-mc/cobblemon!662
2023-10-05 09:06:27 +00:00
Hiroku 579e48f93c Merge branch 'implement_pokemon' into 'main'
Some more minor fixes for Pokemon.

See merge request cable-mc/cobblemon!661
2023-10-05 09:01:41 +00:00
Hiroku e8520953f6 Merge branch 'sound' into 'main'
Updated the Healing Machine sound

See merge request cable-mc/cobblemon!663
2023-10-05 08:49:06 +00:00
apion 47deb6504b Get flywheel packaged into the fabric built jar, fix some create conflicts 2023-10-04 19:21:58 -04:00
Sterrezo cd0f95169a Merge branch 'main' into sound 2023-10-04 23:58:56 +02:00
Sterrezo a23b37ee47 Updated the Healing Machine sound 2023-10-04 23:57:10 +02:00
Pebbles 370d65284d Merge branch 'main' into 'mongdb-datastore'
# Conflicts:
#   common/src/main/kotlin/com/cobblemon/mod/common/api/storage/factory/FileBackedPokemonStoreFactory.kt
2023-10-04 14:10:01 +00:00
Deltric e2b2ee9031 Remove ignore case from check 2023-10-03 21:04:48 -05:00
Deltric 141b38b81c Fix nickname updates not applying when returning to species name. 2023-10-03 20:59:41 -05:00
Lily f41c2aa0c1 fixed 5 billion typos 2023-10-03 18:46:59 -04:00
tyzillion 87fffe67f5 Made Frogadiers cry not loop, fixed Patrat and Watchog emissives. Fixed Phantumps shiny emissive AGAIN, and fixed shiny phantump texture. 2023-10-03 17:18:42 -04:00
tyzillion 7a13a5a4d1 Updated Garchomp animation tweaks, updated Nidoking texture, updated Nidorino model and animations, Removed Blazing and Ender variants from Vivillon. 2023-10-03 16:58:02 -04:00
Lily 9efc3f1eef gen 8 drops 2023-10-03 18:47:53 +00:00
Lily 8188cabb4f gen 7 drops 2023-10-03 18:23:14 +00:00
Lily b545e01aef gen 6 drops 2023-10-03 18:01:54 +00:00
Lily c34a09430a gen 5 drops 2023-10-03 17:39:38 +00:00
Lily 403acf5822 gen 4 drops 2023-10-03 16:49:30 +00:00
Lily d53c17bc8e gen 3 drops 2023-10-03 15:00:24 +00:00
Lily 7bc9778ce3 gen 2 drops 2023-10-03 14:20:07 +00:00
Paul 57687ffcdb Fixed wild Pokémon not sleeping in the wild 2023-10-03 20:59:51 +10:00
Paul d40e2706c0 Merge remote-tracking branch 'origin/main' 2023-10-03 20:32:50 +10:00
Paul abecc6c74d Fixed light in spawning not being a very good condition at all 2023-10-03 20:32:38 +10:00
Hiroku 709b933661 Merge branch 'store_bug' into 'main'
Fixes an error in the Pokémon list in the BottomlessStore

See merge request cable-mc/cobblemon!659
2023-10-03 10:13:25 +00:00
Hiroku d426d6e843 Merge branch 'untinted-glasses' into 'main'
Updates the Apricorns

See merge request cable-mc/cobblemon!660
2023-10-03 07:31:06 +00:00
dhi_holo 234acf0787 consistency patch
makes stripped and unstripped logs have the same top
2023-10-03 14:37:33 +10:00
dhi_holo b4b0bed36c correction
wrong files lmao
2023-10-03 14:28:03 +10:00
dhi_holo 65f0bfdcd9 Update CobblemonClient.kt
knew I'd miss some random thing about leaf tinting, damn you line 96
2023-10-03 14:19:50 +10:00
dhi_holo f598af314a Fitting In
All the Apricorn Items (plus the Sprout blocks) now have fitting leaves

I also finally fixed the log textures not being updated 🗡️
2023-10-03 14:12:37 +10:00
dhi_holo cef14e938f Updates the Leaves
Leaves now no longer use tinting (commented out the code incase we need to roll it back eventually)
2023-10-03 13:32:53 +10:00
Pedro Souza f53cd87081 Fixed BottomlessStore 2023-10-03 00:26:36 -03:00
Deltric bfc820808f Items are double consumed 2023-10-02 04:20:57 -05:00
Hiroku 57a34e490d Merge branch 'new-tag-syncing' into 'main'
Unbattleable and Hide label spawn packet

See merge request cable-mc/cobblemon!657
2023-10-02 08:10:15 +00:00
Deltric e817496f7e Unbattleable and Hide label spawn packet 2023-10-02 02:47:03 -05:00
Paul 8aea2d5b74 Tweaks to relative berry growth speeds 2023-10-02 15:59:03 +10:00
Paul 47213c3ae4 Fixed growth mulch oops 2023-10-02 15:50:13 +10:00
Hiroku d70fbe70d2 Merge branch 'pd-extension-safety' into 'main'
PD Extension Load Safety

See merge request cable-mc/cobblemon!656
2023-10-02 03:09:48 +00:00
Deltric 3768d4278e Increase Mint grow chance x5 2023-10-01 20:05:15 -05:00
Xander Forrest 6283a0bee0 Merge remote-tracking branch 'origin/main' 2023-10-01 15:48:15 +01:00
Xander Forrest 43a24a9c98 Instead of just setting FormData field on a Pokemon when applying PokemonProperties, apply each aspect of that new Form Data.
When updating the form, get the current form, and remove those aspects first. If not, you can not switch a regional formed Pokemon "back to normal", because there is no "normal" aspect, "normal" form is just the default if the other Form's aspects aren't present.
2023-10-01 15:48:03 +01:00
Xander Forrest d8b401aee0 Merge branch cobblemon:main into main 2023-10-01 14:46:31 +00:00
Hiroku f64e919bf2 Merge branch 'no-more-advancement-for-you' into 'main'
Do more complicated check for level up trigger

Closes #536

See merge request cable-mc/cobblemon!653
2023-10-01 10:07:18 +00:00
Hiroku a727c099ae Slowed mints back down again, just a bit 2023-10-01 04:40:43 +00:00
Hiroku e4ae8fe6dd Merge branch 'rest-fix' into 'main'
fix rest move not updating client-side hp

Closes #539

See merge request cable-mc/cobblemon!654
2023-09-30 22:33:33 +00:00
Xander Forrest c46ab35af0 Update aspects when applying PokemonProperties to a Pokemon or PokemonEntity 2023-09-30 22:50:51 +01:00
miasmus 25bfdb3aa2 fix rest move not updating client-side hp 2023-09-30 17:14:52 -04:00
MoeBoy76 7d5b0c9648 increased complication of level up trigger to fix #536 2023-10-01 07:52:45 +11:00
Hiroku 2ccf49e65c Made mints ~10% rarer in each band 2023-09-30 20:11:37 +00:00
Licious bc12466e09 Merge branch 'more-1.4-fixes' into 'main'
Various bug fixes

Closes #507, #534, #504, #505, and #503

See merge request cable-mc/cobblemon!650
2023-09-30 19:54:55 +00:00
Hiroku 7d03f5f780 Faster mint growth 2023-09-30 05:45:53 +00:00
Hiroku 2eb23f0707 Merge branch 'pp-to-the-max' into 'main'
Update pp_max.json

See merge request cable-mc/cobblemon!651
2023-09-30 04:07:32 +00:00
dhi_holo cbe7626bdc Update pp_max.json
Changes the required berry to Hopo
2023-09-30 14:03:52 +10:00
Paul f83b10643c Added attack knockback attribute to Pokémon, closes #503 2023-09-30 13:23:53 +10:00
Paul 40be5a2060 Fixed most of the berry mulches not working, closes #505 2023-09-30 13:15:37 +10:00
Paul 2b26576a1c Fixed mutations not working woops, closes #504 2023-09-30 12:52:33 +10:00
Paul 48d6f7f707 Fixed pasture block drops and Pokémon not despawning from pastures under regular block break situations, closes #534 2023-09-30 12:29:03 +10:00
Paul ea6bf1fcd1 Make berries take a sec to break instead of being instant 2023-09-30 12:27:27 +10:00
Paul e0ab5e60d0 Fixed pasture and PC drop behaviour 2023-09-30 12:21:42 +10:00
Paul 3d4e941af2 Fixed errors when partying pastured Pokémon 2023-09-30 12:15:52 +10:00
Paul 6aa359d7cc Merge remote-tracking branch 'origin/main' 2023-09-30 10:58:13 +10:00
Hiroku 646fc606d6 Merge branch 'increase-mint-growth' into 'main'
Increase Mint grow chance x5

See merge request cable-mc/cobblemon!649
2023-09-30 00:42:19 +00:00
Deltric 37e9823fe0 Increase Mint grow chance x5 2023-09-29 19:41:17 -05:00
Paul 9cd24e76d2 Fixed party lock relating to switching in PvP battles, closes #507 2023-09-30 09:45:18 +10:00
Paul fb52c1badd Merge remote-tracking branch 'origin/main' 2023-09-30 08:55:42 +10:00
Paul 24126e582b Many crop rarity tweeks 2023-09-30 08:55:28 +10:00
Veraxiel a08ca9c8eb Update apricorns_normal.json 2023-09-29 22:38:21 +00:00
Hiroku 896198eca2 Merge branch 'implement_pokemon' into 'main'
Minor fixes to oversights on Pokemon

Closes #496

See merge request cable-mc/cobblemon!648
2023-09-29 21:44:36 +00:00
tyzillion 38a20c76a1 Made Gallades battle quirk more frequent. Added Garchomps battle idle. Added Floragato's battle cry. 2023-09-29 17:03:33 -04:00
tyzillion 7ac80cb716 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon
# Conflicts:
#	common/src/main/resources/assets/cobblemon/bedrock/pokemon/animations/0497_serperior/serperior.animation.json
#	common/src/main/resources/assets/cobblemon/sounds/pokemon/cofagrigus/cofagrigus_cry.ogg
#	common/src/main/resources/assets/cobblemon/sounds/pokemon/yamask/yamask_cry.ogg
2023-09-29 16:35:24 -04:00
Sterrezo 2a83af5626 Updated audio assets, fixed Serperior missing a cry, fixed Floragato's sound keyframe, changed Gallade's cry to include the quirk 2023-09-29 10:23:50 +02:00
Hiroku 7cc8fd8201 Merge branch 'pasture-block-fixes' into 'main'
Pastured Pokémon fixes

Closes #522 and #520

See merge request cable-mc/cobblemon!646
2023-09-29 07:05:48 +00:00
Deltric 901de0031c Pastured Pokémon fixes 2023-09-29 00:46:21 -05:00
Paul f762ba7425 Fixed healing moves looking like they fully heal opponent Pokémon, closes #528 2023-09-29 14:36:21 +10:00
Hiroku f5b92c11a0 Merge branch 'mint-altitude-tweaks' into 'main'
Altitude placement for mints

See merge request cable-mc/cobblemon!645
2023-09-29 04:16:57 +00:00
Deltric ecc5143ae6 Altitude placement for mints 2023-09-28 22:57:36 -05:00
Hiroku c6a7dcde33 Merge branch 'pokemon-json-fix' into 'main'
Json safety checks for Pokemon loadFromJson

See merge request cable-mc/cobblemon!643
2023-09-29 01:50:03 +00:00
Hiroku 7821801c83 Merge branch '1.4-fixes' into 'main'
1.4 fixes

Closes #525, #521, #514, #518, and #511

See merge request cable-mc/cobblemon!642
2023-09-29 01:30:59 +00:00
Deltric 85f8f971da Json safety checks for Pokemon loadFromJson 2023-09-28 20:28:28 -05:00
Paul 2808e52873 Merge remote-tracking branch 'origin/1.4-fixes' into 1.4-fixes 2023-09-29 10:53:48 +10:00
Paul 69f8d4a306 Tweaked medicinal leek rarity, relates to #513 2023-09-29 10:52:39 +10:00
Paul e7351af2a8 Tweaked sparse berry rarity, relates to #512 2023-09-29 10:50:07 +10:00
Paul 7ad5ee633d Tweaked big root rarity and depth, relates to #510 2023-09-29 10:49:25 +10:00
Paul 742c4c8087 Fixed berries not having the correct generation weights, closes #511 2023-09-29 10:48:11 +10:00
Paul ae41d4ac58 Fixed Forge pasture block issues wherever pasture blocks are near the world center, closes #518 2023-09-29 10:21:53 +10:00
Paul 3f4086fc90 Fixed only one store saving on disconnect, closes #514 2023-09-29 10:08:38 +10:00
Paul 9e993df788 Moved brewing stand mixin to common to fix it not working on servers, closes #521 2023-09-29 08:10:00 +10:00
Paul a389c21b25 Fixed shoulder-mount icon displaying even for non-shoulder-mountable Pokémon, closes #525 2023-09-29 07:59:57 +10:00
Hiroku b20be79ce6 Merge branch 'json-changes' into 'main'
Recipe changes and some spawn fixes

Closes #524

See merge request cable-mc/cobblemon!641
2023-09-28 08:46:22 +00:00
dhi_holoandHiroku 9b05db6c5f Recipe changes and some spawn fixes 2023-09-28 08:46:22 +00:00
Nick f7de61ce71 Merge branch 'tyzillion-main-patch-53704' into 'main'
Update 0_phantump_base.json

See merge request cable-mc/cobblemon!640
2023-09-27 22:10:00 +00:00
Tyzillion 9811390573 Update 0_phantump_base.json 2023-09-27 21:49:51 +00:00
Nick 11e7d193fb Merge branch 'arclight-incompat-fix' into 'main'
Fix Arclight incompat

See merge request cable-mc/cobblemon!639
2023-09-27 00:12:05 +00:00
Neovitalism 3e2788b789 Fix Arclight incompat 2023-09-26 19:31:20 -04:00
Hiroku bda999e1fd Merge branch 'small-changelog-fix' into 'main'
Update CHANGELOG.md - fixed typos and added two missing pokemon

See merge request cable-mc/cobblemon!638
2023-09-26 20:21:42 +00:00
Lily e249a96749 Update CHANGELOG.md - fixed typos and added two missing pokemon 2023-09-26 14:38:42 +00:00
Paul 2078108ea7 Fixed aspear berry behaving weirdly when harvested from above 2023-09-26 18:23:25 +10:00
Hiroku ddb24e9621 Merge branch '1.4-Spawns' into 'main'
Updated spawn files.

See merge request cable-mc/cobblemon!633
2023-09-26 08:08:03 +00:00
TyzillionandHiroku b07795e547 Updated spawn files. 2023-09-26 08:08:03 +00:00
miasmus 7e63cd9c1d adds drops for sneasels, fixes #496 2023-09-25 19:32:09 -04:00
Nick 8680f2ade0 Merge branch 'implement_pokemon' into 'main'
Final merge on Pokémon Implementation for 1.4!

See merge request cable-mc/cobblemon!637
2023-09-25 17:33:41 +00:00
TyzillionandNick 5679d4dc05 Final merge on Pokémon Implementation for 1.4! 2023-09-25 17:33:41 +00:00
tyzillion 980c0d4c37 Made Gallade's battle quirk not overlay on battle idle. 2023-09-25 09:24:36 -04:00
tyzillion 50f1abd47e Adjusted Sprigatito ui frames and fixed Oinkologne's gender differences not working. 2023-09-24 13:05:38 -04:00
tyzillion a555ac8e6d Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-09-23 23:57:13 -04:00
Veraxiel 96d2b322a3 Update is_dense.json 2023-09-24 03:04:30 +00:00
Veraxiel 7bae99468b Update is_sparse.json 2023-09-24 03:04:26 +00:00
Veraxiel 8b99cfe98d Update is_dense.json 2023-09-24 01:52:15 +00:00
Veraxiel ac6eb38152 Update is_sparse.json 2023-09-24 01:52:12 +00:00
Paul 1621910428 Merge remote-tracking branch 'origin/main' 2023-09-24 11:45:50 +10:00
Paul b74037afb6 Fixed incompatibility crash with Pixelmon Reforged 2023-09-24 11:45:39 +10:00
Veraxiel 753bfa6936 Update is_sparse.json 2023-09-24 01:32:55 +00:00
Hiroku 53d575b1c4 Merge branch 'some-api-utilities' into 'main'
Add some API utilities

See merge request cable-mc/cobblemon!636
2023-09-23 23:57:48 +00:00
Paul 97e90a87c1 Rework density tags to be sparse and dense 2023-09-24 09:13:14 +10:00
Neovitalism a72525cf65 Add some API utilities 2023-09-23 18:38:06 -04:00
Paul 07e487e0cd Further further rarity tweaking for berries 2023-09-23 21:07:38 +10:00
Hiroku bcf3fe1dc6 Merge branch 'battle-advancer' into 'main'
Battle Victory Advancement fix and tweaks

Closes #470

See merge request cable-mc/cobblemon!635
2023-09-23 08:01:16 +00:00
MoeBoy76andHiroku 8d5d567153 Battle Victory Advancement fix and tweaks 2023-09-23 08:01:15 +00:00
Paul 0643bc8d58 Merge remote-tracking branch 'origin/main' 2023-09-23 13:29:06 +10:00
Paul 1c6633bfdc Further rarity tweaking for berries 2023-09-23 13:28:52 +10:00
Hiroku f876c5f6c8 Merge branch 'persistence-and-extra-flags' into 'main'
Implement persistence on Pokemon and flags for hide label and unbattleable.

See merge request cable-mc/cobblemon!634
2023-09-23 03:19:40 +00:00
Deltric 99744af491 Implement persistence on Pokemon and flags for hide label and unbattleable. 2023-09-21 21:06:51 -05:00
Paul 9f2a4261f0 Fixed jump keyframes using smooth interpolation 2023-09-22 11:07:26 +10:00
Paul 1b6b0524e8 Merge remote-tracking branch 'origin/main' into implement_pokemon 2023-09-22 10:39:49 +10:00
Paul 5f740b1c58 Merge branch 'main' into berry-with-flywheel
# Conflicts:
#	gradle/libs.versions.yml
2023-09-22 10:07:53 +10:00
Paul 0cd79c6c8f Updated fabric-api to 0.89.0 2023-09-22 10:07:27 +10:00
tyzillion f5e492a6ce Fixed Diggersby UI's, Fixed Sprigatito shiny, Make Boltunds cry not loop, and Made Pidgeotto's look animation us neck. 2023-09-21 19:45:13 -04:00
tyzillion c8c1677182 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-09-21 17:23:57 -04:00
tyzillion 8431e25c31 Fixed error that caused build to fail. 2023-09-21 17:02:37 -04:00
tyzillion 121f7c6a9a Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into 1.4-Spawns 2023-09-21 17:02:19 -04:00
Hiroku 37f508793d Merge branch 'sound' into 'main'
Probably final iteration of Pokeball sounds

See merge request cable-mc/cobblemon!632
2023-09-21 20:01:53 +00:00
SterrezoandHiroku 5807e4526e Probably final iteration of Pokeball sounds 2023-09-21 20:01:53 +00:00
Licious 63a42edb7f Merge branch 'more-crop-gen-fixes' into 'main'
Many crop fixes

Closes #476, #494, and #495

See merge request cable-mc/cobblemon!629
2023-09-21 19:43:23 +00:00
tyzillion c523408fe0 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into 1.4-Spawns 2023-09-21 14:32:30 -04:00
Paul 7baf8e079d Improve medicinal leek anti-beach from Miasmus 2023-09-21 18:39:11 +10:00
Hiroku 88105e070b Merge branch 'this-is-just-your-nature' into 'main'
Fixed mints not visually changing stats

See merge request cable-mc/cobblemon!630
2023-09-21 07:54:29 +00:00
tyzillion cef0ad7efa Forgot to update Cetitan animation. 2023-09-21 02:15:33 -04:00
tyzillion 592ead6674 Misc Fixes 2023-09-21 02:13:10 -04:00
Paul 98556c1b24 Made medicinal leeks substantially rarer 2023-09-20 20:29:26 +10:00
Paul 137f080ba9 Fixed mints not visually changing stats 2023-09-20 20:27:50 +10:00
Paul 4f3601ab3b Added beach exclusion to medicinal leeks 2023-09-20 20:15:26 +10:00
Paul e523c46594 Improve rarity of generating big roots and only generate them with good space (and not water) 2023-09-20 20:10:14 +10:00
Paul 251ebe2a37 Improve berry generation in jungles by being able to replace leaves with them 2023-09-20 20:09:45 +10:00
Paul 12191b5d96 Fixed big roots not generating from stone 2023-09-20 20:09:24 +10:00
Paul 4da74f0bfb Fixed issues with wild berries not generating berries if spawned at mature age, reworked growth point timing 2023-09-20 20:09:11 +10:00
Paul b893681af5 Made berry groves rarer again 2023-09-20 20:08:34 +10:00
tyzillion eb159d0702 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-09-19 18:55:25 -04:00
Veraxiel d47197ab3b Updated spawn files. Added spawn compat for William Wythers' Overhauled Overworld. 2023-09-19 18:26:41 -04:00
Paul 64a2b9c60f Updated berry data because a bunch of positions were missing 2023-09-19 20:25:11 +10:00
tyzillion b4585cabd4 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2023-09-18 16:45:16 -04:00
tyzillion dd15de6e94 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-09-18 16:45:07 -04:00
Paul c5dab7208f License and registration, please 2023-09-18 18:46:29 +10:00
Paul 4a5d53a020 More fixes to Flywheel implementation, it renders all the berries correctly! 2023-09-18 18:45:04 +10:00
Paul cc163b73e1 Many fixes for flywheel 2023-09-18 15:51:25 +10:00
Sterrezo d1682b78c6 I didn't break anything
Accidentally removed a line for Mimikyu's shoulder mount last commit, readding it.
2023-09-17 11:39:11 +02:00
Sterrezo 52827c3be6 Documented all new cries in the changelog 2023-09-17 11:31:48 +02:00
Nick 23e2d56db4 Merge branch 'root-and-herb-fixes' into 'main'
Root and herb fixes

See merge request cable-mc/cobblemon!628
2023-09-17 06:58:52 +00:00
Hiroku 3451a70cfd Micro-optimized at Nick's request 2023-09-17 05:39:27 +00:00
tyzillion 3869fc590d Fixed Meowscarada spawning everywhere. 2023-09-16 20:33:09 -04:00
tyzillion ba4f4c8137 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into 1.4-Spawns 2023-09-16 20:32:15 -04:00
Paul 7f372c1f16 Merge remote-tracking branch 'origin/main' into berry-with-flywheel 2023-09-17 10:09:07 +10:00
tyzillion 4624e7cab2 Gave long boi Exeggutor a proper hit box. 2023-09-16 19:08:19 -04:00
Paul 967053824b Made revival herbs rarer 2023-09-17 09:04:33 +10:00
tyzillion 95bc331dc9 Updated Changelog with Pokemon in previous versions that got a cry. 2023-09-16 19:04:23 -04:00
Paul 3c3ef6a387 Fixed roots being able to spread forever 2023-09-17 09:04:14 +10:00
Paul 309de12a0e Fixed big roots being too rare 2023-09-17 09:03:52 +10:00
tyzillion 90b22316cb Combee flys when walking, adjusted Exegguttor and Exeggcute sizes. Updated Shulker Forretress texture. 2023-09-16 18:56:41 -04:00
tyzillion dc1aec75ba Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-09-16 18:56:23 -04:00
tyzillion f60b3f1f4f Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2023-09-16 18:56:00 -04:00
Paul 3e118dcca6 Reworking flywheel impl 2023-09-17 06:47:35 +10:00
Sterrezo 12aac4f52d Implemented 13 new cries , updated 9
Added cries to Hoothoot, Noctowl, Aipom, Shroomish, Breloom, Ambipom, Chingling, Yamask, Cofagrigus, Nickit, Thievul
2023-09-16 14:04:26 +02:00
Hiroku 9b1699b507 Merge branch 'discovered-advanced-typoment' into 'main'
Update catch_all_vivillon.json

See merge request cable-mc/cobblemon!627
2023-09-16 00:29:53 +00:00
dhi_holoandHiroku f0cf94b830 Update catch_all_vivillon.json 2023-09-16 00:29:52 +00:00
Nick ddab45148c Merge branch 'mod-compat' into 'main'
Mod compat

See merge request cable-mc/cobblemon!626
2023-09-15 23:30:13 +00:00
HirokuandNick 2a23c77da7 Mod compat 2023-09-15 23:30:12 +00:00
tyzillion 97625d2750 Fixed Bergmite and Avalugg spawns. 2023-09-15 13:50:18 -04:00
tyzillion ef600fda79 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into 1.4-Spawns 2023-09-15 13:33:52 -04:00
navneetset bd6364deac Removed pretty printing for MongoDB Gson. 2023-09-15 19:00:40 +02:00
navneetset 1fbdf1fce1 Fixed single save not picking up dirtyStore other than first one. 2023-09-15 19:00:24 +02:00
navneetset 6060013110 Merge branch 'mongdb-datastore' of https://gitlab.com/navneetset/cobblemon-peb-fork into mongdb-datastore 2023-09-15 18:56:51 +02:00
navneetset 755cf731f0 Fix dumb rebasing I did to merge main, add back previous implementation. 2023-09-15 18:55:54 +02:00
navneetset 6246af2979 Added MongoDB support for Cobblemon playerdata. 2023-09-15 18:55:54 +02:00
navneetset 6b27f13396 Added MongoDB datastore piggybacking off JSON store. Fixed package typo. 2023-09-15 18:55:54 +02:00
Hiroku 9a4fcb15b2 Merge branch 'mint-generation' into 'main'
Fixed mint generation

See merge request cable-mc/cobblemon!625
2023-09-15 11:49:27 +00:00
Paul 07bb57c009 Buffed mints spawning 2023-09-15 21:30:08 +10:00
Paul 2934e38077 Fixed mints not generating 2023-09-15 20:32:31 +10:00
Hiroku d60592b5e4 Merge branch 'berry-gen-fixes' into 'main'
Fixed berries generating midair or where water was, fixed snowy grass blocks...

Closes #478

See merge request cable-mc/cobblemon!624
2023-09-15 08:36:12 +00:00
apion f563f69afd Fixing rotations 2023-09-15 02:45:21 -04:00
tyzillion 354914105e Merge remote-tracking branch 'origin/1.4-Spawns' into 1.4-Spawns 2023-09-15 00:01:03 -04:00
tyzillion b154b6de64 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into 1.4-Spawns 2023-09-14 23:53:17 -04:00
Paul 66e1f621cf Fixed berries generating midair or where water was, fixed snowy grass blocks with berries on them, made berries rarer. Closes #478 2023-09-15 13:52:46 +10:00
tyzillion 7d55d52608 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-09-14 23:52:24 -04:00
Hiroku 63d84df283 Merge branch 'implement_pokemon' into 'main'
Last of Pokémon Implemented.

See merge request cable-mc/cobblemon!623
2023-09-15 03:49:07 +00:00
TyzillionandHiroku 94400e61f5 Last of Pokémon Implemented. 2023-09-15 03:49:07 +00:00
tyzillion ce337e8fff Beldum line can fly, Updated Bunnelby and Sprigatito model, updated onix animation. Updated Trevenants and Vivillon textures. 2023-09-14 21:16:44 -04:00
apion 72b6f46c4b Merge branch 'main' into berry-with-flywheel 2023-09-14 21:04:28 -04:00
Veraxiel 547af6dd77 Fixed spawn files. 2023-09-14 21:02:10 -04:00
tyzillion 70119478a5 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-09-14 20:14:22 -04:00
Hiroku 029e120b2c Merge branch '1-point-4-bug-fixes' into 'main'
Some bug fixes

Closes #456 and #481

See merge request cable-mc/cobblemon!622
2023-09-15 00:05:53 +00:00
MiaandHiroku 7a305792af Some bug fixes 2023-09-15 00:05:53 +00:00
Nick 06ed32e4cb Merge branch 'issue-484' into 'main'
Fixes issue #484 (this is what you get for using regexes Hiroku)

Closes #484

See merge request cable-mc/cobblemon!621
2023-09-13 20:16:10 +00:00
apion ee63bf0eab Fixes issue #484 (this is what you get for using regexes Hiroku) 2023-09-13 15:54:18 -04:00
Hiroku 48a4add7aa Merge branch 'berry' into 'main'
Berry hitboxes, berry reordering

Closes #444 and #428

See merge request cable-mc/cobblemon!617
2023-09-12 11:34:28 +00:00
Paul dc8d7e36e0 Merge remote-tracking branch 'origin/main' into berry
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/block/BerryBlock.kt
2023-09-12 20:52:23 +10:00
Paul 1c1a683f2d Fixed exploding pasture blocks crashing servers on Forge, closes #472 2023-09-12 20:36:35 +10:00
Paul 0ee4f60391 Fixed bad registration of processor types on Forge 2023-09-12 20:26:52 +10:00
Paul 4a7893f647 Fixed species.create not working for some species with weird names, added /clearpc command 2023-09-12 19:51:12 +10:00
Paul 76890135ef Fixed many items not being possible to give to pokemon by shift rc 2023-09-12 18:48:12 +10:00
Hiroku 930f95d3b6 Merge branch 'sound' into 'main'
Sound updates and consistency fixes

See merge request cable-mc/cobblemon!619
2023-09-12 07:49:54 +00:00
SterrezoandHiroku 0c15d14f1a Sound updates and consistency fixes 2023-09-12 07:49:54 +00:00
Hiroku a2bb0fb3cd Merge branch '1-point-4-bug-fixes' into 'main'
1.4 Bug Fixes

Closes #471, #455, #385, #445, #456, and #463

See merge request cable-mc/cobblemon!620
2023-09-12 07:49:14 +00:00
miasmus a97753c339 add block break particles to mulch removal 2023-09-11 22:48:47 -04:00
miasmus 557dda4c1d holy crap im so smrat (fixes harvesting berries with bonemeal in hand not playing interact anim) 2023-09-11 22:03:25 -04:00
miasmus 944fdf7c0c no one told me to test before pushing to main 2023-09-11 17:06:33 -04:00
tyzillion 10b2aecc12 Updated Floragato mode and Meowscarada model. Fixed Volbeat and Illumise taking baths in water. 2023-09-11 17:06:23 -04:00
tyzillion 565d38f085 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon
# Conflicts:
#	common/src/main/resources/data/cobblemon/species/generation1/pikachu.json
2023-09-11 17:06:01 -04:00
miasmus ada8bc9403 Merge main into 1-point-4-bug-fixes 2023-09-11 16:56:03 -04:00
Paul 2d3d245b03 Fix pikachu evolution properly apparently and fix Nincada -> Shedinja direct evo being a thing 2023-09-11 19:57:03 +10:00
Veraxiel 9adeb60abe Updated spawn files. 2023-09-11 04:35:58 -04:00
Paul 6c91342954 Licenses mf, do you speak it? 2023-09-11 17:45:52 +10:00
Hiroku 98b84d853c Merge branch 'screw-mark-removed' into 'main'
markRemoved bad, PreEmptsExplosion good

See merge request cable-mc/cobblemon!618
2023-09-11 06:55:45 +00:00
NeovitalismandHiroku 83ee5f3c3d markRemoved bad, PreEmptsExplosion good 2023-09-11 06:55:45 +00:00
Paul 137088296e Merge remote-tracking branch 'origin/main' into berry 2023-09-11 16:50:42 +10:00
Paul e748059052 Basic protections against blocks being switched underneath a pasture BE's nose 2023-09-11 15:15:35 +10:00
tyzillion d748241727 Fixed names on spawn files. 2023-09-11 01:06:11 -04:00
Paul f515a2ef72 Merge remote-tracking branch 'origin/main' into berry 2023-09-11 14:45:37 +10:00
Paul 0c9017d5e2 Merge remote-tracking branch 'origin/berry' into berry 2023-09-11 14:44:57 +10:00
Paul fd12789791 Colliders for all the berry trees 2023-09-11 14:44:38 +10:00
Hiroku 638c92ec4c Merge branch 'starter-ball' into 'main'
Chested Balls

Closes #461

See merge request cable-mc/cobblemon!616
2023-09-11 04:26:17 +00:00
dhi_holoandHiroku bee865931a Chested Balls 2023-09-11 04:26:16 +00:00
Veraxiel 77ee8b1743 Merge branch '1.4-Spawns' of https://gitlab.com/cable-mc/pokemon-cobbled into 1.4-Spawns 2023-09-10 21:21:16 -04:00
Veraxiel 5eef45b49a Fixed structure names in presets and spawns. 2023-09-10 21:21:03 -04:00
tyzillion 79f7dd1519 Funny liscense moment. 2023-09-10 19:35:50 -04:00
tyzillion 919dec6809 Fixed json loading error. 2023-09-10 19:02:20 -04:00
tyzillion f00f73491d Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-09-10 18:58:05 -04:00
tyzillion c7cf73812c Added spawns for many new pokemon, added biome based evos to Spewpa, and fixed issues. 2023-09-10 18:56:28 -04:00
tyzillion 80fbab35dc Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into 1.4-Spawns 2023-09-10 15:14:56 -04:00
miasmus ad039cb949 re-order berries, fixes #428 2023-09-10 12:16:26 -04:00
miasmus 0436b36872 partially heal PP when sleeping (fixes #463) 2023-09-10 11:58:42 -04:00
navneetset 9f60ce51c7 Fix dumb rebasing I did to merge main, add back previous implementation. 2023-09-10 14:17:12 +02:00
navneetset 343e13d1ac Added MongoDB support for Cobblemon playerdata. 2023-09-10 14:10:38 +02:00
navneetset ca175ab164 Added MongoDB datastore piggybacking off JSON store. Fixed package typo. 2023-09-10 14:09:03 +02:00
Hiroku 8a62088fb4 Merge branch 'battle_gimmicks' into 'main'
Mega Evolution, Z-Moves, Dynamax, and Terastallization

See merge request cable-mc/cobblemon!572
2023-09-10 09:54:30 +00:00
Segfault GuyandHiroku 7e2bb0ca6a Mega Evolution, Z-Moves, Dynamax, and Terastallization 2023-09-10 09:54:29 +00:00
tyzillion ebad166b12 Tweaked Emissives on Gengar, Fixed Quilava cries, Fixed Braixen emissive pixel. 2023-09-10 04:34:04 -04:00
tyzillion 92f5fd7cd6 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-09-10 04:33:30 -04:00
Veraxiel 507319fa0f Added new presets and biome tags. Updated presets and biome tags. Updated spawn files. 2023-09-10 04:12:10 -04:00
Paul 228347e46f Merge remote-tracking branch 'origin/main' into berry
# Conflicts:
#	common/src/main/java/com/cobblemon/mod/common/mixin/StructurePoolGeneratorMixin.java
#	common/src/main/kotlin/com/cobblemon/mod/common/world/CobblemonStructures.kt
2023-09-10 16:20:04 +10:00
Paul 3a2c12c652 Fixed displayName in spawn files not working properly. Closes #320 2023-09-10 15:11:45 +10:00
Paul a6945adf5a Added optional 'enabled' property to model layers so that they can be disabled later in resolver variations. Closes #373 2023-09-10 15:08:17 +10:00
Paul 295e68b0d5 Poison Heal Pokémon will heal if poisoned out of battle. Closes #373 2023-09-10 14:43:29 +10:00
Paul be983f6115 Fixed an apparently unsafe cast to client world for Litematica, closes #375 2023-09-10 14:27:56 +10:00
Paul 6eeda04b78 Fixed reused models from multiple posers causing rotation problems, closes #414 2023-09-10 14:26:58 +10:00
Paul c03097e627 Fixed quirks being idle-preventing from resource packs, closes #429 and closes #419 2023-09-10 14:14:35 +10:00
tyzillion 163e17fb3f Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-09-09 22:48:45 -04:00
Paul a330f95559 Improve sneaking positioning of shoulder mounts 2023-09-10 11:12:53 +10:00
Paul 25d7c8376e Fixed shoulder mount animations being a blur 2023-09-10 11:05:50 +10:00
Paul bc93bae9ab Check the form during readfromnbt/json 2023-09-10 11:01:32 +10:00
Paul 4f9ca14301 Fixed evolutions being blank for forms that rely on root-species evos 2023-09-10 11:01:12 +10:00
Paul b9515a2a81 Fixed more nicknaming glitches 2023-09-10 11:00:54 +10:00
miasmus 6200e3a693 update changelog 2023-09-09 19:35:12 -04:00
miasmus 290f3e2845 adjusted steelix and dragalge hitboxes 2023-09-09 19:30:56 -04:00
miasmus 516e3c4cd9 fix typhlosion/quilava cry anim playing during battle idle 2023-09-09 19:10:38 -04:00
miasmus e419030339 pokemon that can fly will not fall to their deaths 2023-09-09 18:45:54 -04:00
Paul 7675148d37 Fixed inconsistency with sending out tracing 2023-09-10 08:45:42 +10:00
tyzillion fe739cd644 Meganium and Galarian Meowth crash fixed. Updated hitboxes and frames for the last set of Pokemon implemented. 2023-09-09 18:23:14 -04:00
tyzillion dd5e9c08aa Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-09-09 18:22:48 -04:00
miasmus 03b29ce468 fix leeks, for real this time (fixes #456) 2023-09-09 18:18:53 -04:00
Paul d2668a15b0 Grouped structure maximums and limited berry farms to 2 total per village 2023-09-10 08:05:21 +10:00
miasmus d9a99ad65b Fix players being able to battle/trade in spectator mode 2023-09-09 17:42:41 -04:00
miasmus 0fc9d29884 fix leeks generating on ice 2023-09-09 17:16:39 -04:00
Hiroku f500ab4a87 Merge branch 'berry' into 'main'
Reworked berry generation in villages using their own structures, rarity & gen fixes

Closes #444

See merge request cable-mc/cobblemon!615
2023-09-09 20:55:30 +00:00
Hiroku 19a85276af Reworked berry generation in villages using their own structures, rarity & gen fixes 2023-09-09 20:55:30 +00:00
tyzillion 70c2404b20 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-09-09 16:01:43 -04:00
Paul 27a4b3b6f4 Reworked berry generation in villages using their own structures 2023-09-09 20:28:42 +10:00
Paul 5df79f083a Fixed wild berry trees being still too common and surviving on air 2023-09-09 20:26:28 +10:00
Paul 1501c3689a Merge remote-tracking branch 'origin/main' into berry 2023-09-09 19:20:44 +10:00
Hiroku 277ec8ffcd Merge branch 'lootchestplate' into 'main'
chestlootplate

See merge request cable-mc/cobblemon!614
2023-09-09 02:52:19 +00:00
dhi_holoandHiroku c7b82adfb0 chestlootplate 2023-09-09 02:52:19 +00:00
tyzillion fb56430213 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-09-08 19:05:26 -04:00
tyzillion 083b439049 Fixes, Frames, and Hitboxes. Fixed Gengar texture. 2023-09-08 19:05:02 -04:00
Paul 98e495f7e4 Merge remote-tracking branch 'origin/main' into berry 2023-09-09 08:53:50 +10:00
Paul 508e607440 Merge remote-tracking branch 'origin/main' 2023-09-09 08:48:38 +10:00
Paul ab69588331 Flying AI improvements 2023-09-09 08:48:26 +10:00
apion a8ac109a50 Allowed for the use of existing berry models in flywheel optimizations 2023-09-08 18:34:51 -04:00
tyzillion 1813baaa6f Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-09-08 16:04:21 -04:00
tyzillion 5b5171b9bc Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2023-09-08 16:04:09 -04:00
Hiroku b912e8cbca Merge branch 'berry' into 'main'
Berry fixes including mulch visibility

Closes #444

See merge request cable-mc/cobblemon!613
2023-09-08 19:55:32 +00:00
Hiroku cc2eaf6c1a Berry fixes including mulch visibility 2023-09-08 19:55:32 +00:00
apion fbe31f3232 Try rendering berry trees with flywheel 2023-09-08 11:52:18 -04:00
Sterrezo b530af1ff6 Added missing placeholder assets to Exeggutor to prevent an error in the log 2023-09-08 12:47:13 +02:00
Paul a608cbe0fe Merge conflicty stuff 2023-09-08 19:46:18 +10:00
Paul a4ed9393f0 Merge remote-tracking branch 'origin/main' into berry
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/block/BerryBlock.kt
2023-09-08 19:46:05 +10:00
Paul f294d4fcef Fixed berry juice, energy root, heal powder, potions, and status cure items not being consumed when used outside of battle 2023-09-08 19:43:12 +10:00
Paul 6046ca10d0 Merge remote-tracking branch 'origin/berry' into berry 2023-09-08 19:39:09 +10:00
Paul d24371b9e4 Added mulch visibility for berry trees, and fixed surprise mulch on revival herbs 2023-09-08 19:37:18 +10:00
Hiroku 645d84858e Merge branch 'unloaded-pasture-fix' into 'main'
Fix removing pokemon from an unloaded pasture

See merge request cable-mc/cobblemon!612
2023-09-08 08:09:13 +00:00
NeovitalismandHiroku 04ecd3d976 Fix removing pokemon from an unloaded pasture 2023-09-08 08:09:13 +00:00
Paul c02fe8a00c Fixed hand not swinging when applying mulch 2023-09-08 16:33:28 +10:00
Hiroku 008e42a267 Merge branch 'berry' into 'main'
Latest Berry Updates

Closes #444

See merge request cable-mc/cobblemon!606
2023-09-08 06:29:28 +00:00
NickandHiroku 316ab772bf Latest Berry Updates 2023-09-08 06:29:28 +00:00
Hiroku bca4b06750 Should return pass not fail for isSneaking interaction check 2023-09-08 06:29:04 +00:00
Hiroku dea1d74e40 Merge branch 'fix-battle-particle-misrendering' into 'main'
Fix Issues Related to RenderContext Changes

See merge request cable-mc/cobblemon!611
2023-09-08 05:30:17 +00:00
NickandHiroku 12f1259495 Fix Issues Related to RenderContext Changes 2023-09-08 05:30:17 +00:00
Lily cc30f4f207 fix sneaking checks when using items on pokemon 2023-09-08 00:51:27 -04:00
Hiroku 775a2038d0 Merge branch 'shiny_starters_gamerule' into 'main'
add shiny starters gamerule

See merge request cable-mc/cobblemon!557
2023-09-08 04:51:07 +00:00
LilyandHiroku 1dc8ae036f add shiny starters gamerule 2023-09-08 04:51:07 +00:00
Paul 0011993afb Fixed wiki berry pivot 2023-09-08 13:59:49 +10:00
Hiroku 1ef22ad52a Merge branch 'pokemon-item-tint' into 'main'
Added in tint nbt for Pokemon items

See merge request cable-mc/cobblemon!608
2023-09-08 03:16:33 +00:00
Hiroku e8030c0180 Merge branch 'fix_446' into 'main'
Fix Drag Dispatch.

Closes #446

See merge request cable-mc/cobblemon!610
2023-09-08 03:16:24 +00:00
Segfault Guy e929f6f02d Fix Drag Dispatch. 2023-09-07 22:56:22 -04:00
tyzillion 8ec91f7a40 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-09-07 21:28:01 -04:00
apion 41b9411d06 Merge branch 'berry' into berry-perf-improvements
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/block/entity/BerryBlockEntity.kt
2023-09-07 21:17:12 -04:00
Deltric 9518422f62 Added in tint nbt for Pokemon items 2023-09-07 20:17:12 -05:00
Lily 4c03891f19 berry grove trees now only spawn at age 3 or higher ( Closes #445 ) 2023-09-07 21:16:13 -04:00
Hiroku 52a3bf50d0 Merge branch 'armor-sprites' into 'main'
updated sprites for auspicious and malicious armor + clarified what a renderable pokemon is

See merge request cable-mc/cobblemon!607
2023-09-08 00:52:28 +00:00
LilyandHiroku c1657b5772 updated sprites for auspicious and malicious armor + clarified what a renderable pokemon is 2023-09-08 00:52:28 +00:00
Lily e57c9487ca prevent berry groves from replacing water blocks 2023-09-07 20:13:36 -04:00
miasmus 7e583d6319 fix itemgroup, add descriptions for 96 pokemon, fixes #455 2023-09-07 19:49:00 -04:00
Paul 11256c0e3a Fixed berry flowers not rendering 2023-09-08 09:41:34 +10:00
Paul ffb53626eb Only allow mulching berry trees that are pre-flowering and are on farmland 2023-09-08 09:27:34 +10:00
Paul a74671f710 Re-delete unused mixin [skip-ci] 2023-09-08 09:09:25 +10:00
Hiroku 04d83251b4 Merge branch 'evolution-changes-&-fixes' into 'main'
Evolution changes & fixes

Closes #287, #386, and #398

See merge request cable-mc/cobblemon!582
2023-09-07 23:04:40 +00:00
LiciousandHiroku bece6dfbb0 Evolution changes & fixes 2023-09-07 23:04:40 +00:00
miasmus 5e5cb4e388 no more pokemon waterboarding (fixes #385) 2023-09-07 18:02:01 -04:00
Hiroku 8f9dc451f1 Merge branch 'a-guide-to-1-point-4' into 'main'
Advancements (from hell)

See merge request cable-mc/cobblemon!543
2023-09-07 21:48:19 +00:00
dhi_holoandHiroku ffb1c94c3f Advancements (from hell) 2023-09-07 21:48:19 +00:00
Lily d9b2f0cef8 Merge remote-tracking branch 'origin/berry' into berry 2023-09-07 17:18:20 -04:00
Lily 458fa1732c make berry groves 3x rarer 2023-09-07 17:17:38 -04:00
tyzillion 3040eee59c Updated Gengar, Readded Shulker Forretress, Updated Doduo shiny texture, Updated Serperior textures. 2023-09-06 21:54:51 -04:00
miasmus 23e532a214 fixed compile errors from merge 2023-09-06 16:53:57 -04:00
Nick 70f1e5e621 Fix conflicts between main and berry branch 2023-09-06 17:12:04 +00:00
apion 10033be4b5 Actually fix flower models 2023-09-06 11:19:54 -04:00
apion 914067038a Fix forge client, fix flower models 2023-09-06 11:13:28 -04:00
miasmusandapion bf9f08826b Fixes #444 (some berries not consumed on use outside of battle) 2023-09-06 10:50:07 -04:00
ApionXDandapion da27b80e82 Fixed bug where tall grass wouldn't be deleted when a berry tree replaced its lower block 2023-09-06 10:50:07 -04:00
miasmusandapion e6c9c7798e Adds other crops to maintains_farmland tag 2023-09-06 10:50:07 -04:00
miasmusandapion d0b7b956e8 Adds a #cobblemon:berry tag with all the berry blocks, adds them to the #maintains_farmland tag 2023-09-06 10:50:07 -04:00
Lilyandapion 0301064ed5 added missing particles for figy, micle, passho, starf, and wacan berries 2023-09-06 10:50:06 -04:00
Lilyandapion b8595f8d59 prevent player from interacting with pokemon when sneaking 2023-09-06 10:50:06 -04:00
tyzillion d120c8e031 Readded Phantump and Trevenants Emissives. License moment 🤙 2023-09-06 00:22:32 -04:00
tyzillion aa91b5b20b Misc Fixes, Many walk speeds modified, Removed Shulker Forretress and Minecraft tree variants of Phantump and Trevenant. 2023-09-05 23:58:16 -04:00
tyzillion 84dfaa0a77 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-09-05 23:57:23 -04:00
Nick 1e8ae04ad5 Merge branch 'gui-model-hook' into 'main'
Add reference to previously polled species name and aspects.

See merge request cable-mc/cobblemon!594
2023-09-06 03:00:38 +00:00
WaterpickerandNick 0cfa7bf61d Add reference to previously polled species name and aspects. 2023-09-06 03:00:37 +00:00
tyzillion 9987c0c13f Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2023-09-05 16:45:37 -04:00
miasmus 99a88e66e7 Fixes #444 (some berries not consumed on use outside of battle) 2023-09-05 16:07:59 -04:00
Sterrezo b7a3e276f1 Implemented 82 cries
I'm gonna lie down
2023-09-05 20:14:40 +02:00
ApionXD 0240f925f6 Fixed bug where tall grass wouldn't be deleted when a berry tree replaced its lower block 2023-09-05 10:32:12 -04:00
tyzillion d9774272ce Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon
# Conflicts:
#	CHANGELOG.md
2023-09-05 09:10:58 -04:00
Hiroku aa2532df6f Merge branch 'x-treme-crafting' into 'main'
X-Item Recipes

See merge request cable-mc/cobblemon!604
2023-09-05 11:52:28 +00:00
dhi_holoandHiroku 0c14e5dedc X-Item Recipes 2023-09-05 11:52:28 +00:00
Hiroku 62248ff97c Merge branch 'long_lost_logs' into 'main'
Oops! Forgot to update the changelogs. No one cares about these, right?

See merge request cable-mc/cobblemon!603
2023-09-05 10:54:13 +00:00
Segfault GuyandHiroku 17343abce2 Oops! Forgot to update the changelogs. No one cares about these, right? 2023-09-05 10:54:13 +00:00
Hiroku 0ff73d0c21 Merge branch 'auspicious_armor' into 'main'
adds auspicious and malicious armor, equipping functionality is in the earlier...

Closes #436

See merge request cable-mc/cobblemon!602
2023-09-05 09:56:57 +00:00
LilyandHiroku 77da1f8252 adds auspicious and malicious armor, equipping functionality is in the earlier... 2023-09-05 09:56:57 +00:00
Hiroku 18301300aa Merge branch 'implement_pokemon' into 'main'
So so so many Pokemon implemented and models, animations, and textures updated

See merge request cable-mc/cobblemon!600
2023-09-05 08:59:10 +00:00
TyzillionandHiroku ca044e8390 So so so many Pokemon implemented and models, animations, and textures updated 2023-09-05 08:59:10 +00:00
miasmus a6b68b4076 Adds other crops to maintains_farmland tag 2023-09-04 19:50:26 -04:00
miasmus dbce3252ab Adds a #cobblemon:berry tag with all the berry blocks, adds them to the #maintains_farmland tag 2023-09-04 19:29:33 -04:00
Lily cc3b09f590 added missing particles for figy, micle, passho, starf, and wacan berries 2023-09-04 19:24:23 -04:00
Lily 8ed2b820f2 prevent player from interacting with pokemon when sneaking 2023-09-04 17:25:56 -04:00
apion 3b967933ca Licenses 2023-09-04 16:35:43 -04:00
apion 665aad40a8 Added logic to rerender blocks when necessary 2023-09-04 16:32:23 -04:00
apion 527f429c20 Use guava cache now, evict entries after a minute 2023-09-04 15:13:56 -04:00
Sterrezo 85803b11b4 Implemented cries for remaining starters 2023-09-04 21:01:03 +02:00
apion 6d3f3d1353 Fixed lighting issues (kinda) 2023-09-04 14:17:49 -04:00
apion b70748e1b8 BerryBlockRenderer now caches vertices, improves perf by about 4x (HOORAY) 2023-09-04 05:53:56 -04:00
tyzillion c6406ab0ea Small Fixes. 2023-09-04 05:08:57 -04:00
tyzillion 28c750caf9 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-09-04 05:08:32 -04:00
Paul ff2db8fa11 You saw nothing 2023-09-04 18:49:38 +10:00
Paul 42d330e1c0 Added berry world gen weights to data 2023-09-04 18:45:27 +10:00
Paul 062cee2b9a Merge remote-tracking branch 'origin/main' 2023-09-04 18:16:36 +10:00
Paul 5730d812a0 Randomize berry positions for most berry trees (except for berry swords) 2023-09-04 18:16:28 +10:00
tyzillion ab22780598 Modified walk speeds for Roggenrola line, Quilava, Typhlosion, and Feraligatr. 😅 2023-09-04 02:00:08 -04:00
tyzillion 1b2e0fb58e Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-09-04 01:54:36 -04:00
tyzillion 6616234393 🥚 2023-09-04 01:52:57 -04:00
Hiroku cb4ad09a11 Merge branch 'heal-me-up-scotty' into 'main'
Potions are like healing berries

Closes #437

See merge request cable-mc/cobblemon!598
2023-09-04 05:52:07 +00:00
MoeBoy76andHiroku 1d81df91eb Potions are like healing berries 2023-09-04 05:52:06 +00:00
Hiroku d962d30074 Merge branch 'fix-starter-volume' into 'main'
Fixes starter selection sound effect playing twice when clicking the arrow keys to navigate

Closes #427

See merge request cable-mc/cobblemon!599
2023-09-04 05:47:31 +00:00
tyzillion e33420bab7 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2023-09-04 01:39:08 -04:00
tyzillion 17dcbb25c3 Implemented Teddiursa and Ursaring. Fixed Clodsire pivot, fixed Lickylicky crash. Added animated textures to Ponyta line, updated Tinkaton, Tevenant, Slowking, Boltund, Quaxwell, Delphox, Koffing, Weezing, Chikorita, Bayleef, Meganium, Mareep, Flaaffy, Ampharos, Oshawott, Dewott, Doduo, Dodrio, Abra, Kadabra, Alakazam, Emolga, Slowpoke, Slowbro, and Slowking. Updated animations for Bunnelby, Diggersby, Cetoddle, Cetitan, Sprigatito line, Snivy line, Hitmonchan, Lonoone, Beldum line, Chikorita line, Phantump line, Mareep line, Fennekin line, Yamper line, Doduo line, Slowpoke line, Hoothoot, Froakie, Komala, Galar Meowth, Quaxwell, and Granbull. 2023-09-04 01:38:50 -04:00
tyzillion 1b36c40959 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-09-04 01:36:08 -04:00
Hiroku 5096d9a15a Merge branch 'pokemonloot-fix' into 'main'
Fixes pokemon dropping XP when doPokemonLoot gamerule is set to false

See merge request cable-mc/cobblemon!597
2023-09-04 04:20:21 +00:00
Hiroku 24737cf606 Merge branch 'selected-pokemon-pvp-fix' into 'main'
Fix player battle always starting with first pokemon

Closes #389

See merge request cable-mc/cobblemon!579
2023-09-04 04:12:14 +00:00
MiaandHiroku 7bd1c24b57 Fix player battle always starting with first pokemon 2023-09-04 04:12:13 +00:00
DoctorWafflePhD db2cd8501e A handful of UI & hitbox fixes. 2023-09-03 22:32:48 -05:00
tyzillion fd6348adbe Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-09-03 22:41:34 -04:00
miasmus 36b1bec04b Fixes starter selection sound effect playing twice when clicking the arrow keys to navigate 2023-09-03 20:19:52 -04:00
Hiroku 7f14b60efb Merge branch 'neo-1.4-fixes' into 'main'
Various bug fixes

See merge request cable-mc/cobblemon!596
2023-09-03 22:27:52 +00:00
NeovitalismandHiroku 239559cfd3 Various bug fixes 2023-09-03 22:27:52 +00:00
miasmus c4b2a1546a Fixes pokemon dropping XP when doPokemonLoot gamerule is set to false 2023-09-03 13:39:51 -04:00
tyzillion e3c9c16add Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-09-03 12:26:58 -04:00
apion d17f8f90b8 Made berry atlases actually work (only on Fabric for now, this is prototyped af) 2023-09-03 05:56:08 -04:00
Paul 278b36234e Put the pre-render call back so pokeballs animate (oopsy) 2023-09-03 14:43:49 +10:00
Paul 1598c8209a Fixed ternary and boolean-not operators not working in Molang which broke berry friendship increase amounts 2023-09-03 14:38:44 +10:00
DoctorWafflePhD bc9182e37f Numerous scaling fixes. Hitboxes not fixed (yet). 2023-09-02 13:42:20 -05:00
tyzillion 68923dd95f Updated Sprigatito and Braixen, Made Wooper not just be Paldean, Fixes Ratatta texture. Fixes Grotle crash. 2023-09-02 12:03:35 -04:00
apion 1d353bdc5b Added hitboxes to the early stages of berry tree growth 2023-09-02 03:37:31 -04:00
apion df7109ba45 Added flower model/texture, fixed particles in all the tree models 2023-09-02 03:15:39 -04:00
tyzillion ab3449243f Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-09-02 02:25:51 -04:00
Hiroku deb7ece946 Merge branch 'berry' into 'main'
Berries

See merge request cable-mc/cobblemon!595
2023-09-02 06:05:40 +00:00
ApionandHiroku d8f9f8926b Berries 2023-09-02 06:05:40 +00:00
apion 457e7b65c9 Merge remote-tracking branch 'origin/berry' into berry 2023-09-02 01:36:35 -04:00
apion 755d4ea612 Added early stage growth models to all block states 2023-09-02 01:36:27 -04:00
Hiroku ad6bcb1572 Licenses fix (apion banned) 2023-09-02 05:28:15 +00:00
apion 42235a35ee Final asset sync (hopefully) 2023-09-02 00:59:01 -04:00
tyzillion a8f6e66ab4 Updated models and textures for Gyarados, Hitmonchan, Hitmonlee, Serperior, Haunter, Chansey, Blissey, Happiny, Sneasel, Weavile, Spiritomb, Dratini, Dragonair, Dragonite, Pidgey, Pidgeotto, and Pidgeot.
Implemented Paldean Wooper and Clodsire.
2023-09-02 00:50:32 -04:00
apion d6e51b9c55 Merge remote-tracking branch 'origin/berry' into berry 2023-09-01 21:27:00 -04:00
apion d2970c10b3 Added texture atlases for berries, fixed issue in Forge where berry models werent being loaded 2023-09-01 21:26:45 -04:00
tyzillion f3cb2aab87 Implemented Crabrawler, Crabominable, Wimpod, Golisopod, Nincada, Ninjask, Shedinja, Ralts, Kirlia, Gardevoir, Gallade, Beldum, Metang, Metagross, Ursaluna, Lechonk, Oinkologne, Pidove, Tranquil, Unfezant, Timburr, Gurdurr, and Conkeldurr. 2023-09-01 20:56:09 -04:00
tyzillion d9c6522685 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-09-01 20:54:59 -04:00
Hiroku ca54a0abf0 Last one was stereo (THANKS STERR) 2023-09-01 09:18:13 +00:00
Hiroku 1ad743a126 Added berry eat sound effect 2023-09-01 09:16:52 +00:00
Paul cde5a5b408 Added berry juice, fixed Touga sprite/blockstates missing 2023-09-01 19:03:43 +10:00
Paul e6a45fd356 Removed dead code in berry interactions, added medicinal brew sprite, changelog updates 2023-09-01 16:57:00 +10:00
apion c3eb05e5c6 More asset sync (again) (YAY!) Also disabled berry tinting 2023-08-31 19:54:26 -04:00
apion a82dee2beb More asset sync (again) (YAY!) Also disabled berry tinting 2023-08-31 19:54:05 -04:00
apion 8099bfe330 Merge branch 'main' into berry
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/util/MoLangExtensions.kt
2023-08-31 19:11:18 -04:00
Paul 9d8803caf2 Make entity accessible from poseable entity state 2023-09-01 09:01:12 +10:00
Veraxiel 7074a63f95 Updated existing spawn files. Added preset for Flowers and Gemstones. Removed preset for Underground. Updated Natural preset. 2023-08-31 04:35:04 -04:00
apion 95d6a1c183 More asset sync 2023-08-31 00:08:02 -04:00
apion 4fd433b072 Actually fixed berries rendering when off screen (you were right the first time Hiroku) 2023-08-28 21:10:29 -04:00
apion dc6804bba6 Moved mulch logic into the berry block entity 2023-08-28 18:50:55 -04:00
Paul 3e005e5032 Merge branch 'main' into implement_pokemon 2023-08-28 18:27:51 +10:00
Paul 08827a742f Fixes to particle effects in bedrock animations 2023-08-28 18:27:19 +10:00
Paul f93e8e221a Fixes to particle effects in bedrock animations 2023-08-28 18:27:03 +10:00
Paul cc7433025f Slow torterra down so we can watch him do the walk 2023-08-28 18:26:34 +10:00
Paul aa17482a6e Fixed Mamoswine crash 2023-08-28 18:00:58 +10:00
tyzillion 7f0f6e7c4d Implemented Fletchling, Fletchinder, and Talonflame. Shulker Forretress. 2023-08-27 20:38:38 -04:00
Paul 16a0cd1fe7 Updated heaps of berry assets and placements 2023-08-27 21:50:38 +10:00
tyzillion 2fc9d587d9 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-08-27 07:38:44 -04:00
Paul a6a76052a6 Fixed various items not preventing off-hand interactions from playing 2023-08-27 15:58:57 +10:00
Paul abeb005bbb Improve error logging for bad MoLang expression parsing from String.asExpression 2023-08-27 13:05:03 +10:00
Paul 6835232aa6 Added support for effect looping in non-loop animations 2023-08-27 13:04:47 +10:00
Paul 78ebc9a9eb Added MoLang instructions: s.sound(effect, volume, pitch) and s.random(...) 2023-08-27 13:04:06 +10:00
Paul f5e85971f3 Made Pokémon appear red when hurt 2023-08-27 11:11:53 +10:00
tyzillion 1d950d9640 Update when? When Update? Implemented Johto Starters.
Update when? Update? Update when? Update? When Update? Update?
2023-08-26 02:55:28 -04:00
tyzillion 3b63f88669 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-08-26 02:52:51 -04:00
Hiroku e85b2aa138 Merge branch 'battle_bugs_1' into 'main'
Fix Shedinja HP and Faint Softlock.

Closes #341 and #400

See merge request cable-mc/cobblemon!593
2023-08-26 02:33:53 +00:00
Segfault Guy 371e1426a3 Fix Shedinja HP and Faint Softlock. 2023-08-25 22:24:54 -04:00
Hiroku 256e09846d Merge branch 'main' into 'main'
Made Master Balls Fireproof (won't disappear when thrown in lava/fire)

See merge request cable-mc/cobblemon!591
2023-08-26 01:49:13 +00:00
RetroandHiroku dd2d441b0c Made Master Balls Fireproof (won't disappear when thrown in lava/fire) 2023-08-26 01:49:13 +00:00
tyzillion 4f35e8348d Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-08-25 12:43:12 -04:00
tyzillion 36c76b96b3 Implemented Komala,Phantump,and Trevenant all with wood variants. 2023-08-25 12:42:39 -04:00
Nick ddc57ecd8d Merge branch 'fixed-tag-file' into 'main'
Fixed tag file

See merge request cable-mc/cobblemon!592
2023-08-24 19:50:57 +00:00
Deltric 202a6a0496 Fixed tag file 2023-08-24 14:26:32 -05:00
Hiroku fbc639cbf3 Merge branch 'power-items' into 'main'
Added in Power Items

See merge request cable-mc/cobblemon!580
2023-08-24 09:38:51 +00:00
DeltricandHiroku 78faf30b32 Added in Power Items 2023-08-24 09:38:51 +00:00
tyzillion 2fe98577b6 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-08-23 15:34:55 -04:00
Hiroku 39cbb448a6 Merge branch 'poke-select' into 'main'
Update Poke Select Interface

See merge request cable-mc/cobblemon!588
2023-08-22 09:21:51 +00:00
TestandHiroku fd10f8efd8 Update Poke Select Interface 2023-08-22 09:21:51 +00:00
Hiroku 9161f61017 Merge branch 'spawn-issue' into 'main'
Bug fixes

Closes #402 and #403

See merge request cable-mc/cobblemon!577
2023-08-22 09:08:40 +00:00
ApionandHiroku 4244680956 Bug fixes 2023-08-22 09:08:40 +00:00
Hiroku 92ad81f8d1 Merge branch 'sound' into 'main'
Various sound updates and volume tweaks

See merge request cable-mc/cobblemon!587
2023-08-22 09:06:17 +00:00
SterrezoandHiroku c1c7106bff Various sound updates and volume tweaks 2023-08-22 09:06:17 +00:00
Hiroku e36b1b22c4 Merge branch 'main' into 'main'
Persistent Data Fix

See merge request cable-mc/cobblemon!589
2023-08-22 09:05:39 +00:00
ItsJustChris85 e21d445e14 Persistent Data Fix 2023-08-22 00:51:00 -04:00
tyzillion dadeb2670b Made fixes to my last push and implemented Starly, Staravia,
and Staraptor.
2023-08-20 14:22:46 -04:00
tyzillion aedca9e969 Updated Roggenrola line, Misdreavus line, Exeggcute, Golduck, Elekid, Electabuzz, and Chesnaught models, textures, and animations, updated Spinda model, texture, and animation. Added 2 new spots too. Updated Slowking texture, Implemented Alolan Exeggcute. 2023-08-20 12:14:25 -04:00
tyzillion e1ca6bbc94 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-08-20 12:13:14 -04:00
apion 22d66103b6 Added missing berries, fix desert grove spawning, decrease chance of groves 2023-08-20 06:14:33 -04:00
apion 0e2a0af914 Asset sync 2023-08-20 05:07:49 -04:00
Paul 098ff1f96b Clamp set level within bounds instead of throwing exceptions (means we don't corrupt storages) 2023-08-20 17:21:25 +10:00
Paul f93445f081 JvmOverloads in battle builder, closes #410 2023-08-20 17:06:50 +10:00
Paul 85a962e924 Licenses 2023-08-20 15:13:23 +10:00
Paul f6d0f11c99 Implemented uncatchable, fixed some capture calculation issues, added PokeBallCaptureCalculatedEvent and PokemonCatchRateEvent 2023-08-20 13:51:08 +10:00
Paul e74b838fb2 Fixed lighting of pokemon model items 2023-08-20 10:35:29 +10:00
apion 7591345181 Fixed probability calculations 2023-08-18 06:53:35 -04:00
apion 8d157a5ad5 Added berry spawns to villages, add licenses 2023-08-18 05:50:06 -04:00
tyzillion d41ef023ff Implemented cries for Mudbray, Mudsdale, Fennekin, Braixen, Delphox, Buneary, Lopunny, Snivy, Servine, and Serperior. Updated models and textures for Snivy, Servine, Serperior, Buneary, and Lopunny. Updated animations for Mudbray and Mudsdale. 2023-08-17 20:59:30 -04:00
apion 8b857881a8 Merge branch 'implementing-naturally-generated-structures' into berry 2023-08-17 05:09:26 -04:00
apion 995a8c2dc0 Got structure processor + overrides working 2023-08-17 05:08:00 -04:00
tyzillion 30b769db13 Fixed issues with Galarian Meowth and Perrserker. Added proper cries to Farfectchd and its Galar counterpart. Updated Corviknight, Fenniken, Braixen, and Delphox model and animations. Updated Rookidee and Corvisquire's animations. Merged Braixen's textures and gave it animated textures. 2023-08-17 00:17:36 -04:00
tyzillion ac7bd33f08 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-08-17 00:13:54 -04:00
apion 4dc7accef9 Testing mixin 2023-08-16 19:07:53 -04:00
apion 90b8923b98 Merge branch 'main' into implementing-naturally-generated-structures
# Conflicts:
#	common/src/main/resources/cobblemon-common.accesswidener
#	common/src/main/resources/mixins.cobblemon-common.json
#	fabric/src/main/kotlin/com/cobblemon/mod/fabric/CobblemonFabric.kt
#	forge/src/main/kotlin/com/cobblemon/mod/forge/CobblemonForge.kt
2023-08-15 22:17:11 -04:00
apion 9a7e4d05f0 Added JEI integration for berry mutations 2023-08-15 21:35:35 -04:00
Paul 8d981d1b05 Added brewing recipes for all the medicine 2023-08-16 08:45:13 +10:00
apion f5bf60dd37 Added some caching to berry generation 2023-08-14 15:39:53 -04:00
apion 585eb2a946 Add missing license headers 2023-08-14 14:35:52 -04:00
apion ee38a90aad Berry data update 2023-08-14 14:33:10 -04:00
apion d9fc5f5c90 Added system for controlling where berries spawn 2023-08-14 14:32:51 -04:00
apion 5d9be82e8f Added random spawn of berries. (Need system to disable certain berries from spawning) 2023-08-14 04:18:39 -04:00
apion 808a238d2a Swapped to deserializing preferred biomes to actual tags 2023-08-14 03:54:18 -04:00
tyzillion 69908c1ab5 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2023-08-13 22:24:13 -04:00
tyzillion f8cdcde27c Implemented cry animations for Miltank and Treeko. Updated Pikachu and Raichu and implemented their alolan counterparts. same for Rattata and Raticate but updated theirs, also gave alolans their own poser. Gave Krabby and Kingler a placeholder walk. Added Cherry tree Torterra with petal particles. Gave shiny Gastly blue particles. Made Slugma and Magcargo's particles match their shinies. Updated Corviknight, Fennekin, Braixen, Delphox, Snivy, Servine, Serperior, Steelix, Meowth, and Persian models. Updated Meowth and Persian Models. Update Mudbray and Mudsdale textures. Implemented Alolan and Galarian, Meowth and Persian. Implemented Miltanks Mooshtank forms. 2023-08-13 22:23:14 -04:00
apion 0a505bec75 Got growth mulch working. Also added a block ticker to berry trees for more controlled growth times 2023-08-13 02:19:05 -04:00
tyzillion 948d599390 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon
# Conflicts:
#	CHANGELOG.md
2023-08-12 22:16:21 -04:00
apion f561141315 Got all mulches except growth working for berries 2023-08-12 21:04:50 -04:00
apion 8419b140a7 Berry data update 2023-08-12 20:13:06 -04:00
DoctorWafflePhD 4be1ab3cac Cry implementation for Chimchar line, and Cleffa poser tweaks, 2023-08-12 15:34:39 -05:00
apion 12824f6f4f Merge remote-tracking branch 'origin/main' into berry
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonItems.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/tags/CobblemonBlockTags.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/CobblemonClient.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/item/group/CobblemonItemGroups.kt
2023-08-12 14:37:47 -04:00
Paul 60df079794 Improve performance of berry tree rendering by only rendering berries when they are on-screen 2023-08-12 18:43:50 +10:00
apion 1924862fcb Fixed renderer again (please let this be the last time) and fixed pecha clipping 2023-08-12 00:45:00 -04:00
apion dba3de83fa Updated script to grab tint index values from asset repo, fixed renderer (Hiroku) and updated colors (again) 2023-08-11 19:48:09 -04:00
apion df30a209a5 Once again, synced the mature tree model, berry textures, and berry geographies for berries 1-24 from the asset repo 2023-08-10 21:30:01 -04:00
apion 0fea0966c0 Added berry geographies 2023-08-10 19:53:25 -04:00
apion 727fc969fa Hopefully fixed rendered? 2023-08-10 19:30:17 -04:00
apion c17ae13578 Fixed typo 2023-08-10 16:17:45 -04:00
apion 8e09051bf7 Synced some textures from the asset repo, BerryBlockRenderer changes. 2023-08-10 15:58:27 -04:00
apion 4f03643840 Synced models for berries 12-24 to asset repo 2023-08-09 19:43:42 -04:00
apion 6cdab8f296 Updated models for berries 1-12 to the ones from the asset repo, add tints for berries 1-12 2023-08-09 16:28:57 -04:00
apion fc1bade1d1 Fixed a few model typos, made berry foliage colors fall back to leaf colors 2023-08-09 14:31:39 -04:00
tyzillion fd5132b317 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-08-08 18:59:01 -04:00
apion 544efc80d5 Update all berry data to come from the GDrive spreadsheets 2023-08-08 12:19:30 -04:00
apion 43fe97a6fe Added a growth factor to berries affected by their current biome. Also added script to generate berry data from spreadsheet data 2023-08-08 12:02:25 -04:00
tyzillion f021faf0d3 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-08-07 18:14:00 -04:00
nlingebretson 965196da2e Added placement data for berry trees 1-14 2023-08-06 13:36:35 -05:00
Paul 72c4cc0992 Undid battle debug stuff because I forgot, again 2023-08-05 17:10:47 +10:00
Paul b0838e88fd Put berries in the agriculture tab instead 2023-08-05 17:09:52 +10:00
Paul 925d7ce2dc Added berry interaction + bag item effects, berry eat sound hook, berry eating lang, berries to creative tab 2023-08-05 17:08:00 +10:00
tyzillion 2b562ace12 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-08-04 19:29:12 -04:00
Paul a4000a6c0f Merge remote-tracking branch 'origin/main' into berry
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonItems.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonEntity.kt
2023-08-04 11:19:50 +10:00
tyzillion a56d24b9dc Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2023-08-01 19:33:32 -04:00
Sterrezo 607b59a978 Implemented cries for Spearow, Fearow, Arbok, Ekans, Pichu, Pikachu, Raichu
Removed empty space from Espeon's model.kt file
2023-08-02 00:47:00 +02:00
tyzillion b8eb2c708e Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-07-31 18:37:19 -04:00
tyzillion 7bffc44db0 Updated animations for Venusaur, Mankey, Tauros, Cleffa, Quagsire, Piplup, Prinplup, Empoleon, Primeape, Poppolio, Bionne, Prismarina, and Mimikyu. Tweaked some portraits. Fixed Aipom texture and Ambipom's crash. 2023-07-28 20:16:51 -04:00
tyzillion 1099ce055a Updated animations for Ponyta, Galarian Ponyta, Rapidash, Abra, Aipom, Ambipom, Chingling, Snubbull, Breloom, Gible, Gabite, Klank, Klinklang, Rookidee, Corvisquire, Quaxly, Quaquaval, Tinktaton, and Annihilape. Added cry sound to Ponyta, Galarian Ponyta, Rapidash, Quaxy, and Quaquaval cry animation. 2023-07-27 22:57:33 -04:00
tyzillion de5e958bf3 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon
# Conflicts:
#	CHANGELOG.md
2023-07-27 22:56:15 -04:00
Sterrezo ab6494a2f6 Implemented stuff properly this time. Added Fuecoco line cries.
My previous pushes were missing code in model.kt files. Everything's working now. Fuecoco line has final animations, I only added sound. I also corrected a typo in sounds.json
2023-07-26 18:56:16 +02:00
Sterrezo 967fbd2608 Placeholder cry animations for Espeon, Umbreon, Leafeon, Glaceon, Sylveon. Fixed Lucario's placeholder cry animation. 2023-07-26 17:03:54 +02:00
DoctorWafflePhD e6ffd2e16d Implemented cry animations for Turtwig, Grotle, and Torterra. 2023-07-25 04:47:07 -05:00
DoctorWafflePhD 8ff0835e4e Fixed Empoleon cry. 2023-07-25 03:29:43 -05:00
DoctorWafflePhD 301df2e1d1 Implemented cry animations for the Piplup line. 2023-07-25 00:39:20 -05:00
DoctorWafflePhD 4c4f79494b Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2023-07-24 21:59:40 -05:00
DoctorWafflePhD bcd998d690 Implemented cry animations for Cleffa, Wooper, Quagsire, Piplup, and Mimikyu. 2023-07-24 21:52:34 -05:00
Sterrezo 7ab3c18762 Added placeholder cry animations and 19 new cries
Placeholder cry animations for Riolu, Lucario, Wooloo, Dubwool. Added 19 new cries. Updated Tauros cry. I'll update the changelog once all cries are implemented.
2023-07-24 22:43:58 +02:00
tyzillion ddb426674f Added blank crys to all Pokemon that don't have a cry atm, added blank ambients to gen 9 Pokemon. Updated sound.json with new sound references. Edited or added cry animations with sounds for Bulbasaur line, Charmander line, Squirtle line, Caterpie line, Weedle line, Pidgey line, Rattata line, Clefairy line, Tauros, and Eevee gen one line. 2023-07-23 15:26:36 -04:00
tyzillion 6c93a6c1a8 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-07-23 15:20:42 -04:00
tyzillion 28d0ae9b75 Fixed Wishiwashi crash. Resized Turtwig. Added Paldea starters to starter select. Added blank crys to all Pokemon, added blank ambients to gen 9 Pokemon. Updated sound.json with new sound references. 2023-07-20 21:05:39 -04:00
tyzillion 742a6b244f Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon
# Conflicts:
#	CHANGELOG.md
2023-07-20 19:18:44 -04:00
tyzillion 4c5fcf5310 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon
# Conflicts:
#	CHANGELOG.md
2023-07-20 15:34:43 -04:00
tyzillion aaf5f4d354 Multiple Pokemon resized. Changed walkspeed for Bergmite, Linoone, Wingull, Turtwig line and Piplup line. Added flying ai to Cottonee, Whimsicott, and Kricketune. Made Avalugg properly float. Fixed Tinktatink line not using battle idle. Fixed Numels texture issues. Fixed Braixens texture. Edited hitbox for Granbull, Skeledirge, Maschiff, and Mabosstiff. Added implemented to json for Surskit line and Phanpy line. Fixed Caterpie animation. 2023-07-17 20:19:52 -04:00
Lily f6cbadff61 mulch can now be used on berry trees and removed using a shovel 2023-07-17 20:05:10 -04:00
tyzillion 5414cbcc14 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2023-07-16 22:10:53 -04:00
tyzillion 3104239a9f Implemented Wishiwashi, Galarian Zigzagoon, Galarian Linoone, and Obstagoon. Updated animations and models for Barboach, Wailord, Illumise, Volbeat, Scorbunny, Mimikyu, Turtwig, Grotle, Torterra, Kricketot, Kricketune, Bergmite, Avalugg , Shroomish, Bonsly, Mudsbray, Mudsdale, Arrokuda, and Barraskewda. Added emissive for Sharpedo. Tweaked walk speeds on Drowzee, Murkrow, Turtwig, Grotle, and Torterra. Added flying behavior to Honchkrow. Actually fixed Cacnea's size. 2023-07-16 22:10:41 -04:00
Lily e10e048e2c Merge remote-tracking branch 'origin/main' into berry
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonBlockEntities.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonBlocks.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonItems.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/CobblemonClient.kt
2023-07-16 20:18:05 -04:00
DoctorWafflePhD 32a360ba0c Updated Stufful and Bewear's model and animation files. 2023-07-16 17:32:04 -05:00
DoctorWafflePhD 99d190abff Fixed Vivillon wings issue for Icy Snow and High Plains patterns. 2023-07-16 16:54:46 -05:00
tyzillion 33aa3043c6 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-07-16 15:55:33 -04:00
tyzillion 4577c36afb Implemented Phanpy, Donphan, Buizel, Floatzel, Zigzagoon, Linoone, Cottonee, and Whimsicott. 2023-07-16 00:43:37 -04:00
tyzillion 6d9d5d1533 Implemented Snubbull, Granbull, Maschiff, and Mabosstiff. 2023-07-15 02:03:18 -04:00
tyzillion a6cc7b77bb Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-07-14 18:19:33 -04:00
tyzillion 3ef2eca934 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-07-12 18:11:01 -04:00
tyzillion e81eaa5b57 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-07-11 18:25:59 -04:00
tyzillion edc5ce5fb4 Implemented Fuecoco, Crocalor, Skeledirge, Quaxly, Quaxwell, and Quaquaval. Added a way to disable x or y head movement on the look animation. 2023-07-10 23:11:05 -04:00
tyzillion b1b7d3fea2 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2023-07-10 18:26:03 -04:00
tyzillion 7ee88cefe5 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon
# Conflicts:
#	common/src/main/resources/data/cobblemon/species/generation1/pidgey.json
#	common/src/main/resources/data/cobblemon/species/generation1/pikachu.json
#	common/src/main/resources/data/cobblemon/species/generation1/zubat.json
#	common/src/main/resources/data/cobblemon/species/generation2/pichu.json
#	common/src/main/resources/data/cobblemon/species/generation2/wooper.json
#	common/src/main/resources/data/cobblemon/species/generation5/joltik.json
2023-07-10 18:23:45 -04:00
Soul Eternum 2cfa9f8985 Added a fallback locator for particle animations 2023-07-10 16:38:51 -05:00
tyzillion 5bab095036 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-07-09 21:56:38 -04:00
tyzillion c394f56548 Implemented Tinkatink, Tinkatuff, Tinkaton, Yamper, and
Boltund.
2023-07-09 21:55:54 -04:00
tyzillion dc270bb64e Implemented Volbeat, Illumise, Galarian Ponyta, and Galarian Rapidash. Fixed Wingull's animation typo. Implemented Wingull and Pelippers water surface animations. Made quirks play less frequently on Ponyta and Farfetched. Added "implemented": true, to Shroomish, Breloom, Hoothoot, Noctowl, Numel and Camerupt's species json. Fixed Serperior's crash. Exeggcute model and animations updated. Model updates for Chansey, Blissey. Texture update for Happiny. 2023-07-09 05:22:04 -04:00
tyzillion 8c6c3a6ca0 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon
# Conflicts:
#	CHANGELOG.md
2023-07-08 19:34:10 -04:00
tyzillion ac05f24646 Added Glimmora's battle idle. Fixed Riolu and Lucario models. Tweaked Riolu and Lucario's scale and hitbox. Updated Wingull and Pelipper's animations. 2023-07-06 23:27:09 -04:00
tyzillion 2b3045594b Deleted shoulder effects, learn to make potions, losers.
(You can always add them back via datapacks!)
2023-07-06 21:14:53 -04:00
tyzillion 86d8fb01ef Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-07-06 20:56:09 -04:00
tyzillion fe9a1c7e99 Implemented Annihilape, Squawkabilly, Shroodle, and Grafaiai. Updated Rapidash, Taillow, and Swellow's animation. Updated Mankey, Primeape, Haunter, Voltorb, Electrode, Riolu, Lucario, and Serperior with remodels/revamps. 2023-07-06 20:55:38 -04:00
tyzillion a9735c69cb Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-07-06 15:57:59 -04:00
tyzillion bf401d1ff0 Implemented Arrokuda, Barraskewda, Bunnelby, and Diggersby. Edited Wingull and Pelipper's scale and hitbox. 2023-07-05 23:13:16 -04:00
tyzillion fb6e65d868 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-07-05 14:17:04 -04:00
tyzillion aa04b27500 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-07-04 22:33:10 -04:00
tyzillion 954d6fa156 Added emissives to Yamask and Cofagrigus eyes. Made Yamask and Cofagrigus fly. Implemented Skrelp, Dragalge, Patrat, Watchog, Mareep, Flaaffy, and Ampharos. Made Wooloo and Dubwool smaller. Fixed Varoom and Revavroom's wheel spinning when changing from walk to idle. Updated model and texture of Mewtwo and Mew. 2023-07-04 22:32:47 -04:00
tyzillion dd2d22b793 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2023-07-04 13:36:14 -04:00
Xylopia 03bfce766d Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/repository/PokemonModelRepository.kt
2023-07-02 20:15:58 -04:00
Xylopia fab9eed4e1 Added Yamask and Cofagrigus 2023-07-02 20:13:42 -04:00
tyzillion 123ed403ae Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-07-02 20:08:19 -04:00
tyzillion 0c763e3715 Implemented Roggenrola, Boldore, Gigalith, Numel, Camerupt, Shinx, Luxio, Luxray, Aipom, Ambipom, Hoothoot, Noctowl, Wingull, and Pelipper. Added placeholder wing flying animations to Articuno, Zapdos, Moltres, Scyther, Scizor, Golbat, and Crobat. Updated Model of Mr.Mime, Cacnea, Prinplup, Empoleon, Hypno, Cacnea, and Farfetchd. Updated Animation of Cacnea, Cacturne, Scatterbug, Spewpa, Garganacl, Farfetchd, Ponyta, Drowzee, Piplup, Prinplup, and Empoleon. Mr_Mime texture updated. Tweaked UI frames of Exeggutor. Added particles to Spewpa. Gave Alolan Vulpix and Ninetales its own poser. 2023-07-02 19:23:49 -04:00
DoctorWafflePhD b52a0a0ebd Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2023-07-01 20:53:16 -05:00
tyzillion 9c1edea469 Updated Changelog. 2023-07-01 17:23:52 -04:00
tyzillion 87d8c17f4f Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen1/ArcanineModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen1/ElectabuzzModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen1/FearowModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen1/ScytherModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen2/ElekidModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen3/LotadModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen4/ElectivireModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen4/LickilickyModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen7/DecidueyeModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen7/RowletModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen9/WalkingwakeModel.kt
2023-07-01 17:22:13 -04:00
Paul 506aafbdf0 Merged from main and added berries to creative menu 2023-07-01 21:25:20 +10:00
Paul 814bba5273 Merge remote-tracking branch 'origin/main' into berry
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonItems.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/events/CobblemonEvents.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/CobblemonClient.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/VaryingRenderableResolver.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonEntity.kt
#	common/src/main/resources/cobblemon-common.accesswidener
2023-07-01 21:08:11 +10:00
Paul b5475b0e3e Multi-axis rotations on berries, cleaned rendering logic for pokeballs and berries, cleaned berry block entity logic 2023-07-01 21:05:32 +10:00
Paul 3ab5a4daf3 Use less inflation on torchic male form since it does every direction 2023-07-01 15:21:48 +10:00
Paul f7672e66ab Fixed Torchic gender difference not being visible due to pane with no inflation 2023-07-01 15:09:02 +10:00
Paul 61d926a23d Fixed Varoom and Revavroom crashing asset loading due to animation typos 2023-07-01 15:03:34 +10:00
Paul 5ab364f0ab Fixed Farfetch'd not having a Galarian form 2023-07-01 15:02:49 +10:00
tyzillion 734d2b2414 Added emissives to Lanturn and Relicanth. Made Corviknight 5 blocks big. Made Gorebyss and Huntail swim faster. 2023-06-30 14:16:26 -04:00
tyzillion 0763a96f34 Updated models for Garganacl and Magikarp Male. Updated animation for Mudbray, Mudsdale, Varoom, and Revavroom. 2023-06-30 13:18:05 -04:00
DoctorWafflePhD 2ae4ba68e4 Dugtrio also no longer floats in water. 2023-06-29 12:49:14 -05:00
DoctorWafflePhD 750adabba1 Diglett now sinks to the ocean floor instead of floating. Not that we intend to have Diglett in the water anyways, but...
Dodrio's legs move at a more appropriate pace when walking.
Slowpoke's placeholder leg movements are more noticable.
2023-06-29 12:48:42 -05:00
DoctorWafflePhD a914a69051 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2023-06-28 00:41:47 -05:00
DoctorWafflePhD beacc319b9 Fixed model issues on Scolipede and Espathra. 2023-06-28 00:41:38 -05:00
tyzillion c48b7b980b Updated Elekid line model overhaul. Fixed Whirlpede and Scolipede sleep crash and implemented their battle idles. Fixed Floragato's t-pose issue. Gave Wooper his floating and swimming poses. Dusknoir doesn't move his eye while in battle but will still look at the player outside of it. Ceruledge now has his passive blades outside of battle and his big blades in battle. 2023-06-28 00:34:18 -04:00
nlingebretson c60a3939a4 We sent the berries to flavor town (not clickbait) - added flavor values to berries and pointed each berry tree to use correct models for flowering berries 2023-06-27 20:53:54 -05:00
tyzillion d553483dcb Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon
# Conflicts:
#	CHANGELOG.md
2023-06-27 20:14:11 -04:00
DoctorWafflePhD c9f1a61bf5 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2023-06-26 04:20:50 -05:00
DoctorWafflePhD 84d58bf2d9 Changed the sizes of many Pokémon.
Fixed missing texture with Poké Ball Vivillon.
Fixed AI on a handful of Pokémon.
2023-06-26 04:20:37 -05:00
nlingebretson c0c49cc951 Updated growth time and refresh rate in berry data files, replacing the previous lifecycle data 2023-06-25 12:39:26 -05:00
nlingebretson fe08a94540 Updated Base Yield and Bonus Yield (bonus is temporary stored in growthFactors - will move to preferred biomes) 2023-06-25 11:19:32 -05:00
tyzillion df35528a53 Updated Dusknoir animation and Model. Framed and modified sizes and hitboxes of multiple Pokemon. 2023-06-21 19:22:26 -04:00
tyzillion 405f6e91de Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-06-21 19:11:22 -04:00
DoctorWafflePhD ac072e5a88 Adjusted walk speeds of Charcadet line, Exeggcute line, Popplio line, and Lickitung line. 2023-06-17 02:35:45 -05:00
DoctorWafflePhD ca0b098866 Merge branch 'main' into implement_pokemon 2023-06-16 21:11:40 -05:00
DoctorWafflePhD 3fd13dd47c Chingling now shoulder-mountable (and doesn't sleep on your shoulder). Also fixed advancements background. 2023-06-16 21:10:28 -05:00
DoctorWafflePhD 38bc7e1bde Merge branch 'main' into implement_pokemon
# Conflicts:
#	CHANGELOG.md
2023-06-16 17:55:00 -05:00
DoctorWafflePhD 6497d770dd Chingling now shoulder-mountable 2023-06-16 17:48:32 -05:00
DoctorWafflePhD 2410fa6578 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen7/CutieflyModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen7/RibombeeModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen9/GlimmetModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen9/GlimmoraModel.kt
2023-06-16 00:11:17 -05:00
DoctorWafflePhD 32e1623998 Implemented animations for Cutiefly line and Glimmet line. 2023-06-16 00:08:38 -05:00
tyzillion 31799ad144 Updated animations of Venipede, Whirlipede, Scolipede, Cutiefly, Ribombee, Falinks,Exeggcute, Exeggutor, Lickitung, Lickilicky, Breloom, Chimecho, Chingling, Golett, Glimmet, and Glimmora.
Updated Models of Cutiefly, Ribombee, Venipede, Whirlipede, Scolipede, and Breloom.
2023-06-15 21:10:09 -04:00
tyzillion b60f7ba22e Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon
# Conflicts:
#	CHANGELOG.md
2023-06-15 21:09:28 -04:00
Paul 9a03c17a0c Berry stuff on 1.19.4 and fixed some missing data 2023-06-11 20:56:54 +10:00
Paul 1bc2295b70 Added pokeball entity to capture event 2023-06-11 19:16:56 +10:00
Paul 37cd4ff11b Merge remote-tracking branch 'origin/main' into berry
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonBlockEntities.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonBlocks.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonEntities.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonItems.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonNetwork.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/events/CobblemonEvents.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/interaction/PokemonEntityInteraction.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/item/Berries.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/item/Berry.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/tags/CobblemonBlockTags.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/CobblemonClient.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/net/ClientPacketRegistrar.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/item/CobblemonItemGroups.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/item/interactive/CandyItem.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/item/interactive/InteractiveItem.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/item/interactive/LinkCableItem.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/item/interactive/VitaminItem.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/util/NetExtensions.kt
#	common/src/main/resources/assets/cobblemon/lang/en_us.json
#	common/src/main/resources/assets/cobblemon/textures/block/berry_leaf.png
#	common/src/main/resources/assets/cobblemon/textures/block/coba_tree.png
#	common/src/main/resources/assets/cobblemon/textures/block/leaf.png
#	common/src/main/resources/assets/cobblemon/textures/block/rawst_tree.png
#	common/src/main/resources/assets/cobblemon/textures/block/vines.png
2023-06-11 14:30:03 +10:00
nlingebretson 5f9108400b Rework of berries to include a growth time and refresh rate 2023-06-10 21:04:57 -05:00
DoctorWafflePhD c80ef7a8c0 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2023-06-10 16:43:06 -05:00
DoctorWafflePhD 7bdc302583 Implemented Venipede, Whirlipede, and Scolipede. 2023-06-10 16:32:22 -05:00
DoctorWafflePhD 8de2a12323 Implemented sleeping bubbles onto the sleeping particle. 2023-06-10 07:07:43 -05:00
tyzillion 6004c153d3 Broke up with Validate Animations.
- ValidateAnimations.kt removed
Pipeline restored.
2023-06-09 23:58:13 -04:00
DoctorWafflePhD ac96ad3720 Implemented updated Falinks. 2023-06-09 01:03:38 -05:00
DoctorWafflePhD a06793616d Tweaked the sleeping particle a bit, and tweaked the position of the sleep locator on Vivillon and Bonsly. 2023-06-09 00:44:24 -05:00
DoctorWafflePhD 97f545bd4e Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2023-06-09 00:35:29 -05:00
Paul a267b63df2 Fixed Falinks torso name replacement insanity I wanna unalive 2023-06-09 15:35:05 +10:00
Paul ea9d961fd8 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2023-06-09 09:00:48 +10:00
Paul 51396f94b1 Merge remote-tracking branch 'origin/main' into implement_pokemon 2023-06-09 08:59:25 +10:00
tyzillion 412dc73d9d "Sir, know why I pulled you over? No? Let me see your license. No? Well then I am gonna have to fail your pipeline. Sit tight."
Cacnea crash fixed and license updated.
2023-06-08 17:57:48 -04:00
DoctorWafflePhD c605e2d030 Tweaked the sleeping particle & made it exist on a special "particles" animation file so that any model may use it without having to edit every sleeping animation to include particle data. 2023-06-08 10:51:37 -05:00
DoctorWafflePhD d5c93b60a9 Implemented a proof-of-concept sleeping particle. Currently it only applies to Vivillon. 2023-06-07 11:44:13 -05:00
DoctorWafflePhD 7d8c6aef8e Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2023-06-06 21:57:02 -05:00
DoctorWafflePhD 3c593ea3ed Implemented (not-yet-officially-approved) Bonsly animations and made it a tad larger. Fixed a small issue with Cetitan's model rendering both mouths at once. Fixed a pivot point issue on Charcadet. Fixed an incorrectly-registered quirk on Alolan Exeggutor. 2023-06-06 21:39:10 -05:00
DoctorWafflePhD 5a7732588d Implemented Cetoddle and Cetitan. Touched up Glimmora's size. 2023-06-06 13:03:27 -05:00
DoctorWafflePhD 25488ae972 Implemented Bouffalant, and Cinderace remodel. Added missing "implemented" keys to Bonsly and Sudowoodo's species files. 2023-06-05 20:22:14 -05:00
tyzillion 4bf9733fe6 Implemented Cacnea, Cacturne, Nickit, Theivul, Duskull, Dusclops, and Dusknoir. 2023-06-05 21:19:45 -04:00
tyzillion 0672aebd61 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2023-06-05 21:18:52 -04:00
Waffle 5db7d6380f Bonsly, Sudowoodoo, Glimmet, & Glimmora implemented. 2023-06-05 19:38:01 -05:00
Waffle 7f90a6ffec Huntail now uses the same "slithering" behavior as Ekans when on land. Doduo and Dodrio now walk significantly faster. 2023-06-05 19:36:52 -05:00
Waffle d45f0e382b Fixed incorrect hitbox and scaling of Kricketot and Kricketune. Kricketune is now shoulder-mountable. 2023-06-05 14:27:01 -05:00
tyzillion fab6d6e82d Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon
# Conflicts:
#	CHANGELOG.md
2023-06-04 20:34:33 -04:00
Waffle a79c61c5a4 Touched up UI positioning for Popplio line & Aerodactyl. Fixed incorrect package lines in Popplio line posers. 2023-06-04 10:00:56 -05:00
Waffle 3dfe05dccd Implemented updated Bidoof/Bibarel shiny textures 2023-06-04 06:06:44 -05:00
tyzillion e485484051 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2023-06-03 13:07:35 -04:00
tyzillion 865ddcd59b Fixed Pidgeotto flapping during idle instead of while flying. 2023-06-03 13:07:16 -04:00
Waffle 999070b270 Touched up Tandemaus and Maushold and added/tweaked some of their anims. 2023-06-03 11:40:50 -05:00
Waffle 00d1590790 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2023-06-03 05:49:02 -05:00
tyzillion 6cc17a08dc Bird Pokemon are actually drones created by the government. Source: KFC
Added flying placeholder animations to Pidgey, Pidgeotto, Pidgeot, Chatot, Rookidee, Corvisquire, Corviknight, Taillow, Swellow, Rowlet, Dartrix, and Decidueye.
2023-06-03 01:23:58 -04:00
tyzillion 60911f3ec7 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-05-31 20:59:20 -04:00
tyzillion 7f1a35fffe funny license go brrrrrr
(Added "implemented": true, to the Pokemon I added so far, cuz oversight.)
2023-05-31 20:57:07 -04:00
tyzillion 10f5fd673e Implemented Alolan Exeggutor, Galarian Farfetchd, Rookidee, Corvisquire, Corviknight, and Sirfetchd. 2023-05-31 20:41:10 -04:00
Waffle 765921d219 Updated Bidoof's model to the pivot-fixed version. 2023-05-30 08:29:47 -05:00
tyzillion 2422e60aa1 Updated Popplio, Brionne, and Primarina's models. Updated animations for Popplio and Brionne. Fixed Exeggutor crash. Implemented Barboach, Whiscash, Combee, Vespiquen, Lillipup, Herdier, and Stoutland. 2023-05-29 18:37:16 -04:00
Paul e9265eb0a6 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2023-05-29 18:30:03 +10:00
Paul 07ad7db139 Improved test error clarity and removed unsafe operation in ValidateAnimations 2023-05-29 18:29:56 +10:00
Waffle 159ecf5ffa Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon
# Conflicts:
#	CHANGELOG.md
2023-05-29 00:33:16 -05:00
tyzillion 12be2c7b7b Removed Klevin, fixing pipeline fails. 2023-05-29 01:29:23 -04:00
Waffle 95590a2673 Fixed Maushold-Three's model not rendering. Pidgeot moves a little quicker. 2023-05-29 00:23:58 -05:00
tyzillion 869f6b1120 Added animations that just added sleep to Arcanine, Jigglypuff line and Vulpix Line. Updated animations to Greninja, Eiscue, Luvdisc, Chimchar, Monferno, Infernape, Flittle, Espathra, Sobble, Drizzile, and Inteleon. Updated Model for Chimchar, Espathra, Torchic, Combusken, Blaziken, Exeggcute, Exeggutor, Lickilicky, Pichu, and Drizzile. Fixed Flittle having float being used instead of hover. Updated model and animation for Raichu. updated conditions on multiple faints. 2023-05-29 00:54:33 -04:00
tyzillion 2cdfac02e6 Updated shiny Dwebble and Crustle texture. Updated Heatmor, Aerodactyl, Greninja, Charcadet, Armarouge, and Ceruledge animations. Added sleep behavior to Magnemite and Magneton. 2023-05-28 18:46:34 -04:00
tyzillion a9127c7021 Fixed Magnezone, Arcanine,and Mudsdale, fixed missing metal sparks particle. 2023-05-28 17:08:59 -04:00
tyzillion 3023de995a Updated Changelog with Pokemon to be added and remodels. Updated Arcanine, Magnemite, Magneton, Magnezone model and textures. 2023-05-28 14:34:23 -04:00
tyzillion 59c3df6a47 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2023-05-28 14:32:57 -04:00
Waffle 7391e3bc69 Merge branch 'main' into implement_pokemon
# Conflicts:
#	CHANGELOG.md
2023-05-28 06:54:59 -05:00
Waffle 4ab72a6334 Implemented Lotad line's new animations. 2023-05-28 06:15:07 -05:00
Waffle af357aca51 fixup! Implemented Ditto, Shuckle, and Pumpkaboo line's new animations. Pumpkaboo and Gourgeist also now have size variance. 2023-05-28 06:00:08 -05:00
Waffle c7d060bb8d Yanma and Yanmega wings now flap much faster (this was making me irrationally angry) 2023-05-28 03:35:53 -05:00
Waffle c3db5c0525 Vivillon now defaults to Meadow pattern (likely temporary) 2023-05-28 03:35:36 -05:00
Waffle 04328d2b8a Implemented Ditto, Shuckle, and Pumpkaboo line's new animations. Pumpkaboo and Gourgeist also now have size variance. 2023-05-28 03:34:59 -05:00
tyzillion fb03f426c6 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2023-05-26 16:15:52 -04:00
Waffle 00ed7bb0e8 Added missing implemented keys to Scatterbug line's species files 2023-05-25 22:18:02 -05:00
Waffle 38d81ced56 Implemented Garganacl, added missing baseScale and hitbox keys in Nacli and Naclstack species files and fixed their hitboxes, tweaked their walkSpeeds 2023-05-25 22:17:11 -05:00
Waffle 95ecf75a3a Added the fixed Yanma shiny texture. 2023-05-25 20:01:41 -05:00
Waffle 0afde170f4 Tweaked some movement speeds (breloom & naclstack). Also tweaked Naclstack's walk animation slightly. 2023-05-25 19:59:20 -05:00
Waffle 5a312ee6c6 Somehow, Masquerain's wing textures got reverted. Re-reverted them - they should have transparency again. 2023-05-25 08:41:24 -05:00
Waffle 6533da0ed6 Fixed Scatterbug's baseScale and hitbox size. Spewpa now evolves into different Vivillon patterns based on biome. Some patterns are currently awaiting confirmation on obtainment method and are thus unavailable without the use of commands. 2023-05-25 08:37:29 -05:00
Waffle 339ad676ca Implemented Scatterbug, Spewpa, and Vivillon. Vivillon's wing pattern currently defaults to Meadow, and no behavior to determine Vivillon wing pattern based off evolution location is currently implemented. 2023-05-25 05:51:54 -05:00
Waffle 0edc762ff8 Butterfree no longer T-poses while flying, and moves at a speed of 0.4 2023-05-25 05:51:22 -05:00
Waffle 320a3a11b8 Implemented Stufful and Bewear. Both need shiny textures, and use placeholder animations. 2023-05-25 04:20:25 -05:00
Waffle f4d177ce8c Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon
# Conflicts:
#	common/src/main/resources/assets/cobblemon/bedrock/pokemon/animations/0870_falinks/falinks.animation.json
#	common/src/main/resources/data/cobblemon/species/generation8/falinks.json
2023-05-25 01:41:46 -05:00
Waffle f3598e915e Implemented Falinks & updated licenses (haven't run that command in a while teehee). 2023-05-24 23:31:20 -05:00
tyzillion 3314075f6e Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-05-24 19:21:10 -04:00
tyzillion 141296a2d5 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2023-05-24 19:19:59 -04:00
Waffle 48147f460b Implemented Falinks & updated licenses (haven't run that command in a while teehee). 2023-05-24 05:46:41 -05:00
Waffle 2d72fbb82a Implemented Carnivine. Needs animations. 2023-05-24 01:06:03 -05:00
Waffle 98b72f07b6 Added missing implemented key to Cutiefly and Ribombee's species files. 2023-05-24 01:05:33 -05:00
Waffle 465fb2bef4 Implemented the Wooper remodel, as well as some animations ++(.‿.)++ 2023-05-24 00:12:07 -05:00
Waffle d1f96af65f Separated Masquerain's texture into a base and wing texture, and made the wings slightly translucent. 2023-05-24 00:11:42 -05:00
Waffle 990dad0c51 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon
# Conflicts:
#	common/src/main/resources/data/cobblemon/species/generation7/cutiefly.json
#	common/src/main/resources/data/cobblemon/species/generation7/ribombee.json
2023-05-24 00:01:05 -05:00
Waffle 67a8230b91 Made Cutiefly & Ribombee's wings translucent, as well as fixed accidentally swapped names in their resolver files (oops) 2023-05-23 08:21:14 -05:00
Waffle 0d66e7bc1b Made Cutiefly & Ribombee's wings translucent, as well as fixed accidentally swapped names in their resolver files (oops) 2023-05-23 08:09:34 -05:00
tyzillion 56f0e0a1e2 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2023-05-22 20:42:23 -04:00
Waffle 1e5c48129c Implemented Cutiefly and Ribombee. 2023-05-22 06:58:28 -05:00
Waffle aed830b1ea Implemented Cutiefly and Ribombee. 2023-05-22 06:47:22 -05:00
tyzillion c30596c89b Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon
# Conflicts:
#	CHANGELOG.md
2023-05-20 12:19:43 -04:00
Waffle 851e0e56dd Parasect can no longer look around, moves at a speed of 0.45, and is always on the move. Sorry, zombie crab. 2023-05-20 05:13:06 -05:00
Waffle 0e92743da5 Implemented Cutiefly and Ribombee. Probably broken, I just needed to move to a new local copy of the IDE because intelliJ moment idk idk 2023-05-20 02:59:29 -05:00
nlingebretson 0245d82250 Updated item sprite to use the up-to-date sprites in the repo and added base json files for berry data (incomplete) 2023-05-17 20:28:06 -05:00
Waffle 9dc3b910f4 Touched up Surskit and implemented Masquerain. 2023-05-11 10:18:50 -05:00
Waffle 089d75cf57 Fixed Walking Wake not actually walking on wakes. 2023-05-10 20:10:38 -05:00
Waffle 9ef45d6324 Touched up Surskit and implemented Masquerain. 2023-05-10 16:10:21 -05:00
Waffle 881a957f59 Added Surskit 2023-05-10 12:22:01 -05:00
Waffle 0e0562c1a3 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2023-05-09 17:38:23 -05:00
tyzillion 40cc7d30b2 Hopefully pipeline fix. 2023-05-09 18:01:05 -04:00
tyzillion c2b1d336db Updated Models for Aerodactyl, Spearow, Fearow, Drowzee, Hypno, Lickitung, Pidgeotto, Pidgeot, Scyther, Scizor, and Kleavor. All still need frames and scaling adjusted. 2023-05-09 17:41:27 -04:00
Waffle eca69b4d96 Increased Pikachu's movement speed to better fit its animation 2023-05-09 15:12:32 -05:00
Waffle c607198de9 Fixed an incorrect identifier of bidoof_female.geo.json 2023-05-09 13:40:27 -05:00
Waffle 3ce9bd05a8 Positioned Flittle & Espathra's portraits and profiles. Hopefully fixed Espathra's eye jank. 2023-05-09 13:34:17 -05:00
tyzillion d209918dde Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-05-09 14:06:38 -04:00
tyzillion c5de65044d Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2023-05-09 14:05:37 -04:00
Waffle 96fbe3a685 Removed some unused imports in Flittle's model
TODO: position Flittle and Espathra's portrait and profile
2023-05-08 20:34:20 -05:00
Waffle d33defea6a Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2023-05-08 20:31:11 -05:00
Waffle d16d3eac34 Implemented Flittle & Espathra. Flittle can be shoulder-mounted. 2023-05-08 20:30:57 -05:00
Waffle 99b175f72a Positioned Comfey's portrait, played with its shoulder mount position, & gave it behavior for flight and sleep. 2023-05-08 19:17:37 -05:00
Waffle ae4d16bfcb Positioned Comfey's portrait, played with its shoulder mount position, & gave it behavior for flight and sleep. 2023-05-08 18:14:00 -05:00
Waffle ff039c0d24 Tweaked Tandemaus and Maushold's hitboxes as well as their portraits and profile scales. 2023-05-08 16:57:51 -05:00
SPG f4ef41c130 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/repository/PokemonModelRepository.kt
2023-05-08 14:06:36 -07:00
SPG e572d22819 Implmented Poochyena
Implmented Mightyena
Implmented Sprigatto
Implmented Floragato
Implmented Meowscarada

Floragato is stuck in T-pose, will need to have someone look at it
2023-05-08 14:02:46 -07:00
Waffle 9c448eca97 Adds Ceruledge's textures 2023-05-08 15:37:44 -05:00
Waffle 742caa227d Added transformTicks to Golurk's animations, and made them slower than the default 10 ticks. 2023-05-08 15:37:02 -05:00
Waffle b095e87ec9 Implemented Charcadet, Armarouge, and Ceruledge. All 3 use placeholder animations. 2023-05-08 15:36:38 -05:00
Waffle b2c66efa83 Added TransformTicks to Golurk's model. They're a bit slower than the default of 10. 2023-05-08 14:22:28 -05:00
Waffle 7274713e50 Implemented Breloom's animations by Berri
Synced Breloom's movement speed to its animation speed
Scaled Shroomish back up just a tad (0.6 -> 0.8)
Scaled Breloom back up just a tad (0.8 -> 0.9)
Fixed Shuckle's portrait and profile placement
Made Garchomp even faster to better sync with its run animation
2023-05-08 13:53:20 -05:00
Waffle 094f943ab5 Implemented Shroomish and Breloom
Added missing transformTicks properties in Bidoof's poses (should transition between poses better)
2023-05-07 16:58:57 -05:00
Waffle f55198249f Implemented Drowzee and Hypno remodels (no anims)
Implemented Gligar and Gliscor (no anims)
Igglybuff is now shoulder mountable
Updated licenses
2023-05-07 06:49:13 -05:00
Waffle 2fddfe12e6 Implemented Chatot 2023-05-06 03:23:54 -05:00
Waffle 88619f0512 Implemented Fidough & Dachsbun
Gave Chimecho flight
Updated Chingling & Chimecho scale & hitboxes
2023-05-06 01:56:57 -05:00
Waffle 695368932d Implemented Fidough & Dachsbun
Gave Chimecho flight
Updated Chingling & Chimecho scale & hitboxes
2023-05-06 01:54:30 -05:00
Waffle 84926f12eb Made Golurk move slightly slower to better sync with its walking animation. 2023-05-03 06:52:42 -05:00
Waffle 9048c00021 Added Chingling and Chimecho, and posed them for portrait and profile. Neither have animations implemented currently. Updated licenses as well. 2023-05-03 06:43:00 -05:00
tyzillion ed5cc49b6d Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2023-05-02 13:31:07 -04:00
Waffle f348b4e8de Fixed Bidoof's sleep, tweaked its portrait, and added license to Chinchou's model file. 2023-05-02 01:21:28 -05:00
Waffle 6acd8167fb Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2023-05-01 22:15:54 -05:00
Waffle b131c2fe1f Gave Bidoof a sleeping animation & implemented sleeping behavior. 2023-04-29 15:08:10 -05:00
Waffle d848a2e78c Gave Bidoof a sleeping animation & implemented sleeping behavior. 2023-04-29 15:03:19 -05:00
Waffle 2447f61f8c Fixed Bidoof's movement. oops
Also, made its WATER_FLOAT animation a bit quicker.
2023-04-29 14:14:31 -05:00
Waffle 9839e48dee Reduced Bidoof's swim speed, and added water floating animation (also used as a placeholder for swimming ATM) 2023-04-29 00:35:15 -05:00
Waffle 95f4f96cda actually implemented blink whoops 2023-04-27 16:19:16 -05:00
Waffle 9ce697bf00 Bidoof
- Updated some model pivots
- walkSpeed 0.35 -> 0.3
- ground_idle and ground_walk animations made
- Implemented blink
2023-04-27 16:18:18 -05:00
Waffle 5424513e7e Changed the species files of several Pokemon, mostly to change their movement speeds, though Wailord did get a size bump.
Venusaur walkSpeed 0.35 -> 0.3
Charmander walkSpeed 0.35 -> 0.3
Charmeleon walkSpeed 0.35 -> 0.3
Squirtle walkSpeed 0.35 -> 0.29
Wartortle walkSpeed 0.35 -> 0.29
Blastoise walkSpeed 0.35 -> 0.3
Caterpie walkSpeed 0.35 -> 0.26
Weedle walkSpeed 0.35 -> 0.26
Beedrill walkSpeed 0.35 -> 0.4
Pidgeot walkSpeed 0.35 -> 0.38
Rattata walkSpeed 0.35 -> 0.41
Raticate walkSpeed 0.35 -> 0.33
Slowpoke walkSpeed 0.35 -> 0.125
Slowbro walkSpeed 0.35 -> 0.18
Slowking walkSpeed 0.35 -> 0.23
Wailord scaled up
  - baseScale 1.3 -> 2
  - width 3.5 -> 3.2
  - height 2.3 -> 2.1
Galvantula walkSpeed 0.35 -> 0.4
Naclstack walkSpeed 0.35 -> 0.23
Gargancl walkSpeed 0.35 -> 0.25
2023-04-27 07:06:07 -05:00
Waffle 4de268fcd8 Scaled Chinchou, Shuckle, Tandemaus, and Maushold. Additionally made Shuckle move slowly. 2023-04-27 02:12:35 -05:00
Waffle 86c415cc55 Fixed a couple stray palette-nonconforming pixels on Gorebyss's texture. 2023-04-27 02:11:49 -05:00
Waffle e08066a26c Added Chinchou, Clamperl, Huntail, and Gorebyss 2023-04-27 01:21:23 -05:00
Waffle eea985d56d Added canFly behavior 2023-04-27 00:42:16 -05:00
Nick 000d210b33 Adjust comment checker for even more fun formats that break the unit test :D 2023-04-24 21:14:55 -07:00
tyzillion 124d68a8fe Updated license 2023-04-24 23:22:25 -04:00
tyzillion 0c019b1c71 Updated Model and Texture of Pikachu. Updated weedle texture. 2023-04-24 22:28:06 -04:00
tyzillion fd5468ff6e Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon
# Conflicts:
#	CHANGELOG.md
2023-04-24 12:50:57 -04:00
SPG 1d2c1413da Implmented Lanturn
- Fixed License Violation
2023-04-23 21:21:56 -07:00
SPG 005945447b Implmented Lanturn 2023-04-23 21:20:44 -07:00
SPG d69ddef3e3 Implmented Lanturn 2023-04-23 17:53:29 -07:00
tyzillion 4ac7060e4d Implemented Spinarak, Ariados, Shuckle, Taillow, Swellow, Relicanth, Mudbray, Mudsdale, Comfey, Tandemaus, Maushold, Varoom, and Revavroom.
Updated model and textures of Farfetchd and Gengar.
Updated model of Sceptile.
Updated animation for Murkrow and Farfetchd.
2023-04-20 22:17:09 -04:00
nlingebretson 4bd30be29f Added lang data for berries and tooltips (part 1) 2023-04-15 19:20:58 -05:00
nlingebretson 0b52918d8d Pointed textures on trees to updated files. 2023-04-15 14:42:54 -05:00
bcheevers123 9b73565e28 Added Texture, Young Declare, Mature Declare, Blockstate, Item Icon, Item Declare. Some berrry trees missing textures. Lang and Berry Data need added. 2023-04-15 19:36:41 +01:00
bcheevers123 a1e04e8df2 Added Texture, Young Declare, Mature Declare, Blockstate, Item Icon, Item Declare. Some berrry trees missing textures. Langf and Berry Data need added. 2023-04-15 19:35:48 +01:00
nlingebretson 51a542b6a9 Added Aguav and Cheri Berry implementation examples 2023-04-15 10:15:28 -05:00
nlingebretson f0e8d80da4 Added texture/item files and added items in the declaration portion 2023-04-10 20:21:58 -05:00
Yaseen 532bf008d3 shorter desert long path 2023-03-28 18:09:11 +01:00
Yaseen 701c727475 Shorter long_paths for snowy and desert 2023-03-28 18:08:55 +01:00
Yaseen 3df605c50f Fix desert and taiga pokecenter nbts 2023-03-28 17:33:27 +01:00
jmmcp ad97188902 Updated snowy pokecenter nbt 2023-03-28 00:59:52 -04:00
Yaseen 237edcc2fa a bunch of code clean up 2023-03-27 17:18:10 +01:00
Yaseen 51ab2c4fd8 Tidy up access wideners 2023-03-27 16:31:28 +01:00
Yaseen c0a482a92a better desert village nbt 2023-03-27 16:29:55 +01:00
Yaseen 829a063fe7 Add support for legacy pool elements (for paths) + use CobblemonStructureIDs 2023-03-27 15:47:37 +01:00
Yaseen f3f2fa11f7 Delete some temp files 2023-03-27 15:45:31 +01:00
Yaseen 298ba53ec2 taiga with stairs 2023-03-27 08:09:14 +01:00
jmmcp 28401e3c95 Updated taiga nbt and changed weights 2023-03-27 00:43:40 -04:00
Yaseen 3a0ed1a244 half fix for taiga pokecenter jigssaw (still need to make it turn to stairs) 2023-03-27 02:44:25 +01:00
Yaseen b27895a3c2 some refactoring 2023-03-27 02:27:05 +01:00
Yaseen e8647313b7 Streets + processors 2023-03-27 02:23:36 +01:00
Yaseen 7fdff93a25 add mossify processor for taiga pokecenter 2023-03-27 02:18:55 +01:00
Yaseen 06335ca854 better way of adding pokecenters to structure pool 2023-03-27 02:02:50 +01:00
Yaseen ba22800783 Some experiments 2023-03-19 23:45:14 +00:00
Yaseen 832f260472 Remove unused mixins 2023-03-19 22:51:17 +00:00
Yaseen df594f18d4 Some cleanup + small fix 2023-03-17 00:57:37 +00:00
Yaseen 5663d50a1c Better fix 2023-03-16 21:04:57 +00:00
Yaseen 373be37287 delete unused mixin 2023-03-16 15:06:51 +00:00
Yaseen 7071d74196 little bit of cleanup 2023-03-16 03:57:52 +00:00
Yaseen f5f3ad0d58 seems like its working 2023-03-16 03:39:05 +00:00
Yaseen 7e1b9b65f1 fix taiga pokecenter nbt 2023-03-14 21:14:10 +00:00
Yaseen 57839da643 Bunch of clean up 2023-03-14 01:48:30 +00:00
Yaseen 4a4dd66a65 A bunch of mixin stuff 2023-03-13 23:59:12 +00:00
jmmcp cfcf97bc88 Updated jsons and village plains pokecenter NBT jigsaw location. 2023-03-06 19:11:16 -05:00
jmmcp 1adf625044 Updated pokecenter NBT files to have proper structure void blocks and healers/pcs implemented.
Implemented natural generation of plains, desert, snowy, taiga, and savanna village pokecenters.
2023-03-05 21:55:47 -05:00
jmmcp a136ca106b Merge remote-tracking branch 'origin/implementing-naturally-generated-structures' into implementing-naturally-generated-structures
# Conflicts:
#	common/src/main/resources/data/cobblemon/structures/village_plains_pokecenter.nbt
#	common/src/main/resources/data/minecraft/worldgen/template_pool/village/plains/houses.json
2023-03-05 18:27:40 -05:00
Yaseen cbe1a79c2a increase the weights 2023-03-05 23:03:44 +00:00
Yaseen 093f953c7f more houses on long path 2023-03-05 18:22:46 +00:00
Yaseen dfd4fd252f Added long path and pokemon center plains 2023-03-05 18:15:39 +00:00
jmmcp e22befbc33 Working towards generation in villages 2023-03-04 23:40:19 -05:00
jmmcp 7bbb0eac56 Working towards generation in villages 2023-03-04 15:09:32 -05:00
jmmcp c42facec8a Added pokecenter nbt files and allowed village_plains_pokecenter to naturally generate. 2023-03-01 21:07:59 -05:00
Licious17 7d2663b082 Add a few more berry items 2023-02-03 20:41:51 +00:00
Licious17 43c6751039 Fix compile error 2023-02-03 15:24:39 +00:00
Licious17 f0fc94d25a Merge branch 'main' into berry
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonBlockEntities.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonBlocks.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/block/BerryBlock.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/block/entity/BerryBlockEntity.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/data/CobbledDataProvider.kt
#	common/src/main/resources/assets/cobblemon/lang/en_us.json
2023-02-03 15:19:26 +00:00
Licious17 10ba9c5f87 Added various API events related to the berry farming process. 2023-01-20 09:28:34 +00:00
Licious17 dcca1ec71f Add remaining interactions required for berry functionality. 2023-01-19 18:50:38 +00:00
Licious17 7847227a57 Remove unused import 2023-01-16 12:21:19 +00:00
Licious17 3f1660295e Implement berry mutation 2023-01-16 12:20:39 +00:00
Licious17 87f1063d6f Fix imports and licenses 2023-01-15 17:14:11 +00:00
Licious17 0951a7d73e Merge branch 'main' into berry
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonItems.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonNetwork.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/tags/CobblemonBlockTags.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/net/ClientPacketRegistrar.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonEntity.kt
2023-01-15 17:06:02 +00:00
Licious17 256fcf3a8b Fixed berry flower and fruit not rendering for the first life cycle 2022-12-20 14:15:11 +00:00
Licious17 7e082f27e0 Remove reference to client only class in Berry API 2022-12-19 19:20:21 +00:00
Licious17 e81b8ca4f2 Removed VoxelShape for berry fruit and flowers, added customizable rotation to berry flower and fruits growth points. 2022-12-19 18:43:33 +00:00
Licious17 351910a3ef Merge branch 'main' into berry
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/data/CobbledDataProvider.kt
2022-12-19 12:52:42 +00:00
Paul e700dcb142 Model rotation example in berry block renderer 2022-12-13 20:45:41 +10:00
Paul 2527b0e5d1 Corrected comment [skip-ci] 2022-12-13 20:34:32 +10:00
Paul 0fe36a98d7 Cleanup code [skip-ci] 2022-12-13 20:31:10 +10:00
Paul c9ef897a2e Fixed positioning of berry and flower rendering 2022-12-13 20:30:11 +10:00
Licious17 2cc46406de Updated pecha fruit texture, fixed berry rendering culling. 2022-12-10 13:43:04 +00:00
Licious17 1ef39bf1a3 Attempts at berry fruit and flower rendering 2022-12-09 10:09:19 +00:00
Licious17 e0bc16a232 Merge branch 'main' into berry 2022-12-08 16:17:01 +00:00
Paul f46109e080 Fixed berry trees not rendering 2022-12-08 19:30:58 +10:00
Licious17 21983061a6 Fix tint index of berry tree model being shared by the break particle 2022-12-06 16:05:45 +00:00
Licious17 87543095f1 Cleanup 2022-12-06 15:08:26 +00:00
Licious17 688b0836a5 Add missing doc 2022-12-06 15:04:53 +00:00
Licious17 42d2a5ce89 Added util extension for Box ByteBuf read/write 2022-12-06 15:03:20 +00:00
Licious17 307f5e2c8d Merge branch 'main' into berry 2022-12-06 12:12:51 +00:00
Licious17 b1a6b43414 Fix pecha berry Y voxelshape y positions 2022-12-05 14:57:30 +00:00
Licious17 8d90e2d190 Merge branch 'main' into berry
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/data/CobbledDataProvider.kt
2022-12-05 14:51:37 +00:00
Licious17 767446c804 Implemented berry data synchronization with client 2022-12-05 14:49:50 +00:00
Licious17 b6d5762ddd Make berry tree animate the breaking after last life cycle, added LiteralHexColorAdapter type adapter 2022-12-05 13:47:10 +00:00
Licious17 dc0ab2e810 Add foliage color as a customizable datapack property of berries. 2022-12-05 13:27:18 +00:00
Licious17 f50ec2ae5a Fix berry tree not re-rolling growth points between harvests 2022-12-04 13:20:35 +00:00
Licious17 a4d0ddf229 Prevent unnecessary chunk saving on berry tree life cycles value update if the value is the same 2022-12-04 13:15:54 +00:00
Licious17 b1d84fef55 Fix berry tree entity read/write nbt being the other way around 2022-12-04 13:14:36 +00:00
Licious17 e26f4c33ba Document util functions inside BerryBlock and BerryBlockEntity 2022-12-03 14:21:09 +00:00
Licious17 7b023ab34f License stuff. 2022-12-03 14:15:57 +00:00
Licious17 ded186890d Implemented berry harvesting and life cycles. 2022-12-03 14:14:36 +00:00
Licious17 4c5b16e502 Added util to get the berry item and block implementation from the berry API, added pickstack functionality for the berry block 2022-12-03 12:35:15 +00:00
Licious17 6b95f8b7bf Update berry yield API for better mod compat 2022-12-03 12:24:44 +00:00
Licious17 4a50293e04 Change usages of VoxelShapes#cuboid to Block#createCuboidShape 2022-12-02 23:51:54 +00:00
Licious17 9fa829b30a Enabled dynamicBounds setting for Berry blocks 2022-12-02 23:07:50 +00:00
Licious17 0dc6b8321e Expanded berry growth factors to have API, allow data driven berry tree voxelshapes 2022-12-02 22:25:27 +00:00
Licious17 4616e61825 Implement berry datapack loading 2022-12-01 22:52:51 +00:00
Licious17 63c0b7da37 More berry data 2022-12-01 15:04:43 +00:00
Licious17 aad041998c Added block rendering stuff for berries 2022-11-30 13:22:52 +00:00
Licious17 b0e58975f2 License stuff, fixed berry tooltip 2022-11-30 12:41:00 +00:00
Licious17 cf41dd6fb4 Implemented Pecha interaction, fixed bad refactor on Flavor package path 2022-11-30 12:33:07 +00:00
Licious17 a66eb04097 Move InteractiveItem to API 2022-11-29 10:45:00 +00:00
Licious17 960d20599e Refactor InteractiveItem to be an interface instead, progress on berry block n item 2022-11-28 18:07:25 +00:00
Licious17 8ea6f13d34 License stuff 2022-11-28 15:21:03 +00:00
Licious17 34d28c798d Progress on data backing berries 2022-11-28 15:10:32 +00:00
Licious17 cb0046f4cc Fix merge bad import 2022-11-28 12:56:09 +00:00
Licious17 b475ead059 Merge branch 'main' into berry
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonItems.kt
#	common/src/main/resources/assets/cobblemon/lang/en_us.json
2022-11-28 12:52:36 +00:00
Licious17 9557c48cab Merge remote-tracking branch 'origin/berry' into berry 2022-11-28 12:50:26 +00:00
Licious17 1062507ffb Added barebones berry block 2022-11-28 12:50:15 +00:00
dhi_holo b5aef1cccc Revert "Update first_evolution.json"
This reverts commit f9df1085ec.
2022-11-26 03:27:20 +10:00
dhi_holo 658e6a9da5 Revert "Advancements Fixed Maybe?"
This reverts commit ff6f18d575.
2022-11-26 03:27:12 +10:00
dhi_holo ff6f18d575 Advancements Fixed Maybe?
I went and rewrote parts of the advancements until they worked properly as far as I can tell.
I don't get why it was breaking, but it was, and hopefully it won't from now on
2022-11-26 02:32:38 +10:00
dhi_holo f9df1085ec Update first_evolution.json
Should fix the issue Hiro mentioned earlier
2022-11-26 01:07:02 +10:00
Licious17 997bacefe2 Merge branch 'main' into berry 2022-11-25 12:46:45 +00:00
Licious17 5f94707a9e Added pecha berry assets, added pecha berry item 2022-11-25 12:40:47 +00:00
6217 changed files with 365504 additions and 32015 deletions
+272 -78
View File
@@ -1,39 +1,56 @@
# Changelog
## [1.4.0](#1-4-0)
## [1.4.0 - The Friends and Farms Update (October 13th, 2023)](#1-4-0)
### Additions
- Added nicknaming.
- Added mints, found on mountains.
- Added revival herbs, with pep-up flowers if fully grown, growing in lush caves.
- Added medicinal leeks, growing on the surface of rivers and ponds. It is a potion ingredient!
- Added big roots, generating from cave ceiling dirt and sometimes spreading into energy roots.
- Added trading between players. Press R while looking at another player, you'll figure it out.
- Added pasture blocks, used to let your PC Pokémon roam around your base.
- Added support for scale in animations.
- Added support for jump keyframes (i.e. pre and post keyframes)
- Made Nosepass point towards world spawn while idle.
- Added structure spawn conditions
- Added Pokémon cry system for battles and sending out.
- Added cries for Gen 1-9 starters and their evolutions.
- Added cries for Chatot, Darmanitan, Darumaka, Lucario, Mimikyu, Quagsire, Riolu, Wooper, Caterpie, Metapod, Butterfree, Weedle, Kakuna, Beedrill, Pidgey, Pidgeotto, Pidgeot, Rattata, Raticate, Cleffa, Clefairy, Clefable, Tauros, Miltank, Buneary, Lopunny, Wooloo, Dubwool.
- Added recipes for Berry Juice, Heal Powder, Remedy, Fine Remedy, Superb Remedy, Revive, Max Revive, HP Up, Protein, Iron, Calcium, Zinc, Carbos, PP Up, PP Max, Pasture, Medicinal Leek to Magenta Dye, Roasted Leek, Leek and Potato Stew, Braised Vivichoke, Vivichoke Dip, Mulch Base, Growth Mulch, Surprise Mulch, Coarse Mulch, Humid Mulch, Rich Mulch, Loamy Mulch, Peat Mulch, Sandy Mulch, Health Feather, Muscle Feather, Resist Feather, Genius Feather, Clever Feather, Genius Feather
- Added a shoulder mount for Mimikyu
- Added Advancement trigger for defeating Pokémon and collecting varieties of Pokémon.
- Added sleep animations to Arcanine, Jigglypuff, Wigglytuff, Vulpix and Ninetales.
- Added pasture blocks, used to let your PC Pokémon roam around an area.
- Added nicknaming from the summary menu of a Pokémon (click their name).
- Added trading between players. Press R while looking at another player and you'll figure the rest out.
- Added mints for changing Pokémon stats. These are most commonly found at high altitudes.
- Added [Revival Herbs](https://wiki.cobblemon.com/index.php/Revival_Herb), with pep-up flowers when fully grown, growing in lush caves.
- Added [Medicinal Leeks](https://wiki.cobblemon.com/index.php/Medicinal_Leek), growing on the surface of rivers and ponds. It is a potion ingredient and can be cooked as food!.
- Added [Big Roots](https://wiki.cobblemon.com/index.php/Big_Root), generating from cave ceiling dirt which sometimes spread as energy roots.
- Added [69 Berry Trees](https://wiki.cobblemon.com/index.php/Berry_Tree) and [Berries](https://wiki.cobblemon.com/index.php/Berry). Some are found in village farms, some from planting different berries close to each other.
- Added mulches: Mulch Base, Growth Mulch, Surprise Mulch, Coarse Mulch, Humid Mulch, Rich Mulch, Loamy Mulch, Peat Mulch, and Sandy Mulch
- Added [Vivichokes](https://wiki.cobblemon.com/index.php/Vivichoke), obtainable from wandering villager trades and some loot chests.
- Added medicine brewing using medicinal leeks and berries in brewing stands.
- Added Pokémon cries when in battles and being sent out.
- Added medicinal items: Berry Juice, Heal Powder, Remedy, Fine Remedy, Superb Remedy, Revive, Max Revive, Potion, Super Potion, Hyper Potion, Max Potion, Full Restore, Full Heal, Antidote, Awakening, Burn Heal, Ice Heal, and Paralyze Heal.
- Added battle items: X Attack, X Defence, X Sp.Atk, X Sp.Def, X Speed, Dire Hit, and Guard Spec.
- Added EV items: Power Anklet, Power Band, Power Belt, Power Bracelet, Power Lens, Power Weight.
- Added food items: Roasted Leek, Leek and Potato Stew, Braised Vivichoke, and Vivichoke Dip
- Added evolution items: Auspicious Armor and Malicious Armor, which can be used to evolve Charcadet into Armarouge or Ceruledge respectively.
- Added (mostly brewing) recipes for HP Up, Protein, Iron, Calcium, Zinc, Carbos, PP Up, PP Max, and Medicinal Leek to Magenta Dye.
- Added held items: Bright Powder, Destiny Knot
- Added AI for Nosepass to point towards world spawn when idle. We just think it's neat.
- Added shoulder mounting for Mimikyu.
- Added flying placeholder animations to Pidgey, Pidgeotto, Pidgeot, Golbat, Crobat, Scyther, Scizor, Zapdos, Moltres, Articuno, Dragonite, Rowlet, Dartrix, and Decidueye.
- Added loot to various vanilla chest loot tables (Link Cable in Ancient Cities, Woodland Mansions, End Cities, and Igloos, Vivichoke Seeds in Jungle Temples, Dungeons, and Plains, Savanna, Snowy, and Taiga Villages, and all 7 Apricorn Sprouts in Desert, Plains, Savanna, Snowy, and Taiga Villages, as well as the Bonus Chest)
- Added loot to various vanilla chest loot tables (Link Cable in Ancient Cities, Woodland Mansions, End Cities, and Igloos, Vivichoke Seeds in Jungle Temples, Dungeons, and Plains, Savanna, Snowy, and Taiga Villages, and all 7 Apricorn Sprouts in Desert, Plains, Savanna, Snowy, and Taiga Villages, as well as the Bonus Chest, which can also have 5 of the basic Poké Ball types)
- Added a `doShinyStarters` gamerule to make it quick and easy to be offered shiny starters.
- Added a `doPokemonLoot` gamerule to toggle Pokémon dropping items/exp on death.
- Added ability activation announcement when in battle.
- Added animations for Wailord and made it BIGGER.
- Added Cherry Torterra variant.
- Added 2 new face spots for Spinda. The number of unique Spindas increases...
- Added Forretress Shulker variant.
- Added the `/teststore <player> <store> <properties>` command allowing command block/mcfunction users to query a party, PC or both for Pokémon matching specific properties and returning the match count, this will be a cheat command in the Minecraft permission system or use the permission `cobblemon.command.teststore` if a permission mod is present.
- Added the `/querylearnset <player> <slot> <move>` command allowing command block/mcfunction users to query a party slot and check if the Pokémon can learn a specific move returning a 1 if yes otherwise 0, this will be a cheat command in the Minecraft permission system or use the permission `cobblemon.command.querylearnset` if a permission mod is present.
- Added the `/testpcslot <player> <slot> <properties>` command allowing command block/mcfunction users to query a pc slot and check if the Pokémon matches specific properties returning a 1 if yes otherwise 0, this will be a cheat command in the Minecraft permission system or use the permission `cobblemon.command.testpcslot` if a permission mod is present.
- Added the `/testpartyslot <player> <slot> <properties>` command allowing command block/mcfunction users to query a party slot and check if the Pokémon matches a specific properties returning a 1 if yes otherwise 0, this will be a cheat command in the Minecraft permission system or use the permission `cobblemon.command.testpartyslot` if a permission mod is present.
- Added the `/clearparty <player>` command for emptying a player's party.
- Added the `/clearpc <player>` command for emptying a player's PC.
- Added the `/pokemonrestart <reset_starters>` and the `/pokemonrestartother <player> <reset_starters>` command allowing command block/mcfunction users to reset a players Pokémon data.
- Added support for "isBattle" and "isTouchingWater" properties on resource pack Pokémon poses. This allows your custom Pokémon to be posed differently when in battle.
- Added support for "isVisible" on a transformed part on resource pack Pokémon poses. This allows your custom Pokémon to have bones disappear in specific poses, such as hiding Greninja's throwing star when not in a battle pose.
- Added the `doPokemonLoot` gamerule to toggle Pokémon dropping items/exp on death.
### Pokémon Added
#### Gen 2
- Chikorita
- Bayleef
- Meganium
- Totodile
- Croconaw
- Feraligatr
- Cyndaquil
- Quilava
- Typhlosion
- Spinarak
- Ariados
- Shuckle
@@ -47,6 +64,12 @@
- Flaaffy
- Ampharos
- Sudowoodo
- Snubbull
- Granbull
- Phanpy
- Donphan
- Teddiursa
- Ursaring
#### Gen 3
@@ -60,7 +83,7 @@
- Cacnea
- Cacturne
- Poochyena
- Mightyenna
- Mightyena
- Wingull
- Pelipper
- Numel
@@ -73,11 +96,22 @@
- Chimecho
- Barboach
- Whiscash
- Volbeat
- Illumise
- Zigzagoon
- Linoone
- Ralts
- Kirlia
- Gardevoir
- Nincada
- Ninjask
- Shedinja
- Beldum
- Metang
- Metagross
#### Gen 4
- Cherubi (Planned)
- Cherrim (Planned)
- Carnivine
- Shinx
- Luxio
@@ -90,48 +124,77 @@
- Chatot
- Combee
- Vespiquen
- Buizel
- Floatzel
- Starly
- Staravia
- Staraptor
- Gallade
#### Gen 5
- Bouffolant
- Bouffalant
- Roggenrola
- Boldore
- Gigalith
- Venepede
- Whirlpede
- Venipede
- Whirlipede
- Scolipede
- Yamask (Planned)
- Cofagrigus (Planned)
- Patrat (Planned)
- Watchog (Planned)
- Yamask
- Cofagrigus
- Patrat
- Watchog
- Lillipup
- Herdier
- Stoutland
- Cottonee
- Whimsicott
- Pidove
- Tranquill
- Unfezant
- Timburr
- Gurdurr
- Conkeldurr
#### Gen 6
- Scatterbug
- Spewpa
- Vivillion
- Skrelp (Planned)
- Dragalge (Planned)
- Bunnelby (Planned)
- Diggersby (Planned)
- Vivillon
- Skrelp
- Dragalge
- Bunnelby
- Diggersby
- Phantump
- Trevenant
- Fletchling
- Fletchinder
- Talonflame
#### Gen 7
- Wishiwashi (Planned)
- Wishiwashi
- Cutiefly
- Ribombee
- Stufful
- Bewear
- Comfey
- Alolan Exeggutor
- Alolan Raichu
- Alolan Meowth
- Alolan Persian
- Komala
- Wimpod
- Golisopod
- Crabrawler
- Crabominable
- Mudbray
- Mudsdale
#### Gen 8
- Arrokuda (Planned)
- Barraskewda (Planned)
- Arrokuda
- Barraskewda
- Nickit
- Thievul
- Falinks
@@ -140,12 +203,28 @@
- Rookidee
- Corvisquire
- Corviknight
- Galarian Ponyta
- Galarian Rapidash
- Yamper
- Boltund
- Galarian Zigzagoon
- Galarian Linoone
- Obstagoon
- Galarian Meowth
- Perrserker
- Ursaluna
#### Gen 9
- Sprigatitto
- Sprigatito
- Floragato
- Meowscarada
- Fuecoco
- Crocalor
- Skeledirge
- Quaxly
- Quaxwell
- Quaquaval
- Flittle
- Espathra
- Garganacl
@@ -155,88 +234,186 @@
- Ceruledge
- Cetoddle
- Cetitan
- Shroodle (Planned)
- Grafaiai (Planned)
- Shroodle
- Grafaiai
- Tandemaus
- Maushold
- Varoom
- Revavroom
- Squawkabilly (Planned)
- Squawkabilly
- Glimmet
- Glimmora
- Annihilape
- Tinkatink
- Tinkatuff
- Tinkaton
- Maschiff
- Mabosstiff
- Lechonk
- Oinkologne
- Paldean Wooper
- Clodsire
### Changes
- Updated model and textures of Arcanine, Magnemite, Magneton, Magnezone, Exeggcute, Exeggutor, Farfetchd, Elekid, Electabuzz, Electivire, Pichu, Pikachu, Raichu, Gengar, Wooper Drowzee, Hypno, Aerodactyl, Spearow, Fearow, Lickitung, Pidgeotto, Pidgeot, Scyther, Scizor, Kleavor, Popplio, Brionne, Primarina, Torchic, Combusken, Blaziken, Aerodacyl, Scyther, Scizor, Kleavor, Lickitung, Lickilicky, Happiny, Chansey, Pidgey, Pidgeotto, Pidgeot, Spearow, Fearow, Drowzee, Hypno, Arcanine, Magnemite, Magneton, Magnezone, Exeggcute, Exeggutor, Farfetchd, Elekid, Electabuzz, Electivire, Pichu, Pikachu, Raichu, and Gengar.
- Updated models of Sceptile and Shuckle.
- Removed the existing shoulder effects from Pokémon until we have more balanced versions of them (they're too powerful!)
- Updated models and textures of Weedle, Dwebble and Crustle, Spiritomb, Koffing and Weezing, Kadabra and Alakazam, Emolga, Oshawott, Doduo and Dodrio, Dratini and Dragonair and Dragonite, Sneasel and Weavile, Gyarados, Hitmonlee and Hitmonchan, Chesnaught, Spinda, Mamoswine, Steelix, Misdreavus and Mismagius, Buneary and Lopunny, Golduck, Meowth and Persian, Fennekin and Braixen and Delphox, Snivy and Servine and Serperior, Ratatta and Raticate, Nidorina and Nidoqueen, Nidoran Male and Nidoking, Riolu and Lucario, Haunter and Gengar, Mankey and Primeape, Mew and Mewtwo, Arcanine, Magnemite and Magneton and Magnezone, Exeggcute and Exeggutor, Elekid and Electabuzz and Electivire, Pichu and Pikachu and Raichu, Wooper, Drowzee and Hypno, Aerodactyl, Spearow and Fearow, Lickitung and Lickilicky, Pidgey and Pidgeotto and Pidgeot, Scyther and Scizor and Kleavor, Popplio and Brionne and Primarina, Torchic and Combusken and Blaziken, Happiny and Chansey and Blissey.
- Updated animations for Steelix, Turtwig and Grotle and Torterra, Ponyta and Rapidash, Piplup and Prinplup and Empoleon, Drowzee and Hypno, Farfetch'd, Exeggcute and Exeggutor, Bidoof, Chimecho, Lickitung and Lickilicky, Popplio and Brionne, Luvdisc, Chimchar and Monferno and Infernape, Sobble and Drizzile and Inteleon, Greninja, Heatmor, Aerodactyl, Ditto, Lotad and Lombre and Ludicolo, Pumpkaboo and Gourgeist.
- Updated sprites for EV medicines, the rare candy, and the apricorn door item.
- Updated textures for apricorn doors and all the evolution stone ores.
- Ponyta and Rapidash now have animated textures; they look insane.
- Updated Apricorn Leaves color.
- Wild Pokémon now heal if you are defeated by them or flee from them.
- Doubled the default time between ambient Pokémon cries (they have cries if you're using a resource pack to add them)
- Moved spawn attempts per tick to a config option (ticksBetweenSpawnAttempts)
- PCs can now be waterlogged
- Starter selection prompt now appears as a tutorial-esque toast instead of plain text
- Cobblemon items can now all have their own tooltips via resourcepacks, to add a tooltip simply add a lang entry like "item.cobblemon.{item_id}.tooltip", if you want to add multiple tooltip lines you can do so with "item.cobblemon.{item_id}.tooltip_1" and upwards.
- Updated texture of Weedle.
- Updated shiny texture of Dwebble and Crustle.
- Updated Animations for Piplup, Prinplup, Empoleon, Drowzee, Hypno, Farfetch'd, Exeggcute, Exeggutor, Bidoof, Chimecho, Lickytung, Lickilicky, Popplio, Brionne, Luvdisc, Chimchar, Monferno, Infernape, Sobble, Drizzile, Inteleon, Greninja, Heatmor, Aerodactyl, Ditto, Lotad, Lombre, Ludicolo, Pumpkaboo, Gourgeist.
- Reorganised the advancements recipes folder
- Pokeedit command now supports IVs and EVs.
- Pokéedit command now supports IVs and EVs.
- Reorganised creative categories
- Pokemon can now wander into non-solid blocks such as foliage
- Pokeballs now despawn after 30 seconds
- Pokémon can now wander into non-solid blocks such as foliage
- Thrown Poké Balls now despawn after 30 seconds so that they don't fly forever.
- Dive Balls will now have the same motion speed underwater as if they were thrown in the air.
- Hardcoded potion shoulder effects have been removed, you can now use any potion vanilla or otherwise with the parameters you'd like, for more information see the [Datapack & Resourcepack Creators](#datapack-&-resourcepack-creators) section.
- Clicking categories of the Stat sub-section or the party reorder button in the Summary screen will now produce a click sound.
- Hardcoded potion shoulder effects have been removed. You can now use any potion vanilla or otherwise with the parameters you'd like, for more information see the [Datapack & Resourcepack Creators](#datapack-&-resourcepack-creators) section.
- Clicking categories of the Stat subsection or the party reorder button in the Summary screen will now produce a click sound.
- Updated PC Recipe.
- Improved Pokémon AI and movement.
- Friendship will slowly increase when Pokémon are shoulder-mounted.
- Master Balls are now unable to be burned when dropped into fire/lava. They're made from stronger stuff.
- Pokémon will appear red when hurt, like regular entities, except when they're fainting.
- Pokémon's air meter no longer depletes while battling underwater.
- Sleeping partially restores PP of Pokémon
- Shoulder mounts now match the shoulder position a bit more accurately when sneaking.
- Poison Heal will now cause poisoned Pokémon to heal outside of battle.
- Updated Poké Ball, PC, UI, evolution and Healing Machine sounds.
### Added cries to the following Pokémon:
- All starters and their evolutions
- Caterpie, Metapod, Butterfree
- Weedle, Kakuna, Beedrill
- Pidgey, Pidgeotto, Pidgeot
- Rattata, Raticate
- Spearow, Fearow
- Ekans, Arbok
- Pichu, Pikachu, Raichu, Alolan Raichu
- Cleffa, Clefairy, Clefable
- Mankey, Primeape, Annihilape
- Ponyta, Rapidash, Galarian Ponyta, Galarian Rapidash
- Farfetch'd, Galarian Farfetch'd, Sirfetch'd
- Onix, Steelix
- Tauros
- Ditto
- Eevee, Vaporeon, Jolteon, Flareon, Espeon, Umbreon, Leafeon, Glaceon, Sylveon
- Hoothoot, Noctowl
- Mareep, Flaaffy, Ampharos
- Aipom, Ambipom
- Wooper, Quagsire, Clodsire
- Snubbull, Granbull
- Miltank
- Poochyena, Mightyena
- Taillow, Swellow
- Ralts, Kirlia, Gardevoir, Gallade
- Shroomish, Breloom
- Nincada, Ninjask, Shedinja
- Buneary, Lopunny
- Chingling
- Chatot
- Riolu, Lucario
- Pidove, Tranquill, Unfezant
- Roggenrola, Boldore, Gigalith
- Venipede, Whirlipede, Scolipede
- Maractus
- Dwebble, Crustle
- Yamask, Cofagrigus
- Bunnelby, Diggersby
- Fletchling, Fletchinder, Talonflame
- Scatterbug, Spewpa, Vivillon
- Honedge, Doublade, Aegislash
- Skrelp, Dragalge
- Phantump, Trevenant
- Pumpkaboo, Gourgeist
- Bergmite, Avalugg
- Mudbray, Mudsdale
- Stufful, Bewear
- Mimikyu
- Rookidee, Corvisquire, Corviknight
- Nickit, Thievul
- Wooloo, Dubwool
- Yamper, Boltund
- Tandemaus
- Fidough, Dachsbun
- Squawkabilly
- Nacli, Naclstack, Garganacl
- Charcadet, Armarouge, Ceruledge
- Maschiff, Mabosstiff
- Shroodle, Grafaiai
- Flittle, Espathra
- Tinkatink, Tinkatuff, Tinkaton
- Varoom, Revavroom
- Glimmet, Glimmora
- Cetoddle, Cetitan
- Tatsugiri
### Fixes
- Fixed spawning moon phase dependent Pokémon only when the moon phase is wrong
- Fixed spawning moon phase dependent Pokémon only when the moon phase is wrong (that's a funny woopsy)
- Fixed large Pokémon spawning partially inside walls where they suffocate.
- Fixed messages for entry hazards, screens, Tailwind, Perish Song, Destiny Bond, Shed Skin, Uproar, Forewarn, Disguise, Arena Trap, Yawn, Curse, Clamp, Whirlpool, Liquid Ooze, Miracle Eye and Safeguard.
- Fixed custom Pokémon in your party or PC not being removed when the addon is removed, causing major issues.
- Fixed messages for entry hazards, screens, weather, damage, healing, Tailwind, Perish Song, Destiny Bond, Shed Skin, Uproar, Forewarn, Disguise, Arena Trap, Yawn, Curse, Clamp, Whirlpool, Liquid Ooze, Miracle Eye, Safeguard, Magic Bounce, Lock On, Focus Energy, Confusion, and more.
- Fixed Porygon not evolving with an Upgrade.
- Fixed super sized Pumpkaboo not having any moves.
- Fixed Infernape look animation.
- Fixed Garchomp t-posing while swimming.
- Fixed a bug that caused sleeping Pokémon to stay asleep.
- Fixed a bug that would freeze a battle when a Pokémon gets trapped due to an ability.
- Fixed Garchomp T-posing while swimming which was very funny.
- Fixed a bug that caused sleeping Pokémon to stay asleep. Forever. The years passing them by as they dream of a world without hate...
- Fixed a bug that would freeze a battle when a Pokémon gets trapped by an ability, making the trap abilities even scarier and trap-like than they were before.
- Fixed the Poké Ball close animation canceling whenever colliding with a block.
- Fixed faint animations not working properly in add-ons.
- Fixed lighting and Pokémon label issues when a Pokémon item frame is nearby.
- Fixed Pokémon being able to spawn outside the world border as a tease.
- Fixed deepslate water stone ore items looking like deepslate fire stone ores.
- Fixed a bunch of client-side logging errors when Pokémon are shoulder mounted.
- Fixed deepslate water stone ore items looking like deepslate fire stone ores. Huh?
- Fixed a bunch of client-side logging errors when Pokémon are shoulder mounted. You didn't notice? Good.
- Fixed a crash when wild Pokémon have to struggle under specific circumstances.
- Fixed uncolored pixels on Yanma's shiny texture.
- Fixed apricorn tree leaves looking gross on Fast graphics mode.
- Fixed apricorn tree leaves looking gross on the Fast graphics mode.
- Fixed hoes not breaking apricorn tree leaves any faster.
- Fixed Shiftry's PC model position.
- Fixed the /pc command not playing the opening sound.
- Fixed Shedinja not being able to recover naturally.
- Fixed different forms of Pokémon not being able to appear as different sizes.
- Fixed the Healing Machine soft locking you from using others when removed by non-players.
- Fixed animations being sped up when using the Replay Mod.
- Fixed particle animations not running when a Pokémon is off-screen.
- Fixed Pokémon variants and layers not rendering correctly when shouldered and playing on a dedicated server, existing shoulders affected will need to be retrieved and shouldered again.
- Shoulder effects will now stay applied through situations that remove potion effects such as drinking milk.
- Fixed Shedninja evolving to use the consumed Pokeball and removed the held item.
- Fixed non-existent species in spawn pool file causing random species to spawn.
- Fixed shoulder effects not staying applied through situations that remove potion effects such as drinking milk.
- Fixed Shedinja not being able to recover naturally.
- Fixed Shedinja evolving to use the consumed Poké Ball and removed the held item to prevent dupes.
- Fixed Shedinja healing above 1 HP.
- Fixed Shedinja, basically.
- Fixed shearing Pokémon dropping 0-2 wool instead of 1-3.
- Fixed some alignment issues in the stat hexagon of the summary menu.
- Fixed some alignment issues in the stat hexagon of the summary menu. OCD people rejoice.
- Fixed capture calculations not applying ball bonuses entirely correctly.
- Fixed battles soft-locking when consecutive Pokémon faint on switch-in.
- Fixed timing and color of battle window messages.
- Fixed players being able to trade, battle and let out their Pokémon while in spectator mode.
- Fixed Galarian Yamask not being able to evolve and by proxy the ``damage_taken`` evolution requirement.
- Fixed Bisharp not being able to evolve and by proxy the ``defeat`` evolution requirement.
- Fixed White-Striped Basculin not being able to evolve because of a broken ``recoil`` evolution requirement.
- Fixed Primeape, Qwilfish and Stantler not being able to evolve because of a broken ``use_move`` evolution requirement.
- Fixed Bramblin, Pawmo, and Rellor not being able to evolve because of a broken ``blocks_traveled`` evolution requirement.
- Fixed displayName property in spawn files not doing what it's meant to do.
- Fixed Pokémon not sleeping in the wild like we wanted them to.
### Developer
- Added SpawnEvent
- Added persistent NBT property inside Pokemon to store quick and simple data.
- Added SpawnEvent, ThrownPokeballHitEvent, PokemonSentEvent, PokemonRecalledEvent.
- Added BattleFledEvent, BattleStartedEvent, BattleFaintedEvent.
- Added persistent NBT property inside Pokémon to store quick and simple data.
- Species and FormData have had their evolutions, pre-evolution and labels properties exposed. It is still recommended to work using a Pokémon instance when possible.
- Added capture check to BattleVictoryEvent
- Added ThownPokeballHitEvent
- Added capture check to BattleVictoryEvent.
- The various hardcoded potion shoulder effects have been removed, make use of PotionBaseEffect.
- Added ContextManager for tracking causes and contexts of conditions created during a battle. See BattleContext for types of conditions that are tracked.
- Added MongoDB support for storing Pokémon and Player data. Must be enabled in config, requires MongoDB core and sync drivers (4.10.0+).
- CobblemonShowdown updated to version 10.
- Generation of a battle can be set in BattleFormat.
- Pokémon now have ``teraType``, ``dmaxLevel``, and ``gmaxFactor`` properties. Gimmicks can be used during battle by adding the respective identifiers to ``keyItems`` in PlayerData: ``key_stone``, ``z_ring``, ``dynamax_band``, and ``tera_orb``. Dynamax is only supported in Gen 8 battles. Mega Evolution and Z-Power require custom held items to be added (e.g. an item with the path ``gengarite`` will allow Gengar to Mega Evolve). Currently custom Z-Crystals and Mega Stones are not supported.
### Datapack & Resourcepack Creators
- All potion related shoulder effects have had their IDs changed, they now all share the same type being `potion_effect` and use the vanilla Potion data [parameters](https://minecraft.fandom.com/wiki/Potion#Item_data), take for example the default Pidgey asset:
- All potion related shoulder effects have had their IDs changed. They now all share the same type being `potion_effect` and use the vanilla Potion data [parameters](https://minecraft.fandom.com/wiki/Potion#Item_data). For example, here is the converted Pidgey asset:
- ```json
{
"type": "potion_effect",
@@ -247,6 +424,23 @@
"showIcon": false
}
```
- Renamed the ``walked_steps`` evolution requirement to ``blocks_traveled``.
- Added support for scale in animations.
- Added support for jump keyframes (i.e. pre and post keyframes)
- Added structure spawning conditions
- Added Advancement trigger for defeating Pokémon and collecting varieties of Pokémon.
- Added support for "isBattle" and "isTouchingWater" properties on resource pack Pokémon poses. This allows your custom Pokémon to be posed differently when in battle.
- Added support for "isVisible" on a transformed part on resource pack Pokémon poses. This allows your custom Pokémon to have bones disappear in specific poses, such as hiding Greninja's throwing star when not in a battle pose.
- Added support for battle music. Sounds can be added to the ``battle.pvp.default`` and ``battle.pvw.default`` sound events.
- Added 'enabled' optional property on model layers, allowing later variations to disable previously-defined layers. See [this issue](https://gitlab.com/cable-mc/cobblemon/-/issues/335) for how this looks.
- Cobblemon items can now all have their own tooltips via resourcepacks. To add a tooltip, add a lang entry like "item.cobblemon.{item_id}.tooltip". If you want to add multiple tooltip lines you can do so with "item.cobblemon.{item_id}.tooltip_1" and upwards.
- Item interaction evolutions and held item requirements now support NBT by creating an object JSON containing the key ``item`` for what used to be the existing condition support and a ``nbt`` key for the NBT format, this is the string [format](https://minecraft.fandom.com/wiki/NBT_format) expected in commands. Existing data does not need to be updated.
- Fixed faint animations not working properly in add-ons.
- Fixed non-existent species in spawn pool files causing random species to spawn.
### Localization
- Added partial translations for Dutch, Polish, Swedish, Hungarian, Czech, Cyprus Greek, and even Esperanto.
- Updated translation for French and Canadian French, Simplified Chinese, Japanese, Korean, Spanish and Mexican Spanish, Pirate English, German, Thai, Turkish, Portuguese and Brazilian Portuguese, Ukrainian, and Russian.
## [1.3.1 (March 31st, 2023)](#1-3-1)
@@ -260,7 +454,7 @@
- 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 `/pokebox` and `/pokeboxall` commands to move Pokémon(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
@@ -283,7 +477,6 @@
- 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.
- Healing Machine and PC are now mine-able with pickaxes and Apricorn leaves are mine-able using hoes.
- Updated Pokéball, UI and evolution sounds.
### Fixes
- Fixed killing a Dodrio killing your game. Dodrio will never look the same to us.
@@ -604,6 +797,7 @@
- Fixed Magnitude battle messages.
- Moves that are disabled or out of PP now show transparently in the battle GUI instead of being hidden completely.
- Statuses like sleep and frozen no longer last forever if it was carried over from a previous battle.
- Fixed a formatting error that affected Pokemon nicknames when the storage type is JSON.
### Localization
- Added species, ability, and move translations for `ko_ko`, `jp_jp`, `fr_fr`, `es_es`, `it_it`, and `zh_cn`.
@@ -1,3 +1,13 @@
/*
*
* * Copyright (C) 2023 Cobblemon Contributors
* *
* * This Source Code Form is subject to the terms of the Mozilla Public
* * License, v. 2.0. If a copy of the MPL was not distributed with this
* * file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
*/
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
val accessWidenerFile = "src/main/resources/cobblemon-common.accesswidener"
@@ -13,6 +23,9 @@ plugins {
repositories {
mavenCentral()
//JEI
maven("https://maven.blamejared.com/")
maven("https://maven.tterrag.com/")
}
license {
@@ -55,4 +68,4 @@ tasks {
withType<Jar> {
from(rootProject.file("LICENSE"))
}
}
}
+16
View File
@@ -1,3 +1,13 @@
/*
*
* * Copyright (C) 2023 Cobblemon Contributors
* *
* * This Source Code Form is subject to the terms of the Mozilla Public
* * License, v. 2.0. If a copy of the MPL was not distributed with this
* * file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
*/
plugins {
id("cobblemon.base-conventions")
id("cobblemon.publish-conventions")
@@ -17,13 +27,19 @@ dependencies {
implementation(libs.reflect)
modImplementation(libs.fabricLoader)
//Flywheel has no common dep so just pick one and don't use any platform specific code in common
// modCompileOnly(libs.flywheelFabric)
modApi(libs.molang)
compileOnlyApi(libs.jeiApi)
// For Showdown
modCompileOnly(libs.graal)
//shadowCommon group: 'commons-io', name: 'commons-io', version: '2.6'
// For datastore
modCompileOnly(libs.mongoDriverCore)
modCompileOnly(libs.mongoDriverSync)
testRuntimeOnly(libs.junitEngine)
testImplementation(libs.junitApi)
@@ -0,0 +1,16 @@
/*
* 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.bridges;
import net.minecraft.structure.processor.StructureProcessor;
public interface StructureProcessorListBridge {
void append(StructureProcessor processor);
void clear();
}
@@ -8,6 +8,8 @@
package com.cobblemon.mod.common.client.render.models.blockbench.pose;
import com.cobblemon.mod.common.client.render.models.blockbench.PoseableEntityModel;
import com.cobblemon.mod.common.client.render.models.blockbench.repository.RenderContext;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.Entity;
@@ -38,7 +40,7 @@ public interface Bone {
/**
* Renders a particular bone in relation to a particular entity.
*
* @param entity The entity this bone is being drawn for. This parameter need not be available and can be null
* @param context The render context this bone is being drawn for.
* @param stack The current [MatrixStack] for the renderer
* @param buffer The vertex consumer deployed by the renderer
* @param packedLight The light level to be applied to the bone
@@ -50,8 +52,8 @@ public interface Bone {
*
* @since 1.4.0
*/
<T extends Entity> void render(
@Nullable T entity,
void render(
RenderContext context,
MatrixStack stack,
VertexConsumer buffer,
int packedLight,
@@ -0,0 +1,38 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.mixin;
import com.cobblemon.mod.common.block.PreEmptsExplosion;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.explosion.Explosion;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(value = Explosion.class)
public class ExplosionMixin {
@Redirect(
method = "affectWorld",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/world/World;getBlockState(Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/block/BlockState;",
ordinal = 0
)
)
public BlockState cobblemon$whenExploded(World world, BlockPos pos) {
BlockState blockState = world.getBlockState(pos);
if(blockState.getBlock() instanceof PreEmptsExplosion preExplosionBlock) {
preExplosionBlock.whenExploded(world, blockState, pos);
}
return blockState;
}
}
@@ -8,7 +8,9 @@
package com.cobblemon.mod.common.mixin;
import com.cobblemon.mod.common.client.render.models.blockbench.PoseableEntityModel;
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Bone;
import com.cobblemon.mod.common.client.render.models.blockbench.repository.RenderContext;
import net.minecraft.client.model.ModelPart;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.client.util.math.MatrixStack;
@@ -36,7 +38,7 @@ public abstract class ModelPartMixin implements Bone {
}
@Override
public <T extends Entity> void render(T entity, MatrixStack stack, VertexConsumer buffer, int packedLight, int packedOverlay, float r, float g, float b, float a) {
public void render(RenderContext context, MatrixStack stack, VertexConsumer buffer, int packedLight, int packedOverlay, float r, float g, float b, float a) {
this.render(stack, buffer, packedLight, packedOverlay, r, g, b, a);
}
@@ -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.mixin;
import com.mojang.datafixers.util.Pair;
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import net.minecraft.structure.pool.StructurePool;
import net.minecraft.structure.pool.StructurePoolElement;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Mutable;
import org.spongepowered.asm.mixin.gen.Accessor;
import java.util.List;
@Mixin(StructurePool.class)
public interface StructurePoolAccessor {
@Accessor("elementCounts")
List<Pair<StructurePoolElement, Integer>> getElementCounts();
@Mutable
@Accessor("elementCounts")
void setElementCounts(List<Pair<StructurePoolElement, Integer>> elementCounts);
@Accessor("elements")
ObjectArrayList<StructurePoolElement> getElements();
}
@@ -0,0 +1,217 @@
/*
* 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.world.CobblemonStructureIDs;
import net.minecraft.registry.Registry;
import net.minecraft.structure.PoolStructurePiece;
import net.minecraft.structure.StructureTemplateManager;
import net.minecraft.structure.pool.*;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.random.Random;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.world.HeightLimitView;
import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.noise.NoiseConfig;
import org.apache.commons.lang3.mutable.MutableObject;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Mutable;
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.ModifyVariable;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import java.util.*;
@Mixin(StructurePoolBasedGenerator.StructurePoolGenerator.class)
public abstract class StructurePoolGeneratorMixin {
@Final
@Mutable
@Shadow Deque<StructurePoolBasedGenerator.ShapedPoolStructurePiece> structurePieces;
Map<String, Integer> generatedStructureGroupCounts;
private static final Map<String, Integer> structureMaxes;
private static final Map<Identifier, Set<String>> structureGroups = new HashMap<>();
static {
String pokecenter = "pokecenter";
String berry = "berry_farm";
structureGroups.put(CobblemonStructureIDs.PLAINS_POKECENTER, Set.of(pokecenter));
structureGroups.put(CobblemonStructureIDs.DESERT_POKECENTER, Set.of(pokecenter));
structureGroups.put(CobblemonStructureIDs.SAVANNA_POKECENTER, Set.of(pokecenter));
structureGroups.put(CobblemonStructureIDs.SNOWY_POKECENTER, Set.of(pokecenter));
structureGroups.put(CobblemonStructureIDs.TAIGA_POKECENTER, Set.of(pokecenter));
structureGroups.put(CobblemonStructureIDs.SAVANNA_BERRY_SMALL, Set.of(berry));
structureGroups.put(CobblemonStructureIDs.SAVANNA_BERRY_LARGE, Set.of(berry));
structureGroups.put(CobblemonStructureIDs.PLAINS_BERRY_SMALL, Set.of(berry));
structureGroups.put(CobblemonStructureIDs.PLAINS_BERRY_LARGE, Set.of(berry));
structureGroups.put(CobblemonStructureIDs.SNOWY_BERRY_SMALL, Set.of(berry));
structureGroups.put(CobblemonStructureIDs.SNOWY_BERRY_LARGE, Set.of(berry));
structureGroups.put(CobblemonStructureIDs.DESERT_BERRY_SMALL, Set.of(berry));
structureGroups.put(CobblemonStructureIDs.DESERT_BERRY_LARGE, Set.of(berry));
structureGroups.put(CobblemonStructureIDs.TAIGA_BERRY_SMALL, Set.of(berry));
structureGroups.put(CobblemonStructureIDs.TAIGA_BERRY_LARGE, Set.of(berry));
//Mapped using location string as key
Map<String, Integer> aMap = new HashMap<>();
aMap.put(pokecenter, 1);
aMap.put(berry, 2);
// aMap.put(CobblemonStructureIDs.PLAINS_LONG_PATH, 3);
// aMap.put(CobblemonStructureIDs.DESERT_LONG_PATH, 3);
// aMap.put(CobblemonStructureIDs.SAVANNA_LONG_PATH, 3);
// aMap.put(CobblemonStructureIDs.SNOWY_LONG_PATH, 3);
// aMap.put(CobblemonStructureIDs.TAIGA_LONG_PATH, 3);
structureMaxes = Collections.unmodifiableMap(aMap);
}
public Set<String> getGroups(Identifier structureIdentifier) {
return structureGroups.getOrDefault(structureIdentifier, Set.of());
}
public boolean hasReachedMaximum(Identifier structureIdentifier) {
Set<String> groups = getGroups(structureIdentifier);
for (String group : groups) {
int count = generatedStructureGroupCounts.getOrDefault(group, 0);
if (count >= structureMaxes.getOrDefault(group, Integer.MAX_VALUE)) {
return true;
}
}
return false;
}
public void incrementStructureCount(Identifier structureIdentifier) {
Set<String> groups = getGroups(structureIdentifier);
for (String group : groups) {
generatedStructureGroupCounts.put(group, generatedStructureGroupCounts.getOrDefault(group, 0) + 1);
}
}
@Inject(method = "<init>", at = @At("RETURN"))
private void onStructurePoolGeneratorCreation(Registry<StructurePool> registry, int maxSize, ChunkGenerator chunkGenerator, StructureTemplateManager structureTemplateManager, List<? super PoolStructurePiece> children, Random random, CallbackInfo ci) {
generatedStructureGroupCounts = new HashMap<>();
}
@ModifyVariable(method = "generatePiece", at = @At("STORE"), ordinal = 1)
private Iterator<StructurePoolElement> reduceStructurePoolElementIterator(Iterator<StructurePoolElement> iterator) {
List<StructurePoolElement> reducedList = new ArrayList<>();
while (iterator.hasNext()) {
StructurePoolElement structure = iterator.next();
Identifier structurePieceLocationKey = getCobblemonOnlyLocation(structure);
if (structurePieceLocationKey == null) {
reducedList.add(structure);
continue;
}
if (!hasReachedMaximum(structurePieceLocationKey)) {
reducedList.add(structure);
}
}
return reducedList.iterator();
}
@ModifyVariable(method = "generatePiece", at = @At("STORE"), ordinal = 1)
private PoolStructurePiece injected(PoolStructurePiece poolStructurePiece) {
Identifier structureLocationKey = getCobblemonOnlyLocation(poolStructurePiece.getPoolElement());
if (structureLocationKey != null) {
incrementStructureCount(structureLocationKey);
}
return poolStructurePiece;
}
// This doesn't SEEM necessary? It appears to work without.
@Inject(method = "generatePiece", at = @At("HEAD"))
private void beforeGeneratePiece(PoolStructurePiece piece, MutableObject<VoxelShape> pieceShape, int minY, boolean modifyBoundingBox, HeightLimitView world, NoiseConfig noiseConfig, CallbackInfo ci) {
// Identifier structureLocationKey = getCobblemonOnlyLocation(piece.getPoolElement());
//
// if (structureLocationKey != null) {
// Integer currentlyGenerated = generatedStructureCounts.get(structureLocationKey);
// if (currentlyGenerated == null) currentlyGenerated = 0;
// generatedStructureCounts.put(structureLocationKey, currentlyGenerated + 1);
// }
//
// List<StructurePoolBasedGenerator.ShapedPoolStructurePiece> reducedStructurePiecesList = structurePieces.stream().toList();
//
// for (Identifier maxStructureLocationKey : structureMaxes.keySet()) {
// Integer maxAllowed = structureMaxes.get(maxStructureLocationKey);
//
// Integer currentlyGenerated = generatedStructureCounts.get(maxStructureLocationKey);
// if (currentlyGenerated == null) currentlyGenerated = 0;
// if (currentlyGenerated < maxAllowed) {
// continue;
// }
//
// //Already have max so need to remove
// reducedStructurePiecesList = reducedStructurePiecesList.stream()
// .filter(shapedStructurePiece -> {
// Identifier locationKey = getCobblemonOnlyLocation(shapedStructurePiece.piece.getPoolElement());
// if (locationKey == null) {
// return true;
// }
//
// return !locationKey.equals(maxStructureLocationKey);
// })
// .collect(Collectors.toList());
// }
//
// structurePieces = new ArrayDeque<>(reducedStructurePiecesList);
}
private static Identifier getCobblemonOnlyLocation(StructurePoolElement structurePoolElement) {
Identifier location = getLocationIfAvailable(structurePoolElement);
if (location == null) return null;
if (!location.getNamespace().equals("cobblemon")) return null;
return location;
}
private static Identifier getLocationIfAvailable(StructurePoolElement structurePoolElement) {
if (structurePoolElement instanceof LegacySinglePoolElement legacySinglePoolElement) {
if (legacySinglePoolElement.location.left().isEmpty()) return null;
return legacySinglePoolElement.location.left().get();
} else if (structurePoolElement instanceof SinglePoolElement singlePoolElement) {
if (singlePoolElement.location.left().isEmpty()) return null;
return singlePoolElement.location.left().get();
} else {
return null;
}
}
// private List<StructurePoolElement> removeInstanceOfLocationKeyFrom(List<StructurePoolElement> structureList, Integer allowedNumberOfInstances, Identifier locationKey) {
// List<StructurePoolElement> reducedList = new ArrayList<>();
// int instancesFound = 0;
//
// for (StructurePoolElement structurePoolElement: structureList) {
// Identifier structureKey = getCobblemonOnlyLocation(structurePoolElement);
// if (structureKey == null || !structureKey.equals(locationKey)) {
// reducedList.add(structurePoolElement);
// continue;
// }
//
// if (instancesFound >= allowedNumberOfInstances) {
// continue;
// }
//
// reducedList.add(structurePoolElement);
// instancesFound++;
// }
//
// return reducedList;
// }
}
@@ -0,0 +1,43 @@
/*
* 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.bridges.StructureProcessorListBridge;
import com.google.common.collect.ImmutableList;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.structure.processor.StructureProcessor;
import net.minecraft.structure.processor.StructureProcessorList;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Mutable;
import org.spongepowered.asm.mixin.Shadow;
@Mixin(StructureProcessorList.class)
public class StructureProcessorListMixin implements StructureProcessorListBridge {
@Final
@Mutable
@Shadow
private List<StructureProcessor> list;
@Override
public void append(StructureProcessor processor) {
List<StructureProcessor> mutable = new ArrayList<>(this.list);
mutable.add(processor);
this.list = ImmutableList.copyOf(mutable);
}
@Override
public void clear() {
this.list = ImmutableList.of();
}
}
@@ -9,6 +9,7 @@
package com.cobblemon.mod.common
import com.cobblemon.mod.common.advancement.CobblemonCriteria
import com.cobblemon.mod.common.advancement.criterion.EvolvePokemonContext
import com.cobblemon.mod.common.api.Priority
import com.cobblemon.mod.common.api.SeasonResolver
import com.cobblemon.mod.common.api.data.DataProvider
@@ -18,7 +19,9 @@ import com.cobblemon.mod.common.api.drop.ItemDropEntry
import com.cobblemon.mod.common.api.events.CobblemonEvents.BATTLE_VICTORY
import com.cobblemon.mod.common.api.events.CobblemonEvents.DATA_SYNCHRONIZED
import com.cobblemon.mod.common.api.events.CobblemonEvents.EVOLUTION_COMPLETE
import com.cobblemon.mod.common.api.events.CobblemonEvents.LEVEL_UP_EVENT
import com.cobblemon.mod.common.api.events.CobblemonEvents.POKEMON_CAPTURED
import com.cobblemon.mod.common.api.events.CobblemonEvents.TRADE_COMPLETED
import com.cobblemon.mod.common.api.net.serializers.PoseTypeDataSerializer
import com.cobblemon.mod.common.api.net.serializers.StringSetDataSerializer
import com.cobblemon.mod.common.api.net.serializers.Vec3DataSerializer
@@ -46,13 +49,16 @@ import com.cobblemon.mod.common.api.spawning.prospecting.SpawningProspector
import com.cobblemon.mod.common.api.starter.StarterHandler
import com.cobblemon.mod.common.api.storage.PokemonStoreManager
import com.cobblemon.mod.common.api.storage.adapter.conversions.ReforgedConversion
import com.cobblemon.mod.common.api.storage.adapter.flatifle.FileStoreAdapter
import com.cobblemon.mod.common.api.storage.adapter.flatifle.JSONStoreAdapter
import com.cobblemon.mod.common.api.storage.adapter.flatifle.NBTStoreAdapter
import com.cobblemon.mod.common.api.storage.adapter.database.MongoDBStoreAdapter
import com.cobblemon.mod.common.api.storage.adapter.flatfile.FileStoreAdapter
import com.cobblemon.mod.common.api.storage.adapter.flatfile.JSONStoreAdapter
import com.cobblemon.mod.common.api.storage.adapter.flatfile.NBTStoreAdapter
import com.cobblemon.mod.common.api.storage.factory.FileBackedPokemonStoreFactory
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.storage.player.factory.JsonPlayerDataStoreFactory
import com.cobblemon.mod.common.api.storage.player.factory.MongoPlayerDataStoreFactory
import com.cobblemon.mod.common.api.tags.CobblemonEntityTypeTags
import com.cobblemon.mod.common.battles.BagItems
import com.cobblemon.mod.common.battles.BattleFormat
@@ -86,7 +92,6 @@ import com.cobblemon.mod.common.pokemon.feature.TagSeasonResolver
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
import com.cobblemon.mod.common.pokemon.properties.tags.PokemonFlagProperty
import com.cobblemon.mod.common.pokemon.stat.CobblemonStatProvider
import com.cobblemon.mod.common.starter.CobblemonStarterHandler
@@ -101,6 +106,10 @@ import com.cobblemon.mod.common.util.server
import com.cobblemon.mod.common.world.feature.CobblemonPlacedFeatures
import com.cobblemon.mod.common.world.feature.ore.CobblemonOrePlacedFeatures
import com.cobblemon.mod.common.world.gamerules.CobblemonGameRules
import com.mongodb.ConnectionString
import com.mongodb.MongoClientSettings
import com.mongodb.client.MongoClient
import com.mongodb.client.MongoClients
import java.io.File
import java.io.FileReader
import java.io.FileWriter
@@ -245,7 +254,6 @@ object Cobblemon {
DataKeys.HAS_BEEN_SHEARED,
FlagSpeciesFeatureProvider(keys = listOf(DataKeys.HAS_BEEN_SHEARED), default = false))
CustomPokemonProperty.register(UntradeableProperty)
CustomPokemonProperty.register(UncatchableProperty)
CustomPokemonProperty.register(PokemonFlagProperty)
CustomPokemonProperty.register(HiddenAbilityPropertyType)
@@ -258,15 +266,52 @@ object Cobblemon {
PlatformEvents.SERVER_STARTING.subscribe { event ->
val server = event.server
playerData = PlayerDataStoreManager().also { it.setup(server) }
val mongoClient: MongoClient?
val pokemonStoreRoot = server.getSavePath(WorldSavePath.ROOT).resolve("pokemon").toFile()
val storeAdapter = when (config.storageFormat) {
"nbt", "json" -> {
val jsonFactory = JsonPlayerDataStoreFactory()
jsonFactory.setup(server)
playerData.setFactory(jsonFactory)
if (config.storageFormat == "nbt") {
NBTStoreAdapter(pokemonStoreRoot.absolutePath, useNestedFolders = true, folderPerClass = true)
} else {
JSONStoreAdapter(
pokemonStoreRoot.absolutePath,
useNestedFolders = true,
folderPerClass = true
)
}
}
"mongodb" -> {
try {
Class.forName("com.mongodb.client.MongoClient")
val mongoClientSettings = MongoClientSettings.builder()
.applyConnectionString(ConnectionString(config.mongoDBConnectionString))
.build()
mongoClient = MongoClients.create(mongoClientSettings)
val mongoFactory = MongoPlayerDataStoreFactory(mongoClient, config.mongoDBDatabaseName)
playerData.setFactory(mongoFactory)
MongoDBStoreAdapter(mongoClient, config.mongoDBDatabaseName)
} catch (e: ClassNotFoundException) {
LOGGER.error("MongoDB driver not found.")
throw e
}
}
else -> throw IllegalArgumentException("Unsupported storageFormat: ${config.storageFormat}")
}
.with(ReforgedConversion(server.getSavePath(WorldSavePath.ROOT))) as FileStoreAdapter<*>
storage.registerFactory(
priority = Priority.LOWEST,
factory = FileBackedPokemonStoreFactory(
adapter = if (config.storageFormat == "nbt") {
NBTStoreAdapter(pokemonStoreRoot.absolutePath, useNestedFolders = true, folderPerClass = true)
} else {
JSONStoreAdapter(pokemonStoreRoot.absolutePath, useNestedFolders = true, folderPerClass = true)
}.with(ReforgedConversion(server.getSavePath(WorldSavePath.ROOT))) as FileStoreAdapter<*>,
adapter = storeAdapter,
createIfMissing = true,
pcConstructor = { uuid -> PCStore(uuid).also { it.resize(config.defaultBoxCount) } }
)
@@ -292,7 +337,7 @@ object Cobblemon {
// Ensure the config option is enabled and that the result was a ninjask and that shedinja exists
if (this.config.ninjaskCreatesShedinja && pokemon.species.resourceIdentifier == ninjaskIdentifier && PokemonSpecies.getByIdentifier(Pokemon.SHEDINJA) != null) {
val player = pokemon.getOwnerPlayer() ?: return@subscribe
if (player.inventory.containsAny { it.item is PokeBallItem }) {
if (player.isCreative || player.inventory.containsAny { it.item is PokeBallItem }) {
var pokeball = Items.AIR
player.inventory.combinedInventory.forEach {
it.forEach {
@@ -301,7 +346,12 @@ object Cobblemon {
}
}
}
player.inventory.removeAmountIf(1) { it.item is PokeBallItem }
if (!player.isCreative) {
player.inventory.removeAmountIf(1) { it.item is PokeBallItem }
}
if (pokeball == Items.AIR) {
pokeball = CobblemonItems.POKE_BALL
}
val properties = event.evolution.result.copy()
properties.species = Pokemon.SHEDINJA.toString()
val product = pokemon.clone()
@@ -309,9 +359,12 @@ object Cobblemon {
properties.apply(product)
product.caughtBall = (pokeball as PokeBallItem).pokeBall
pokemon.storeCoordinates.get()?.store?.add(product)
CobblemonCriteria.EVOLVE_POKEMON.trigger(player, EvolvePokemonContext(event.pokemon.preEvolution!!.species.resourceIdentifier, product.species.resourceIdentifier, playerData.get(player).advancementData.totalEvolvedCount))
}
}
}
LEVEL_UP_EVENT.subscribe { AdvancementHandler.onLevelUp(it) }
TRADE_COMPLETED.subscribe { AdvancementHandler.onTradeCompleted(it) }
BagItems.observable.subscribe {
LOGGER.info("Starting dummy Showdown battle to force it to pre-load data.")
@@ -8,6 +8,7 @@
package com.cobblemon.mod.common
import com.cobblemon.mod.common.block.entity.BerryBlockEntity
import com.cobblemon.mod.common.block.entity.HealingMachineBlockEntity
import com.cobblemon.mod.common.block.entity.PCBlockEntity
import com.cobblemon.mod.common.block.entity.PokemonPastureBlockEntity
@@ -27,6 +28,7 @@ object CobblemonBlockEntities : PlatformRegistry<Registry<BlockEntityType<*>>, R
val HEALING_MACHINE: BlockEntityType<HealingMachineBlockEntity> = this.create("healing_machine", BlockEntityType.Builder.create(::HealingMachineBlockEntity, CobblemonBlocks.HEALING_MACHINE).build(null))
@JvmField
val PC: BlockEntityType<PCBlockEntity> = this.create("pc", BlockEntityType.Builder.create(::PCBlockEntity, CobblemonBlocks.PC).build(null))
val BERRY = this.create("berry", BlockEntityType.Builder.create(::BerryBlockEntity, *CobblemonBlocks.berries().values.toTypedArray()).build(null))
@JvmField
val PASTURE: BlockEntityType<PokemonPastureBlockEntity> = this.create("pasture", BlockEntityType.Builder.create(::PokemonPastureBlockEntity, CobblemonBlocks.PASTURE).build(null))
@@ -17,6 +17,8 @@ import com.cobblemon.mod.common.mixin.invoker.StairsBlockInvoker
import com.cobblemon.mod.common.mixin.invoker.TrapdoorBlockInvoker
import com.cobblemon.mod.common.mixin.invoker.*
import com.cobblemon.mod.common.platform.PlatformRegistry
import com.cobblemon.mod.common.util.cobblemonResource
import com.cobblemon.mod.common.block.BerryBlock
import net.minecraft.block.*
import net.minecraft.block.piston.PistonBehavior
import net.minecraft.entity.effect.StatusEffects
@@ -25,6 +27,7 @@ import net.minecraft.registry.Registry
import net.minecraft.registry.RegistryKey
import net.minecraft.registry.RegistryKeys
import net.minecraft.sound.BlockSoundGroup
import net.minecraft.util.Identifier
import net.minecraft.util.math.intprovider.UniformIntProvider
@Suppress("SameParameterValue", "HasPlatformType", "MemberVisibilityCanBePrivate", "unused")
@@ -227,6 +230,87 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, RegistryKey<Registry<
private fun apricornBlock(name: String, apricorn: Apricorn): ApricornBlock = this.create(name, ApricornBlock(AbstractBlock.Settings.create().mapColor(apricorn.mapColor()).ticksRandomly().strength(Blocks.OAK_LOG.hardness, Blocks.OAK_LOG.blastResistance).sounds(BlockSoundGroup.WOOD).nonOpaque(), apricorn))
private val berries = mutableMapOf<Identifier, BerryBlock>()
val AGUAV_BERRY = this.berryBlock("aguav")
val APICOT_BERRY = this.berryBlock("apicot")
val ASPEAR_BERRY = this.berryBlock("aspear")
val BABIRI_BERRY = this.berryBlock("babiri")
val BELUE_BERRY = this.berryBlock("belue")
val BLUK_BERRY = this.berryBlock("bluk")
val CHARTI_BERRY = this.berryBlock("charti")
val CHERI_BERRY = this.berryBlock("cheri")
val CHESTO_BERRY = this.berryBlock("chesto")
val CHILAN_BERRY = this.berryBlock("chilan")
val CHOPLE_BERRY = this.berryBlock("chople")
val COBA_BERRY = this.berryBlock("coba")
val COLBUR_BERRY = this.berryBlock("colbur")
val CORNN_BERRY = this.berryBlock("cornn")
val CUSTAP_BERRY = this.berryBlock("custap")
val DURIN_BERRY = this.berryBlock("durin")
val ENIGMA_BERRY = this.berryBlock("enigma")
val FIGY_BERRY = this.berryBlock("figy")
val GANLON_BERRY = this.berryBlock("ganlon")
val GREPA_BERRY = this.berryBlock("grepa")
val HABAN_BERRY = this.berryBlock("haban")
val HONDEW_BERRY = this.berryBlock("hondew")
val HOPO_BERRY = this.berryBlock("hopo")
val IAPAPA_BERRY = this.berryBlock("iapapa")
val JABOCA_BERRY = this.berryBlock("jaboca")
val KASIB_BERRY = this.berryBlock("kasib")
val KEBIA_BERRY = this.berryBlock("kebia")
val KEE_BERRY = this.berryBlock("kee")
val KELPSY_BERRY = this.berryBlock("kelpsy")
val LANSAT_BERRY = this.berryBlock("lansat")
val LEPPA_BERRY = this.berryBlock("leppa")
val LIECHI_BERRY = this.berryBlock("liechi")
val LUM_BERRY = this.berryBlock("lum")
val MAGO_BERRY = this.berryBlock("mago")
val MAGOST_BERRY = this.berryBlock("magost")
val MARANGA_BERRY = this.berryBlock("maranga")
val MICLE_BERRY = this.berryBlock("micle")
val NANAB_BERRY = this.berryBlock("nanab")
val NOMEL_BERRY = this.berryBlock("nomel")
val OCCA_BERRY = this.berryBlock("occa")
val ORAN_BERRY = this.berryBlock("oran")
val PAMTRE_BERRY = this.berryBlock("pamtre")
val PASSHO_BERRY = this.berryBlock("passho")
val PAYAPA_BERRY = this.berryBlock("payapa")
val PECHA_BERRY = this.berryBlock("pecha")
val PERSIM_BERRY = this.berryBlock("persim")
val PETAYA_BERRY = this.berryBlock("petaya")
val PINAP_BERRY = this.berryBlock("pinap")
val POMEG_BERRY = this.berryBlock("pomeg")
val QUALOT_BERRY = this.berryBlock("qualot")
val RABUTA_BERRY = this.berryBlock("rabuta")
val RAWST_BERRY = this.berryBlock("rawst")
val RAZZ_BERRY = this.berryBlock("razz")
val RINDO_BERRY = this.berryBlock("rindo")
val ROSELI_BERRY = this.berryBlock("roseli")
val ROWAP_BERRY = this.berryBlock("rowap")
val SALAC_BERRY = this.berryBlock("salac")
val SHUCA_BERRY = this.berryBlock("shuca")
val SITRUS_BERRY = this.berryBlock("sitrus")
val SPELON_BERRY = this.berryBlock("spelon")
val STARF_BERRY = this.berryBlock("starf")
val TAMATO_BERRY = this.berryBlock("tamato")
val TANGA_BERRY = this.berryBlock("tanga")
val TOUGA_BERRY = this.berryBlock("touga")
val WACAN_BERRY = this.berryBlock("wacan")
val WATMEL_BERRY = this.berryBlock("watmel")
val WEPEAR_BERRY = this.berryBlock("wepear")
val WIKI_BERRY = this.berryBlock("wiki")
val YACHE_BERRY = this.berryBlock("yache")
fun berries() = this.berries.toMap()
private fun berryBlock(name: String): BerryBlock {
val identifier = cobblemonResource("${name}_berry")
val block = this.create(identifier.path, BerryBlock(identifier, AbstractBlock.Settings.copy(Blocks.WHEAT).dynamicBounds().sounds(BlockSoundGroup.CROP).strength(0.2F)))
this.berries[identifier] = block
return block
}
/**
* Helper method for creating logs
* copied over from Vanilla
@@ -248,4 +332,4 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, RegistryKey<Registry<
val block = BlocksInvoker.createLeavesBlock(BlockSoundGroup.GRASS)
return this.create(name, block)
}
}
}
@@ -44,6 +44,7 @@ object CobblemonCommands {
TestPcSlotCommand.register(dispatcher)
TestPartySlotCommand.register(dispatcher)
ClearPartyCommand.register(dispatcher)
ClearPCCommand.register(dispatcher)
PokemonRestartCommand.register(dispatcher)
}
}
@@ -8,6 +8,7 @@
package com.cobblemon.mod.common
import com.cobblemon.mod.common.api.data.JsonDataRegistry
import com.cobblemon.mod.common.api.net.ClientNetworkPacketHandler
import com.cobblemon.mod.common.api.net.NetworkPacket
import com.cobblemon.mod.common.api.net.ServerNetworkPacketHandler
@@ -20,6 +21,7 @@ import net.minecraft.network.listener.ClientPlayPacketListener
import net.minecraft.network.packet.Packet
import net.minecraft.registry.RegistryKey
import net.minecraft.registry.tag.TagKey
import net.minecraft.resource.ResourceManager
import net.minecraft.resource.ResourceReloader
import net.minecraft.resource.ResourceType
import net.minecraft.server.MinecraftServer
@@ -160,6 +162,13 @@ interface CobblemonImplementation {
*/
fun server(): MinecraftServer?
/**
* Handles platform independent reloading of a [JsonDataRegistry].
*
* @param registry The [JsonDataRegistry] to reload.
* @param manager The [ResourceManager] to reload from.
*/
fun <T> reloadJsonRegistry(registry: JsonDataRegistry<T>, manager: ResourceManager): HashMap<Identifier, T>
}
enum class ModAPI {
@@ -13,18 +13,27 @@ import com.cobblemon.mod.common.api.pokeball.PokeBalls
import com.cobblemon.mod.common.api.pokemon.Natures
import com.cobblemon.mod.common.api.pokemon.stats.Stats
import com.cobblemon.mod.common.api.pokemon.status.Statuses
import com.cobblemon.mod.common.block.BerryBlock
import com.cobblemon.mod.common.block.MintBlock.MintType
import com.cobblemon.mod.common.item.*
import com.cobblemon.mod.common.item.battle.DireHitItem
import com.cobblemon.mod.common.item.battle.GuardSpecItem
import com.cobblemon.mod.common.item.battle.XStatItem
import com.cobblemon.mod.common.item.berry.FriendshipRaisingBerryItem
import com.cobblemon.mod.common.item.berry.HealingBerryItem
import com.cobblemon.mod.common.item.berry.PPRestoringBerryItem
import com.cobblemon.mod.common.item.berry.PortionHealingBerryItem
import com.cobblemon.mod.common.item.berry.StatusCuringBerryItem
import com.cobblemon.mod.common.item.berry.VolatileCuringBerryItem
import com.cobblemon.mod.common.item.interactive.*
import com.cobblemon.mod.common.item.interactive.PotionItem
import com.cobblemon.mod.common.platform.PlatformRegistry
import com.cobblemon.mod.common.pokeball.PokeBall
import com.cobblemon.mod.common.pokemon.helditem.CobblemonHeldItemManager
import com.cobblemon.mod.common.util.cobblemonResource
import net.minecraft.block.Block
import net.minecraft.block.ComposterBlock
import net.minecraft.entity.LivingEntity
import net.minecraft.entity.effect.StatusEffectInstance
import net.minecraft.entity.effect.StatusEffects
import net.minecraft.item.*
@@ -32,6 +41,8 @@ import net.minecraft.registry.Registries
import net.minecraft.registry.Registry
import net.minecraft.registry.RegistryKey
import net.minecraft.registry.RegistryKeys
import net.minecraft.util.Identifier
import net.minecraft.world.World
@Suppress("unused")
object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<Item>>, Item>() {
@@ -220,8 +231,82 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<It
@JvmField val PEAT_BLOCK = noSettingsItem("peat_block")
@JvmField val RAZOR_CLAW = noSettingsItem("razor_claw")
@JvmField val RAZOR_FANG = noSettingsItem("razor_fang")
// ToDo enable me when malicious armor goes in the game
//@JvmField val AUSPICIOUS_ARMOR = heldItem("auspicious_armor")
@JvmField val AUSPICIOUS_ARMOR = heldItem("auspicious_armor")
@JvmField val MALICIOUS_ARMOR = heldItem("malicious_armor")
private val berries = mutableMapOf<Identifier, BerryItem>()
// Plants
@JvmField val ORAN_BERRY = berryItem("oran", HealingBerryItem(CobblemonBlocks.ORAN_BERRY) { CobblemonMechanics.berries.oranRestoreAmount })
@JvmField val CHERI_BERRY = berryItem("cheri", StatusCuringBerryItem(CobblemonBlocks.CHERI_BERRY, Statuses.PARALYSIS))
@JvmField val CHESTO_BERRY = berryItem("chesto", StatusCuringBerryItem(CobblemonBlocks.CHESTO_BERRY, Statuses.SLEEP))
@JvmField val PECHA_BERRY = berryItem("pecha", StatusCuringBerryItem(CobblemonBlocks.PECHA_BERRY, Statuses.POISON, Statuses.POISON_BADLY))
@JvmField val RAWST_BERRY = berryItem("rawst", StatusCuringBerryItem(CobblemonBlocks.RAWST_BERRY, Statuses.BURN))
@JvmField val ASPEAR_BERRY = berryItem("aspear", StatusCuringBerryItem(CobblemonBlocks.ASPEAR_BERRY, Statuses.FROZEN))
@JvmField val PERSIM_BERRY = berryItem("persim", VolatileCuringBerryItem(CobblemonBlocks.PERSIM_BERRY, "confusion"))
@JvmField val RAZZ_BERRY = berryItem("razz", CobblemonBlocks.RAZZ_BERRY)
@JvmField val BLUK_BERRY = berryItem("bluk", CobblemonBlocks.BLUK_BERRY)
@JvmField val NANAB_BERRY = berryItem("nanab", CobblemonBlocks.NANAB_BERRY)
@JvmField val WEPEAR_BERRY = berryItem("wepear", CobblemonBlocks.WEPEAR_BERRY)
@JvmField val PINAP_BERRY = berryItem("pinap", CobblemonBlocks.PINAP_BERRY)
@JvmField val OCCA_BERRY = berryItem("occa", CobblemonBlocks.OCCA_BERRY)
@JvmField val PASSHO_BERRY = berryItem("passho", CobblemonBlocks.PASSHO_BERRY)
@JvmField val WACAN_BERRY = berryItem("wacan", CobblemonBlocks.WACAN_BERRY)
@JvmField val RINDO_BERRY = berryItem("rindo", CobblemonBlocks.RINDO_BERRY)
@JvmField val YACHE_BERRY = berryItem("yache", CobblemonBlocks.YACHE_BERRY)
@JvmField val CHOPLE_BERRY = berryItem("chople", CobblemonBlocks.CHOPLE_BERRY)
@JvmField val KEBIA_BERRY = berryItem("kebia", CobblemonBlocks.KEBIA_BERRY)
@JvmField val SHUCA_BERRY = berryItem("shuca", CobblemonBlocks.SHUCA_BERRY)
@JvmField val COBA_BERRY = berryItem("coba", CobblemonBlocks.COBA_BERRY)
@JvmField val PAYAPA_BERRY = berryItem("payapa", CobblemonBlocks.PAYAPA_BERRY)
@JvmField val TANGA_BERRY = berryItem("tanga", CobblemonBlocks.TANGA_BERRY)
@JvmField val CHARTI_BERRY = berryItem("charti", CobblemonBlocks.CHARTI_BERRY)
@JvmField val KASIB_BERRY = berryItem("kasib", CobblemonBlocks.KASIB_BERRY)
@JvmField val HABAN_BERRY = berryItem("haban", CobblemonBlocks.HABAN_BERRY)
@JvmField val COLBUR_BERRY = berryItem("colbur", CobblemonBlocks.COLBUR_BERRY)
@JvmField val BABIRI_BERRY = berryItem("babiri", CobblemonBlocks.BABIRI_BERRY)
@JvmField val CHILAN_BERRY = berryItem("chilan", CobblemonBlocks.CHILAN_BERRY)
@JvmField val ROSELI_BERRY = berryItem("roseli", CobblemonBlocks.ROSELI_BERRY)
@JvmField val LEPPA_BERRY = berryItem("leppa", PPRestoringBerryItem(CobblemonBlocks.LEPPA_BERRY) { CobblemonMechanics.berries.ppRestoreAmount })
@JvmField val LUM_BERRY = berryItem("lum", StatusCuringBerryItem(CobblemonBlocks.LUM_BERRY))
@JvmField val FIGY_BERRY = berryItem("figy", PortionHealingBerryItem(CobblemonBlocks.FIGY_BERRY, true) { CobblemonMechanics.berries.portionHealRatio })
@JvmField val WIKI_BERRY = berryItem("wiki", PortionHealingBerryItem(CobblemonBlocks.WIKI_BERRY, true) { CobblemonMechanics.berries.portionHealRatio })
@JvmField val MAGO_BERRY = berryItem("mago", PortionHealingBerryItem(CobblemonBlocks.MAGO_BERRY, true) { CobblemonMechanics.berries.portionHealRatio })
@JvmField val AGUAV_BERRY = berryItem("aguav", PortionHealingBerryItem(CobblemonBlocks.AGUAV_BERRY, true) { CobblemonMechanics.berries.portionHealRatio })
@JvmField val IAPAPA_BERRY = berryItem("iapapa", PortionHealingBerryItem(CobblemonBlocks.IAPAPA_BERRY, true) { CobblemonMechanics.berries.portionHealRatio })
@JvmField val SITRUS_BERRY = berryItem("sitrus", HealingBerryItem(CobblemonBlocks.SITRUS_BERRY) { CobblemonMechanics.berries.sitrusHealAmount })
@JvmField val TOUGA_BERRY = berryItem("touga", CobblemonBlocks.TOUGA_BERRY)
@JvmField val CORNN_BERRY = berryItem("cornn", CobblemonBlocks.CORNN_BERRY)
@JvmField val MAGOST_BERRY = berryItem("magost", CobblemonBlocks.MAGOST_BERRY)
@JvmField val RABUTA_BERRY = berryItem("rabuta", CobblemonBlocks.RABUTA_BERRY)
@JvmField val NOMEL_BERRY = berryItem("nomel", CobblemonBlocks.NOMEL_BERRY)
@JvmField val ENIGMA_BERRY = berryItem("enigma", CobblemonBlocks.ENIGMA_BERRY)
@JvmField val POMEG_BERRY = berryItem("pomeg", FriendshipRaisingBerryItem(CobblemonBlocks.POMEG_BERRY, Stats.HP))
@JvmField val KELPSY_BERRY = berryItem("kelpsy", FriendshipRaisingBerryItem(CobblemonBlocks.KELPSY_BERRY, Stats.ATTACK))
@JvmField val QUALOT_BERRY = berryItem("qualot", FriendshipRaisingBerryItem(CobblemonBlocks.QUALOT_BERRY, Stats.DEFENCE))
@JvmField val HONDEW_BERRY = berryItem("hondew", FriendshipRaisingBerryItem(CobblemonBlocks.HONDEW_BERRY, Stats.SPECIAL_ATTACK))
@JvmField val GREPA_BERRY = berryItem("grepa", FriendshipRaisingBerryItem(CobblemonBlocks.GREPA_BERRY, Stats.SPECIAL_DEFENCE))
@JvmField val TAMATO_BERRY = berryItem("tamato", FriendshipRaisingBerryItem(CobblemonBlocks.TAMATO_BERRY, Stats.SPEED))
@JvmField val SPELON_BERRY = berryItem("spelon", CobblemonBlocks.SPELON_BERRY)
@JvmField val PAMTRE_BERRY = berryItem("pamtre", CobblemonBlocks.PAMTRE_BERRY)
@JvmField val WATMEL_BERRY = berryItem("watmel", CobblemonBlocks.WATMEL_BERRY)
@JvmField val DURIN_BERRY = berryItem("durin", CobblemonBlocks.DURIN_BERRY)
@JvmField val BELUE_BERRY = berryItem("belue", CobblemonBlocks.BELUE_BERRY)
@JvmField val KEE_BERRY = berryItem("kee", CobblemonBlocks.KEE_BERRY)
@JvmField val MARANGA_BERRY = berryItem("maranga", CobblemonBlocks.MARANGA_BERRY)
@JvmField val HOPO_BERRY = berryItem("hopo", PPRestoringBerryItem(CobblemonBlocks.HOPO_BERRY) { CobblemonMechanics.berries.ppRestoreAmount })
@JvmField val LIECHI_BERRY = berryItem("liechi", CobblemonBlocks.LIECHI_BERRY)
@JvmField val GANLON_BERRY = berryItem("ganlon", CobblemonBlocks.GANLON_BERRY)
@JvmField val SALAC_BERRY = berryItem("salac", CobblemonBlocks.SALAC_BERRY)
@JvmField val PETAYA_BERRY = berryItem("petaya", CobblemonBlocks.PETAYA_BERRY)
@JvmField val APICOT_BERRY = berryItem("apicot", CobblemonBlocks.APICOT_BERRY)
@JvmField val LANSAT_BERRY = berryItem("lansat", CobblemonBlocks.LANSAT_BERRY)
@JvmField val STARF_BERRY = berryItem("starf", CobblemonBlocks.STARF_BERRY)
@JvmField val MICLE_BERRY = berryItem("micle", CobblemonBlocks.MICLE_BERRY)
@JvmField val CUSTAP_BERRY = berryItem("custap", CobblemonBlocks.CUSTAP_BERRY)
@JvmField val JABOCA_BERRY = berryItem("jaboca", CobblemonBlocks.JABOCA_BERRY)
@JvmField val ROWAP_BERRY = berryItem("rowap", CobblemonBlocks.ROWAP_BERRY)
@JvmField val BERRY_JUICE = this.create("berry_juice", BerryJuiceItem())
// Medicine
@JvmField
@@ -253,16 +338,20 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<It
@JvmField
val ROASTED_LEEK = create("roasted_leek", Item(Item.Settings().food(FoodComponent.Builder().snack().hunger(3).saturationModifier(0.3f).build())))
@JvmField
val BRAISED_VIVICHOKE = create("braised_vivichoke", Item(Item.Settings().maxCount(1).food(FoodComponent.Builder().hunger(6).saturationModifier(0.6f).build())))
val BRAISED_VIVICHOKE = create("braised_vivichoke", Item(Item.Settings().food(FoodComponent.Builder().hunger(6).saturationModifier(0.6f).build())))
@JvmField
val VIVICHOKE_DIP = create("vivichoke_dip", StewItem(Item.Settings().maxCount(1)
val VIVICHOKE_DIP = create("vivichoke_dip", object : StewItem(Settings().maxCount(1)
.food(FoodComponent.Builder()
.hunger(10)
.saturationModifier(1.2F)
.statusEffect(StatusEffectInstance(StatusEffects.ABSORPTION, 600, 0), 1F)
.build()
)
))
.statusEffect(StatusEffectInstance(StatusEffects.ABSORPTION, 900, 0), 1F)
.alwaysEdible()
.build())) {
override fun finishUsing(stack: ItemStack?, world: World?, user: LivingEntity?): ItemStack {
user?.clearStatusEffects()
return super.finishUsing(stack, world, user)
}
})
@JvmField
val ENERGY_ROOT = create("energy_root", EnergyRootItem(CobblemonBlocks.ENERGY_ROOT, Item.Settings().food(FoodComponent.Builder().hunger(1).snack().saturationModifier(0.2f).build())))
@JvmField
@@ -544,6 +633,18 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<It
val DESTINY_KNOT = heldItem("destiny_knot")
@JvmField
val EVERSTONE = heldItem("everstone")
@JvmField
val POWER_ANKLET = heldItem("power_anklet")
@JvmField
val POWER_BAND = heldItem("power_band")
@JvmField
val POWER_BELT = heldItem("power_belt")
@JvmField
val POWER_BRACER = heldItem("power_bracer")
@JvmField
val POWER_LENS = heldItem("power_lens")
@JvmField
val POWER_WEIGHT = heldItem("power_weight")
// Mulch
@JvmField
@@ -573,6 +674,8 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<It
private fun noSettingsItem(name: String): CobblemonItem = this.create(name, CobblemonItem(Item.Settings()))
fun berries() = this.berries.toMap()
private fun mulchItem(name: String, mulchVariant: MulchVariant): MulchItem = this.create(name, MulchItem(mulchVariant))
private fun pokeBallItem(pokeBall: PokeBall): PokeBallItem {
@@ -593,4 +696,17 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<It
}
)
}
private fun berryItem(name: String, berryBlock: BerryBlock): BerryItem {
val finalName = "${name}_berry"
val item = this.create(finalName, BerryItem(berryBlock))
this.berries[cobblemonResource(finalName)] = item
return item
}
private fun berryItem(name: String, berryItem: BerryItem): BerryItem {
val finalName = "${name}_berry"
val item = this.create(finalName, berryItem)
this.berries[cobblemonResource(finalName)] = item
return item
}
}
@@ -11,6 +11,8 @@ package com.cobblemon.mod.common
import com.bedrockk.molang.Expression
import com.cobblemon.mod.common.api.data.DataRegistry
import com.cobblemon.mod.common.api.reactive.SimpleObservable
import com.cobblemon.mod.common.mechanics.BerriesMechanic
import com.cobblemon.mod.common.mechanics.PotionsMechanic
import com.cobblemon.mod.common.mechanics.RemediesMechanic
import com.cobblemon.mod.common.util.adapters.ExpressionAdapter
import com.cobblemon.mod.common.util.cobblemonResource
@@ -30,11 +32,19 @@ object CobblemonMechanics : DataRegistry {
.create()
var remedies = RemediesMechanic()
var berries = BerriesMechanic()
var potions = PotionsMechanic()
override fun sync(player: ServerPlayerEntity) {}
override fun reload(manager: ResourceManager) {
manager.getResourceOrThrow(cobblemonResource("mechanics/remedies.json")).inputStream.use {
remedies = gson.fromJson(it.reader(), RemediesMechanic::class.java)
remedies = loadMechanic(manager, "remedies", RemediesMechanic::class.java)
berries = loadMechanic(manager, "berries", BerriesMechanic::class.java)
potions = loadMechanic(manager, "potions", PotionsMechanic::class.java)
}
private fun <T> loadMechanic(manager: ResourceManager, name: String, clazz: Class<T>): T {
manager.getResourceOrThrow(cobblemonResource("mechanics/$name.json")).inputStream.use {
return gson.fromJson(it.reader(), clazz)
}
}
}
@@ -13,14 +13,14 @@ import com.cobblemon.mod.common.api.net.NetworkPacket
import com.cobblemon.mod.common.api.net.ServerNetworkPacketHandler
import com.cobblemon.mod.common.client.net.SetClientPlayerDataHandler
import com.cobblemon.mod.common.client.net.battle.*
import com.cobblemon.mod.common.client.net.callback.move.OpenMoveCallbackHandler
import com.cobblemon.mod.common.client.net.callback.party.OpenPartyCallbackHandler
import com.cobblemon.mod.common.client.net.callback.partymove.OpenPartyMoveCallbackHandler
import com.cobblemon.mod.common.client.net.data.DataRegistrySyncPacketHandler
import com.cobblemon.mod.common.client.net.data.UnlockReloadPacketHandler
import com.cobblemon.mod.common.client.net.effect.SpawnSnowstormParticleHandler
import com.cobblemon.mod.common.client.net.gui.InteractPokemonUIPacketHandler
import com.cobblemon.mod.common.client.net.gui.SummaryUIPacketHandler
import com.cobblemon.mod.common.client.net.callback.move.OpenMoveCallbackHandler
import com.cobblemon.mod.common.client.net.callback.party.OpenPartyCallbackHandler
import com.cobblemon.mod.common.client.net.callback.partymove.OpenPartyMoveCallbackHandler
import com.cobblemon.mod.common.client.net.pasture.ClosePastureHandler
import com.cobblemon.mod.common.client.net.pasture.OpenPastureHandler
import com.cobblemon.mod.common.client.net.pasture.PokemonPasturedHandler
@@ -56,6 +56,7 @@ import com.cobblemon.mod.common.net.messages.client.callback.OpenMoveCallbackPac
import com.cobblemon.mod.common.net.messages.client.callback.OpenPartyCallbackPacket
import com.cobblemon.mod.common.net.messages.client.callback.OpenPartyMoveCallbackPacket
import com.cobblemon.mod.common.net.messages.client.data.AbilityRegistrySyncPacket
import com.cobblemon.mod.common.net.messages.client.data.BerryRegistrySyncPacket
import com.cobblemon.mod.common.net.messages.client.data.MovesRegistrySyncPacket
import com.cobblemon.mod.common.net.messages.client.data.PropertiesCompletionRegistrySyncPacket
import com.cobblemon.mod.common.net.messages.client.data.SpeciesRegistrySyncPacket
@@ -210,6 +211,7 @@ object CobblemonNetwork : NetworkManager {
this.createClientBound(HeldItemUpdatePacket.ID, HeldItemUpdatePacket::decode, PokemonUpdatePacketHandler())
this.createClientBound(PokemonStateUpdatePacket.ID, PokemonStateUpdatePacket::decode, PokemonUpdatePacketHandler())
this.createClientBound(TetheringUpdatePacket.ID, TetheringUpdatePacket::decode, PokemonUpdatePacketHandler())
this.createClientBound(TradeableUpdatePacket.ID, TradeableUpdatePacket::decode, PokemonUpdatePacketHandler())
// Evolution start
this.createClientBound(AddEvolutionPacket.ID, AddEvolutionPacket::decode, PokemonUpdatePacketHandler())
@@ -273,6 +275,7 @@ object CobblemonNetwork : NetworkManager {
this.createClientBound(SpeciesRegistrySyncPacket.ID, SpeciesRegistrySyncPacket::decode, DataRegistrySyncPacketHandler())
this.createClientBound(PropertiesCompletionRegistrySyncPacket.ID, PropertiesCompletionRegistrySyncPacket::decode, DataRegistrySyncPacketHandler())
this.createClientBound(UnlockReloadPacket.ID, UnlockReloadPacket::decode, UnlockReloadPacketHandler)
this.createClientBound(BerryRegistrySyncPacket.ID, BerryRegistrySyncPacket::decode, DataRegistrySyncPacketHandler())
// Effects
this.createClientBound(SpawnSnowstormParticlePacket.ID, SpawnSnowstormParticlePacket::decode, SpawnSnowstormParticleHandler)
@@ -78,6 +78,16 @@ object CobblemonSounds : PlatformRegistry<Registry<SoundEvent>, RegistryKey<Regi
@JvmField
val MEDICINE_SPRAY_USE = this.create("medicine_spray.use")
@JvmField
val BERRY_HARVEST = this.create("berry.harvest")
@JvmField
val BERRY_EAT = this.create("berry.eat")
@JvmField
val MULCH_PLACE = this.create("mulch.place")
@JvmField
val MULCH_REMOVE = this.create("mulch.remove")
private fun create(name: String): SoundEvent = this.create(name, SoundEvent.of(cobblemonResource(name)))
}
@@ -32,7 +32,7 @@ object CobblemonTradeOffers {
* @return The resulting list.
*/
fun tradeOffersFor(profession: VillagerProfession): List<VillagerTradeOffer> = when (profession) {
VillagerProfession.FARMER -> listOf(VillagerTradeOffer(VillagerProfession.FARMER, 3, listOf(TradeOffers.SellItemFactory(CobblemonItems.VIVICHOKE_SEEDS, 32, 1, 1, 6))))
VillagerProfession.FARMER -> listOf(VillagerTradeOffer(VillagerProfession.FARMER, 3, listOf(TradeOffers.SellItemFactory(CobblemonItems.VIVICHOKE_SEEDS, 24, 1, 1, 6))))
else -> emptyList()
}
@@ -42,7 +42,7 @@ object CobblemonTradeOffers {
* @return The resulting list.
*/
fun resolveWanderingTradeOffers(): List<WandererTradeOffer> = listOf(
WandererTradeOffer(false, listOf(TradeOffers.SellItemFactory(CobblemonItems.VIVICHOKE_SEEDS, 32, 1, 1, 6)))
WandererTradeOffer(false, listOf(TradeOffers.SellItemFactory(CobblemonItems.VIVICHOKE_SEEDS, 24, 1, 1, 6)))
)
/**
@@ -47,13 +47,13 @@ object CobblemonCriteria {
val EVOLVE_POKEMON = this.create(
SimpleCriterionTrigger(
cobblemonResource("pokemon_evolved"),
SimpleCountableCriterionCondition::class.java
EvolvePokemonCriterionCondition::class.java
)
)
val WIN_BATTLE = this.create(
SimpleCriterionTrigger(
BattleCountableCriterionTrigger(
cobblemonResource("battles_won"),
SimpleCountableCriterionCondition::class.java
BattleCountableCriterionCondition::class.java
)
)
@@ -71,6 +71,41 @@ object CobblemonCriteria {
)
)
val POKEMON_INTERACT = this.create(
SimpleCriterionTrigger(
cobblemonResource("pokemon_interact"),
PokemonInteractCriterion::class.java
)
)
val PARTY_CHECK = this.create(
SimpleCriterionTrigger(
cobblemonResource("party"),
PartyCheckCriterion::class.java
)
)
val LEVEL_UP = this.create(
SimpleCriterionTrigger(
cobblemonResource("level_up"),
LevelUpCriterionCondition::class.java
)
)
val PASTURE_USE = this.create(
SimpleCriterionTrigger(
cobblemonResource("pasture_use"),
PickStarterCriterionCondition::class.java
)
)
val TRADE_POKEMON = this.create(
SimpleCriterionTrigger(
cobblemonResource("trade_pokemon"),
TradePokemonCriterionCondition::class.java
)
)
private fun <T : Criterion<*>> create(criteria: T): T = Cobblemon.implementation.registerCriteria(criteria)
}
@@ -0,0 +1,67 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.advancement.criterion
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.api.battles.model.PokemonBattle
import com.cobblemon.mod.common.util.toJsonArray
import com.google.gson.JsonObject
import net.minecraft.predicate.entity.LootContextPredicate
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.Identifier
open class BattleCountableCriterionTrigger(identifier: Identifier, criterionClass: Class<BattleCountableCriterionCondition>) : SimpleCriterionTrigger<BattleCountableContext, BattleCountableCriterionCondition>(identifier, criterionClass) {
}
class BattleCountableCriterionCondition(id: Identifier, predicate: LootContextPredicate) : CountableCriterionCondition<BattleCountableContext>(id, predicate) {
private var battleTypes = mutableListOf("any")
override fun fromJson(json: JsonObject) {
super.fromJson(json)
if(!json.get("battle_types").isJsonNull) {
battleTypes.clear()
json.get("battle_types").asJsonArray.asList().forEach() {
battleTypes.add(it.asString)
}
}
}
override fun toJson(json: JsonObject) {
super.toJson(json)
json.add("battle_types", battleTypes.toJsonArray())
}
override fun matches(player: ServerPlayerEntity, context: BattleCountableContext): Boolean {
var typeCheck = false
val advancementData = Cobblemon.playerData.get(player).advancementData
if (battleTypes.isEmpty() || battleTypes.contains("any")) {
typeCheck = true
}
if (battleTypes.contains("pvp")) {
typeCheck = context.battle.isPvP
context.times = advancementData.totalPvPBattleVictoryCount
}
if (battleTypes.contains("pvw")) {
typeCheck = context.battle.isPvW
context.times = advancementData.totalPvWBattleVictoryCount
}
if (battleTypes.contains("pvn")) {
typeCheck = context.battle.isPvN
context.times = advancementData.totalPvWBattleVictoryCount
}
if (battleTypes.size > 1) {
context.times = advancementData.totalBattleVictoryCount
}
return context.times >= count && typeCheck
}
}
open class BattleCountableContext(times : Int, var battle : PokemonBattle) : CountableContext(times)
@@ -34,6 +34,6 @@ class CaughtPokemonCriterionCondition(id: Identifier, predicate: LootContextPred
}
override fun matches(player: ServerPlayerEntity, context: CountablePokemonTypeContext): Boolean {
return super.matches(player, context) && context.type == type
return super.matches(player, context) && (context.type == type || type == "any")
}
}
@@ -0,0 +1,38 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.advancement.criterion
import com.cobblemon.mod.common.util.asIdentifierDefaultingNamespace
import com.google.gson.JsonObject
import net.minecraft.predicate.entity.LootContextPredicate
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.Identifier
class EvolvePokemonCriterionCondition(id: Identifier, entity: LootContextPredicate) : CountableCriterionCondition<EvolvePokemonContext>(id, entity) {
var species = "any"
var evolution = "any"
override fun toJson(json: JsonObject) {
super.toJson(json)
json.addProperty("species", species)
json.addProperty("evolution", evolution)
}
override fun fromJson(json: JsonObject) {
super.fromJson(json)
species = json.get("species")?.asString ?: "any"
evolution = json.get("evolution")?.asString ?: "any"
}
override fun matches(player: ServerPlayerEntity, context: EvolvePokemonContext): Boolean {
return context.times >= count && (context.species == species.asIdentifierDefaultingNamespace() || species == "any") &&
(context.evolution == evolution.asIdentifierDefaultingNamespace() || evolution == "any")
}
}
open class EvolvePokemonContext(val species : Identifier, val evolution : Identifier, times: Int) : CountableContext(times)
@@ -0,0 +1,41 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.advancement.criterion
import com.cobblemon.mod.common.pokemon.Pokemon
import com.google.gson.JsonObject
import net.minecraft.predicate.entity.LootContextPredicate
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.Identifier
class LevelUpCriterionCondition(id: Identifier, entity: LootContextPredicate) : SimpleCriterionCondition<LevelUpContext>(id, entity) {
var level = 0
var evolved = true
override fun toJson(json: JsonObject) {
json.addProperty("level", level)
json.addProperty("has_evolved", evolved)
}
override fun fromJson(json: JsonObject) {
level = json.get("level")?.asInt ?: 0
evolved = json.get("has_evolved")?.asBoolean ?: true
}
override fun matches(player: ServerPlayerEntity, context: LevelUpContext): Boolean {
val preEvo = context.pokemon.preEvolution == null
val hasEvolution = !context.pokemon.evolutions.none()
var evolutionCheck = true
if (preEvo || hasEvolution) {
evolutionCheck = !(preEvo == hasEvolution)
}
return level == context.level && evolutionCheck == evolved
}
}
open class LevelUpContext(var level : Int, var pokemon : Pokemon)
@@ -0,0 +1,54 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.advancement.criterion
import com.cobblemon.mod.common.api.storage.party.PlayerPartyStore
import com.cobblemon.mod.common.util.asIdentifierDefaultingNamespace
import com.cobblemon.mod.common.util.party
import com.google.gson.JsonArray
import com.google.gson.JsonObject
import net.minecraft.predicate.entity.LootContextPredicate
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.Identifier
class PartyCheckCriterion(id: Identifier, entity: LootContextPredicate) : SimpleCriterionCondition<PartyCheckContext>(id, entity){
val party = mutableListOf<Identifier>()
override fun toJson(json: JsonObject) {
json.add("party", JsonArray(party.size).also {
party.forEach { pokemon -> it.add(pokemon.toString()) }
})
}
override fun fromJson(json: JsonObject) {
party.clear()
json.getAsJsonArray("party").forEach { element ->
party.add(element.asString.asIdentifierDefaultingNamespace())
}
}
override fun matches(player: ServerPlayerEntity, context: PartyCheckContext): Boolean {
val playerParty = player.party()
val matches = mutableListOf<Identifier>()
party.forEach {
if (it == "any".asIdentifierDefaultingNamespace()) {
matches.add(it)
}
}
val partyCount = playerParty.count()
if (matches.containsAll(party) && party.size == partyCount && matches.size == partyCount) return true
playerParty.iterator().forEach {
if (party.contains(it.species.resourceIdentifier)) {
matches.add(it.species.resourceIdentifier)
}
}
return matches.containsAll(party) && matches.size == partyCount
}
}
open class PartyCheckContext(val party : PlayerPartyStore)
@@ -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.advancement.criterion
import com.cobblemon.mod.common.util.asIdentifierDefaultingNamespace
import com.google.gson.JsonObject
import net.minecraft.predicate.entity.LootContextPredicate
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.Identifier
open class PokemonInteractContext(var type: Identifier, var item : Identifier)
class PokemonInteractCriterion(id: Identifier, entity: LootContextPredicate) : SimpleCriterionCondition<PokemonInteractContext>(id, entity) {
var type = "any"
var item = "any"
override fun toJson(json: JsonObject) {
json.addProperty("type", type)
json.addProperty("item", item)
}
override fun fromJson(json: JsonObject) {
type = json.get("type")?.asString ?: "any"
item = json.get("item")?.asString ?: "any"
}
override fun matches(player: ServerPlayerEntity, context: PokemonInteractContext): Boolean {
return (context.type == type.asIdentifierDefaultingNamespace() || type == "any") && (context.item == item.asIdentifierDefaultingNamespace() || item == "any")
}
}
@@ -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.advancement.criterion
import com.cobblemon.mod.common.pokemon.Pokemon
import com.cobblemon.mod.common.util.asIdentifierDefaultingNamespace
import com.google.gson.JsonObject
import net.minecraft.predicate.entity.LootContextPredicate
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.Identifier
class TradePokemonCriterionCondition(id: Identifier, entity: LootContextPredicate) : SimpleCriterionCondition<TradePokemonContext>(id, entity) {
var traded = "any"
var received = "any"
var tradedHeldItem = "any"
var receivedHeldItem = "any"
override fun toJson(json: JsonObject) {
json.addProperty("traded", traded)
json.addProperty("received", received)
json.addProperty("traded_held_item", tradedHeldItem)
json.addProperty("received_held_item", receivedHeldItem)
}
override fun fromJson(json: JsonObject) {
traded = json.get("traded")?.asString ?: "any"
received = json.get("received")?.asString ?: "any"
tradedHeldItem = json.get("traded_held_item")?.asString ?: "minecraft:air"
receivedHeldItem = json.get("received_held_item")?.asString ?: "minecraft:air"
}
override fun matches(player: ServerPlayerEntity, context: TradePokemonContext): Boolean {
val heldItem1 = context.traded.heldItem().item.registryEntry.registryKey().value
val heldItem2 = context.received.heldItem().item.registryEntry.registryKey().value
return (context.traded.species.resourceIdentifier == traded.asIdentifierDefaultingNamespace() || traded == "any") &&
(context.received.species.resourceIdentifier == received.asIdentifierDefaultingNamespace() || received == "any") &&
(heldItem1 == tradedHeldItem.asIdentifierDefaultingNamespace() || heldItem1 == "minecraft:air".asIdentifierDefaultingNamespace()) &&
(heldItem2 == receivedHeldItem.asIdentifierDefaultingNamespace() || heldItem2 == "minecraft:air".asIdentifierDefaultingNamespace())
}
}
open class TradePokemonContext(val traded: Pokemon, val received: Pokemon)
@@ -35,7 +35,7 @@ interface SleepDepth {
override fun shouldWake(pokemonEntity: PokemonEntity): Boolean {
val nearbyPlayers = pokemonEntity.world.getPlayers(TargetPredicate.createNonAttackable(), pokemonEntity, Box.of(pokemonEntity.pos, 16.0, 16.0, 16.0))
return nearbyPlayers.none { !it.isSneaking }
return nearbyPlayers.any { !it.isSneaking }
}
}
@@ -10,6 +10,8 @@ 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.api.moves.MoveTemplate
import com.cobblemon.mod.common.api.moves.Moves
import com.cobblemon.mod.common.battles.ActiveBattlePokemon
import com.cobblemon.mod.common.battles.pokemon.BattlePokemon
import java.util.UUID
@@ -194,6 +196,11 @@ class BattleMessage(rawMessage: String) {
return Effect.parse(data)
}
fun moveAt(index: Int): MoveTemplate? {
val argument = argumentAt(index)?.lowercase()?.replace("[^a-z0-9]".toRegex(), "") ?: return null
return Moves.getByName(argument)
}
/**
* Queries an optional argument with given [argumentName] for a 'pnx' that will be parsed into a [BattleActor] and [ActiveBattlePokemon].
*
@@ -34,22 +34,20 @@ import com.cobblemon.mod.common.battles.dispatch.GO
import com.cobblemon.mod.common.battles.dispatch.WaitDispatch
import com.cobblemon.mod.common.battles.interpreter.ContextManager
import com.cobblemon.mod.common.battles.pokemon.BattlePokemon
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.battles.runner.ShowdownService
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.net.messages.client.battle.BattleEndPacket
import com.cobblemon.mod.common.net.messages.client.battle.BattleMessagePacket
import com.cobblemon.mod.common.net.messages.client.battle.BattleMusicPacket
import com.cobblemon.mod.common.pokemon.evolution.progress.DefeatEvolutionProgress
import com.cobblemon.mod.common.pokemon.evolution.requirements.DefeatRequirement
import com.cobblemon.mod.common.util.battleLang
import com.cobblemon.mod.common.util.getPlayer
import net.minecraft.entity.Entity
import java.io.File
import java.util.UUID
import java.util.concurrent.ConcurrentLinkedQueue
import net.minecraft.text.Text
import java.io.File
import kotlin.io.path.Path
import kotlin.io.path.writeLines
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.text.Text
/**
* Individual battle instance
@@ -62,7 +60,7 @@ open class PokemonBattle(
val side1: BattleSide,
val side2: BattleSide
) {
/** Whether or not logging will be silenced for this battle. */
/** Whether logging will be silenced for this battle. */
var mute = true
init {
@@ -211,11 +209,16 @@ open class PokemonBattle(
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))
if (facedFainted) {
pokemon.evolutions.forEach { evolution ->
evolution.requirements.filterIsInstance<DefeatRequirement>().forEach { defeatRequirement ->
if (defeatRequirement.target.matches(faintedPokemon.effectedPokemon)) {
val progress = pokemon.evolutionProxy.current().progressFirstOrCreate({ it is DefeatEvolutionProgress && it.currentProgress().target == defeatRequirement.target }) { DefeatEvolutionProgress() }
progress.updateProgress(DefeatEvolutionProgress.Progress(defeatRequirement.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
@@ -0,0 +1,106 @@
/*
* 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.berry
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.api.berry.spawncondition.BerrySpawnCondition
import com.cobblemon.mod.common.api.data.JsonDataRegistry
import com.cobblemon.mod.common.api.mulch.MulchVariant
import com.cobblemon.mod.common.api.pokemon.stats.Stat
import com.cobblemon.mod.common.api.pokemon.status.Status
import com.cobblemon.mod.common.api.reactive.SimpleObservable
import com.cobblemon.mod.common.net.messages.client.data.BerryRegistrySyncPacket
import com.cobblemon.mod.common.pokemon.adapters.CobblemonStatTypeAdapter
import com.cobblemon.mod.common.util.adapters.*
import com.cobblemon.mod.common.util.cobblemonResource
import com.google.gson.GsonBuilder
import com.google.gson.reflect.TypeToken
import java.awt.Color
import net.minecraft.predicate.NumberRange
import net.minecraft.registry.RegistryKeys
import net.minecraft.registry.tag.TagKey
import net.minecraft.resource.ResourceType
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.Identifier
import net.minecraft.util.math.Box
import net.minecraft.util.math.Vec3d
import net.minecraft.world.biome.Biome
/**
* The data registry for [Berry].
*
* @author Licious
* @since November 28th, 2022
*/
object Berries : JsonDataRegistry<Berry> {
override val id: Identifier = cobblemonResource("berries")
override val type: ResourceType = ResourceType.SERVER_DATA
override val observable = SimpleObservable<Berries>()
override val gson = GsonBuilder()
.disableHtmlEscaping()
.setPrettyPrinting()
.registerTypeAdapter(MulchVariant::class.java, MulchVariantAdapter)
.registerTypeAdapter(NumberRange.FloatRange::class.java, FloatNumberRangeAdapter)
.registerTypeAdapter(Status::class.java, StatusAdapter)
.registerTypeAdapter(TypeToken.getParameterized(Collection::class.java, Box::class.java).type, BoxCollectionAdapter)
.registerTypeAdapter(Box::class.java, BoxAdapter)
.registerTypeAdapter(Vec3d::class.java, VerboseVec3dAdapter)
.registerTypeAdapter(Identifier::class.java, IdentifierAdapter)
.registerTypeAdapter(GrowthFactor::class.java, CobblemonGrowthFactorAdapter)
.registerTypeAdapter(IntRange::class.java, VerboseIntRangeAdapter)
.registerTypeAdapter(Color::class.java, LiteralHexColorAdapter)
.registerTypeAdapter(Stat::class.java, CobblemonStatTypeAdapter)
.registerTypeAdapter(TypeToken.getParameterized(TagKey::class.java, Biome::class.java).type, TagKeyAdapter(RegistryKeys.BIOME))
.registerTypeAdapter(BerrySpawnCondition::class.java, CobblemonBerrySpawnConditionAdapter)
.create()
override val typeToken: TypeToken<Berry> = TypeToken.get(Berry::class.java)
override val resourcePath = "berries"
private val berries = hashMapOf<Identifier, Berry>()
override fun reload(data: Map<Identifier, Berry>) {
this.berries.clear()
data.forEach { (identifier, berry) ->
try {
berry.identifier = identifier
berry.validate()
this.berries[identifier] = berry
} catch (e: Exception) {
Cobblemon.LOGGER.error("Skipped loading the {} berry", identifier, e)
}
}
Cobblemon.LOGGER.info("Loaded {} berries", this.berries.size)
this.observable.emit(this)
}
override fun sync(player: ServerPlayerEntity) {
BerryRegistrySyncPacket(this.all()).sendToPlayer(player)
}
fun all() = this.berries.values.toList()
/**
* Gets a berry if loaded.
*
* @param identifier The identifier of the berry.
* @return The [Berry] if loaded otherwise null.
*/
fun getByIdentifier(identifier: Identifier): Berry? = this.berries[identifier]
/**
* Gets a berry if loaded.
*
* @param name The path of the identifier of the berry under the [Cobblemon.MODID] namespace.
* @return The [Berry] if loaded otherwise null.
*/
fun getByName(name: String): Berry? = this.getByIdentifier(cobblemonResource(name))
}
@@ -0,0 +1,347 @@
/*
* 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.berry
import com.cobblemon.mod.common.CobblemonBlocks
import com.cobblemon.mod.common.CobblemonItems
import com.cobblemon.mod.common.api.berry.spawncondition.BerrySpawnCondition
import com.cobblemon.mod.common.api.events.CobblemonEvents
import com.cobblemon.mod.common.api.events.berry.BerryYieldCalculationEvent
import com.cobblemon.mod.common.api.mulch.MulchVariant
import com.cobblemon.mod.common.block.BerryBlock
import com.cobblemon.mod.common.block.entity.BerryBlockEntity
import com.cobblemon.mod.common.item.BerryItem
import com.cobblemon.mod.common.pokemon.Nature
import com.cobblemon.mod.common.util.readBox
import com.cobblemon.mod.common.util.writeBox
import com.google.gson.annotations.SerializedName
import java.awt.Color
import java.util.EnumSet
import kotlin.math.min
import net.minecraft.block.Block
import net.minecraft.block.BlockState
import net.minecraft.client.model.ModelPart
import net.minecraft.entity.LivingEntity
import net.minecraft.network.PacketByteBuf
import net.minecraft.registry.tag.TagKey
import net.minecraft.util.Identifier
import net.minecraft.util.math.BlockPos
import net.minecraft.util.math.Box
import net.minecraft.util.math.Vec3d
import net.minecraft.util.shape.VoxelShape
import net.minecraft.util.shape.VoxelShapes
import net.minecraft.world.World
import net.minecraft.world.biome.Biome
/**
* Represents the data behind a berry.
*
* @property identifier The [Identifier] of this berry.
* @property baseYield The [IntRange] possible for the berry tree before [bonusYield] is calculated.
* @property preferredBiomeTags The [TagKey]s of the berries preffered biomes. Determines spawning and yield
* @property growthTime The [IntRange] possible in minutes for how long the berry tree takes to grow.
* @property refreshRate The [IntRange] possible in minutes for how long the berry tree takes to regrow its berries once it has been harvested.
* @depreciated @property lifeCycles The [IntRange] possible for the berry to live for between harvests.
* @property favoriteMulches The types of mulches that benefit this berries yield
* @property growthFactors An array of [GrowthFactor]s that will affect this berry. The client is not aware of these.
* @property mutations A map of the partner berry as the key and the value as the resulting mutation with this berry.
* @property growthPoints A collection of [GrowthPoint]s for the berry flowers and fruit.
* @property sproutShapeBoxes A collection of [Box]es that make up the tree [VoxelShape] during the sprouting stages.
* @property matureShapeBoxes A collection of [Box]es that make up the tree [VoxelShape] during the mature stages.
* @property flavors The [Flavor] values.
* @property tintIndexes Determines tints at specific indexes if any.
* @property flowerModelIdentifier The [Identifier] for the model of the berry in flower form.
* @property flowerTexture The [Identifier] for the texture of the berry in flower form. This is resolved into a [ModelPart] on the client.
* @property fruitModelIdentifier The [Identifier] for the model of the berry in flower form. This is resolved into a [ModelPart] on the client.
* @property fruitTexture The [Identifier] for the texture of the berry in flower form.
*
* @throws IllegalArgumentException if the any yield range argument is not a positive range.
*/
class Berry(
identifier: Identifier,
val baseYield: IntRange,
val preferredBiomeTags: List<TagKey<Biome>>,
val growthTime: IntRange,
val refreshRate: IntRange,
//val lifeCycles: IntRange,
val favoriteMulches: EnumSet<MulchVariant>,
val growthFactors: Collection<GrowthFactor>,
val spawnConditions: List<BerrySpawnCondition>,
var growthPoints: Array<GrowthPoint>,
val randomizedGrowthPoints: Boolean = true,
val mutations: Map<Identifier, Identifier>,
@SerializedName("sproutShape")
private val sproutShapeBoxes: Collection<Box>,
@SerializedName("matureShape")
private val matureShapeBoxes: Collection<Box>,
private val flavors: Map<Flavor, Int>,
val tintIndexes: Map<Int, Color>,
@SerializedName("flowerModel")
val flowerModelIdentifier: Identifier,
val flowerTexture: Identifier,
@SerializedName("fruitModel")
val fruitModelIdentifier: Identifier,
val fruitTexture: Identifier,
val weight: Float
) {
@Transient
var identifier: Identifier = identifier
internal set
@Transient
private lateinit var shapedFlower: HashMap<Int, VoxelShape>
@Transient
private lateinit var shapedFruit: HashMap<Int, VoxelShape>
/**
* The [VoxelShape] of the tree during the sprouting stages.
*/
@Transient
lateinit var sproutShape: VoxelShape
private set
/**
* The [VoxelShape] of the tree during the mature stages.
*/
@Transient
lateinit var matureShape: VoxelShape
private set
init {
this.validate()
}
/**
* Finds the [BerryItem] that uses this berry for data.
*
* @return The [BerryItem] if existing.
*/
fun item(): BerryItem? = CobblemonItems.berries()[this.identifier]
/**
* Finds the [BerryBlock] that uses this berry for data.
*
* @return The [BerryBlock] if existing.
*/
fun block(): BerryBlock? = CobblemonBlocks.berries()[this.identifier]
/**
* Query the value of a certain flavor.
*
* @param flavor The [Flavor] being queried.
* @return The value if any or 0.
*/
fun flavor(flavor: Flavor): Int = this.flavors[flavor] ?: 0
fun dislikedBy(nature: Nature): Boolean {
val dislikedFlavor = nature.dislikedFlavor ?: return false
return flavor(dislikedFlavor) > 0
}
/**
* Calculates the yield for a berry tree being planted or replanted after a life cycle.
* Triggers [BerryYieldCalculationEvent].
*
* @param world The [World] the tree is present in.
* @param state The [BlockState] of the tree.
* @param pos The [BlockPos] of the tree.
* @param placer The [LivingEntity] tending to the tree, if any.
* @return The total berry stack count.
*/
fun calculateYield(world: World, state: BlockState, pos: BlockPos, placer: LivingEntity? = null): Int {
val base = this.baseYield.random()
val bonus = this.bonusYield(world, state, pos)
var yield = base + bonus.first
val treeEntity = world.getBlockEntity(pos) as BerryBlockEntity
if (BerryBlock.getMulch(state) == MulchVariant.RICH) {
yield = min(yield + 1, maxYield())
treeEntity.decrementMulchDuration(world, pos, state)
}
val event = BerryYieldCalculationEvent(this, world, state, pos, placer, yield, bonus.second)
CobblemonEvents.BERRY_YIELD.post(event) { yield = it.yield }
return yield
}
/**
* Calculates and returns the minimum possible yield by summing [baseYield] and [growthFactors] minimum values.
*
* @return The minimum possible yield.
*/
fun minYield() = this.baseYield.first + this.growthFactors.sumOf { it.minYield() }
/**
* Calculates and returns the maximum possible yield by summing [baseYield] and [growthFactors] max values.
*
* @return The maximum possible yield.
*/
fun maxYield() = this.baseYield.last + this.growthFactors.sumOf { it.maxYield() }
/**
* Checks if this berry can mutate with the given [partner].
* For the berry the mutations may produce use [mutationWith].
*
* @param partner The [Berry] being checked as a possible mutation partner.
* @return If a mutation is possible.
*/
fun canMutateWith(partner: Berry) = this.mutationWith(partner) != null
/**
* Query for the possible mutation with the given [partner].
*
* @param partner The [Berry] being mutated with.
* @return The resulting [Berry] if the mutation is possible.
*/
fun mutationWith(partner: Berry): Berry? {
val berryIdentifier = this.mutations[partner.identifier] ?: return null
return Berries.getByIdentifier(berryIdentifier)
}
/**
* Query for a possible partner to mutate into the given [resulting].
*
* @param resulting The [Berry] the mutation should result in.
* @return The [Berry] that mutates with this berry into the given [resulting] if possible.
*/
fun partnerForMutation(resulting: Berry): Berry? {
return this.mutations.firstNotNullOfOrNull { (partner, result) ->
if (result == resulting.identifier)
Berries.getByIdentifier(partner)
else
null
}
}
// A cheat since gson doesn't invoke init block
internal fun validate() {
if (this.baseYield.first < 0 || this.baseYield.last < 0) {
throw IllegalArgumentException("A berry base yield must be a positive range")
}
if (this.growthTime.first < 0 || this.growthTime.last < 0) {
throw IllegalArgumentException("The growth time must be a positive range")
}
if (this.refreshRate.first < 0 || this.refreshRate.last < 0) {
throw IllegalArgumentException("The refresh rate must be a positive range")
}
/*
if (this.lifeCycles.first < 0 || this.lifeCycles.last < 0) {
throw IllegalArgumentException("A berry life cycle must be a positive range")
}
*/
this.growthFactors.forEach { it.validateArguments() }
val maxYield = this.maxYield()
if (this.growthPoints.size < maxYield) {
throw IllegalArgumentException("Anchor points must have enough elements for the max possible yield of $maxYield you've provided ${this.growthPoints.size} points")
}
this.shapedFlower = hashMapOf()
this.shapedFruit = hashMapOf()
this.sproutShape = this.createAndUniteShapes(this.sproutShapeBoxes)
this.matureShape = this.createAndUniteShapes(this.matureShapeBoxes)
}
internal fun encode(buffer: PacketByteBuf) {
buffer.writeIdentifier(this.identifier)
buffer.writeInt(this.baseYield.first)
buffer.writeInt(this.baseYield.last)
buffer.writeEnumSet(favoriteMulches, MulchVariant::class.java)
//buffer.writeInt(this.lifeCycles.first)
//buffer.writeInt(this.lifeCycles.last)
buffer.writeInt(this.growthTime.first)
buffer.writeInt(this.growthTime.last)
buffer.writeInt(this.refreshRate.first)
buffer.writeInt(this.refreshRate.last)
buffer.writeCollection(this.growthPoints.toList()) { writer, value ->
writer.writeDouble(value.position.x)
writer.writeDouble(value.position.y)
writer.writeDouble(value.position.z)
writer.writeDouble(value.rotation.x)
writer.writeDouble(value.rotation.y)
writer.writeDouble(value.rotation.z)
}
buffer.writeBoolean(this.randomizedGrowthPoints)
buffer.writeMap(this.mutations, { writer, key -> writer.writeIdentifier(key) }, { writer, value -> writer.writeIdentifier(value) })
buffer.writeCollection(this.sproutShapeBoxes) { writer, value ->
writer.writeBox(value)
}
buffer.writeCollection(this.matureShapeBoxes) { writer, value ->
writer.writeBox(value)
}
buffer.writeMap(this.flavors, { writer, key -> writer.writeEnumConstant(key) }, { writer, value -> writer.writeInt(value) })
buffer.writeMap(this.tintIndexes, { writer, key -> writer.writeInt(key) }, { writer, value -> writer.writeInt(value.rgb) })
buffer.writeIdentifier(this.flowerModelIdentifier)
buffer.writeIdentifier(this.flowerTexture)
buffer.writeIdentifier(this.fruitModelIdentifier)
buffer.writeIdentifier(this.fruitTexture)
}
/**
* Calculates the bonus yield for the berry tree.
*
* @param world The [World] the tree is present in.
* @param state The [BlockState] of the tree.
* @param pos The [BlockPos] of the tree.
* @return The bonus yield, the growth factors that passed.
*/
private fun bonusYield(world: World, state: BlockState, pos: BlockPos): Pair<Int, Collection<GrowthFactor>> {
var bonus = 0
val passed = arrayListOf<GrowthFactor>()
val mulchVariant = BerryBlock.getMulch(state)
val hasBiomeMulch = mulchVariant in favoriteMulches
this.growthFactors.forEach { factor ->
if (factor.isValid(world, state, pos)) {
bonus += factor.yield()
passed += factor
} else if (hasBiomeMulch) {
bonus += factor.yield()
}
}
return bonus to passed
}
private fun createAndUniteShapes(boxes: Collection<Box>): VoxelShape {
var shape: VoxelShape? = null
boxes.forEach { box ->
shape = if (shape == null) {
Block.createCuboidShape(box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ)
} else {
VoxelShapes.union(shape, Block.createCuboidShape(box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ))
}
}
return shape ?: VoxelShapes.fullCube()
}
companion object {
internal fun decode(buffer: PacketByteBuf): Berry {
val identifier = buffer.readIdentifier()
val baseYield = IntRange(buffer.readInt(), buffer.readInt())
val favMulchs = buffer.readEnumSet(MulchVariant::class.java)
//val lifeCycles = IntRange(buffer.readInt(), buffer.readInt())
val growthTime = IntRange(buffer.readInt(), buffer.readInt())
val refreshRate = IntRange(buffer.readInt(), buffer.readInt())
val growthPoints = buffer.readList { reader ->
GrowthPoint(Vec3d(reader.readDouble(), reader.readDouble(), reader.readDouble()), Vec3d(reader.readDouble(), reader.readDouble(), reader.readDouble()))
}.toTypedArray()
val randomizedGrowthPoints = buffer.readBoolean()
val mutations = buffer.readMap({ reader -> reader.readIdentifier() }, { reader -> reader.readIdentifier() })
val sproutShapeBoxes = buffer.readList { it.readBox() }
val matureShapeBoxes = buffer.readList { it.readBox() }
val flavors = buffer.readMap({ reader -> reader.readEnumConstant(Flavor::class.java) }, { reader -> reader.readInt() })
val tintIndexes = buffer.readMap({ reader -> reader.readInt() }, { reader -> Color(reader.readInt()) })
val flowerModelIdentifier = buffer.readIdentifier()
val flowerTexture = buffer.readIdentifier()
val fruitModelIdentifier = buffer.readIdentifier()
val fruitTexture = buffer.readIdentifier()
return Berry(identifier, baseYield, emptyList(), growthTime, refreshRate, favMulchs, emptySet(), emptyList(), growthPoints, randomizedGrowthPoints, mutations, sproutShapeBoxes, matureShapeBoxes, flavors, tintIndexes, flowerModelIdentifier, flowerTexture, fruitModelIdentifier, fruitTexture, 0F)
}
}
}
@@ -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.berry
import com.cobblemon.mod.common.CobblemonBlocks
import com.cobblemon.mod.common.block.BerryBlock
import com.cobblemon.mod.common.world.feature.BerryGroveFeature
import com.google.common.cache.CacheBuilder
import com.google.common.cache.CacheLoader
import com.google.common.cache.LoadingCache
import net.minecraft.registry.entry.RegistryEntry
import net.minecraft.world.biome.Biome
object BerryHelper {
private val CACHE_LOADER = object : CacheLoader<RegistryEntry<Biome>, List<BerryBlock>>() {
override fun load(key: RegistryEntry<Biome>): List<BerryBlock> {
return naturalBerries.filter { berryBlock ->
val berry = berryBlock.berry()
berry?.spawnConditions?.any { it.canSpawn(berry, key) } ?: false
}
}
}
private val naturalBerries = CobblemonBlocks.berries().values.filter {
(it.berry()?.spawnConditions?.size ?: 0) > 0
}
private val validBerryCache: LoadingCache<RegistryEntry<Biome>, List<BerryBlock>> = CacheBuilder.newBuilder()
.maximumSize(4)
.build(CACHE_LOADER)
fun getBerriesForBiome(biome: RegistryEntry<Biome>): List<BerryBlock> {
return validBerryCache.get(biome)
}
fun getNaturallyGeneratingBerries(): List<BerryBlock> {
return naturalBerries
}
}
@@ -0,0 +1,26 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.berry
/**
* Represents the different flavors associated with berries and other Pokémon consumables.
* See the [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Flavor) article for more information.
*
* @author Licious
* @since November 28th, 2022
*/
enum class Flavor {
SPICY,
DRY,
SWEET,
BITTER,
SOUR
}
@@ -0,0 +1,61 @@
/*
* 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.berry
import net.minecraft.block.BlockState
import net.minecraft.util.math.BlockPos
import net.minecraft.world.WorldView
/**
* Represents a condition that impacts extra berry yield.
*
* @author Licious
* @since December 2nd, 2022
*/
interface GrowthFactor {
/**
* Validates the arguments contained in this factor, this is invoked during loading.
*
* @throws IllegalArgumentException If an argument isn't valid.
*/
fun validateArguments()
/**
* Checks if this factor should yield a bonus.
*
* @param world The [WorldView] the berry tree is in.
* @param state The [BlockState] of the berry tree.
* @param pos The [BlockPos] of the berry tree.
* @return If the bonus should activate.
*/
fun isValid(world: WorldView, state: BlockState, pos: BlockPos): Boolean
/**
* Resolves the amount of bonus berries to grow if [isValid] was true.
*
* @return The amount of extra berries to grow.
*/
fun yield(): Int
/**
* Returns the minimum possible yield for this factor.
*
* @return The minimum possible yield for this factor.
*/
fun minYield(): Int
/**
* Returns the maximum possible yield for this factor.
*
* @return The maximum possible yield for this factor.
*/
fun maxYield(): Int
}
@@ -0,0 +1,25 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.berry
import net.minecraft.util.math.Vec3d
/**
* Represents a position in a berry tree where a berry will flower then fruit.
*
* @property position The coordinates of the berry in the tree block.
* @property rotation The degree value for the rotation each axis.
*
* @author Licious
* @since December 19th, 2022
*/
data class GrowthPoint(
val position: Vec3d,
val rotation: Vec3d
)
@@ -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.api.berry.adapter
import com.cobblemon.mod.common.api.berry.GrowthFactor
import com.cobblemon.mod.common.util.adapters.CobblemonGrowthFactorAdapter
import com.google.gson.JsonDeserializer
import com.google.gson.JsonSerializer
import net.minecraft.util.Identifier
import kotlin.reflect.KClass
/**
* A type adapter for [GrowthFactor]s.
* For the default implementation see [CobblemonGrowthFactorAdapter].
*
* @author Licious
* @since December 2nd, 2022
*/
interface GrowthFactorAdapter : JsonDeserializer<GrowthFactor>, JsonSerializer<GrowthFactor> {
/**
* Register a [GrowthFactor] to be used by this adapter.
*
* @param type The [KClass] of the [GrowthFactor].
* @param identifier The expected [Identifier] in the parsed JSON.
*/
fun register(type: KClass<out GrowthFactor>, identifier: Identifier)
}
@@ -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.berry.adapter
import com.cobblemon.mod.common.api.berry.GrowthFactor
import com.cobblemon.mod.common.api.berry.spawncondition.BerrySpawnCondition
import com.cobblemon.mod.common.util.adapters.CobblemonBerrySpawnConditionAdapter
import com.google.gson.JsonDeserializer
import com.google.gson.JsonSerializer
import net.minecraft.util.Identifier
import kotlin.reflect.KClass
/**
* A type adapter for [GrowthFactor]s.
* For the default implementation see [CobblemonBerrySpawnConditionAdapter].
*
* @author Apion
* @since August 14, 2023
*/
interface SpawnConditionAdapter : JsonDeserializer<BerrySpawnCondition>, JsonSerializer<BerrySpawnCondition> {
/**
* Register a [BerrySpawnCondition] to be used by this adapter.
*
* @param type The [KClass] of the [BerrySpawnCondition].
* @param identifier The expected [Identifier] in the parsed JSON.
*/
fun register(type: KClass<out BerrySpawnCondition>, identifier: Identifier)
}
@@ -0,0 +1,30 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.berry.spawncondition
import com.cobblemon.mod.common.api.berry.Berry
import com.cobblemon.mod.common.util.cobblemonResource
import net.minecraft.registry.entry.RegistryEntry
import net.minecraft.util.math.random.Random
import net.minecraft.world.biome.Biome
class AllBiomeCondition(val minGroveSize: Int, val maxGroveSize: Int) : BerrySpawnCondition{
override fun canSpawn(berry: Berry, biome: RegistryEntry<Biome>): Boolean {
return true
}
override fun getGroveSize(random: Random): Int {
return random.nextBetween(minGroveSize, maxGroveSize)
}
companion object {
val ID = cobblemonResource("all_biome")
}
}
@@ -0,0 +1,20 @@
/*
* 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.berry.spawncondition
import com.cobblemon.mod.common.api.berry.Berry
import net.minecraft.registry.entry.RegistryEntry
import net.minecraft.util.math.random.Random
import net.minecraft.world.biome.Biome
interface BerrySpawnCondition {
fun getGroveSize(random: Random): Int
fun canSpawn(berry: Berry, biome: RegistryEntry<Biome>): Boolean
}
@@ -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.berry.spawncondition
import com.cobblemon.mod.common.api.berry.Berry
import com.cobblemon.mod.common.util.cobblemonResource
import net.minecraft.registry.entry.RegistryEntry
import net.minecraft.util.math.random.Random
import net.minecraft.world.biome.Biome
import kotlin.math.min
class PreferredBiomeCondition(val minGroveSize: Int, val maxGroveSize: Int) : BerrySpawnCondition{
override fun getGroveSize(random: Random): Int {
return random.nextBetween(minGroveSize, maxGroveSize)
}
override fun canSpawn(berry: Berry, biome: RegistryEntry<Biome>): Boolean {
val preferredBiomeTags = berry.preferredBiomeTags
return preferredBiomeTags.any {biome.isIn(it)}
}
companion object {
val ID = cobblemonResource("preferred_biome")
}
}
@@ -13,8 +13,10 @@ import com.cobblemon.mod.common.CobblemonNetwork.sendPacket
import com.cobblemon.mod.common.api.moves.Move
import com.cobblemon.mod.common.net.messages.client.callback.OpenPartyMoveCallbackPacket
import com.cobblemon.mod.common.pokemon.Pokemon
import com.cobblemon.mod.common.util.lang
import java.util.UUID
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.text.MutableText
/**
* Used for opening a party select screen for players which routes to move selection when they choose a Pokémon.
@@ -30,6 +32,7 @@ object PartyMoveSelectCallbacks {
@JvmOverloads
fun create(
player: ServerPlayerEntity,
partyTitle: MutableText = lang("ui.party"),
pokemon: List<Pair<PartySelectPokemonDTO, List<MoveSelectDTO>>>,
cancel: (ServerPlayerEntity) -> Unit = {},
handler: (ServerPlayerEntity, pokemonIndex: Int, PartySelectPokemonDTO, moveIndex: Int, MoveSelectDTO) -> Unit
@@ -40,12 +43,13 @@ object PartyMoveSelectCallbacks {
handler = handler
)
callbacks[player.uuid] = callback
player.sendPacket(OpenPartyMoveCallbackPacket(callback.uuid, callback.pokemon))
player.sendPacket(OpenPartyMoveCallbackPacket(callback.uuid, partyTitle, callback.pokemon))
}
@JvmOverloads
fun createFromPokemon(
player: ServerPlayerEntity,
partyTitle: MutableText = lang("ui.party"),
pokemon: List<Pokemon>,
moves: (Pokemon) -> List<Move> = { it.moveSet.getMoves() },
canSelectPokemon: (Pokemon) -> Boolean = { true },
@@ -62,6 +66,7 @@ object PartyMoveSelectCallbacks {
create(
player = player,
partyTitle = partyTitle,
pokemon = pokemonList,
cancel = cancel,
handler = { _, pkIndex, _, moveIndex, _ ->
@@ -12,10 +12,10 @@ import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.CobblemonNetwork.sendPacket
import com.cobblemon.mod.common.api.pokemon.PokemonProperties
import com.cobblemon.mod.common.api.pokemon.PokemonPropertyExtractor
import com.cobblemon.mod.common.api.text.text
import com.cobblemon.mod.common.battles.pokemon.BattlePokemon
import com.cobblemon.mod.common.net.messages.client.callback.OpenPartyCallbackPacket
import com.cobblemon.mod.common.pokemon.Pokemon
import com.cobblemon.mod.common.util.lang
import java.util.UUID
import net.minecraft.item.ItemStack
import net.minecraft.nbt.NbtCompound
@@ -36,7 +36,7 @@ object PartySelectCallbacks {
@JvmOverloads
fun create(
player: ServerPlayerEntity,
title: Text = "".text(),
title: Text = lang("ui.party"),
pokemon: List<PartySelectPokemonDTO>,
cancel: (ServerPlayerEntity) -> Unit = {},
handler: (ServerPlayerEntity, index: Int) -> Unit
@@ -61,12 +61,14 @@ object PartySelectCallbacks {
@JvmOverloads
fun createBattleSelect(
player: ServerPlayerEntity,
title: Text = lang("ui.party"),
pokemon: List<BattlePokemon>,
canSelect: (BattlePokemon) -> Boolean,
cancel: (ServerPlayerEntity) -> Unit = {},
handler: (BattlePokemon) -> Unit
) = create(
player = player,
title = title,
cancel = cancel,
pokemon = pokemon.map { pk -> PartySelectPokemonDTO(pk.effectedPokemon).also { it.enabled = canSelect(pk) } }
) { _, index -> handler(pokemon[index]) }
@@ -74,12 +76,14 @@ object PartySelectCallbacks {
@JvmOverloads
fun createFromPokemon(
player: ServerPlayerEntity,
title: Text = lang("ui.party"),
pokemon: List<Pokemon>,
canSelect: (Pokemon) -> Boolean,
cancel: (ServerPlayerEntity) -> Unit = {},
handler: (Pokemon) -> Unit
) = create(
player = player,
title = title,
cancel = cancel,
pokemon = pokemon.map { pk -> PartySelectPokemonDTO(pk).also { it.enabled = canSelect(pk) } }
) { _, index -> handler(pokemon[index]) }
@@ -117,36 +121,43 @@ class PartySelectCallback(
open class PartySelectPokemonDTO(
val pokemonProperties: PokemonProperties,
val aspects: Set<String>,
val heldItem: ItemStack = ItemStack.EMPTY,
var hpRatio: Float = 1F,
var currentHealth: Int,
var maxHealth: Int,
var enabled: Boolean
) {
@JvmOverloads
constructor(pokemon: Pokemon, enabled: Boolean = true): this(
pokemonProperties = pokemon.createPokemonProperties(
PokemonPropertyExtractor.ASPECTS,
PokemonPropertyExtractor.SPECIES,
PokemonPropertyExtractor.LEVEL,
PokemonPropertyExtractor.NICKNAME,
PokemonPropertyExtractor.POKEBALL,
PokemonPropertyExtractor.STATUS
PokemonPropertyExtractor.STATUS,
),
aspects = pokemon.aspects,
heldItem = pokemon.heldItemNoCopy(),
hpRatio = pokemon.currentHealth / pokemon.hp.toFloat(),
currentHealth = pokemon.currentHealth,
maxHealth = pokemon.hp,
enabled = enabled
)
constructor(buffer: PacketByteBuf): this(
pokemonProperties = PokemonProperties().loadFromNBT(buffer.readNbt() as NbtCompound),
aspects = buffer.readList { it.readString() }.toSet(),
heldItem = buffer.readItemStack(),
hpRatio = buffer.readFloat(),
currentHealth = buffer.readInt(),
maxHealth = buffer.readInt(),
enabled = buffer.readBoolean()
)
fun writeToBuffer(buffer: PacketByteBuf) {
buffer.writeNbt(pokemonProperties.saveToNBT())
buffer.writeCollection(aspects) { _, aspect -> buffer.writeString(aspect) }
buffer.writeItemStack(heldItem)
buffer.writeFloat(hpRatio)
buffer.writeInt(currentHealth)
buffer.writeInt(maxHealth)
buffer.writeBoolean(enabled)
}
}
@@ -8,11 +8,9 @@
package com.cobblemon.mod.common.api.data
import com.cobblemon.mod.common.util.endsWith
import com.cobblemon.mod.common.Cobblemon
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import java.io.File
import java.util.concurrent.ExecutionException
import net.minecraft.resource.ResourceManager
import net.minecraft.util.Identifier
@@ -44,20 +42,7 @@ interface JsonDataRegistry<T> : DataRegistry {
val resourcePath: String
override fun reload(manager: ResourceManager) {
val data = hashMapOf<Identifier, T>()
manager.findResources(this.resourcePath) { path -> path.endsWith(JSON_EXTENSION) }.forEach { (identifier, resource) ->
resource.inputStream.use { stream ->
stream.bufferedReader().use { reader ->
val resolvedIdentifier = Identifier(identifier.namespace, File(identifier.path).nameWithoutExtension)
try {
data[resolvedIdentifier] = this.gson.fromJson(reader, this.typeToken.type)
} catch (exception: Exception) {
throw ExecutionException("Error loading JSON for data: $identifier", exception)
}
}
}
}
this.reload(data)
this.reload(Cobblemon.implementation.reloadJsonRegistry(this, manager))
}
/**
@@ -68,6 +53,6 @@ interface JsonDataRegistry<T> : DataRegistry {
fun reload(data: Map<Identifier, T>)
companion object {
private const val JSON_EXTENSION = ".json"
const val JSON_EXTENSION = ".json"
}
}
@@ -10,11 +10,11 @@ package com.cobblemon.mod.common.api.drop
import com.cobblemon.mod.common.api.events.CobblemonEvents.LOOT_DROPPED
import com.cobblemon.mod.common.api.events.drops.LootDroppedEvent
import kotlin.random.Random
import net.minecraft.entity.LivingEntity
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.server.world.ServerWorld
import net.minecraft.util.math.Vec3d
import kotlin.random.Random
/**
* A table of drops that can produce a list of [DropEntry]. You can produce a drop list from [getDrops] to
@@ -13,6 +13,10 @@ import com.cobblemon.mod.common.api.events.battles.BattleFledEvent
import com.cobblemon.mod.common.api.events.battles.BattleStartedPostEvent
import com.cobblemon.mod.common.api.events.battles.BattleStartedPreEvent
import com.cobblemon.mod.common.api.events.battles.BattleVictoryEvent
import com.cobblemon.mod.common.api.events.berry.BerryHarvestEvent
import com.cobblemon.mod.common.api.events.berry.BerryMutationOfferEvent
import com.cobblemon.mod.common.api.events.berry.BerryMutationResultEvent
import com.cobblemon.mod.common.api.events.berry.BerryYieldCalculationEvent
import com.cobblemon.mod.common.api.events.drops.LootDroppedEvent
import com.cobblemon.mod.common.api.events.entity.PokemonEntityLoadEvent
import com.cobblemon.mod.common.api.events.entity.PokemonEntitySaveEvent
@@ -20,6 +24,8 @@ import com.cobblemon.mod.common.api.events.entity.PokemonEntitySaveToWorldEvent
import com.cobblemon.mod.common.api.events.entity.SpawnEvent
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.pokeball.PokeBallCaptureCalculatedEvent
import com.cobblemon.mod.common.api.events.pokeball.PokemonCatchRateEvent
import com.cobblemon.mod.common.api.events.pokeball.ThrownPokeballHitEvent
import com.cobblemon.mod.common.api.events.pokemon.*
import com.cobblemon.mod.common.api.events.pokemon.evolution.EvolutionAcceptedEvent
@@ -59,6 +65,10 @@ object CobblemonEvents {
@JvmField
val THROWN_POKEBALL_HIT = CancelableObservable<ThrownPokeballHitEvent>()
@JvmField
val POKEMON_CATCH_RATE = EventObservable<PokemonCatchRateEvent>()
@JvmField
val POKE_BALL_CAPTURE_CALCULATED = EventObservable<PokeBallCaptureCalculatedEvent>()
@JvmField
val POKEMON_CAPTURED = EventObservable<PokemonCapturedEvent>()
// @JvmField
// val EGG_HATCH = EventObservable<HatchEggEvent>()
@@ -80,6 +90,9 @@ object CobblemonEvents {
@JvmField
val POKEMON_RECALLED = EventObservable<PokemonRecalledEvent>()
@JvmField
val TRADE_COMPLETED = EventObservable<TradeCompletedEvent>()
@JvmField
val LEVEL_UP_EVENT = EventObservable<LevelUpEvent>()
@@ -120,6 +133,15 @@ object CobblemonEvents {
@JvmField
val APRICORN_HARVESTED = EventObservable<ApricornHarvestEvent>()
// Berries
@JvmField
val BERRY_HARVEST = EventObservable<BerryHarvestEvent>()
@JvmField
val BERRY_MUTATION_OFFER = EventObservable<BerryMutationOfferEvent>()
@JvmField
val BERRY_MUTATION_RESULT = EventObservable<BerryMutationResultEvent>()
@JvmField
val BERRY_YIELD = EventObservable<BerryYieldCalculationEvent>()
@JvmField
val LEFTOVERS_CREATED = CancelableObservable<LeftoversCreatedEvent>()
@JvmField
@@ -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.berry
import com.cobblemon.mod.common.api.berry.Berry
/**
* The base of all Berry related events.
*
* @author Licious
* @since November 28th, 2022
*/
interface BerryEvent {
/**
* The [Berry] related to the event trigger
*/
val berry: Berry
}
@@ -0,0 +1,41 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.events.berry
import com.cobblemon.mod.common.api.berry.Berry
import com.cobblemon.mod.common.block.entity.BerryBlockEntity
import net.minecraft.block.BlockState
import net.minecraft.item.ItemStack
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.math.BlockPos
import net.minecraft.world.World
/**
* An event fired when [BerryBlockEntity.harvest] is invoked.
*
* @property berry The [Berry] the tree is attached to.
* @property player The [ServerPlayerEntity] harvesting the tree.
* @property world The [World] the tree is in.
* @property pos The [BlockPos] of the tree.
* @property state The [BlockState] of the tree.
* @property blockEntity The backing [BerryBlockEntity]-
* @property drops A collection of [ItemStack]s produced by this harvest.
*
* @author Licious
* @since November 28th, 2022
*/
data class BerryHarvestEvent(
override val berry: Berry,
val player: ServerPlayerEntity,
val world: World,
val pos: BlockPos,
val state: BlockState,
val blockEntity: BerryBlockEntity,
val drops: MutableList<ItemStack>
) : BerryEvent
@@ -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.api.events.berry
import com.cobblemon.mod.common.api.berry.Berry
import com.cobblemon.mod.common.block.BerryBlock
import net.minecraft.block.BlockState
import net.minecraft.util.math.BlockPos
import net.minecraft.world.World
/**
* The event fired when [BerryBlock.grow] is invoked and the tree passes to [BerryBlock.MATURE_AGE].
* This allows you to modify the possible mutations for the tree, for the event that decides which of these mutations is used see [BerryMutationResultEvent].
*
* @property world The [World] the berry tree is in.
* @property state The [BlockState] of the berry tree.
* @property pos The [BlockPos] of the berry tree.
* @property mutations The possible [Berry] mutations.
*
* @author Licious
* @since January 19th, 2022
*/
data class BerryMutationOfferEvent(
override val berry: Berry,
val world: World,
val state: BlockState,
val pos: BlockPos,
val mutations: MutableSet<Berry>
) : BerryEvent
@@ -0,0 +1,37 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.events.berry
import com.cobblemon.mod.common.api.berry.Berry
import com.cobblemon.mod.common.block.BerryBlock
import net.minecraft.block.BlockState
import net.minecraft.util.math.BlockPos
import net.minecraft.world.World
/**
* The event fired when [BerryBlock.grow] is invoked and the tree passes to [BerryBlock.MATURE_AGE].
* This allows you to modify the possible mutations for the tree, for the event that decides which of these mutations is used see [BerryMutationResultEvent].
*
* @property world The [World] the berry tree is in.
* @property state The [BlockState] of the berry tree.
* @property pos The [BlockPos] of the berry tree.
* @property mutations The possible [Berry] mutations.
* @property pickedMutation The [Berry] chosen to mutate into, if null the mutation will not occur.
*
* @author Licious
* @since January 19th, 2022
*/
data class BerryMutationResultEvent(
override val berry: Berry,
val world: World,
val state: BlockState,
val pos: BlockPos,
val mutations: Set<Berry>,
var pickedMutation: Berry?
) : BerryEvent
@@ -0,0 +1,58 @@
/*
* 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.berry
import com.cobblemon.mod.common.api.berry.Berry
import com.cobblemon.mod.common.api.berry.GrowthFactor
import net.minecraft.block.BlockState
import net.minecraft.entity.LivingEntity
import net.minecraft.util.math.BlockPos
import net.minecraft.world.World
/**
* The event fired when [Berry.calculateYield] is invoked.
*
* @property world The [World] the berry tree is in.
* @property state The [BlockState] of the berry tree.
* @property pos The [BlockPos] of the berry tree.
* @property placer The [LivingEntity] triggering the calculation.
* @property yield The current yield of berries.
* @property passedGrowthFactors The [Berry.growthFactors] where [GrowthFactor.isValid] was true.
*
* @author Licious
* @since November 28th, 2022
*/
class BerryYieldCalculationEvent(
override val berry: Berry,
val world: World,
val state: BlockState,
val pos: BlockPos,
val placer: LivingEntity?,
yield: Int,
val passedGrowthFactors: Collection<GrowthFactor>
) : BerryEvent {
/**
* The amount of berries this tree will yield.
*
* @throws IllegalArgumentException If a new value exceeds [Berry.maxYield] or be lesser than 0.
*/
var yield: Int = yield
set(value) {
val max = this.berry.maxYield()
if (value > max) {
throw IllegalArgumentException("Cannot set the berry yield for ${this.berry.identifier} above $max")
}
if (value < 0) {
throw IllegalArgumentException("A berry tree cannot yield a negative amount of berries")
}
field = value
}
}
@@ -8,6 +8,7 @@
package com.cobblemon.mod.common.api.events.farming
import com.cobblemon.mod.common.api.apricorn.Apricorn
import net.minecraft.block.BlockState
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.server.world.ServerWorld
@@ -18,6 +19,7 @@ import net.minecraft.util.math.BlockPos
*/
class ApricornHarvestEvent(
val player: ServerPlayerEntity,
val apricorn: Apricorn,
val world: ServerWorld,
val pos: BlockPos
) {
@@ -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.api.events.pokeball
import com.cobblemon.mod.common.api.pokeball.catching.CaptureContext
import com.cobblemon.mod.common.entity.pokeball.EmptyPokeBallEntity
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import net.minecraft.entity.LivingEntity
import net.minecraft.server.network.ServerPlayerEntity
/**
* Event fired when a Poké Ball has completed its capture calculation and is about to begin shaking
* or breaking free. The result of the capture can be changed by replacing [captureResult].
*
* @author Hiroku
* @since August 20th, 2023
*/
class PokeBallCaptureCalculatedEvent(
val thrower: LivingEntity,
val pokemonEntity: PokemonEntity,
val pokeBallEntity: EmptyPokeBallEntity,
var captureResult: CaptureContext
) {
fun ifPlayer(action: PokeBallCaptureCalculatedEvent.(player: ServerPlayerEntity) -> Unit) {
if (thrower is ServerPlayerEntity) {
action(this, thrower)
}
}
}
@@ -0,0 +1,30 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.events.pokeball
import com.cobblemon.mod.common.entity.pokeball.EmptyPokeBallEntity
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import net.minecraft.entity.LivingEntity
/**
* Event fired when a capture calculator is accessing a Pokémon's catch rate. The [catchRate] property can
* be changed to adjust the rate.
*
* If you want to prevent a Pokémon from being caught, you should be handling the [PokeBallCaptureCalculatedEvent]
* event instead.
*
* @author Hiroku
* @since August 20th, 2023
*/
class PokemonCatchRateEvent(
val thrower: LivingEntity,
val pokeBallEntity: EmptyPokeBallEntity,
val pokemonEntity: PokemonEntity,
var catchRate: Float
)
@@ -8,10 +8,12 @@
package com.cobblemon.mod.common.api.events.pokemon
import com.cobblemon.mod.common.entity.pokeball.EmptyPokeBallEntity
import com.cobblemon.mod.common.pokemon.Pokemon
import net.minecraft.server.network.ServerPlayerEntity
data class PokemonCapturedEvent (
val pokemon: Pokemon,
val player: ServerPlayerEntity
val player: ServerPlayerEntity,
val pokeBallEntity: EmptyPokeBallEntity
)
@@ -0,0 +1,14 @@
/*
* 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.pokemon
import com.cobblemon.mod.common.pokemon.Pokemon
import com.cobblemon.mod.common.trade.TradeParticipant
class TradeCompletedEvent(val tradeParticipant1 : TradeParticipant, val tradeParticipant1Pokemon : Pokemon, val tradeParticipant2 : TradeParticipant, val tradeParticipant2Pokemon : Pokemon)
@@ -12,6 +12,7 @@ import com.cobblemon.mod.common.api.text.font
import com.cobblemon.mod.common.client.gui.battle.BattleOverlay.Companion.PORTRAIT_DIAMETER
import com.cobblemon.mod.common.client.render.models.blockbench.PoseableEntityState
import com.cobblemon.mod.common.client.render.models.blockbench.repository.PokemonModelRepository
import com.cobblemon.mod.common.client.render.models.blockbench.repository.RenderContext
import com.cobblemon.mod.common.entity.PoseType
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.pokemon.Species
@@ -179,7 +180,11 @@ fun drawPortraitPokemon(
partialTicks: Float
) {
val model = PokemonModelRepository.getPoser(species.resourceIdentifier, aspects)
val texture = PokemonModelRepository.getTexture(species.resourceIdentifier, aspects, state)
val texture = PokemonModelRepository.getTexture(species.resourceIdentifier, aspects, state?.animationSeconds ?: 0F)
val context = RenderContext()
PokemonModelRepository.getTextureNoSubstitute(species.resourceIdentifier, aspects, 0f).let { it -> context.put(RenderContext.TEXTURE, it) }
context.put(RenderContext.SCALE, species.getForm(aspects).baseScale)
val renderType = model.getLayer(texture)
@@ -215,11 +220,12 @@ fun drawPortraitPokemon(
val packedLight = LightmapTextureManager.pack(11, 7)
model.withLayerContext(immediate, state, PokemonModelRepository.getLayers(species.resourceIdentifier, aspects)) {
model.render(matrixStack, buffer, packedLight, OverlayTexture.DEFAULT_UV, 1F, 1F, 1F, 1F)
model.render(context, matrixStack, buffer, packedLight, OverlayTexture.DEFAULT_UV, 1F, 1F, 1F, 1F)
immediate.draw()
}
matrixStack.pop()
model.setDefault()
DiffuseLighting.enableGuiDepthLighting()
}
@@ -0,0 +1,48 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.interaction
import net.minecraft.entity.Entity
import net.minecraft.item.ItemStack
import net.minecraft.server.network.ServerPlayerEntity
/**
* An interaction that will affect an [Entity].
* These need to be triggered.
*
* @param T The type of the [Entity] this interaction will affect.
*/
interface EntityInteraction<T : Entity> {
/**
* Fired when a [ServerPlayerEntity] interacts with the target entity.
*
* @param player The [ServerPlayerEntity] interacting with the [entity].
* @param entity The [Entity] of type [T] being interacted.
* @param stack The [ItemStack] used in this interaction.
* @return true if the interaction was successful and no further interactions should be processed
*/
fun onInteraction(player: ServerPlayerEntity, entity: T, stack: ItemStack): Boolean
/**
* Decreases the stack size by a given amount.
* The stack size should be validated beforehand.
* If the [player] is in creative mode the decrement won't be performed.
*
* @param player The [ServerPlayerEntity] that caused the interaction, this is used to check for creative mode.
* @param stack The [ItemStack] being mutated.
* @param amount The amount to deduct from the stack, default is 1.
*/
fun consumeItem(player: ServerPlayerEntity, stack: ItemStack, amount: Int = 1) {
if (!player.isCreative) {
stack.decrement(amount)
}
}
}
@@ -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.interaction
import com.google.gson.JsonDeserializer
import com.google.gson.JsonSerializer
import kotlin.reflect.KClass
import net.minecraft.util.Identifier
/**
* A type adapter for [EntityInteraction]s.
* For the default implementation with Pokémon entities see [CobblemonPokemonEntityInteractionTypeAdapter].
*
* @param T The type of [EntityInteraction].
*
* @author Licious
* @since November 30th, 2022
*/
interface EntityInteractionTypeAdapter<T : EntityInteraction<*>> : JsonDeserializer<T>, JsonSerializer<T> {
fun registerInteraction(identifier: Identifier, type: KClass<out T>)
}
@@ -6,23 +6,26 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.item.interactive
package com.cobblemon.mod.common.api.interaction
import com.cobblemon.mod.common.CobblemonSounds
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.item.interactive.PokemonInteractiveItem.Ownership
import net.minecraft.item.ItemStack
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.sound.SoundEvent
/**
* An [InteractiveItem] targeting [PokemonEntity]s.
*
* @param accepted The [Ownership] variants for this interaction to fire [PokemonInteractiveItem.processInteraction].
* An [EntityInteraction] targeting [PokemonEntity]s.
* These need to be manually triggered if not implemented by an item.
*/
interface PokemonInteractiveItem : InteractiveItem<PokemonEntity> {
interface PokemonEntityInteraction : EntityInteraction<PokemonEntity> {
/**
* The accepted [Ownership] for the Pokémon entity in order for the interaction to fire.
*/
val accepted: Set<Ownership>
fun getSound(): SoundEvent? = CobblemonSounds.ITEM_USE
val sound: SoundEvent?
get() = CobblemonSounds.ITEM_USE
override fun onInteraction(player: ServerPlayerEntity, entity: PokemonEntity, stack: ItemStack): Boolean {
val pokemon = entity.pokemon
@@ -40,30 +43,15 @@ interface PokemonInteractiveItem : InteractiveItem<PokemonEntity> {
}
/**
* Fired after [InteractiveItem.onInteraction] the [Ownership] is checked if contained in [accepted].
* Fired after [EntityInteraction.onInteraction] the [Ownership] is checked if contained in [accepted].
*
* @param player The [ServerPlayerEntity] interacting with the [entity].
* @param entity The [PokemonEntity] being interacted with.
* @param stack The [ItemStack] used in this interaction. [ItemStack.getItem] will always be of the same type as this [InteractiveItem].
* @param stack The [ItemStack] used in this interaction.
* @return true if the interaction was successful and no further interactions should be processed.
*/
fun processInteraction(player: ServerPlayerEntity, entity: PokemonEntity, stack: ItemStack): Boolean
/**
* Decreases the stack size by a given amount.
* The stack size should be validated beforehand.
* If the [player] is in creative mode the decrement won't be performed.
*
* @param player The [ServerPlayerEntity] that caused the interaction, this is used to check for creative mode.
* @param stack The [ItemStack] being mutated.
* @param amount The amount to deduct from the stack, default is 1.
*/
fun consumeItem(player: ServerPlayerEntity, stack: ItemStack, amount: Int = 1) {
if (!player.isCreative) {
stack.decrement(amount)
}
}
/**
* Represents the ownership status of a Pokemon relative to a Player.
*
@@ -98,6 +98,11 @@ interface PokemonAndMoveSelectingItem {
fun canUseOnMove(move: Move): Boolean
fun interactWithSpecific(player: ServerPlayerEntity, stack: ItemStack, pokemon: Pokemon): TypedActionResult<ItemStack>? {
if (player.isSneaking) {
return TypedActionResult.pass(stack)
}
MoveSelectCallbacks.create(
player = player,
moves = pokemon.moveSet.toList(),
@@ -146,4 +151,4 @@ interface PokemonAndMoveSelectingItem {
return TypedActionResult.success(stack)
}
}
}
@@ -8,6 +8,8 @@
package com.cobblemon.mod.common.api.item
import com.cobblemon.mod.common.advancement.CobblemonCriteria
import com.cobblemon.mod.common.advancement.criterion.PokemonInteractContext
import com.cobblemon.mod.common.api.battles.model.actor.BattleActor
import com.cobblemon.mod.common.api.callback.PartySelectCallbacks
import com.cobblemon.mod.common.api.text.red
@@ -22,6 +24,7 @@ import com.cobblemon.mod.common.util.isHeld
import com.cobblemon.mod.common.util.isLookingAt
import com.cobblemon.mod.common.util.party
import net.minecraft.item.ItemStack
import net.minecraft.registry.Registries
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.TypedActionResult
import net.minecraft.util.math.Box
@@ -59,15 +62,17 @@ interface PokemonSelectingItem {
return interactWithSpecificBattle(player, stack, battlePokemon)
}
} ?: run {
if (entity != null) {
val pokemon = entity.pokemon
if (entity.ownerUuid == player.uuid) {
return applyToPokemon(player, stack, pokemon) ?: TypedActionResult.pass(stack)
if (!player.isSneaking) {
return if (entity != null) {
val pokemon = entity.pokemon
if (entity.ownerUuid == player.uuid) {
applyToPokemon(player, stack, pokemon) ?: TypedActionResult.pass(stack)
} else {
TypedActionResult.fail(stack)
}
} else {
return TypedActionResult.fail(stack)
interactGeneral(player, stack)
}
} else {
return interactGeneral(player, stack)
}
}
@@ -89,6 +94,7 @@ interface PokemonSelectingItem {
if (!player.isCreative) {
stack.decrement(1)
}
CobblemonCriteria.POKEMON_INTERACT.trigger(player, PokemonInteractContext(battlePokemon.entity!!.pokemon.species.resourceIdentifier, Registries.ITEM.getId(stack.item)))
}
}
@@ -106,16 +112,19 @@ interface PokemonSelectingItem {
}
fun interactGeneral(player: ServerPlayerEntity, stack: ItemStack): TypedActionResult<ItemStack> {
val party = player.party().toList()
if (party.isEmpty()) {
return TypedActionResult.fail(stack)
}
PartySelectCallbacks.createFromPokemon(
player = player,
pokemon = player.party().toList(),
pokemon = party,
canSelect = ::canUseOnPokemon,
handler = { pk ->
if (stack.isHeld(player)) {
applyToPokemon(player, stack, pk)
if (!player.isCreative) {
stack.decrement(1)
}
CobblemonCriteria.POKEMON_INTERACT.trigger(player, PokemonInteractContext(pk.species.resourceIdentifier, Registries.ITEM.getId(stack.item)))
}
}
)
@@ -18,6 +18,8 @@ import net.minecraft.nbt.NbtCompound
import net.minecraft.nbt.NbtElement
import net.minecraft.nbt.NbtList
import net.minecraft.network.PacketByteBuf
import kotlin.math.min
class MoveSet : Iterable<Move> {
val observable = SimpleObservable<MoveSet>()
private var emit = true
@@ -63,6 +65,11 @@ class MoveSet : Iterable<Move> {
update()
}
fun partialHeal() {
getMoves().forEach { it.currentPp = min((it.currentPp + (it.maxPp / 2)), it.maxPp)}
update()
}
fun clear() {
doWithoutEmitting {
for (i in 0 until MOVE_COUNT){
@@ -8,38 +8,24 @@
package com.cobblemon.mod.common.api.mulch
import com.cobblemon.mod.common.CobblemonItems
import com.cobblemon.mod.common.item.MulchItem
import net.minecraft.util.StringIdentifiable
/**
* Represents the different types of Mulch implemented in the mod.
*
*/
enum class MulchVariant {
enum class MulchVariant(val duration: Int = -1) : StringIdentifiable {
COARSE,
GROWTH,
GROWTH(3),
HUMID,
LOAMY,
PEAT,
RICH,
RICH(3),
SANDY,
SURPRISE;
SURPRISE(3),
NONE;
/**
* Resolves the item version of the Mulch.
*
* @return The [MulchItem] equivalent.
*/
fun item(): MulchItem = when (this) {
COARSE -> CobblemonItems.COARSE_MULCH
GROWTH -> CobblemonItems.GROWTH_MULCH
HUMID -> CobblemonItems.HUMID_MULCH
LOAMY -> CobblemonItems.LOAMY_MULCH
PEAT -> CobblemonItems.PEAT_MULCH
RICH -> CobblemonItems.RICH_MULCH
SANDY -> CobblemonItems.SANDY_MULCH
SURPRISE -> CobblemonItems.SURPRISE_MULCH
override fun asString(): String {
return name.lowercase()
}
}
}
@@ -65,6 +65,7 @@ object CobblemonPermissions {
val TEST_PARTY_SLOT = this.create("${COMMAND_PREFIX}testpartyslot", PermissionLevel.CHEAT_COMMANDS_AND_COMMAND_BLOCKS)
val CLEAR_PARTY = this.create("${COMMAND_PREFIX}clearparty", PermissionLevel.CHEAT_COMMANDS_AND_COMMAND_BLOCKS)
val CLEAR_PC = this.create("${COMMAND_PREFIX}clearpc", PermissionLevel.CHEAT_COMMANDS_AND_COMMAND_BLOCKS)
fun all(): Iterable<Permission> = this.permissions
@@ -8,9 +8,12 @@
package com.cobblemon.mod.common.api.pokeball.catching.calculators
import com.cobblemon.mod.common.api.events.CobblemonEvents
import com.cobblemon.mod.common.api.events.pokeball.PokemonCatchRateEvent
import com.cobblemon.mod.common.api.pokeball.catching.CaptureContext
import com.cobblemon.mod.common.entity.pokeball.EmptyPokeBallEntity
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.pokeball.PokeBall
import com.cobblemon.mod.common.pokemon.Pokemon
import net.minecraft.entity.LivingEntity
/**
@@ -24,7 +27,6 @@ import net.minecraft.entity.LivingEntity
* @since November 30, 2021
*/
interface CaptureCalculator {
/**
* The literal ID of this calculator.
* Used when registering the calculator to the registry in order to be used by the game rule.
@@ -37,10 +39,22 @@ interface CaptureCalculator {
* Processes a capture attempt with the given params.
*
* @param thrower The [LivingEntity] that threw the [PokeBall].
* @param pokeBall The [PokeBall] used.
* @param target The target [Pokemon] attempting to be captured.
* @return
* @param pokeBallEntity The [EmptyPokeBallEntity] used.
* @param target The target [PokemonEntity] attempting to be captured.
* @return a [CaptureContext] that is the result of the capture attempt.
*/
fun processCapture(thrower: LivingEntity, pokeBall: PokeBall, target: Pokemon) : CaptureContext
fun processCapture(thrower: LivingEntity, pokeBallEntity: EmptyPokeBallEntity, target: PokemonEntity) : CaptureContext
fun getCatchRate(thrower: LivingEntity, pokeBallEntity: EmptyPokeBallEntity, target: PokemonEntity, catchRate: Float): Float {
val event = PokemonCatchRateEvent(
thrower = thrower,
pokemonEntity = target,
pokeBallEntity = pokeBallEntity,
catchRate = catchRate
)
CobblemonEvents.POKEMON_CATCH_RATE.post(event)
return event.catchRate
}
}
@@ -8,7 +8,7 @@
package com.cobblemon.mod.common.api.pokemon
import com.cobblemon.mod.common.api.item.Flavor
import com.cobblemon.mod.common.api.berry.Flavor
import com.cobblemon.mod.common.api.pokemon.stats.Stats
import com.cobblemon.mod.common.pokemon.Nature
import com.cobblemon.mod.common.util.cobblemonResource
@@ -166,6 +166,16 @@ object Natures {
return allNatures.find { nature -> nature.name == name }
}
/**
* Utility method to get a nature by string
* @return a nature type or null
*/
fun getNature(identifier: String): Nature? {
val nature = getNature(cobblemonResource(identifier))
if(nature != null) return nature
return getNature(Identifier(identifier))
}
/**
* Helper function for a random Nature
* @return a random nature type
@@ -15,16 +15,21 @@ import com.cobblemon.mod.common.api.pokemon.aspect.AspectProvider
import com.cobblemon.mod.common.api.pokemon.stats.Stats
import com.cobblemon.mod.common.api.pokemon.status.Statuses
import com.cobblemon.mod.common.api.properties.CustomPokemonProperty
import com.cobblemon.mod.common.api.types.ElementalTypes
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.pokemon.*
import com.cobblemon.mod.common.pokemon.EVs
import com.cobblemon.mod.common.pokemon.Gender
import com.cobblemon.mod.common.pokemon.IVs
import com.cobblemon.mod.common.pokemon.Pokemon
import com.cobblemon.mod.common.pokemon.RenderablePokemon
import com.cobblemon.mod.common.pokemon.status.PersistentStatus
import com.cobblemon.mod.common.pokemon.status.PersistentStatusContainer
import com.cobblemon.mod.common.util.DataKeys
import com.cobblemon.mod.common.util.asIdentifierDefaultingNamespace
import com.cobblemon.mod.common.util.isInt
import com.cobblemon.mod.common.util.splitMap
import com.google.gson.JsonArray
import com.google.gson.JsonObject
import kotlin.random.Random
import net.minecraft.nbt.NbtCompound
import net.minecraft.nbt.NbtElement
import net.minecraft.nbt.NbtList
@@ -86,6 +91,10 @@ open class PokemonProperties {
props.ability = parseStringOfRegistry(keyPairs, listOf("ability")) { Abilities.get(it)?.name }
props.status = parseStringOfRegistry(keyPairs, listOf("status")) { (Statuses.getStatus(it) ?: Statuses.getStatus(it.asIdentifierDefaultingNamespace()))?.showdownName }
props.nickname = parseText(keyPairs, listOf("nickname", "nick"))
props.teraType = parseStringOfRegistry(keyPairs, listOf("tera_type", "tera")) { ElementalTypes.get(it)?.name }
props.dmaxLevel = parseIntProperty(keyPairs, listOf("dmax_level", "dmax"))?.coerceIn(0, Cobblemon.config.maxDynamaxLevel)
props.gmaxFactor = parseBooleanProperty(keyPairs, listOf("gmax_factor", "gmax"))
props.tradeable = parseBooleanProperty(keyPairs, listOf("tradeable", "tradable"))
val maybeIVs = IVs()
val maybeEVs = EVs()
@@ -147,9 +156,10 @@ open class PokemonProperties {
}
private fun parseSpeciesIdentifier(keyPairs: MutableList<Pair<String, String?>>): String? {
fun cleanSpeciesName(string: String) = string.lowercase().replace("[^a-z0-9_:]".toRegex(), "")
val matched = getMatchedKeyPair(keyPairs, listOf("species"))
if (matched != null) {
val value = matched.second?.lowercase() ?: return null
val value = matched.second?.let(::cleanSpeciesName) ?: return null
return if (value.lowercase() == "random") {
"random"
} else {
@@ -168,7 +178,7 @@ open class PokemonProperties {
"random"
} else {
try {
val identifier = pair.first.asIdentifierDefaultingNamespace()
val identifier = cleanSpeciesName(pair.first).asIdentifierDefaultingNamespace()
val found = PokemonSpecies.getByIdentifier(identifier) ?: return@find false
if (found.resourceIdentifier.namespace == Cobblemon.MODID) found.resourceIdentifier.path else found.resourceIdentifier.toString()
} catch (e: InvalidIdentifierException) {
@@ -246,6 +256,10 @@ open class PokemonProperties {
var ability: String? = null
var aspects: Set<String> = emptySet()
var status: String? = null
var teraType: String? = null
var dmaxLevel: Int? = null
var gmaxFactor: Boolean? = null
var tradeable: Boolean? = null
var ivs: IVs? = null
var evs: EVs? = null
@@ -287,14 +301,19 @@ open class PokemonProperties {
customProperties.forEach { it.apply(pokemon) }
ivs?.let { ivs ->
ivs.forEach { stat ->
pokemon.ivs[stat.key] = stat.value
pokemon.setIV(stat.key, stat.value)
}
}
evs?.let { evs ->
evs.forEach { stat ->
pokemon.evs[stat.key] = stat.value
pokemon.setEV(stat.key, stat.value)
}
}
teraType?.let { ElementalTypes.get(it)?.let { type -> pokemon.teraType = type } }
dmaxLevel?.let { pokemon.dmaxLevel = it }
gmaxFactor?.let { pokemon.gmaxFactor = it }
tradeable?.let { pokemon.tradeable = it }
pokemon.updateAspects()
}
fun apply(pokemonEntity: PokemonEntity) {
@@ -322,14 +341,19 @@ open class PokemonProperties {
customProperties.forEach { it.apply(pokemonEntity) }
ivs?.let { ivs ->
ivs.forEach { stat ->
pokemonEntity.pokemon.ivs[stat.key] = stat.value
pokemonEntity.pokemon.setIV(stat.key, stat.value)
}
}
evs?.let { evs ->
evs.forEach { stat ->
pokemonEntity.pokemon.evs[stat.key] = stat.value
pokemonEntity.pokemon.setEV(stat.key, stat.value)
}
}
teraType?.let { ElementalTypes.get(it)?.let { type -> pokemonEntity.pokemon.teraType = type } }
dmaxLevel?.let { pokemonEntity.pokemon.dmaxLevel = it }
gmaxFactor?.let { pokemonEntity.pokemon.gmaxFactor = it }
tradeable?.let { pokemonEntity.pokemon.tradeable = it }
pokemonEntity.pokemon.updateAspects()
}
fun matches(pokemon: Pokemon): Boolean {
@@ -363,6 +387,10 @@ open class PokemonProperties {
evs?.forEach{ stat ->
if (stat.value != pokemon.evs[stat.key]) { return false }
}
teraType?.takeIf { it != pokemon.teraType.name }?.let { return false }
dmaxLevel?.takeIf { it != pokemon.dmaxLevel }?.let { return false }
gmaxFactor?.takeIf { it != pokemon.gmaxFactor }?.let { return false }
tradeable?.takeIf { it != pokemon.tradeable }?.let { return false }
return customProperties.none { !it.matches(pokemon) }
}
@@ -395,6 +423,10 @@ open class PokemonProperties {
evs?.forEach{ stat ->
if (stat.value != pokemonEntity.pokemon.evs[stat.key]) { return false }
}
teraType?.takeIf { it != pokemonEntity.pokemon.teraType.name }?.let { return false }
dmaxLevel?.takeIf { it != pokemonEntity.pokemon.dmaxLevel }?.let { return false }
gmaxFactor?.takeIf { it != pokemonEntity.pokemon.gmaxFactor }?.let { return false }
tradeable?.takeIf { it != pokemonEntity.pokemon.tradeable }?.let { return false }
return customProperties.none { !it.matches(pokemonEntity) }
}
@@ -435,24 +467,33 @@ open class PokemonProperties {
if (stat.value != propertiesEVs[stat.key]) { return false }
}
}
teraType?.takeIf { it != properties.teraType }?.let { return false }
dmaxLevel?.takeIf { it != properties.dmaxLevel }?.let { return false }
gmaxFactor?.takeIf { it != properties.gmaxFactor }?.let { return false }
tradeable?.takeIf { it != properties.tradeable }?.let { return false }
return true
}
fun create(): Pokemon {
val pokemon = Pokemon()
apply(pokemon)
// Force the setter to initialize it
pokemon.species = pokemon.species
// This should only be a thing once we have moveset control in properties until then a creation should require a moveset init.
/*
if (pokemon.moveSet.none { it != null }) {
pokemon.initializeMoveset()
}
*/
pokemon.initializeMoveset()
pokemon.initialize()
roll(pokemon)
return pokemon
}
// TEST YOUR LUCK!
fun roll(pokemon: Pokemon) {
val baseTypes = pokemon.species.types.toList()
if (this.shiny == null) pokemon.shiny = Cobblemon.config.shinyRate.checkRate()
if (this.teraType == null) pokemon.teraType =
if (Cobblemon.config.teraTypeRate.checkRate()) ElementalTypes.all().filter { !baseTypes.contains(it) }.random()
else baseTypes.random()
}
// If the config value is at least 1, then do 1/x and use that as the property chance
private fun Float.checkRate(): Boolean = this >= 1 && (Random.Default.nextFloat() < 1 / this)
fun createEntity(world: World): PokemonEntity {
return PokemonEntity(world, create())
}
@@ -473,6 +514,10 @@ open class PokemonProperties {
status?.let { nbt.putString(DataKeys.POKEMON_STATUS_NAME, it) }
ivs?.let { nbt.put(DataKeys.POKEMON_IVS, it.saveToNBT(NbtCompound())) }
evs?.let { nbt.put(DataKeys.POKEMON_EVS, it.saveToNBT(NbtCompound())) }
teraType?.let { nbt.putString(DataKeys.POKEMON_TERA_TYPE, it) }
dmaxLevel?.let { nbt.putInt(DataKeys.POKEMON_DMAX_LEVEL, it) }
gmaxFactor?.let { nbt.putBoolean(DataKeys.POKEMON_GMAX_FACTOR, it) }
tradeable?.let { nbt.putBoolean(DataKeys.POKEMON_TRADEABLE, it) }
val custom = NbtList()
customProperties.map { NbtString.of(it.asString()) }.forEach { custom.add(it) }
nbt.put(DataKeys.POKEMON_PROPERTIES_CUSTOM, custom)
@@ -494,6 +539,10 @@ open class PokemonProperties {
status = if (tag.contains(DataKeys.POKEMON_STATUS_NAME)) tag.getString(DataKeys.POKEMON_STATUS_NAME) else null
ivs = if (tag.contains(DataKeys.POKEMON_IVS)) ivs?.loadFromNBT(tag.getCompound(DataKeys.POKEMON_IVS)) as IVs? else null
evs = if (tag.contains(DataKeys.POKEMON_EVS)) evs?.loadFromNBT(tag.getCompound(DataKeys.POKEMON_EVS)) as EVs? else null
teraType = if (tag.contains(DataKeys.POKEMON_TERA_TYPE)) tag.getString(DataKeys.POKEMON_TERA_TYPE) else null
dmaxLevel = if (tag.contains(DataKeys.POKEMON_DMAX_LEVEL)) tag.getInt(DataKeys.POKEMON_DMAX_LEVEL) else null
gmaxFactor = if (tag.contains(DataKeys.POKEMON_GMAX_FACTOR)) tag.getBoolean(DataKeys.POKEMON_GMAX_FACTOR) else null
tradeable = if (tag.contains(DataKeys.POKEMON_TRADEABLE)) tag.getBoolean(DataKeys.POKEMON_TRADEABLE) else null
val custom = tag.getList(DataKeys.POKEMON_PROPERTIES_CUSTOM, NbtElement.STRING_TYPE.toInt())
// This is kinda gross
custom.forEach { customProperties.addAll(parse(it.asString()).customProperties) }
@@ -517,6 +566,10 @@ open class PokemonProperties {
status?.let { json.addProperty(DataKeys.POKEMON_STATUS_NAME, it) }
ivs?.let { json.add(DataKeys.POKEMON_IVS, it.saveToJSON(JsonObject())) }
evs?.let { json.add(DataKeys.POKEMON_EVS, it.saveToJSON(JsonObject())) }
teraType?.let { json.addProperty(DataKeys.POKEMON_TERA_TYPE, it) }
dmaxLevel?.let { json.addProperty(DataKeys.POKEMON_DMAX_LEVEL, it) }
gmaxFactor?.let { json.addProperty(DataKeys.POKEMON_GMAX_FACTOR, it) }
tradeable?.let { json.addProperty(DataKeys.POKEMON_TRADEABLE, it) }
val custom = JsonArray()
customProperties.map { it.asString() }.forEach { custom.add(it) }
json.add(DataKeys.POKEMON_PROPERTIES_CUSTOM, custom)
@@ -539,6 +592,10 @@ open class PokemonProperties {
status = json.get(DataKeys.POKEMON_STATUS_NAME)?.asString
ivs?.loadFromJSON(json.getAsJsonObject(DataKeys.POKEMON_IVS))
evs?.loadFromJSON(json.getAsJsonObject(DataKeys.POKEMON_EVS))
teraType = json.get(DataKeys.POKEMON_TERA_TYPE)?.asString
dmaxLevel = json.get(DataKeys.POKEMON_DMAX_LEVEL)?.asInt
gmaxFactor = json.get(DataKeys.POKEMON_GMAX_FACTOR)?.asBoolean
tradeable = json.get(DataKeys.POKEMON_TRADEABLE)?.asBoolean
val custom = json.get(DataKeys.POKEMON_PROPERTIES_CUSTOM)?.asJsonArray
// This is still kinda gross
custom?.forEach { customProperties.addAll(parse(it.asString).customProperties) }
@@ -565,6 +622,10 @@ open class PokemonProperties {
evs?.forEach{ stat ->
pieces.add("${stat.key}_ev=${stat.value}")
}
teraType?.let { pieces.add("tera_type=$it") }
dmaxLevel?.let { pieces.add("dmax_level=$it") }
gmaxFactor?.let { pieces.add("gmax_factor=$it") }
tradeable?.let { pieces.add("tradeable=$it") }
customProperties.forEach { pieces.add(it.asString()) }
return pieces.joinToString(separator)
}
@@ -34,7 +34,6 @@ import com.cobblemon.mod.common.api.reactive.SimpleObservable
import com.cobblemon.mod.common.api.spawning.TimeRange
import com.cobblemon.mod.common.api.types.ElementalType
import com.cobblemon.mod.common.api.types.adapters.ElementalTypeAdapter
import com.cobblemon.mod.common.battles.runner.ShowdownService
import com.cobblemon.mod.common.net.messages.client.data.SpeciesRegistrySyncPacket
import com.cobblemon.mod.common.pokemon.FormData
import com.cobblemon.mod.common.pokemon.Species
@@ -42,7 +41,8 @@ import com.cobblemon.mod.common.pokemon.SpeciesAdditions
import com.cobblemon.mod.common.pokemon.evolution.adapters.CobblemonEvolutionAdapter
import com.cobblemon.mod.common.pokemon.evolution.adapters.CobblemonPreEvolutionAdapter
import com.cobblemon.mod.common.pokemon.evolution.adapters.CobblemonRequirementAdapter
import com.cobblemon.mod.common.pokemon.helditem.CobblemonEmptyHeldItemManager
import com.cobblemon.mod.common.pokemon.evolution.adapters.NbtItemPredicateAdapter
import com.cobblemon.mod.common.pokemon.evolution.predicate.NbtItemPredicate
import com.cobblemon.mod.common.pokemon.helditem.CobblemonHeldItemManager
import com.cobblemon.mod.common.util.adapters.*
import com.cobblemon.mod.common.util.cobblemonResource
@@ -95,6 +95,7 @@ object PokemonSpecies : JsonDataRegistry<Species> {
.registerTypeAdapter(TypeToken.getParameterized(RegistryLikeCondition::class.java, Item::class.java).type, ItemLikeConditionAdapter)
.registerTypeAdapter(EggGroup::class.java, EggGroupAdapter)
.registerTypeAdapter(StatusEffect::class.java, RegistryElementAdapter<StatusEffect> { Registries.STATUS_EFFECT })
.registerTypeAdapter(NbtItemPredicate::class.java, NbtItemPredicateAdapter)
.disableHtmlEscaping()
.enableComplexMapKeySerialization()
.create()
@@ -238,11 +239,14 @@ object PokemonSpecies : JsonDataRegistry<Species> {
val heightm = form?.height ?: species.height
val weightkg = form?.weight ?: species.weight
// This is ugly, but we already have it hardcoded in the mod anyway
val maxHp = if (species.showdownId() == "shedinja") 1 else null
val maxHP = if (species.showdownId() == "shedinja") 1 else null
val canGigantamax: String? = if (form?.gigantamaxMove != null) form.gigantamaxMove.name else null
val cannotDynamax = form?.dynamaxBlocked ?: species.dynamaxBlocked
// ToDo battleOnly
// ToDo changesFrom
val requiredMove = form?.requiredMove
val requiredItem = form?.requiredItem
val requiredItems = form?.requiredItems
}
private fun createShowdownName(species: Species): String {
@@ -10,11 +10,14 @@ package com.cobblemon.mod.common.api.pokemon.effect.adapter
import com.cobblemon.mod.common.api.pokemon.effect.ShoulderEffect
import com.cobblemon.mod.common.api.pokemon.effect.ShoulderEffectRegistry
import com.cobblemon.mod.common.pokemon.effects.PotionBaseEffect
import com.google.gson.JsonDeserializationContext
import com.google.gson.JsonDeserializer
import com.google.gson.JsonElement
import com.google.gson.JsonObject
import java.lang.reflect.Type
import net.minecraft.registry.Registries
import net.minecraft.util.Identifier
object ShoulderEffectAdapter: JsonDeserializer<ShoulderEffect> {
override fun deserialize(json: JsonElement, typeOfT: Type, context: JsonDeserializationContext): ShoulderEffect {
@@ -23,7 +26,18 @@ object ShoulderEffectAdapter: JsonDeserializer<ShoulderEffect> {
} else {
json.asJsonObject.get("type").asString to json.asJsonObject
}
val effect = ShoulderEffectRegistry.get(typeId) ?: throw IllegalArgumentException("Cannot find shoulder effect with type '$typeId'")
val effect = ShoulderEffectRegistry.get(typeId) ?: run {
try {
val effectId = Identifier(typeId.replace("-", "_").replace("slow_fall", "slow_falling"))
val registry = Registries.STATUS_EFFECT
val effect = registry.get(effectId)
if (effect != null) {
return PotionBaseEffect(effect, 0, true, false, false)
}
} catch (_: Exception) {}
throw IllegalArgumentException("Cannot find shoulder effect with type '$typeId'")
}
return context.deserialize(obj, effect)
}
}
@@ -8,6 +8,7 @@
package com.cobblemon.mod.common.api.pokemon.stats
import com.cobblemon.mod.common.api.tags.CobblemonItemTags
import com.cobblemon.mod.common.battles.pokemon.BattlePokemon
/**
@@ -53,9 +54,24 @@ interface EvCalculator {
object Generation8EvCalculator : EvCalculator {
private val powerItems = mapOf(
Stats.SPEED to CobblemonItemTags.POWER_ANKLET,
Stats.SPECIAL_DEFENCE to CobblemonItemTags.POWER_BAND,
Stats.DEFENCE to CobblemonItemTags.POWER_BELT,
Stats.ATTACK to CobblemonItemTags.POWER_BRACER,
Stats.SPECIAL_ATTACK to CobblemonItemTags.POWER_LENS,
Stats.HP to CobblemonItemTags.POWER_WEIGHT
)
override fun calculate(battlePokemon: BattlePokemon, opponentPokemon: BattlePokemon): Map<Stat, Int> {
// ToDo Once held items and EV related items are implemented update this
return opponentPokemon.originalPokemon.form.evYield
val heldItem = battlePokemon.effectedPokemon.heldItemNoCopy()
val evYield = mutableMapOf<Stat, Int>()
for ((stat, value) in opponentPokemon.originalPokemon.form.evYield) {
val boost = if (!heldItem.isEmpty && heldItem.isIn(powerItems[stat])) 8 else 0
evYield[stat] = evYield.getOrDefault(stat, 0) + value + boost
}
return evYield
}
}
@@ -90,7 +90,7 @@ object CobblemonSpawningProspector : SpawningProspector {
val state = query.getBlockState(pos.set(x, y, z))
blocks[x - area.baseX][y - baseY][z - area.baseZ] = WorldSlice.BlockData(
state = state,
light = state.getOpacity(world, pos)
light = world.getLightLevel(pos)
)
if (canSeeSky) {
@@ -14,9 +14,7 @@ import com.cobblemon.mod.common.api.pokemon.PokemonProperties
import com.cobblemon.mod.common.api.spawning.context.SpawningContext
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.pokemon.feature.SeasonFeatureHandler
import com.cobblemon.mod.common.util.toVec3d
import com.cobblemon.mod.common.util.weightedSelection
import kotlin.random.Random
/**
* A [SpawnAction] that will spawn a single [PokemonEntity].
@@ -35,10 +33,6 @@ class PokemonSpawnAction(
if (props.level == null) {
props.level = detail.getDerivedLevelRange().random()
}
if (props.shiny == null) {
// If the config value is at least 1, then do 1/x and use that as the shiny chance
props.shiny = Cobblemon.config.shinyRate.takeIf { it >= 1 }?.let { Random.Default.nextFloat() < 1 / it }
}
val heldItems = detail.heldItems?.takeIf { it.isNotEmpty() }?.toMutableList() ?: mutableListOf()
val heldItem = if (heldItems.isNotEmpty()) {
val until100 = 1 - heldItems.sumOf { it.percentage / 100 }
@@ -17,6 +17,7 @@ import com.cobblemon.mod.common.api.spawning.context.SpawningContext
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.pokemon.Pokemon
import com.cobblemon.mod.common.util.asIdentifierDefaultingNamespace
import com.cobblemon.mod.common.util.asTranslated
import com.cobblemon.mod.common.util.lang
import com.google.gson.annotations.SerializedName
import kotlin.math.ceil
@@ -48,6 +49,8 @@ class PokemonSpawnDetail : SpawnDetail() {
override fun getName(): MutableText {
displayName?.let { return it.asTranslated() }
val speciesString = pokemon.species
if (speciesString != null) {
if (speciesString.lowercase() == "random") {
@@ -1,20 +0,0 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.spawning.influence
import com.cobblemon.mod.common.api.spawning.context.SpawningContext
import com.cobblemon.mod.common.api.spawning.detail.PokemonSpawnDetail
import com.cobblemon.mod.common.api.spawning.detail.SpawnDetail
import com.cobblemon.mod.common.world.gamerules.CobblemonGameRules.DO_POKEMON_SPAWNING
open class GameRuleInfluence : SpawningInfluence {
override fun affectSpawnable(detail: SpawnDetail, ctx: SpawningContext): Boolean {
return detail !is PokemonSpawnDetail || ctx.world.gameRules.getBoolean(DO_POKEMON_SPAWNING)
}
}
@@ -30,6 +30,7 @@ import net.minecraft.util.math.Vec3d
import net.minecraft.world.World
import net.minecraft.world.chunk.Chunk
import net.minecraft.world.chunk.ChunkStatus
import com.cobblemon.mod.common.world.gamerules.CobblemonGameRules.DO_POKEMON_SPAWNING
/**
* A type of [TickingSpawner] that operates within some area. When this spawner type
@@ -60,6 +61,9 @@ abstract class AreaSpawner(
override fun run(cause: SpawnCause): Pair<SpawningContext, SpawnDetail>? {
val area = getArea(cause)
if (area?.world?.gameRules?.getBoolean(DO_POKEMON_SPAWNING) == false) {
return null
}
val constrainedArea = if (area != null) constrainArea(area) else null
if (constrainedArea != null) {
val numberNearby = constrainedArea.world.getEntitiesByClass(
@@ -11,7 +11,6 @@ package com.cobblemon.mod.common.api.spawning.spawner
import com.cobblemon.mod.common.api.spawning.CobblemonSpawnPools
import com.cobblemon.mod.common.api.spawning.SpawnerManager
import com.cobblemon.mod.common.api.spawning.detail.SpawnPool
import com.cobblemon.mod.common.api.spawning.influence.GameRuleInfluence
import com.cobblemon.mod.common.api.spawning.influence.PlayerLevelRangeInfluence
import com.cobblemon.mod.common.api.spawning.influence.SpawningInfluence
import net.minecraft.server.network.ServerPlayerEntity
@@ -26,7 +25,7 @@ import net.minecraft.server.network.ServerPlayerEntity
*/
object PlayerSpawnerFactory {
var spawns: SpawnPool = CobblemonSpawnPools.WORLD_SPAWN_POOL
var influenceBuilders = mutableListOf<(player: ServerPlayerEntity) -> SpawningInfluence?>({ PlayerLevelRangeInfluence(it, variation = 5) }, { GameRuleInfluence() })
var influenceBuilders = mutableListOf<(player: ServerPlayerEntity) -> SpawningInfluence?>({ PlayerLevelRangeInfluence(it, variation = 5) })
fun create(spawnerManager: SpawnerManager, player: ServerPlayerEntity): PlayerSpawner {
val influences = influenceBuilders.mapNotNull { it(player) }
@@ -34,4 +33,4 @@ object PlayerSpawnerFactory {
it.influences.addAll(influences)
}
}
}
}
@@ -32,12 +32,12 @@ open class BottomlessStore(override val uuid: UUID) : PokemonStore<BottomlessPos
override fun iterator() = pokemon.iterator()
override fun get(position: BottomlessPosition) = position.currentIndex
.takeIf { it < pokemon.size && it >= 0 }
.takeIf { it in pokemon.indices }
?.let { pokemon[it] }
override fun getFirstAvailablePosition() = BottomlessPosition(pokemon.size)
override fun isValidPosition(position: BottomlessPosition) = position.currentIndex >= 0
operator fun get(index: Int) = index.takeIf { it >= 0 && it < pokemon.size }?.let { pokemon[it] }
operator fun get(index: Int) = index.takeIf { it in pokemon.indices }?.let { pokemon[it] }
override fun getObservingPlayers() = emptySet<ServerPlayerEntity>()
override fun sendTo(player: ServerPlayerEntity) {}
@@ -58,7 +58,12 @@ open class BottomlessStore(override val uuid: UUID) : PokemonStore<BottomlessPos
override fun loadFromNBT(nbt: NbtCompound): BottomlessStore {
var i = -1
while (nbt.contains(DataKeys.STORE_SLOT + ++i)) {
pokemon.add(Pokemon().loadFromNBT(nbt.getCompound(DataKeys.STORE_SLOT + i)))
val pokemonNBT = nbt.getCompound(DataKeys.STORE_SLOT + i)
try {
pokemon.add(Pokemon().loadFromNBT(pokemonNBT))
} catch(_: InvalidSpeciesException) {
handleInvalidSpeciesNBT(pokemonNBT)
}
}
return this
}
@@ -71,7 +76,12 @@ open class BottomlessStore(override val uuid: UUID) : PokemonStore<BottomlessPos
override fun loadFromJSON(json: JsonObject): BottomlessStore {
var i = -1
while (json.has(DataKeys.STORE_SLOT + ++i)) {
pokemon.add(Pokemon().loadFromJSON(json.getAsJsonObject(DataKeys.STORE_SLOT + i)))
val pokemonJSON = json.getAsJsonObject(DataKeys.STORE_SLOT + i)
try {
pokemon.add(Pokemon().loadFromJSON(pokemonJSON))
} catch (_: InvalidSpeciesException) {
handleInvalidSpeciesJSON(pokemonJSON)
}
}
return this
}
@@ -92,11 +102,16 @@ open class BottomlessStore(override val uuid: UUID) : PokemonStore<BottomlessPos
this.pokemon.add(pokemon)
storeChangeObservable.emit(Unit)
} else if (position.currentIndex in 0 until this.pokemon.size) {
var startIndex = position.currentIndex;
if (pokemon != null) {
this.pokemon.add(position.currentIndex, pokemon)
startIndex += 1;
} else {
this.pokemon.removeAt(position.currentIndex)
}
for(i in startIndex until this.pokemon.size) {
this.pokemon[i].storeCoordinates.set(StoreCoordinates(this, BottomlessPosition(i)))
}
storeChangeObservable.emit(Unit)
}
}
@@ -0,0 +1,19 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.storage
import net.minecraft.util.Identifier
/**
* An exception when trying to deserialize a Pokemon instance with an identifier that doesn't seem to be in the registry.
*
* @author Hiroku
* @since October 9th, 2023
*/
class InvalidSpeciesException(val identifier: Identifier) : IllegalStateException("Invalid species: $identifier")
@@ -146,8 +146,10 @@ abstract class PokemonStore<T : StorePosition> : Iterable<Pokemon> {
operator fun get(uuid: UUID) = find { it.uuid == uuid }
open fun handleInvalidSpeciesNBT(nbt: NbtCompound) {}
abstract fun saveToNBT(nbt: NbtCompound): NbtCompound
abstract fun loadFromNBT(nbt: NbtCompound): PokemonStore<T>
open fun handleInvalidSpeciesJSON(json: JsonObject) {}
abstract fun saveToJSON(json: JsonObject): JsonObject
abstract fun loadFromJSON(json: JsonObject): PokemonStore<T>
abstract fun savePositionToNBT(position: T, nbt: NbtCompound)
@@ -121,8 +121,12 @@ class ReforgedConversion(val base: Path) : CobblemonConverter<NbtCompound> {
evs[Stats.SPECIAL_DEFENCE] = nbt.getInt("EVSpecialDefense")
evs[Stats.SPEED] = nbt.getInt("EVSpeed")
result.evs = evs
result.ivs = ivs
ivs.forEach { stat ->
result.setIV(stat.key, stat.value)
}
evs.forEach { stat ->
result.setEV(stat.key, stat.value)
}
for (move in nbt.getList("Moveset", 10)) {
val compound = move as NbtCompound
@@ -0,0 +1,101 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.storage.adapter.database
import com.cobblemon.mod.common.api.storage.PokemonStore
import com.cobblemon.mod.common.api.storage.StorePosition
import com.cobblemon.mod.common.api.storage.adapter.CobblemonAdapterParent
import com.cobblemon.mod.common.api.storage.adapter.flatfile.FileStoreAdapter
import com.cobblemon.mod.common.api.storage.adapter.flatfile.JSONStoreAdapter
import com.cobblemon.mod.common.api.storage.adapter.flatfile.NBTStoreAdapter
import com.cobblemon.mod.common.api.storage.party.PlayerPartyStore
import com.cobblemon.mod.common.api.storage.pc.PCStore
import com.cobblemon.mod.common.util.server
import com.google.gson.Gson
import com.google.gson.JsonObject
import com.mongodb.client.MongoClient
import com.mongodb.client.MongoCollection
import com.mongodb.client.model.ReplaceOptions
import net.minecraft.util.WorldSavePath
import org.bson.Document
import java.util.UUID
/**
* A [FileStoreAdapter] for MongoDB. This allows a [PokemonStore] to be serialized to a MongoDB database.
*
* @author Pebbles
* @since August 23rd, 2023
*/
open class MongoDBStoreAdapter(
private val mongoClient: MongoClient,
private val databaseName: String,
) : CobblemonAdapterParent<JsonObject>(), FileStoreAdapter<JsonObject> {
private fun getCollection(storeClass: Class<out PokemonStore<*>>): MongoCollection<Document> {
val collectionName = when (storeClass) {
PlayerPartyStore::class.java -> "PlayerPartyCollection"
PCStore::class.java -> "PCCollection"
else -> "OtherCollection"
}
return mongoClient.getDatabase(databaseName).getCollection(collectionName)
}
private val gson: Gson = Gson()
override fun <E : StorePosition, T : PokemonStore<E>> serialize(store: T): JsonObject {
return store.saveToJSON(JsonObject())
}
override fun save(storeClass: Class<out PokemonStore<*>>, uuid: UUID, serialized: JsonObject) {
val document = Document.parse(gson.toJson(serialized))
document.put("uuid", uuid.toString())
val collection = getCollection(storeClass)
val filter = Document("uuid", uuid.toString())
collection.replaceOne(filter, document, ReplaceOptions().upsert(true))
}
override fun <E : StorePosition, T : PokemonStore<E>> provide(storeClass: Class<T>, uuid: UUID): T? {
val server = server()!!
val pokemonStoreRoot = server.getSavePath(WorldSavePath.ROOT).resolve("pokemon").toFile()
val jsonAdapter = JSONStoreAdapter(
pokemonStoreRoot.absolutePath,
useNestedFolders = true,
folderPerClass = true
)
val nbtAdapter = NBTStoreAdapter(pokemonStoreRoot.absolutePath, useNestedFolders = true, folderPerClass = true)
// 1. Check if data exists in MongoDB
val collection = getCollection(storeClass)
val filter = Document("uuid", uuid.toString())
val document = collection.find(filter).first()
if (document != null) {
val json = gson.fromJson(document.toJson(), JsonObject::class.java)
val store = storeClass.getConstructor(UUID::class.java).newInstance(uuid)
store.loadFromJSON(json)
return store
}
// 2. Fallback to checking JSON and NBT
val nbtStore = nbtAdapter.provide(storeClass, uuid)
if (nbtStore != null) {
save(storeClass, uuid, serialize(nbtStore))
return nbtStore
}
val jsonStore = jsonAdapter.provide(storeClass, uuid)
if (jsonStore != null) {
save(storeClass, uuid, serialize(jsonStore))
return jsonStore
}
return null
}
}
@@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.storage.adapter.flatifle
package com.cobblemon.mod.common.api.storage.adapter.flatfile
import com.cobblemon.mod.common.api.storage.PokemonStore
import com.cobblemon.mod.common.api.storage.StorePosition
@@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.storage.adapter.flatifle
package com.cobblemon.mod.common.api.storage.adapter.flatfile
import com.cobblemon.mod.common.api.storage.PokemonStore
import com.cobblemon.mod.common.api.storage.StorePosition
@@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.storage.adapter.flatifle
package com.cobblemon.mod.common.api.storage.adapter.flatfile
import com.cobblemon.mod.common.api.storage.PokemonStore
import com.cobblemon.mod.common.api.storage.StorePosition
@@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.storage.adapter.flatifle
package com.cobblemon.mod.common.api.storage.adapter.flatfile
import com.cobblemon.mod.common.Cobblemon.LOGGER
import com.cobblemon.mod.common.api.storage.PokemonStore
@@ -14,7 +14,7 @@ import com.cobblemon.mod.common.api.reactive.Observable.Companion.emitWhile
import com.cobblemon.mod.common.api.storage.PokemonStore
import com.cobblemon.mod.common.api.storage.StorePosition
import com.cobblemon.mod.common.api.storage.adapter.SerializedStore
import com.cobblemon.mod.common.api.storage.adapter.flatifle.FileStoreAdapter
import com.cobblemon.mod.common.api.storage.adapter.flatfile.FileStoreAdapter
import com.cobblemon.mod.common.api.storage.party.PlayerPartyStore
import com.cobblemon.mod.common.api.storage.pc.PCStore
import com.cobblemon.mod.common.platform.events.PlatformEvents
@@ -123,7 +123,7 @@ open class FileBackedPokemonStoreFactory<S>(
}
override fun onPlayerDisconnect(playerID: UUID) {
dirtyStores.find { it.uuid == playerID }?.let { save(it) }
dirtyStores.filter { it.uuid == playerID }.forEach(::save)
storeCaches.forEach { (_, cache) -> cache.cacheMap.remove(playerID) }
}
@@ -12,6 +12,7 @@ import com.cobblemon.mod.common.CobblemonNetwork.sendPacket
import com.cobblemon.mod.common.api.reactive.Observable
import com.cobblemon.mod.common.api.reactive.Observable.Companion.stopAfter
import com.cobblemon.mod.common.api.reactive.SimpleObservable
import com.cobblemon.mod.common.api.storage.InvalidSpeciesException
import com.cobblemon.mod.common.api.storage.PokemonStore
import com.cobblemon.mod.common.api.storage.StoreCoordinates
import com.cobblemon.mod.common.battles.pokemon.BattlePokemon
@@ -168,8 +169,12 @@ open class PartyStore(override val uuid: UUID) : PokemonStore<PartyPosition>() {
while (slotCount < slots.size) { slots.add(null) }
for (slot in slots.indices) {
val pokemonNBT = nbt.getCompound(DataKeys.STORE_SLOT + slot)
if (!pokemonNBT.isEmpty) {
slots[slot] = Pokemon().loadFromNBT(pokemonNBT)
try {
if (!pokemonNBT.isEmpty) {
slots[slot] = Pokemon().loadFromNBT(pokemonNBT)
}
} catch (_: InvalidSpeciesException) {
handleInvalidSpeciesNBT(pokemonNBT)
}
}
@@ -196,7 +201,12 @@ open class PartyStore(override val uuid: UUID) : PokemonStore<PartyPosition>() {
for (slot in slots.indices) {
val key = DataKeys.STORE_SLOT + slot
if (json.has(key)) {
slots[slot] = Pokemon().loadFromJSON(json.get(key).asJsonObject)
val pokemonJSON = json.get(key).asJsonObject
try {
slots[slot] = Pokemon().loadFromJSON(pokemonJSON)
} catch (_: InvalidSpeciesException) {
handleInvalidSpeciesJSON(pokemonJSON)
}
}
}
@@ -9,6 +9,8 @@
package com.cobblemon.mod.common.api.storage.party
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.advancement.CobblemonCriteria
import com.cobblemon.mod.common.advancement.criterion.PartyCheckContext
import com.cobblemon.mod.common.api.pokemon.evolution.PassiveEvolution
import com.cobblemon.mod.common.api.storage.pc.PCStore
import com.cobblemon.mod.common.battles.BattleRegistry
@@ -18,13 +20,13 @@ import com.cobblemon.mod.common.util.DataKeys
import com.cobblemon.mod.common.util.getPlayer
import com.cobblemon.mod.common.util.isPokemonEntity
import com.cobblemon.mod.common.util.lang
import java.util.UUID
import kotlin.math.round
import kotlin.random.Random
import net.minecraft.nbt.NbtCompound
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.text.Text
import java.util.*
import kotlin.math.ceil
import kotlin.math.round
import kotlin.random.Random
/**
* A [PartyStore] used for a single player. This uses the player's UUID as the store's UUID, and is declared as its own
@@ -52,6 +54,7 @@ open class PlayerPartyStore(
override fun add(pokemon: Pokemon): Boolean {
return if (super.add(pokemon)) {
pokemon.getOwnerPlayer()?.let { CobblemonCriteria.PARTY_CHECK.trigger(it, PartyCheckContext(this)) }
true
} else {
val player = playerUUID.getPlayer()
@@ -151,4 +154,31 @@ open class PlayerPartyStore(
}
return true
}
override fun swap(position1: PartyPosition, position2: PartyPosition) {
super.swap(position1, position2)
//Make it so we can check what's in the Player's party
val pokemon1 = get(position1)
val pokemon2 = get(position2)
if (pokemon1 != null && pokemon2 != null) {
val player = pokemon1.getOwnerPlayer()
if (player != null) {
CobblemonCriteria.PARTY_CHECK.trigger(player, PartyCheckContext(this))
}
} else if (pokemon1 != null || pokemon2 != null) {
var player = pokemon1?.getOwnerPlayer()
if (player != null) {
CobblemonCriteria.PARTY_CHECK.trigger(player, PartyCheckContext(this))
} else {
player = pokemon2!!.getOwnerPlayer()
CobblemonCriteria.PARTY_CHECK.trigger(player!!, PartyCheckContext(this))
}
}
}
override fun set(position: PartyPosition, pokemon: Pokemon) {
super.set(position, pokemon)
pokemon.getOwnerPlayer()?.let { CobblemonCriteria.PARTY_CHECK.trigger(it, PartyCheckContext(this)) }
}
}
@@ -10,6 +10,7 @@ package com.cobblemon.mod.common.api.storage.pc
import com.cobblemon.mod.common.api.reactive.Observable.Companion.stopAfter
import com.cobblemon.mod.common.api.reactive.SimpleObservable
import com.cobblemon.mod.common.api.storage.InvalidSpeciesException
import com.cobblemon.mod.common.api.storage.StoreCoordinates
import com.cobblemon.mod.common.net.messages.client.storage.pc.SetPCBoxPokemonPacket
import com.cobblemon.mod.common.pokemon.Pokemon
@@ -120,7 +121,12 @@ open class PCBox(val pc: PCStore) : Iterable<Pokemon> {
open fun loadFromJSON(json: JsonObject): PCBox {
for (slot in 0 until POKEMON_PER_BOX) {
if (json.has(DataKeys.STORE_SLOT + slot)) {
pokemon[slot] = Pokemon().loadFromJSON(json.getAsJsonObject(DataKeys.STORE_SLOT + slot))
val pokemonJson = json.getAsJsonObject(DataKeys.STORE_SLOT + slot)
try {
pokemon[slot] = Pokemon().loadFromJSON(pokemonJson)
} catch (_: InvalidSpeciesException) {
pc.handleInvalidSpeciesJSON(pokemonJson)
}
}
}
return this
@@ -129,7 +135,12 @@ open class PCBox(val pc: PCStore) : Iterable<Pokemon> {
open fun loadFromNBT(nbt: NbtCompound): PCBox {
for (slot in 0 until POKEMON_PER_BOX) {
if (nbt.contains(DataKeys.STORE_SLOT + slot)) {
pokemon[slot] = Pokemon().loadFromNBT(nbt.getCompound(DataKeys.STORE_SLOT + slot))
val pokemonNBT = nbt.getCompound(DataKeys.STORE_SLOT + slot)
try {
pokemon[slot] = Pokemon().loadFromNBT(pokemonNBT)
} catch (_: InvalidSpeciesException) {
pc.handleInvalidSpeciesNBT(pokemonNBT)
}
}
}
return 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.api.storage.player
import com.google.gson.JsonObject
/**
* A dummy implementation of the [PlayerDataExtension] interface.
* Used for when a previous [PlayerDataExtension] is no longer registered.
*
* @author Deltric
* @since 2023-10-01
*/
class DummyPlayerDataExtension(
val json: JsonObject
): PlayerDataExtension {
override fun name(): String {
return this.json.get(PlayerDataExtension.NAME_KEY).asString
}
override fun serialize(): JsonObject {
return this.json
}
override fun deserialize(json: JsonObject): PlayerDataExtension {
return DummyPlayerDataExtension(json)
}
}
@@ -24,8 +24,16 @@ class PlayerAdvancementData {
private set
var totalBattleVictoryCount: Int = 0
private set
var totalPvPBattleVictoryCount: Int = 0
private set
var totalPvWBattleVictoryCount: Int = 0
private set
var totalPvNBattleVictoryCount: Int = 0
private set
var totalShinyCaptureCount: Int = 0
private set
var totalTradedCount: Int = 0
private set
private var totalTypeCaptureCounts = mutableMapOf<String, Int>()
private var totalDefeatedCounts = mutableMapOf<Identifier, Int>()
@@ -45,13 +53,29 @@ class PlayerAdvancementData {
}
fun updateTotalBattleVictoryCount() {
totalEvolvedCount++
totalBattleVictoryCount++
}
fun updateTotalPvPBattleVictoryCount() {
totalPvPBattleVictoryCount++
}
fun updateTotalPvWBattleVictoryCount() {
totalPvWBattleVictoryCount++
}
fun updateTotalPvNBattleVictoryCount() {
totalPvNBattleVictoryCount++
}
fun updateTotalShinyCaptureCount() {
totalShinyCaptureCount++
}
fun updateTotalTradedCount() {
totalTradedCount++
}
fun getTotalTypeCaptureCount(type: ElementalType): Int {
if (!totalTypeCaptureCounts.containsKey(key = type.name)) {
totalTypeCaptureCounts[type.name] = 0
@@ -11,8 +11,10 @@ package com.cobblemon.mod.common.api.storage.player
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.CobblemonNetwork.sendPacket
import com.cobblemon.mod.common.net.messages.client.starter.SetClientPlayerDataPacket
import com.cobblemon.mod.common.util.cobblemonResource
import java.util.UUID
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.Identifier
data class PlayerData(
val uuid: UUID,
@@ -20,7 +22,8 @@ data class PlayerData(
var starterLocked: Boolean,
var starterSelected: Boolean,
var starterUUID: UUID?,
val extraData: MutableMap<String, PlayerDataExtension>
var keyItems: MutableSet<Identifier>,
val extraData: MutableMap<String, PlayerDataExtension>,
) {
var advancementData: PlayerAdvancementData = PlayerAdvancementData()
@@ -36,6 +39,7 @@ data class PlayerData(
starterLocked = !Cobblemon.starterConfig.allowStarterOnJoin,
starterSelected = false,
starterUUID = null,
keyItems = mutableSetOf(),
extraData = mutableMapOf()
)
}
@@ -8,13 +8,10 @@
package com.cobblemon.mod.common.api.storage.player.adapter
import com.cobblemon.mod.common.api.storage.player.PlayerAdvancementData
import com.cobblemon.mod.common.api.storage.player.PlayerData
import com.cobblemon.mod.common.api.storage.player.PlayerDataExtension
import com.cobblemon.mod.common.util.adapters.IdentifierAdapter
import com.cobblemon.mod.common.util.fromJson
import com.cobblemon.mod.common.util.getPlayer
import com.cobblemon.mod.common.util.removeIf
import com.google.gson.GsonBuilder
import java.io.BufferedReader
import java.io.FileReader
@@ -24,6 +21,8 @@ import java.util.UUID
import net.minecraft.server.MinecraftServer
import net.minecraft.util.Identifier
import net.minecraft.util.WorldSavePath
import kotlin.reflect.KMutableProperty
import kotlin.reflect.full.memberProperties
class JsonPlayerData: PlayerDataStoreAdapter {
@@ -57,9 +56,11 @@ class JsonPlayerData: PlayerDataStoreAdapter {
playerFile.parentFile.mkdirs()
return if (playerFile.exists()) {
gson.fromJson<PlayerData>(BufferedReader(FileReader(playerFile))).also {
// Resolves old data from pre 1.0, don't even ask man. - Hiroku
if (it.advancementData == null) {
it.advancementData = PlayerAdvancementData()
// Resolves old data that's missing new properties
val newProps = it::class.memberProperties.filterIsInstance<KMutableProperty<*>>().filter { member -> member.getter.call(it) == null }
if (newProps.isNotEmpty()) {
val defaultData = PlayerData.defaultData(uuid)
newProps.forEach { member -> member.setter.call(it, member.getter.call(defaultData)) }
}
}
} else {
@@ -0,0 +1,66 @@
/*
* 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.storage.player.adapter
import com.cobblemon.mod.common.api.storage.player.PlayerAdvancementData
import com.cobblemon.mod.common.api.storage.player.PlayerData
import com.cobblemon.mod.common.api.storage.player.PlayerDataExtension
import com.cobblemon.mod.common.util.adapters.IdentifierAdapter
import com.google.gson.Gson
import com.google.gson.GsonBuilder
import com.mongodb.client.MongoClient
import com.mongodb.client.model.ReplaceOptions
import net.minecraft.util.Identifier
import org.bson.Document
import java.util.UUID
import kotlin.reflect.KMutableProperty
import kotlin.reflect.full.memberProperties
class MongoPlayerDataAdapter(
mongoClient: MongoClient,
databaseName: String
) : PlayerDataStoreAdapter {
companion object {
val gson = GsonBuilder()
.disableHtmlEscaping()
.registerTypeAdapter(PlayerDataExtension::class.java, PlayerDataExtensionAdapter)
.registerTypeAdapter(Identifier::class.java, IdentifierAdapter)
.create()
}
private val collection = mongoClient.getDatabase(databaseName).getCollection("PlayerDataCollection")
override fun load(uuid: UUID): PlayerData {
val filter = Document("uuid", uuid.toString())
val document = collection.find(filter).first()
return if (document != null) {
val jsonStr = document.toJson()
gson.fromJson(jsonStr, PlayerData::class.java).also {
val newProps = it::class.memberProperties.filterIsInstance<KMutableProperty<*>>().filter { member -> member.getter.call(it) == null }
if (newProps.isNotEmpty()) {
val defaultData = PlayerData.defaultData(uuid)
newProps.forEach { member -> member.setter.call(it, member.getter.call(defaultData)) }
}
}
} else {
PlayerData.defaultData(uuid).also(::save)
}
}
override fun save(playerData: PlayerData) {
val jsonStr = gson.toJson(playerData)
val document = Document.parse(jsonStr)
document.put("uuid", playerData.uuid.toString())
val filter = Document("uuid", playerData.uuid.toString())
collection.replaceOne(filter, document, ReplaceOptions().upsert(true))
}
}
@@ -8,6 +8,8 @@
package com.cobblemon.mod.common.api.storage.player.adapter
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.api.storage.player.DummyPlayerDataExtension
import com.cobblemon.mod.common.api.storage.player.PlayerDataExtension
import com.cobblemon.mod.common.api.storage.player.PlayerDataExtensionRegistry
import com.google.gson.JsonDeserializationContext
@@ -34,7 +36,13 @@ object PlayerDataExtensionAdapter: JsonSerializer<PlayerDataExtension>, JsonDese
val jObject = json.asJsonObject
val name = jObject.get(PlayerDataExtension.NAME_KEY)
?: throw IllegalStateException("PlayerDataExtension without name")
val extension = PlayerDataExtensionRegistry.getOrException(name.asString)
return extension.getDeclaredConstructor().newInstance().deserialize(jObject)
val extension = PlayerDataExtensionRegistry.get(name.asString)
return if (extension != null) {
extension.getDeclaredConstructor().newInstance().deserialize(jObject)
} else {
Cobblemon.LOGGER.info("No PlayerDataExtension registered with name ${name.asString}, loading data with a dummy extension.")
DummyPlayerDataExtension(jObject)
}
}
}
@@ -26,7 +26,7 @@ class JsonPlayerDataStoreFactory : PlayerDataStoreFactory {
}
override fun load(uuid: UUID): PlayerData {
return if(cache.contains(uuid))
return if (cache.contains(uuid))
cache[uuid]!!;
else {
val data = adapter.load(uuid);
@@ -40,7 +40,7 @@ class JsonPlayerDataStoreFactory : PlayerDataStoreFactory {
}
override fun saveAll() {
cache.forEach { (_, pd) -> adapter.save(pd)}
cache.forEach { (_, pd) -> adapter.save(pd) }
cache.removeIf { (uuid, _) -> uuid.getPlayer() == null }
}
@@ -0,0 +1,45 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.storage.player.factory
import com.cobblemon.mod.common.api.storage.player.PlayerData
import com.cobblemon.mod.common.api.storage.player.adapter.MongoPlayerDataAdapter
import com.cobblemon.mod.common.util.getPlayer
import com.cobblemon.mod.common.util.removeIf
import com.mongodb.client.MongoClient
import java.util.UUID
class MongoPlayerDataStoreFactory(mongoClient: MongoClient, databaseName: String) : PlayerDataStoreFactory {
private val cache = mutableMapOf<UUID, PlayerData>()
private val adapter = MongoPlayerDataAdapter(mongoClient, databaseName)
override fun load(uuid: UUID): PlayerData {
return if (cache.contains(uuid))
cache[uuid]!!;
else {
val data = adapter.load(uuid);
cache[uuid] = data
data
}
}
override fun save(data: PlayerData) {
adapter.save(data)
}
override fun saveAll() {
cache.forEach { (_, pd) -> adapter.save(pd) }
cache.removeIf { (uuid, _) -> uuid.getPlayer() == null }
}
override fun onPlayerDisconnect(uuid: UUID) {
cache.remove(uuid)
}
}
@@ -22,7 +22,7 @@ import net.minecraft.registry.tag.TagKey
object CobblemonBiomeTags {
@JvmField
val IS_ABYSS = create("is_abyss")
val IS_DEEP_DARK = create("is_deep_dark")
@JvmField
val IS_ARID = create("is_arid")
@JvmField
@@ -38,7 +38,7 @@ object CobblemonBiomeTags {
@JvmField
val IS_COLD = create("is_cold")
@JvmField
val IS_DEEP = create("is_deep")
val IS_DEEP_OCEAN = create("is_deep_ocean")
@JvmField
val IS_DESERT = create("is_desert")
@JvmField
@@ -52,9 +52,9 @@ object CobblemonBiomeTags {
@JvmField
val IS_FRESHWATER = create("is_freshwater")
@JvmField
val IS_FRIGID = create("is_frigid")
val IS_COLD_OCEAN = create("is_cold_ocean")
@JvmField
val IS_FROZEN = create("is_frozen")
val IS_FROZEN_OCEAN = create("is_frozen_ocean")
@JvmField
val IS_GLACIAL = create("is_glacial")
@JvmField
@@ -68,7 +68,7 @@ object CobblemonBiomeTags {
@JvmField
val IS_JUNGLE = create("is_jungle")
@JvmField
val IS_LUKEWARM = create("is_lukewarm")
val IS_LUKEWARM_OCEAN = create("is_lukewarm_ocean")
@JvmField
val IS_LUSH = create("is_lush")
@JvmField
@@ -86,7 +86,7 @@ object CobblemonBiomeTags {
@JvmField
val IS_PLATEAU = create("is_plateau")
@JvmField
val IS_REEF = create("is_reef")
val IS_WARM_OCEAN = create("is_warm_ocean")
@JvmField
val IS_RIVER = create("is_river")
@JvmField
@@ -96,7 +96,7 @@ object CobblemonBiomeTags {
@JvmField
val IS_SKY = create("is_sky")
@JvmField
val IS_SNOWY = create("is_snowy")
val IS_SNOWY_FOREST = create("is_snowy_forest")
@JvmField
val IS_SPOOKY = create("is_spooky")
@JvmField
@@ -119,6 +119,10 @@ object CobblemonBiomeTags {
val IS_VOlCANIC = create("is_volcanic")
@JvmField
val IS_WINTER = create("is_winter")
@JvmField
val IS_SPARSE = create("is_sparse")
@JvmField
val IS_DENSE = create("is_dense")
// Has Feature tags
@JvmField

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