Compare commits

...
Author SHA1 Message Date
Paul 754ca7003f More TM porting to 1.21 2024-07-03 19:03:51 +10:00
Paul 337e6d9b1f Mostly ported TM progress to 1.21 2024-06-30 12:31:15 +10:00
Paul 01c74ad92f Merge branch 'refs/heads/sega_bass_pro_fishing_2' into tm-machine
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/api/types/ElementalType.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/CobblemonClient.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/data/CobblemonDataProvider.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/item/group/CobblemonItemGroups.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/pokemon/helditem/BaseCobblemonHeldItemManager.kt
#	neoforge/src/main/kotlin/com/cobblemon/mod/neoforge/CobblemonNeoForge.kt
2024-06-30 11:13:57 +10:00
Paul b1d06a667d Merge remote-tracking branch 'origin/main' into tm-machine
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonItems.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/CobblemonBakingOverrides.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/CobblemonClient.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/command/TestCommand.kt
#	common/src/main/resources/assets/cobblemon/lang/en_us.json
#	common/src/main/resources/assets/cobblemon/sounds.json
2024-06-30 11:06:33 +10:00
Hiroku 155ff3dfed Merge branch 'feature/fix-property-extraction-nickname' into 'main'
fix PokemonProperties#asString prefixing nicknames with a '$'

See merge request cable-mc/cobblemon!1079
2024-06-28 23:59:23 +00:00
Paul af678af2df Packet fixes, lan joins now work 2024-06-28 14:05:13 +10:00
Paulandapion 0db5292e44 Disable multi project optimization 2024-06-27 20:03:46 -04:00
Apion 257352c75d Merge branch 'held-item-manager-item-checker' into 'main'
Held item manager item checker

See merge request cable-mc/cobblemon!883
2024-06-27 23:14:34 +00:00
Polymeta 01a5ef46a5 fix PokemonProperties#asString prefixing nicknames with a '$' 2024-06-28 00:14:08 +01:00
Paul 5150a96944 Merge remote-tracking branch 'origin/main' into sega_bass_pro_fishing_2
# Conflicts:
#	.gitlab-ci.yml
2024-06-25 07:49:40 +10:00
Paul ab987fba58 Merge branch 'refs/heads/main' into sega_bass_pro_fishing_2 2024-06-23 17:50:18 +10:00
Hiroku 3c2c706878 Update .gitlab-ci.yml file 2024-06-23 07:40:58 +00:00
Paul 8625c754cd Fixed crashing on server environments caused by SOMEONE who was messing with berry mulch 2024-06-23 15:36:47 +10:00
Paul 9ddd11205e Merge branch 'refs/heads/1.21' into sega_bass_pro_fishing_2 2024-06-22 17:17:18 +10:00
Paul 9ebd655909 Merge remote-tracking branch 'origin/main' into sega_bass_pro_fishing_2
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen1/MagmarModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen2/MagbyModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen4/MagmortarModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen8/DreepyModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonEntity.kt
2024-06-22 17:07:03 +10:00
Paul 51e10bbb3f Licenses 2024-06-22 17:03:36 +10:00
Paul 7cd4c9856f Fixed Pokémon sendout effects not playing until you look at the Pokémon 2024-06-22 16:16:58 +10:00
Paul 8b2a20f542 Fixed particle effects not being visible (vertex order has changed) 2024-06-22 15:49:07 +10:00
Paul 8093bc510c Speculated changes for particle issues 2024-06-22 11:01:08 +10:00
Hiroku d06a371129 Merge branch 'shouldermon-sneaking-fix' into 'main'
Shouldermon Sneaking Edits

Closes #786

See merge request cable-mc/cobblemon!950
2024-06-21 23:59:43 +00:00
Hiroku eb55003d14 Merge branch 'crumbling-arch' into 'main'
i hate the crumbling arch

See merge request cable-mc/cobblemon!1057
2024-06-21 23:49:17 +00:00
Hiroku facb6b9910 Merge branch 'implement_pokemon' into 'main'
Some stuff

See merge request cable-mc/cobblemon!1063
2024-06-21 23:48:58 +00:00
Frank The FarmerandHiroku cf685ac098 Some stuff 2024-06-21 23:48:58 +00:00
Hiroku 0b2c5c0418 Merge branch 'tmetcalfe89/fix-testpartyslot-species-check' into 'main'
fixed comparison not using namespace in `b` of `a != b`

See merge request cable-mc/cobblemon!1071
2024-06-21 23:03:02 +00:00
Hiroku 3bfccdc0a5 Merge branch 'main' into 'main'
Relocate groups exported by GraalJS - Fix Crash on GraalVM

See merge request cable-mc/cobblemon!1074
2024-06-21 23:02:17 +00:00
Hiroku 6fd5904b12 Merge branch 'main' into 'main'
Add Lang for Apricorn Blocks

See merge request cable-mc/cobblemon!1075
2024-06-21 23:01:38 +00:00
Hiroku 8d942dc6e2 Merge branch 'tags/update' into 'main'
Updated all tags documentation

See merge request cable-mc/cobblemon!979
2024-06-21 22:40:44 +00:00
WaldleuferandHiroku a9a98b3810 Updated all tags documentation 2024-06-21 22:40:43 +00:00
Joseph T. McQuigg ee9baa8131 Add Lang for Apricorn Blocks 2024-06-21 13:20:40 -04:00
Paul 7bb8eb29cf Probable correction to some of the particle materials we probably don't even use 2024-06-21 22:19:42 +10:00
Paul 33c0897534 Fixed dialogue regressions from port, corrected potion effect TODOs 2024-06-21 21:52:13 +10:00
CanadianBacon 970aaee6c6 Relocate groups exported by GraalJS
org.graalvm -> com.cobblemon.mod.relocations.graalvm
com.oracle -> com.cobblemon.mod.relocations.oracle
2024-06-17 08:22:20 +02:00
Paul c83cfb2439 1.21 now boots on Fabric 2024-06-17 12:30:10 +10:00
Paul 995ffc165e Mostly ported to 1.21 2024-06-17 11:19:09 +10:00
Paul f548cd8570 Merge remote-tracking branch 'origin/1.20.5' into sega_bass_pro_fishing_2 2024-06-17 09:22:44 +10:00
Hiroku f6124d7474 Merge branch 'initiate_battle_while_recalling_bugfix' into 'main'
Fixes issue #872

Closes #872

See merge request cable-mc/cobblemon!1072
2024-06-16 08:07:16 +00:00
Notepadccino a0300ccd18 Update CHANGELOG.md 2024-06-16 08:05:22 +00:00
Nick 00543bdf91 I prefer rocks anyways 2024-06-15 19:55:36 -07:00
notepadccino 486056d7f0 Fixes issue #872 2024-06-14 16:52:12 +02:00
Paul 0f7dc57429 Mergo conflicto dispellus 2024-06-14 14:35:26 +10:00
Paul 2f0dd36214 Merge branch 'refs/heads/1.20.5' into sega_bass_pro_fishing_2
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/client/CobblemonClient.kt
2024-06-14 14:25:17 +10:00
Hiroku 03ca6a4396 Merge branch 'tmetcalfe89/fix-energy-root-reviving' into 'main'
fixed energy root reviving

See merge request cable-mc/cobblemon!1065
2024-06-14 04:13:20 +00:00
Deltric bad5f0aad7 pokemon item 2024-06-13 23:01:16 -05:00
Paul 7223c6db5e More evo and move scroll corrections, started fixing up starter selection 2024-06-14 13:27:10 +10:00
Paul 1e5744ad87 Merge remote-tracking branch 'origin/1.20.5' into 1.20.5 2024-06-14 13:09:21 +10:00
Paul b6ed67308a Fixed evo and move swap scrolls 2024-06-14 12:51:07 +10:00
apion 88808e8548 Changed gradle run configs to use a username matched to UUID 2024-06-13 22:26:53 -04:00
tmetcalfe89 691c52eed0 changelog 2024-06-13 19:05:02 -07:00
tmetcalfe89 a6765c0328 fixed comparison not using namespace in b of a != b 2024-06-13 19:01:08 -07:00
Hiroku b2d26abc4b Merge branch 'Fixes901' into 'main'
Fix For 901

Closes #901

See merge request cable-mc/cobblemon!1069
2024-06-14 00:32:08 +00:00
Hiroku 3f838a9d8a Merge branch 'nickname-render-fix' into '1.20.5'
Fix nickname styling affecting the rendering of the level label.

See merge request cable-mc/cobblemon!1070
2024-06-11 09:29:40 +00:00
Licious 8152f518f0 Fix nickname styling affecting the rendering of the level label. 2024-06-11 10:20:12 +01:00
JazzMcNade ebb677cc9c Don't read the current hp until you've fully calculated the max hp 2024-06-09 14:53:28 -05:00
Licious f181aabb3c Merge branch 'fix-898' into 'main'
Fix lack of side check when instancing Pokemon on PokemonEntity

Closes #898

See merge request cable-mc/cobblemon!1068
2024-06-09 17:43:34 +00:00
Licious 4df5e987c7 Fix lack of side check when instancing Pokemon on PokemonEntity 2024-06-09 17:43:33 +00:00
tmetcalfe89 3026e5c66f changelog 2024-06-09 10:39:43 -07:00
tmetcalfe89 f2310d8979 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into tmetcalfe89/fix-energy-root-reviving 2024-06-09 10:39:22 -07:00
Paul ceb5c0c7f5 Fixed many pasture block issues from the port 2024-06-09 21:39:37 +10:00
Paul 9fa0ddaeb7 Fixed battle overlay issue with pokemon tiles 2024-06-09 13:27:11 +10:00
Paul 4aa55c4174 Merge remote-tracking branch 'origin/1.20.5' into sega_bass_pro_fishing_2 2024-06-09 13:06:04 +10:00
apion 4ca8f2ef4d Fixed conditional loading of botany pots compat 2024-06-08 22:58:36 -04:00
Paul f821604018 Merge remote-tracking branch 'origin/1.20.5' into sega_bass_pro_fishing_2
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonItemComponents.kt
#	common/src/main/resources/cobblemon-common.accesswidener
2024-06-09 12:44:52 +10:00
apion 47b5864975 Fixed Pokemon hitboxes not being set. 2024-06-08 22:43:20 -04:00
Paul 9996c06f69 Many more fixes for 1.20.6 2024-06-09 12:42:38 +10:00
Nick ede880344f Templating of new Item Components 2024-06-08 19:25:02 -07:00
Paul 5083c4e472 Merge remote-tracking branch 'origin/1.20.5' into sega_bass_pro_fishing_2 2024-06-09 12:11:04 +10:00
Paul a993cd9e81 License 2024-06-09 12:10:33 +10:00
Paul 045501fb50 Corrected many things for 1.20.6 2024-06-09 12:02:39 +10:00
apion e3b1b4ee34 Fixed pokemon nicknames not serializing 2024-06-08 21:42:01 -04:00
apion 363be6f2cb Fixed issue from merge 2024-06-08 21:19:29 -04:00
apion e60fd608bf Fix broken id and fixed AspectCriterion 2024-06-08 21:15:35 -04:00
apion 939e4eae6a Fixed all campfire and smoking recipes 2024-06-08 21:04:02 -04:00
apion efd633fbdf Fixed all blasting recipes 2024-06-08 20:58:34 -04:00
apion 20dd3e2a7f Fixed all smelting recipes 2024-06-08 20:56:15 -04:00
apion 33f0a619c1 Fix a BUNCH of stone cutter recipes 2024-06-08 20:52:05 -04:00
apion 4afdbbb13e Fix a BUNCH of recipes 2024-06-08 20:36:48 -04:00
apion 5597495f4e Fix some JSONs that were erroring 2024-06-08 20:25:19 -04:00
apion c63ea840ec Fix a bunch of advancements 2024-06-08 19:44:01 -04:00
Paul e3ca678cd8 Merge remote-tracking branch 'origin/1.20.5' into sega_bass_pro_fishing_2
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/Cobblemon.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonNetwork.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/molang/MoLangFunctions.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/net/serializers/StringSetDataSerializer.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/battles/BattleBuilder.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/gui/dialogue/RenderableFace.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/particle/ParticleStorm.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/block/DisplayCaseRenderer.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/PoseableEntityModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen5/ConkeldurrModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen5/GolettModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen5/GolurkModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/generic/GenericBedrockEntity.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokeball/EmptyPokeBallEntity.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/net/messages/client/animation/PlayPosableAnimationPacket.kt
#	common/src/main/resources/cobblemon-common.accesswidener
#	fabric/src/main/kotlin/com/cobblemon/mod/fabric/client/CobblemonFabricClient.kt
#	gradle.properties
2024-06-09 09:43:40 +10:00
apion 3ba761df2b Fixed criteria registration 2024-06-08 19:32:54 -04:00
Nick 03fb363420 Merge remote-tracking branch 'origin/1.20.5' into 1.20.5 2024-06-08 16:09:14 -07:00
Nick 24315154fc Fix a merge conflict for fossil multiblock structure 2024-06-08 16:09:00 -07:00
apion 731b904a42 Fixed LootInjector 2024-06-08 18:58:14 -04:00
Nick bb4c3d8a48 Fix libs.versions.toml 2024-06-08 15:56:17 -07:00
Nick 9dc851d052 Add an image to our buildscript 2024-06-08 15:54:57 -07:00
Nick fc06b04e47 Merge remote-tracking branch 'origin/1.20.5' into 1.20.5
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/Cobblemon.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/spawning/condition/SpawningCondition.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/block/BerryBlock.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/block/BindingSoilBlock.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/block/RestorationTankBlock.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/block/chest/GildedChestBlock.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/block/entity/GildedChestBlockEntity.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/block/entity/RestorationTankBlockEntity.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/block/multiblock/FossilMultiblockStructure.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/PoseableEntityModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/command/SpawnPokemonFromPool.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonEntity.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/integration/adorn/AdornCompatibility.kt
#	fabric/src/main/java/com/cobblemon/mod/fabric/mixin/GuiMixin.java
#	fabric/src/main/kotlin/com/cobblemon/mod/fabric/CobblemonFabric.kt
#	gradle/build-logic/src/main/kotlin/cobblemon.base-conventions.gradle.kts
#	gradle/wrapper/gradle-wrapper.properties
#	neoforge/build.gradle.kts
#	neoforge/src/main/kotlin/com/cobblemon/mod/neoforge/CobblemonNeoForge.kt
2024-06-08 15:52:31 -07:00
Nick ac5f9ac3c5 Sync with main, to the best of our abilities. Fixes some primary blurring on common menus 2024-06-08 15:50:32 -07:00
apion 31323eb53e Fix some issues from the main merge and a StackOverflow in PasturePokemonScrollList 2024-06-08 18:28:46 -04:00
apion ef01482a3d Fixed some serialization issues 2024-06-08 17:59:58 -04:00
Hiroku 65971386f2 Merge branch 'Myslippy-main-patch-82434' into 'main'
Update CHANGELOG.md

See merge request cable-mc/cobblemon!1062
2024-06-08 21:27:17 +00:00
Hiroku 19b5dc7024 Merge branch '1.20.5-with-main-stuff' into '1.20.5'
But what if we brought main into 1.20.5

See merge request cable-mc/cobblemon!1066
2024-06-08 21:26:30 +00:00
apion 8fa4f7b5c2 Fixed build 2024-06-08 17:16:42 -04:00
Paul 81498888bd Some corrections 2024-06-08 20:00:16 +10:00
Paul c1c9f8e235 Fix some project config stuff 2024-06-08 18:38:09 +10:00
Paul 4dac02d68c Merge remote-tracking branch 'origin/1.20.5' into 1.20.5
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/Cobblemon.kt
#	gradle/libs.versions.yml
#	neoforge/build.gradle.kts
2024-06-08 16:42:47 +10:00
Paul d631e89645 Merge remote-tracking branch 'origin/main' into 1.20.5
# Conflicts:
#	common/build.gradle.kts
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonNetwork.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/multiblock/MultiblockBlock.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/pokemon/evolution/Evolution.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/block/BerryBlock.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/block/RestorationTankBlock.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/block/chest/GildedChestBlock.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/block/entity/GildedChestBlockEntity.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/block/entity/RestorationTankBlockEntity.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/block/multiblock/FossilMultiblockStructure.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/particle/ParticleStorm.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/PoseableEntityModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/command/SpawnPokemonFromPool.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonEntity.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/integration/adorn/AdornCompatibility.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/integration/jei/berry/BerryMutationProvider.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/integration/jei/berry/BerryMutationRecipe.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/pokemon/evolution/variants/ItemInteractionEvolution.kt
#	fabric/build.gradle.kts
#	fabric/src/main/kotlin/com/cobblemon/mod/fabric/CobblemonFabric.kt
#	gradle.properties
#	gradle/build-logic/src/main/kotlin/cobblemon.base-conventions.gradle.kts
#	gradle/libs.versions.yml
#	gradle/wrapper/gradle-wrapper.properties
#	neoforge/build.gradle.kts
#	neoforge/src/main/kotlin/com/cobblemon/mod/neoforge/CobblemonNeoForge.kt
#	settings.gradle.kts
2024-06-08 16:41:34 +10:00
Nick 384724a906 Merge remote-tracking branch 'origin/1.20.5' into 1.20.5
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/Cobblemon.kt
#	gradle/libs.versions.yml
#	neoforge/build.gradle.kts
2024-06-07 23:24:06 -07:00
apion 245683832b Added the idea of UnsplittablePackets 2024-06-08 02:02:27 -04:00
Nick 639417d6c8 Merge remote-tracking branch 'refs/remotes/origin/main' into 1.20.5
# Conflicts:
#	common/build.gradle.kts
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonNetwork.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/multiblock/MultiblockBlock.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/pokemon/evolution/Evolution.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/block/BerryBlock.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/block/RestorationTankBlock.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/block/chest/GildedChestBlock.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/block/entity/GildedChestBlockEntity.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/block/entity/RestorationTankBlockEntity.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/block/multiblock/FossilMultiblockStructure.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/particle/ParticleStorm.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/PoseableEntityModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/command/SpawnPokemonFromPool.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonEntity.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/integration/adorn/AdornCompatibility.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/integration/jei/berry/BerryMutationProvider.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/integration/jei/berry/BerryMutationRecipe.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/pokemon/evolution/variants/ItemInteractionEvolution.kt
#	fabric/build.gradle.kts
#	fabric/src/main/kotlin/com/cobblemon/mod/fabric/CobblemonFabric.kt
#	gradle.properties
#	gradle/build-logic/src/main/kotlin/cobblemon.base-conventions.gradle.kts
#	gradle/libs.versions.yml
#	gradle/wrapper/gradle-wrapper.properties
#	neoforge/build.gradle.kts
#	neoforge/src/main/kotlin/com/cobblemon/mod/neoforge/CobblemonNeoForge.kt
#	settings.gradle.kts
2024-06-07 22:44:45 -07:00
apion 6f7e3cf594 Neoforge now boots to menu 2024-06-08 00:35:05 -04:00
apion 9570ce45ef Fix a bunch of NeoForge issues, also moved ItemComponents and Advancement Critera to PlatformRegistries 2024-06-08 00:18:20 -04:00
apion 2cda836703 Move all deps to 1.20.6 2024-06-07 22:25:25 -04:00
apion 5fd36954e0 Use codecs where we should be using codecs 2024-06-07 22:01:29 -04:00
apion 53c3808203 Removed more pokecenter files and fixed BrewingRecipeRegistryMixin 2024-06-07 21:42:40 -04:00
Paul a5be2a1761 Fix missing datatracker init 2024-06-08 11:40:23 +10:00
apion 6768a9f528 Remove broken structures, and block state prop on TumblestoneBlock 2024-06-07 21:27:42 -04:00
Paul c97ceef6f8 Migrated heaps of packets over to RegistryByteBuf, 1.20.5 vers now compiles 2024-06-08 11:00:07 +10:00
Paul f59e3b53a1 Reworked packet rego for fabric and neo 2024-06-08 10:15:23 +10:00
tmetcalfe89 5b52fe5479 fixed energy root reviving 2024-06-07 08:08:19 -07:00
apion 2acac11997 Split up network managing tasks into payload registry and handler registry. Needs cleanup, and need to figure out where some of these methods actually need to be called. Also I only really worked on Fabric ATM 2024-06-07 00:52:44 -04:00
Paul 56223cbd36 Fabric client packet stuff 2 2024-06-07 14:07:53 +10:00
Deltric 985c68e266 read enum set 2024-06-06 22:38:56 -05:00
Paul 4e69d70331 Fabric client packet stuff 2024-06-07 13:25:12 +10:00
Paul b7892c3510 Merge remote-tracking branch 'origin/1.20.5' into 1.20.5 2024-06-07 12:36:14 +10:00
Paul ed246384d7 Various packet fixes 10 2024-06-07 12:36:04 +10:00
Deltric 106eee622c widen access 2024-06-06 21:33:27 -05:00
Paul 2bfe51d82b Various packet fixes 9 2024-06-07 12:24:56 +10:00
Deltric 8036dcb0c3 couple more packets 2024-06-06 21:23:47 -05:00
apion c6642ec707 More 1.20.5 2024-06-06 22:23:39 -04:00
Paul 5e60446f3c Various packet fixes 8 2024-06-07 12:20:49 +10:00
Deltric fe6be77a30 couple more packets 2024-06-06 21:19:49 -05:00
apion f73b3b22b6 More 1.20.5 2024-06-06 22:15:54 -04:00
Deltric 6e801caa19 couple more packets 2024-06-06 21:14:44 -05:00
Paul bca3903fc7 Various packet fixes 7 2024-06-07 12:14:22 +10:00
Paul e70234e5a9 Merge remote-tracking branch 'origin/1.20.5' into 1.20.5 2024-06-07 12:12:25 +10:00
Paul 88f9094bbe Various packet fixes 6 2024-06-07 12:12:10 +10:00
apion e5dd56d9fa More 1.20.5 2024-06-06 22:09:54 -04:00
Paul 793862e834 Various packet fixes 5 2024-06-07 12:08:26 +10:00
apion 75dd1cc9f9 More 1.20.5 2024-06-06 22:07:48 -04:00
Deltric c90f80c16e couple changes 2024-06-06 21:05:20 -05:00
apion 02fda8ab7c More 1.20.5 2024-06-06 22:03:25 -04:00
Paul df1924f751 Various packet fixes 4 2024-06-07 12:00:44 +10:00
apion 059b8bb251 Merge remote-tracking branch 'origin/1.20.5' into 1.20.5 2024-06-06 21:55:35 -04:00
apion b72be56330 More 1.20.5 2024-06-06 21:55:28 -04:00
Deltric 74db2cddaf updated species imports 2024-06-06 20:55:06 -05:00
Paul 7551c40c2b Various packet fixes 3 2024-06-07 11:53:22 +10:00
Deltric 383f254652 possible component implementation for pokemon item 2024-06-06 20:50:18 -05:00
apion 41f2ec0585 More 1.20.5 2024-06-06 21:48:48 -04:00
Paul addf2332bc Various packet fixes 2 2024-06-07 11:48:14 +10:00
Paul 8ff891749a Various packet fixes 2024-06-07 11:42:34 +10:00
apion 8d3bdf7e4c More 1.20.5 2024-06-06 21:42:04 -04:00
Paul 8018e4079c writeUuid readUuid writePartyPosition readPartyPosition writePCPosition readPartyPosition 2024-06-07 11:35:48 +10:00
apion d9bcd2139a More 1.20.5 2024-06-06 21:31:02 -04:00
Paul 38394794db readText writeText readEntityDimensions 2024-06-07 11:27:43 +10:00
apion bfba3b248f More 1.20.5 2024-06-06 21:24:07 -04:00
Paul c41485c265 writeMap readMap 2024-06-07 11:23:19 +10:00
apion a4273f61e6 More 1.20.5 2024-06-06 21:16:22 -04:00
apion 1c5f2a4533 More 1.20.5 2024-06-06 20:41:23 -04:00
Apion 1e7fa34c44 Merge branch 'no-entity-rendering' into 'sega_bass_pro_fishing_2'
Major refactor of animation system

See merge request cable-mc/cobblemon!1055
2024-06-06 11:22:07 +00:00
HirokuandApion 58e82f1bf6 Major refactor of animation system 2024-06-06 11:22:06 +00:00
Hiroku 13ca5871cb Merge branch 'corals_restoration_tank_bugfix' into 'main'
Fix issue #892

Closes #892

See merge request cable-mc/cobblemon!1064
2024-06-05 21:48:10 +00:00
notepadccino 54ba99a002 Fix issue #892
The #minecraft:corals tag seems to apply to blocks, not to items. For items you'd either need to trace back the tags of whichever block is placed by the item, or just specify the items one by one. I went with the simpler option, but if needed the former solution can always be implemented.
2024-06-05 19:11:08 +02:00
apion bd0618840a More 1.20.5 2024-06-04 00:14:11 -04:00
Myslippy b40f47b00d Update CHANGELOG.md 2024-06-03 03:00:34 +00:00
Hiroku 800d348611 Merge branch 'mushroom_restoration_fabric_fix' into 'main'
Fix #890

Closes #890

See merge request cable-mc/cobblemon!1059
2024-06-03 00:04:49 +00:00
Hiroku d4dd48b3ff Merge branch 'implement_pokemon' into 'main'
5 new cries + bugfix

See merge request cable-mc/cobblemon!1061
2024-06-02 23:31:48 +00:00
Sterrezo 89d6bb2356 Merge branch 'main' into implement_pokemon 2024-06-02 21:48:03 +02:00
notepadccino 3a65425015 Fix mushroom tag issue
the #minecraft:mushrooms tag is a forge thing, it doesn't exist in fabric.
However I've tested out corals as well and they don't work either which is odd, since they should have a #minecraft:corals tag
2024-06-02 18:21:47 +02:00
mia 2454edcaa4 cleanup 2024-06-01 19:30:22 -04:00
mia 9357686f7a fixes #786, adjust offsets 2024-06-01 19:08:35 -04:00
Apion fad10da89f Merge branch 'forcespawn_cmd_fix' into 'main'
Fixes #877

Closes #877

See merge request cable-mc/cobblemon!1056
2024-06-01 15:19:06 +00:00
Slippy 928dfcdadf i hate the crumbling arch 2024-06-01 08:47:58 -05:00
notepadccino 055ce8168c Fixes #877 2024-06-01 15:42:21 +02:00
Plastered_Crab 5e74af8a9e - changes to try to stop instance of casting sound depending on scenario 2024-05-31 20:52:13 -07:00
Hiroku e4da05fd50 we are snapshotting thx 2024-06-01 00:24:30 +00:00
Paul c1d97444ac Merge remote-tracking branch 'origin/main' into sega_bass_pro_fishing_2
# Conflicts:
#	CHANGELOG.md
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonItems.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/spawning/BestSpawner.kt
2024-06-01 09:42:00 +10:00
Paul 3a17a88ea2 Changelog stuff [skip-ci] 2024-06-01 09:38:50 +10:00
Hiroku 09abf30421 Merge branch 'no-middle-stage-ha-fix' into 'main'
Hidden Ability slot for cocoons.

See merge request cable-mc/cobblemon!1020
2024-05-31 23:38:18 +00:00
Hiroku 06ea4b4cec Merge branch 'berry-changes' into 'main'
Berry changes

See merge request cable-mc/cobblemon!1030
2024-05-31 23:35:59 +00:00
Hiroku 8799308800 Merge branch 'Frank's-Coding-Farm' into 'main'
Enabled Seafloor spawns & Disabled spawning in slabs

See merge request cable-mc/cobblemon!1040
2024-05-31 23:35:24 +00:00
Frank The FarmerandHiroku d727fde5b3 Enabled Seafloor spawns & Disabled spawning in slabs 2024-05-31 23:35:24 +00:00
Hiroku ce5e93b552 Merge branch 'main' into 'main'
Fixes #878

Closes #878

See merge request cable-mc/cobblemon!1052
2024-05-31 23:34:39 +00:00
Hiroku 77c0138c09 Merge branch 'get-sticked' into 'main'
Leeks are Sticks (visually)

See merge request cable-mc/cobblemon!1054
2024-05-31 23:34:25 +00:00
Sterrezo 0ded29dcad Added cries to Timburr and Golett lines. Updated the changelog with a recent Cubone sound fix. 2024-05-31 14:06:02 +02:00
Sterrezo 62fae979eb Merge branch 'main' into implement_pokemon 2024-05-31 13:40:42 +02:00
dhi_holo dc727fe56d Leeks are Sticks (visually)
Medicinal and Roasted Leeks now reference a new display setting, making them held like sticks/rods.

That's it, that's the entire change, it's a small parity thing, this is what I like doing, okay.
2024-05-31 10:19:06 +10:00
Plastered_Crab ca8243c13b - added new field to SoundManager mixin to allow for sounds to be stopped and casting sounds get stopped when bobber hits surface or casting is cancelled 2024-05-30 15:38:31 -07:00
Plastered_Crab 0386650acb - adjusted pokerod sounds 2024-05-30 13:17:26 -07:00
Plastered_Crab 44f719ee16 - added in new rod sounds and water sounds 2024-05-29 21:29:56 -07:00
Apion 4db36ef6fa Merge branch 'tmetcalfe89/abstract-shedding' into 'main'
abstracted shedinja logic for datapackability

See merge request cable-mc/cobblemon!1014
2024-05-30 04:02:21 +00:00
Timothy MetcalfeandApion e350d920b5 abstracted shedinja logic for datapackability 2024-05-30 04:02:21 +00:00
Apion 2a0ae1a466 Merge branch 'tumbled-bricks' into 'main'
Tumbled Blocks and Bricks

See merge request cable-mc/cobblemon!1051
2024-05-30 02:58:57 +00:00
dhi_holoandApion 3b8f7f23a3 Tumbled Blocks and Bricks 2024-05-30 02:58:57 +00:00
apion 72cf161f0d Merge branch 'refs/heads/main' into berry-changes
# Conflicts:
#	CHANGELOG.md
2024-05-29 22:24:12 -04:00
apion fe3d8d3185 Changed CHANGELOG.md merge strategy 2024-05-29 22:06:53 -04:00
apion d04ed7a519 Add empty headers to CHANGELOG.md 2024-05-29 21:51:57 -04:00
Apion e6e9137cb5 Merge branch 'AmauraFetusClippingFix' into 'main'
Amaura fetus clipping fix

Closes #873

See merge request cable-mc/cobblemon!1053
2024-05-30 00:49:20 +00:00
Plastered_Crab 1414face03 Merge branch 'main' into sega_bass_pro_fishing_2
# Conflicts:
#	CHANGELOG.md
#	common/src/main/kotlin/com/cobblemon/mod/common/api/moves/animations/ActionEffectTimeline.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/pokemon/stats/Stats.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/particle/ParticleStorm.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/PoseableEntityState.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/JsonPokemonPoseableModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/command/TestCommand.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonEntity.kt
#	gradle.properties
2024-05-28 20:45:48 -07:00
Plastered_Crab b5f131d525 - updated fishing baits, fixed shiny bait effect to use config, and fixed Bobber renderer to not have naughty variables 2024-05-28 15:38:26 -07:00
JazzMcNade 78f25b3f8b Corrected typo in changelog 2024-05-28 17:25:08 -05:00
JazzMcNade 631293e0cd UpdatedChangelog 2024-05-28 17:10:20 -05:00
JazzMcNade 2865b8140a Scaled down Amaura's fetus model to avoid clipping through the tank while animating 2024-05-28 17:07:46 -05:00
notepadccino be34bc4c74 Fixes #878 2024-05-28 19:12:21 +02:00
Sterrezo bae26162dd Update cubone.animation.json 2024-05-28 12:09:35 +02:00
Paul df8f078d13 Fixed Wooloo Dubwool issues and fixed sync issues with Gimmighoul 2024-05-27 15:39:21 +10:00
Paul 309b223da9 Changelog update 4 [skip-ci] 2024-05-27 11:53:03 +10:00
Paul 75f688fa30 Changelog update 3 [skip-ci] 2024-05-27 11:48:22 +10:00
Paul d7fadd58ed Changelog update 2 [skip-ci] 2024-05-27 11:42:56 +10:00
Paul 996c7189b6 Changelog update [skip-ci] 2024-05-27 11:31:38 +10:00
Paul e1d5f07aed Fixed root part animations on JSON posers, clean up changelog, no snapshot, remove bubblebeam effect for now 2024-05-27 11:14:05 +10:00
Paul 6afe77ef0c Fixed confusion particle timing 2024-05-27 10:23:00 +10:00
Hiroku bf54f28b58 Merge branch 'move-effects' into 'main'
A bunch of particles, now with sound!

See merge request cable-mc/cobblemon!1049
2024-05-27 00:08:36 +00:00
Paul aac10e967f Reverted protect change to camera mode 2024-05-27 10:06:39 +10:00
Sterrezo 0cd9da80d7 Update sounds.json 2024-05-27 02:06:27 +02:00
Sterrezo d33f1150d2 Adjusted assets for powder moves, protect, swords dance and thunder wave. Rebalanced volumes of all moves. 2024-05-27 01:39:41 +02:00
Hiroku 216ed85da1 Merge branch 'IllusionThrownPokeballRevealFix' into 'main'
IllusionThrownPokeballRevealFix

See merge request cable-mc/cobblemon!1046
2024-05-26 23:35:07 +00:00
Paul 4b70b20ab7 Fixed using confusion breaking battles lol 2024-05-27 09:26:40 +10:00
Segfault Guy 125e193b81 Broadcast messages with CLIENT species on pokeball hit. 2024-05-26 19:17:16 -04:00
Paul 1ebd249351 Fixed sleeppowder effect, added redundancy to action effects in case they run into an exception 2024-05-27 09:08:22 +10:00
Segfault Guy 74727cda48 Merge branch 'main' into IllusionThrownPokeballRevealFix 2024-05-26 18:47:53 -04:00
Paul 6a8a2489d1 Fixed structure reference to cave_support not working 2024-05-27 08:27:59 +10:00
Paul 3524931596 Fixed dyeable Pokemon not being dyeable away from white unless spawned via command, fixed creative mode players still losing the dye 2024-05-27 07:06:57 +10:00
Paul 43d9347c9c Updated zh and es_es translations 2024-05-27 06:47:56 +10:00
Tyzillion 60303504cd Changelog update. 2024-05-26 11:52:30 -04:00
Tyzillion 63db0066d3 more sounds! 2024-05-26 11:49:50 -04:00
apion 6e0270ac80 Fully moved mulch into block entity 2024-05-26 11:31:21 -04:00
apion 30070d35f6 Fully moved mulch into block entity 2024-05-26 11:23:47 -04:00
apion 8e3435479a Start trying to move mulch into block entity 2024-05-26 09:39:57 -04:00
Tyzillion 333e1fe9ae Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into move-effects 2024-05-26 09:35:42 -04:00
Tyzillion c0c8c103f4 Updated changelog 2024-05-26 09:11:47 -04:00
Tyzillion a414784cca Added sounds to sand attack and the spore mushrooms, implemented confusion cuz I forgot to last night. 2024-05-26 09:10:41 -04:00
Apion b4b01ef0b6 Merge branch 'sound' into 'main'
Updated all generic impact assets

See merge request cable-mc/cobblemon!1048
2024-05-26 12:45:16 +00:00
SterrezoandApion 04f725d72e Updated all generic impact assets 2024-05-26 12:45:16 +00:00
Hiroku 0257f591de Merge branch 'implement_pokemon' into 'main'
Shedinja T Pose & Little guys sliding

See merge request cable-mc/cobblemon!1047
2024-05-26 11:40:35 +00:00
Frank The FarmerandHiroku dfeeed8796 Shedinja T Pose & Little guys sliding 2024-05-26 11:40:35 +00:00
Paul 0e304a81e8 Changelog, deleted unneeded caves template pool, licenses 2024-05-26 21:33:57 +10:00
Hiroku 03acc21af1 Merge branch 'move-effects' into 'main'
Implemented Action Effects

Closes #814, #773, #840, and #841

See merge request cable-mc/cobblemon!1045
2024-05-26 11:31:20 +00:00
Hiroku 2233e6903b Merge branch '1.5-structure-fixes' into 'main'
added loot to the trapped chest in unstable caves so you can't tell which one...

See merge request cable-mc/cobblemon!1042
2024-05-26 11:25:36 +00:00
Hiroku ac281faa3b Merge branch 'main' into 'move-effects'
# Conflicts:
#   CHANGELOG.md
2024-05-26 11:07:24 +00:00
FrankTheFarmer ad7a881fdc Changelog 2024-05-26 20:20:36 +10:00
FrankTheFarmer f9a2b5cc9c Fixed Budew and Lechonk sliding if they walked for too long 2024-05-26 20:17:47 +10:00
FrankTheFarmer e2cc006c7c Fixed Shedinja T posing in battle 2024-05-26 20:17:20 +10:00
FrankTheFarmer 13240d28ea Merge branch 'main' into implement_pokemon 2024-05-26 20:00:04 +10:00
JazzMcNade 6891272516 Throwing a ball at a player owned pokemon no longer reveals Illusion 2024-05-26 03:02:49 -05:00
Hiroku eba784071a Merge branch 'Primary-Quirks-for-JSON' into 'main'
Primary quirks for json

See merge request cable-mc/cobblemon!1044
2024-05-26 04:10:33 +00:00
Hiroku a4435af9c0 Merge branch 'GildedChestLockAnimFix' into 'main'
GildedChestLockAnimFix

Closes #811

See merge request cable-mc/cobblemon!1043
2024-05-26 04:08:22 +00:00
JazzMcNade 4b0b0f813e Merge branch 'main' into GildedChestLockAnimFix 2024-05-25 22:59:01 -05:00
JazzMcNade c32da0825c Updated Changelog 2024-05-25 22:47:39 -05:00
Tyzillion 803703b6a6 Updated changelog 2024-05-25 23:43:50 -04:00
Tyzillion 668914275e Added sounds to all the powder attacks. Tweaks and fixes. 2024-05-25 23:42:02 -04:00
FrankTheFarmer af90ff6733 Added excludedLabels 2024-05-26 13:07:16 +10:00
FrankTheFarmer c657c2ea68 CHANGELOG with example. 2024-05-26 11:27:58 +10:00
FrankTheFarmer 2f567830d4 Temporary function for bedrock quirks intended for 1.5.1 2024-05-26 11:07:14 +10:00
Tyzillion 569f3c624e Implemented Cotton guard. 2024-05-25 20:38:31 -04:00
Tyzillion f30be418f9 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into move-effects
# Conflicts:
#	CHANGELOG.md
2024-05-25 20:38:13 -04:00
Tyzillion 2c50dc2d0c Implemented Ember, Powder moves, and updated other particles. Implemented Infatuation 2024-05-25 20:34:07 -04:00
Hiroku dde2e9f52a Merge branch 'fix/form-sync' into 'main'
Form Sync on Form Change Fix

See merge request cable-mc/cobblemon!1041
2024-05-26 00:02:40 +00:00
NickandHiroku 50a21d91e8 Form Sync on Form Change Fix 2024-05-26 00:02:40 +00:00
Tyzillion 58f3de13fa Implemented Ember, Powder moves, and updated other particles. 2024-05-25 13:55:44 -04:00
Tyzillion 8d67a3a909 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into move-effects
# Conflicts:
#	CHANGELOG.md
2024-05-25 10:54:51 -04:00
JazzMcNade ad4cb8a290 Gilded Chest no longer animates to the open state on the client when the client fails to open a locked chest 2024-05-24 21:30:54 -05:00
Hiroku d9e5de5f97 Fixed pluralize usage for pose conditions 2024-05-24 22:35:48 +00:00
Hiroku e4a47af06d Merge branch 'sendout-bug' into 'main'
Fixed tiny bug, fixes #867

Closes #867

See merge request cable-mc/cobblemon!1037
2024-05-24 22:03:50 +00:00
Apion cc741c0478 Merge branch 'remulched' into 'main'
Cheap Mulch!

See merge request cable-mc/cobblemon!1039
2024-05-24 12:28:03 +00:00
dhi_holo 6887887d6b Cheap Mulch!
Made Mulch cheaper, as outlined by #866
2024-05-24 20:28:45 +10:00
Hiroku cf1100a20e Merge branch 'implement_pokemon' into 'main'
Wailord, Seedot line, and apostrophes in the changelog

See merge request cable-mc/cobblemon!1038
2024-05-24 09:46:27 +00:00
Frank The FarmerandHiroku ebc7b97e4f Wailord, Seedot line, and apostrophes in the changelog 2024-05-24 09:46:26 +00:00
FrankTheFarmer 5324b7b19e Merge branch 'main' into implement_pokemon
# Conflicts:
#	CHANGELOG.md
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen3/WailordModel.kt
2024-05-24 19:37:33 +10:00
FrankTheFarmer 5bddc31cbf Seedot line hitbox fixes 2024-05-24 19:30:11 +10:00
apion d65ce9222a Fixed tiny bug, fixes #867 2024-05-24 05:04:36 -04:00
FrankTheFarmer 72bc2221af Actually stopped Wailord in the chatbox for real this time 2024-05-24 18:56:27 +10:00
Apion 706221aead Merge branch 'LangFixes' into 'main'
A Couple of Lang Fixes

See merge request cable-mc/cobblemon!1035
2024-05-24 08:15:24 +00:00
Apion 26bfca893b Merge branch 'main' into 'LangFixes'
# Conflicts:
#   CHANGELOG.md
2024-05-24 07:01:46 +00:00
JazzMcNade 5f65f3c20c Updated Changelog 2024-05-24 01:47:23 -05:00
JazzMcNade 1e5239da10 Added English language keys for Rough Skin and Iron Barbs 2024-05-24 01:26:30 -05:00
JazzMcNade 7d8ec3470b Fix for Hyper Cutter / Big Pecks incorrectly stating they prevented accuracy from being lowered 2024-05-24 01:25:58 -05:00
Apion 389d2a0adc Merge branch '1.5-fixes-112313' into 'main'
1.5 fixes 112313

See merge request cable-mc/cobblemon!1034
2024-05-24 04:45:10 +00:00
apion 37433aa0c5 CHANGELOG.md 2024-05-24 00:34:04 -04:00
Paul 7fa0022095 Fixed species sync failing when madmen give pokemon more than 255 level up moves on the same level 2024-05-24 14:21:03 +10:00
Paul 9fde7a7618 Merge remote-tracking branch 'origin/main' into 1.5-fixes-112313 2024-05-24 14:18:04 +10:00
Paul 6c1f7ddd70 Putted the AttackDefenceRatioRequirement back for backcompat 2024-05-24 14:15:45 +10:00
apion 1a1cedb3aa Regenned berry data, added bone meal chance 2024-05-23 23:53:42 -04:00
Hiroku 241b83cec9 Merge branch 'implement_pokemon' into 'main'
Implementation Stuff

See merge request cable-mc/cobblemon!1027
2024-05-23 21:57:39 +00:00
Frank The FarmerandHiroku f0feb81a16 Implementation Stuff 2024-05-23 21:57:38 +00:00
apion b82287f258 Vera berry changes 2024-05-23 09:02:24 -04:00
FrankTheFarmer 9099cb4b5d Merge branch 'main' into implement_pokemon 2024-05-23 22:37:47 +10:00
FrankTheFarmer 99e0b7d995 Smeargle Mentioned 2024-05-23 22:34:58 +10:00
Hiroku 00f4052b75 Merge branch 'MoreFossilMachineFixes' into 'main'
Many Fossil Machine Fixes

See merge request cable-mc/cobblemon!1033
2024-05-23 11:02:07 +00:00
Hiroku 407c24b7c5 Merge branch 'asset-updates' into 'main'
Updated wooloo/dubwool textures and passho berry stuff

Closes #854

See merge request cable-mc/cobblemon!1031
2024-05-23 10:56:56 +00:00
FrankTheFarmer 372f44538b Smeagol 2024-05-23 15:47:13 +10:00
JazzMcNade c8904c3e38 Removed commented code, updated changelog 2024-05-23 00:24:22 -05:00
JazzMcNade 6bfc711129 Update FossilMultiblockStructure.kt 2024-05-22 23:25:46 -05:00
JazzMcNade 3d914f47ee Merge branch 'main' into MoreFossilMachineFixes 2024-05-22 23:25:26 -05:00
JazzMcNade 61891d8fe4 Refactored blockState check to for the blockstate property (credit to Charzard4261) , fixed typo 2024-05-22 21:26:49 -05:00
FrankTheFarmer 0bec3ac851 Merge branch 'main' into implement_pokemon 2024-05-23 07:21:49 +10:00
apion 1b66ee8ce3 Updated wooloo/dubwool textures and passho berry stuff 2024-05-22 03:57:34 -04:00
apion c884c556cb Remove binding soil 2024-05-22 03:37:04 -04:00
Apion 5e6091c782 Merge branch 'tmetcalfe89/revive-event' into 'main'
added fossil revived event

See merge request cable-mc/cobblemon!1029
2024-05-22 07:26:52 +00:00
Timothy MetcalfeandApion 5a2e5479e0 added fossil revived event 2024-05-22 07:26:52 +00:00
apion 9a8b481fa2 Changed berry grow timers per Vera request 2024-05-22 03:26:09 -04:00
apion e2fb31fad3 Merge branch 'refs/heads/main' into berry-changes 2024-05-22 02:39:51 -04:00
Tyzillion fc03682140 Implemented quick attack 2024-05-21 22:30:41 -04:00
JazzMcNade 07fbffaa71 Fixed refactor mistake in previous commit. 2024-05-21 20:45:54 -05:00
FrankTheFarmer 17b8dd3532 Wailord will now stop forcing its head into the chatbox 2024-05-22 09:53:31 +10:00
Tyzillion 5e2f5dadb4 Fixed some errors I ran into. 2024-05-21 19:36:11 -04:00
FrankTheFarmer 4cf8a19d43 Tyrantrum will now stop forcing its head into the chatbox 2024-05-22 09:34:12 +10:00
Tyzillion fc682d1cd1 Implemented action effects for Sand Attack, Protect, Minimize, and Swords Dance. 2024-05-21 19:13:06 -04:00
Tyzillion 7759c91f3b Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into move-effects
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/api/pokemon/evolution/Evolution.kt
2024-05-21 19:11:04 -04:00
JazzMcNade c13654f60c FossilMultiblockStructure no longer stores a created pokemon, instead the pokemon is created when the pokemon is retrieved from the machine 2024-05-21 02:36:39 -05:00
Plastered_Crab edf6acb5dd - changed things for raft spawning for water surface battles for testing 2024-05-20 21:54:59 -07:00
JazzMcNade 289e9df52b Fixed Restoration Tank over consuming items when interacting with Create blocks 2024-05-20 21:23:13 -05:00
Plastered_Crab a73673b55a - Test for sending mons out on rafts 2024-05-20 18:05:34 -07:00
FrankTheFarmer f205e7f29e CHANGELOG 2024-05-21 10:18:44 +10:00
FrankTheFarmer cec031595f Merge branch 'main' into implement_pokemon 2024-05-21 10:14:21 +10:00
FrankTheFarmer af007dad17 Added missing Chingling and Chimecho spawns near bells 2024-05-21 09:54:39 +10:00
Tyzillion 5dca5a1579 Merge remote-tracking branch 'origin/move-effects' into move-effects 2024-05-20 15:57:38 -04:00
Plastered_Crab 92a2b52b46 Merge remote-tracking branch 'origin/sega_bass_pro_fishing_2' into sega_bass_pro_fishing_2 2024-05-20 08:52:12 -07:00
Plastered_Crab e6ca128498 - isSlimeChunnk is a SpawningCondition now 2024-05-20 08:51:54 -07:00
JazzMcNade 3ebad9dc9d Fixed a Create crash when a chute attempts to access the inventory of the top half of the Restoration Tank when the bottom half has been destoryed 2024-05-19 21:27:03 -05:00
apion c93fa02616 Fixed dispatch timeline 2024-05-19 21:13:58 -04:00
Hiroku 4e1b82917b Merge branch 'Roaming-Gholdengo-Request' into 'main'
Lets Gholdengo maintain its roaming aspect

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

See merge request cable-mc/cobblemon!1026
2024-05-20 00:11:02 +00:00
FrankTheFarmer 8490f3a923 Fixed Cyndaquil's flame clipping when it wasn't ignited 2024-05-20 08:17:02 +10:00
FrankTheFarmer 9bf6200163 Merge branch 'main' into implement_pokemon 2024-05-20 08:11:19 +10:00
apion 5897fff954 Added boost/unboost general particles, removed the particle from growl 2024-05-19 18:05:11 -04:00
apion 2fd2137d78 Added poison (this particle is BROKEN) 2024-05-19 17:22:09 -04:00
apion 42c4d6625e Added poison (this particle is BROKEN) 2024-05-19 17:21:52 -04:00
apion b0381d1685 We do a little refactoring 2024-05-19 16:23:41 -04:00
David Sadler 5ad7d5406a Change dimension spawn condition to check with IDs not effects 2024-05-19 18:45:34 +01:00
apionandPaul 21ccfb8202 Added q.entity support to particle effects that are attached to entities 2024-05-19 17:19:34 +10:00
apion 3b00043b13 Got confusion kinda working, needs tweaks 2024-05-19 02:44:05 -04:00
JazzMcNade 2b403df6ef Removed client side mutations in FossilMultiblockStructure's onUse and enabled the client to enter the function 2024-05-19 01:37:04 -05:00
apion f0d5622bab Added volatile status stuff 2024-05-19 02:20:12 -04:00
apion ec28ca0c45 Added action effect for paralysis + action effect triggers for the cant command 2024-05-19 01:11:41 -04:00
Tyzillion 0d68eedc74 Merge remote-tracking branch 'origin/move-effects' into move-effects 2024-05-18 22:24:56 -04:00
Paul 6ec008ee83 Merge remote-tracking branch 'origin/main' into 1.5-fixy
# Conflicts:
#	CHANGELOG.md
2024-05-19 11:19:13 +10:00
Hiroku f81e8ba766 Merge branch 'npcs' into 'sega_bass_pro_fishing_2'
NPC foundationwork that's not implemented but I need the tech for reasons

See merge request cable-mc/cobblemon!1024
2024-05-19 00:31:46 +00:00
Paul c969e1731b Merge remote-tracking branch 'origin/move-effects' into move-effects 2024-05-19 09:13:29 +10:00
Paul bb77c6d4a9 Fixed particle velocity not respecting drag as much as it should oops sorry 2024-05-19 09:13:17 +10:00
Tyzillion 5dfc90c0bd Merge remote-tracking branch 'origin/move-effects' into move-effects 2024-05-18 18:52:14 -04:00
apion 26a72fe6a9 I hope this works (pt. 2) 2024-05-18 18:46:58 -04:00
apion 4bb9547822 I hope this works 2024-05-18 17:08:09 -04:00
Tyzillion ffe88d75b5 Merge remote-tracking branch 'origin/move-effects' into move-effects 2024-05-18 16:08:32 -04:00
apion d8980fabbe Fix entity_scale var 2024-05-18 14:56:47 -04:00
apion 7598413e93 Merge branch 'refs/heads/particle-rave' into move-effects 2024-05-18 13:55:24 -04:00
apion b0cc4714fc Merge branch 'refs/heads/main' into move-effects
# Conflicts:
#	CHANGELOG.md
2024-05-18 13:53:45 -04:00
JazzMcNade 5aa3f34880 Added block type checks before attempting to update the blockstate from the fossilmultiblockstructure 2024-05-18 12:15:50 -05:00
Slippy 21363405fc console log spam fix for real this time 2024-05-18 12:00:11 -05:00
JazzMcNade 340be0b2a1 Fixed an issue where the lights on the restoration tank would not animate if it was facing east 2024-05-18 11:57:16 -05:00
JazzMcNade 933e29b134 Fix for TankEntityRenderer desync 2024-05-18 11:52:54 -05:00
Tyzillion 41b27e5d75 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into move-effects
# Conflicts:
#	CHANGELOG.md
2024-05-18 10:55:29 -04:00
Tyzillion e80bf0e331 Merge remote-tracking branch 'origin/move-effects' into move-effects 2024-05-18 10:54:32 -04:00
Hiroku f4d2226ec2 Merge branch '1.5.1' into 'main'
Moar 🐛🔫

Closes #847 and #799

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

Closes #824

See merge request cable-mc/cobblemon!1021
2024-05-18 01:40:13 +00:00
ApionandHiroku 86db95a7dc Make wooloos dyable 2024-05-18 01:40:13 +00:00
apion be95b79e4d Removed unnecessary override 2024-05-17 21:20:20 -04:00
Paul 683aa354ed Fixed particle event triggers spawning particles on the emitter, fixes #814 2024-05-18 11:10:48 +10:00
apion aa19ff2c95 Added entity scale as a particle param 2024-05-17 20:57:10 -04:00
Paul 7d5e790f75 Fixed particle rotations being inverted 2024-05-18 10:55:28 +10:00
apion 5753443ab2 Optimized a player lookup 2024-05-17 20:39:27 -04:00
apion c6b7186032 Merge branch 'refs/heads/main' into 1.5.1
# Conflicts:
#	CHANGELOG.md
2024-05-17 20:35:50 -04:00
apion 32f3be2687 Changelog 2024-05-17 20:33:24 -04:00
apion 9012d78806 Apparently Kotlin uses .equals when using ==, === is Java == behavior 2024-05-17 20:30:18 -04:00
apion fffdfb7654 Fixes bug with InvMove, closes #847 2024-05-17 20:28:57 -04:00
Tyzillion 76f17c9760 Merge remote-tracking branch 'origin/move-effects' into move-effects 2024-05-17 18:33:17 -04:00
Hiroku b314733f0b Merge branch 'Frank's-Bug-Fixing-Farm' into 'main'
Frank's bug fixing farm

See merge request cable-mc/cobblemon!1019
2024-05-17 10:44:01 +00:00
Frank The FarmerandHiroku d5aa07fe91 Frank's bug fixing farm 2024-05-17 10:44:00 +00:00
Paul 3b0d2cd980 Added parametric particle support (motion and rotation), closes #773 2024-05-17 16:43:35 +10:00
Ludichat 7e43a7424e Updated CHANGELOG.md. 2024-05-17 08:26:51 +02:00
apion 27bedc2d2c Closes #799 2024-05-16 21:59:36 -04:00
Hiroku 86744c23a5 Merge branch '1.5.1' into 'main'
Fix recoil evo bug

Closes #844

See merge request cable-mc/cobblemon!1022
2024-05-17 01:41:41 +00:00
Tyzillion f5a3c93039 Merge remote-tracking branch 'origin/move-effects' into move-effects 2024-05-16 21:35:16 -04:00
Paul 00dc501df7 Fixed timed particle ages being a tick too long, fixes #840 2024-05-17 11:28:49 +10:00
apion 8d1a64136f Fix recoil evo bug 2024-05-16 20:33:19 -04:00
Paul 39fee0bcea Fixed particle effects generated from molang not having access to entity_radius and stuff. Fixes #841 2024-05-17 10:26:18 +10:00
Tyzillion 1162689172 Merge remote-tracking branch 'origin/move-effects' into move-effects 2024-05-16 20:08:03 -04:00
Paul bc550dd32c Fixed unlocked evolutions getting re-checked and eating held items, fixes #843 2024-05-17 10:04:54 +10:00
Paul b295644070 Cleaned imports 2024-05-17 09:37:29 +10:00
Paul 21df0085e2 Merge remote-tracking branch 'origin/main' into move-effects 2024-05-17 09:08:19 +10:00
Paul 3009af8c42 Fixed missing cant.nopp lang key, fixes #842 2024-05-17 08:52:23 +10:00
Hiroku bfd34eb621 Merge branch '1.5.1' into 'main'
Fixes a few issues

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

See merge request cable-mc/cobblemon!1012
2024-05-16 22:46:10 +00:00
Hiroku 2dc2c96176 Update CHANGELOG.md [skip-ci] 2024-05-16 22:44:00 +00:00
Hiroku df4db17cfd Removed println 2024-05-16 22:40:56 +00:00
Plastered_Crab 2f3ae9bc5e - correct particles now play at certain events when fishing 2024-05-16 15:37:11 -07:00
apion ccbe33bfe5 Fixed missing texture on fishing particle 2024-05-16 17:55:23 -04:00
apion 0989c90eb3 Fixed server sync issue on rod registry 2024-05-16 17:11:32 -04:00
apion ddcd0ffd37 Merge branch 'refs/heads/main' into sega_bass_pro_fishing_2
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonSounds.kt
2024-05-16 16:57:47 -04:00
Plastered_Crab 1f5d15e59d - rods now use NBT to store baits on them 2024-05-16 13:21:32 -07:00
Ludichat b718daf0f1 Gives a Hidden Ability slot to middle stage evolution and Ferroseed with a single ability. 2024-05-16 21:49:34 +02:00
Slippy 08c4f4a0ff added loot to the trapped chest in unstable caves so you can't tell which one is trapped if you're using lootr muwahahahaha 2024-05-16 01:57:41 -05:00
Plastered_Crab a3ff4b6b81 - more particle work and dynamic tooltip parsing 2024-05-15 22:22:46 -07:00
Slippy c4a1704a8b unstable cave loot table fixes 2024-05-15 20:35:24 -05:00
apion 45bec488f1 Fixed bug with pasture block 2024-05-15 20:41:32 -04:00
apion 9287374504 Merge branch 'refs/heads/main' into 1.5.1 2024-05-15 18:24:56 -04:00
apion 90c5180712 Revert "update Forge to current RB, update Fabric deps to latest"
This reverts commit 7139d4708b.
2024-05-15 18:17:29 -04:00
Tyzillion 51af37b37a Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into move-effects 2024-05-15 18:09:53 -04:00
Plastered_Crab d2c084e4af - more setup for the dynamic tooltips 2024-05-15 12:37:52 -07:00
Plastered_Crab 98eda52866 - adjustments to fishing particles 2024-05-15 12:13:07 -07:00
apion f2a36cd74a Merge branch 'refs/heads/main' into 1.5.1
# Conflicts:
#	CHANGELOG.md
2024-05-15 14:51:45 -04:00
Plastered_Crab c9d3cbd848 - initial steps for dynamic tooltips for pokerods + test particles 2024-05-15 10:34:22 -07:00
Nick 158aa05f24 Merge branch 'fix/downgrade-loom' into 'main'
fix: resolve mapping issues by downgrading loom

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

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

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

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

See merge request cable-mc/cobblemon!1011
2024-05-14 20:15:13 +00:00
Plastered_Crab b7ba3f62f7 - Made all berries work as bait as well as their effects
- Reworked IV bait logic to allow for stacking effects
- Fixed Glow Berries and Sweet Berries to work as bait
2024-05-14 12:35:43 -07:00
tmetcalfe89 eb80c20dbf updated readme 2024-05-14 09:11:16 -07:00
apion 7ab3951613 Fix gilded chest item drops 2024-05-14 11:16:33 -04:00
apion e6d51c4d56 A little more fossil machine clean up 2024-05-14 10:26:25 -04:00
Apion 3813ec3c92 Merge branch 'sound' into 'main'
Renamed Relic Coin Sack sound assets. Added new sounds for Relic Coin Pouches.

See merge request cable-mc/cobblemon!1013
2024-05-14 14:12:24 +00:00
apion b9364304ca Changelog teehee 2024-05-14 09:47:35 -04:00
Sterrezo 9be212d2b8 Renamed Relic Coin Sack sound assets. Added new sounds for Relic Coin Pouches.
Renamed all sounds called "coin_pouch..." to "relic_coin_sack..." Added new sounds for breaking and placing Relic Coin Pouches with a new sound group for them.
2024-05-14 13:27:11 +02:00
tmetcalfe89 2559257b3a added licenses 2024-05-14 01:16:30 -07:00
apion 8236c6fb11 Merge branch 'refs/heads/main' into 1.5.1 2024-05-14 04:13:40 -04:00
apion 2041d43db4 Hopefully fixed some other bugs 2024-05-14 03:53:35 -04:00
Apion a1687e8304 Merge branch 'tmetcalfe89/ensure-defeat-count' into 'main'
Ensure update total defeat count on battle win

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

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

Closes #834

See merge request cable-mc/cobblemon!1009
2024-05-13 09:45:38 +00:00
dhi_holo b19c5ed125 Updated fossils.json Item Tag
Sorted the fossils tag to match the order on Bulbapedia (just to make sure all other fossils were there, and because it looks a little nicer), and added Fossilized Drake to the tag
2024-05-13 17:51:19 +10:00
Paul c1b5e58f8a Added Lure Ball functionality, improved spawning API's use of causes, added forcedAspects to Pokemon, added aspect/unaspect in PokemonProperties 2024-05-13 17:42:36 +10:00
Paul b1904ab3fd Sega Bas Pro Fishing 2™ is the 1.6.0 branch 2024-05-13 15:19:23 +10:00
Paul 949925ca9f Merge remote-tracking branch 'origin/main' into sega_bass_pro_fishing_2 2024-05-13 15:17:19 +10:00
Paul e3cca0d9cf SpawnAction#complete returns R instead of Boolean 2024-05-13 15:08:55 +10:00
tmetcalfe89 1aa55f8199 replaced entity ref with originalPokemon 2024-05-12 21:49:58 -07:00
Paul 4c16b2ce2e Track friendship on client entities, tweaks to dataTracker initializing, MoLang in pose & quirk conditions 2024-05-13 12:47:53 +10:00
Slippy 969d6ac7fc console spam fix 2024-05-12 09:23:39 -05:00
Slippy 46bb9e1aec console fix 2024-05-11 21:58:50 -05:00
Slippy 9792ff3392 console spam fix 2024-05-11 21:36:29 -05:00
Paul 7ebe0551e1 Fixed build issue caused by unnecessary AW 2024-05-11 18:54:29 +10:00
Paul 6e1d4e0c4d Merge remote-tracking branch 'origin/main' into sega_bass_pro_fishing_2 2024-05-11 18:32:10 +10:00
FrankTheFarmer 4482a4f072 Forgot to add Mismagius to model updates 2024-05-09 10:00:05 +10:00
FrankTheFarmer a92f37c740 Added Krabby's missing temporary-cry animation 2024-05-09 09:57:26 +10:00
FrankTheFarmer 4677dda922 Limited Mismagius' yaw range to prevent some clipping 2024-05-09 09:56:29 +10:00
FrankTheFarmer 81f7320e4a Mismagius asset updates 2024-05-09 09:56:01 +10:00
FrankTheFarmer 3c9cf42da4 Fixed Flabebe's broken species name. Apparently its Flabébé and not Flabébé??? 2024-05-06 08:39:34 +10:00
FrankTheFarmer 620ed73fe9 Fixed Klefki t pose when sleeping 2024-05-06 08:38:23 +10:00
Tyzillion 978d9e76a1 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into move-effects 2024-05-04 17:48:57 -04:00
FrankTheFarmer 7d09b7e2fe Fixed a broken texture on Elgyem 2024-05-04 18:48:08 +10:00
FrankTheFarmer 656cff2ab3 Made Galarian Zigzagoon use Hoenn Zigzagoon's shoulder animation 2024-05-04 18:16:59 +10:00
Tyzillion 1d8462fd63 Implemented better Krabby bubble blowing quirk animation. 2024-05-03 18:34:23 -04:00
Tyzillion e417db6a8d Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2024-05-03 16:39:08 -04:00
MoeBoy76 a0b263e392 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon 2024-05-03 10:45:11 +10:00
MoeBoy76 16d0d3b7e1 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon
# Conflicts:
#	CHANGELOG.md
#	common/src/main/resources/data/cobblemon/species/generation1/exeggcute.json
#	common/src/main/resources/data/cobblemon/species/generation1/pikachu.json
#	common/src/main/resources/data/cobblemon/species/generation2/cyndaquil.json
#	common/src/main/resources/data/cobblemon/species/generation2/quilava.json
#	common/src/main/resources/data/cobblemon/species/generation5/dewott.json
#	common/src/main/resources/data/cobblemon/species/generation5/oshawott.json
#	common/src/main/resources/data/cobblemon/species/generation7/dartrix.json
#	common/src/main/resources/data/cobblemon/species/generation7/rowlet.json
2024-05-02 15:49:13 +10:00
MoeBoy76 dbedc58dd9 changelog conflict fix [skip-ci] 2024-05-02 15:43:54 +10:00
FrankTheFarmer c0ea565967 Updated Changelog with recent changes 2024-05-02 14:26:10 +10:00
FrankTheFarmer 7e92f5f314 Updated Spewpa evolution and Vivillon spawn biome tags 2024-05-02 14:25:21 +10:00
FrankTheFarmer df3ed93032 Added anticondition structure requirements to evolutions 2024-05-02 14:24:45 +10:00
FrankTheFarmer 2335fd388e Updated and added time ranges 2024-05-02 14:22:26 +10:00
FrankTheFarmer e152cc9fd0 Updated Changelog with recent work 2024-05-01 21:31:00 +10:00
FrankTheFarmer 3f7e2bef40 Updated Spewpa evolutions and made sure they work. I hate evolution™ 2024-05-01 21:30:16 +10:00
FrankTheFarmer 25927c6ebe Updated Vivillon biome tags to new format and added 2 more 2024-05-01 21:28:40 +10:00
FrankTheFarmer 2f18d6b05f Created new folder for all regional evolution biome tags and moved region bias ones there 2024-05-01 20:34:48 +10:00
FrankTheFarmer 2600e23233 Removed sliggoos cross region evolutions 2024-05-01 20:33:26 +10:00
FrankTheFarmer 5c5c72d800 Updated Goomy to use new evolution biome tags for evolution 2024-05-01 20:32:15 +10:00
FrankTheFarmer 2c812344f9 Updated Petilil evo biomes and added priority evos to save a sun stone hopefully 2024-05-01 20:24:33 +10:00
FrankTheFarmer 37b4577230 Updated Hisui Starter evos to use the updated evolution biome tags 2024-05-01 19:50:51 +10:00
FrankTheFarmer fcf64b00bf Updated Pikachu and Exeggcute evolutions to prioritize cross region evos if applicable 2024-05-01 19:40:48 +10:00
FrankTheFarmer 02b8cd81a0 Updated Conkeldurr with the correct animation files 2024-04-30 21:38:54 +10:00
FrankTheFarmer def1b44f08 Fixed Conkeldurr holding too much concrete during sleep animation 2024-04-30 17:02:01 +10:00
FrankTheFarmer b28f915af9 Selected Hisui starters will now come in ancient poke balls 2024-04-30 15:07:59 +10:00
FrankTheFarmer 29ce8b584a Stopped the zoroarks cry animations from looping 2024-04-29 19:22:18 +10:00
FrankTheFarmer 84f3a44109 Found Sudowoodo and Bonsly. Hiding since July 2023 2024-04-29 15:35:20 +10:00
FrankTheFarmer 08a58eee8a Prevented and preserved Cubone's evolution to Alolan Marowak 2024-04-29 08:55:05 +10:00
Tyzillion 1e067cb7e4 Implemented simple elemental punches. Implemented sweetscent effects, and stat increase and decrease particles. 2024-04-27 22:00:56 -04:00
FrankTheFarmer c10f48090c Added dried kelp blocks, melon, vines, and sea pickles to list of organic materials for the fossil machine 2024-04-28 11:07:16 +10:00
Paul 7aef56c610 license 2024-04-27 14:28:30 +10:00
Paul 27e1a34097 Merge remote-tracking branch 'origin/main' into sega_bass_pro_fishing_2
# Conflicts:
#	common/src/main/resources/assets/cobblemon/textures/item/poke_balls/beast_ball.png
2024-04-27 12:43:42 +10:00
Tyzillion 2f464f82b1 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into move-effects 2024-04-26 21:01:38 -04:00
apion f1463f92e6 More conflict resolution (SOB) 2024-04-26 13:46:06 -04:00
FrankTheFarmer 9c0e5e487a Reverted Snorlax's resize 2024-04-26 20:57:20 +10:00
FrankTheFarmer 95f2bbbf15 If for some reason you are above an Aurorus, it will no longer break its neck trying to look at you. 2024-04-26 20:37:53 +10:00
FrankTheFarmer 864d184cd9 Scaled drifloon down a bit 2024-04-26 17:53:56 +10:00
FrankTheFarmer a2256f6208 Lurantis animation file update 2024-04-26 16:44:14 +10:00
FrankTheFarmer 945d556b43 Fixed Cubone holding its bone humerusly 2024-04-26 16:18:14 +10:00
FrankTheFarmer f0def2e883 Fixed zubat's shoulder animations 2024-04-26 13:42:21 +10:00
FrankTheFarmer 79c644dad0 So the 10 and 11 bug can be fixed with underscores 👀 2024-04-26 13:37:39 +10:00
Tyzillion 28c0e17a48 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into move-effects 2024-04-25 18:21:18 -04:00
apion 0303db5fff A bunch more 1.20.5 2024-04-25 17:30:09 -04:00
apion 105840a334 A bunch more 1.20.5 (mostly codec stuff) 2024-04-25 17:10:07 -04:00
apion 335fbfd3e0 Fixed a lot of the codecs for advancements 2024-04-25 15:31:55 -04:00
apion dfe30a91b6 Mitigated all errors in the neoforge module (god forgive me for some of the things I've done) and renamed most stuff from forge to neoforge 2024-04-25 15:00:50 -04:00
apion e0f62b5eb9 Updated a bunch of dependencies. Swapped from Forge to NeoForge (Forge is not yet on 1.20.5, might get added back later) Got to a point where we can reload the project in IntelliJ 2024-04-25 12:32:49 -04:00
apion 63edd09f3f Update to Gradle 8.6 and Loom 1.6 2024-04-25 11:01:50 -04:00
apion 1fde1e4428 Merged main into 1.20.4 2024-04-25 10:18:17 -04:00
apion a2d574300c Merge branch 'main' into 1.20.4
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/block/TumblestoneBlock.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/block/chest/GildedChestBlock.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/block/entity/GildedChestBlockEntity.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/gui/summary/Summary.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonEntity.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/pokemon/Pokemon.kt
#	forge/src/main/java/com/cobblemon/mod/forge/mixin/LootManagerMixin.java
#	gradle/libs.versions.yml
2024-04-25 08:31:40 -04:00
FrankTheFarmer 87e41bdb89 Fixed Kabuto animation but on implementation branch 2024-04-25 22:22:18 +10:00
FrankTheFarmer 8a8505d816 3/4 of the Galar fossils can now look at the player. 2024-04-25 21:04:04 +10:00
FrankTheFarmer 1a19c51748 Fixed Slowpoke spawning everywhere 2024-04-25 17:16:37 +10:00
FrankTheFarmer 8a66ab9235 Removed unimplemented cries from sounds json 2024-04-25 16:41:11 +10:00
Paul ee50361555 Merge remote-tracking branch 'origin/main' into implement_pokemon
# Conflicts:
#	CHANGELOG.md
2024-04-25 11:47:23 +10:00
Paul d3631f1436 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2024-04-25 10:28:21 +10:00
Paul 31136435fe Fixed autogeneration of target and special_attack locators 2024-04-25 10:20:19 +10:00
Paul bdeb83c62c Fixed entity_particles parsing of the effect ID when it's a simple string 2024-04-25 10:20:01 +10:00
FrankTheFarmer 79e1f9143c Fixed Wooloo's blink and leg but in game 2024-04-25 10:07:09 +10:00
Paul 15bf726421 Merge remote-tracking branch 'origin/main' into move-effects 2024-04-24 15:13:23 +10:00
DoctorWafflePhD 7f1889db7b bubblebeam VFX uploaded for review by hiroku (thanks oomfie) 2024-04-23 21:42:16 -05:00
DoctorWafflePhD 548c18bea4 hit particle fix(?) 2024-04-23 21:41:46 -05:00
DoctorWafflePhD d9203bef2a hit particle fix(?) 2024-04-23 21:06:57 -05:00
FrankTheFarmer bef0b2fb87 Updated regional bias evolution data to hopefully work as intended. I hate evolution. 2024-04-23 20:49:22 +10:00
FrankTheFarmer d7bbc05af8 Created biome tags for the regional bias evolutions. They're specific to each form's spawn data 2024-04-23 20:47:27 +10:00
FrankTheFarmer 7ca3ab5e30 Updated portrait data for the Samurotts 2024-04-23 20:43:44 +10:00
FrankTheFarmer 1bbb1201c8 Chansey animation fixes. Cry implemented but no sound file yet 2024-04-23 18:20:26 +10:00
FrankTheFarmer 8ed4fee8af Added more visual distinction for Hisui Bias Quilava in the evolution menu. Plus Cyndaquil textures 2024-04-23 17:18:07 +10:00
FrankTheFarmer a3dacc2c3d Forgot about the changelog lol 2024-04-22 20:50:03 +10:00
FrankTheFarmer c265f73308 Fixed eyes on the faints of Hitmonlee and Phantump 2024-04-22 20:40:12 +10:00
FrankTheFarmer 670dedc0e2 Grovyle shiny texture fixes 2024-04-22 14:01:59 +10:00
Tyzillion 5e24799295 move effects are in the works now. :) 2024-04-21 23:05:41 -04:00
Paul b25dc6610e Fixed bobber spawning not working 2024-04-22 11:20:54 +10:00
Paul fa67bba631 Merge remote-tracking branch 'origin/main' into sega_bass_pro_fishing_2
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonItems.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonNetwork.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonSounds.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/advancement/CobblemonCriteria.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/CobblemonClient.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/block/DisplayCaseRenderer.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen1/MagikarpModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/item/group/CobblemonItemGroups.kt
#	common/src/main/resources/assets/cobblemon/bedrock/pokemon/animations/0129_magikarp/magikarp.animation.json
2024-04-22 11:07:52 +10:00
Tyzillion a7243102d5 Evolution particle tweaks and Pokemon now stop moving if evolution is started. 2024-04-21 21:06:47 -04:00
Tyzillion de6a84a75b Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into evolution-effect 2024-04-21 19:37:16 -04:00
FrankTheFarmer 6e19ee6059 Tricko remodel 2024-04-22 09:05:52 +10:00
Tyzillion be3c35eb43 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into evolution-effect 2024-04-21 11:21:57 -04:00
FrankTheFarmer a865d59b99 changelog update 2024-04-21 17:27:38 +10:00
FrankTheFarmer 8896440451 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2024-04-21 17:09:04 +10:00
FrankTheFarmer 39b27a8c17 Quick and dirty fixes for Pikachu and Exeggcute evolution data. Added new biome tag for their evolution requirements. 2024-04-21 16:41:50 +10:00
Sterrezo a0eb614f2a Kabuto now does the funny noise. Fixed Lucario's cry missing
I didn't know what to do with Kabuto's animation, ended up using a placeholder. Lucario had an incorrectly named keyframe.
2024-04-15 23:26:44 +02:00
FrankTheFarmer a6e4aeb321 The Doduo line will now bite less 2024-04-15 15:57:48 +10:00
FrankTheFarmer bb796921b5 Changelog updates. Removed duplicates and added list of new shoulder mounts 2024-04-15 10:30:11 +10:00
FrankTheFarmer 9f6f764aa1 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2024-04-15 07:59:57 +10:00
FrankTheFarmer f115a87b66 Roaming Gimmighoul can now evolve 2024-04-15 07:59:31 +10:00
Waldleufer 77c880ff2d fix: cry script - relaxing handling of all Forms, skipping non-regional forms [skip-ci] 2024-04-14 09:29:01 +02:00
FrankTheFarmer 16c64b9d8e Updated behaviour for Armaldo, Carracosta, Tirtouga, and Wimpod 2024-04-14 12:26:45 +10:00
FrankTheFarmer caeb45e9e1 Tyrantrum line kotlin poser placed in the proper generation. 2024-04-14 12:23:03 +10:00
FrankTheFarmer 6e341438e9 Goomy line updates and Steenee scale update 2024-04-14 11:38:17 +10:00
Tyzillion 7407483498 Updated Branch with latest main. Added Lucario aura in battle. 2024-04-13 16:34:44 -04:00
Tyzillion 020c728004 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2024-04-13 14:55:15 -04:00
Sterrezo 7125987c98 Fixed Hisuian Lilligant's cry missing
Asset was incorrectly named
2024-04-13 20:33:25 +02:00
Waldleufer 6448c4472e fix: cry script - handling all Forms, skipping non-regional forms [skip-ci] 2024-04-13 20:11:26 +02:00
Waldleufer eedac70d13 fix: cry script - sprinkling in some magic [skip-ci] 2024-04-13 19:07:48 +02:00
Sterrezo 025e09cd12 Couple cry fixes
Updated KrabbyModel.kt. Fixed missing or incorrect sound effect keyframes in animation.json files.
2024-04-13 18:54:55 +02:00
Waldleufer 4d2cfb63ea fix: cry script - warn about files not in the right locations [skip-ci] 2024-04-13 18:52:27 +02:00
Waldleufer 40794acdd5 fix: cry script - properly check elaborate cries [skip-ci] 2024-04-13 18:25:25 +02:00
Sterrezo 82f8855725 Fixed missing Grovyle and Sceptile cries missing 2024-04-13 17:57:21 +02:00
Waldleufer 5abcdbb837 fix: cry script - new way to implement cries does not require an import [skip-ci] 2024-04-13 17:48:01 +02:00
Waldleufer 2f817a7f9a fix: cry script - ignore commented out lines [skip-ci] 2024-04-13 17:33:35 +02:00
Waldleufer 67767fc53a fix: cry script - only log warnings for pokemon marked as "In-Game" [skip-ci] 2024-04-13 17:16:34 +02:00
Tyzillion 43cd4b8403 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2024-04-13 02:50:14 -04:00
Tyzillion 2660d73bb6 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2024-04-13 02:49:33 -04:00
FrankTheFarmerReal faa7ca5d19 Revoking Hisuian Visas 2024-04-13 11:48:17 +10:00
Tyzillion 0fcbe51d97 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2024-04-12 11:16:59 -04:00
Tyzillion b23ad62f99 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2024-04-12 11:16:44 -04:00
Sterrezo 3ca4ce8f80 Implemented 13 new cries, more changelog updates with previously undocumented cries 2024-04-12 16:47:25 +02:00
Sterrezo 446a994195 Fixed a typo in komala.animation.json 2024-04-12 16:14:12 +02:00
Sterrezo 60e7ac828d Implemented more cries, updated changelog
Added cries for Goomy, Sliggoo, Goodra, Hisui Bias Goomy, Hisuian Sliggoo, Hisuian Goodra, Klefki. Fixed Arcanine's cry misisng. Updated changelog with previously undocumented cries.
2024-04-12 13:10:18 +02:00
Sterrezo a870effd3b Added a keyframe with a cry for Lapras 2024-04-12 10:27:53 +02:00
FrankTheFarmerReal 236237a170 The simple blink of a Bouffalant shall no longer crash your game 2024-04-12 17:00:37 +10:00
FrankTheFarmerReal 0fc67ba042 Updated Goomy's hisui bias assets and added missing oinkologne cry files. 2024-04-12 13:32:48 +10:00
FrankTheFarmerReal 997ab29d91 Added a couple cries 2024-04-12 11:29:01 +10:00
FrankTheFarmerReal e74f54f1d0 Implemented Kotlin posers for Hisuian starters unique cries
Deleted Datrix
2024-04-12 00:05:12 +10:00
Sterrezo 081e368551 Merge branch 'implement_pokemon' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2024-04-11 14:04:44 +02:00
Sterrezo 1538f58a4a Added audio assets for previously added cries 2024-04-11 14:04:16 +02:00
FrankTheFarmerReal e5103e5d03 Separated Oinkologne models to allow for separate cries 2024-04-11 21:54:01 +10:00
FrankTheFarmerReal 1cea15c9e5 Fixed Milcery being unable to evolve properly 2024-04-11 21:49:58 +10:00
FrankTheFarmerReal 3395fe0140 Hisuian Samurott texture fixed 2024-04-11 21:49:58 +10:00
FrankTheFarmerReal 2eff8d14eb Fixed Happiny being unable to evolve 2024-04-11 21:49:58 +10:00
FrankTheFarmerReal ed3cdf9b75 Limited the Typhlosions and Cyndaquils ability to look up to prevent bone dislocation in certain scenarios 2024-04-11 21:49:58 +10:00
FrankTheFarmerReal 6e1ba0599f Corrected egg groups for Toedscool line 2024-04-11 21:49:58 +10:00
FrankTheFarmerReal 497d5ce39b Basculegion behaviour updated. Should stop drowning. 2024-04-11 21:49:58 +10:00
FrankTheFarmerReal 660de3ea03 Dusknoir animations updated 2024-04-11 21:49:58 +10:00
FrankTheFarmerReal 5ab3d7b493 Updated Ekans texture 2024-04-11 21:49:57 +10:00
FrankTheFarmerReal 2ce0069484 Closed Scyther's mouth after it cries 2024-04-11 21:49:57 +10:00
Sterrezo d87fa57c95 Implemented a bunch of cries
Woobat, Swoobat, Lilligant, Hisuian Lilligant, Basculin, Klink (Deleted a redundant animation file as well), Klang, Klinklang, Litwick, Lampent, Chandelure, Cubchoo, Bouffalant, Larvesta, Volcarona, Fomanting, Lurantis, Gossifleur, Eldegoss, Stonjourner, Basculegion, Sneasler, Overqwil, Oinkologne
2024-04-11 13:40:36 +02:00
Paul 9d49ce086a merge conflict bug resolution 2024-04-11 15:10:17 +10:00
Paul 5f8c1d5b6d Merge remote-tracking branch 'origin/main' into npcs
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonCommands.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/battles/model/PokemonBattle.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/battles/ShowdownInterpreter.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/battles/interpreter/instructions/FaintInstruction.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/CobblemonClient.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/entity/PokemonClientDelegate.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/JsonPokemonPoseableModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/PokemonPoseableModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/pokemon/PokemonRenderer.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/command/TestCommand.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonEntity.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonServerDelegate.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/particle/SnowstormParticleReader.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/pokemon/Pokemon.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/util/MiscUtils.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/util/WorldExtensions.kt
2024-04-11 14:36:52 +10:00
FrankTheFarmerReal 69947b0b32 Fixed Flabebe line T pose when sleeping 2024-04-11 09:01:02 +10:00
Tyzillion f4c3f9ae04 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into implement_pokemon 2024-04-10 09:34:02 -04:00
FrankTheFarmerReal 04e1a6b41c Removed duplicate entry from changelog 2024-04-10 18:13:26 +10:00
FrankTheFarmerReal 6ae2adb2d0 Stopped Pumpkaboo's cry from looping 2024-04-10 17:12:44 +10:00
FrankTheFarmerReal 0bf6932fe5 Dusknoir's animations are now about 20 degrees cooler™ 2024-04-10 09:59:27 +10:00
FrankTheFarmerReal 71382a3bd1 Merge remote-tracking branch 'origin/implement_pokemon' into implement_pokemon 2024-04-09 10:27:14 +10:00
FrankTheFarmerReal 0f4f29518b Placeholder Volcarona animations 2024-04-09 10:26:37 +10:00
Sterrezo 8aeeece0a3 Fixed missing cries, updated the changelog.
Fixed missing audio files, sound effect keyframes and model.kt files. Partially updated the changelog.
2024-04-08 18:55:58 +02:00
Paul 850b418c80 Improve surface-swimmers behaviour when submerged 2024-04-08 22:51:04 +10:00
FrankTheFarmerReal 42af2898b2 Hitbox fixes and Lapras placeholder swim animation 2024-04-08 18:23:01 +10:00
Lily e6590bef08 moved most baits to the new system 2024-03-19 15:00:59 +00:00
Lily 60b0e70651 updated some baits to use the new system 2024-03-19 14:40:17 +00:00
Lily 0d9f8bbb36 refactored the fishing bait system to allow for multiple effects per item 2024-03-18 22:24:24 -04:00
Deltric 00eca1c019 fix: battle gui rendering bugs and removed old method 2024-03-17 01:02:43 -05:00
Deltric babfb43750 Merge remote-tracking branch 'origin/1.20.4' into 1.20.4
# Conflicts:
#	common/build.gradle.kts
#	common/src/main/kotlin/com/cobblemon/mod/common/block/chest/GildedChestBlock.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/gui/startselection/StarterSelectionScreen.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/pokemon/Pokemon.kt
#	common/src/main/resources/assets/cobblemon/lang/en_us.json
2024-03-17 00:25:21 -05:00
Deltric 3aa94fcd2a fixed two leftover errors from merging in main 2024-03-17 00:19:25 -05:00
Deltric 20a866a0e3 draft: rough port with some bugs to fix and code to clean up. 2024-03-16 23:39:29 -05:00
Deltric 67f2146c3c remove baked in adorn for compatibility mod 2024-03-16 23:27:16 -05:00
Deltric ad49106132 initial gradle changes 2024-03-16 23:27:09 -05:00
Deltric 064df9c26e draft: rough port with some bugs to fix and code to clean up. 2024-03-16 23:15:12 -05:00
Paul bd8d9fa9e3 Added a bunch of AI tasks to NPCs for combat (I dunno it's neat) 2024-03-16 11:16:58 +10:00
Tyzillion b4508bf87e More tweaks to evolution particles. 2024-03-10 06:29:27 -04:00
Tyzillion dcb4f52cdb Added sounds to evolution. 2024-03-10 00:32:08 -05:00
Tyzillion 1e9b390f38 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into evolution-effect 2024-03-09 23:34:36 -05:00
Tyzillion 7edd47f995 Evolution tweaks. 2024-03-08 19:12:46 -05:00
Tyzillion dd220c5c85 Merge remote-tracking branch 'origin/evolution-effect' into evolution-effect 2024-03-07 22:02:04 -05:00
Paul bea84a37d4 Fixed a bunch of evolution animation locator issues 2024-03-08 13:01:42 +10:00
Tyzillion ac30da3c15 Merge remote-tracking branch 'origin/evolution-effect' into evolution-effect 2024-03-07 20:58:08 -05:00
Paul 3861835d47 Test command spawns bedrock entity for evo 2024-03-06 21:06:38 +10:00
Sterrezo e75dcd63d1 Merge branch 'sega_bass_pro_fishing_2' of https://gitlab.com/cable-mc/cobblemon into sega_bass_pro_fishing_2 2024-03-04 17:46:49 +01:00
Sterrezo a4fc1442bf Updated fishing sounds 2024-03-04 17:46:06 +01:00
Tyzillion d62fb5c4c7 Merge remote-tracking branch 'origin/evolution-effect' into evolution-effect 2024-03-03 20:58:44 -05:00
Paul ca9dde92cd Merge remote-tracking branch 'origin/main' into evolution-effect 2024-03-04 11:32:33 +10:00
Tyzillion 6ba264ddcb Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into evolution-effect 2024-03-03 20:26:59 -05:00
Tyzillion ab6c088ddf Evolution particle edits. 2024-03-03 17:56:50 -05:00
Tyzillion 18105a8b3f Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon into evolution-effect 2024-03-03 17:56:44 -05:00
Tyzillion acb5984a9e Evolution particles electric boogaloo. 2024-03-03 03:50:33 -05:00
Paul 0a3ba8d4fa Fixed generic bedrock animations not being loaded 2024-03-03 17:37:43 +10:00
Paul 15259f0a95 Merge remote-tracking branch 'origin/main' into evolution-effect 2024-03-03 17:32:04 +10:00
Tyzillion 9f66c053e1 Evolution Particles BB. 2024-03-03 02:25:10 -05:00
Deltric ea2936f204 remove baked in adorn for compatibility mod 2024-03-02 17:44:25 -06:00
Deltric 9d7eef9bcd initial gradle changes 2024-03-02 17:18:50 -06:00
Timothy Metcalfe c8dedce977 Merge branch 'main' into 'held-item-manager-item-checker'
# Conflicts:
#   common/src/main/kotlin/com/cobblemon/mod/common/command/TestCommand.kt
2024-03-02 09:09:59 +00:00
Plastered_Crab fb85ceacb0 - More adjustments to the reel-in trajectory 2024-03-01 12:40:14 -08:00
Paul 9da2e125ac More NPC AI, some molang context implementation 2024-03-01 10:07:25 +10:00
jeffw773 7d9644ba51 - tweak Gyarados spawn for testing 2024-02-29 08:58:05 -08:00
Plastered_Crab 39c856b69a - Added in all Ancient Rod predicates so they look right when casting 2024-02-28 15:49:56 -08:00
Plastered_Crab 4a4c375f66 - Added in new test sounds for fishing 2024-02-28 14:56:28 -08:00
Plastered_Crab d22df3e554 - tweaked reel in logic and trajectory 2024-02-27 16:36:09 -08:00
apion 743da2817b Added rooted soil 2024-02-27 06:07:24 -05:00
apion ebdf69f496 Rebuilt blockstate jsons 2024-02-27 05:57:41 -05:00
Plastered_Crab ed4dadc3f6 - cleaned up code 2024-02-26 16:21:44 -08:00
Plastered_Crab c2e5e39019 - Tweaked IV bait logic 2024-02-26 16:11:35 -08:00
Plastered_Crab f383e5a52f - Fixed some bait logic 2024-02-26 15:33:28 -08:00
Plastered_Crab 914b7c63c9 - Hooking entities no longer crashes the game :D 2024-02-26 14:37:57 -08:00
Plastered_Crab 5a17a5ed68 - Glow/Sweet Berries can be used as bait + fixes for particles for fishing trails 2024-02-26 12:04:54 -08:00
jeffw773 bb1a46950f - added comment to bobber entity 2024-02-26 06:27:39 -08:00
jeffw773 679d3eae58 - edit to vanilla bait list 2024-02-26 06:08:04 -08:00
jeffw773 a9cd80e496 - remove junk test fishing loot table. Finalize % chance to get Smithing Template odds 2024-02-26 05:38:50 -08:00
tmetcalfe89 8f64e4fef8 removed testcommand addition 2024-02-25 22:28:46 -08:00
apion a96cc307bb Fixed loot table injector 2024-02-25 23:39:06 -05:00
jeffw773 f2b2a282e5 Merge remote-tracking branch 'origin/sega_bass_pro_fishing_2' into sega_bass_pro_fishing_2 2024-02-25 19:56:20 -08:00
jeffw773 5bd7695ce8 - players can define their own bait now 2024-02-25 19:56:05 -08:00
Lily b42387a23f Merge remote-tracking branch 'origin/sega_bass_pro_fishing_2' into sega_bass_pro_fishing_2 2024-02-25 17:40:43 -05:00
Lily 6aa1e6f9ad advancement + tag changes 2024-02-25 17:39:55 -05:00
jeffw773 414fcf8278 - Removed additional crafting recipe 2024-02-24 21:27:26 -08:00
jeffw773 a3c26484a4 - Inejected Pokerod Smithing Template into Treasure Fishing table 2024-02-24 21:25:06 -08:00
Paul 53acf7a628 Various improvements to NPC AI 2024-02-24 15:17:48 +10:00
Lily fbc8883c96 advancement fixes, removed crafting table recipes, fixed fishing bait not registering 2024-02-23 23:57:50 -05:00
Paul 235b5d062d Merge remote-tracking branch 'origin/main' into npcs 2024-02-24 13:56:55 +10:00
jeffw773 baba3f669d Merge remote-tracking branch 'origin/sega_bass_pro_fishing_2' into sega_bass_pro_fishing_2 2024-02-23 17:45:38 -08:00
jeffw773 2fe098adac - added in recipes for ancient rods 2024-02-23 17:45:23 -08:00
Lily 1c770049b4 Merge remote-tracking branch 'origin/sega_bass_pro_fishing_2' into sega_bass_pro_fishing_2
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/item/interactive/PokerodItem.kt
2024-02-23 20:21:53 -05:00
Lily 71b854f36a ancient rods + advancements 2024-02-23 20:21:26 -05:00
apion 995364c960 Texture updates 2024-02-23 19:53:27 -05:00
jeffw773 61b944a293 - reworked fishing baits to be datapackable (now you can fish with steak if you wanted) 2024-02-23 16:16:48 -08:00
apion 289b2ddc7b Berries now stick out of the ground when initially planted 2024-02-23 19:08:03 -05:00
jeffw773 46ed6d0492 - more bait swapping logic 2024-02-23 08:53:46 -08:00
jeffw773 72058bb56f - Fixed some bait swapping logic 2024-02-22 23:57:05 -08:00
jeffw773 a7b28ed936 - Added some wip fishing sounds 2024-02-22 23:19:25 -08:00
jeffw773 96fce55688 - added some additional fishing spawn pool pokemon 2024-02-22 22:15:27 -08:00
Lily 85daf496d8 changes to pokerod item lang 2024-02-22 23:16:09 -05:00
Paul 7655ddb25b More AI work for NPCs, im lernings 2024-02-23 12:16:10 +10:00
Plastered_Crab 7b4b498877 - All but 6 berries are implemented for bait (save me) 2024-02-22 15:52:17 -08:00
Plastered_Crab 0ee32c7fd3 - Most of the baits work now (I am so tired) 2024-02-22 14:44:47 -08:00
Plastered_Crab 2c2c1b0cf4 - More groundwork for bait 2024-02-22 09:30:46 -08:00
jeffw773 218edf680b - Ground work for baits having effects on fishing 2024-02-21 21:35:21 -08:00
Plastered_Crab 7598a0dacc - Updated assets for rods 2024-02-21 18:33:25 -08:00
Licious d5af099120 Merge branch 'main' into tm-machine 2024-02-21 20:34:34 +00:00
Plastered_Crab 7327a4ddb5 - Bait can be removed and swapped out on the bobber 2024-02-21 11:44:21 -08:00
Plastered_Crab f1d3e7b12b - Bait can now be applied to the fishing bobbers 2024-02-21 11:09:53 -08:00
tmetcalfe89 8dfbe8c60e last println gone 2024-02-21 09:12:32 -08:00
jeffw773 410ea6be87 - Tweaked line colors and started on bait testing 2024-02-20 23:08:48 -08:00
Plastered_Crab 399dfc33c5 - Added Beast Rod (blue string variant) 2024-02-20 17:05:20 -08:00
tmetcalfe89 8d81432519 leftover printlns *closes door quietly behind him* 2024-02-20 16:22:37 -08:00
tmetcalfe89 6a9662a514 cleaning up after myself 2024-02-20 16:16:29 -08:00
tmetcalfe89 15f65ad714 scaled back the scope and accommodated the same stores as looking by pokemon 2024-02-20 16:08:38 -08:00
Plastered_Crab 26e39bb37d - Altered the trajectory of reeled in pokemon 2024-02-20 15:17:11 -08:00
Lily 825e1ee110 Merge branch 'type_gem' into tm-machine
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/client/CobblemonClient.kt
#	common/src/main/resources/assets/cobblemon/lang/en_us.json
2024-02-20 17:54:13 -05:00
Plastered_Crab 4ff7df63c0 - Fixed colored fishing lines for cosmetic rods and fixed line not breaking when swapping to another rod 2024-02-20 14:45:39 -08:00
tmetcalfe89 1d209bab40 I should test before push 2024-02-20 10:46:44 -08:00
tmetcalfe89 9198dbb51e back to an interface with ye 2024-02-20 10:43:54 -08:00
tmetcalfe89 9ce6e51f55 prototype for splitting one question into two 2024-02-20 10:34:19 -08:00
jeffw773 1d1f749d6d - Added cast predicates and JSON features to each remaining cosmetic rod 2024-02-20 01:36:14 -08:00
Lily ee0dc24207 temporarily removed type gems 2024-02-19 20:52:26 -05:00
Lily e5d702bb5a added new type gem sprites 2024-02-19 20:41:41 -05:00
Plastered_Crab d6e4b9c1a6 - Added other rods to the CobblemonItems list 2024-02-19 17:19:56 -08:00
apion 15d3ee0d49 Data-packable fishing rods kind of 2024-02-19 19:56:22 -05:00
Plastered_Crab de0ed1ab41 - Added crafting table recipes for cosmetic rods 2024-02-19 15:12:47 -08:00
Lily 81d930afae poke rod sync stuff (not fully working atm) 2024-02-19 15:37:30 -05:00
Plastered_Crab b83d75f30f - More Attempts at setting ball used for bobber and line color for rod during registry 2024-02-19 11:42:04 -08:00
Plastered_Crab 5814c1a5d6 - Attempts to get each ball rendered correctly for each rod (still needs work) 2024-02-19 10:10:57 -08:00
jeffw773 a45fec50a4 - Added fancy cosmetic Rods for each pokeball type 2024-02-18 22:51:05 -08:00
jeffw773 576b6ea767 - implemented test Magikarp animations + added test hook to Bobber 2024-02-18 18:05:16 -08:00
Paul dd6271ceed Merge remote-tracking branch 'origin/main' into npcs 2024-02-19 11:35:40 +10:00
jeffw773 792287cb5a - added new Magikarp models/textures/animations 2024-02-18 14:44:11 -08:00
Lily 42ad084dbe pokerod assets 2024-02-18 16:24:20 -05:00
jeffw773 b9bd61f3dc - fishing line connects to bobber much better now 2024-02-18 01:04:41 -08:00
jeffw773 c6d6f98d03 - fishing line connects to bobber much better now 2024-02-18 01:03:28 -08:00
jeffw773 abbd17faf7 - Pokeball Bobber now casts with more controlled random pitch/yaw amounts and also rotates upright when it hits water 2024-02-18 00:29:21 -08:00
jeffw773 c159137a70 Merge remote-tracking branch 'origin/display_case' into sega_bass_pro_fishing_2 2024-02-17 22:54:08 -08:00
jeffw773 03628631f7 - Pokeball bobber now rotates upwards when bobbing in water 2024-02-17 11:50:37 -08:00
jeffw773 e5e61df4b2 Merge remote-tracking branch 'origin/sega_bass_pro_fishing_2' into sega_bass_pro_fishing_2
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/entity/PokeBobberEntityRenderer.kt
2024-02-17 10:31:26 -08:00
Lily f07c4bf5b1 refactored fishing bobber variable names to be more readable instead of the single-letter names that mc gives us 2024-02-17 11:31:38 -05:00
Lily 0e3fd520f0 fixed naming to be more consistent with vanilla textures 2024-02-17 11:23:08 -05:00
jeffw773 935f3100d2 - Pokeball Bobber now slows down fast in water (due to water friction) and has a random spin applied when casting 2024-02-16 22:12:07 -08:00
Lily 8b32764ce3 pokerod smithing template assets 2024-02-17 00:14:26 -05:00
Lily 3e5a57ea20 pokerod now slowly stops spinning 2024-02-16 23:35:34 -05:00
Plastered_Crab 6ee94aa55b - Pokeball Bobber now spins when cast and stops spinning on land, needs fixed for water surface 2024-02-16 17:01:07 -08:00
Paul 05e7e1448b Removed redundant function 2024-02-17 10:51:10 +10:00
Lily bd5185e69e Merge remote-tracking branch 'origin/sega_bass_pro_fishing_2' into sega_bass_pro_fishing_2 2024-02-16 19:31:40 -05:00
Lily 5e8df4609b started bobber rendering 2024-02-16 19:31:21 -05:00
Plastered_Crab 289d1474a6 - Beeeeg Whiscash has been added to fishing spawn chances 2024-02-16 14:54:52 -08:00
Plastered_Crab e4604c0d13 - Wooper (Heart variant) is now fully implemented for fishing 2024-02-16 14:24:31 -08:00
Tyzillion d4f91fa945 Wooper Heart Fix. <3 2024-02-16 16:53:53 -05:00
Plastered_Crab 5c52a9a31a - Started Implemented Wooper (heart form) to be added to the fishing chance pool 2024-02-16 13:19:57 -08:00
Plastered_Crab db2efcb48e - added new spawn conditional for lureLevel. Variants of Karp can now only have a chance to appear at certain Lure levels 2024-02-16 10:32:55 -08:00
Plastered_Crab 3bcbe2fb45 - Incorporated Pokerod Treasure loot table and player will physically reel in pokemon under 200 lbs 2024-02-16 09:32:01 -08:00
Lily c6e514216c added new obtain methods 2024-02-16 11:26:36 -05:00
Paul c7202cc869 Fixed magikarp jump pattern spawn file 2024-02-16 11:34:40 +10:00
Lily 269e18786b Merge remote-tracking branch 'origin/sega_bass_pro_fishing_2' into sega_bass_pro_fishing_2 2024-02-15 19:40:14 -05:00
Lily bd79a4ecfb pokerod smithing template (needs some more assets but should be functional) 2024-02-15 19:39:49 -05:00
Plastered_Crab 3c3a8b1af9 - Pokerod now cannot stack and has same durability as vanilla fishing rod 2024-02-15 16:07:54 -08:00
Lily 11e2ed34e5 Merge branch 'main' into sega_bass_pro_fishing_2
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonEntities.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonItems.kt
#	fabric/src/main/kotlin/com/cobblemon/mod/fabric/client/CobblemonFabricClient.kt
#	forge/src/main/kotlin/com/cobblemon/mod/forge/client/CobblemonForgeClient.kt
2024-02-15 18:54:42 -05:00
Plastered_Crab 1500d6cdf1 - All Magikarp Jump variants implemented and new item loot tables started 2024-02-15 14:59:18 -08:00
Plastered_Crab acbbe2a1ba - Start to JUMP variants spawning properly when fishing 2024-02-14 16:42:58 -08:00
Plastered_Crab 0fe6bc918c - Adding Magikarp JUMP addon variants into Base mod 2024-02-14 14:57:27 -08:00
Plastered_Crab d399b3e29a - Magikarps now get reeled in at good distances in front of player 2024-02-14 14:20:32 -08:00
Plastered_Crab acc6f119e1 - Magikarps getting reeled in now land in front of the player instead of behind the player (for battle reasons) 2024-02-13 16:45:22 -08:00
Plastered_Crab 932a2c375c - Begin different reel-in trajectories for fishing up Magikarps 2024-02-13 14:46:42 -08:00
Paul 1d3de659a8 Conflicty resolvo 2024-02-11 12:14:51 +10:00
Paul 9e5879edd3 Put molang back 2024-02-11 12:01:39 +10:00
Paul 4f71340ef8 Conflict stuff 2024-02-11 11:59:40 +10:00
Paul b5c4863e20 Setup saving for NPC edit UI 2024-02-11 11:38:28 +10:00
Paul a3eff4b195 Merge branch 'move-animations' into npcs
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/battles/ShowdownInterpreter.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/entity/PokemonClientDelegate.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/pokemon/PokemonRenderer.kt
2024-02-10 16:12:26 +10:00
Nick 142eebe9e6 Apply model predicates, starting with Pokerod 2024-02-09 22:07:43 -08:00
jeffw773 36f19c9180 - Xp is rewarded to player for fishing up Pokemon 2024-02-09 21:15:10 -08:00
Paul 168e034daf Removed some more dead code 2024-02-10 13:28:56 +10:00
Paul 827e651b22 Removed some dead code 2024-02-10 12:15:37 +10:00
Paul fc34312bbb Crucial all-important fix (may change the world as we know it) 2024-02-10 12:15:14 +10:00
Paul 53261b3274 Removed dead code 2024-02-10 11:40:35 +10:00
Paul 9c3a38657c Merge remote-tracking branch 'origin/main' into move-animations 2024-02-10 11:37:57 +10:00
Paul 656487c868 Oops don't remove that 2024-02-10 11:36:36 +10:00
Paul d491f16aff Merge remote-tracking branch 'origin/main' into move-animations
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/fossil/FossilModel.kt
2024-02-10 11:31:10 +10:00
Paul 29a5b4931d Changelog 2024-02-10 11:30:47 +10:00
Paul 42fdcc740e The default target locator would probably work as a default special_attack locator 2024-02-10 11:27:20 +10:00
Paul 3bfc3ca425 Approximate the target locator for pokemon without that locator in the model 2024-02-10 11:19:28 +10:00
Paul 82682c3710 Merge remote-tracking branch 'origin/main' into move-animations
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/PoseableEntityState.kt
2024-02-10 10:37:12 +10:00
jeffw773 beb8fed6bd - Pokeball Bobber now renders correctly when cast out with Pokerod
- Luck of the Sea and Lure get read correctly from the rod and factor into the spawn bucket chosen
2024-02-09 14:17:13 -08:00
jeffw773 142284a17c - Pokemon rarity is altered by Luck of the Sea 2024-02-08 21:18:41 -08:00
Paul 261850cc9f Early work on NPC editor 2024-02-09 13:47:40 +10:00
jeffw773 f1ea86362a - Fixed fishing spawns being able to check if sky is actually visible.
- added isOcean to biomes to Magikarp
2024-02-07 18:28:42 -08:00
Lily f80a2850bb template type gem block 2024-02-05 19:42:36 -05:00
Lily 64fe6cefde Merge branch 'crystal_block' into tm-machine 2024-02-05 19:24:12 -05:00
Lily 26f337c0fd unlock tms when the player obtains them 2024-02-05 16:48:44 -05:00
Paul d1772b0241 Merge branch 'amo/sendout-upgrade' into npcs
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/client/CobblemonClient.kt
2024-02-04 14:46:04 +10:00
Paul ec3361ad91 Added basic fishing spawn detail for Magikarp and use the world pool for fishing because ehhh 2024-02-03 12:16:53 +10:00
Paul ca7c36ce15 Added trigger spawning with a fishing implementation 2024-02-03 12:13:38 +10:00
jeffw773 f7c73728d7 - Added some newer spawning stuff and added battle initiation after fished up mon 2024-02-02 16:38:15 -08:00
jeffw773 1992a23edc Merge branch 'main' into sega_bass_pro_fishing_2 2024-02-02 13:39:02 -08:00
Paul 4bb2564b80 Merge branch 'amo/sendout-upgrade' into move-animations 2024-02-02 14:26:44 +10:00
Paul 4ab72dd0d9 Added MoLang scrip framework 2024-02-02 11:31:42 +10:00
jeffw773 9fc81c1b33 - Amethyst Shards now only feed into the correct slot 2024-02-01 09:04:02 -08:00
JazzMcNade 5c599dbb9a TM machine monitor switches on and off with player interaction. 2024-02-01 01:08:34 -06:00
jeffw773 d5a94ff784 - Changes to Blockstate when being used by player
- Plays sound when crafted with automation (might not be wanted later idk)
2024-01-31 16:16:52 -08:00
jeffw773 024f299486 - Comparator output from TMM now updates with respect to actions done by TM Machine 2024-01-31 12:06:23 -08:00
jeffw773 9a2b588568 - TM Machine can now Hopper out created TMs and spit out TMs and craft with Redstone signals if wanted 2024-01-31 10:53:26 -08:00
JazzMcNade b6fb5e8776 manual crafting 2024-01-31 03:00:40 -06:00
jeffw773 987b9bb275 - Sync fixes for TMM Inventory and UI slots 2024-01-30 14:35:33 -08:00
apion b04ab8b95b Took some stuff out of CobblemonClient and put it in TMIten (clean up) 2024-01-30 16:52:22 -05:00
Lily dab0623d61 Merge remote-tracking branch 'origin/tm-machine' into tm-machine 2024-01-30 14:16:21 -05:00
Lily cb5b6ec68b advancement obtain method 2024-01-30 14:16:11 -05:00
JazzMcNade ea57c9dc5d Fix for removeStack 2024-01-30 01:56:35 -06:00
jeffw773 9abab091d9 - Materials feed into correct slots on TMM from hoppers 2024-01-28 13:01:49 -08:00
JazzMcNade e2e50d2f1b tm block now has a persistent inventory 2024-01-27 20:37:13 -06:00
jeffw773 4ac88ba192 - fixes to TM instances and isReadyToCraft conditional 2024-01-27 13:00:34 -08:00
jeffw773 37eccce8b1 - tweaks to tms 2024-01-27 12:14:13 -08:00
jeffw773 e44db7c380 - Filter Disc renders properly with client 2024-01-27 11:05:21 -08:00
JazzMcNade d57bb42720 Fix for shift click not always applying the filter 2024-01-27 05:13:19 -06:00
jeffw773 f0c44f040f Merge remote-tracking branch 'origin/tm-machine' into tm-machine 2024-01-26 21:52:45 -08:00
jeffw773 2d6e2f87ed - Hoppers and comparators are working for making TMs and Blank TMs 2024-01-26 21:52:27 -08:00
apion 8b4193a5db Fixed rotations 2024-01-26 22:54:33 -05:00
apion 667dfe32e3 More fun stuff 2024-01-26 22:27:13 -05:00
Paul 7f6eb452be Moved NPCs over to JSON posers and improved declaration of label exclusions in primary animations 2024-01-27 11:08:01 +10:00
apion 218253765e Merge branch 'main' into tm-machine 2024-01-26 18:50:37 -05:00
apion ff082adf67 Start working on rendering different color disks in the render machine 2024-01-26 17:27:49 -05:00
apion 66959816ef Merge branch 'main' into tm-machine
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonNetwork.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonSounds.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/storage/player/PlayerData.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/CobblemonClient.kt
#	common/src/main/resources/assets/cobblemon/lang/en_us.json
#	common/src/main/resources/assets/cobblemon/sounds.json
#	common/src/main/resources/cobblemon-common.accesswidener
2024-01-26 15:52:23 -05:00
jeffw773 0e85835a87 Merge remote-tracking branch 'origin/tm-machine' into tm-machine 2024-01-26 12:44:35 -08:00
jeffw773 e165d4958d - TM Machine Inventory Disc 2024-01-26 12:44:18 -08:00
JazzMcNade e0736e1988 TM Block is no longer treated as 2 blocks tall for placement. 2024-01-26 02:04:24 -06:00
jeffw773 724ff86a21 - TM Machine Inventory Test 2024-01-25 23:03:38 -08:00
Paul 0afe50c883 Some fixes to have NPCs use the send out animations 2024-01-26 12:59:08 +10:00
Paul a74499a14b Conflict issues 2024-01-26 11:07:23 +10:00
jeffw773 97427fa58b - TM Machine Entity functioning 2024-01-25 17:04:38 -08:00
Paul e6ff24072f Merge branch 'move-animations' into npcs
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/Cobblemon.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonEntities.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/net/serializers/IdentifierDataSerializer.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/scheduling/SchedulingFunctions.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/CobblemonClient.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/PoseableEntityModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/bedrock/animation/BedrockStatefulAnimation.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/pokemon/PokemonRenderer.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/command/TestCommand.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/data/CobblemonDataProvider.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonEntity.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/pokemon/Pokemon.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/util/DataKeys.kt
2024-01-26 10:51:47 +10:00
Paul 7693d22e58 Why is there a .ignored folder 2024-01-25 19:31:25 +10:00
Paul f3544f9cdf Updated inbuilt posers for new animation system stuff 2024-01-25 19:30:44 +10:00
Paul 9f7800b995 Mountains of remaining work on move animations system 2024-01-25 19:10:41 +10:00
jeffw773 c9d47a3e21 - More TM Mechanics 2024-01-24 22:30:56 -08:00
jeffw773 c5c884ca2e - Testing New TM Functionality 2024-01-24 15:58:42 -08:00
jeffw773 f086c32b95 - TM Machine Testing 2024-01-24 14:25:49 -08:00
jeffw773 ecea176300 - Added placeholder Type Gem sprites for TM Materials 2024-01-23 16:11:39 -08:00
jeffw773 c00413bb32 - Added Back buttons to TM Machine 2024-01-23 14:28:57 -08:00
jeffw773 be78012ce6 - TM Machine can now scroll through TMs
- Fixed how Scroll List and TM entries are handled so they can be interacted with properly
2024-01-23 11:01:05 -08:00
Paul 022c8ed499 Merge branch 'amo/sendout-upgrade' into move-animations
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/client/entity/PokemonClientDelegate.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/PoseableEntityModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/PoseableEntityState.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/bedrock/animation/BedrockAnimation.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokeball/PokeBallModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/JsonPokemonPoseableModel.kt
2024-01-19 13:50:41 +10:00
jeffw773 dad28135cc - Brief changes to particle count based on rarity reeled in 2024-01-18 14:32:43 -08:00
jeffw773 e41d13dd53 - Pokerod now uses config values for rarity buckets and access biome spawn pools 2024-01-14 23:02:33 -08:00
jeffw773 64cae53d82 - Pokerod foundation laid out for having chance to spawn Pokemon instead of getting item as well as rarity chance started 2024-01-14 00:11:12 -08:00
dhi_holo c9bf0bd8d7 Merge branch 'sega_bass_pro_fishing_2' of https://gitlab.com/cable-mc/cobblemon into sega_bass_pro_fishing_2 2024-01-14 13:36:53 +10:00
dhi_holo 97d2047aee It's a Tool, It's a Rod
makes pokerod be held correctly, and adds second model file for the cast variation, when that is implemented.
2024-01-14 13:36:04 +10:00
jeffw773 811f8abed7 - Added override for model of pokerod when cast 2024-01-13 19:27:22 -08:00
jeffw773 ab02a54f28 - Finally the Pokerod is starting to work! (it is backwards tho) 2024-01-13 19:08:36 -08:00
jeffw773 6e0c1aefcc - More testing fishing code for pokerod 2024-01-13 13:55:02 -08:00
jeffw773 e887b6c43c - Some code for fishing testing again 2024-01-13 12:16:38 -08:00
jeffw773 25172c2bc9 - Some code for fishing testing 2024-01-13 11:23:38 -08:00
jeffw773 929b90173a - Some code for fishing testing 2024-01-12 11:58:02 -08:00
jeffw773 70a65f6ffe - Testing code 2024-01-12 07:39:21 -08:00
jeffw773 db7d3f01d8 - Starting implementation on fishing 2024-01-12 07:39:20 -08:00
Paul 08565a9823 Brought fossils into the new molang/animation changes 2024-01-12 10:01:02 +10:00
jeffw773 3844dd6314 - Added mouseClicked, mouseScrolled, mouseDragged to TMScrollingList (but still no work) 2024-01-11 12:34:14 -08:00
Lily 080077189f tm machine ui 2024-01-10 19:45:04 -05:00
Paul e11245f609 Merge remote-tracking branch 'origin/main' into move-animations
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonNetwork.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/molang/ExpressionLike.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/molang/MoLangFunctions.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/molang/SingleExpression.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/battles/ShowdownInterpreter.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/ClientMoLangFunctions.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/PoseableEntityModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/pokeball/PokeBallPoseableState.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/config/CobblemonConfig.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/Poseable.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonEntity.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/util/MiscUtils.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/util/MoLangExtensions.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/util/adapters/ExpressionLikeAdapter.kt
2024-01-08 16:17:56 +10:00
Paul b3a6d8eb27 Tried fixing a wander path issue 2024-01-08 12:30:35 +10:00
Paul 093c3683c5 Merge remote-tracking branch 'origin/main' into npcs 2024-01-07 14:04:45 +10:00
Paul 2b4b9ca5dd Setup and foundation work on NPC entity AI 2024-01-07 12:32:25 +10:00
Paul ea70d27f87 Merge remote-tracking branch 'origin/main' into npcs 2024-01-06 10:37:21 +10:00
Paul 5487b81f10 Improved rendering of reference faces and NPCs in dialogue GUI 2024-01-06 10:36:37 +10:00
Paul 96b8aeb5b8 Added NPC face and dialogue scripty stuff woo 2024-01-05 16:00:03 +10:00
Paul bf1520b1b4 Fixed NPC recalling logic 2024-01-05 11:03:09 +10:00
Paul 0f22da7ff2 Merge remote-tracking branch 'origin/main' into npcs
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonNetwork.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/battles/ShowdownInterpreter.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/CobblemonClient.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/command/TestCommand.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/data/CobblemonDataProvider.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/util/DataKeys.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/util/MiscUtils.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/util/adapters/MoValueAdapter.kt
2024-01-05 10:20:35 +10:00
jeffw773 4fa86c7742 - Added Eiko's new TM Machine Textures and fixed inventory slot locations 2024-01-04 13:11:00 -08:00
jeffw773 3c9cff5027 - Tweaked position of TM Machine GUI slightly as well as tooltips and inventory slots 2024-01-03 23:02:07 -08:00
Lily a1047e05d4 psychic trim update + updated type icons 2024-01-03 20:19:38 -05:00
Lily b7c1157c5c slight changes to the TM UI 2024-01-03 13:47:41 -05:00
apion cc8a51abcd TM Menu actually rendering now 2024-01-03 06:45:25 -05:00
apion 38174155bf Improved registry process for HandledScreens 2024-01-03 03:05:58 -05:00
Lily 2698006f93 filterTms function for when the UI is implemented 2024-01-03 00:30:50 -05:00
Lily aa38674fc8 TMM sounds and subtitles 2024-01-02 22:40:04 -05:00
apion 9ca0742386 Added fixed TMM model, added system to register HandledScreens 2024-01-02 21:53:50 -05:00
Lily 32d291890e TM colors and type gem items 2024-01-02 18:36:04 -05:00
Lily 381fd1d5e2 tm machine visuals 2024-01-02 12:42:32 -05:00
Lily a2fbe16ede textures partially 2024-01-02 12:20:32 -05:00
Lily 0b478ebd5a working coloring for tm items based on two ints given in the tm json file 2024-01-02 11:40:27 -05:00
Lily b0b07e8edd functional obtain methods for tms, with an option to passively check them 2024-01-01 15:40:07 -05:00
Paul 90e39874e0 Imports mainly 2023-12-27 11:12:58 +10:00
Paul 2d5796de71 Merge remote-tracking branch 'origin/improved-transformed-parts' into move-animations
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonEntity.kt
2023-12-26 13:32:48 +10:00
Paul 3b152eafac Conflict resolution artifact 2023-12-26 12:12:53 +10:00
Paul 06ed354ebe Merge branch 'improved-transformed-parts' into move-animations
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/api/molang/MoLangFunctions.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/entity/EmptyPokeBallClientDelegate.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/entity/PokemonClientDelegate.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/PoseableEntityState.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonEntity.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonServerDelegate.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/util/MoLangExtensions.kt
2023-12-26 12:09:23 +10:00
Paul caad276cbf Moved NPC's to use modern MC AI 2023-12-25 20:16:41 +10:00
Paul 093ad6329d Merge remote-tracking branch 'origin/main' into npcs 2023-12-25 11:38:58 +10:00
Paul 94d216fd7a Corrections from merging in scheduling changes 2023-12-24 21:34:52 +10:00
Paul 04c63145e1 Merge branch 'improved-transformed-parts' into npcs
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonEntities.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/battles/model/PokemonBattle.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/scheduling/SchedulingFunctions.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/battles/ShowdownInterpreter.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/CobblemonClient.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/bedrock/animation/BedrockAnimation.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/bedrock/animation/BedrockStatefulAnimation.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/bedrock/animation/BedrockStatelessAnimation.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/pokemon/PokemonRenderer.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/command/TestCommand.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonEntity.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonServerDelegate.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/pokemon/Pokemon.kt
#	fabric/src/main/kotlin/com/cobblemon/mod/fabric/client/CobblemonFabricClient.kt
#	forge/src/main/kotlin/com/cobblemon/mod/forge/client/CobblemonForgeClient.kt
2023-12-24 15:15:52 +10:00
Lily 824773150a more tm item stuff 2023-12-15 16:54:28 -05:00
Lily 3dc285cc70 tm item?!?!?! what the flip?!? 2023-12-11 19:48:36 -05:00
apion e12d0bea66 Added TMBlock (lol) 2023-12-01 01:19:28 -05:00
Paul 80b8cebb19 Fully integrated smooth animation transitioning into move animations 2023-11-25 17:19:19 +10:00
Paul b339081128 Merge remote-tracking branch 'origin/improved-transformed-parts' into move-animations
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonNetwork.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/scheduling/SchedulingFunctions.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/entity/PokemonClientDelegate.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/PoseableEntityModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/PoseableEntityState.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen1/CharizardModel.kt
2023-11-24 10:09:32 +10:00
apion 5bc4994091 Added learned tms to PlayerData, added a way to obtain TMs 2023-11-22 05:01:09 -05:00
apion 2b992dfd51 Setup TM registry 2023-11-22 03:22:36 -05:00
Paul 506e685117 Added q.animation to poseable models molang runtime 2023-11-03 19:07:32 +10:00
Paul eceac5fa81 Substantially implemented system for action effects 2023-10-30 17:01:42 +10:00
Paul a6b5c0bfab Added support for arbitrary animation starting for poseable entities 2023-10-27 15:12:41 +10:00
Paul b1a0d4d5a7 Groundwork for effect animations 2023-10-26 18:47:32 +10:00
Paul 627d31d0cc Merge branch 'spawn-rules' into move-animations 2023-10-21 13:15:32 +10:00
Paul d9f1e3c15f Merge remote-tracking branch 'origin/main' into move-animations 2023-10-21 11:47:14 +10:00
Paul eca52623e8 Merge remote-tracking branch 'origin/main' into npcs
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/pokemon/Pokemon.kt
2023-10-21 10:54:21 +10:00
Paul 10740ac1c8 Merge remote-tracking branch 'origin/main' into move-animations 2023-10-14 17:11:23 +10:00
Paul b9766486db Merge remote-tracking branch 'origin/main' into npcs 2023-10-13 18:07:42 +10:00
Paul bf6a923e2c Tracked data improvements for NPCs 2023-10-13 08:41:38 +10:00
Paul a073886bc5 Merge remote-tracking branch 'origin/main' into npcs 2023-10-09 17:04:40 +10:00
Paul 7c4749ecd1 Added variables listing to NPC class 2023-10-08 17:54:47 +10:00
Paul 76566669c6 Merge remote-tracking branch 'origin/spawn-rules' into npcs
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/api/pokemon/PokemonProperties.kt
2023-10-08 11:10:16 +10:00
Paul 5b8e673e53 Merge remote-tracking branch 'origin/main' into npcs 2023-10-07 21:29:53 +10:00
Paul f0a62d56a9 Merge remote-tracking branch 'origin/main' into move-animations 2023-10-07 14:56:49 +10:00
Paul 565a28de87 Merge remote-tracking branch 'origin/main' into move-animations 2023-10-02 20:16:34 +10:00
Paul de35a54f84 Fixes from merge from main 2023-09-26 18:02:32 +10:00
Paul 2c164685f4 Merge broken 2023-09-25 13:35:48 +10:00
Paul c3789cd620 Testcommand should spawn trainers not in the ground please thank you (also update trainer animations) 2023-08-27 11:02:03 +10:00
Paul 0905b16a48 Fixed instances of NPC Pokémon not being recalled or disappeared when the NPC dies 2023-08-27 11:01:14 +10:00
Paul 7881b14c4d Fixed NPC Pokémon persisting across restarts as if they were wild 2023-08-27 10:50:17 +10:00
Paul 49c8df2cef Polished timing of NPC sendout/recall animations, added win/loss NPC animations 2023-08-26 19:21:49 +10:00
Paul 165b51fde6 Many NPC battle improvements, including sendout/recall animations and scheduling, animation fixes 2023-08-25 22:07:09 +10:00
Paul b020f642f3 Merge branch 'main' into npcs 2023-08-22 19:56:15 +10:00
Paul 88e0bf57c8 Outlined NPC battle logic 2023-08-21 15:57:41 +10:00
Paul 2adb96c6bc Merge remote-tracking branch 'origin/main' into npcs 2023-08-20 19:30:24 +10:00
Paul 4094dfa6de Much more foundation for NPCs configuration 2023-08-19 12:53:25 +10:00
Paul 135ec86291 Basic AI for NPCs, implemented limb swing properties in molang to improve idle/walk for NPCs, fixes 2023-08-16 07:19:45 +10:00
Paul 910a8361ec Licenses 2023-08-13 21:51:15 +10:00
Paul 125f7d679f Much more NPC framework, rendering works, NPC class data registry configured 2023-08-13 21:50:45 +10:00
Paul 04abd73f35 Merge remote-tracking branch 'origin/main' into npcs
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/client/CobblemonClient.kt
2023-08-13 20:40:34 +10:00
Paul f3ba33f7ba More outlining for action effects 2023-05-02 19:54:18 +10:00
Paul ed4dff66b6 Tentative move particle work 2023-04-27 22:45:58 +10:00
Paul 0f16290c34 Merge remote-tracking branch 'origin/1.19.3' into npcs 2023-04-24 21:16:23 +10:00
Paul 9725c46b30 Initial work on NPCs 2023-04-03 21:14:29 +10:00
3882 changed files with 77718 additions and 25587 deletions
+1
View File
@@ -3,3 +3,4 @@
# are changed when only line endings change.
src/generated/**/.cache/cache text eol=lf
src/generated/**/*.json text eol=lf
CHANGELOG.md merge=union
+1
View File
@@ -36,6 +36,7 @@ common/src/main/resources/assets/cobblemon/showdown
*/generated/resources/*
/fabric/src/generated/resources/cobblemon-common.accesswidener
/.ignored/
common/.fabric
# MacOS
.DS_Store
+2
View File
@@ -1,3 +1,5 @@
image: amazoncorretto:21
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
+1
View File
@@ -0,0 +1 @@
LambDynamicLights compat needs to be restored
+24
View File
@@ -0,0 +1,24 @@
### Additions
- Pokémon are now animated when seen in any GUI that isn't the party GUI.
- Quirk animations can now occur for Pokémon that are shoulder mounted.
### Changes
- Improved the performance of display cases that contain Pokémon photos.
### Fixes
- Fixed some Pokémon photos in display cases flashing if the Pokémon has gender differences.
- Fixed Bidoof and Jigglypuff sleep animations stopping after some time, causing them to be 'asleep' while T-posing menacingly.
- Fixed entities not changing poses unless you're looking at them.
- Fixed cries not playing on send-out if the Pokémon is off-screen.
### Developer
- Rebuilt large swaths of the model animation code to simplify it.
- Renamed a bunch of things from %Poseable% to %Posable% because spelling.
- Renamed StatelessAnimation to PoseAnimation.
- Renamed StatefulAnimation to ActiveAnimation.
- Documented the animation system.
### Data Pack & Resource Pack Creators
- Added MoLang compatibility in the isVisible property for transformed parts.
- Added q.has_aspect('some_aspect') function to animations, posers, and entity particle effects.
- Added support for conditional pose animations.
+158 -3
View File
@@ -1,11 +1,166 @@
# Changelog
## [1.5.1](#1-5-1)
## [1.6.0 - The Bass Pro Fishing Update (Month Xth, 2024)](#1-6-0)
#### "Now that there's a fishing mechanic, the mod is actually good!"
### Additions
- Added Pokémon (and item) fishing using modified fishing rods - Poké Rods! You'll need a Poké Rod smithing template, a fishing rod, and some type of Poké Ball. Each Poké Ball makes a differently themed rod. Why not?
- Added Lure Ball functionality, increasing the catch rate of Pokémon that were caught on a fishing rod.
- Added property chaining support for duplicate CustomPokemonPropertyType elements.
- Added aspect and unaspect PokemonProperty arguments (which also includes commands such as /pokemonedit, /spawnpokemon, and /givepokemon) to allow forcing or un-forcing an aspect on a Pokémon.
### Developer
- SpawnCause is now an implementation of SpawningInfluence.
- Added "forcedAspects" to Pokemon to make it easier to easily add basic aspects to a Pokémon in a way that persists. We already know that everyone is going to overuse this.
- Made the Pokemon.aspects setter private. This could technically break sidemods but if you are affected by this then you were using it wrong! Use Pokemon.forcedAspects to fix it.
## [1.5.3](#1-5-3)
### Fixes
- Scaled down Amaura's fetus model to avoid clipping through the tank while animating
- Added Polished Tumblestone and Tumblestone Brick block sets from Tumblestone, Black Tumblestone, and Sky Tumblestone.
- Fixed Cubone's cry not having a sound.
- Fixed the Seafloor spawning context not being a usable context.
- Fixed Pokemon spawning in non-full blocks like slabs.
- Fixed Gilded Chests not dropping the chest itself when broken, only the contents.
- Fixed Pokémon losing their Hidden Ability through evolution if the middle stage did not have a Hidden Ability.
- Fixed Chimchar and Monferno T posing whenever they sleep.
- Fixed the Magby line not having any placeholder walk animations.
- Fixed Duskull and Dusclops using skylight levels for their nether spawn data. There is no sun in the Nether!
- Fixed Crumbling Arch not blending in with the world.
- Fixed Energy Root applying being usable on a fainted Pokemon.
- Fixed Pokémon entity not spawning when starting a battle while recalling said Pokémon
- Fixed species comparison not using namespace for both sides in PokemonProperties.isSubsetOf.
- Fixed PokemonProperties#asString prefixing nicknames with a '$'
### Additions
- Added extra visuals to early berry growth stages
### Added cries to the following Pokémon
- Timburr, Gurdurr, Conkeldurr
- Golett, Golurk
### Changes
- Altered the item model for Medicinal Leeks and Roasted Leeks to be held like sticks and other rod items.
- Adjusted some berry balance values like yield and growth times
- Changes to mulch buffs/durations
- Dreepy is now shoulder mountable
### Developer
### Data Pack & Resource Pack Creators
- Added support for "shedders" similar to Shedinja's evolution logic.
## [1.5.2 (May 27th, 2024)](#1-5-2)
### Fixes
- Fixed Wooloo and Dubwool dyeing making your game start dying. Only if you do it on a server.
- Fixed Gimmighoul causing PCs and parties to look glitched out, also only in a server.
- Fixed players being able to dye other people's sheep Pokémon.
## [1.5.1 (May 27th, 2024)](#1-5-1)
### Additions
- Added unique send out particles for Cherish, Dream, Beast, and Ancient Origin balls.
- Made Wooloo and Dubwool dye-able like sheep. So cute!
- Added stat up and down particles.
- Most status effects now have particles! These include: Paralysis, Poison, Sleep, Confusion, Infatuation.
#### Move Particle Effects
- Confusion
- Cotton Guard
- Growl
- Ice Punch
- Fire Punch
- Thunder Punch
- Minimize
- Quick Attack
- Protect
- Swords Dance
- Sand Attack
- Poison Powder
- Sleep Powder
- Stun Spore
- Powder
- Rage Powder
- Spore
- Thunder Wave
### Changes
- Sounds for Relic Coin Sacks have been correctly renamed. Relic Coin Pouches received new sounds for breaking and placing.
- Readjusted Petilil portraits so they fit a bit better.
- Improved handling of Pokémon taken from the Restoration Tank block to be a bit more stable.
- Made Mulch cheaper to craft.
### Fixes
-Fixed a bug in which adding organic material to the fossil tank via right click was adding the full count of the stack currently in hand
- Fixed a bug in which adding organic material to the restoration tank via right click was adding the full count of the stack currently in hand - but only taking 1 of the item.
- Fixed a niche issue where some properties of entities were not initialized correctly, causing Pokémon that appeared to be level 1 until you battle them.
- Fixed Fossilized Drake being missing from the Fossils item tag.
- Fixed Gilded Chest block entity not being cleared on block break, creating spooky ghost blocks. Old ones can be fixed by placing something like a furnace where it was, then breaking the furnace.
- Fixed sherd brokenness on Forge.
- Fixed Supplementaries incompatibility.
- Fixed Fossil Compartment crash with Jade / WAILA forks.
- Fixed pasture block PC lookups when the player is offline.
- Fixed an untranslated battle message that occurs when using a move that just ran out of PP (e.g. Fire Blast that just got spited mid-turn).
- Fixed held items being eaten even when the held item evolutions are already unlocked.
- Fixed Hisuian Decidueye not being Grass/Fighting.
- Fixed both Decidueye forms learning both Triple Arrows and Spirit Shackle.
- Fixed Pineco being unable to evolve into Shulker Forretress.
- Fixed Kabutops T-posing when underwater. It doesn't have proper swimming animations yet, though.
- Fixed Pidgey's missing walk animation.
- Fixed Cyndaquil's hidden flames clipping if it was swimming.
- Fixed Chimecho and Chingling being unable to spawn near bells. They are meant to!
- Fixed Tyrantrum and Wailord Party Overlay models peeking through the chat box. It was kinda funny though.
- Fixed hitbox sizes for Seedot, Nuzleaf, and Shiftry.
- Fixed Budew and Lechonk sliding if they walked for too long.
- Fixed Shedinja T-posing in battle.
- Fixed recoil evolution condition not working, making things like Basculegion unobtainable.
- Fixed issue where poser debug tools didn't work on JSON posers.
- Fixed issue where gilded chests don't close when going far away.
- Fixed issue where the restoration tank's renderer was reading old data, making it appear wrong.
- Fixed issue where the lights on the restoration tank would not animate if it was facing east. Very specific.
- Fixed client crash with the fossil machine when updating block state on a chunk that is unloaded in the client. I don't understand this but the devs are sure that all of those are real words.
- Fixed Restoration Tank crash with Create upon the tank block's destruction.
- Fixed Restoration Tank over consuming items when interacting with Create blocks.
- Fixed addons that add very many moves to a learn-set causing disappearing Pokémon (visually) issues on servers.
- Fixed Hyper Cutter and Big Pecks incorrectly stating that it prevented accuracy from being lowered in battle.
- Fixed missing messages for Rough Skin and Iron Barbs in battle.
- Fixed a bug where sometimes Pokémon sendouts wouldn't create an entity, or the entity would spawn at 0 0 0 which is not a good place for a Pokémon to be. Or any of us, really.
- Fixed issue in which a locked gilded chest would animate to the open state when the client fails to open it, such as when it is locked.
- Fixed a bug where aspects of a form would not be properly reflected on form changes (eg. Normal -> Hisui).
- Fixed generic battle effect sounds not sounding the way they were intended to.
- Fixed particle effects often not having access to some specific entity functions from MoLang.
- Fixed particles sometimes lasting a single tick too long, causing (very quick) visual glitches.
- Fixed particle rotations being inverted.
- Fixed particle events not spawning at the instigating particle's location.
- Fixed a bunch of spam during world generation.
- Fixed a bug in which throwing a Poké Ball at a player owned Pokémon with the ability Illusion would reveal its true species. Hilarious meta strategy.
- Fixed root-part animations not working for JSON posed Pokémon. You didn't notice this but if we didn't fix this in this update then if you use Quick Attack a lot you'd have seen a whole lot of [this](https://cdn.discordapp.com/attachments/1076993968803434627/1242660506783715369/Minecraft__1.20.1_-_Singleplayer_2024-05-21_22-08-17.mp4?ex=66549408&is=66534288&hm=ff95ee293eb15634fd63e6546534ea279540a1c892605e8d561593ca2c5600c5&) which is damn funny but very unintended.
## [1.5.0 - The Ruins and Revival Update (May Xth, 2024)](#1-5-0)
### Developer
- Changed SpawnAction#complete to return a nullable generic R (the spawn action result) instead of a boolean. Provides more information this way.
- Added an event that fires when a fossil is revived, with or without a player.
- Added IVS and EVS property extractors.
- Fixed PCStore#resize not allowing PC boxes size reduction.
### Data Pack & Resource Pack Creators
- Added support for MoLang conditions for quirks and poses.
- Changed the AttackDefenceRatio requirement to StatCompare and StatEqual. There is some backwards compatibility for AttackDefenceRatio, though.
- Changed "dimensions" spawn condition to check with dimension IDs instead of effects, so custom dimension IDs can be used.
- Added parametric motion and rotation support to particle effects.
- Added entity_scale as a molang var for particles (likely only applicable to Pokemon)
- Added support for primary quirk animations using the following format:
```JSON
{
"quirks": [
"q.bedrock_primary_quirk('<pokemon>', '<animation>', <minSeconds>, <maxSeconds>, <loopTimes>, '<excludedLabels>', q.curve('<waveFunction>'))"
]
}
```
### Localization
- Updated translations for:
- Simplified and Traditional Chinese.
- Spanish.
## [1.5.0 - The Ruins and Revival Update (May 12th, 2024)](#1-5-0)
#### "You're telling me that Mojang has added archaeology to the game? Hmm... that gives me an idea."
### Additions
+1 -1
View File
@@ -1,6 +1,6 @@
plugins {
id("cobblemon.root-conventions")
id ("net.nemerosa.versioning") version "2.8.2"
id ("net.nemerosa.versioning") version "3.1.0"
}
version = "${project.property("mod_version")}+${project.property("mc_version")}"
+8 -6
View File
@@ -1,8 +1,8 @@
import utilities.isSnapshot
import utilities.version
import java.time.OffsetDateTime
import java.time.ZoneOffset
import java.time.format.DateTimeFormatter
import utilities.isSnapshot
import utilities.version
/*
*
@@ -20,16 +20,17 @@ plugins {
id("net.kyori.blossom")
id("org.jetbrains.gradle.plugin.idea-ext")
id("net.nemerosa.versioning") version "2.8.2"
id("net.nemerosa.versioning")
}
architectury {
common("forge", "fabric")
common("neoforge", "fabric")
}
repositories {
maven(url = "${rootProject.projectDir}/deps")
maven(url = "https://api.modrinth.com/maven")
maven(url = "https://maven.neoforged.net/releases")
mavenLocal()
}
@@ -39,7 +40,7 @@ dependencies {
modApi(libs.molang)
// Integrations
compileOnlyApi(libs.jei.api)
// compileOnlyApi(libs.jei.api)
modCompileOnly(libs.bundles.fabric.integrations.compileOnly) {
isTransitive = false
}
@@ -89,7 +90,8 @@ sourceSets {
property("gitCommit", versioning.info.commit)
property("branch", versioning.info.branch)
System.getProperty("buildNumber")?.let { property("buildNumber", it) }
property("timestamp", OffsetDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ofPattern("MM/dd/yyyy hh:mm:ss")) + " UTC")
}
}
}
}
}
@@ -0,0 +1,24 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common;
import com.cobblemon.mod.common.entity.npc.NPCEntity;
import net.minecraft.entity.ai.brain.Brain;
import net.minecraft.entity.ai.brain.MemoryModuleType;
import net.minecraft.entity.ai.brain.sensor.Sensor;
import net.minecraft.entity.ai.brain.sensor.SensorType;
import java.util.Collection;
public class GenericsCheatClass {
// For some reason, doing this in the NPCEntity class in Kotlin gives confusing generic errors I could not resolve.
public static Brain.Profile<NPCEntity> createNPCBrain(Collection<MemoryModuleType<?>> memories, Collection<SensorType<? extends Sensor<? super NPCEntity>>> sensors) {
return Brain.createProfile(memories, sensors);
}
}
@@ -42,10 +42,7 @@ public interface Bone {
* @param buffer The vertex consumer deployed by the renderer
* @param packedLight The light level to be applied to the bone
* @param packedOverlay The overlay value to be applied to the bone
* @param r A value representing the amount of red coloring that should be applied on the RGB scale
* @param g A value representing the amount of green coloring that should be applied on the RGB scale
* @param b A value representing the amount of blue coloring that should be applied on the RGB scale
* @param a The alpha value to apply to the model based on the RGB scale
* @param color RGBA packed integer color value
*
* @since 1.4.0
*/
@@ -55,10 +52,7 @@ public interface Bone {
VertexConsumer buffer,
int packedLight,
int packedOverlay,
float r,
float g,
float b,
float a
int color
);
/**
@@ -13,8 +13,8 @@ import com.cobblemon.mod.common.client.render.layer.PokemonOnShoulderRenderer;
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity;
import com.cobblemon.mod.common.pokemon.FormData;
import com.cobblemon.mod.common.pokemon.lighthing.LightingData;
import dev.lambdaurora.lambdynlights.api.DynamicLightHandler;
import dev.lambdaurora.lambdynlights.api.DynamicLightHandlers;
//import dev.lambdaurora.lambdynlights.api.DynamicLightHandler;
//import dev.lambdaurora.lambdynlights.api.DynamicLightHandlers;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.Pair;
@@ -32,36 +32,36 @@ public class LambDynamicLightsCompat {
// Make sure not to call anything Fabric specific :)
public static void hookCompat() {
// Pokémon entities
DynamicLightHandlers.registerDynamicLightHandler(
CobblemonEntities.POKEMON,
DynamicLightHandler.makeHandler(
pokemon -> resolvedPokemonLightLevel(pokemon, false),
pokemon -> true
)
);
DynamicLightHandlers.registerDynamicLightHandler(
CobblemonEntities.POKEMON,
DynamicLightHandler.makeHandler(
pokemon -> resolvedPokemonLightLevel(pokemon, true),
pokemon -> false
)
);
// DynamicLightHandlers.registerDynamicLightHandler(
// CobblemonEntities.POKEMON,
// DynamicLightHandler.makeHandler(
// pokemon -> resolvedPokemonLightLevel(pokemon, false),
// pokemon -> true
// )
// );
// DynamicLightHandlers.registerDynamicLightHandler(
// CobblemonEntities.POKEMON,
// DynamicLightHandler.makeHandler(
// pokemon -> resolvedPokemonLightLevel(pokemon, true),
// pokemon -> false
// )
// );
// Shouldered Pokémon
DynamicLightHandlers.registerDynamicLightHandler(
EntityType.PLAYER,
DynamicLightHandler.makeHandler(
player -> resolvedShoulderLightLevel(player, false),
player -> true
)
);
DynamicLightHandlers.registerDynamicLightHandler(
EntityType.PLAYER,
DynamicLightHandler.makeHandler(
player -> resolvedShoulderLightLevel(player, true),
player -> false
)
);
// DynamicLightHandlers.registerDynamicLightHandler(
// EntityType.PLAYER,
// DynamicLightHandler.makeHandler(
// player -> resolvedShoulderLightLevel(player, false),
// player -> true
// )
// );
// DynamicLightHandlers.registerDynamicLightHandler(
// EntityType.PLAYER,
// DynamicLightHandler.makeHandler(
// player -> resolvedShoulderLightLevel(player, true),
// player -> false
// )
// );
}
private static int resolvedPokemonLightLevel(PokemonEntity pokemon, boolean underwater) {
@@ -17,4 +17,6 @@ public interface SoundManagerDuck {
void pauseSounds(@Nullable Identifier id, @Nullable SoundCategory category);
void resumeSounds(@Nullable Identifier id, @Nullable SoundCategory category);
void stopSounds(@Nullable Identifier id, @Nullable SoundCategory category);
}
@@ -21,5 +21,7 @@ public interface SoundSystemDuck {
void resumeSounds(@Nullable Identifier id, @Nullable SoundCategory category);
void stopSounds(@Nullable Identifier id, @Nullable SoundCategory category);
Collection<SoundInstance> getSounds(@Nullable SoundCategory category);
}
@@ -19,7 +19,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(CrashReport.class)
public final class CrashReportMixin {
@Inject(method = "addStackTrace", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/SystemDetails;writeTo(Ljava/lang/StringBuilder;)V"))
@Inject(method = "addDetails", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/SystemDetails;writeTo(Ljava/lang/StringBuilder;)V"))
public void cobblemon$printCobblemonDetails(StringBuilder builder, CallbackInfo callback) {
CrashReportSection cobblemon = new CrashReportSection("Cobblemon");
cobblemon.add("Version", CobblemonBuildDetails.VERSION);
@@ -9,6 +9,7 @@
package com.cobblemon.mod.common.mixin;
import com.cobblemon.mod.common.sherds.CobblemonSherds;
import net.minecraft.block.DecoratedPotPattern;
import net.minecraft.block.DecoratedPotPatterns;
import net.minecraft.item.Item;
import net.minecraft.registry.RegistryKey;
@@ -21,7 +22,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
public abstract class DecoratedPotPatternsMixin {
@Inject(method = "fromSherd", at=@At("HEAD"), cancellable = true)
private static void cobblemon$getCobblemonSherdTexture(Item sherd,
CallbackInfoReturnable<RegistryKey<String>> cir) {
CallbackInfoReturnable<RegistryKey<DecoratedPotPattern>> cir) {
if (CobblemonSherds.INSTANCE.getSherdToPattern().containsKey(sherd)) {
cir.setReturnValue(CobblemonSherds.INSTANCE.getSherdToPattern().get(sherd));
return;
@@ -11,6 +11,7 @@ package com.cobblemon.mod.common.mixin;
import com.cobblemon.mod.common.client.CobblemonClient;
import net.minecraft.client.render.entity.EntityRenderDispatcher;
import net.minecraft.client.render.entity.EntityRenderer;
import net.minecraft.client.util.SkinTextures;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.resource.ResourceManager;
import org.spongepowered.asm.mixin.Mixin;
@@ -24,7 +25,7 @@ import java.util.Map;
@Mixin(EntityRenderDispatcher.class)
public class EntityRenderDispatcherMixin {
@Shadow private Map<String, EntityRenderer<? extends PlayerEntity>> modelRenderers;
@Shadow private Map<SkinTextures.Model, EntityRenderer<? extends PlayerEntity>> modelRenderers;
@Inject(
method = "reload",
@@ -33,4 +34,4 @@ public class EntityRenderDispatcherMixin {
public void resourceManagerReloadHook(ResourceManager resourceManager, CallbackInfo ci) {
CobblemonClient.INSTANCE.onAddLayer(this.modelRenderers);
}
}
}
@@ -11,6 +11,7 @@ package com.cobblemon.mod.common.mixin;
import com.cobblemon.mod.common.api.scheduling.ClientTaskTracker;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.render.RenderTickCounter;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
@@ -26,7 +27,7 @@ public class GameRendererMixin {
method = "render",
at = @At(value = "TAIL")
)
public void render(float tickDelta, long startTime, boolean tick, CallbackInfo ci) {
public void render(RenderTickCounter counter, boolean tick, CallbackInfo ci) {
MinecraftClient client = MinecraftClient.getInstance();
long newTime = System.currentTimeMillis();
// Don't play scheduled animations when the game is paused
@@ -32,7 +32,7 @@ import org.spongepowered.asm.mixin.injection.points.BeforeStringInvoke;
@Mixin(ModelLoader.class)
public abstract class ModelLoaderMixin {
@Shadow protected abstract void addModel(ModelIdentifier modelId);
@Shadow protected abstract void addModelToBake(ModelIdentifier modelId, UnbakedModel unbakedModel);
@Final
@Shadow
@@ -53,8 +53,9 @@ public abstract class ModelLoaderMixin {
CallbackInfo ci) {
CobblemonBakingOverrides.INSTANCE.getModels().forEach(bakingOverride -> {
try {
this.unbakedModels.put(bakingOverride.getModelIdentifier(), this.loadModelFromJson(bakingOverride.getModelLocation()));
this.addModel(bakingOverride.getModelIdentifier());
JsonUnbakedModel unbakedModel = this.loadModelFromJson(bakingOverride.getModelLocation());
this.unbakedModels.put(bakingOverride.getModelIdentifier().id(), unbakedModel);
this.addModelToBake(bakingOverride.getModelIdentifier(), unbakedModel);
} catch (IOException e) {
LOGGER.error("Error loading a Cobblemon BakedModel:", e);
throw new RuntimeException(e);
@@ -8,13 +8,11 @@
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;
import net.minecraft.entity.Entity;
import org.jetbrains.annotations.NotNull;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
@@ -24,7 +22,7 @@ import java.util.Map;
@Mixin(ModelPart.class)
public abstract class ModelPartMixin implements Bone {
@Shadow public abstract void render(MatrixStack matrices, VertexConsumer vertices, int light, int overlay, float red, float green, float blue, float alpha);
@Shadow public abstract void render(MatrixStack matrices, VertexConsumer vertices, int light, int overlay, int color);
@Shadow public abstract void rotate(MatrixStack matrixStack);
@@ -38,8 +36,8 @@ public abstract class ModelPartMixin implements Bone {
}
@Override
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);
public void render(RenderContext context, MatrixStack stack, VertexConsumer buffer, int packedLight, int packedOverlay, int color) {
this.render(stack, buffer, packedLight, packedOverlay, color);
}
@Override
@@ -21,13 +21,13 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(Mouse.class)
public class PartyScrollMixin {
@Shadow
private double eventDeltaWheel;
private double eventDeltaVerticalWheel;
@Inject(
method = "onMouseScroll",
at = @At(
value = "FIELD",
target="Lnet/minecraft/client/Mouse;eventDeltaWheel:D",
target="Lnet/minecraft/client/Mouse;eventDeltaVerticalWheel:D",
opcode = Opcodes.PUTFIELD,
ordinal = 2,
shift = At.Shift.BEFORE
@@ -36,18 +36,18 @@ public class PartyScrollMixin {
)
public void onMouseScroll(long window, double horizontal, double vertical, CallbackInfo ci) {
if (PartySendBinding.INSTANCE.getWasDown()) {
int i = (int)eventDeltaWheel;
int i = (int)eventDeltaVerticalWheel;
if (i > 0) {
while (i-- > 0) CobblemonClient.INSTANCE.getStorage().shiftSelected(false);
ci.cancel();
eventDeltaWheel = 0;
eventDeltaVerticalWheel = 0;
PartySendBinding.INSTANCE.actioned();
} else if (i < 0) {
while (i++ < 0) CobblemonClient.INSTANCE.getStorage().shiftSelected(true);
ci.cancel();
eventDeltaWheel = 0;
eventDeltaVerticalWheel = 0;
PartySendBinding.INSTANCE.actioned();
}
}
}
}
}
@@ -18,6 +18,7 @@ import com.cobblemon.mod.common.api.tags.CobblemonItemTags;
import com.cobblemon.mod.common.pokemon.Pokemon;
import com.cobblemon.mod.common.util.CompoundTagExtensionsKt;
import com.cobblemon.mod.common.util.DataKeys;
import net.minecraft.component.type.FoodComponent;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.ItemEntity;
import net.minecraft.entity.LivingEntity;
@@ -138,7 +139,7 @@ public abstract class PlayerMixin extends LivingEntity {
shift = At.Shift.AFTER
)
)
public void onEatFood(World world, ItemStack stack, CallbackInfoReturnable<ItemStack> cir) {
public void onEatFood(World world, ItemStack stack, FoodComponent foodComponent, CallbackInfoReturnable<ItemStack> cir) {
if (!getWorld().isClient) {
if (stack.isIn(CobblemonItemTags.LEAVES_LEFTOVERS) && getWorld().random.nextDouble() < Cobblemon.config.getAppleLeftoversChance()) {
ItemStack leftovers = new ItemStack(CobblemonItems.LEFTOVERS);
@@ -60,6 +60,12 @@ public abstract class SoundManagerMixin implements SoundManagerDuck {
((SoundSystemDuck)soundSystem).resumeSounds(id, category);
}
/** Stops the queried SoundInstance(s). If id is null, will stop all sounds belonging to the SoundCategory. */
@Override
public void stopSounds(@Nullable Identifier id, @Nullable SoundCategory category) {
((SoundSystemDuck)soundSystem).stopSounds(id, category);
}
/** Blocks filtered sounds from being played while a BattleMusicInstance is in progress. */
@Inject(method = "play(Lnet/minecraft/client/sound/SoundInstance;)V", at = @At("HEAD"), cancellable = true)
public void playStart(SoundInstance sound, CallbackInfo cb) {
@@ -15,15 +15,8 @@ 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;
@@ -33,9 +26,6 @@ import java.util.*;
@Mixin(StructurePoolBasedGenerator.StructurePoolGenerator.class)
public abstract class StructurePoolGeneratorMixin {
@Final
@Mutable
@Shadow Deque<StructurePoolBasedGenerator.ShapedPoolStructurePiece> structurePieces;
Map<String, Integer> generatedStructureGroupCounts;
@@ -123,7 +113,7 @@ public abstract class StructurePoolGeneratorMixin {
return reducedList.iterator();
}
@ModifyVariable(method = "generatePiece", at = @At("STORE"), ordinal = 1)
@ModifyVariable(method = "generatePiece", at = @At("HEAD"), ordinal = 0, argsOnly = true)
private PoolStructurePiece injected(PoolStructurePiece poolStructurePiece) {
Identifier structureLocationKey = getCobblemonOnlyLocation(poolStructurePiece.getPoolElement());
if (structureLocationKey != null) {
@@ -133,42 +123,42 @@ public abstract class StructurePoolGeneratorMixin {
}
// 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);
}
// @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);
@@ -214,4 +204,4 @@ public abstract class StructurePoolGeneratorMixin {
//
// return reducedList;
// }
}
}
@@ -8,7 +8,6 @@
package com.cobblemon.mod.common.mixin.invoker;
import com.cobblemon.mod.common.integration.adorn.AdornCompatibility;
import java.util.List;
import juuxel.adorn.block.variant.BlockVariantSet;
import juuxel.adorn.block.variant.BlockVariantSets;
@@ -28,6 +27,6 @@ public abstract class AdornRegisterInvoker {
@Inject(method = "register()V", at = @At("HEAD"), remap = false)
void register(CallbackInfo ci) {
variantSets.add(AdornCompatibility.INSTANCE);
// variantSets.add(AdornCompatibility.INSTANCE);
}
}
@@ -9,7 +9,6 @@
package com.cobblemon.mod.common.mixin.invoker;
import net.minecraft.block.*;
import net.minecraft.resource.featuretoggle.FeatureFlag;
import net.minecraft.sound.BlockSoundGroup;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;
@@ -19,23 +18,23 @@ import org.spongepowered.asm.mixin.gen.Invoker;
public interface BlocksInvoker {
@Invoker("createLogBlock")
static PillarBlock createLogBlock(MapColor topMapColor, MapColor sideMapColor) {
static Block createLogBlock(MapColor topMapColor, MapColor sideMapColor) {
throw new UnsupportedOperationException();
}
@Invoker("createLeavesBlock")
static LeavesBlock createLeavesBlock(BlockSoundGroup soundGroup) {
static Block createLeavesBlock(BlockSoundGroup soundGroup) {
throw new UnsupportedOperationException();
}
@Invoker("createWoodenButtonBlock")
static ButtonBlock createWoodenButtonBlock(BlockSetType blockSetType, FeatureFlag... requiredFeatures) {
static Block createWoodenButtonBlock(BlockSetType blockSetType) {
throw new UnsupportedOperationException();
}
@Invoker("createFlowerPotBlock")
static FlowerPotBlock createFlowerPotBlock(Block flower, FeatureFlag... requiredFeatures) {
static Block createFlowerPotBlock(Block flower) {
throw new UnsupportedOperationException();
}
}
}
@@ -11,14 +11,13 @@ package com.cobblemon.mod.common.mixin.invoker;
import net.minecraft.block.AbstractBlock;
import net.minecraft.block.BlockSetType;
import net.minecraft.block.DoorBlock;
import net.minecraft.sound.SoundEvent;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;
@Mixin(DoorBlock.class)
public interface DoorBlockInvoker {
@Invoker("<init>")
static DoorBlock cobblemon$create(AbstractBlock.Settings settings, BlockSetType blockSetType) {
static DoorBlock cobblemon$create(BlockSetType blockSetType, AbstractBlock.Settings settings) {
throw new UnsupportedOperationException();
}
}
}
@@ -11,14 +11,13 @@ package com.cobblemon.mod.common.mixin.invoker;
import net.minecraft.block.AbstractBlock;
import net.minecraft.block.BlockSetType;
import net.minecraft.block.PressurePlateBlock;
import net.minecraft.sound.SoundEvent;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;
@Mixin(PressurePlateBlock.class)
public interface PressurePlateBlockInvoker {
@Invoker("<init>")
static PressurePlateBlock cobblemon$create(PressurePlateBlock.ActivationRule type, AbstractBlock.Settings settings, BlockSetType blockSetType) {
static PressurePlateBlock cobblemon$create(BlockSetType type, AbstractBlock.Settings settings) {
throw new UnsupportedOperationException();
}
}
}
@@ -0,0 +1,20 @@
package com.cobblemon.mod.common.mixin.invoker;
import net.minecraft.block.AbstractBlock;
import net.minecraft.block.BlockSetType;
import net.minecraft.block.PressurePlateBlock;
import net.minecraft.resource.featuretoggle.FeatureSet;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.screen.ScreenHandlerType;
import net.minecraft.screen.ScreenHandlerType.Factory;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.gen.Invoker;
@Mixin(ScreenHandlerType.class)
public interface ScreenHandlerTypeInvoker {
@Invoker("<init>")
static <T extends ScreenHandler> ScreenHandlerType<T> cobblemon$create(Factory<T> factory, FeatureSet requiredFeatures) {
throw new UnsupportedOperationException();
}
}
@@ -11,14 +11,13 @@ package com.cobblemon.mod.common.mixin.invoker;
import net.minecraft.block.AbstractBlock;
import net.minecraft.block.BlockSetType;
import net.minecraft.block.TrapdoorBlock;
import net.minecraft.sound.SoundEvent;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;
@Mixin(TrapdoorBlock.class)
public interface TrapdoorBlockInvoker {
@Invoker("<init>")
static TrapdoorBlock cobblemon$create(AbstractBlock.Settings settings, BlockSetType blockSetType) {
static TrapdoorBlock cobblemon$create(BlockSetType blockSetType, AbstractBlock.Settings settings) {
throw new UnsupportedOperationException();
}
}
}
@@ -27,6 +27,7 @@ import com.cobblemon.mod.common.api.events.CobblemonEvents.TRADE_COMPLETED
import com.cobblemon.mod.common.api.net.serializers.IdentifierDataSerializer
import com.cobblemon.mod.common.api.net.serializers.PoseTypeDataSerializer
import com.cobblemon.mod.common.api.net.serializers.StringSetDataSerializer
import com.cobblemon.mod.common.api.net.serializers.UUIDSetDataSerializer
import com.cobblemon.mod.common.api.net.serializers.Vec3DataSerializer
import com.cobblemon.mod.common.api.permission.PermissionValidator
import com.cobblemon.mod.common.api.pokeball.catching.calculators.CaptureCalculator
@@ -49,8 +50,13 @@ import com.cobblemon.mod.common.api.scheduling.ServerRealTimeTaskTracker
import com.cobblemon.mod.common.api.scheduling.ServerTaskTracker
import com.cobblemon.mod.common.api.spawning.BestSpawner
import com.cobblemon.mod.common.api.spawning.CobblemonSpawningProspector
import com.cobblemon.mod.common.api.spawning.WorldSlice
import com.cobblemon.mod.common.api.spawning.context.AreaContextResolver
import com.cobblemon.mod.common.api.spawning.context.AreaSpawningContext
import com.cobblemon.mod.common.api.spawning.context.calculators.AreaSpawningContextCalculator
import com.cobblemon.mod.common.api.spawning.context.calculators.AreaSpawningInput
import com.cobblemon.mod.common.api.spawning.prospecting.SpawningProspector
import com.cobblemon.mod.common.api.spawning.spawner.Spawner
import com.cobblemon.mod.common.api.starter.StarterHandler
import com.cobblemon.mod.common.api.storage.PokemonStoreManager
import com.cobblemon.mod.common.api.storage.adapter.conversions.ReforgedConversion
@@ -98,20 +104,15 @@ import com.cobblemon.mod.common.pokemon.aspects.SHINY_ASPECT
import com.cobblemon.mod.common.pokemon.evolution.variants.BlockClickEvolution
import com.cobblemon.mod.common.pokemon.feature.TagSeasonResolver
import com.cobblemon.mod.common.pokemon.helditem.CobblemonHeldItemManager
import com.cobblemon.mod.common.pokemon.properties.AspectPropertyType
import com.cobblemon.mod.common.pokemon.properties.HiddenAbilityPropertyType
import com.cobblemon.mod.common.pokemon.properties.UnaspectPropertyType
import com.cobblemon.mod.common.pokemon.properties.UncatchableProperty
import com.cobblemon.mod.common.pokemon.properties.tags.PokemonFlagProperty
import com.cobblemon.mod.common.pokemon.stat.CobblemonStatProvider
import com.cobblemon.mod.common.sherds.CobblemonSherds
import com.cobblemon.mod.common.starter.CobblemonStarterHandler
import com.cobblemon.mod.common.trade.TradeManager
import com.cobblemon.mod.common.util.DataKeys
import com.cobblemon.mod.common.util.cobblemonResource
import com.cobblemon.mod.common.util.ifDedicatedServer
import com.cobblemon.mod.common.util.isLaterVersion
import com.cobblemon.mod.common.util.party
import com.cobblemon.mod.common.util.removeAmountIf
import com.cobblemon.mod.common.util.server
import com.cobblemon.mod.common.util.*
import com.cobblemon.mod.common.world.feature.CobblemonPlacedFeatures
import com.cobblemon.mod.common.world.feature.ore.CobblemonOrePlacedFeatures
import com.cobblemon.mod.common.world.gamerules.CobblemonGameRules
@@ -126,6 +127,7 @@ import net.minecraft.item.Items
import net.minecraft.item.NameTagItem
import net.minecraft.registry.RegistryKey
import net.minecraft.util.WorldSavePath
import net.minecraft.util.math.BlockPos
import net.minecraft.world.World
import org.apache.logging.log4j.LogManager
import org.apache.logging.log4j.Logger
@@ -183,6 +185,7 @@ object Cobblemon {
implementation.registerPermissionValidator()
implementation.registerSoundEvents()
implementation.registerDataComponents()
implementation.registerBlocks()
implementation.registerItems()
implementation.registerEntityTypes()
@@ -190,6 +193,8 @@ object Cobblemon {
implementation.registerBlockEntityTypes()
implementation.registerWorldGenFeatures()
implementation.registerParticles()
implementation.registerEntityDataSerializers()
implementation.registerCriteria()
DropEntry.register("command", CommandDropEntry::class.java)
DropEntry.register("item", ItemDropEntry::class.java, isDefault = true)
@@ -203,7 +208,6 @@ object Cobblemon {
CobblemonPlacedFeatures.register()
this.registerArgumentTypes()
CobblemonCriteria // Init the fields and register the criteria
CobblemonGameRules // Init fields and register
ShoulderEffectRegistry.register()
@@ -235,7 +239,7 @@ object Cobblemon {
val player = event.player
val block = player.world.getBlockState(event.pos).block
player.party().forEach { pokemon ->
pokemon.evolutions
pokemon.lockedEvolutions
.filterIsInstance<BlockClickEvolution>()
.forEach { evolution ->
evolution.attemptEvolution(pokemon, BlockClickEvolution.BlockInteractionContext(block, player.world))
@@ -250,11 +254,6 @@ object Cobblemon {
it.player.party().forEach { pokemon -> pokemon.entity?.recallWithAnimation() }
}
TrackedDataHandlerRegistry.register(Vec3DataSerializer)
TrackedDataHandlerRegistry.register(StringSetDataSerializer)
TrackedDataHandlerRegistry.register(PoseTypeDataSerializer)
TrackedDataHandlerRegistry.register(IdentifierDataSerializer)
// Lowest priority because this applies after luxury ball bonus as of gen 4
CobblemonEvents.FRIENDSHIP_UPDATED.subscribe(Priority.LOWEST) { event ->
var increment = (event.newFriendship - event.pokemon.friendship).toFloat()
@@ -291,6 +290,8 @@ object Cobblemon {
CustomPokemonProperty.register(UncatchableProperty)
CustomPokemonProperty.register(PokemonFlagProperty)
CustomPokemonProperty.register(HiddenAbilityPropertyType)
CustomPokemonProperty.register(AspectPropertyType)
CustomPokemonProperty.register(UnaspectPropertyType)
ifDedicatedServer {
isDedicatedServer = true
@@ -372,36 +373,6 @@ object Cobblemon {
BATTLE_VICTORY.subscribe { AdvancementHandler.onWinBattle(it) }
EVOLUTION_COMPLETE.subscribe(Priority.LOWEST) { event ->
AdvancementHandler.onEvolve(event)
val pokemon = event.pokemon
val ninjaskIdentifier = cobblemonResource("ninjask")
// 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.isCreative || player.inventory.containsAny { it.item is PokeBallItem }) {
var pokeball = Items.AIR
player.inventory.combinedInventory.forEach {
it.forEach {
itemStack -> if (itemStack.item is PokeBallItem && pokeball == Items.AIR) {
pokeball = itemStack.item as 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()
product.removeHeldItem()
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) }
@@ -416,7 +387,8 @@ object Cobblemon {
).ifSuccessful { it.mute = true }
}
CobblemonSherds.registerSherds()
//To whomever is merging, this is moved out of Cobblemon and into the CobblemonImplementations
//CobblemonSherds.registerSherds()
}
fun getLevel(dimension: RegistryKey<World>): World? {
@@ -523,4 +495,4 @@ object Cobblemon {
this.implementation.registerCommandArgument(cobblemonResource("dialogue"), DialogueArgumentType::class, ConstantArgumentSerializer.of(DialogueArgumentType::dialogue))
}
}
}
@@ -13,6 +13,7 @@ import net.minecraft.entity.ai.brain.Activity
object CobblemonActivities {
val activities = mutableListOf<Activity>()
val BATTLING_ACTIVITY = Activity("pokemon_battling")
val NPC_BATTLING = Activity("npc_battling")
fun register(activity: Activity): Activity {
activities.add(activity)
@@ -45,6 +45,8 @@ object CobblemonBlockEntities : PlatformRegistry<Registry<BlockEntityType<*>>, R
val SIGN: BlockEntityType<CobblemonSignBlockEntity> = this.create("sign", BlockEntityType.Builder.create(::CobblemonSignBlockEntity, CobblemonBlocks.APRICORN_SIGN, CobblemonBlocks.APRICORN_WALL_SIGN).build(null))
@JvmField
val HANGING_SIGN: BlockEntityType<CobblemonHangingSignBlockEntity> = this.create("hanging_sign", BlockEntityType.Builder.create(::CobblemonHangingSignBlockEntity, CobblemonBlocks.APRICORN_HANGING_SIGN, CobblemonBlocks.APRICORN_WALL_HANGING_SIGN).build(null))
@JvmField
val TM_BLOCK: BlockEntityType<TMBlockEntity> = this.create("tm_block", BlockEntityType.Builder.create(::TMBlockEntity, CobblemonBlocks.TM_MACHINE).build(null))
@JvmField
val GILDED_CHEST: BlockEntityType<GildedChestBlockEntity> = this.create("chest", BlockEntityType.Builder.create(::GildedChestBlockEntity,
@@ -11,24 +11,21 @@ package com.cobblemon.mod.common
import com.cobblemon.mod.common.api.apricorn.Apricorn
import com.cobblemon.mod.common.block.*
import com.cobblemon.mod.common.block.MintBlock.MintType
import com.cobblemon.mod.common.block.FossilAnalyzerBlock
import com.cobblemon.mod.common.block.MonitorBlock
import com.cobblemon.mod.common.block.RestorationTankBlock
import com.cobblemon.mod.common.mixin.invoker.DoorBlockInvoker
import com.cobblemon.mod.common.mixin.invoker.PressurePlateBlockInvoker
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 com.cobblemon.mod.common.block.chest.GildedChestBlock
import com.cobblemon.mod.common.block.sign.CobblemonHangingSignBlock
import com.cobblemon.mod.common.block.sign.CobblemonSignBlock
import com.cobblemon.mod.common.block.sign.CobblemonWallHangingSignBlock
import com.cobblemon.mod.common.block.sign.CobblemonWallSignBlock
import com.cobblemon.mod.common.mixin.invoker.BlocksInvoker
import com.cobblemon.mod.common.mixin.invoker.DoorBlockInvoker
import com.cobblemon.mod.common.mixin.invoker.FireBlockInvoker
import com.cobblemon.mod.common.mixin.invoker.PressurePlateBlockInvoker
import com.cobblemon.mod.common.mixin.invoker.StairsBlockInvoker
import com.cobblemon.mod.common.mixin.invoker.TrapdoorBlockInvoker
import com.cobblemon.mod.common.platform.PlatformRegistry
import com.cobblemon.mod.common.util.cobblemonResource
import net.minecraft.block.*
import net.minecraft.block.enums.Instrument
import net.minecraft.block.enums.NoteBlockInstrument
import net.minecraft.block.piston.PistonBehavior
import net.minecraft.entity.effect.StatusEffects
import net.minecraft.registry.Registries
@@ -109,17 +106,17 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, RegistryKey<Registry<
@JvmField
val STRIPPED_APRICORN_WOOD = log("stripped_apricorn_wood")
@JvmField
val APRICORN_PLANKS = this.create("apricorn_planks", Block(AbstractBlock.Settings.create().mapColor(MapColor.DIRT_BROWN).instrument(Instrument.BASS).strength(2.0f, 3.0f).sounds(BlockSoundGroup.WOOD)))
val APRICORN_PLANKS = this.create("apricorn_planks", Block(AbstractBlock.Settings.create().mapColor(MapColor.DIRT_BROWN).instrument(NoteBlockInstrument.BASS).strength(2.0f, 3.0f).sounds(BlockSoundGroup.WOOD)))
@JvmField
val APRICORN_LEAVES = leaves("apricorn_leaves")
@JvmField
val APRICORN_FENCE = this.create("apricorn_fence", FenceBlock(AbstractBlock.Settings.create().mapColor(APRICORN_PLANKS.defaultMapColor).instrument(Instrument.BASS).strength(2.0f, 3.0f).sounds(BlockSoundGroup.WOOD)))
val APRICORN_FENCE = this.create("apricorn_fence", FenceBlock(AbstractBlock.Settings.create().mapColor(APRICORN_PLANKS.defaultMapColor).instrument(NoteBlockInstrument.BASS).strength(2.0f, 3.0f).sounds(BlockSoundGroup.WOOD)))
@JvmField
val APRICORN_FENCE_GATE = this.create("apricorn_fence_gate", FenceGateBlock(AbstractBlock.Settings.create().mapColor(APRICORN_PLANKS.defaultMapColor).instrument(Instrument.BASS).strength(2.0f, 3.0f).sounds(BlockSoundGroup.WOOD), APRICORN_WOOD_TYPE))
val APRICORN_FENCE_GATE = this.create("apricorn_fence_gate", FenceGateBlock(APRICORN_WOOD_TYPE, AbstractBlock.Settings.create().mapColor(APRICORN_PLANKS.defaultMapColor).strength(2.0f, 3.0f).sounds(BlockSoundGroup.WOOD)))
@JvmField // Note At the time of 1.20.0 we don't need our own BlockSetType for Apricorn wood
val APRICORN_BUTTON = this.create("apricorn_button", BlocksInvoker.createWoodenButtonBlock(BlockSetType.OAK))
@JvmField
val APRICORN_PRESSURE_PLATE = this.create("apricorn_pressure_plate", PressurePlateBlockInvoker.`cobblemon$create`(PressurePlateBlock.ActivationRule.EVERYTHING, AbstractBlock.Settings.create().mapColor(APRICORN_PLANKS.defaultMapColor).instrument(Instrument.BASS).noCollision().strength(0.5f).sounds(BlockSoundGroup.WOOD), APRICORN_BLOCK_SET_TYPE))
val APRICORN_PRESSURE_PLATE = this.create("apricorn_pressure_plate", PressurePlateBlockInvoker.`cobblemon$create`(APRICORN_BLOCK_SET_TYPE, AbstractBlock.Settings.create().mapColor(APRICORN_PLANKS.defaultMapColor).noCollision().strength(0.5f).sounds(BlockSoundGroup.WOOD)))
@JvmField
val APRICORN_SIGN = this.create("apricorn_sign", CobblemonSignBlock(AbstractBlock.Settings.copy(Blocks.OAK_SIGN), APRICORN_WOOD_TYPE))
@JvmField
@@ -129,13 +126,13 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, RegistryKey<Registry<
@JvmField
val APRICORN_WALL_HANGING_SIGN = this.create("apricorn_wall_hanging_sign", CobblemonWallHangingSignBlock(AbstractBlock.Settings.copy(Blocks.OAK_HANGING_SIGN), APRICORN_WOOD_TYPE))
@JvmField
val APRICORN_SLAB = this.create("apricorn_slab", SlabBlock(AbstractBlock.Settings.create().mapColor(MapColor.OAK_TAN).instrument(Instrument.BASS).strength(2.0f, 3.0f).sounds(BlockSoundGroup.WOOD)))
val APRICORN_SLAB = this.create("apricorn_slab", SlabBlock(AbstractBlock.Settings.create().mapColor(MapColor.OAK_TAN).instrument(NoteBlockInstrument.BASS).strength(2.0f, 3.0f).sounds(BlockSoundGroup.WOOD)))
@JvmField
val APRICORN_STAIRS = this.create("apricorn_stairs", StairsBlockInvoker.`cobblemon$create`(APRICORN_PLANKS.defaultState, AbstractBlock.Settings.copy(APRICORN_PLANKS)))
@JvmField
val APRICORN_DOOR = this.create("apricorn_door", DoorBlockInvoker.`cobblemon$create`(AbstractBlock.Settings.create().mapColor(APRICORN_PLANKS.defaultMapColor).instrument(Instrument.BASS).strength(3.0F).sounds(BlockSoundGroup.WOOD).nonOpaque(), APRICORN_BLOCK_SET_TYPE))
val APRICORN_DOOR = this.create("apricorn_door", DoorBlockInvoker.`cobblemon$create`(APRICORN_BLOCK_SET_TYPE, AbstractBlock.Settings.create().mapColor(APRICORN_PLANKS.defaultMapColor).instrument(NoteBlockInstrument.BASS).strength(3.0F).sounds(BlockSoundGroup.WOOD).nonOpaque()))
@JvmField
val APRICORN_TRAPDOOR = this.create("apricorn_trapdoor", TrapdoorBlockInvoker.`cobblemon$create`(AbstractBlock.Settings.create().mapColor(MapColor.OAK_TAN).instrument(Instrument.BASS).strength(3.0F).sounds(BlockSoundGroup.WOOD).nonOpaque().allowsSpawning { _, _, _, _ -> false }, APRICORN_BLOCK_SET_TYPE))
val APRICORN_TRAPDOOR = this.create("apricorn_trapdoor", TrapdoorBlockInvoker.`cobblemon$create`(APRICORN_BLOCK_SET_TYPE, AbstractBlock.Settings.create().mapColor(MapColor.OAK_TAN).instrument(NoteBlockInstrument.BASS).strength(3.0F).sounds(BlockSoundGroup.WOOD).nonOpaque().allowsSpawning { _, _, _, _ -> false }))
private val PLANT_PROPERTIES = AbstractBlock.Settings.create().mapColor(MapColor.DARK_GREEN).noCollision().ticksRandomly().breakInstantly().sounds(BlockSoundGroup.GRASS).pistonBehavior(PistonBehavior.DESTROY)
@JvmField
@@ -195,7 +192,7 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, RegistryKey<Registry<
.strength(1.0F)
.sounds(CobblemonSounds.TUMBLESTONE_BLOCK_SOUNDS)
.requiresTool()
.instrument(Instrument.BASEDRUM)
.instrument(NoteBlockInstrument.BASEDRUM)
))
@JvmField
val SKY_TUMBLESTONE_BLOCK = this.create("sky_tumblestone_block", Block(AbstractBlock.Settings.create()
@@ -203,7 +200,7 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, RegistryKey<Registry<
.strength(1.0F)
.sounds(CobblemonSounds.TUMBLESTONE_BLOCK_SOUNDS)
.requiresTool()
.instrument(Instrument.BASEDRUM)
.instrument(NoteBlockInstrument.BASEDRUM)
))
@JvmField
val BLACK_TUMBLESTONE_BLOCK = this.create("black_tumblestone_block", Block(AbstractBlock.Settings.create()
@@ -211,7 +208,214 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, RegistryKey<Registry<
.strength(1.0F)
.sounds(CobblemonSounds.TUMBLESTONE_BLOCK_SOUNDS)
.requiresTool()
.instrument(Instrument.BASEDRUM)
.instrument(NoteBlockInstrument.BASEDRUM)
))
@JvmField
val POLISHED_TUMBLESTONE = this.create("polished_tumblestone", Block(AbstractBlock.Settings.create()
.mapColor(MapColor.TERRACOTTA_ORANGE)
.strength(1.0F)
.sounds(CobblemonSounds.TUMBLESTONE_BLOCK_SOUNDS)
.requiresTool()
.instrument(NoteBlockInstrument.BASEDRUM)
))
@JvmField
val POLISHED_TUMBLESTONE_STAIRS = this.create("polished_tumblestone_stairs", StairsBlockInvoker.`cobblemon$create`(POLISHED_TUMBLESTONE.defaultState, AbstractBlock.Settings.copy(POLISHED_TUMBLESTONE)))
@JvmField
val POLISHED_TUMBLESTONE_SLAB = this.create("polished_tumblestone_slab", SlabBlock(AbstractBlock.Settings.create()
.mapColor(MapColor.TERRACOTTA_ORANGE)
.strength(1.0F)
.sounds(CobblemonSounds.TUMBLESTONE_BLOCK_SOUNDS)
.requiresTool()
.instrument(NoteBlockInstrument.BASEDRUM)
))
@JvmField
val POLISHED_TUMBLESTONE_WALL = this.create("polished_tumblestone_wall", WallBlock(AbstractBlock.Settings.create()
.mapColor(MapColor.TERRACOTTA_ORANGE)
.strength(1.0F)
.sounds(CobblemonSounds.TUMBLESTONE_BLOCK_SOUNDS)
.requiresTool()
.instrument(NoteBlockInstrument.BASEDRUM)
))
@JvmField
val CHISELED_POLISHED_TUMBLESTONE = this.create("chiseled_polished_tumblestone", Block(AbstractBlock.Settings.create()
.mapColor(MapColor.TERRACOTTA_ORANGE)
.strength(1.0F)
.sounds(CobblemonSounds.TUMBLESTONE_BLOCK_SOUNDS)
.requiresTool()
.instrument(NoteBlockInstrument.BASEDRUM)
))
@JvmField
val TUMBLESTONE_BRICKS = this.create("tumblestone_bricks", Block(AbstractBlock.Settings.create()
.mapColor(MapColor.TERRACOTTA_ORANGE)
.strength(1.0F)
.sounds(CobblemonSounds.TUMBLESTONE_BLOCK_SOUNDS)
.requiresTool()
.instrument(NoteBlockInstrument.BASEDRUM)
))
@JvmField
val TUMBLESTONE_BRICK_STAIRS = this.create("tumblestone_brick_stairs", StairsBlockInvoker.`cobblemon$create`(TUMBLESTONE_BRICKS.defaultState, AbstractBlock.Settings.copy(TUMBLESTONE_BRICKS)))
@JvmField
val TUMBLESTONE_BRICK_SLAB = this.create("tumblestone_brick_slab", SlabBlock(AbstractBlock.Settings.create()
.mapColor(MapColor.TERRACOTTA_ORANGE)
.strength(1.0F)
.sounds(CobblemonSounds.TUMBLESTONE_BLOCK_SOUNDS)
.requiresTool()
.instrument(NoteBlockInstrument.BASEDRUM)
))
@JvmField
val TUMBLESTONE_BRICK_WALL = this.create("tumblestone_brick_wall", WallBlock(AbstractBlock.Settings.create()
.mapColor(MapColor.TERRACOTTA_ORANGE)
.strength(1.0F)
.sounds(CobblemonSounds.TUMBLESTONE_BLOCK_SOUNDS)
.requiresTool()
.instrument(NoteBlockInstrument.BASEDRUM)
))
@JvmField
val CHISELED_TUMBLESTONE_BRICKS = this.create("chiseled_tumblestone_bricks", Block(AbstractBlock.Settings.create()
.mapColor(MapColor.TERRACOTTA_ORANGE)
.strength(1.0F)
.sounds(CobblemonSounds.TUMBLESTONE_BLOCK_SOUNDS)
.requiresTool()
.instrument(NoteBlockInstrument.BASEDRUM)
))
@JvmField
val POLISHED_SKY_TUMBLESTONE = this.create("polished_sky_tumblestone", Block(AbstractBlock.Settings.create()
.mapColor(MapColor.LIGHT_BLUE)
.strength(1.0F)
.sounds(CobblemonSounds.TUMBLESTONE_BLOCK_SOUNDS)
.requiresTool()
.instrument(NoteBlockInstrument.BASEDRUM)
))
@JvmField
val POLISHED_SKY_TUMBLESTONE_STAIRS = this.create("polished_sky_tumblestone_stairs", StairsBlockInvoker.`cobblemon$create`(POLISHED_SKY_TUMBLESTONE.defaultState, AbstractBlock.Settings.copy(POLISHED_SKY_TUMBLESTONE)))
@JvmField
val POLISHED_SKY_TUMBLESTONE_SLAB = this.create("polished_sky_tumblestone_slab", SlabBlock(AbstractBlock.Settings.create()
.mapColor(MapColor.LIGHT_BLUE)
.strength(1.0F)
.sounds(CobblemonSounds.TUMBLESTONE_BLOCK_SOUNDS)
.requiresTool()
.instrument(NoteBlockInstrument.BASEDRUM)
))
@JvmField
val POLISHED_SKY_TUMBLESTONE_WALL = this.create("polished_sky_tumblestone_wall", WallBlock(AbstractBlock.Settings.create()
.mapColor(MapColor.LIGHT_BLUE)
.strength(1.0F)
.sounds(CobblemonSounds.TUMBLESTONE_BLOCK_SOUNDS)
.requiresTool()
.instrument(NoteBlockInstrument.BASEDRUM)
))
@JvmField
val CHISELED_POLISHED_SKY_TUMBLESTONE = this.create("chiseled_polished_sky_tumblestone", Block(AbstractBlock.Settings.create()
.mapColor(MapColor.LIGHT_BLUE)
.strength(1.0F)
.sounds(CobblemonSounds.TUMBLESTONE_BLOCK_SOUNDS)
.requiresTool()
.instrument(NoteBlockInstrument.BASEDRUM)
))
@JvmField
val SKY_TUMBLESTONE_BRICKS = this.create("sky_tumblestone_bricks", Block(AbstractBlock.Settings.create()
.mapColor(MapColor.LIGHT_BLUE)
.strength(1.0F)
.sounds(CobblemonSounds.TUMBLESTONE_BLOCK_SOUNDS)
.requiresTool()
.instrument(NoteBlockInstrument.BASEDRUM)
))
@JvmField
val SKY_TUMBLESTONE_BRICK_STAIRS = this.create("sky_tumblestone_brick_stairs", StairsBlockInvoker.`cobblemon$create`(
SKY_TUMBLESTONE_BRICKS.defaultState, AbstractBlock.Settings.copy(SKY_TUMBLESTONE_BRICKS)))
@JvmField
val SKY_TUMBLESTONE_BRICK_SLAB = this.create("sky_tumblestone_brick_slab", SlabBlock(AbstractBlock.Settings.create()
.mapColor(MapColor.LIGHT_BLUE)
.strength(1.0F)
.sounds(CobblemonSounds.TUMBLESTONE_BLOCK_SOUNDS)
.requiresTool()
.instrument(NoteBlockInstrument.BASEDRUM)
))
@JvmField
val SKY_TUMBLESTONE_BRICK_WALL = this.create("sky_tumblestone_brick_wall", WallBlock(AbstractBlock.Settings.create()
.mapColor(MapColor.LIGHT_BLUE)
.strength(1.0F)
.sounds(CobblemonSounds.TUMBLESTONE_BLOCK_SOUNDS)
.requiresTool()
.instrument(NoteBlockInstrument.BASEDRUM)
))
@JvmField
val CHISELED_SKY_TUMBLESTONE_BRICKS = this.create("chiseled_sky_tumblestone_bricks", Block(AbstractBlock.Settings.create()
.mapColor(MapColor.LIGHT_BLUE)
.strength(1.0F)
.sounds(CobblemonSounds.TUMBLESTONE_BLOCK_SOUNDS)
.requiresTool()
.instrument(NoteBlockInstrument.BASEDRUM)
))
@JvmField
val POLISHED_BLACK_TUMBLESTONE = this.create("polished_black_tumblestone", Block(AbstractBlock.Settings.create()
.mapColor(MapColor.TERRACOTTA_BLACK)
.strength(1.0F)
.sounds(CobblemonSounds.TUMBLESTONE_BLOCK_SOUNDS)
.requiresTool()
.instrument(NoteBlockInstrument.BASEDRUM)
))
@JvmField
val POLISHED_BLACK_TUMBLESTONE_STAIRS = this.create("polished_black_tumblestone_stairs", StairsBlockInvoker.`cobblemon$create`(POLISHED_BLACK_TUMBLESTONE.defaultState, AbstractBlock.Settings.copy(POLISHED_BLACK_TUMBLESTONE)))
@JvmField
val POLISHED_BLACK_TUMBLESTONE_SLAB = this.create("polished_black_tumblestone_slab", SlabBlock(AbstractBlock.Settings.create()
.mapColor(MapColor.TERRACOTTA_BLACK)
.strength(1.0F)
.sounds(CobblemonSounds.TUMBLESTONE_BLOCK_SOUNDS)
.requiresTool()
.instrument(NoteBlockInstrument.BASEDRUM)
))
@JvmField
val POLISHED_BLACK_TUMBLESTONE_WALL = this.create("polished_black_tumblestone_wall", WallBlock(AbstractBlock.Settings.create()
.mapColor(MapColor.TERRACOTTA_BLACK)
.strength(1.0F)
.sounds(CobblemonSounds.TUMBLESTONE_BLOCK_SOUNDS)
.requiresTool()
.instrument(NoteBlockInstrument.BASEDRUM)
))
@JvmField
val CHISELED_POLISHED_BLACK_TUMBLESTONE = this.create("chiseled_polished_black_tumblestone", Block(AbstractBlock.Settings.create()
.mapColor(MapColor.TERRACOTTA_BLACK)
.strength(1.0F)
.sounds(CobblemonSounds.TUMBLESTONE_BLOCK_SOUNDS)
.requiresTool()
.instrument(NoteBlockInstrument.BASEDRUM)
))
@JvmField
val BLACK_TUMBLESTONE_BRICKS = this.create("black_tumblestone_bricks", Block(AbstractBlock.Settings.create()
.mapColor(MapColor.TERRACOTTA_BLACK)
.strength(1.0F)
.sounds(CobblemonSounds.TUMBLESTONE_BLOCK_SOUNDS)
.requiresTool()
.instrument(NoteBlockInstrument.BASEDRUM)
))
@JvmField
val BLACK_TUMBLESTONE_BRICK_STAIRS = this.create("black_tumblestone_brick_stairs", StairsBlockInvoker.`cobblemon$create`(
BLACK_TUMBLESTONE_BRICKS.defaultState, AbstractBlock.Settings.copy(BLACK_TUMBLESTONE_BRICKS)))
@JvmField
val BLACK_TUMBLESTONE_BRICK_SLAB = this.create("black_tumblestone_brick_slab", SlabBlock(AbstractBlock.Settings.create()
.mapColor(MapColor.TERRACOTTA_BLACK)
.strength(1.0F)
.sounds(CobblemonSounds.TUMBLESTONE_BLOCK_SOUNDS)
.requiresTool()
.instrument(NoteBlockInstrument.BASEDRUM)
))
@JvmField
val BLACK_TUMBLESTONE_BRICK_WALL = this.create("black_tumblestone_brick_wall", WallBlock(AbstractBlock.Settings.create()
.mapColor(MapColor.TERRACOTTA_BLACK)
.strength(1.0F)
.sounds(CobblemonSounds.TUMBLESTONE_BLOCK_SOUNDS)
.requiresTool()
.instrument(NoteBlockInstrument.BASEDRUM)
))
@JvmField
val CHISELED_BLACK_TUMBLESTONE_BRICKS = this.create("chiseled_black_tumblestone_bricks", Block(AbstractBlock.Settings.create()
.mapColor(MapColor.TERRACOTTA_BLACK)
.strength(1.0F)
.sounds(CobblemonSounds.TUMBLESTONE_BLOCK_SOUNDS)
.requiresTool()
.instrument(NoteBlockInstrument.BASEDRUM)
))
@JvmField
@@ -234,7 +438,7 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, RegistryKey<Registry<
"relic_coin_pouch",
CoinPouchBlock(
AbstractBlock.Settings.create()
.sounds(CobblemonSounds.COIN_POUCH_SOUNDS)
.sounds(CobblemonSounds.RELIC_COIN_POUCH_SOUNDS)
.pistonBehavior(PistonBehavior.DESTROY)
.strength(0.4f)
.nonOpaque(), true
@@ -245,7 +449,7 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, RegistryKey<Registry<
"relic_coin_sack",
CoinPouchBlock(
AbstractBlock.Settings.create()
.sounds(CobblemonSounds.COIN_POUCH_SOUNDS)
.sounds(CobblemonSounds.RELIC_COIN_SACK_SOUNDS)
.pistonBehavior(PistonBehavior.DESTROY)
.strength(0.4f), false
))
@@ -387,6 +591,17 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, RegistryKey<Registry<
.luminance { if ((it.get(PCBlock.ON) as Boolean) && (it.get(PCBlock.PART) == PCBlock.PCPart.TOP)) 10 else 0 }
)
)
val TM_MACHINE = create(
"tm_machine",
TMBlock(
AbstractBlock.Settings.create()
.mapColor(MapColor.GREEN)
.sounds(BlockSoundGroup.METAL)
.pistonBehavior(PistonBehavior.BLOCK)
.nonOpaque()
.luminance { if (it.get(TMBlock.ON) as Boolean) 10 else 0 }
)
)
@JvmField
val DISPLAY_CASE = create(
@@ -430,10 +645,71 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, RegistryKey<Registry<
@JvmField
val VIVICHOKE_SEEDS = this.create("vivichoke_seeds", VivichokeBlock(AbstractBlock.Settings.create().pistonBehavior(PistonBehavior.DESTROY).burnable().mapColor(MapColor.DARK_GREEN).noCollision().ticksRandomly().breakInstantly().sounds(CobblemonSounds.VIVICHOKE_SOUNDS)))
@JvmField
val PEP_UP_FLOWER = this.create("pep_up_flower", FlowerBlock(StatusEffects.LEVITATION, 10, AbstractBlock.Settings.create().mapColor(MapColor.DARK_GREEN).noCollision().breakInstantly().sounds(BlockSoundGroup.GRASS).offset(AbstractBlock.OffsetType.XZ).pistonBehavior(PistonBehavior.DESTROY)))
val PEP_UP_FLOWER = this.create("pep_up_flower", FlowerBlock(StatusEffects.LEVITATION, 10F, AbstractBlock.Settings.create().mapColor(MapColor.DARK_GREEN).noCollision().breakInstantly().sounds(BlockSoundGroup.GRASS).offset(AbstractBlock.OffsetType.XZ).pistonBehavior(PistonBehavior.DESTROY)))
@JvmField
val POTTED_PEP_UP_FLOWER = this.create("potted_pep_up_flower", BlocksInvoker.createFlowerPotBlock(PEP_UP_FLOWER))
@JvmField
val NORMAL_TYPE_GEM_BLOCK = this.create("normal_type_gem_block", Block(AbstractBlock.Settings.copy(Blocks.AMETHYST_BLOCK)))
@JvmField
val NORMAL_TYPE_GEM = typeGem(
"normal_type_gem",
GrowableStoneBlock.STAGE_3,
7,
3,
null,
NORMAL_TYPE_GEM_BLOCK
)
@JvmField
val LARGE_BUDDING_NORMAL_TYPE_GEM = typeGem(
"large_budding_normal_type_gem",
GrowableStoneBlock.STAGE_2,
5,
3,
NORMAL_TYPE_GEM,
NORMAL_TYPE_GEM_BLOCK
)
@JvmField
val MEDIUM_BUDDING_NORMAL_TYPE_GEM = typeGem(
"medium_budding_normal_type_gem",
GrowableStoneBlock.STAGE_1,
4,
3,
LARGE_BUDDING_NORMAL_TYPE_GEM,
NORMAL_TYPE_GEM_BLOCK
)
@JvmField
val SMALL_BUDDING_NORMAL_TYPE_GEM = typeGem(
"small_budding_normal_type_gem",
GrowableStoneBlock.STAGE_0,
3,
4,
MEDIUM_BUDDING_NORMAL_TYPE_GEM,
NORMAL_TYPE_GEM_BLOCK
)
private fun typeGem(
name: String,
stage: Int,
height: Int,
xzOffset: Int,
nextStage: Block?,
baseBlock: Block
): TypeGemBlock {
return this.create(name, TypeGemBlock(
settings = AbstractBlock.Settings.create()
.pistonBehavior(PistonBehavior.DESTROY)
.nonOpaque()
.strength(1.5F)
.sounds(CobblemonSounds.TYPE_GEM_SOUNDS),
stage = stage,
height = height,
xzOffset = xzOffset,
nextStage = nextStage,
baseBlock = baseBlock
))
}
/**
* Returns a map of all the blocks that can be stripped with an axe in the format of input - output.
*
@@ -444,8 +720,6 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, RegistryKey<Registry<
APRICORN_LOG to STRIPPED_APRICORN_LOG
)
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 fun tumblestoneBlock(name: String, stage: Int, height: Int, xzOffset: Int, nextStage: Block?) : Block {
@@ -528,6 +802,7 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, RegistryKey<Registry<
val WEPEAR_BERRY = this.berryBlock("wepear")
val WIKI_BERRY = this.berryBlock("wiki")
val YACHE_BERRY = this.berryBlock("yache")
//val BINDING_SOIL = this.create("binding_soil", BindingSoilBlock(AbstractBlock.Settings.create()))
init {
/**
@@ -560,7 +835,7 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, RegistryKey<Registry<
/**
* Calls helper method from Vanilla
*/
private fun log(name: String, arg: MapColor = MapColor.DIRT_BROWN, arg2: MapColor = MapColor.DIRT_BROWN): PillarBlock {
private fun log(name: String, arg: MapColor = MapColor.DIRT_BROWN, arg2: MapColor = MapColor.DIRT_BROWN): Block {
val block = BlocksInvoker.createLogBlock(arg, arg2)
return this.create(name, block)
}
@@ -580,16 +855,16 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, RegistryKey<Registry<
return block
}
private fun evolutionStoneOre(name: String) = this.create(name, ExperienceDroppingBlock(AbstractBlock.Settings.copy(Blocks.IRON_ORE), UniformIntProvider.create(1, 2)))
private fun evolutionStoneOre(name: String) = this.create(name, ExperienceDroppingBlock(UniformIntProvider.create(1, 2), AbstractBlock.Settings.copy(Blocks.IRON_ORE)))
private fun deepslateEvolutionStoneOre(name: String) = this.create(name, ExperienceDroppingBlock(AbstractBlock.Settings.copy(Blocks.DEEPSLATE_IRON_ORE), UniformIntProvider.create(1, 2)))
private fun deepslateEvolutionStoneOre(name: String) = this.create(name, ExperienceDroppingBlock(UniformIntProvider.create(1, 2), AbstractBlock.Settings.copy(Blocks.DEEPSLATE_IRON_ORE)))
/**
* Helper method for creating leaves
* copied over from Vanilla
*/
private fun leaves(name: String): LeavesBlock {
private fun leaves(name: String): Block {
val block = BlocksInvoker.createLeavesBlock(BlockSoundGroup.GRASS)
return this.create(name, block)
}
}
}
@@ -48,6 +48,7 @@ object CobblemonCommands {
PokemonRestartCommand.register(dispatcher)
BedrockParticleCommand.register(dispatcher)
OpenDialogueCommand.register(dispatcher)
NPCEditCommand.register(dispatcher)
// Possibly lock down registration if and only if under dev environment or running in an environment
// with a certain system environment variable set
@@ -11,7 +11,9 @@ package com.cobblemon.mod.common
import com.cobblemon.mod.common.api.pokeball.PokeBalls
import com.cobblemon.mod.common.entity.boat.CobblemonBoatEntity
import com.cobblemon.mod.common.entity.boat.CobblemonChestBoatEntity
import com.cobblemon.mod.common.entity.fishing.PokeRodFishingBobberEntity
import com.cobblemon.mod.common.entity.generic.GenericBedrockEntity
import com.cobblemon.mod.common.entity.npc.NPCEntity
import com.cobblemon.mod.common.entity.pokeball.EmptyPokeBallEntity
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.platform.PlatformRegistry
@@ -53,7 +55,7 @@ object CobblemonEntities : PlatformRegistry<Registry<EntityType<*>>, RegistryKey
@JvmField
val BOAT: EntityType<CobblemonBoatEntity> = this.create(
BOAT_KEY.path,
EntityType.Builder.create(::CobblemonBoatEntity, SpawnGroup.MISC).setDimensions(1.375F, 0.5625F).maxTrackingRange(10)
EntityType.Builder.create(::CobblemonBoatEntity, SpawnGroup.MISC).dimensions(1.375F, 0.5625F).maxTrackingRange(10)
.build(BOAT_KEY.toString())
)
@@ -62,10 +64,19 @@ object CobblemonEntities : PlatformRegistry<Registry<EntityType<*>>, RegistryKey
@JvmField
val CHEST_BOAT: EntityType<CobblemonChestBoatEntity> = this.create(
CHEST_BOAT_KEY.path,
EntityType.Builder.create(::CobblemonChestBoatEntity, SpawnGroup.MISC).setDimensions(1.375F, 0.5625F).maxTrackingRange(10)
EntityType.Builder.create(::CobblemonChestBoatEntity, SpawnGroup.MISC).dimensions(1.375F, 0.5625F).maxTrackingRange(10)
.build(CHEST_BOAT_KEY.toString())
)
@JvmField
val POKE_BOBBER_KEY = cobblemonResource("poke_bobber")
@JvmField
val POKE_BOBBER: EntityType<PokeRodFishingBobberEntity> = this.create(
POKE_BOBBER_KEY.path,
EntityType.Builder.create(::PokeRodFishingBobberEntity, SpawnGroup.MISC).dimensions(0.5F, 0.5F).maxTrackingRange(10)
.build(POKE_BOBBER_KEY.toString())
)
@JvmField
val GENERIC_BEDROCK_ENTITY_KEY = cobblemonResource("generic_bedrock")
@JvmField
@@ -75,8 +86,16 @@ object CobblemonEntities : PlatformRegistry<Registry<EntityType<*>>, RegistryKey
.build(GENERIC_BEDROCK_ENTITY_KEY.toString())
)
@JvmField
val NPC_KEY = cobblemonResource("npc")
@JvmField
val NPC: EntityType<NPCEntity> = create(
NPC_KEY.path,
EntityType.Builder.create({ _, world -> NPCEntity(world) }, SpawnGroup.CREATURE).build("$NPC_KEY")
)
fun registerAttributes(consumer: (EntityType<out LivingEntity>, DefaultAttributeContainer.Builder) -> Unit) {
consumer(POKEMON, PokemonEntity.createAttributes())
consumer(NPC, NPCEntity.createAttributes())
}
}
@@ -9,23 +9,18 @@
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
import com.mojang.brigadier.arguments.ArgumentType
import kotlin.reflect.KClass
import net.minecraft.advancement.criterion.Criterion
import net.minecraft.block.ComposterBlock
import net.minecraft.command.argument.serialize.ArgumentSerializer
import net.minecraft.item.ItemConvertible
import net.minecraft.network.PacketByteBuf
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.screen.ScreenHandlerType
import net.minecraft.server.MinecraftServer
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.text.Text
@@ -70,6 +65,10 @@ interface CobblemonImplementation {
*/
fun registerSoundEvents()
fun registerDataComponents()
fun registerEntityDataSerializers()
/**
* TODO
*
@@ -108,6 +107,7 @@ interface CobblemonImplementation {
fun registerParticles()
/**
* Add a feature to the current platform implementation.
*
@@ -146,7 +146,7 @@ interface CobblemonImplementation {
* @param criteria
* @return
*/
fun <T : Criterion<*>> registerCriteria(criteria: T): T
fun registerCriteria()
/**
* TODO
@@ -158,6 +158,8 @@ interface CobblemonImplementation {
*/
fun registerResourceReloader(identifier: Identifier, reloader: ResourceReloader, type: ResourceType, dependencies: Collection<Identifier>)
fun registerScreenHandlerType(identifier: Identifier, screenHandlerType: ScreenHandlerType<*>)
/**
* TODO
*
@@ -214,30 +216,17 @@ enum class ResourcePackActivationBehaviour {
enum class ModAPI {
FABRIC,
FORGE
FORGE,
NEOFORGE
}
interface NetworkManager {
fun registerClientBound()
fun registerServerBound()
fun <T: NetworkPacket<T>> createClientBound(identifier: Identifier, kClass: KClass<T>, encoder: (T, PacketByteBuf) -> Unit, decoder: (PacketByteBuf) -> T, handler: ClientNetworkPacketHandler<T>)
fun <T: NetworkPacket<T>> createServerBound(identifier: Identifier, kClass: KClass<T>, encoder: (T, PacketByteBuf) -> Unit, decoder: (PacketByteBuf) -> T, handler: ServerNetworkPacketHandler<T>)
fun sendPacketToPlayer(player: ServerPlayerEntity, packet: NetworkPacket<*>)
fun sendPacketToServer(packet: NetworkPacket<*>)
fun <T : NetworkPacket<*>> asVanillaClientBound(packet: T): Packet<ClientPlayPacketListener>
fun sendToServer(packet: NetworkPacket<*>)
}
enum class Environment {
CLIENT,
SERVER
}
}
@@ -0,0 +1,53 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common
import com.cobblemon.mod.common.item.components.HeldItemCapableComponent
import com.cobblemon.mod.common.item.components.PokemonItemComponent
import com.cobblemon.mod.common.item.RodBaitComponent
import com.cobblemon.mod.common.item.components.TMMoveComponent
import com.cobblemon.mod.common.platform.PlatformRegistry
import net.minecraft.component.ComponentType
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
object CobblemonItemComponents : PlatformRegistry<Registry<ComponentType<*>>, RegistryKey<Registry<ComponentType<*>>>, ComponentType<*>>() {
val POKEMON_ITEM: ComponentType<PokemonItemComponent> = ComponentType.builder<PokemonItemComponent>()
.codec(PokemonItemComponent.CODEC)
.packetCodec(PokemonItemComponent.PACKET_CODEC)
.build()
val HELD_ITEM_REP: ComponentType<HeldItemCapableComponent> = ComponentType.builder<HeldItemCapableComponent>()
.codec(HeldItemCapableComponent.CODEC)
.packetCodec(HeldItemCapableComponent.PACKET_CODEC)
.build()
val BAIT: ComponentType<RodBaitComponent> = ComponentType.builder<RodBaitComponent>()
.codec(RodBaitComponent.CODEC)
.packetCodec(RodBaitComponent.PACKET_CODEC)
.build()
val TM_MOVE: ComponentType<TMMoveComponent> = ComponentType.builder<TMMoveComponent>()
.codec(TMMoveComponent.CODEC)
.packetCodec(TMMoveComponent.PACKET_CODEC)
.build()
fun register() {
Registry.register(Registries.DATA_COMPONENT_TYPE, Identifier.of("cobblemon:pokemon_item"), POKEMON_ITEM)
Registry.register(Registries.DATA_COMPONENT_TYPE, Identifier.of("cobblemon:bait"), BAIT)
Registry.register(Registries.DATA_COMPONENT_TYPE, Identifier.of("cobblemon:tm_move"), TM_MOVE)
}
override val registry = Registries.DATA_COMPONENT_TYPE
override val registryKey = RegistryKeys.DATA_COMPONENT_TYPE
}
@@ -14,6 +14,8 @@ import com.cobblemon.mod.common.api.pokeball.PokeBalls
import com.cobblemon.mod.common.api.pokemon.Natures
import com.cobblemon.mod.common.api.pokemon.stats.Stats
import com.cobblemon.mod.common.api.pokemon.status.Statuses
import com.cobblemon.mod.common.api.text.blue
import com.cobblemon.mod.common.api.text.gray
import com.cobblemon.mod.common.block.BerryBlock
import com.cobblemon.mod.common.block.MintBlock
import com.cobblemon.mod.common.block.MintBlock.MintType
@@ -23,6 +25,7 @@ import com.cobblemon.mod.common.item.armor.CobblemonArmorTrims
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.BerryItem
import com.cobblemon.mod.common.item.berry.FriendshipRaisingBerryItem
import com.cobblemon.mod.common.item.berry.HealingBerryItem
import com.cobblemon.mod.common.item.berry.PPRestoringBerryItem
@@ -30,21 +33,29 @@ import com.cobblemon.mod.common.item.berry.PortionHealingBerryItem
import com.cobblemon.mod.common.item.berry.StatusCuringBerryItem
import com.cobblemon.mod.common.item.berry.VolatileCuringBerryItem
import com.cobblemon.mod.common.item.interactive.*
import com.cobblemon.mod.common.item.interactive.PotionItem
import com.cobblemon.mod.common.item.interactive.ability.AbilityChangeItem
import com.cobblemon.mod.common.platform.PlatformRegistry
import com.cobblemon.mod.common.pokeball.PokeBall
import com.cobblemon.mod.common.pokemon.helditem.CobblemonHeldItemManager
import com.cobblemon.mod.common.util.cobblemonResource
import net.minecraft.block.Block
import net.minecraft.component.DataComponentTypes
import net.minecraft.component.type.FoodComponent
import net.minecraft.entity.LivingEntity
import net.minecraft.entity.effect.StatusEffectInstance
import net.minecraft.entity.effect.StatusEffects
import net.minecraft.item.*
import net.minecraft.item.BlockItem
import net.minecraft.item.HangingSignItem
import net.minecraft.item.Item
import net.minecraft.item.ItemStack
import net.minecraft.item.Items
import net.minecraft.item.SignItem
import net.minecraft.item.SmithingTemplateItem
import net.minecraft.registry.Registries
import net.minecraft.registry.Registry
import net.minecraft.registry.RegistryKey
import net.minecraft.registry.RegistryKeys
import net.minecraft.text.Text
import net.minecraft.util.Identifier
import net.minecraft.world.World
@@ -252,6 +263,7 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<It
val HEALING_MACHINE = blockItem("healing_machine", CobblemonBlocks.HEALING_MACHINE)
@JvmField
val PC = blockItem("pc", CobblemonBlocks.PC)
val TM_MACHINE = blockItem("tm_machine", CobblemonBlocks.TM_MACHINE)
@JvmField
val PASTURE = blockItem("pasture", CobblemonBlocks.PASTURE)
@JvmField
@@ -408,15 +420,15 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<It
@JvmField
val CLEVER_FEATHER = create("clever_feather", FeatherItem(Stats.SPECIAL_DEFENCE))
@JvmField
val MEDICINAL_LEEK = heldItem("medicinal_leek", MedicinalLeekItem(CobblemonBlocks.MEDICINAL_LEEK, Item.Settings().food(FoodComponent.Builder().snack().hunger(1).saturationModifier(0.2f).build())), "leek")
val MEDICINAL_LEEK = heldItem("medicinal_leek", MedicinalLeekItem(CobblemonBlocks.MEDICINAL_LEEK, Item.Settings().food(FoodComponent.Builder().snack().nutrition(1).saturationModifier(0.2f).build())), "leek")
@JvmField
val ROASTED_LEEK = create("roasted_leek", Item(Item.Settings().food(FoodComponent.Builder().snack().hunger(3).saturationModifier(0.3f).build())))
val ROASTED_LEEK = create("roasted_leek", Item(Item.Settings().food(FoodComponent.Builder().snack().nutrition(3).saturationModifier(0.3f).build())))
@JvmField
val BRAISED_VIVICHOKE = create("braised_vivichoke", Item(Item.Settings().food(FoodComponent.Builder().hunger(6).saturationModifier(0.6f).build())))
val BRAISED_VIVICHOKE = create("braised_vivichoke", Item(Item.Settings().food(FoodComponent.Builder().nutrition(6).saturationModifier(0.6f).build())))
@JvmField
val VIVICHOKE_DIP = create("vivichoke_dip", object : StewItem(Settings().maxCount(1)
val VIVICHOKE_DIP = create("vivichoke_dip", object : Item(Settings().maxCount(1)
.food(FoodComponent.Builder()
.hunger(10)
.nutrition(10)
.saturationModifier(1.2F)
.statusEffect(StatusEffectInstance(StatusEffects.ABSORPTION, 900, 0), 1F)
.alwaysEdible()
@@ -427,7 +439,7 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<It
}
})
@JvmField
val ENERGY_ROOT = compostableItem("energy_root", EnergyRootItem(CobblemonBlocks.ENERGY_ROOT, Item.Settings().food(FoodComponent.Builder().hunger(1).snack().saturationModifier(0.2f).build())))
val ENERGY_ROOT = compostableItem("energy_root", EnergyRootItem(CobblemonBlocks.ENERGY_ROOT, Item.Settings().food(FoodComponent.Builder().nutrition(1).snack().saturationModifier(0.2f).build())))
@JvmField
val REVIVAL_HERB = compostableItem("revival_herb", RevivalHerbItem(CobblemonBlocks.REVIVAL_HERB))
@JvmField
@@ -455,7 +467,7 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<It
@JvmField
val HEAL_POWDER = create("heal_powder", HealPowderItem())
@JvmField
val LEEK_AND_POTATO_STEW = create("leek_and_potato_stew", StewItem(Item.Settings().food(FoodComponent.Builder().hunger(8).saturationModifier(0.6f).build()).maxCount(1)))
val LEEK_AND_POTATO_STEW = create("leek_and_potato_stew", Item(Item.Settings().food(FoodComponent.Builder().nutrition(8).saturationModifier(0.6f).build()).maxCount(1)))
@JvmField
val REVIVE = create("revive", ReviveItem(max = false))
@JvmField
@@ -932,12 +944,182 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<It
@JvmField
val BLACK_TUMBLESTONE_BLOCK = blockItem("black_tumblestone_block", CobblemonBlocks.BLACK_TUMBLESTONE_BLOCK)
@JvmField
val POKEROD_SMITHING_TEMPLATE = create("pokerod_smithing_template", SmithingTemplateItem(
Text.translatable("item.minecraft.fishing_rod").blue(),
Text.translatable("item.cobblemon.smithing_template.pokerod.ingredients").blue(),
Text.translatable("upgrade.cobblemon.pokerod").gray(),
Text.translatable("item.cobblemon.smithing_template.pokerod.base_slot_description"),
Text.translatable("item.cobblemon.smithing_template.pokerod.additions_slot_description"),
listOf(cobblemonResource("item/empty_slot_fishing_rod")),
listOf(cobblemonResource("item/empty_slot_pokeball"))
))
@JvmField
val POLISHED_TUMBLESTONE = blockItem("polished_tumblestone", CobblemonBlocks.POLISHED_TUMBLESTONE)
@JvmField
val POLISHED_TUMBLESTONE_STAIRS = blockItem("polished_tumblestone_stairs", CobblemonBlocks.POLISHED_TUMBLESTONE_STAIRS)
@JvmField
val POLISHED_TUMBLESTONE_SLAB = blockItem("polished_tumblestone_slab", CobblemonBlocks.POLISHED_TUMBLESTONE_SLAB)
@JvmField
val POLISHED_TUMBLESTONE_WALL = blockItem("polished_tumblestone_wall", CobblemonBlocks.POLISHED_TUMBLESTONE_WALL)
@JvmField
val CHISELED_POLISHED_TUMBLESTONE = blockItem("chiseled_polished_tumblestone", CobblemonBlocks.CHISELED_POLISHED_TUMBLESTONE)
@JvmField
val TUMBLESTONE_BRICKS = blockItem("tumblestone_bricks", CobblemonBlocks.TUMBLESTONE_BRICKS)
@JvmField
val TUMBLESTONE_BRICK_STAIRS = blockItem("tumblestone_brick_stairs", CobblemonBlocks.TUMBLESTONE_BRICK_STAIRS)
@JvmField
val TUMBLESTONE_BRICK_SLAB = blockItem("tumblestone_brick_slab", CobblemonBlocks.TUMBLESTONE_BRICK_SLAB)
@JvmField
val TUMBLESTONE_BRICK_WALL = blockItem("tumblestone_brick_wall", CobblemonBlocks.TUMBLESTONE_BRICK_WALL)
@JvmField
val CHISELED_TUMBLESTONE_BRICKS = blockItem("chiseled_tumblestone_bricks", CobblemonBlocks.CHISELED_TUMBLESTONE_BRICKS)
@JvmField
val POLISHED_SKY_TUMBLESTONE = blockItem("polished_sky_tumblestone", CobblemonBlocks.POLISHED_SKY_TUMBLESTONE)
@JvmField
val POLISHED_SKY_TUMBLESTONE_STAIRS = blockItem("polished_sky_tumblestone_stairs", CobblemonBlocks.POLISHED_SKY_TUMBLESTONE_STAIRS)
@JvmField
val POLISHED_SKY_TUMBLESTONE_SLAB = blockItem("polished_sky_tumblestone_slab", CobblemonBlocks.POLISHED_SKY_TUMBLESTONE_SLAB)
@JvmField
val POLISHED_SKY_TUMBLESTONE_WALL = blockItem("polished_sky_tumblestone_wall", CobblemonBlocks.POLISHED_SKY_TUMBLESTONE_WALL)
@JvmField
val CHISELED_POLISHED_SKY_TUMBLESTONE = blockItem("chiseled_polished_sky_tumblestone", CobblemonBlocks.CHISELED_POLISHED_SKY_TUMBLESTONE)
@JvmField
val SKY_TUMBLESTONE_BRICKS = blockItem("sky_tumblestone_bricks", CobblemonBlocks.SKY_TUMBLESTONE_BRICKS)
@JvmField
val SKY_TUMBLESTONE_BRICK_STAIRS = blockItem("sky_tumblestone_brick_stairs", CobblemonBlocks.SKY_TUMBLESTONE_BRICK_STAIRS)
@JvmField
val SKY_TUMBLESTONE_BRICK_SLAB = blockItem("sky_tumblestone_brick_slab", CobblemonBlocks.SKY_TUMBLESTONE_BRICK_SLAB)
@JvmField
val SKY_TUMBLESTONE_BRICK_WALL = blockItem("sky_tumblestone_brick_wall", CobblemonBlocks.SKY_TUMBLESTONE_BRICK_WALL)
@JvmField
val CHISELED_SKY_TUMBLESTONE_BRICKS = blockItem("chiseled_sky_tumblestone_bricks", CobblemonBlocks.CHISELED_SKY_TUMBLESTONE_BRICKS)
@JvmField
val POLISHED_BLACK_TUMBLESTONE = blockItem("polished_black_tumblestone", CobblemonBlocks.POLISHED_BLACK_TUMBLESTONE)
@JvmField
val POLISHED_BLACK_TUMBLESTONE_STAIRS = blockItem("polished_black_tumblestone_stairs", CobblemonBlocks.POLISHED_BLACK_TUMBLESTONE_STAIRS)
@JvmField
val POLISHED_BLACK_TUMBLESTONE_SLAB = blockItem("polished_black_tumblestone_slab", CobblemonBlocks.POLISHED_BLACK_TUMBLESTONE_SLAB)
@JvmField
val POLISHED_BLACK_TUMBLESTONE_WALL = blockItem("polished_black_tumblestone_wall", CobblemonBlocks.POLISHED_BLACK_TUMBLESTONE_WALL)
@JvmField
val CHISELED_POLISHED_BLACK_TUMBLESTONE = blockItem("chiseled_polished_black_tumblestone", CobblemonBlocks.CHISELED_POLISHED_BLACK_TUMBLESTONE)
@JvmField
val BLACK_TUMBLESTONE_BRICKS = blockItem("black_tumblestone_bricks", CobblemonBlocks.BLACK_TUMBLESTONE_BRICKS)
@JvmField
val BLACK_TUMBLESTONE_BRICK_STAIRS = blockItem("black_tumblestone_brick_stairs", CobblemonBlocks.BLACK_TUMBLESTONE_BRICK_STAIRS)
@JvmField
val BLACK_TUMBLESTONE_BRICK_SLAB = blockItem("black_tumblestone_brick_slab", CobblemonBlocks.BLACK_TUMBLESTONE_BRICK_SLAB)
@JvmField
val BLACK_TUMBLESTONE_BRICK_WALL = blockItem("black_tumblestone_brick_wall", CobblemonBlocks.BLACK_TUMBLESTONE_BRICK_WALL)
@JvmField
val CHISELED_BLACK_TUMBLESTONE_BRICKS = blockItem("chiseled_black_tumblestone_bricks", CobblemonBlocks.CHISELED_BLACK_TUMBLESTONE_BRICKS)
@JvmField
val AUTOMATON_ARMOR_TRIM_SMITHING_TEMPLATE: SmithingTemplateItem = this.create(
"automaton_armor_trim_smithing_template",
SmithingTemplateItem.of(CobblemonArmorTrims.AUTOMATON)
)
val pokeRods = mutableListOf<PokerodItem>()
@JvmField
val POKE_ROD = pokerodItem(cobblemonResource("poke_rod"))
@JvmField
val CITRINE_ROD = pokerodItem(cobblemonResource("citrine_rod"))
@JvmField
val VERDANT_ROD = pokerodItem(cobblemonResource("verdant_rod"))
@JvmField
val AZURE_ROD = pokerodItem(cobblemonResource("azure_rod"))
@JvmField
val ROSEATE_ROD = pokerodItem(cobblemonResource("roseate_rod"))
@JvmField
val SLATE_ROD = pokerodItem(cobblemonResource("slate_rod"))
@JvmField
val PREMIER_ROD = pokerodItem(cobblemonResource("premier_rod"))
@JvmField
val GREAT_ROD = pokerodItem(cobblemonResource("great_rod"))
@JvmField
val ULTRA_ROD = pokerodItem(cobblemonResource("ultra_rod"))
@JvmField
val SAFARI_ROD = pokerodItem(cobblemonResource("safari_rod"))
@JvmField
val FAST_ROD = pokerodItem(cobblemonResource("fast_rod"))
@JvmField
val LEVEL_ROD = pokerodItem(cobblemonResource("level_rod"))
@JvmField
val LURE_ROD = pokerodItem(cobblemonResource("lure_rod"))
@JvmField
val HEAVY_ROD = pokerodItem(cobblemonResource("heavy_rod"))
@JvmField
val LOVE_ROD = pokerodItem(cobblemonResource("love_rod"))
@JvmField
val FRIEND_ROD = pokerodItem(cobblemonResource("friend_rod"))
@JvmField
val MOON_ROD = pokerodItem(cobblemonResource("moon_rod"))
@JvmField
val SPORT_ROD = pokerodItem(cobblemonResource("sport_rod"))
@JvmField
val PARK_ROD = pokerodItem(cobblemonResource("park_rod"))
@JvmField
val NET_ROD = pokerodItem(cobblemonResource("net_rod"))
@JvmField
val DIVE_ROD = pokerodItem(cobblemonResource("dive_rod"))
@JvmField
val NEST_ROD = pokerodItem(cobblemonResource("nest_rod"))
@JvmField
val REPEAT_ROD = pokerodItem(cobblemonResource("repeat_rod"))
@JvmField
val TIMER_ROD = pokerodItem(cobblemonResource("timer_rod"))
@JvmField
val LUXURY_ROD = pokerodItem(cobblemonResource("luxury_rod"))
@JvmField
val DUSK_ROD = pokerodItem(cobblemonResource("dusk_rod"))
@JvmField
val HEAL_ROD = pokerodItem(cobblemonResource("heal_rod"))
@JvmField
val QUICK_ROD = pokerodItem(cobblemonResource("quick_rod"))
@JvmField
val DREAM_ROD = pokerodItem(cobblemonResource("dream_rod"))
@JvmField
val BEAST_ROD = pokerodItem(cobblemonResource("beast_rod"))
@JvmField
val MASTER_ROD = pokerodItem(cobblemonResource("master_rod"))
@JvmField
val CHERISH_ROD = pokerodItem(cobblemonResource("cherish_rod"))
@JvmField
val ANCIENT_POKE_ROD = pokerodItem(cobblemonResource("ancient_poke_rod"))
@JvmField
val ANCIENT_CITRINE_ROD = pokerodItem(cobblemonResource("ancient_citrine_rod"))
@JvmField
val ANCIENT_VERDANT_ROD = pokerodItem(cobblemonResource("ancient_verdant_rod"))
@JvmField
val ANCIENT_AZURE_ROD = pokerodItem(cobblemonResource("ancient_azure_rod"))
@JvmField
val ANCIENT_ROSEATE_ROD = pokerodItem(cobblemonResource("ancient_roseate_rod"))
@JvmField
val ANCIENT_SLATE_ROD = pokerodItem(cobblemonResource("ancient_slate_rod"))
@JvmField
val ANCIENT_IVORY_ROD = pokerodItem(cobblemonResource("ancient_ivory_rod"))
@JvmField
val ANCIENT_GREAT_ROD = pokerodItem(cobblemonResource("ancient_great_rod"))
@JvmField
val ANCIENT_ULTRA_ROD = pokerodItem(cobblemonResource("ancient_ultra_rod"))
@JvmField
val ANCIENT_FEATHER_ROD = pokerodItem(cobblemonResource("ancient_feather_rod"))
@JvmField
val ANCIENT_WING_ROD = pokerodItem(cobblemonResource("ancient_wing_rod"))
@JvmField
val ANCIENT_JET_ROD = pokerodItem(cobblemonResource("ancient_jet_rod"))
@JvmField
val ANCIENT_HEAVY_ROD = pokerodItem(cobblemonResource("ancient_heavy_rod"))
@JvmField
val ANCIENT_LEADEN_ROD = pokerodItem(cobblemonResource("ancient_leaden_rod"))
@JvmField
val ANCIENT_GIGATON_ROD = pokerodItem(cobblemonResource("ancient_gigaton_rod"))
@JvmField
val ANCIENT_ORIGIN_ROD = pokerodItem(cobblemonResource("ancient_origin_rod"))
// Misc
@JvmField
val POKEMON_MODEL = this.create("pokemon_model", PokemonItem())
@@ -947,6 +1129,10 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<It
val RELIC_COIN_POUCH = blockItem("relic_coin_pouch", CobblemonBlocks.RELIC_COIN_POUCH)
@JvmField
val RELIC_COIN_SACK = blockItem("relic_coin_sack", CobblemonBlocks.RELIC_COIN_SACK)
@JvmField
val TECHNICAL_MACHINE = this.create("technical_machine", TechnicalMachineItem(Item.Settings()))
@JvmField
val BLANK_TM = this.create("blank_tm", CobblemonItem(Item.Settings()))
// Type Gems
@JvmField
@@ -985,6 +1171,8 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<It
val STEEL_GEM = noSettingsItem("steel_gem")
@JvmField
val FAIRY_GEM = noSettingsItem("fairy_gem")
//@JvmField
//val BINDING_SOIL = blockItem("binding_soil", CobblemonBlocks.BINDING_SOIL)
private fun blockItem(name: String, block: Block): BlockItem = this.create(name, BlockItem(block, Item.Settings()))
@@ -1003,6 +1191,13 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<It
private fun candyItem(name: String, calculator: CandyItem.Calculator): CandyItem = this.create(name, CandyItem(calculator))
private fun pokerodItem(pokeRodId: Identifier): PokerodItem {
val settings = Item.Settings().maxCount(1).maxDamage(Items.FISHING_ROD.components.get(DataComponentTypes.MAX_DAMAGE)!!)
val item = create(pokeRodId.path, PokerodItem(pokeRodId, settings))
pokeRods.add(item)
return item
}
private fun heldItem(name: String, remappedName: String? = null): CobblemonItem = create(
name,
CobblemonItem(Item.Settings()).also {
@@ -1093,4 +1288,4 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, RegistryKey<Registry<It
return createdItem
}
}
}
@@ -10,11 +10,13 @@ package com.cobblemon.mod.common
import com.bedrockk.molang.Expression
import com.cobblemon.mod.common.api.data.DataRegistry
import com.cobblemon.mod.common.api.molang.ExpressionLike
import com.cobblemon.mod.common.api.reactive.SimpleObservable
import com.cobblemon.mod.common.mechanics.BerriesMechanic
import com.cobblemon.mod.common.mechanics.PotionsMechanic
import com.cobblemon.mod.common.mechanics.RemediesMechanic
import com.cobblemon.mod.common.util.adapters.ExpressionAdapter
import com.cobblemon.mod.common.util.adapters.ExpressionLikeAdapter
import com.cobblemon.mod.common.util.cobblemonResource
import com.google.gson.GsonBuilder
import net.minecraft.resource.ResourceManager
@@ -29,6 +31,7 @@ object CobblemonMechanics : DataRegistry {
val gson = GsonBuilder()
.setPrettyPrinting()
.registerTypeAdapter(Expression::class.java, ExpressionAdapter)
.registerTypeAdapter(ExpressionLike::class.java, ExpressionLikeAdapter)
.create()
var remedies = RemediesMechanic()
@@ -0,0 +1,35 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common
import com.mojang.serialization.Codec
import com.mojang.serialization.codecs.ListCodec
import com.mojang.serialization.codecs.PrimitiveCodec
import java.util.Optional
import net.minecraft.entity.ai.brain.MemoryModuleType
import net.minecraft.util.Uuids
object CobblemonMemories {
val memories = mutableMapOf<String, MemoryModuleType<*>>()
val BATTLING_POKEMON = register("battling_pokemon", ListCodec(Uuids.INT_STREAM_CODEC, 0, 31))
val NPC_BATTLING = register("npc_battling", PrimitiveCodec.BOOL)
fun <U> register(id: String, codec: Codec<U>): MemoryModuleType<U> {
val memoryModule = MemoryModuleType(Optional.of(codec))
memories[id] = memoryModule
return memoryModule
}
fun <U> register(id: String): MemoryModuleType<U> {
val memoryModule = MemoryModuleType<U>(Optional.empty())
memories[id] = memoryModule
return memoryModule
}
}
@@ -8,25 +8,27 @@
package com.cobblemon.mod.common
import com.cobblemon.mod.common.api.net.ClientNetworkPacketHandler
import com.cobblemon.mod.common.api.net.NetworkPacket
import com.cobblemon.mod.common.api.net.ServerNetworkPacketHandler
import com.cobblemon.mod.common.client.net.PlayerInteractOptionsHandler
import com.cobblemon.mod.common.client.net.SetClientPlayerDataHandler
import com.cobblemon.mod.common.client.net.animation.PlayPoseableAnimationHandler
import com.cobblemon.mod.common.client.net.animation.PlayPosableAnimationHandler
import com.cobblemon.mod.common.client.net.battle.*
import com.cobblemon.mod.common.client.net.callback.move.OpenMoveCallbackHandler
import com.cobblemon.mod.common.client.net.callback.party.OpenPartyCallbackHandler
import com.cobblemon.mod.common.client.net.callback.partymove.OpenPartyMoveCallbackHandler
import com.cobblemon.mod.common.client.net.data.DataRegistrySyncPacketHandler
import com.cobblemon.mod.common.client.net.data.UnlockReloadPacketHandler
import com.cobblemon.mod.common.client.net.effect.RunPosableMoLangHandler
import com.cobblemon.mod.common.client.net.dialogue.DialogueClosedHandler
import com.cobblemon.mod.common.client.net.dialogue.DialogueOpenedHandler
import com.cobblemon.mod.common.client.net.effect.RunPosableMoLangHandler
import com.cobblemon.mod.common.client.net.effect.SpawnSnowstormEntityParticleHandler
import com.cobblemon.mod.common.client.net.effect.SpawnSnowstormParticleHandler
import com.cobblemon.mod.common.client.net.gui.CraftBlankTMPacketHandler
import com.cobblemon.mod.common.client.net.gui.CraftTMPacketHandler
import com.cobblemon.mod.common.client.net.gui.InteractPokemonUIPacketHandler
import com.cobblemon.mod.common.client.net.gui.SummaryUIPacketHandler
import com.cobblemon.mod.common.client.net.npc.CloseNPCEditorHandler
import com.cobblemon.mod.common.client.net.npc.OpenNPCEditorHandler
import com.cobblemon.mod.common.client.net.pasture.ClosePastureHandler
import com.cobblemon.mod.common.client.net.pasture.OpenPastureHandler
import com.cobblemon.mod.common.client.net.pasture.PokemonPasturedHandler
@@ -56,28 +58,24 @@ import com.cobblemon.mod.common.client.net.trade.TradeOfferExpiredHandler
import com.cobblemon.mod.common.client.net.trade.TradeOfferNotificationHandler
import com.cobblemon.mod.common.client.net.trade.TradeStartedHandler
import com.cobblemon.mod.common.client.net.trade.TradeUpdatedHandler
import com.cobblemon.mod.common.net.PacketRegisterInfo
import com.cobblemon.mod.common.net.messages.client.PlayerInteractOptionsPacket
import com.cobblemon.mod.common.net.messages.client.animation.PlayPoseableAnimationPacket
import com.cobblemon.mod.common.net.messages.client.animation.PlayPosableAnimationPacket
import com.cobblemon.mod.common.net.messages.client.battle.*
import com.cobblemon.mod.common.net.messages.client.callback.OpenMoveCallbackPacket
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.GlobalSpeciesFeatureSyncPacket
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.SpeciesFeatureAssignmentSyncPacket
import com.cobblemon.mod.common.net.messages.client.data.SpeciesRegistrySyncPacket
import com.cobblemon.mod.common.net.messages.client.data.StandardSpeciesFeatureSyncPacket
import com.cobblemon.mod.common.net.messages.client.data.UnlockReloadPacket
import com.cobblemon.mod.common.net.messages.client.data.*
import com.cobblemon.mod.common.net.messages.client.dialogue.DialogueClosedPacket
import com.cobblemon.mod.common.net.messages.client.dialogue.DialogueOpenedPacket
import com.cobblemon.mod.common.net.messages.client.effect.RunPosableMoLangPacket
import com.cobblemon.mod.common.net.messages.client.effect.SpawnSnowstormEntityParticlePacket
import com.cobblemon.mod.common.net.messages.client.effect.SpawnSnowstormParticlePacket
import com.cobblemon.mod.common.net.messages.client.fishing.FishingBaitRegistrySyncPacket
import com.cobblemon.mod.common.net.messages.client.fossil.FossilRegistrySyncPacket
import com.cobblemon.mod.common.net.messages.client.fossil.NaturalMaterialRegistrySyncPacket
import com.cobblemon.mod.common.net.messages.client.npc.CloseNPCEditorPacket
import com.cobblemon.mod.common.net.messages.client.npc.OpenNPCEditorPacket
import com.cobblemon.mod.common.net.messages.client.pasture.ClosePasturePacket
import com.cobblemon.mod.common.net.messages.client.pasture.OpenPasturePacket
import com.cobblemon.mod.common.net.messages.client.pasture.PokemonPasturedPacket
@@ -113,9 +111,16 @@ import com.cobblemon.mod.common.net.messages.client.trade.TradeOfferExpiredPacke
import com.cobblemon.mod.common.net.messages.client.trade.TradeOfferNotificationPacket
import com.cobblemon.mod.common.net.messages.client.trade.TradeStartedPacket
import com.cobblemon.mod.common.net.messages.client.trade.TradeUpdatedPacket
import com.cobblemon.mod.common.net.messages.client.ui.CraftBlankTMPacket
import com.cobblemon.mod.common.net.messages.client.ui.CraftTMPacket
import com.cobblemon.mod.common.net.messages.client.ui.InteractPokemonUIPacket
import com.cobblemon.mod.common.net.messages.client.ui.SummaryUIPacket
import com.cobblemon.mod.common.net.messages.server.*
import com.cobblemon.mod.common.net.messages.server.BattleChallengePacket
import com.cobblemon.mod.common.net.messages.server.BenchMovePacket
import com.cobblemon.mod.common.net.messages.server.RequestMoveSwapPacket
import com.cobblemon.mod.common.net.messages.server.RequestPlayerInteractionsPacket
import com.cobblemon.mod.common.net.messages.server.SelectStarterPacket
import com.cobblemon.mod.common.net.messages.server.SendOutPokemonPacket
import com.cobblemon.mod.common.net.messages.server.battle.BattleSelectActionsPacket
import com.cobblemon.mod.common.net.messages.server.battle.RemoveSpectatorPacket
import com.cobblemon.mod.common.net.messages.server.battle.SpectateBattlePacket
@@ -127,6 +132,7 @@ import com.cobblemon.mod.common.net.messages.server.callback.partymove.PartyMove
import com.cobblemon.mod.common.net.messages.server.callback.partymove.PartyPokemonMoveSelectedPacket
import com.cobblemon.mod.common.net.messages.server.dialogue.EscapeDialoguePacket
import com.cobblemon.mod.common.net.messages.server.dialogue.InputToDialoguePacket
import com.cobblemon.mod.common.net.messages.server.npc.SaveNPCPacket
import com.cobblemon.mod.common.net.messages.server.pasture.PasturePokemonPacket
import com.cobblemon.mod.common.net.messages.server.pasture.UnpastureAllPokemonPacket
import com.cobblemon.mod.common.net.messages.server.pasture.UnpasturePokemonPacket
@@ -163,6 +169,7 @@ import com.cobblemon.mod.common.net.serverhandling.callback.partymove.PartyPokem
import com.cobblemon.mod.common.net.serverhandling.dialogue.EscapeDialogueHandler
import com.cobblemon.mod.common.net.serverhandling.dialogue.InputToDialogueHandler
import com.cobblemon.mod.common.net.serverhandling.evolution.AcceptEvolutionHandler
import com.cobblemon.mod.common.net.serverhandling.npc.SaveNPCHandler
import com.cobblemon.mod.common.net.serverhandling.pasture.PasturePokemonHandler
import com.cobblemon.mod.common.net.serverhandling.pasture.UnpastureAllPokemonHandler
import com.cobblemon.mod.common.net.serverhandling.pasture.UnpasturePokemonHandler
@@ -189,12 +196,7 @@ import com.cobblemon.mod.common.net.serverhandling.trade.ChangeTradeAcceptanceHa
import com.cobblemon.mod.common.net.serverhandling.trade.OfferTradeHandler
import com.cobblemon.mod.common.net.serverhandling.trade.UpdateTradeOfferHandler
import com.cobblemon.mod.common.util.server
import net.minecraft.network.PacketByteBuf
import net.minecraft.network.listener.ClientPlayPacketListener
import net.minecraft.network.packet.Packet
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.Identifier
import kotlin.reflect.KClass
/**
* Registers Cobblemon network packets.
@@ -204,254 +206,247 @@ import kotlin.reflect.KClass
* @author Hiroku, Licious
* @since November 27th, 2021
*/
object CobblemonNetwork : NetworkManager {
object CobblemonNetwork {
fun ServerPlayerEntity.sendPacket(packet: NetworkPacket<*>) = sendPacketToPlayer(this, packet)
fun sendToServer(packet: NetworkPacket<*>) = this.sendPacketToServer(packet)
fun sendToServer(packet: NetworkPacket<*>) = Cobblemon.implementation.networkManager.sendToServer(packet)
fun sendToAllPlayers(packet: NetworkPacket<*>) = sendPacketToPlayers(server()!!.playerManager.playerList, packet)
fun sendPacketToPlayers(players: Iterable<ServerPlayerEntity>, packet: NetworkPacket<*>) = players.forEach { sendPacketToPlayer(it, packet) }
override fun registerClientBound() {
val s2cPayloads = generateS2CPacketInfoList()
val c2sPayloads = generateC2SPacketInfoList()
private fun generateS2CPacketInfoList(): List<PacketRegisterInfo<*>> {
val list = mutableListOf<PacketRegisterInfo<*>>()
// Pokemon Update Packets
this.createClientBound(FriendshipUpdatePacket.ID, FriendshipUpdatePacket::decode, PokemonUpdatePacketHandler())
this.createClientBound(MoveSetUpdatePacket.ID, MoveSetUpdatePacket::decode, PokemonUpdatePacketHandler())
this.createClientBound(NatureUpdatePacket.ID, NatureUpdatePacket::decode, PokemonUpdatePacketHandler())
this.createClientBound(ShinyUpdatePacket.ID, ShinyUpdatePacket::decode, PokemonUpdatePacketHandler())
this.createClientBound(SpeciesUpdatePacket.ID, SpeciesUpdatePacket::decode, PokemonUpdatePacketHandler())
this.createClientBound(NicknameUpdatePacket.ID, NicknameUpdatePacket::decode, PokemonUpdatePacketHandler())
this.createClientBound(HealthUpdatePacket.ID, HealthUpdatePacket::decode, PokemonUpdatePacketHandler())
this.createClientBound(ExperienceUpdatePacket.ID, ExperienceUpdatePacket::decode, PokemonUpdatePacketHandler())
this.createClientBound(StatusUpdatePacket.ID, StatusUpdatePacket::decode, PokemonUpdatePacketHandler())
this.createClientBound(CaughtBallUpdatePacket.ID, CaughtBallUpdatePacket::decode, PokemonUpdatePacketHandler())
this.createClientBound(BenchedMovesUpdatePacket.ID, BenchedMovesUpdatePacket::decode, PokemonUpdatePacketHandler())
this.createClientBound(GenderUpdatePacket.ID, GenderUpdatePacket::decode, PokemonUpdatePacketHandler())
this.createClientBound(AspectsUpdatePacket.ID, AspectsUpdatePacket::decode, PokemonUpdatePacketHandler())
this.createClientBound(AbilityUpdatePacket.ID, AbilityUpdatePacket::decode, PokemonUpdatePacketHandler())
this.createClientBound(EVsUpdatePacket.ID, EVsUpdatePacket::decode, PokemonUpdatePacketHandler())
this.createClientBound(IVsUpdatePacket.ID, IVsUpdatePacket::decode, PokemonUpdatePacketHandler())
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())
this.createClientBound(SpeciesFeatureUpdatePacket.ID, SpeciesFeatureUpdatePacket::decode, PokemonUpdatePacketHandler())
this.createClientBound(OriginalTrainerUpdatePacket.ID, OriginalTrainerUpdatePacket::decode, PokemonUpdatePacketHandler())
list.add(PacketRegisterInfo(FriendshipUpdatePacket.ID, FriendshipUpdatePacket::decode, PokemonUpdatePacketHandler()))
list.add(PacketRegisterInfo(MoveSetUpdatePacket.ID, MoveSetUpdatePacket::decode, PokemonUpdatePacketHandler()))
list.add(PacketRegisterInfo(NatureUpdatePacket.ID, NatureUpdatePacket::decode, PokemonUpdatePacketHandler()))
list.add(PacketRegisterInfo(ShinyUpdatePacket.ID, ShinyUpdatePacket::decode, PokemonUpdatePacketHandler()))
list.add(PacketRegisterInfo(SpeciesUpdatePacket.ID, SpeciesUpdatePacket::decode, PokemonUpdatePacketHandler()))
list.add(PacketRegisterInfo(NicknameUpdatePacket.ID, NicknameUpdatePacket::decode, PokemonUpdatePacketHandler()))
list.add(PacketRegisterInfo(HealthUpdatePacket.ID, HealthUpdatePacket::decode, PokemonUpdatePacketHandler()))
list.add(PacketRegisterInfo(ExperienceUpdatePacket.ID, ExperienceUpdatePacket::decode, PokemonUpdatePacketHandler()))
list.add(PacketRegisterInfo(StatusUpdatePacket.ID, StatusUpdatePacket::decode, PokemonUpdatePacketHandler()))
list.add(PacketRegisterInfo(CaughtBallUpdatePacket.ID, CaughtBallUpdatePacket::decode, PokemonUpdatePacketHandler()))
list.add(PacketRegisterInfo(BenchedMovesUpdatePacket.ID, BenchedMovesUpdatePacket::decode, PokemonUpdatePacketHandler()))
list.add(PacketRegisterInfo(GenderUpdatePacket.ID, GenderUpdatePacket::decode, PokemonUpdatePacketHandler()))
list.add(PacketRegisterInfo(AspectsUpdatePacket.ID, AspectsUpdatePacket::decode, PokemonUpdatePacketHandler()))
list.add(PacketRegisterInfo(AbilityUpdatePacket.ID, AbilityUpdatePacket::decode, PokemonUpdatePacketHandler()))
list.add(PacketRegisterInfo(EVsUpdatePacket.ID, EVsUpdatePacket::decode, PokemonUpdatePacketHandler()))
list.add(PacketRegisterInfo(IVsUpdatePacket.ID, IVsUpdatePacket::decode, PokemonUpdatePacketHandler()))
list.add(PacketRegisterInfo(HeldItemUpdatePacket.ID, HeldItemUpdatePacket::decode, PokemonUpdatePacketHandler()))
list.add(PacketRegisterInfo(PokemonStateUpdatePacket.ID, PokemonStateUpdatePacket::decode, PokemonUpdatePacketHandler()))
list.add(PacketRegisterInfo(TetheringUpdatePacket.ID, TetheringUpdatePacket::decode, PokemonUpdatePacketHandler()))
list.add(PacketRegisterInfo(TradeableUpdatePacket.ID, TradeableUpdatePacket::decode, PokemonUpdatePacketHandler()))
list.add(PacketRegisterInfo(SpeciesFeatureUpdatePacket.ID, SpeciesFeatureUpdatePacket::decode, PokemonUpdatePacketHandler()))
list.add(PacketRegisterInfo(OriginalTrainerUpdatePacket.ID, OriginalTrainerUpdatePacket::decode, PokemonUpdatePacketHandler()))
list.add(PacketRegisterInfo(FormUpdatePacket.ID, FormUpdatePacket::decode, PokemonUpdatePacketHandler()))
// Evolution start
this.createClientBound(AddEvolutionPacket.ID, AddEvolutionPacket::decode, PokemonUpdatePacketHandler())
this.createClientBound(ClearEvolutionsPacket.ID, ClearEvolutionsPacket::decode, PokemonUpdatePacketHandler())
this.createClientBound(RemoveEvolutionPacket.ID, RemoveEvolutionPacket::decode, PokemonUpdatePacketHandler())
list.add(PacketRegisterInfo(AddEvolutionPacket.ID, AddEvolutionPacket::decode, PokemonUpdatePacketHandler()))
list.add(PacketRegisterInfo(ClearEvolutionsPacket.ID, ClearEvolutionsPacket::decode, PokemonUpdatePacketHandler()))
list.add(PacketRegisterInfo(RemoveEvolutionPacket.ID, RemoveEvolutionPacket::decode, PokemonUpdatePacketHandler()))
// Evolution End
// Storage Packets
this.createClientBound(InitializePartyPacket.ID, InitializePartyPacket::decode, InitializePartyHandler)
this.createClientBound(SetPartyPokemonPacket.ID, SetPartyPokemonPacket::decode, SetPartyPokemonHandler)
this.createClientBound(MoveClientPartyPokemonPacket.ID, MoveClientPartyPokemonPacket::decode, MoveClientPartyPokemonHandler)
this.createClientBound(SetPartyReferencePacket.ID, SetPartyReferencePacket::decode, SetPartyReferenceHandler)
this.createClientBound(InitializePCPacket.ID, InitializePCPacket::decode, InitializePCHandler)
this.createClientBound(MoveClientPCPokemonPacket.ID, MoveClientPCPokemonPacket::decode, MoveClientPCPokemonHandler)
this.createClientBound(SetPCBoxPokemonPacket.ID, SetPCBoxPokemonPacket::decode, SetPCBoxPokemonHandler)
this.createClientBound(SetPCPokemonPacket.ID, SetPCPokemonPacket::decode, SetPCPokemonHandler)
this.createClientBound(OpenPCPacket.ID, OpenPCPacket::decode, OpenPCHandler)
this.createClientBound(ClosePCPacket.ID, ClosePCPacket::decode, ClosePCHandler)
this.createClientBound(SwapClientPokemonPacket.ID, SwapClientPokemonPacket::decode, SwapClientPokemonHandler)
this.createClientBound(RemoveClientPokemonPacket.ID, RemoveClientPokemonPacket::decode, RemoveClientPokemonHandler)
list.add(PacketRegisterInfo(InitializePartyPacket.ID, InitializePartyPacket::decode, InitializePartyHandler))
list.add(PacketRegisterInfo(SetPartyPokemonPacket.ID, SetPartyPokemonPacket::decode, SetPartyPokemonHandler))
list.add(PacketRegisterInfo(MoveClientPartyPokemonPacket.ID, MoveClientPartyPokemonPacket::decode, MoveClientPartyPokemonHandler))
list.add(PacketRegisterInfo(SetPartyReferencePacket.ID, SetPartyReferencePacket::decode, SetPartyReferenceHandler))
list.add(PacketRegisterInfo(InitializePCPacket.ID, InitializePCPacket::decode, InitializePCHandler))
list.add(PacketRegisterInfo(MoveClientPCPokemonPacket.ID, MoveClientPCPokemonPacket::decode, MoveClientPCPokemonHandler))
list.add(PacketRegisterInfo(SetPCBoxPokemonPacket.ID, SetPCBoxPokemonPacket::decode, SetPCBoxPokemonHandler))
list.add(PacketRegisterInfo(SetPCPokemonPacket.ID, SetPCPokemonPacket::decode, SetPCPokemonHandler))
list.add(PacketRegisterInfo(OpenPCPacket.ID, OpenPCPacket::decode, OpenPCHandler))
list.add(PacketRegisterInfo(ClosePCPacket.ID, ClosePCPacket::decode, ClosePCHandler))
list.add(PacketRegisterInfo(SwapClientPokemonPacket.ID, SwapClientPokemonPacket::decode, SwapClientPokemonHandler))
list.add(PacketRegisterInfo(RemoveClientPokemonPacket.ID, RemoveClientPokemonPacket::decode, RemoveClientPokemonHandler))
// UI Packets
this.createClientBound(SummaryUIPacket.ID, SummaryUIPacket::decode, SummaryUIPacketHandler)
this.createClientBound(InteractPokemonUIPacket.ID, InteractPokemonUIPacket::decode, InteractPokemonUIPacketHandler)
this.createClientBound(PlayerInteractOptionsPacket.ID, PlayerInteractOptionsPacket::decode, PlayerInteractOptionsHandler)
list.add(PacketRegisterInfo(SummaryUIPacket.ID, SummaryUIPacket::decode, SummaryUIPacketHandler))
list.add(PacketRegisterInfo(InteractPokemonUIPacket.ID, InteractPokemonUIPacket::decode, InteractPokemonUIPacketHandler))
list.add(PacketRegisterInfo(PlayerInteractOptionsPacket.ID, PlayerInteractOptionsPacket::decode, PlayerInteractOptionsHandler))
// Starter packets
this.createClientBound(OpenStarterUIPacket.ID, OpenStarterUIPacket::decode, StarterUIPacketHandler)
this.createClientBound(SetClientPlayerDataPacket.ID, SetClientPlayerDataPacket::decode, SetClientPlayerDataHandler)
list.add(PacketRegisterInfo(OpenStarterUIPacket.ID, OpenStarterUIPacket::decode, StarterUIPacketHandler))
list.add(PacketRegisterInfo(SetClientPlayerDataPacket.ID, SetClientPlayerDataPacket::decode, SetClientPlayerDataHandler))
// Battle packets
this.createClientBound(BattleEndPacket.ID, BattleEndPacket::decode, BattleEndHandler)
this.createClientBound(BattleInitializePacket.ID, BattleInitializePacket::decode, BattleInitializeHandler)
this.createClientBound(BattleQueueRequestPacket.ID, BattleQueueRequestPacket::decode, BattleQueueRequestHandler)
this.createClientBound(BattleFaintPacket.ID, BattleFaintPacket::decode, BattleFaintHandler)
this.createClientBound(BattleMakeChoicePacket.ID, BattleMakeChoicePacket::decode, BattleMakeChoiceHandler)
this.createClientBound(BattleHealthChangePacket.ID, BattleHealthChangePacket::decode, BattleHealthChangeHandler)
this.createClientBound(BattleSetTeamPokemonPacket.ID, BattleSetTeamPokemonPacket::decode, BattleSetTeamPokemonHandler)
this.createClientBound(BattleSwitchPokemonPacket.ID, BattleSwitchPokemonPacket::decode, BattleSwitchPokemonHandler)
this.createClientBound(BattleMessagePacket.ID, BattleMessagePacket::decode, BattleMessageHandler)
this.createClientBound(BattleCaptureStartPacket.ID, BattleCaptureStartPacket::decode, BattleCaptureStartHandler)
this.createClientBound(BattleCaptureEndPacket.ID, BattleCaptureEndPacket::decode, BattleCaptureEndHandler)
this.createClientBound(BattleCaptureShakePacket.ID, BattleCaptureShakePacket::decode, BattleCaptureShakeHandler)
this.createClientBound(BattleApplyPassResponsePacket.ID, BattleApplyPassResponsePacket::decode, BattleApplyPassResponseHandler)
this.createClientBound(BattleChallengeNotificationPacket.ID, BattleChallengeNotificationPacket::decode, BattleChallengeNotificationHandler)
this.createClientBound(BattleUpdateTeamPokemonPacket.ID, BattleUpdateTeamPokemonPacket::decode, BattleUpdateTeamPokemonHandler)
this.createClientBound(BattlePersistentStatusPacket.ID, BattlePersistentStatusPacket::decode, BattlePersistentStatusHandler)
this.createClientBound(BattleMadeInvalidChoicePacket.ID, BattleMadeInvalidChoicePacket::decode, BattleMadeInvalidChoiceHandler)
this.createClientBound(BattleMusicPacket.ID, BattleMusicPacket::decode, BattleMusicHandler)
this.createClientBound(BattleChallengeExpiredPacket.ID, BattleChallengeExpiredPacket::decode, BattleChallengeExpiredHandler)
this.createClientBound(BattleReplacePokemonPacket.ID, BattleReplacePokemonPacket::decode, BattleReplacePokemonHandler)
this.createClientBound(BattleTransformPokemonPacket.ID, BattleTransformPokemonPacket::decode, BattleTransformPokemonHandler)
list.add(PacketRegisterInfo(BattleEndPacket.ID, BattleEndPacket::decode, BattleEndHandler))
list.add(PacketRegisterInfo(BattleInitializePacket.ID, BattleInitializePacket::decode, BattleInitializeHandler))
list.add(PacketRegisterInfo(BattleQueueRequestPacket.ID, BattleQueueRequestPacket::decode, BattleQueueRequestHandler))
list.add(PacketRegisterInfo(BattleFaintPacket.ID, BattleFaintPacket::decode, BattleFaintHandler))
list.add(PacketRegisterInfo(BattleMakeChoicePacket.ID, BattleMakeChoicePacket::decode, BattleMakeChoiceHandler))
list.add(PacketRegisterInfo(BattleHealthChangePacket.ID, BattleHealthChangePacket::decode, BattleHealthChangeHandler))
list.add(PacketRegisterInfo(BattleSetTeamPokemonPacket.ID, BattleSetTeamPokemonPacket::decode, BattleSetTeamPokemonHandler))
list.add(PacketRegisterInfo(BattleSwitchPokemonPacket.ID, BattleSwitchPokemonPacket::decode, BattleSwitchPokemonHandler))
list.add(PacketRegisterInfo(BattleMessagePacket.ID, BattleMessagePacket::decode, BattleMessageHandler))
list.add(PacketRegisterInfo(BattleCaptureStartPacket.ID, BattleCaptureStartPacket::decode, BattleCaptureStartHandler))
list.add(PacketRegisterInfo(BattleCaptureEndPacket.ID, BattleCaptureEndPacket::decode, BattleCaptureEndHandler))
list.add(PacketRegisterInfo(BattleCaptureShakePacket.ID, BattleCaptureShakePacket::decode, BattleCaptureShakeHandler))
list.add(PacketRegisterInfo(BattleApplyPassResponsePacket.ID, BattleApplyPassResponsePacket::decode, BattleApplyPassResponseHandler))
list.add(PacketRegisterInfo(BattleChallengeNotificationPacket.ID, BattleChallengeNotificationPacket::decode, BattleChallengeNotificationHandler))
list.add(PacketRegisterInfo(BattleUpdateTeamPokemonPacket.ID, BattleUpdateTeamPokemonPacket::decode, BattleUpdateTeamPokemonHandler))
list.add(PacketRegisterInfo(BattlePersistentStatusPacket.ID, BattlePersistentStatusPacket::decode, BattlePersistentStatusHandler))
list.add(PacketRegisterInfo(BattleMadeInvalidChoicePacket.ID, BattleMadeInvalidChoicePacket::decode, BattleMadeInvalidChoiceHandler))
list.add(PacketRegisterInfo(BattleMusicPacket.ID, BattleMusicPacket::decode, BattleMusicHandler))
list.add(PacketRegisterInfo(BattleChallengeExpiredPacket.ID, BattleChallengeExpiredPacket::decode, BattleChallengeExpiredHandler))
list.add(PacketRegisterInfo(BattleReplacePokemonPacket.ID, BattleReplacePokemonPacket::decode, BattleReplacePokemonHandler))
list.add(PacketRegisterInfo(BattleTransformPokemonPacket.ID, BattleTransformPokemonPacket::decode, BattleTransformPokemonHandler))
// Settings packets
this.createClientBound(ServerSettingsPacket.ID, ServerSettingsPacket::decode, ServerSettingsPacketHandler)
list.add(PacketRegisterInfo(ServerSettingsPacket.ID, ServerSettingsPacket::decode, ServerSettingsPacketHandler))
// Data registries
this.createClientBound(AbilityRegistrySyncPacket.ID, AbilityRegistrySyncPacket::decode, DataRegistrySyncPacketHandler())
this.createClientBound(MovesRegistrySyncPacket.ID, MovesRegistrySyncPacket::decode, DataRegistrySyncPacketHandler())
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())
this.createClientBound(StandardSpeciesFeatureSyncPacket.ID, StandardSpeciesFeatureSyncPacket::decode, DataRegistrySyncPacketHandler())
this.createClientBound(GlobalSpeciesFeatureSyncPacket.ID, GlobalSpeciesFeatureSyncPacket::decode, DataRegistrySyncPacketHandler())
this.createClientBound(SpeciesFeatureAssignmentSyncPacket.ID, SpeciesFeatureAssignmentSyncPacket::decode, DataRegistrySyncPacketHandler())
this.createClientBound(NaturalMaterialRegistrySyncPacket.ID, NaturalMaterialRegistrySyncPacket::decode, DataRegistrySyncPacketHandler())
this.createClientBound(FossilRegistrySyncPacket.ID, FossilRegistrySyncPacket::decode, DataRegistrySyncPacketHandler())
list.add(PacketRegisterInfo(AbilityRegistrySyncPacket.ID, AbilityRegistrySyncPacket::decode, DataRegistrySyncPacketHandler()))
list.add(PacketRegisterInfo(MovesRegistrySyncPacket.ID, MovesRegistrySyncPacket::decode, DataRegistrySyncPacketHandler()))
list.add(PacketRegisterInfo(SpeciesRegistrySyncPacket.ID, SpeciesRegistrySyncPacket::decode, DataRegistrySyncPacketHandler()))
list.add(PacketRegisterInfo(PropertiesCompletionRegistrySyncPacket.ID, PropertiesCompletionRegistrySyncPacket::decode, DataRegistrySyncPacketHandler()))
list.add(PacketRegisterInfo(UnlockReloadPacket.ID, UnlockReloadPacket::decode, UnlockReloadPacketHandler))
list.add(PacketRegisterInfo(BerryRegistrySyncPacket.ID, BerryRegistrySyncPacket::decode, DataRegistrySyncPacketHandler()))
list.add(PacketRegisterInfo(StandardSpeciesFeatureSyncPacket.ID, StandardSpeciesFeatureSyncPacket::decode, DataRegistrySyncPacketHandler()))
list.add(PacketRegisterInfo(GlobalSpeciesFeatureSyncPacket.ID, GlobalSpeciesFeatureSyncPacket::decode, DataRegistrySyncPacketHandler()))
list.add(PacketRegisterInfo(SpeciesFeatureAssignmentSyncPacket.ID, SpeciesFeatureAssignmentSyncPacket::decode, DataRegistrySyncPacketHandler()))
list.add(PacketRegisterInfo(NaturalMaterialRegistrySyncPacket.ID, NaturalMaterialRegistrySyncPacket::decode, DataRegistrySyncPacketHandler()))
list.add(PacketRegisterInfo(FossilRegistrySyncPacket.ID, FossilRegistrySyncPacket::decode, DataRegistrySyncPacketHandler()))
list.add(PacketRegisterInfo(NPCRegistrySyncPacket.ID, NPCRegistrySyncPacket::decode, DataRegistrySyncPacketHandler()))
list.add(PacketRegisterInfo(PokeRodRegistrySyncPacket.ID, PokeRodRegistrySyncPacket::decode, DataRegistrySyncPacketHandler()))
list.add(PacketRegisterInfo(ScriptRegistrySyncPacket.ID, ScriptRegistrySyncPacket::decode, DataRegistrySyncPacketHandler()))
list.add(PacketRegisterInfo(FishingBaitRegistrySyncPacket.ID, FishingBaitRegistrySyncPacket::decode, DataRegistrySyncPacketHandler()))
// Effects
this.createClientBound(SpawnSnowstormParticlePacket.ID, SpawnSnowstormParticlePacket::decode, SpawnSnowstormParticleHandler)
this.createClientBound(SpawnSnowstormEntityParticlePacket.ID, SpawnSnowstormEntityParticlePacket::decode, SpawnSnowstormEntityParticleHandler)
this.createClientBound(RunPosableMoLangPacket.ID, RunPosableMoLangPacket::decode, RunPosableMoLangHandler)
list.add(PacketRegisterInfo(SpawnSnowstormParticlePacket.ID, SpawnSnowstormParticlePacket::decode, SpawnSnowstormParticleHandler))
list.add(PacketRegisterInfo(SpawnSnowstormEntityParticlePacket.ID, SpawnSnowstormEntityParticlePacket::decode, SpawnSnowstormEntityParticleHandler))
list.add(PacketRegisterInfo(RunPosableMoLangPacket.ID, RunPosableMoLangPacket::decode, RunPosableMoLangHandler))
// Hax
this.createClientBound(UnvalidatedPlaySoundS2CPacket.ID, UnvalidatedPlaySoundS2CPacket::decode, UnvalidatedPlaySoundS2CPacketHandler)
this.createClientBound(SpawnPokemonPacket.ID, SpawnPokemonPacket::decode, SpawnExtraDataEntityHandler())
this.createClientBound(SpawnPokeballPacket.ID, SpawnPokeballPacket::decode, SpawnExtraDataEntityHandler())
this.createClientBound(ToastPacket.ID, ToastPacket::decode, ToastPacketHandler)
this.createClientBound(SpawnGenericBedrockPacket.ID, SpawnGenericBedrockPacket::decode, SpawnExtraDataEntityHandler())
list.add(PacketRegisterInfo(UnvalidatedPlaySoundS2CPacket.ID, UnvalidatedPlaySoundS2CPacket::decode, UnvalidatedPlaySoundS2CPacketHandler))
list.add(PacketRegisterInfo(SpawnPokemonPacket.ID, SpawnPokemonPacket::decode, SpawnExtraDataEntityHandler()))
list.add(PacketRegisterInfo(SpawnPokeballPacket.ID, SpawnPokeballPacket::decode, SpawnExtraDataEntityHandler()))
list.add(PacketRegisterInfo(ToastPacket.ID, ToastPacket::decode, ToastPacketHandler))
list.add(PacketRegisterInfo(SpawnGenericBedrockPacket.ID, SpawnGenericBedrockPacket::decode, SpawnExtraDataEntityHandler()))
// Trade packets
this.createClientBound(TradeAcceptanceChangedPacket.ID, TradeAcceptanceChangedPacket::decode, TradeAcceptanceChangedHandler)
this.createClientBound(TradeCancelledPacket.ID, TradeCancelledPacket::decode, TradeCancelledHandler)
this.createClientBound(TradeCompletedPacket.ID, TradeCompletedPacket::decode, TradeCompletedHandler)
this.createClientBound(TradeUpdatedPacket.ID, TradeUpdatedPacket::decode, TradeUpdatedHandler)
this.createClientBound(TradeOfferNotificationPacket.ID, TradeOfferNotificationPacket::decode, TradeOfferNotificationHandler)
this.createClientBound(TradeOfferExpiredPacket.ID, TradeOfferExpiredPacket::decode, TradeOfferExpiredHandler)
this.createClientBound(TradeStartedPacket.ID, TradeStartedPacket::decode, TradeStartedHandler)
list.add(PacketRegisterInfo(TradeAcceptanceChangedPacket.ID, TradeAcceptanceChangedPacket::decode, TradeAcceptanceChangedHandler))
list.add(PacketRegisterInfo(TradeCancelledPacket.ID, TradeCancelledPacket::decode, TradeCancelledHandler))
list.add(PacketRegisterInfo(TradeCompletedPacket.ID, TradeCompletedPacket::decode, TradeCompletedHandler))
list.add(PacketRegisterInfo(TradeUpdatedPacket.ID, TradeUpdatedPacket::decode, TradeUpdatedHandler))
list.add(PacketRegisterInfo(TradeOfferNotificationPacket.ID, TradeOfferNotificationPacket::decode, TradeOfferNotificationHandler))
list.add(PacketRegisterInfo(TradeOfferExpiredPacket.ID, TradeOfferExpiredPacket::decode, TradeOfferExpiredHandler))
list.add(PacketRegisterInfo(TradeStartedPacket.ID, TradeStartedPacket::decode, TradeStartedHandler))
// Pasture
this.createClientBound(OpenPasturePacket.ID, OpenPasturePacket::decode, OpenPastureHandler)
this.createClientBound(ClosePasturePacket.ID, ClosePasturePacket::decode, ClosePastureHandler)
this.createClientBound(PokemonPasturedPacket.ID, PokemonPasturedPacket::decode, PokemonPasturedHandler)
this.createClientBound(PokemonUnpasturedPacket.ID, PokemonUnpasturedPacket::decode, PokemonUnpasturedHandler)
list.add(PacketRegisterInfo(OpenPasturePacket.ID, OpenPasturePacket::decode, OpenPastureHandler))
list.add(PacketRegisterInfo(ClosePasturePacket.ID, ClosePasturePacket::decode, ClosePastureHandler))
list.add(PacketRegisterInfo(PokemonPasturedPacket.ID, PokemonPasturedPacket::decode, PokemonPasturedHandler))
list.add(PacketRegisterInfo(PokemonUnpasturedPacket.ID, PokemonUnpasturedPacket::decode, PokemonUnpasturedHandler))
// Behaviours
this.createClientBound(PlayPoseableAnimationPacket.ID, PlayPoseableAnimationPacket::decode, PlayPoseableAnimationHandler)
list.add(PacketRegisterInfo(PlayPosableAnimationPacket.ID, PlayPosableAnimationPacket::decode, PlayPosableAnimationHandler))
// Move select packets
this.createClientBound(OpenMoveCallbackPacket.ID, OpenMoveCallbackPacket::decode, OpenMoveCallbackHandler)
list.add(PacketRegisterInfo(OpenMoveCallbackPacket.ID, OpenMoveCallbackPacket::decode, OpenMoveCallbackHandler))
// Party select packets
this.createClientBound(OpenPartyCallbackPacket.ID, OpenPartyCallbackPacket::decode, OpenPartyCallbackHandler)
list.add(PacketRegisterInfo(OpenPartyCallbackPacket.ID, OpenPartyCallbackPacket::decode, OpenPartyCallbackHandler))
// Party move select packets
this.createClientBound(OpenPartyMoveCallbackPacket.ID, OpenPartyMoveCallbackPacket::decode, OpenPartyMoveCallbackHandler)
list.add(PacketRegisterInfo(OpenPartyMoveCallbackPacket.ID, OpenPartyMoveCallbackPacket::decode, OpenPartyMoveCallbackHandler))
// Dialogue packets
this.createClientBound(DialogueClosedPacket.ID, DialogueClosedPacket::decode, DialogueClosedHandler)
this.createClientBound(DialogueOpenedPacket.ID, DialogueOpenedPacket::decode, DialogueOpenedHandler)
list.add(PacketRegisterInfo(DialogueClosedPacket.ID, DialogueClosedPacket::decode, DialogueClosedHandler))
list.add(PacketRegisterInfo(DialogueOpenedPacket.ID, DialogueOpenedPacket::decode, DialogueOpenedHandler))
// NPCs
list.add(PacketRegisterInfo(CloseNPCEditorPacket.ID, CloseNPCEditorPacket::decode, CloseNPCEditorHandler))
list.add(PacketRegisterInfo(OpenNPCEditorPacket.ID, OpenNPCEditorPacket::decode, OpenNPCEditorHandler))
return list
}
override fun registerServerBound() {
private fun generateC2SPacketInfoList(): List<PacketRegisterInfo<*>> {
val list = mutableListOf<PacketRegisterInfo<*>>()
// Pokemon Update Packets
this.createServerBound(SetNicknamePacket.ID, SetNicknamePacket::decode, SetNicknameHandler)
list.add(PacketRegisterInfo(SetNicknamePacket.ID, SetNicknamePacket::decode, SetNicknameHandler))
// Evolution Packets
this.createServerBound(AcceptEvolutionPacket.ID, AcceptEvolutionPacket::decode, AcceptEvolutionHandler)
list.add(PacketRegisterInfo(AcceptEvolutionPacket.ID, AcceptEvolutionPacket::decode, AcceptEvolutionHandler))
// Interaction Packets
this.createServerBound(InteractPokemonPacket.ID, InteractPokemonPacket::decode, InteractPokemonHandler)
this.createServerBound(RequestPlayerInteractionsPacket.ID, RequestPlayerInteractionsPacket::decode, RequestInteractionsHandler)
list.add(PacketRegisterInfo(InteractPokemonPacket.ID, InteractPokemonPacket::decode, InteractPokemonHandler))
list.add(PacketRegisterInfo(RequestPlayerInteractionsPacket.ID, RequestPlayerInteractionsPacket::decode, RequestInteractionsHandler))
// Storage Packets
this.createServerBound(SendOutPokemonPacket.ID, SendOutPokemonPacket::decode, SendOutPokemonHandler)
this.createServerBound(RequestMoveSwapPacket.ID, RequestMoveSwapPacket::decode, RequestMoveSwapHandler)
this.createServerBound(BenchMovePacket.ID, BenchMovePacket::decode, BenchMoveHandler)
this.createServerBound(BattleChallengePacket.ID, BattleChallengePacket::decode, ChallengeHandler)
list.add(PacketRegisterInfo(SendOutPokemonPacket.ID, SendOutPokemonPacket::decode, SendOutPokemonHandler))
list.add(PacketRegisterInfo(RequestMoveSwapPacket.ID, RequestMoveSwapPacket::decode, RequestMoveSwapHandler))
list.add(PacketRegisterInfo(BenchMovePacket.ID, BenchMovePacket::decode, BenchMoveHandler))
list.add(PacketRegisterInfo(BattleChallengePacket.ID, BattleChallengePacket::decode, ChallengeHandler))
this.createServerBound(MovePCPokemonToPartyPacket.ID, MovePCPokemonToPartyPacket::decode, MovePCPokemonToPartyHandler)
this.createServerBound(MovePartyPokemonToPCPacket.ID, MovePartyPokemonToPCPacket::decode, MovePartyPokemonToPCHandler)
this.createServerBound(ReleasePartyPokemonPacket.ID, ReleasePartyPokemonPacket::decode, ReleasePartyPokemonHandler)
this.createServerBound(ReleasePCPokemonPacket.ID, ReleasePCPokemonPacket::decode, ReleasePCPokemonHandler)
this.createServerBound(UnlinkPlayerFromPCPacket.ID, UnlinkPlayerFromPCPacket::decode, UnlinkPlayerFromPCHandler)
list.add(PacketRegisterInfo(MovePCPokemonToPartyPacket.ID, MovePCPokemonToPartyPacket::decode, MovePCPokemonToPartyHandler))
list.add(PacketRegisterInfo(MovePartyPokemonToPCPacket.ID, MovePartyPokemonToPCPacket::decode, MovePartyPokemonToPCHandler))
list.add(PacketRegisterInfo(ReleasePartyPokemonPacket.ID, ReleasePartyPokemonPacket::decode, ReleasePartyPokemonHandler))
list.add(PacketRegisterInfo(ReleasePCPokemonPacket.ID, ReleasePCPokemonPacket::decode, ReleasePCPokemonHandler))
list.add(PacketRegisterInfo(UnlinkPlayerFromPCPacket.ID, UnlinkPlayerFromPCPacket::decode, UnlinkPlayerFromPCHandler))
// Starter packets
this.createServerBound(SelectStarterPacket.ID, SelectStarterPacket::decode, SelectStarterPacketHandler)
this.createServerBound(RequestStarterScreenPacket.ID, RequestStarterScreenPacket::decode, RequestStarterScreenHandler)
list.add(PacketRegisterInfo(SelectStarterPacket.ID, SelectStarterPacket::decode, SelectStarterPacketHandler))
list.add(PacketRegisterInfo(RequestStarterScreenPacket.ID, RequestStarterScreenPacket::decode, RequestStarterScreenHandler))
this.createServerBound(SwapPCPokemonPacket.ID, SwapPCPokemonPacket::decode, SwapPCPokemonHandler)
this.createServerBound(SwapPartyPokemonPacket.ID, SwapPartyPokemonPacket::decode, SwapPartyPokemonHandler)
list.add(PacketRegisterInfo(SwapPCPokemonPacket.ID, SwapPCPokemonPacket::decode, SwapPCPokemonHandler))
list.add(PacketRegisterInfo(SwapPartyPokemonPacket.ID, SwapPartyPokemonPacket::decode, SwapPartyPokemonHandler))
this.createServerBound(MovePCPokemonPacket.ID, MovePCPokemonPacket::decode, MovePCPokemonHandler)
this.createServerBound(MovePartyPokemonPacket.ID, MovePartyPokemonPacket::decode, MovePartyPokemonHandler)
list.add(PacketRegisterInfo(MovePCPokemonPacket.ID, MovePCPokemonPacket::decode, MovePCPokemonHandler))
list.add(PacketRegisterInfo(MovePartyPokemonPacket.ID, MovePartyPokemonPacket::decode, MovePartyPokemonHandler))
this.createServerBound(SwapPCPartyPokemonPacket.ID, SwapPCPartyPokemonPacket::decode, SwapPCPartyPokemonHandler)
list.add(PacketRegisterInfo(SwapPCPartyPokemonPacket.ID, SwapPCPartyPokemonPacket::decode, SwapPCPartyPokemonHandler))
// Battle packets
this.createServerBound(BattleSelectActionsPacket.ID, BattleSelectActionsPacket::decode, BattleSelectActionsHandler)
this.createServerBound(SpectateBattlePacket.ID, SpectateBattlePacket::decode, SpectateBattleHandler)
this.createServerBound(RemoveSpectatorPacket.ID, RemoveSpectatorPacket::decode, RemoveSpectatorHandler)
list.add(PacketRegisterInfo(BattleSelectActionsPacket.ID, BattleSelectActionsPacket::decode, BattleSelectActionsHandler))
list.add(PacketRegisterInfo(SpectateBattlePacket.ID, SpectateBattlePacket::decode, SpectateBattleHandler))
list.add(PacketRegisterInfo(RemoveSpectatorPacket.ID, RemoveSpectatorPacket::decode, RemoveSpectatorHandler))
// Trade
this.createServerBound(AcceptTradeRequestPacket.ID, AcceptTradeRequestPacket::decode, AcceptTradeRequestHandler)
this.createServerBound(CancelTradePacket.ID, CancelTradePacket::decode, CancelTradeHandler)
this.createServerBound(ChangeTradeAcceptancePacket.ID, ChangeTradeAcceptancePacket::decode, ChangeTradeAcceptanceHandler)
this.createServerBound(OfferTradePacket.ID, OfferTradePacket::decode, OfferTradeHandler)
this.createServerBound(UpdateTradeOfferPacket.ID, UpdateTradeOfferPacket::decode, UpdateTradeOfferHandler)
list.add(PacketRegisterInfo(AcceptTradeRequestPacket.ID, AcceptTradeRequestPacket::decode, AcceptTradeRequestHandler))
list.add(PacketRegisterInfo(CancelTradePacket.ID, CancelTradePacket::decode, CancelTradeHandler))
list.add(PacketRegisterInfo(ChangeTradeAcceptancePacket.ID, ChangeTradeAcceptancePacket::decode, ChangeTradeAcceptanceHandler))
list.add(PacketRegisterInfo(OfferTradePacket.ID, OfferTradePacket::decode, OfferTradeHandler))
list.add(PacketRegisterInfo(UpdateTradeOfferPacket.ID, UpdateTradeOfferPacket::decode, UpdateTradeOfferHandler))
// Pasture
this.createServerBound(PasturePokemonPacket.ID, PasturePokemonPacket::decode, PasturePokemonHandler)
this.createServerBound(UnpasturePokemonPacket.ID, UnpasturePokemonPacket::decode, UnpasturePokemonHandler)
this.createServerBound(UnpastureAllPokemonPacket.ID, UnpastureAllPokemonPacket::decode, UnpastureAllPokemonHandler)
list.add(PacketRegisterInfo(PasturePokemonPacket.ID, PasturePokemonPacket::decode, PasturePokemonHandler))
list.add(PacketRegisterInfo(UnpasturePokemonPacket.ID, UnpasturePokemonPacket::decode, UnpasturePokemonHandler))
list.add(PacketRegisterInfo(UnpastureAllPokemonPacket.ID, UnpastureAllPokemonPacket::decode, UnpastureAllPokemonHandler))
// Move select packets
this.createServerBound(MoveSelectedPacket.ID, MoveSelectedPacket::decode, MoveSelectedHandler)
this.createServerBound(MoveSelectCancelledPacket.ID, MoveSelectCancelledPacket::decode, MoveSelectCancelledHandler)
list.add(PacketRegisterInfo(MoveSelectedPacket.ID, MoveSelectedPacket::decode, MoveSelectedHandler))
list.add(PacketRegisterInfo(MoveSelectCancelledPacket.ID, MoveSelectCancelledPacket::decode, MoveSelectCancelledHandler))
// Party select packets
this.createServerBound(PartyPokemonSelectedPacket.ID, PartyPokemonSelectedPacket::decode, PartyPokemonSelectedHandler)
this.createServerBound(PartySelectCancelledPacket.ID, PartySelectCancelledPacket::decode, PartySelectCancelledHandler)
list.add(PacketRegisterInfo(PartyPokemonSelectedPacket.ID, PartyPokemonSelectedPacket::decode, PartyPokemonSelectedHandler))
list.add(PacketRegisterInfo(PartySelectCancelledPacket.ID, PartySelectCancelledPacket::decode, PartySelectCancelledHandler))
// Party move select packets
this.createServerBound(PartyPokemonMoveSelectedPacket.ID, PartyPokemonMoveSelectedPacket::decode, PartyPokemonMoveSelectedHandler)
this.createServerBound(PartyMoveSelectCancelledPacket.ID, PartyMoveSelectCancelledPacket::decode, PartyMoveSelectCancelledHandler)
list.add(PacketRegisterInfo(PartyPokemonMoveSelectedPacket.ID, PartyPokemonMoveSelectedPacket::decode, PartyPokemonMoveSelectedHandler))
list.add(PacketRegisterInfo(PartyMoveSelectCancelledPacket.ID, PartyMoveSelectCancelledPacket::decode, PartyMoveSelectCancelledHandler))
// TM Machine packets
// convert to new format
list.add(PacketRegisterInfo(CraftTMPacket.ID, CraftTMPacket::decode, CraftTMPacketHandler))
list.add(PacketRegisterInfo(CraftBlankTMPacket.ID, CraftBlankTMPacket::decode, CraftBlankTMPacketHandler))
// Dialogue packets
this.createServerBound(EscapeDialoguePacket.ID, EscapeDialoguePacket::decode, EscapeDialogueHandler)
this.createServerBound(InputToDialoguePacket.ID, InputToDialoguePacket::decode, InputToDialogueHandler)
list.add(PacketRegisterInfo(EscapeDialoguePacket.ID, EscapeDialoguePacket::decode, EscapeDialogueHandler))
list.add(PacketRegisterInfo(InputToDialoguePacket.ID, InputToDialoguePacket::decode, InputToDialogueHandler))
// NPC packets
list.add(PacketRegisterInfo(SaveNPCPacket.ID, SaveNPCPacket::decode, SaveNPCHandler))
return list
}
private inline fun <reified T : NetworkPacket<T>> createClientBound(identifier: Identifier, noinline decoder: (PacketByteBuf) -> T, handler: ClientNetworkPacketHandler<T>) {
Cobblemon.implementation.networkManager.createClientBound(identifier, T::class, { message, buffer -> message.encode(buffer) }, decoder, handler)
}
private inline fun <reified T : NetworkPacket<T>> createServerBound(identifier: Identifier, noinline decoder: (PacketByteBuf) -> T, handler: ServerNetworkPacketHandler<T>) {
Cobblemon.implementation.networkManager.createServerBound(identifier, T::class, { message, buffer -> message.encode(buffer) }, decoder, handler)
}
override fun <T : NetworkPacket<T>> createClientBound(
identifier: Identifier,
kClass: KClass<T>,
encoder: (T, PacketByteBuf) -> Unit,
decoder: (PacketByteBuf) -> T,
handler: ClientNetworkPacketHandler<T>
) {
Cobblemon.implementation.networkManager.createClientBound(identifier, kClass, encoder, decoder, handler)
}
override fun <T : NetworkPacket<T>> createServerBound(
identifier: Identifier,
kClass: KClass<T>,
encoder: (T, PacketByteBuf) -> Unit,
decoder: (PacketByteBuf) -> T,
handler: ServerNetworkPacketHandler<T>
) {
Cobblemon.implementation.networkManager.createServerBound(identifier, kClass, encoder, decoder, handler)
}
override fun sendPacketToPlayer(player: ServerPlayerEntity, packet: NetworkPacket<*>) = Cobblemon.implementation.networkManager.sendPacketToPlayer(player, packet)
override fun sendPacketToServer(packet: NetworkPacket<*>) = Cobblemon.implementation.networkManager.sendPacketToServer(packet)
override fun <T : NetworkPacket<*>> asVanillaClientBound(packet: T): Packet<ClientPlayPacketListener> = Cobblemon.implementation.networkManager.asVanillaClientBound(packet)
fun sendPacketToPlayer(player: ServerPlayerEntity, packet: NetworkPacket<*>) = Cobblemon.implementation.networkManager.sendPacketToPlayer(player, packet)
}
@@ -0,0 +1,29 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common
import com.cobblemon.mod.common.entity.sensor.BattlingPokemonSensor
import com.cobblemon.mod.common.entity.sensor.NPCBattlingSensor
import java.util.function.Supplier
import net.minecraft.entity.Entity
import net.minecraft.entity.ai.brain.sensor.Sensor
import net.minecraft.entity.ai.brain.sensor.SensorType
object CobblemonSensors {
val sensors = mutableMapOf<String, SensorType<*>>()
val NPC_BATTLING = register("npc_battling", ::NPCBattlingSensor)
val BATTLING_POKEMON = register("battling_pokemon", ::BattlingPokemonSensor)
fun <E : Entity, U : Sensor<E>> register(id: String, supplier: Supplier<U>): SensorType<U> {
val sensor = SensorType(supplier)
sensors[id] = sensor
return sensor
}
}
@@ -122,13 +122,30 @@ object CobblemonSounds : PlatformRegistry<Registry<SoundEvent>, RegistryKey<Regi
val FOSSIL_MACHINE_UNPROTECTED = this.create("fossil_machine.unprotected")
@JvmField
val COIN_POUCH_BREAK = this.create("coin_pouch.break")
val RELIC_COIN_SACK_BREAK = this.create("relic_coin_sack.break")
@JvmField
val COIN_POUCH_HIT = this.create("coin_pouch.hit")
val RELIC_COIN_SACK_HIT = this.create("relic_coin_sack.hit")
@JvmField
val COIN_POUCH_STEP = this.create("coin_pouch.step")
val RELIC_COIN_SACK_STEP = this.create("relic_coin_sack.step")
@JvmField
val COIN_POUCH_PLACE = this.create("coin_pouch.place")
val RELIC_COIN_SACK_PLACE = this.create("relic_coin_sack.place")
@JvmField
val RELIC_COIN_POUCH_BREAK = this.create("relic_coin_pouch.break")
@JvmField
val RELIC_COIN_POUCH_PLACE = this.create("relic_coin_pouch.place")
@JvmField
val FISHING_NOTIFICATION = this.create("fishing.notification")
@JvmField
val FISHING_SPLASH_BIG = this.create("fishing.splash_big")
@JvmField
val FISHING_SPLASH_SMALL = this.create("fishing.splash_small")
@JvmField
val FISHING_BOBBER_LAND = this.create("fishing.bobber_land")
@JvmField
val FISHING_ROD_CAST = this.create("fishing.rod_cast")
@JvmField
val FISHING_ROD_REEL_IN = this.create("fishing.rod_reel_in")
@JvmField
val TUMBLESTONE_BREAK = this.create("tumblestone.break")
@JvmField
@@ -189,13 +206,22 @@ object CobblemonSounds : PlatformRegistry<Registry<SoundEvent>, RegistryKey<Regi
val GILDED_CHEST_PLACE = this.create("gilded_chest.place")
@JvmField
val COIN_POUCH_SOUNDS = BlockSoundGroup(1f, 1f,
COIN_POUCH_BREAK,
COIN_POUCH_STEP,
COIN_POUCH_PLACE,
COIN_POUCH_HIT,
COIN_POUCH_STEP
val RELIC_COIN_SACK_SOUNDS = BlockSoundGroup(1f, 1f,
RELIC_COIN_SACK_BREAK,
RELIC_COIN_SACK_STEP,
RELIC_COIN_SACK_PLACE,
RELIC_COIN_SACK_HIT,
RELIC_COIN_SACK_STEP
)
@JvmField
val RELIC_COIN_POUCH_SOUNDS = BlockSoundGroup(1f, 1f,
RELIC_COIN_POUCH_BREAK,
RELIC_COIN_SACK_STEP,
RELIC_COIN_POUCH_PLACE,
RELIC_COIN_SACK_HIT,
RELIC_COIN_SACK_STEP
)
@JvmField
val IMPACT_NORMAL = this.create("impact.normal")
@JvmField
@@ -250,6 +276,19 @@ object CobblemonSounds : PlatformRegistry<Registry<SoundEvent>, RegistryKey<Regi
TUMBLESTONE_HIT,
TUMBLESTONE_STEP
)
@JvmField
val TM_USE = this.create("tm.use")
@JvmField
val TMM_CRAFT = this.create("tmm.craft")
@JvmField
val TMM_CRAFT_BLANK = this.create("tmm.craft_blank")
@JvmField
val TMM_OFF = this.create("tmm.off")
@JvmField
val TMM_ON = this.create("tmm.on")
@JvmField
val TYPE_GEM_SOUNDS = TUMBLESTONE_BLOCK_SOUNDS
@JvmField
val BERRY_BUSH_SOUNDS = BlockSoundGroup(1f, 1f,
@@ -32,7 +32,14 @@ object CobblemonTradeOffers {
* @return The resulting list.
*/
fun tradeOffersFor(profession: VillagerProfession): List<VillagerTradeOffer> = when (profession) {
VillagerProfession.FARMER -> listOf(VillagerTradeOffer(VillagerProfession.FARMER, 3, listOf(TradeOffers.SellItemFactory(CobblemonItems.VIVICHOKE_SEEDS, 24, 1, 1, 6))))
VillagerProfession.FARMER -> listOf(
VillagerTradeOffer(VillagerProfession.FARMER, 3, listOf(TradeOffers.SellItemFactory(CobblemonItems.VIVICHOKE_SEEDS, 24, 1, 1, 6)))
)
VillagerProfession.FISHERMAN -> listOf(
VillagerTradeOffer(VillagerProfession.FISHERMAN, 5, listOf(
TradeOffers.SellItemFactory(CobblemonItems.POKEROD_SMITHING_TEMPLATE, 12, 3, 30)
))
)
else -> emptyList()
}
@@ -8,10 +8,13 @@
package com.cobblemon.mod.common.advancement
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.advancement.criterion.*
import com.cobblemon.mod.common.util.cobblemonResource
import com.cobblemon.mod.common.platform.PlatformRegistry
import net.minecraft.advancement.criterion.Criterion
import net.minecraft.registry.Registries
import net.minecraft.registry.Registry
import net.minecraft.registry.RegistryKey
import net.minecraft.registry.RegistryKeys
/**
* Contains all the advancement criteria in Cobblemon.
@@ -19,108 +22,40 @@ import net.minecraft.advancement.criterion.Criterion
* @author Licious
* @since October 26th, 2022
*/
object CobblemonCriteria {
val PICK_STARTER = this.create(
SimpleCriterionTrigger(
cobblemonResource("pick_starter"),
PickStarterCriterionCondition::class.java
)
)
val CATCH_POKEMON = this.create(
SimpleCriterionTrigger(
cobblemonResource("catch_pokemon"),
CaughtPokemonCriterionCondition::class.java
)
)
val CATCH_SHINY_POKEMON = this.create(
SimpleCriterionTrigger(
cobblemonResource("catch_shiny_pokemon"),
SimpleCountableCriterionCondition::class.java
)
)
val EGG_HATCH = this.create(
SimpleCriterionTrigger(
cobblemonResource("eggs_hatched"),
SimpleCountableCriterionCondition::class.java
)
)
val EVOLVE_POKEMON = this.create(
SimpleCriterionTrigger(
cobblemonResource("pokemon_evolved"),
EvolvePokemonCriterionCondition::class.java
)
)
val WIN_BATTLE = this.create(
BattleCountableCriterionTrigger(
cobblemonResource("battles_won"),
BattleCountableCriterionCondition::class.java
)
)
object CobblemonCriteria : PlatformRegistry<Registry<Criterion<*>>, RegistryKey<Registry<Criterion<*>>>, Criterion<*>>(){
val PICK_STARTER = this.create("pick_starter", SimpleCriterionTrigger(PokemonCriterion.CODEC))
val DEFEAT_POKEMON = this.create(
SimpleCriterionTrigger(
cobblemonResource("pokemon_defeated"),
SimpleCountableCriterionCondition::class.java
)
)
val CATCH_POKEMON = this.create("catch_pokemon", SimpleCriterionTrigger(CaughtPokemonCriterion.CODEC))
val COLLECT_ASPECT = this.create(
AspectCriterionTrigger(
cobblemonResource("aspects_collected"),
AspectCriterionCondition::class.java
)
)
val CATCH_SHINY_POKEMON = this.create("catch_shiny_pokemon", SimpleCriterionTrigger(CountableCriterion.CODEC))
val POKEMON_INTERACT = this.create(
SimpleCriterionTrigger(
cobblemonResource("pokemon_interact"),
PokemonInteractCriterion::class.java
)
)
val EGG_HATCH = this.create("eggs_hatched", SimpleCriterionTrigger(CountableCriterion.CODEC))
val PARTY_CHECK = this.create(
SimpleCriterionTrigger(
cobblemonResource("party"),
PartyCheckCriterion::class.java
)
)
val EVOLVE_POKEMON = this.create("pokemon_evolved", SimpleCriterionTrigger(EvolvePokemonCriterion.CODEC))
val LEVEL_UP = this.create(
SimpleCriterionTrigger(
cobblemonResource("level_up"),
LevelUpCriterionCondition::class.java
)
)
val WIN_BATTLE = this.create("battles_won", SimpleCriterionTrigger(BattleCountableCriterion.CODEC))
val PASTURE_USE = this.create(
SimpleCriterionTrigger(
cobblemonResource("pasture_use"),
PickStarterCriterionCondition::class.java
)
)
val DEFEAT_POKEMON = this.create("pokemon_defeated", SimpleCriterionTrigger(CountableCriterion.CODEC))
val RESURRECT_POKEMON = this.create(
SimpleCriterionTrigger(
cobblemonResource("resurrect_pokemon"),
PickStarterCriterionCondition::class.java
)
)
val COLLECT_ASPECT = this.create("aspects_collected", SimpleCriterionTrigger(AspectCriterion.CODEC))
val TRADE_POKEMON = this.create(
SimpleCriterionTrigger(
cobblemonResource("trade_pokemon"),
TradePokemonCriterionCondition::class.java
)
)
val POKEMON_INTERACT = this.create("pokemon_interact", SimpleCriterionTrigger(PokemonInteractCriterion.CODEC))
val PARTY_CHECK = this.create("party", SimpleCriterionTrigger(PartyCheckCriterion.CODEC))
val LEVEL_UP = this.create("level_up", SimpleCriterionTrigger(LevelUpCriterion.CODEC))
val PASTURE_USE = this.create("pasture_use", SimpleCriterionTrigger(PokemonCriterion.CODEC))
val RESURRECT_POKEMON = this.create("resurrect_pokemon", SimpleCriterionTrigger(PokemonCriterion.CODEC))
val TRADE_POKEMON = this.create("trade_pokemon", SimpleCriterionTrigger(TradePokemonCriterion.CODEC))
val CAST_POKE_ROD = this.create("cast_poke_rod", SimpleCriterionTrigger(CastPokeRodCriterionCondition.CODEC))
// Advancement criteria for [grow_tumblestone.json]
val PLANT_TUMBLESTONE = this.create(
SimpleCriterionTrigger(
cobblemonResource("plant_tumblestone"),
PlantTumblestoneCriterionCondition::class.java
)
)
private fun <T : Criterion<*>> create(criteria: T): T = Cobblemon.implementation.registerCriteria(criteria)
val PLANT_TUMBLESTONE = this.create("plant_tumblestone", SimpleCriterionTrigger(PlantTumblestoneCriterion.CODEC))
override val registry = Registries.CRITERION
override val registryKey = RegistryKeys.CRITERION
}
@@ -8,38 +8,61 @@
package com.cobblemon.mod.common.advancement.criterion
import com.cobblemon.mod.common.util.asIdentifierDefaultingNamespace
import com.google.gson.JsonArray
import com.google.gson.JsonObject
import com.cobblemon.mod.common.util.cobblemonResource
import com.mojang.serialization.Codec
import com.mojang.serialization.codecs.RecordCodecBuilder
import net.minecraft.predicate.entity.LootContextPredicate
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.Identifier
import net.minecraft.util.dynamic.Codecs
import java.util.Optional
open class AspectCriterionTrigger(identifier: Identifier, criterionClass: Class<AspectCriterionCondition>) : SimpleCriterionTrigger<MutableMap<Identifier, MutableSet<String>>, AspectCriterionCondition>(identifier, criterionClass) {
class AspectCriterion(
playerCtx: Optional<LootContextPredicate>,
val pokemon: Identifier,
val aspects: List<String>
): SimpleCriterionCondition<MutableMap<Identifier, MutableSet<String>>>(playerCtx) {
}
class AspectCriterionCondition(id: Identifier, predicate: LootContextPredicate) : SimpleCriterionCondition<MutableMap<Identifier, MutableSet<String>>>(id, predicate) {
var pokemon = Identifier("cobblemon:pikachu")
var aspects = mutableListOf<String>()
override fun toJson(json: JsonObject) {
json.add("aspects", JsonArray(aspects.size).also {
aspects.forEach { aspect -> it.add(aspect) }
})
json.addProperty("pokemon", pokemon.toString())
}
override fun fromJson(json: JsonObject) {
aspects.clear()
json.getAsJsonArray("aspects").forEach { element ->
aspects.add(element.asString)
}
pokemon = json.get("pokemon").asString.asIdentifierDefaultingNamespace()
companion object {
val CODEC: Codec<AspectCriterion> = RecordCodecBuilder.create { it.group(
//All three of these codecs used to use Codecs.createStrictOptionalFieldCodec, that no longer exists
LootContextPredicate.CODEC.optionalFieldOf("player").forGetter(AspectCriterion::playerCtx),
Identifier.CODEC.optionalFieldOf("pokemon", cobblemonResource("pikachu")).forGetter(AspectCriterion::pokemon),
Codec.STRING.listOf().optionalFieldOf("aspects", listOf()).forGetter(AspectCriterion::aspects)
) .apply(it, ::AspectCriterion) }
}
override fun matches(player: ServerPlayerEntity, context: MutableMap<Identifier, MutableSet<String>>): Boolean {
val caughtAspects = context.getOrDefault(pokemon, mutableSetOf())
return this.aspects.all { it in caughtAspects }
}
}
}
//open class AspectCriterionTrigger(identifier: Identifier, criterionClass: Class<AspectCriterionCondition>) : SimpleCriterionTrigger<MutableMap<Identifier, MutableSet<String>>, AspectCriterionCondition>(identifier, criterionClass) {
//
//}
//
//class AspectCriterionCondition(id: Identifier, predicate: LootContextPredicate) : SimpleCriterionCondition<MutableMap<Identifier, MutableSet<String>>>(id, predicate) {
// var pokemon = Identifier.of("cobblemon:pikachu")
// var aspects = mutableListOf<String>()
// override fun toJson(json: JsonObject) {
// json.add("aspects", JsonArray(aspects.size).also {
// aspects.forEach { aspect -> it.add(aspect) }
// })
// json.addProperty("pokemon", pokemon.toString())
// }
//
// override fun fromJson(json: JsonObject) {
// aspects.clear()
// json.getAsJsonArray("aspects").forEach { element ->
// aspects.add(element.asString)
// }
// pokemon = json.get("pokemon").asString.asIdentifierDefaultingNamespace()
// }
//
// override fun matches(player: ServerPlayerEntity, context: MutableMap<Identifier, MutableSet<String>>): Boolean {
// val caughtAspects = context.getOrDefault(pokemon, mutableSetOf())
// return this.aspects.all { it in caughtAspects }
// }
//
//}
@@ -10,58 +10,105 @@ 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 com.mojang.serialization.Codec
import com.mojang.serialization.codecs.RecordCodecBuilder
import net.minecraft.predicate.entity.LootContextPredicate
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.Identifier
import net.minecraft.util.dynamic.Codecs
import java.util.Optional
open class BattleCountableCriterionTrigger(identifier: Identifier, criterionClass: Class<BattleCountableCriterionCondition>) : SimpleCriterionTrigger<BattleCountableContext, BattleCountableCriterionCondition>(identifier, criterionClass) {
open class BattleCountableContext(var battle : PokemonBattle, times : Int) : CountableContext(times)
}
class BattleCountableCriterion(
playerCtx: Optional<LootContextPredicate>,
val battleTypes: List<String>,
count: Int
): CountableCriterion<BattleCountableContext>(playerCtx, count) {
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())
companion object {
val CODEC: Codec<BattleCountableCriterion> = RecordCodecBuilder.create { it.group(
LootContextPredicate.CODEC.optionalFieldOf("player").forGetter(BattleCountableCriterion::playerCtx),
Codec.STRING.listOf().optionalFieldOf("battle_types", listOf("any")).forGetter(BattleCountableCriterion::battleTypes),
Codec.INT.optionalFieldOf( "count", 0).forGetter(BattleCountableCriterion::count)
).apply(it, ::BattleCountableCriterion) }
}
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
return typeCheck && super.matches(player, context)
}
}
open class BattleCountableContext(times : Int, var battle : PokemonBattle) : CountableContext(times)
//open class BattleCountableCriterionTrigger(identifier: Identifier, criterionClass: Class<BattleCountableCriterion>) : SimpleCriterionTrigger<BattleCountableContext, BattleCountableCriterion>(identifier, criterionClass) {
//
//}
//
//class BattleCountableCriterion(id: Identifier, predicate: LootContextPredicate) : CountableCriterion<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
// }
//}
@@ -0,0 +1,33 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.advancement.criterion
import com.mojang.serialization.Codec
import com.mojang.serialization.codecs.PrimitiveCodec
import com.mojang.serialization.codecs.RecordCodecBuilder
import java.util.Optional
import net.minecraft.predicate.entity.EntityPredicate
import net.minecraft.predicate.entity.LootContextPredicate
import net.minecraft.server.network.ServerPlayerEntity
class CastPokeRodCriterionCondition(
playerCtx: Optional<LootContextPredicate>,
val hasBait: Boolean
): SimpleCriterionCondition<Boolean>(playerCtx) {
companion object {
val CODEC: Codec<CastPokeRodCriterionCondition> = RecordCodecBuilder.create { it.group(
EntityPredicate.LOOT_CONTEXT_PREDICATE_CODEC.optionalFieldOf("player").forGetter(CastPokeRodCriterionCondition::playerCtx),
PrimitiveCodec.BOOL.fieldOf("hasBait").forGetter(CastPokeRodCriterionCondition::hasBait)
).apply(it, ::CastPokeRodCriterionCondition) }
}
override fun matches(player: ServerPlayerEntity, context: Boolean): Boolean {
return hasBait == context
}
}
@@ -8,10 +8,13 @@
package com.cobblemon.mod.common.advancement.criterion
import com.google.gson.JsonObject
import com.mojang.serialization.Codec
import com.mojang.serialization.codecs.RecordCodecBuilder
import net.minecraft.predicate.entity.EntityPredicate
import net.minecraft.predicate.entity.LootContextPredicate
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.Identifier
import net.minecraft.util.dynamic.Codecs
import java.util.Optional
/**
* A context that is used when you require a [CountableContext] along with some type string.
@@ -21,19 +24,38 @@ import net.minecraft.util.Identifier
*/
open class CountablePokemonTypeContext(times: Int, var type: String) : CountableContext(times)
class CaughtPokemonCriterionCondition(id: Identifier, predicate: LootContextPredicate) : CountableCriterionCondition<CountablePokemonTypeContext>(id, predicate) {
var type = "any"
override fun toJson(json: JsonObject) {
super.toJson(json)
json.addProperty("type", type)
}
class CaughtPokemonCriterion(
playerCtx: Optional<LootContextPredicate>,
val type: String,
count: Int
): CountableCriterion<CountablePokemonTypeContext>(playerCtx, count) {
override fun fromJson(json: JsonObject) {
super.fromJson(json)
type = json.get("type")?.asString ?: "any"
companion object {
val CODEC: Codec<CaughtPokemonCriterion> = RecordCodecBuilder.create { it.group(
EntityPredicate.LOOT_CONTEXT_PREDICATE_CODEC.optionalFieldOf("player").forGetter(CaughtPokemonCriterion::playerCtx),
Codec.STRING.optionalFieldOf("type", "any").forGetter(CaughtPokemonCriterion::type),
Codec.INT.optionalFieldOf("count", 0).forGetter(CaughtPokemonCriterion::count)
).apply(it, ::CaughtPokemonCriterion) }
}
override fun matches(player: ServerPlayerEntity, context: CountablePokemonTypeContext): Boolean {
return super.matches(player, context) && (context.type == type || type == "any")
}
}
}
//class CaughtPokemonCriterionCondition(id: Identifier, predicate: LootContextPredicate) : CountableCriterionCondition<CountablePokemonTypeContext>(id, predicate) {
// var type = "any"
// override fun toJson(json: JsonObject) {
// super.toJson(json)
// json.addProperty("type", type)
// }
//
// override fun fromJson(json: JsonObject) {
// super.fromJson(json)
// type = json.get("type")?.asString ?: "any"
// }
//
// override fun matches(player: ServerPlayerEntity, context: CountablePokemonTypeContext): Boolean {
// return super.matches(player, context) && (context.type == type || type == "any")
// }
//}
@@ -8,48 +8,69 @@
package com.cobblemon.mod.common.advancement.criterion
import com.google.gson.JsonObject
import com.mojang.serialization.Codec
import com.mojang.serialization.codecs.RecordCodecBuilder
import net.minecraft.predicate.entity.EntityPredicate
import net.minecraft.predicate.entity.LootContextPredicate
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.Identifier
import net.minecraft.util.dynamic.Codecs
import java.util.Optional
/**
* A type of advancement criterion condition that requires some number of completions. This can be extended to add
* more conditions than just the count.
*
* @author Hiroku
* @since November 4th, 2022
*/
abstract class CountableCriterionCondition<T : CountableContext>(id: Identifier, predicate: LootContextPredicate) : SimpleCriterionCondition<T>(id, predicate) {
var count = 0
override fun fromJson(json: JsonObject) {
count = json.get("count")?.asInt ?: 0
}
open class CountableContext(var times: Int)
override fun toJson(json: JsonObject) {
json.addProperty("count", count)
open class CountableCriterion<T : CountableContext>(
playerCtx: Optional<LootContextPredicate>,
val count: Int
): SimpleCriterionCondition<T>(playerCtx) {
companion object {
val CODEC: Codec<CountableCriterion<CountableContext>> = RecordCodecBuilder.create { it.group(
EntityPredicate.LOOT_CONTEXT_PREDICATE_CODEC.optionalFieldOf("player").forGetter(CountableCriterion<CountableContext>::playerCtx),
Codec.INT.optionalFieldOf("count", 0).forGetter(CountableCriterion<CountableContext>::count)
).apply(it, ::CountableCriterion) }
}
override fun matches(player: ServerPlayerEntity, context: T) = context.times >= count
}
/**
* A concrete subclass of [CountableCriterionCondition] so that you can have advancements that really just need the
* count and nothing else.
*
* This is just a quirk of using generics like this, don't worry about it. The criterion conditions that get used must
* not be generic typed.
*
* @author Hiroku
* @since November 4th, 2022
*/
class SimpleCountableCriterionCondition(id: Identifier, predicate: LootContextPredicate) : CountableCriterionCondition<CountableContext>(id, predicate)
fun SimpleCriterionTrigger<CountableContext, SimpleCountableCriterionCondition>.trigger(player: ServerPlayerEntity, times: Int) = trigger(player, CountableContext(times))
/**
* Some type of context that has a count associated with it, representing how many times the trigger has occurred.
*
* @author Hiroku
* @since November 4th, 2022
*/
open class CountableContext(var times: Int)
///**
// * A type of advancement criterion condition that requires some number of completions. This can be extended to add
// * more conditions than just the count.
// *
// * @author Hiroku
// * @since November 4th, 2022
// */
//abstract class CountableCriterionCondition<T : CountableContext>(id: Identifier, predicate: LootContextPredicate) : SimpleCriterionCondition<T>(id, predicate) {
// var count = 0
// override fun fromJson(json: JsonObject) {
// count = json.get("count")?.asInt ?: 0
// }
//
// override fun toJson(json: JsonObject) {
// json.addProperty("count", count)
// }
//
// override fun matches(player: ServerPlayerEntity, context: T) = context.times >= count
//}
//
///**
// * A concrete subclass of [CountableCriterionCondition] so that you can have advancements that really just need the
// * count and nothing else.
// *
// * This is just a quirk of using generics like this, don't worry about it. The criterion conditions that get used must
// * not be generic typed.
// *
// * @author Hiroku
// * @since November 4th, 2022
// */
//class SimpleCountableCriterionCondition(id: Identifier, predicate: LootContextPredicate) : CountableCriterionCondition<CountableContext>(id, predicate)
//fun SimpleCriterionTrigger<CountableContext, SimpleCountableCriterionCondition>.trigger(player: ServerPlayerEntity, times: Int) = trigger(player, CountableContext(times))
//
///**
// * Some type of context that has a count associated with it, representing how many times the trigger has occurred.
// *
// * @author Hiroku
// * @since November 4th, 2022
// */
//open class CountableContext(var times: Int)
@@ -0,0 +1,65 @@
/*
* 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.mojang.serialization.Codec
import com.mojang.serialization.codecs.RecordCodecBuilder
import net.minecraft.predicate.entity.LootContextPredicate
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.Identifier
import net.minecraft.util.dynamic.Codecs
import java.util.Optional
class EvolvePokemonContext(val species : Identifier, val evolution : Identifier, times: Int) : CountableContext(times)
class EvolvePokemonCriterion(
playerCtx: Optional<LootContextPredicate>,
val species: String,
val evolution: String,
count: Int
): CountableCriterion<EvolvePokemonContext>(playerCtx, count) {
companion object {
val CODEC: Codec<EvolvePokemonCriterion> = RecordCodecBuilder.create { it.group(
LootContextPredicate.CODEC.optionalFieldOf("player").forGetter(EvolvePokemonCriterion::playerCtx),
Codec.STRING.optionalFieldOf("species", "any").forGetter(EvolvePokemonCriterion::species),
Codec.STRING.optionalFieldOf("evolution", "any").forGetter(EvolvePokemonCriterion::evolution),
Codec.INT.optionalFieldOf("count", 0).forGetter(EvolvePokemonCriterion::count)
).apply(it, ::EvolvePokemonCriterion) }
}
override fun matches(player: ServerPlayerEntity, context: EvolvePokemonContext): Boolean {
return context.times >= count && (context.species == species.asIdentifierDefaultingNamespace() || species == "any") &&
(context.evolution == evolution.asIdentifierDefaultingNamespace() || evolution == "any")
}
}
//class EvolvePokemonCriterion(id: Identifier, entity: LootContextPredicate) : CountableCriterion<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)
@@ -1,38 +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.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)
@@ -9,12 +9,43 @@
package com.cobblemon.mod.common.advancement.criterion
import com.cobblemon.mod.common.pokemon.Pokemon
import com.google.gson.JsonObject
import com.mojang.serialization.Codec
import com.mojang.serialization.codecs.RecordCodecBuilder
import net.minecraft.predicate.entity.EntityPredicate
import net.minecraft.predicate.entity.LootContextPredicate
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.Identifier
import net.minecraft.util.dynamic.Codecs
import java.util.Optional
class LevelUpCriterionCondition(id: Identifier, entity: LootContextPredicate) : SimpleCriterionCondition<LevelUpContext>(id, entity) {
class LevelUpContext(val level: Int, val pokemon: Pokemon)
class LevelUpCriterion(
playerCtx: Optional<LootContextPredicate>,
val level: Int,
val evolved: Boolean
): SimpleCriterionCondition<LevelUpContext>(playerCtx) {
companion object {
val CODEC: Codec<LevelUpCriterion> = RecordCodecBuilder.create { it.group(
EntityPredicate.LOOT_CONTEXT_PREDICATE_CODEC.optionalFieldOf("player").forGetter(LevelUpCriterion::playerCtx),
Codec.INT.optionalFieldOf("level", 0).forGetter(LevelUpCriterion::level),
Codec.BOOL.optionalFieldOf("evolved", true).forGetter(LevelUpCriterion::evolved)
).apply(it, ::LevelUpCriterion) }
}
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
}
}
/*class LevelUpCriterionCondition(id: Identifier, entity: LootContextPredicate) : SimpleCriterionCondition<LevelUpContext>(id, entity) {
var level = 0
var evolved = true
override fun toJson(json: JsonObject) {
@@ -36,6 +67,4 @@ class LevelUpCriterionCondition(id: Identifier, entity: LootContextPredicate) :
}
return level == context.level && evolutionCheck == evolved
}
}
open class LevelUpContext(var level : Int, var pokemon : Pokemon)
}*/
@@ -10,14 +10,62 @@ 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 com.mojang.serialization.Codec
import com.mojang.serialization.codecs.RecordCodecBuilder
import net.minecraft.predicate.entity.EntityPredicate
import net.minecraft.predicate.entity.LootContextPredicate
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.Identifier
import net.minecraft.util.dynamic.Codecs
import java.util.Optional
class PartyCheckCriterion(id: Identifier, entity: LootContextPredicate) : SimpleCriterionCondition<PartyCheckContext>(id, entity){
class PartyCheckCriterion(
playerCtx: Optional<LootContextPredicate>,
val party: List<Identifier>,
): SimpleCriterionCondition<PlayerPartyStore>(playerCtx) {
companion object {
val CODEC: Codec<PartyCheckCriterion> = RecordCodecBuilder.create { it.group(
EntityPredicate.LOOT_CONTEXT_PREDICATE_CODEC.optionalFieldOf("player").forGetter(PartyCheckCriterion::playerCtx),
Identifier.CODEC.listOf().optionalFieldOf("id", listOf()).forGetter(PartyCheckCriterion::party)
).apply(it, ::PartyCheckCriterion) }
}
override fun matches(player: ServerPlayerEntity, context: PlayerPartyStore): Boolean {
val matches = mutableListOf<Identifier>()
party.forEach {
if (it == "any".asIdentifierDefaultingNamespace()) {
matches.add(it)
}
}
val partyCount = context.count()
if (matches.containsAll(party) && party.size == partyCount && matches.size == partyCount) return true
context.iterator().forEach {
if (party.contains(it.species.resourceIdentifier)) {
matches.add(it.species.resourceIdentifier)
}
}
return matches.containsAll(party) && matches.size == partyCount
}
}
/*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 {
@@ -51,4 +99,4 @@ class PartyCheckCriterion(id: Identifier, entity: LootContextPredicate) : Simple
}
}
open class PartyCheckContext(val party : PlayerPartyStore)
open class PartyCheckContext(val party : PlayerPartyStore)*/
@@ -10,26 +10,27 @@ package com.cobblemon.mod.common.advancement.criterion
import com.cobblemon.mod.common.api.pokemon.PokemonProperties
import com.cobblemon.mod.common.pokemon.Pokemon
import com.google.gson.JsonObject
import com.mojang.serialization.Codec
import com.mojang.serialization.codecs.RecordCodecBuilder
import net.minecraft.predicate.entity.EntityPredicate
import net.minecraft.predicate.entity.LootContextPredicate
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.Identifier
import net.minecraft.util.dynamic.Codecs
import java.util.Optional
/**
* A criteria that is triggered when a player picks a starter.
*
* @author Licious, Hiroku
* @since October 26th, 2022
*/
class PickStarterCriterionCondition(id: Identifier, predicate: LootContextPredicate) : SimpleCriterionCondition<Pokemon>(id, predicate) {
var properties = PokemonProperties()
override fun toJson(json: JsonObject) {
json.addProperty("properties", properties.originalString)
class PokemonCriterion(
playerCtx: Optional<LootContextPredicate>,
val properties: PokemonProperties
): SimpleCriterionCondition<Pokemon>(playerCtx) {
companion object {
val CODEC: Codec<PokemonCriterion> = RecordCodecBuilder.create { it.group(
EntityPredicate.LOOT_CONTEXT_PREDICATE_CODEC.optionalFieldOf("player").forGetter(PokemonCriterion::playerCtx),
PokemonProperties.CODEC.optionalFieldOf("properties", PokemonProperties()).forGetter(PokemonCriterion::properties)
).apply(it, ::PokemonCriterion) }
}
override fun fromJson(json: JsonObject) {
properties = PokemonProperties.parse(json.get("properties")?.asString ?: "")
override fun matches(player: ServerPlayerEntity, context: Pokemon): Boolean {
return properties.matches(context)
}
override fun matches(player: ServerPlayerEntity, context: Pokemon) = properties.matches(context)
}
@@ -9,44 +9,63 @@
package com.cobblemon.mod.common.advancement.criterion
import com.cobblemon.mod.common.block.TumblestoneBlock
import com.google.gson.JsonObject
import com.mojang.serialization.Codec
import com.mojang.serialization.codecs.RecordCodecBuilder
import net.minecraft.predicate.entity.LootContextPredicate
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.Identifier
import net.minecraft.util.dynamic.Codecs
import net.minecraft.util.math.BlockPos
import java.util.Optional
/**
* A criterion condition for when a tumblestone block is planted
* @param id The identifier of the criterion
* @param predicate The predicate for the criterion
*
* @author Aethen
* @since 02/28/2024
*/
class PlantTumblestoneCriterionCondition(id: Identifier, predicate: LootContextPredicate) :
SimpleCriterionCondition<PlantTumblestoneContext>(id, predicate) {
override fun toJson(json: JsonObject) {
// Add properties to json if needed. None needed for this criterion
class PlantTumblestoneContext(val pos: BlockPos, val block: TumblestoneBlock)
class PlantTumblestoneCriterion(
playerCtx: Optional<LootContextPredicate>
): SimpleCriterionCondition<PlantTumblestoneContext>(playerCtx) {
companion object {
val CODEC: Codec<PlantTumblestoneCriterion> = RecordCodecBuilder.create { it.group(
LootContextPredicate.CODEC.optionalFieldOf("player").forGetter(PlantTumblestoneCriterion::playerCtx)
).apply(it, ::PlantTumblestoneCriterion) }
}
override fun fromJson(json: JsonObject) {
// Parse properties from json if needed. None needed for this criterion
}
/**
* Checks if the tumblestone block can grow at the given position
* @param player The player that planted the tumblestone block
* @param context The context of the criterion
* @return True if the tumblestone block can grow at the given position, false otherwise
*/
override fun matches(player: ServerPlayerEntity, context: PlantTumblestoneContext): Boolean {
return context.tumbleStoneBlock.canGrow(context.pos, player.world)
return context.block.canGrow(context.pos, player.world)
}
}
/**
* The context of the [PlantTumblestoneCriterionCondition]
* @param pos The position of the tumblestone block
* @param tumbleStoneBlock The tumblestone block
*/
open class PlantTumblestoneContext(var pos: BlockPos, var tumbleStoneBlock: TumblestoneBlock)
///**
// * A criterion condition for when a tumblestone block is planted
// * @param id The identifier of the criterion
// * @param predicate The predicate for the criterion
// *
// * @author Aethen
// * @since 02/28/2024
// */
//class PlantTumblestoneCriterionCondition(id: Identifier, predicate: LootContextPredicate) :
// SimpleCriterionCondition<PlantTumblestoneContext>(id, predicate) {
// override fun toJson(json: JsonObject) {
// // Add properties to json if needed. None needed for this criterion
// }
//
// override fun fromJson(json: JsonObject) {
// // Parse properties from json if needed. None needed for this criterion
// }
//
// /**
// * Checks if the tumblestone block can grow at the given position
// * @param player The player that planted the tumblestone block
// * @param context The context of the criterion
// * @return True if the tumblestone block can grow at the given position, false otherwise
// */
// override fun matches(player: ServerPlayerEntity, context: PlantTumblestoneContext): Boolean {
// return context.tumbleStoneBlock.canGrow(context.pos, player.world)
// }
//}
//
///**
// * The context of the [PlantTumblestoneCriterionCondition]
// * @param pos The position of the tumblestone block
// * @param tumbleStoneBlock The tumblestone block
// */
//open class PlantTumblestoneContext(var pos: BlockPos, var tumbleStoneBlock: TumblestoneBlock)
@@ -9,26 +9,33 @@
package com.cobblemon.mod.common.advancement.criterion
import com.cobblemon.mod.common.util.asIdentifierDefaultingNamespace
import com.google.gson.JsonObject
import com.mojang.serialization.Codec
import com.mojang.serialization.codecs.RecordCodecBuilder
import net.minecraft.predicate.entity.EntityPredicate
import net.minecraft.predicate.entity.LootContextPredicate
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.Identifier
import net.minecraft.util.dynamic.Codecs
import java.util.Optional
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)
}
class PokemonInteractContext(val type: Identifier, val item: Identifier)
override fun fromJson(json: JsonObject) {
type = json.get("type")?.asString ?: "any"
item = json.get("item")?.asString ?: "any"
class PokemonInteractCriterion(
playerCtx: Optional<LootContextPredicate>,
val type: Optional<String>,
val item: Optional<String>
): SimpleCriterionCondition<PokemonInteractContext>(playerCtx) {
companion object {
val CODEC: Codec<PokemonInteractCriterion> = RecordCodecBuilder.create { it.group(
EntityPredicate.LOOT_CONTEXT_PREDICATE_CODEC.optionalFieldOf("player").forGetter(PokemonInteractCriterion::playerCtx),
Codec.STRING.optionalFieldOf("type").forGetter(PokemonInteractCriterion::type),
Codec.STRING.optionalFieldOf("item").forGetter(PokemonInteractCriterion::item)
).apply(it, ::PokemonInteractCriterion) }
}
override fun matches(player: ServerPlayerEntity, context: PokemonInteractContext): Boolean {
return (context.type == type.asIdentifierDefaultingNamespace() || type == "any") && (context.item == item.asIdentifierDefaultingNamespace() || item == "any")
val otherType = this.type.orElse("any")
val otherItem = this.item.orElse("any")
return (context.type == otherType.asIdentifierDefaultingNamespace() || otherType == "any") && (context.type == otherItem.asIdentifierDefaultingNamespace() || otherItem == "any")
}
}
@@ -8,61 +8,28 @@
package com.cobblemon.mod.common.advancement.criterion
import com.google.gson.JsonObject
import com.mojang.serialization.Codec
import net.minecraft.advancement.criterion.AbstractCriterion
import net.minecraft.advancement.criterion.AbstractCriterionConditions
import net.minecraft.predicate.entity.AdvancementEntityPredicateDeserializer
import net.minecraft.predicate.entity.AdvancementEntityPredicateSerializer
import net.minecraft.predicate.entity.LootContextPredicate
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.Identifier
import java.util.Optional
/**
* A wrapping around the AbstractCriterion system of Minecraft. This allows the same base class to be used
* for all advancements by wrapping the advancement-specific contextual data in the generic T, the instance of
* the advancement conditions in the generic C, and allowing the condition to do all serialization, deserialization,
* and matching of context against conditions.
*
* @author Hiroku
* @since November 4th, 2022
*/
open class SimpleCriterionTrigger<T, C : SimpleCriterionCondition<T>>(
val _id: Identifier,
val criterionClass: Class<C>
class SimpleCriterionTrigger<T, C : SimpleCriterionCondition<T>>(
val codec: Codec<C>,
) : AbstractCriterion<C>() {
override fun getId() = _id
override fun conditionsFromJson(
obj: JsonObject,
playerPredicate: LootContextPredicate,
predicateDeserializer: AdvancementEntityPredicateDeserializer
): C {
val instance = criterionClass.getConstructor(Identifier::class.java, LootContextPredicate::class.java).newInstance(id, playerPredicate)
instance.fromJson(obj)
return instance
}
override fun getConditionsCodec() = codec
fun trigger(player: ServerPlayerEntity, context: T) = this.trigger(player) { it.matches(player, context) }
fun trigger(player: ServerPlayerEntity, context: T) {
return this.trigger(player) {
it.matches(player, context)
}
}
}
/**
* The base of the conditions for Cobblemon's wrapping around Minecraft advancements. This is parameterized by whatever
* contextual information this condition needs to be checked, and must handle serialization and deserialization from JSON.
*
* @author Hiroku
* @since November 4th, 2022
*/
abstract class SimpleCriterionCondition<T>(
id: Identifier,
playerPredicate: LootContextPredicate
): AbstractCriterionConditions(id, playerPredicate) {
override fun toJson(predicateSerializer: AdvancementEntityPredicateSerializer): JsonObject {
val json = super.toJson(predicateSerializer)
toJson(json)
return json
}
abstract fun toJson(json: JsonObject)
abstract fun fromJson(json: JsonObject)
val playerCtx: Optional<LootContextPredicate>
) : AbstractCriterion.Conditions {
override fun player() = playerCtx
abstract fun matches(player: ServerPlayerEntity, context: T): Boolean
}
@@ -10,12 +10,59 @@ 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 com.mojang.serialization.Codec
import com.mojang.serialization.codecs.RecordCodecBuilder
import net.minecraft.predicate.entity.EntityPredicate
import net.minecraft.predicate.entity.LootContextPredicate
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.Identifier
import net.minecraft.util.dynamic.Codecs
import java.util.Optional
class TradePokemonCriterionCondition(id: Identifier, entity: LootContextPredicate) : SimpleCriterionCondition<TradePokemonContext>(id, entity) {
class TradePokemonContext(val traded: Pokemon, val received: Pokemon)
class TradePokemonCriterion(
playerCtx: Optional<LootContextPredicate>,
val traded: String,
val received: String,
val tradedHeldItem: String,
val receivedHeldItem: String
): SimpleCriterionCondition<TradePokemonContext>(playerCtx) {
companion object {
val CODEC: Codec<TradePokemonCriterion> = RecordCodecBuilder.create { it.group(
EntityPredicate.LOOT_CONTEXT_PREDICATE_CODEC.optionalFieldOf("player").forGetter(TradePokemonCriterion::playerCtx),
Codec.STRING.optionalFieldOf("traded", "any").forGetter(TradePokemonCriterion::traded),
Codec.STRING.optionalFieldOf("received", "any").forGetter(TradePokemonCriterion::received),
Codec.STRING.optionalFieldOf("traded_held_item", "minecraft:air").forGetter(TradePokemonCriterion::tradedHeldItem),
Codec.STRING.optionalFieldOf("received_held_item", "minecraft:air").forGetter(TradePokemonCriterion::receivedHeldItem)
).apply(it, ::TradePokemonCriterion) }
}
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
if (traded != "any" && context.traded.species.resourceIdentifier != traded.asIdentifierDefaultingNamespace()) {
return false
}
if (received != "any" && context.received.species.resourceIdentifier != received.asIdentifierDefaultingNamespace()) {
return false
}
if (heldItem1 != tradedHeldItem.asIdentifierDefaultingNamespace() && heldItem1 != "minecraft:air".asIdentifierDefaultingNamespace()) {
return false
}
if (heldItem2 != receivedHeldItem.asIdentifierDefaultingNamespace() && heldItem2 != "minecraft:air".asIdentifierDefaultingNamespace()) {
return false
}
return true
}
}
/*class TradePokemonCriterionCondition(id: Identifier, entity: LootContextPredicate) : SimpleCriterionCondition<TradePokemonContext>(id, entity) {
var traded = "any"
var received = "any"
var tradedHeldItem = "any"
@@ -44,4 +91,4 @@ class TradePokemonCriterionCondition(id: Identifier, entity: LootContextPredicat
}
}
open class TradePokemonContext(val traded: Pokemon, val received: Pokemon)
open class TradePokemonContext(val traded: Pokemon, val received: Pokemon)*/
@@ -13,8 +13,13 @@ import com.cobblemon.mod.common.CobblemonItems
import com.cobblemon.mod.common.block.ApricornBlock
import com.cobblemon.mod.common.block.ApricornSaplingBlock
import com.cobblemon.mod.common.item.ApricornItem
import com.cobblemon.mod.common.world.feature.CobblemonConfiguredFeatures
import com.mojang.serialization.Codec
import net.minecraft.block.MapColor
import net.minecraft.item.BlockItem
import net.minecraft.registry.RegistryKey
import net.minecraft.util.StringIdentifiable
import net.minecraft.world.gen.feature.ConfiguredFeature
/**
* Contains the different Apricorn variants and util methods to get their item, block, seedling and sapling form.
@@ -22,7 +27,7 @@ import net.minecraft.item.BlockItem
* @author Licious
* @since October 29th, 2022
*/
enum class Apricorn {
enum class Apricorn : StringIdentifiable {
BLACK,
BLUE,
@@ -82,4 +87,20 @@ enum class Apricorn {
YELLOW -> MapColor.YELLOW
}
fun configuredFeature(): RegistryKey<ConfiguredFeature<*, *>> = when(this) {
BLACK -> CobblemonConfiguredFeatures.BLACK_APRICORN_TREE_KEY
BLUE -> CobblemonConfiguredFeatures.BLUE_APRICORN_TREE_KEY
GREEN -> CobblemonConfiguredFeatures.GREEN_APRICORN_TREE_KEY
PINK -> CobblemonConfiguredFeatures.PINK_APRICORN_TREE_KEY
RED -> CobblemonConfiguredFeatures.RED_APRICORN_TREE_KEY
WHITE -> CobblemonConfiguredFeatures.WHITE_APRICORN_TREE_KEY
YELLOW -> CobblemonConfiguredFeatures.YELLOW_APRICORN_TREE_KEY
}
override fun asString() = this.name.lowercase()
companion object {
val CODEC: Codec<Apricorn> = StringIdentifiable.createBasicCodec(::values)
}
}
@@ -8,6 +8,7 @@
package com.cobblemon.mod.common.api.battles.model
import com.bedrockk.molang.runtime.MoLangRuntime
import com.bedrockk.molang.runtime.struct.QueryStruct
import com.bedrockk.molang.runtime.value.DoubleValue
import com.cobblemon.mod.common.Cobblemon
@@ -20,6 +21,7 @@ import com.cobblemon.mod.common.api.battles.model.actor.EntityBackedBattleActor
import com.cobblemon.mod.common.api.battles.model.actor.FleeableBattleActor
import com.cobblemon.mod.common.api.events.CobblemonEvents
import com.cobblemon.mod.common.api.events.battles.BattleFledEvent
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asMoLangValue
import com.cobblemon.mod.common.api.net.NetworkPacket
import com.cobblemon.mod.common.api.tags.CobblemonItemTags
import com.cobblemon.mod.common.api.text.red
@@ -29,6 +31,7 @@ import com.cobblemon.mod.common.battles.BattleCaptureAction
import com.cobblemon.mod.common.battles.BattleFormat
import com.cobblemon.mod.common.battles.BattleRegistry
import com.cobblemon.mod.common.battles.BattleSide
import com.cobblemon.mod.common.battles.ForfeitActionResponse
import com.cobblemon.mod.common.battles.actor.PlayerBattleActor
import com.cobblemon.mod.common.battles.dispatch.BattleDispatch
import com.cobblemon.mod.common.battles.dispatch.DispatchResult
@@ -37,7 +40,6 @@ import com.cobblemon.mod.common.battles.dispatch.WaitDispatch
import com.cobblemon.mod.common.battles.interpreter.ContextManager
import com.cobblemon.mod.common.battles.pokemon.BattlePokemon
import com.cobblemon.mod.common.battles.runner.ShowdownService
import com.cobblemon.mod.common.battles.ForfeitActionResponse
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.net.messages.client.battle.BattleEndPacket
import com.cobblemon.mod.common.net.messages.client.battle.BattleMessagePacket
@@ -48,9 +50,10 @@ import com.cobblemon.mod.common.util.battleLang
import com.cobblemon.mod.common.util.getPlayer
import java.io.File
import java.util.UUID
import java.util.concurrent.CompletableFuture
import java.util.concurrent.ConcurrentLinkedDeque
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.text.Text
import java.util.concurrent.ConcurrentLinkedDeque
/**
* Individual battle instance
@@ -66,6 +69,10 @@ open class PokemonBattle(
) {
/** Whether logging will be silenced for this battle. */
var mute = true
val struct = this.asMoLangValue()
val runtime = MoLangRuntime().also { it.environment.query = struct }
val onEndHandlers: MutableList<(PokemonBattle) -> Unit> = mutableListOf()
init {
side1.battle = this
@@ -97,6 +104,8 @@ open class PokemonBattle(
val battleLog = mutableListOf<String>()
val chatLog = mutableListOf<Text>()
var started = false
var winners = listOf<BattleActor>()
var losers = listOf<BattleActor>()
var ended = false
// TEMP battle showcase stuff
var announcingRules = false
@@ -226,7 +235,7 @@ open class PokemonBattle(
val facedFainted = opponentPokemon.facedOpponents.contains(faintedPokemon)
val pokemon = opponentPokemon.effectedPokemon
if (facedFainted) {
pokemon.evolutions.forEach { evolution ->
pokemon.lockedEvolutions.forEach { evolution ->
evolution.requirements.filterIsInstance<DefeatRequirement>().forEach { defeatRequirement ->
if (defeatRequirement.target.matches(faintedPokemon.effectedPokemon)) {
val progress = pokemon.evolutionProxy.current().progressFirstOrCreate({ it is DefeatEvolutionProgress && it.currentProgress().target == defeatRequirement.target }) { DefeatEvolutionProgress() }
@@ -266,6 +275,7 @@ open class PokemonBattle(
}
sendUpdate(BattleEndPacket())
BattleRegistry.closeBattle(this)
onEndHandlers.forEach { it(this) }
}
fun finishCaptureAction(captureAction: BattleCaptureAction) {
@@ -353,6 +363,14 @@ open class PokemonBattle(
}
}
fun dispatchFuture(future: () -> CompletableFuture<*>) {
val dispatch = BattleDispatch {
val generatedFuture = future()
return@BattleDispatch DispatchResult { generatedFuture.isDone }
}
dispatches.add(dispatch)
}
fun dispatchInsert(dispatcher: () -> Iterable<BattleDispatch>) {
dispatch {
val newDispatches = dispatcher()
@@ -494,7 +512,6 @@ open class PokemonBattle(
queryStruct.addFunction("pvn") { DoubleValue(isPvN) }
queryStruct.addFunction("pvw") { DoubleValue(isPvW) }
queryStruct.addFunction("has_rule") { params -> DoubleValue(params.getString(0) in format.ruleSet) }
return queryStruct
}
}
}
@@ -145,4 +145,7 @@ abstract class BattleActor(
}
open fun awardExperience(battlePokemon: BattlePokemon, experience: Int) {}
open fun sendUpdate(packet: NetworkPacket<*>) {}
open fun win(otherWinners: List<BattleActor>, losers: List<BattleActor>) {}
open fun lose(winners: List<BattleActor>, otherLosers: List<BattleActor>) {}
}
@@ -48,7 +48,7 @@ object Berries : JsonDataRegistry<Berry> {
.disableHtmlEscaping()
.setPrettyPrinting()
.registerTypeAdapter(MulchVariant::class.java, MulchVariantAdapter)
.registerTypeAdapter(NumberRange.FloatRange::class.java, FloatNumberRangeAdapter)
.registerTypeAdapter(NumberRange.DoubleRange::class.java, FloatNumberRangeAdapter)
.registerTypeAdapter(Status::class.java, StatusAdapter)
.registerTypeAdapter(TypeToken.getParameterized(Collection::class.java, Box::class.java).type, BoxCollectionAdapter)
.registerTypeAdapter(Box::class.java, BoxAdapter)
@@ -103,4 +103,4 @@ object Berries : JsonDataRegistry<Berry> {
*/
fun getByName(name: String): Berry? = this.getByIdentifier(cobblemonResource(name))
}
}
@@ -16,11 +16,22 @@ 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.item.berry.BerryItem
import com.cobblemon.mod.common.pokemon.Nature
import com.cobblemon.mod.common.util.readBox
import com.cobblemon.mod.common.util.readEnumConstant
import com.cobblemon.mod.common.util.readEnumSet
import com.cobblemon.mod.common.util.readIdentifier
import com.cobblemon.mod.common.util.readList
import com.cobblemon.mod.common.util.readMap
import com.cobblemon.mod.common.util.writeBox
import com.cobblemon.mod.common.util.writeCollection
import com.cobblemon.mod.common.util.writeEnumConstant
import com.cobblemon.mod.common.util.writeEnumSet
import com.cobblemon.mod.common.util.writeIdentifier
import com.cobblemon.mod.common.util.writeMap
import com.google.gson.annotations.SerializedName
import net.minecraft.network.RegistryByteBuf
import java.awt.Color
import java.util.EnumSet
import kotlin.math.min
@@ -45,9 +56,8 @@ import net.minecraft.world.biome.Biome
* @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 growthTime The [IntRange] possible in minutes for how long the berry tree takes to grow frome age 0 to age 3
* @property refreshRate The [IntRange] possible in minutes for how long the berry tree takes to grow from age 3 to age 5
* @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.
@@ -60,6 +70,7 @@ import net.minecraft.world.biome.Biome
* @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.
* @property stageOnePositioning Transformation of the berry model for age 0
*
* @throws IllegalArgumentException if the any yield range argument is not a positive range.
*/
@@ -69,7 +80,6 @@ class Berry(
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>,
@@ -88,7 +98,9 @@ class Berry(
@SerializedName("fruitModel")
val fruitModelIdentifier: Identifier,
val fruitTexture: Identifier,
val weight: Float
val stageOnePositioning: GrowthPoint,
val weight: Float,
val boneMealChance: Float
) {
@Transient
@@ -161,8 +173,9 @@ class Berry(
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())
if (BerryBlock.getMulch(treeEntity) == MulchVariant.RICH) {
//I hope the upper bound isnt exclusive, especially when there's a method called nextBetweenExclusive
yield += world.random.nextBetween(1, 3)
treeEntity.decrementMulchDuration(world, pos, state)
}
val event = BerryYieldCalculationEvent(this, world, state, pos, placer, yield, bonus.second)
@@ -246,7 +259,7 @@ class Berry(
this.matureShape = this.createAndUniteShapes(this.matureShapeBoxes)
}
internal fun encode(buffer: PacketByteBuf) {
internal fun encode(buffer: RegistryByteBuf) {
buffer.writeIdentifier(this.identifier)
buffer.writeInt(this.baseYield.first)
buffer.writeInt(this.baseYield.last)
@@ -279,6 +292,13 @@ class Berry(
buffer.writeIdentifier(this.flowerTexture)
buffer.writeIdentifier(this.fruitModelIdentifier)
buffer.writeIdentifier(this.fruitTexture)
buffer.writeDouble(stageOnePositioning.position.x)
buffer.writeDouble(stageOnePositioning.position.y)
buffer.writeDouble(stageOnePositioning.position.z)
buffer.writeDouble(stageOnePositioning.rotation.x)
buffer.writeDouble(stageOnePositioning.rotation.y)
buffer.writeDouble(stageOnePositioning.rotation.z)
buffer.writeFloat(boneMealChance)
}
/**
@@ -292,7 +312,8 @@ class Berry(
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 treeEntity = world.getBlockEntity(pos) as? BerryBlockEntity ?: return 0 to passed
val mulchVariant = BerryBlock.getMulch(treeEntity)
val hasBiomeMulch = mulchVariant in favoriteMulches
this.growthFactors.forEach { factor ->
if (factor.isValid(world, state, pos)) {
@@ -319,7 +340,7 @@ class Berry(
companion object {
internal fun decode(buffer: PacketByteBuf): Berry {
internal fun decode(buffer: RegistryByteBuf): Berry {
val identifier = buffer.readIdentifier()
val baseYield = IntRange(buffer.readInt(), buffer.readInt())
val favMulchs = buffer.readEnumSet(MulchVariant::class.java)
@@ -339,9 +360,11 @@ class Berry(
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)
val stageOneYPos = GrowthPoint(Vec3d(buffer.readDouble(), buffer.readDouble(), buffer.readDouble()), Vec3d(buffer.readDouble(), buffer.readDouble(), buffer.readDouble()))
val boneMealChance = buffer.readFloat()
return Berry(identifier, baseYield, emptyList(), growthTime, refreshRate, favMulchs, emptySet(), emptyList(), growthPoints, randomizedGrowthPoints, mutations, sproutShapeBoxes, matureShapeBoxes, flavors, tintIndexes, flowerModelIdentifier, flowerTexture, fruitModelIdentifier, fruitTexture, stageOneYPos, 0F, boneMealChance)
}
}
}
}
@@ -19,6 +19,8 @@ import com.cobblemon.mod.common.net.IntSize
import com.cobblemon.mod.common.net.messages.client.callback.OpenMoveCallbackPacket
import com.cobblemon.mod.common.util.readSizedInt
import com.cobblemon.mod.common.util.writeSizedInt
import com.cobblemon.mod.common.util.writeString
import net.minecraft.network.RegistryByteBuf
import java.util.UUID
import net.minecraft.network.PacketByteBuf
import net.minecraft.server.network.ServerPlayerEntity
@@ -117,14 +119,14 @@ class MoveSelectDTO(val moveTemplate: MoveTemplate, var enabled: Boolean, val pp
constructor(move: Move, enabled: Boolean = true): this(moveTemplate = move.template, enabled = enabled, pp = move.currentPp, ppMax = move.maxPp)
@JvmOverloads
constructor(move: InBattleMove, enabled: Boolean = true): this(moveTemplate = Moves.getByNameOrDummy(move.move), enabled = enabled, pp = move.pp, ppMax = move.maxpp)
constructor(buffer: PacketByteBuf): this(
constructor(buffer: RegistryByteBuf): this(
moveTemplate = Moves.getByNameOrDummy(buffer.readString()),
enabled = buffer.readBoolean(),
pp = buffer.readSizedInt(IntSize.BYTE),
ppMax = buffer.readSizedInt(IntSize.BYTE)
)
fun writeToBuffer(buffer: PacketByteBuf) {
fun writeToBuffer(buffer: RegistryByteBuf) {
buffer.writeString(moveTemplate.name)
buffer.writeBoolean(enabled)
buffer.writeSizedInt(IntSize.BYTE, pp)
@@ -16,10 +16,12 @@ 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 com.cobblemon.mod.common.util.readItemStack
import com.cobblemon.mod.common.util.writeItemStack
import java.util.UUID
import net.minecraft.item.ItemStack
import net.minecraft.nbt.NbtCompound
import net.minecraft.network.PacketByteBuf
import net.minecraft.network.RegistryByteBuf
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.text.Text
@@ -143,8 +145,8 @@ open class PartySelectPokemonDTO(
enabled = enabled
)
constructor(buffer: PacketByteBuf): this(
pokemonProperties = PokemonProperties().loadFromNBT(buffer.readNbt() as NbtCompound),
constructor(buffer: RegistryByteBuf): this(
pokemonProperties = PokemonProperties().loadFromNBT(buffer.readNbt() as NbtCompound, buffer.registryManager),
aspects = buffer.readList { it.readString() }.toSet(),
heldItem = buffer.readItemStack(),
currentHealth = buffer.readInt(),
@@ -152,12 +154,13 @@ open class PartySelectPokemonDTO(
enabled = buffer.readBoolean()
)
fun writeToBuffer(buffer: PacketByteBuf) {
buffer.writeNbt(pokemonProperties.saveToNBT())
fun writeToBuffer(buffer: RegistryByteBuf) {
buffer.writeNbt(pokemonProperties.saveToNBT(buffer.registryManager))
buffer.writeCollection(aspects) { _, aspect -> buffer.writeString(aspect) }
buffer.writeItemStack(heldItem)
buffer.writeInt(currentHealth)
buffer.writeInt(maxHealth)
buffer.writeBoolean(enabled)
}
}
}
@@ -14,7 +14,7 @@ import com.mojang.serialization.DataResult
import com.mojang.serialization.DynamicOps
import com.mojang.serialization.codecs.PrimitiveCodec
import com.mojang.serialization.codecs.RecordCodecBuilder
import net.minecraft.network.PacketByteBuf
import net.minecraft.network.RegistryByteBuf
class MappedCodec<A : CodecMapped, K>(
val codecRetriever: (K) -> Codec<out A>,
@@ -32,7 +32,7 @@ class MappedCodec<A : CodecMapped, K>(
.apply(instance, ::ThingWithType)
}
val thingWithType = thingCodec.decode(ops, input).map { it.first }
val key = thingWithType.get().left().get().string
val key = thingWithType.getOrThrow().string
val codec = codecRetriever(keyFromString(key))
return codec.decode(ops, input).map { Pair(it.first, it.second) }
}
@@ -42,6 +42,6 @@ private class ThingWithType(val string: String)
interface CodecMapped {
fun <T> encode(ops: DynamicOps<T>): DataResult<T>
fun readFromBuffer(buffer: PacketByteBuf)
fun writeToBuffer(buffer: PacketByteBuf)
fun readFromBuffer(buffer: RegistryByteBuf)
fun writeToBuffer(buffer: RegistryByteBuf)
}
@@ -22,7 +22,7 @@ open class RegistryLikeIdentifierCondition<T>(val identifier: Identifier) : Regi
companion object {
fun <T> resolver(
constructor: (Identifier) -> RegistryLikeIdentifierCondition<T>
): (JsonElement) -> RegistryLikeIdentifierCondition<T>? = { constructor(Identifier(it.asString)) }
): (JsonElement) -> RegistryLikeIdentifierCondition<T>? = { constructor(Identifier.of(it.asString)) }
}
override fun fits(t: T, registry: Registry<T>) = registry.getId(t) == identifier
}
@@ -31,7 +31,7 @@ open class RegistryLikeTagCondition<T>(val tag: TagKey<T>) : RegistryLikeConditi
): (JsonElement) -> RegistryLikeTagCondition<T>? = {
val firstSymbol = it.asString.substring(0, 1)
if (firstSymbol == PREFIX) {
val identifier = Identifier(it.asString.substring(1))
val identifier = Identifier.of(it.asString.substring(1))
constructor(TagKey.of(registryKey, identifier))
} else {
null
@@ -11,7 +11,7 @@ package com.cobblemon.mod.common.api.data
import com.cobblemon.mod.common.api.codec.CodecMapped
import com.cobblemon.mod.common.api.codec.MappedCodec
import com.mojang.serialization.Codec
import net.minecraft.network.PacketByteBuf
import net.minecraft.network.RegistryByteBuf
/**
* A utility class to help give Codec support for map adapted class hierarchies.
@@ -31,13 +31,13 @@ abstract class ArbitrarilyMappedSerializableCompanion<T : CodecMapped, K>(
subtypes[key] = RegisteredSubtype(clazz, codec)
}
fun writeToBuffer(buffer: PacketByteBuf, value: T) {
fun writeToBuffer(buffer: RegistryByteBuf, value: T) {
val typeString = stringFromKey(keyFromValue(value))
buffer.writeString(typeString)
value.writeToBuffer(buffer)
}
fun readFromBuffer(buffer: PacketByteBuf): T {
fun readFromBuffer(buffer: RegistryByteBuf): T {
val typeString = buffer.readString()
val clazz = subtypes[keyFromString(typeString)]?.clazz ?: throw IllegalArgumentException("Unrecognized subtype: $typeString")
val value = clazz.getDeclaredConstructor().newInstance()
@@ -20,7 +20,6 @@ import com.cobblemon.mod.common.api.dialogue.input.ActiveInput
import com.cobblemon.mod.common.api.molang.MoLangFunctions.addFunctions
import com.cobblemon.mod.common.api.molang.MoLangFunctions.addStandardFunctions
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asMoLangValue
import com.cobblemon.mod.common.api.molang.MoLangFunctions.getQueryStruct
import com.cobblemon.mod.common.api.molang.MoLangFunctions.setup
import com.cobblemon.mod.common.api.scheduling.ServerRealTimeTaskTracker
import com.cobblemon.mod.common.net.messages.client.dialogue.DialogueOpenedPacket
@@ -42,7 +41,7 @@ class ActiveDialogue(var playerEntity: ServerPlayerEntity, var dialogueReference
var activeInput = ActiveInput(this, currentPage.input)
init {
runtime.environment.getQueryStruct().addFunctions(
runtime.environment.query.addFunctions(
mapOf(
"dialogue" to java.util.function.Function { _ -> toMoLangStruct() },
"player" to java.util.function.Function { _ -> playerStruct }
@@ -27,10 +27,13 @@ object DialogueManager {
val activeDialogues = mutableMapOf<UUID, ActiveDialogue>()
fun startDialogue(playerEntity: ServerPlayerEntity, dialogue: Dialogue) {
val activeDialogue = ActiveDialogue(playerEntity, dialogue)
activeDialogues[playerEntity.uuid] = activeDialogue
val packet = DialogueOpenedPacket(activeDialogue, includeFaces = true)
playerEntity.sendPacket(packet)
startDialogue(ActiveDialogue(playerEntity, dialogue))
}
fun startDialogue(activeDialogue: ActiveDialogue) {
activeDialogues[activeDialogue.playerEntity.uuid] = activeDialogue
val packet = DialogueOpenedPacket(activeDialogue, true)
activeDialogue.playerEntity.sendPacket(packet)
}
fun stopDialogue(playerEntity: ServerPlayerEntity) {
@@ -15,6 +15,8 @@ import com.cobblemon.mod.common.api.text.red
import com.cobblemon.mod.common.util.lang
import com.cobblemon.mod.common.util.toBlockPos
import net.minecraft.block.Blocks
import net.minecraft.component.ComponentChanges
import net.minecraft.component.ComponentMap
import net.minecraft.entity.ItemEntity
import net.minecraft.entity.LivingEntity
import net.minecraft.item.ItemStack
@@ -37,8 +39,8 @@ open class ItemDropEntry : DropEntry {
open val quantityRange: IntRange? = null
override val maxSelectableTimes = 1
open val dropMethod: ItemDropMethod? = null
open val item = Identifier("minecraft:fish")
open val nbt: NbtCompound? = null
open val item = Identifier.of("minecraft:fish")
open val components: ComponentMap? = null
override fun drop(entity: LivingEntity?, world: ServerWorld, pos: Vec3d, player: ServerPlayerEntity?) {
val item = world.registryManager.get(RegistryKeys.ITEM).get(item) ?: return LOGGER.error("Unable to load drop item: $item")
@@ -51,7 +53,11 @@ open class ItemDropEntry : DropEntry {
it
}
}
nbt?.let { stack.nbt = it }
val builder = ComponentChanges.builder()
components?.forEach {
builder.add(it)
}
stack.applyChanges(builder.build())
if (dropMethod == ItemDropMethod.ON_PLAYER && player != null) {
world.spawnEntity(ItemEntity(player.world, player.x, player.y, player.z, stack))
@@ -12,6 +12,7 @@ import com.google.gson.JsonDeserializationContext
import com.google.gson.JsonDeserializer
import com.google.gson.JsonElement
import com.google.gson.JsonObject
import com.google.gson.JsonPrimitive
import com.google.gson.JsonSerializationContext
import com.google.gson.JsonSerializer
import java.lang.reflect.Type
@@ -28,6 +29,10 @@ object EntityDimensionsAdapter : JsonSerializer<EntityDimensions>, JsonDeseriali
const val WIDTH = "width"
const val HEIGHT = "height"
val templates = mutableMapOf(
"player" to { EntityDimensions.changing(0.6F, 1.8F) }
)
override fun serialize(dimensions: EntityDimensions, type: Type, ctx: JsonSerializationContext): JsonElement {
val json = JsonObject()
json.addProperty(WIDTH, dimensions.width)
@@ -36,7 +41,10 @@ object EntityDimensionsAdapter : JsonSerializer<EntityDimensions>, JsonDeseriali
}
override fun deserialize(json: JsonElement, type: Type, ctx: JsonDeserializationContext): EntityDimensions {
if (json is JsonPrimitive) {
return templates[json.asString]?.invoke() ?: throw IllegalStateException("Dimensions provided by template name $json but no such template is set.")
}
json as JsonObject
return EntityDimensions(json.get(WIDTH).asFloat, json.get(HEIGHT).asFloat, false)
return EntityDimensions.changing(json.get(WIDTH).asFloat, json.get(HEIGHT).asFloat)
}
}
@@ -8,6 +8,7 @@
package com.cobblemon.mod.common.api.entity
import com.bedrockk.molang.runtime.struct.QueryStruct
import net.minecraft.entity.Entity
import net.minecraft.entity.data.TrackedData
@@ -18,4 +19,5 @@ interface EntitySideDelegate<T : Entity> {
fun initialize(entity: T) {}
fun tick(entity: T) {}
fun onTrackedDataSet(data: TrackedData<*>) {}
fun addToStruct(struct: QueryStruct) {}
}
@@ -0,0 +1,19 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.entity
import com.cobblemon.mod.common.entity.npc.NPCEntity
/**
* A delegate for some actions that can be different for an NPC on client versus server.
*
* @author Hiroku
* @since August 25th, 2023
*/
interface NPCSideDelegate : EntitySideDelegate<NPCEntity>
@@ -0,0 +1,25 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.entity
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import java.util.concurrent.CompletableFuture
/**
* Interface for custom entities that can send out and recall Pokémon. They get notified
* when either of those actions are occurring.
*
* @author Hiroku
* @since August 25th, 2023
*
*/
interface PokemonSender {
fun sendingOut(): CompletableFuture<Unit>
fun recalling(pokemonEntity: PokemonEntity): CompletableFuture<Unit>
}
@@ -18,6 +18,7 @@ import com.cobblemon.mod.common.pokemon.Species
import com.cobblemon.mod.common.util.DataKeys
import com.cobblemon.mod.common.util.asIdentifierDefaultingNamespace
import net.minecraft.nbt.NbtCompound
import net.minecraft.registry.RegistryWrapper
import java.util.concurrent.CompletableFuture
import kotlin.reflect.KClass
@@ -45,10 +46,10 @@ interface EntityEffect {
fun end(entity: PokemonEntity): CompletableFuture<PokemonEntity>?
/** Saves this effect to NBT. */
fun saveToNbt(): NbtCompound
fun saveToNbt(registryLookup: RegistryWrapper.WrapperLookup): NbtCompound
/** Loads this effect from NBT. */
fun loadFromNBT(nbt: NbtCompound)
fun loadFromNBT(nbt: NbtCompound, registryLookup: RegistryWrapper.WrapperLookup)
companion object {
@@ -67,10 +68,10 @@ interface EntityEffect {
fun createDefault(id: String): EntityEffect? = defaults[id]?.invoke()
fun loadFromNbt(nbt: NbtCompound): EntityEffect? {
fun loadFromNbt(nbt: NbtCompound, registryLookup: RegistryWrapper.WrapperLookup): EntityEffect? {
if (nbt.contains(DataKeys.ENTITY_EFFECT_ID)) {
val id = nbt.getString(DataKeys.ENTITY_EFFECT_ID)
return createDefault(id)?.also { it.loadFromNBT(nbt) }
return createDefault(id)?.also { it.loadFromNBT(nbt, registryLookup) }
}
return null
}
@@ -78,6 +78,8 @@ object CobblemonEvents {
val POKE_BALL_CAPTURE_CALCULATED = EventObservable<PokeBallCaptureCalculatedEvent>()
@JvmField
val POKEMON_CAPTURED = EventObservable<PokemonCapturedEvent>()
@JvmField
val FOSSIL_REVIVED = EventObservable<FossilRevivedEvent>()
// @JvmField
// val EGG_HATCH = EventObservable<HatchEggEvent>()
@JvmField
@@ -0,0 +1,17 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.events.pokemon
import com.cobblemon.mod.common.pokemon.Pokemon
import net.minecraft.server.network.ServerPlayerEntity
data class FossilRevivedEvent (
val pokemon: Pokemon,
val player: ServerPlayerEntity?
)
@@ -0,0 +1,93 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.fishing
import com.cobblemon.mod.common.util.cobblemonResource
import net.minecraft.item.Item
import net.minecraft.item.ItemStack
import net.minecraft.nbt.NbtCompound
import net.minecraft.nbt.NbtList
import net.minecraft.registry.Registry
import net.minecraft.util.Identifier
data class FishingBait(
val item: Identifier,
val effects: List<Effect>,
) {
fun toItemStack(itemRegistry: Registry<Item>) = item.let(itemRegistry::get)?.let { ItemStack(it) } ?: ItemStack.EMPTY
data class Effect(
val type: Identifier,
val subcategory: Identifier?,
val chance: Double = 0.0,
val value: Double = 0.0
) {
fun toNbt(): NbtCompound {
val nbt = NbtCompound()
nbt.putString("Type", type.toString())
subcategory?.let { nbt.putString("Subcategory", it.toString()) }
nbt.putDouble("Chance", chance)
nbt.putDouble("Value", value)
return nbt
}
companion object {
fun fromNbt(nbt: NbtCompound): Effect {
val type = Identifier.of(nbt.getString("Type"))
val subcategory = if (nbt.contains("Subcategory")) Identifier.of(nbt.getString("Subcategory")) else null
val chance = nbt.getDouble("Chance")
val value = nbt.getDouble("Value")
return Effect(type, subcategory, chance, value)
}
}
}
fun toNbt(): NbtCompound {
val nbt = NbtCompound()
nbt.putString("Item", item.toString())
val effectsList = NbtList()
effects.forEach { effectsList.add(it.toNbt()) }
nbt.put("Effects", effectsList)
return nbt
}
companion object {
fun fromNbt(nbt: NbtCompound): FishingBait {
val item = Identifier.of(nbt.getString("Item"))
val effectsList = nbt.getList("Effects", 10) // 10 is the type for NbtCompound
val effects = mutableListOf<Effect>()
for (i in 0 until effectsList.size) {
effects.add(Effect.fromNbt(effectsList.getCompound(i)))
}
return FishingBait(item, effects)
}
val BLANK_BAIT = FishingBait(
cobblemonResource("blank"),
emptyList()
)
}
object Effects {
val NATURE = cobblemonResource("nature")
val IV = cobblemonResource("iv")
val EV = cobblemonResource("ev")
val BITE_TIME = cobblemonResource("bite_time")
val GENDER_CHANCE = cobblemonResource("gender_chance")
val LEVEL_RAISE = cobblemonResource("level_raise")
val TERA = cobblemonResource("tera")
val SHINY_REROLL = cobblemonResource("shiny_reroll")
val HIDDEN_ABILITY_CHANCE = cobblemonResource("ha_chance")
val POKEMON_CHANCE = cobblemonResource("pokemon_chance")
val FRIENDSHIP = cobblemonResource("friendship")
val INERT = cobblemonResource("inert")
}
}
@@ -0,0 +1,114 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.fishing
import com.cobblemon.mod.common.CobblemonItemComponents
import com.cobblemon.mod.common.api.data.JsonDataRegistry
import com.cobblemon.mod.common.api.reactive.SimpleObservable
import com.cobblemon.mod.common.net.messages.client.fishing.FishingBaitRegistrySyncPacket
import com.cobblemon.mod.common.util.adapters.IdentifierAdapter
import com.cobblemon.mod.common.util.cobblemonResource
import com.google.gson.Gson
import com.google.gson.GsonBuilder
import com.google.gson.reflect.TypeToken
import net.minecraft.item.ItemStack
import net.minecraft.registry.Registries
import net.minecraft.resource.ResourceType
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.Identifier
object FishingBaits : JsonDataRegistry<FishingBait>{
override val id = cobblemonResource("fishing_baits")
override val type = ResourceType.SERVER_DATA
override val observable = SimpleObservable<FishingBaits>()
override val typeToken: TypeToken<FishingBait> = TypeToken.get(FishingBait::class.java)
override val resourcePath = "fishing_baits"
override val gson: Gson = GsonBuilder()
.registerTypeAdapter(Identifier::class.java, IdentifierAdapter)
.setPrettyPrinting()
.create()
private val itemMap = mutableMapOf<Identifier, FishingBait>()
override fun sync(player: ServerPlayerEntity) {
FishingBaitRegistrySyncPacket(this.itemMap.values.toList()).sendToPlayer(player)
}
override fun reload(data: Map<Identifier, FishingBait>) {
itemMap.clear()
data.forEach { id, bait ->
itemMap[bait.item] = bait
}
}
fun getFromRodItemStack(stack: ItemStack): FishingBait? {
return stack.components.get(CobblemonItemComponents.BAIT)?.bait
}
fun getFromBaitItemStack(stack: ItemStack): FishingBait? {
return getFromIdentifier(Registries.ITEM.getId(stack.item))
}
fun getFromIdentifier(identifier: Identifier): FishingBait? {
return itemMap[identifier]
}
fun isFishingBait(stack: ItemStack) = itemMap.containsKey(Registries.ITEM.getId(stack.item))
//
//
// fun getBaitSubcategory(item: ItemStack): String? {
// val itemId = Registries.ITEM.getId(item.item)
// if (itemId in itemMap.keys) {
// return itemMap[itemId]?.subcategory
// }
// val tag = tagMap.keys.firstOrNull { it.fits(item.item, Registries.ITEM) }
// if (tag != null) {
// return tagMap[tag]?.subcategory
// }
// return null
// }
//
// fun getBaitSuccessChance(item: ItemStack): Double? {
// val itemId = Registries.ITEM.getId(item.item)
// if (itemId in itemMap.keys) {
// return itemMap[itemId]?.chance
// }
// val tag = tagMap.keys.firstOrNull { it.fits(item.item, Registries.ITEM) }
// if (tag != null) {
// return tagMap[tag]?.chance
// }
// return null
// }
//
// fun getBaitEffectValue(item: ItemStack): Double? {
// val itemId = Registries.ITEM.getId(item.item)
// if (itemId in itemMap.keys) {
// return itemMap[itemId]?.value
// }
// val tag = tagMap.keys.firstOrNull { it.fits(item.item, Registries.ITEM) }
// if (tag != null) {
// return tagMap[tag]?.value
// }
// return null
// }
//
//
// fun getBaitNote(item: ItemStack): String? {
// val itemId = Registries.ITEM.getId(item.item)
// if (itemId in itemMap.keys) {
// return itemMap[itemId]?.note
// }
// val tag = tagMap.keys.firstOrNull { it.fits(item.item, Registries.ITEM) }
// if (tag != null) {
// return tagMap[tag]?.note
// }
// return null
// }
}
@@ -0,0 +1,48 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.fishing
import com.cobblemon.mod.common.api.pokeball.PokeBalls
import com.cobblemon.mod.common.pokeball.PokeBall
import net.minecraft.network.PacketByteBuf
import net.minecraft.util.Identifier
/**
* Base poke rod object
* It is intended that there is one poke rod object initialized for a given poke rod type.
*
* @property name the poke rod registry name
* @property pokeBallId The [Identifier] of the pokeball that is used as the bobber for this rod
* @property lineColor list of [RGB] values that apply to the fishing line of the Pokérod
*/
data class PokeRod(
val pokeBallId: Identifier,
//Hex string of color
val lineColor: String,
var name: Identifier?
) {
internal fun encode(buffer: PacketByteBuf) {
buffer.writeIdentifier(name)
buffer.writeIdentifier(pokeBallId)
buffer.writeString(lineColor)
}
companion object {
internal fun decode(buffer: PacketByteBuf): PokeRod {
val name = buffer.readIdentifier()
val pokeBallId = buffer.readIdentifier()
val lineColor = buffer.readString()
return PokeRod(pokeBallId, lineColor, name)
}
}
fun getPokeBall(): PokeBall? {
return PokeBalls.getPokeBall(pokeBallId)
}
}
@@ -0,0 +1,62 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.fishing
import com.cobblemon.mod.common.api.data.JsonDataRegistry
import com.cobblemon.mod.common.api.reactive.SimpleObservable
import com.cobblemon.mod.common.net.messages.client.data.PokeRodRegistrySyncPacket
import com.cobblemon.mod.common.util.adapters.IdentifierAdapter
import com.cobblemon.mod.common.util.cobblemonResource
import com.google.gson.Gson
import com.google.gson.GsonBuilder
import com.google.gson.reflect.TypeToken
import net.minecraft.resource.ResourceType
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.util.Identifier
/**
* The data registry for [PokeRod]s.
* All the pokerod fields are guaranteed to exist
*/
object PokeRods : JsonDataRegistry<PokeRod> {
override val id = cobblemonResource("pokerods")
override val type = ResourceType.SERVER_DATA
override val observable = SimpleObservable<PokeRods>()
// ToDo once datapack pokerod is implemented add required adapters here
override val gson: Gson = GsonBuilder()
.disableHtmlEscaping()
.registerTypeAdapter(Identifier::class.java, IdentifierAdapter)
.setPrettyPrinting()
.create()
override val typeToken: TypeToken<PokeRod> = TypeToken.get(PokeRod::class.java)
override val resourcePath = "pokerods"
private val rods = mutableMapOf<Identifier, PokeRod>()
override fun reload(data: Map<Identifier, PokeRod>) {
data.forEach {
it.value.name = it.key
rods[it.key] = it.value
}
this.observable.emit(this)
}
override fun sync(player: ServerPlayerEntity) {
PokeRodRegistrySyncPacket(rods.values).sendToPlayer(player)
}
/**
* Gets a Pokerod from registry name.
* @return the pokerod object if found otherwise null.
*/
fun getPokeRod(name : Identifier): PokeRod? = rods[name]
}
@@ -11,7 +11,6 @@ package com.cobblemon.mod.common.api.fossil
import com.cobblemon.mod.common.api.pokemon.PokemonProperties
import com.cobblemon.mod.common.pokemon.evolution.predicate.NbtItemPredicate
import net.minecraft.item.ItemStack
import net.minecraft.registry.Registries
import net.minecraft.text.MutableText
import net.minecraft.text.Text
import net.minecraft.util.Identifier
@@ -48,7 +47,7 @@ class Fossil(
}
return this.fossils.all { fossil ->
ingredients.any { fossil.item.fits(it.item, Registries.ITEM) && fossil.nbt.test(it) }
ingredients.any { fossil.test(it) }
}
}
@@ -64,7 +63,7 @@ class Fossil(
return ingredients.all { ingredient ->
ingredients.count { item -> ingredient.itemMatches(item.registryEntry) } <=
this.fossils.count { fossil -> fossil.item.fits(ingredient.item, Registries.ITEM) && fossil.nbt.test(ingredient) }
this.fossils.count { fossil -> fossil.test(ingredient) }
}
}
@@ -74,7 +73,7 @@ class Fossil(
* @return True if the [ItemStack] is an ingredient, false otherwise.
*/
fun isIngredient(itemStack: ItemStack): Boolean {
return this.fossils.any { it.item.fits(itemStack.item, Registries.ITEM) && it.nbt.test(itemStack) }
return this.fossils.any { it.test(itemStack) }
}
}
@@ -10,12 +10,10 @@ package com.cobblemon.mod.common.api.gui
import com.cobblemon.mod.common.api.text.font
import com.cobblemon.mod.common.client.gui.battle.BattleOverlay.Companion.PORTRAIT_DIAMETER
import com.cobblemon.mod.common.client.render.models.blockbench.PoseableEntityState
import com.cobblemon.mod.common.client.render.models.blockbench.repository.PokemonModelRepository
import com.cobblemon.mod.common.client.render.models.blockbench.PosableState
import com.cobblemon.mod.common.client.render.models.blockbench.repository.RenderContext
import com.cobblemon.mod.common.client.render.models.blockbench.repository.VaryingModelRepository
import com.cobblemon.mod.common.entity.PoseType
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.pokemon.Species
import com.mojang.blaze3d.platform.GlStateManager
import com.mojang.blaze3d.systems.RenderSystem
import net.minecraft.client.MinecraftClient
@@ -25,6 +23,7 @@ import net.minecraft.client.render.DiffuseLighting
import net.minecraft.client.render.GameRenderer
import net.minecraft.client.render.LightmapTextureManager
import net.minecraft.client.render.OverlayTexture
import net.minecraft.client.render.RenderLayer
import net.minecraft.client.render.Tessellator
import net.minecraft.client.render.VertexFormat
import net.minecraft.client.render.VertexFormats
@@ -37,6 +36,7 @@ import net.minecraft.util.math.RotationAxis
import org.joml.Matrix4f
import org.joml.Vector3f
@JvmOverloads
fun blitk(
matrixStack: MatrixStack,
texture: Identifier? = null,
@@ -89,17 +89,17 @@ fun drawRectangle(
minV: Float,
maxV: Float
) {
val bufferbuilder = Tessellator.getInstance().buffer
bufferbuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_TEXTURE)
bufferbuilder.vertex(matrix, x, endY, blitOffset).texture(minU, maxV).next()
bufferbuilder.vertex(matrix, endX, endY, blitOffset).texture(maxU, maxV).next()
bufferbuilder.vertex(matrix, endX, y, blitOffset).texture(maxU, minV).next()
bufferbuilder.vertex(matrix, x, y, blitOffset).texture(minU, minV).next()
val bufferbuilder = Tessellator.getInstance().begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_TEXTURE)
bufferbuilder.vertex(matrix, x, endY, blitOffset).texture(minU, maxV)
bufferbuilder.vertex(matrix, endX, endY, blitOffset).texture(maxU, maxV)
bufferbuilder.vertex(matrix, endX, y, blitOffset).texture(maxU, minV)
bufferbuilder.vertex(matrix, x, y, blitOffset).texture(minU, minV)
// TODO: Figure out if this is correct replacement.
// OLD: BufferRenderer.draw(bufferbuilder)
BufferRenderer.drawWithGlobalProgram(bufferbuilder.end())
}
@JvmOverloads
fun drawCenteredText(
context: DrawContext,
font: Identifier? = null,
@@ -114,6 +114,7 @@ fun drawCenteredText(
context.drawText(textRenderer, comp, x.toInt() - textRenderer.getWidth(comp) / 2, y.toInt(), colour, shadow)
}
@JvmOverloads
fun drawText(
context: DrawContext,
font: Identifier? = null,
@@ -145,6 +146,7 @@ fun drawText(
return isHovered
}
@JvmOverloads
fun drawText(
context: DrawContext,
text: OrderedText,
@@ -163,6 +165,7 @@ fun drawText(
context.drawText(textRenderer, text, tweakedX.toInt(), y.toInt(), colour, shadow)
}
@JvmOverloads
fun drawString(
context: DrawContext,
text: String,
@@ -181,40 +184,47 @@ fun drawString(
context.drawText(textRenderer, comp, x.toInt(), y.toInt(), colour, shadow)
}
fun drawPortraitPokemon(
species: Species,
@JvmOverloads
fun drawPosablePortrait(
identifier: Identifier,
aspects: Set<String>,
matrixStack: MatrixStack,
scale: Float = 13F,
contextScale: Float = 1F,
reversed: Boolean = false,
state: PoseableEntityState<PokemonEntity>? = null,
partialTicks: Float
state: PosableState,
repository: VaryingModelRepository<*>,
partialTicks: Float,
limbSwing: Float = 0F,
limbSwingAmount: Float = 0F,
ageInTicks: Float = 0F,
headYaw: Float = 0F,
headPitch: Float = 0F
) {
val model = PokemonModelRepository.getPoser(species.resourceIdentifier, aspects)
val texture = PokemonModelRepository.getTexture(species.resourceIdentifier, aspects, state?.animationSeconds ?: 0F)
val model = repository.getPoser(identifier, aspects)
state.currentAspects = aspects
state.currentModel = model
val texture = repository.getTexture(identifier, aspects, state.animationSeconds)
val context = RenderContext()
PokemonModelRepository.getTextureNoSubstitute(species.resourceIdentifier, aspects, 0f).let { it -> context.put(RenderContext.TEXTURE, it) }
context.put(RenderContext.SCALE, species.getForm(aspects).baseScale)
context.put(RenderContext.SPECIES, species.resourceIdentifier)
model.context = context
repository.getTextureNoSubstitute(identifier, aspects, 0f).let { context.put(RenderContext.TEXTURE, it) }
context.put(RenderContext.SCALE, contextScale)
context.put(RenderContext.SPECIES, identifier)
context.put(RenderContext.ASPECTS, aspects)
context.put(RenderContext.POSABLE_STATE, state)
val renderType = model.getLayer(texture)
val renderType = RenderLayer.getEntityCutout(texture)
RenderSystem.applyModelViewMatrix()
val quaternion1 = RotationAxis.POSITIVE_Y.rotationDegrees(-32F * if (reversed) -1F else 1F)
val quaternion2 = RotationAxis.POSITIVE_X.rotationDegrees(5F)
if (state == null) {
model.setupAnimStateless(setOf(PoseType.PORTRAIT, PoseType.PROFILE))
} else {
val originalPose = state.currentPose
model.getPose(PoseType.PORTRAIT)?.let { state.setPose(it.poseName) }
state.timeEnteredPose = 0F
state.updatePartialTicks(partialTicks)
model.setupAnimStateful(null, state, 0F, 0F, 0F, 0F, 0F)
originalPose?.let { state.setPose(it) }
}
val originalPose = state.currentPose
state.setPoseToFirstSuitable(PoseType.PORTRAIT)
state.updatePartialTicks(partialTicks)
model.applyAnimations(null, state, limbSwing, limbSwingAmount, ageInTicks, headYaw, headPitch)
originalPose?.let { state.setPose(it) }
matrixStack.push()
matrixStack.translate(0.0, PORTRAIT_DIAMETER.toDouble() + 2.0, 0.0)
@@ -234,13 +244,70 @@ fun drawPortraitPokemon(
val buffer = immediate.getBuffer(renderType)
val packedLight = LightmapTextureManager.pack(11, 7)
model.withLayerContext(immediate, state, PokemonModelRepository.getLayers(species.resourceIdentifier, aspects)) {
model.render(context, matrixStack, buffer, packedLight, OverlayTexture.DEFAULT_UV, 1F, 1F, 1F, 1F)
model.withLayerContext(immediate, state, repository.getLayers(identifier, aspects)) {
model.render(context, matrixStack, buffer, packedLight, OverlayTexture.DEFAULT_UV, -0x1)
immediate.draw()
}
matrixStack.pop()
model.setDefault()
DiffuseLighting.enableGuiDepthLighting()
}
fun drawProfile(
repository: VaryingModelRepository<*>,
resourceIdentifier: Identifier,
aspects: Set<String>,
matrixStack: MatrixStack,
state: PosableState,
partialTicks: Float,
scale: Float = 20F
) {
val model = repository.getPoser(resourceIdentifier, aspects)
val texture = repository.getTexture(resourceIdentifier, aspects, state.animationSeconds)
val context = RenderContext()
model.context = context
repository.getTextureNoSubstitute(resourceIdentifier, aspects, 0f).let { context.put(RenderContext.TEXTURE, it) }
context.put(RenderContext.SCALE, 1F)
context.put(RenderContext.SPECIES, resourceIdentifier)
context.put(RenderContext.ASPECTS, aspects)
context.put(RenderContext.POSABLE_STATE, state)
state.currentAspects = aspects
state.currentModel = model
val renderType = RenderLayer.getEntityCutout(texture)//model.getLayer(texture)
RenderSystem.applyModelViewMatrix()
matrixStack.scale(scale, scale, -scale)
state.setPoseToFirstSuitable(PoseType.PORTRAIT)
state.updatePartialTicks(partialTicks)
model.applyAnimations(null, state, 0F, 0F, 0F, 0F, 0F)
matrixStack.translate(model.profileTranslation.x, model.profileTranslation.y, model.profileTranslation.z - 4.0)
matrixStack.scale(model.profileScale, model.profileScale, 1 / model.profileScale)
// matrixStack.multiply(rotation)
val quaternion1 = RotationAxis.POSITIVE_Y.rotationDegrees(-32F * if (false) -1F else 1F)
val quaternion2 = RotationAxis.POSITIVE_X.rotationDegrees(5F)
matrixStack.multiply(quaternion1)
matrixStack.multiply(quaternion2)
DiffuseLighting.method_34742()
val entityRenderDispatcher = MinecraftClient.getInstance().entityRenderDispatcher
entityRenderDispatcher.setRenderShadows(true)
val bufferSource = MinecraftClient.getInstance().bufferBuilders.entityVertexConsumers
val buffer = bufferSource.getBuffer(renderType)
val light1 = Vector3f(-1F, 1F, 1.0F)
val light2 = Vector3f(1.3F, -1F, 1.0F)
RenderSystem.setShaderLights(light1, light2)
val packedLight = LightmapTextureManager.pack(11, 7)
model.withLayerContext(bufferSource, state, repository.getLayers(resourceIdentifier, aspects)) {
model.render(context, matrixStack, buffer, packedLight, OverlayTexture.DEFAULT_UV, -0x1)
bufferSource.draw()
}
model.setDefault()
entityRenderDispatcher.setRenderShadows(true)
DiffuseLighting.enableGuiDepthLighting()
}
@@ -10,6 +10,8 @@ package com.cobblemon.mod.common.api.gui
import net.minecraft.client.gui.Drawable
import net.minecraft.client.gui.Element
import net.minecraft.client.gui.navigation.GuiNavigation
import net.minecraft.client.gui.navigation.GuiNavigationPath
import net.minecraft.client.gui.screen.narration.NarrationMessageBuilder
import net.minecraft.client.gui.widget.ClickableWidget
import net.minecraft.text.Text
@@ -47,10 +49,10 @@ abstract class ParentWidget(
super.mouseMoved(pMouseX, pMouseY)
}
override fun mouseScrolled(pMouseX: Double, pMouseY: Double, pDelta: Double): Boolean {
override fun mouseScrolled(mouseX: Double, mouseY: Double, horizontalAmount: Double, verticalAmount: Double): Boolean {
return children.any {
it.mouseScrolled(pMouseX, pMouseY, pDelta)
} || super.mouseScrolled(pMouseX, pMouseY, pDelta)
it.mouseScrolled(mouseX, mouseY, horizontalAmount, verticalAmount)
} || super.mouseScrolled(mouseX, mouseY, horizontalAmount, verticalAmount)
}
override fun mouseClicked(pMouseX: Double, pMouseY: Double, pButton: Int): Boolean {
@@ -19,8 +19,10 @@ import com.bedrockk.molang.runtime.value.MoValue
* @since October 22nd, 2023
*/
interface ExpressionLike {
override fun toString(): String
/** Produces a [MoValue] for a [MoLangRuntime] to supply an environment. */
fun resolve(runtime: MoLangRuntime): MoValue
fun resolve(runtime: MoLangRuntime, context: Map<String, MoValue> = emptyMap()): MoValue
fun getString(): String = toString()
fun resolveDouble(runtime: MoLangRuntime) = resolve(runtime).asDouble()
fun resolveFloat(runtime: MoLangRuntime) = resolveDouble(runtime).toFloat()
@@ -28,4 +30,5 @@ interface ExpressionLike {
fun resolveInt(runtime: MoLangRuntime) = resolveDouble(runtime).toInt()
fun resolveBoolean(runtime: MoLangRuntime) = resolveDouble(runtime) == 1.0
fun resolveObject(runtime: MoLangRuntime) = resolve(runtime) as ObjectValue<*>
}
@@ -10,6 +10,8 @@ package com.cobblemon.mod.common.api.molang
import com.bedrockk.molang.Expression
import com.bedrockk.molang.runtime.MoLangRuntime
import com.bedrockk.molang.runtime.value.MoValue
import com.cobblemon.mod.common.util.getString
import com.cobblemon.mod.common.util.resolve
/**
@@ -19,5 +21,6 @@ import com.cobblemon.mod.common.util.resolve
* @since October 22nd, 2023
*/
class ListExpression(val exprs: List<Expression>): ExpressionLike {
override fun resolve(runtime: MoLangRuntime) = exprs.resolve(runtime)
override fun toString() = exprs.joinToString("\n") { it.getString().let { if (it.endsWith(";")) it else "$it;" } }
override fun resolve(runtime: MoLangRuntime, context: Map<String, MoValue>) = exprs.resolve(runtime, context)
}
@@ -18,12 +18,27 @@ import com.bedrockk.molang.runtime.value.DoubleValue
import com.bedrockk.molang.runtime.value.MoValue
import com.bedrockk.molang.runtime.value.StringValue
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.api.battles.model.PokemonBattle
import com.cobblemon.mod.common.api.dialogue.PlayerDialogueFaceProvider
import com.cobblemon.mod.common.client.render.models.blockbench.wavefunction.WaveFunction
import com.cobblemon.mod.common.api.dialogue.ReferenceDialogueFaceProvider
import com.cobblemon.mod.common.api.scripting.CobblemonScripts
import com.cobblemon.mod.common.api.text.text
import com.cobblemon.mod.common.client.render.models.blockbench.wavefunction.WaveFunctions
import com.cobblemon.mod.common.entity.npc.NPCEntity
import com.cobblemon.mod.common.net.messages.client.effect.RunPosableMoLangPacket
import com.cobblemon.mod.common.util.asIdentifierDefaultingNamespace
import com.cobblemon.mod.common.util.effectiveName
import com.cobblemon.mod.common.util.getBooleanOrNull
import com.cobblemon.mod.common.util.getDoubleOrNull
import com.cobblemon.mod.common.util.isInt
import com.cobblemon.mod.common.util.itemRegistry
import com.cobblemon.mod.common.util.worldRegistry
import com.mojang.datafixers.util.Either
import net.minecraft.block.Block
import net.minecraft.entity.LivingEntity
import net.minecraft.entity.damage.DamageSource
import net.minecraft.entity.damage.DamageTypes
import net.minecraft.entity.player.PlayerEntity
import net.minecraft.nbt.NbtCompound
import net.minecraft.nbt.NbtDouble
import net.minecraft.nbt.NbtElement
@@ -35,6 +50,7 @@ import net.minecraft.registry.RegistryKeys
import net.minecraft.registry.entry.RegistryEntry
import net.minecraft.registry.tag.TagKey
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.server.world.ServerWorld
import net.minecraft.util.Identifier
import net.minecraft.world.World
import net.minecraft.world.biome.Biome
@@ -75,23 +91,134 @@ object MoLangFunctions {
val array = ArrayStruct(hashMapOf())
values.forEachIndexed { index, moValue -> array.setDirectly("$index", moValue) }
return@Function array
},
"run_script" to java.util.function.Function { params ->
val runtime = MoLangRuntime()
runtime.environment.query = params.environment.query
runtime.environment.variable = params.environment.variable
runtime.environment.context = params.environment.context
val script = params.getString(0).asIdentifierDefaultingNamespace()
CobblemonScripts.run(script, runtime) ?: DoubleValue(0)
}
)
val biomeFunctions = hashMapOf<String, java.util.function.Function<MoParams, Any>>()
val worldFunctions = hashMapOf<String, java.util.function.Function<MoParams, Any>>()
val dimensionTypeFunctions = hashMapOf<String, java.util.function.Function<MoParams, Any>>()
val blockFunctions = hashMapOf<String, java.util.function.Function<MoParams, Any>>()
val playerFunctions = mutableListOf<(ServerPlayerEntity) -> HashMap<String, java.util.function.Function<MoParams, Any>>>(
val playerFunctions = mutableListOf<(PlayerEntity) -> HashMap<String, java.util.function.Function<MoParams, Any>>>(
{ player ->
hashMapOf(
"username" to java.util.function.Function { _ -> StringValue(player.gameProfile.name) },
"uuid" to java.util.function.Function { _ -> StringValue(player.gameProfile.id.toString()) },
"data" to java.util.function.Function { _ -> return@Function Cobblemon.molangData.load(player.uuid) },
"save_data" to java.util.function.Function { _ -> Cobblemon.molangData.save(player.uuid) },
"main_held_item" to java.util.function.Function { _ -> player.world.itemRegistry.getEntry(player.mainHandStack.item).asMoLangValue(RegistryKeys.ITEM) },
"off_held_item" to java.util.function.Function { _ -> player.world.itemRegistry.getEntry(player.offHandStack.item).asMoLangValue(RegistryKeys.ITEM) },
"face" to java.util.function.Function { _ -> ObjectValue(PlayerDialogueFaceProvider(player.uuid)) }
)
val map = hashMapOf<String, java.util.function.Function<MoParams, Any>>()
map.put("username") { _ -> StringValue(player.gameProfile.name) }
map.put("uuid") { _ -> StringValue(player.gameProfile.id.toString()) }
map.put("data") { _ -> return@put if (player is ServerPlayerEntity) Cobblemon.molangData.load(player.uuid) else DoubleValue(0) }
map.put("save_data") { _ -> if (player is ServerPlayerEntity) Cobblemon.molangData.save(player.uuid) else DoubleValue(0) }
map.put("main_held_item") { _ -> player.world.itemRegistry.getEntry(player.mainHandStack.item).asMoLangValue(RegistryKeys.ITEM) }
map.put("off_held_item") { _ -> player.world.itemRegistry.getEntry(player.offHandStack.item).asMoLangValue(RegistryKeys.ITEM) }
map.put("face") { _ -> ObjectValue(PlayerDialogueFaceProvider(player.uuid)) }
map.put("swing_hand") { _ -> player.swingHand(player.activeHand) }
map.put("food_level") { _ -> DoubleValue(player.hungerManager.foodLevel) }
map.put("saturation_level") { _ -> DoubleValue(player.hungerManager.saturationLevel) }
map.put("tell") { params ->
val message = params.getString(0).text()
val overlay = params.getBooleanOrNull(1) ?: false
player.sendMessage(message, overlay)
}
map.put("teleport") { params ->
val x = params.getDouble(0)
val y = params.getDouble(1)
val z = params.getDouble(2)
val playParticleEffects = params.getBooleanOrNull(3) ?: false
player.teleport(x, y, z, playParticleEffects)
}
map.put("heal") { params ->
val amount = params.getDoubleOrNull(0) ?: player.maxHealth
player.heal(amount.toFloat())
}
map.put("environment") {
val environment = MoLangEnvironment()
environment.query = player.asMoLangValue()
environment
}
map
}
)
val entityFunctions = mutableListOf<(LivingEntity) -> HashMap<String, java.util.function.Function<MoParams, Any>>>(
{ entity ->
val map = hashMapOf<String, java.util.function.Function<MoParams, Any>>()
map.put("damage") { params ->
val amount = params.getDouble(0)
val source = DamageSource(entity.world.registryManager.get(RegistryKeys.DAMAGE_TYPE).getEntry(DamageTypes.GENERIC).get())
entity.damage(source, amount.toFloat())
}
map.put("is_sneaking") { _ -> DoubleValue(entity.isSneaking) }
map.put("is_sprinting") { _ -> DoubleValue(entity.isSprinting) }
map.put("is_flying") { _ -> DoubleValue(entity.isFallFlying) }
map.put("is_in_water") { _ -> DoubleValue(entity.isSubmergedInWater) }
map.put("is_touching_water_or_rain") { _ -> DoubleValue(entity.isWet) }
map.put("is_touching_water") { _ -> DoubleValue(entity.isTouchingWater) }
map.put("is_in_lava") { _ -> DoubleValue(entity.isInLava) }
map.put("is_on_fire") { _ -> DoubleValue(entity.isOnFire) }
map.put("is_invisible") { _ -> DoubleValue(entity.isInvisible) }
map.put("is_sleeping") { _ -> DoubleValue(entity.isSleeping) }
map.put("is_riding") { _ -> DoubleValue(entity.hasVehicle()) }
map.put("health") { _ -> DoubleValue(entity.health) }
map.put("max_health") { _ -> DoubleValue(entity.maxHealth) }
map.put("name") { _ -> StringValue(entity.effectiveName().string) }
map.put("yaw") { _ -> DoubleValue(entity.yaw.toDouble()) }
map.put("pitch") { _ -> DoubleValue(entity.pitch.toDouble()) }
map.put("x") { _ -> DoubleValue(entity.x) }
map.put("y") { _ -> DoubleValue(entity.y) }
map.put("z") { _ -> DoubleValue(entity.z) }
map.put("velocity_x") { _ -> DoubleValue(entity.velocity.x) }
map.put("velocity_y") { _ -> DoubleValue(entity.velocity.y) }
map.put("velocity_z") { _ -> DoubleValue(entity.velocity.z) }
map.put("horizontal_velocity") { _ -> DoubleValue(entity.velocity.horizontalLength()) }
map.put("is_on_ground") { _ -> DoubleValue(entity.isOnGround) }
map.put("world") { _ -> entity.world.worldRegistry.getEntry(entity.world).asWorldMoLangValue() }
map.put("biome") { _ -> entity.world.getBiome(entity.blockPos).asBiomeMoLangValue() }
map
}
)
val npcFunctions = mutableListOf<(NPCEntity) -> HashMap<String, java.util.function.Function<MoParams, Any>>>(
{ npc ->
val map = hashMapOf<String, java.util.function.Function<MoParams, Any>>()
map.put("class") { StringValue(npc.npc.resourceIdentifier.toString()) }
map.put("name") { StringValue(npc.name.string) }
map.put("face") { ObjectValue(ReferenceDialogueFaceProvider(npc.id)) }
map.put("in_battle") { DoubleValue(npc.isInBattle()) }
map.put("run_script_on_client") { params ->
val world = npc.world
if (world is ServerWorld) {
val script = params.getString(0)
val packet = RunPosableMoLangPacket(npc.id, setOf("q.run_script('$script')"))
packet.sendToPlayers(world.players.toList())
}
Unit
}
map.put("run_script") { params ->
val script = params.getString(0).asIdentifierDefaultingNamespace()
val environment = params.environment
val runtime = MoLangRuntime()
runtime.environment.query = environment.query
runtime.environment.variable = environment.variable
runtime.environment.context = environment.context
CobblemonScripts.run(script, runtime) ?: DoubleValue(0)
}
map.put("environment") { _ -> npc.runtime.environment }
map
}
)
val battleFunctions = mutableListOf<(PokemonBattle) -> HashMap<String, java.util.function.Function<MoParams, Any>>>(
{ battle ->
val map = hashMapOf<String, java.util.function.Function<MoParams, Any>>()
map.put("battle_id") { StringValue(battle.battleId.toString()) }
map.put("is_pvn") { DoubleValue(battle.isPvN) }
map.put("is_pvp") { DoubleValue(battle.isPvP) }
map.put("is_pvw") { DoubleValue(battle.isPvW) }
map.put("battle_type") { StringValue(battle.format.toString()) }
map.put("environment") { battle.runtime.environment }
map
}
)
@@ -99,26 +226,46 @@ object MoLangFunctions {
fun RegistryEntry<World>.asWorldMoLangValue() = asMoLangValue(RegistryKeys.WORLD).addFunctions(worldFunctions)
fun RegistryEntry<Block>.asBlockMoLangValue() = asMoLangValue(RegistryKeys.BLOCK).addFunctions(blockFunctions)
fun RegistryEntry<DimensionType>.asDimensionTypeMoLangValue() = asMoLangValue(RegistryKeys.DIMENSION_TYPE).addFunctions(dimensionTypeFunctions)
fun ServerPlayerEntity.asMoLangValue(): ObjectValue<ServerPlayerEntity> {
fun PlayerEntity.asMoLangValue(): ObjectValue<PlayerEntity> {
val value = ObjectValue(
obj = this,
stringify = { it.entityName }
stringify = { it.effectiveName().string }
)
value.addFunctions(entityFunctions.flatMap { it(this).entries.map { it.key to it.value } }.toMap())
value.addFunctions(playerFunctions.flatMap { it(this).entries.map { it.key to it.value } }.toMap())
return value
}
fun NPCEntity.asMoLangValue(): ObjectValue<NPCEntity> {
val value = ObjectValue(
obj = this,
stringify = { it.name.string }
)
value.addFunctions(entityFunctions.flatMap { it(this).entries.map { it.key to it.value } }.toMap())
value.addFunctions(npcFunctions.flatMap { it(this).entries.map { it.key to it.value } }.toMap())
return value
}
fun PokemonBattle.asMoLangValue(): ObjectValue<PokemonBattle> {
val value = ObjectValue(
obj = this,
stringify = { it.battleId.toString() }
)
value.addFunctions(battleFunctions.flatMap { it(this).entries.map { it.key to it.value } }.toMap())
return value
}
fun <T> RegistryEntry<T>.asMoLangValue(key: RegistryKey<Registry<T>>): ObjectValue<RegistryEntry<T>> {
val value = ObjectValue(
obj = this,
stringify = { it.key.get().value.toString() }
)
value.functions.put("is_in") {
val tag = TagKey.of(key, Identifier(it.getString(0).replace("#", "")))
val tag = TagKey.of(key, Identifier.of(it.getString(0).replace("#", "")))
return@put DoubleValue(if (value.obj.isIn(tag)) 1.0 else 0.0)
}
value.functions.put("is_of") {
val identifier = Identifier(it.getString(0))
val identifier = Identifier.of(it.getString(0))
return@put DoubleValue(if (value.obj.matchesId(identifier)) 1.0 else 0.0)
}
return value
@@ -134,15 +281,8 @@ object MoLangFunctions {
return this
}
fun <T : QueryStruct> T.addFunction(name: String, function: java.util.function.Function<MoParams, Any>): T {
this.functions[name] = function
return this
}
fun MoLangEnvironment.getQueryStruct(name: String = "query") = structs.getOrPut(name) { QueryStruct(hashMapOf()) } as QueryStruct
fun MoLangRuntime.setup(): MoLangRuntime {
environment.getQueryStruct().addStandardFunctions()
environment.query.addStandardFunctions()
return this
}
@@ -193,4 +333,6 @@ object MoLangFunctions {
else -> null
} ?: throw IllegalArgumentException("Invalid NBT element type: ${nbt.type}")
}
}
}
fun Either<Identifier, ExpressionLike>.runScript(runtime: MoLangRuntime) = map({ CobblemonScripts.run(it, runtime) }, { it.resolve(runtime) })
@@ -10,6 +10,8 @@ package com.cobblemon.mod.common.api.molang
import com.bedrockk.molang.Expression
import com.bedrockk.molang.runtime.MoLangRuntime
import com.bedrockk.molang.runtime.value.MoValue
import com.cobblemon.mod.common.util.getString
import com.cobblemon.mod.common.util.resolve
/**
@@ -20,5 +22,6 @@ import com.cobblemon.mod.common.util.resolve
* @since October 22nd, 2023
*/
class SingleExpression(val expr: Expression) : ExpressionLike {
override fun resolve(runtime: MoLangRuntime) = runtime.resolve(expr)
override fun toString() = expr.getString()
override fun resolve(runtime: MoLangRuntime, context: Map<String, MoValue>) = runtime.resolve(expr, context)
}
@@ -12,12 +12,15 @@ import com.cobblemon.mod.common.api.reactive.SimpleObservable
import com.cobblemon.mod.common.net.IntSize
import com.cobblemon.mod.common.util.DataKeys
import com.cobblemon.mod.common.util.readSizedInt
import com.cobblemon.mod.common.util.readString
import com.cobblemon.mod.common.util.writeSizedInt
import com.cobblemon.mod.common.util.writeString
import com.google.gson.JsonArray
import com.google.gson.JsonObject
import net.minecraft.network.RegistryByteBuf
import net.minecraft.nbt.NbtCompound
import net.minecraft.nbt.NbtList
import net.minecraft.network.PacketByteBuf
class BenchedMoves : Iterable<BenchedMove> {
val observable = SimpleObservable<BenchedMoves>()
private var emit = true
@@ -59,7 +62,7 @@ class BenchedMoves : Iterable<BenchedMove> {
return json
}
fun saveToBuffer(buffer: PacketByteBuf) {
fun saveToBuffer(buffer: RegistryByteBuf) {
buffer.writeShort(benchedMoves.size)
benchedMoves.forEach { it.saveToBuffer(buffer) }
}
@@ -81,7 +84,7 @@ class BenchedMoves : Iterable<BenchedMove> {
return this
}
fun loadFromBuffer(buffer: PacketByteBuf): BenchedMoves {
fun loadFromBuffer(buffer: RegistryByteBuf): BenchedMoves {
doThenEmit {
clear()
repeat(times = buffer.readShort().toInt()) {
@@ -105,7 +108,7 @@ data class BenchedMove(val moveTemplate: MoveTemplate, val ppRaisedStages: Int)
return json
}
fun saveToBuffer(buffer: PacketByteBuf) {
fun saveToBuffer(buffer: RegistryByteBuf) {
buffer.writeString(moveTemplate.name)
buffer.writeSizedInt(IntSize.U_BYTE, ppRaisedStages)
}
@@ -127,7 +130,7 @@ data class BenchedMove(val moveTemplate: MoveTemplate, val ppRaisedStages: Int)
)
}
fun loadFromBuffer(buffer: PacketByteBuf): BenchedMove {
fun loadFromBuffer(buffer: RegistryByteBuf): BenchedMove {
val name = buffer.readString()
return BenchedMove(
Moves.getByName(name) ?: MoveTemplate.dummy(name),
@@ -14,8 +14,11 @@ import com.cobblemon.mod.common.api.types.ElementalType
import com.cobblemon.mod.common.net.IntSize
import com.cobblemon.mod.common.util.DataKeys
import com.cobblemon.mod.common.util.readSizedInt
import com.cobblemon.mod.common.util.readString
import com.cobblemon.mod.common.util.writeSizedInt
import com.cobblemon.mod.common.util.writeString
import com.google.gson.JsonObject
import net.minecraft.network.RegistryByteBuf
import kotlin.math.ceil
import kotlin.properties.Delegates
import net.minecraft.nbt.NbtCompound
@@ -114,7 +117,7 @@ open class Move(
return json
}
fun saveToBuffer(buffer: PacketByteBuf) {
fun saveToBuffer(buffer: RegistryByteBuf) {
buffer.writeString(name)
buffer.writeSizedInt(IntSize.U_BYTE, currentPp)
buffer.writeSizedInt(IntSize.U_BYTE, raisedPpStages)
@@ -135,7 +138,7 @@ open class Move(
return Move(template, currentPp, raisedPpStages)
}
fun loadFromBuffer(buffer: PacketByteBuf): Move {
fun loadFromBuffer(buffer: RegistryByteBuf): Move {
val moveName = buffer.readString()
val currentPp = buffer.readSizedInt(IntSize.U_BYTE)
val raisedPpStages = buffer.readSizedInt(IntSize.U_BYTE)
@@ -14,6 +14,7 @@ import com.cobblemon.mod.common.util.DataKeys
import com.cobblemon.mod.common.util.readSizedInt
import com.cobblemon.mod.common.util.writeSizedInt
import com.google.gson.JsonObject
import net.minecraft.network.RegistryByteBuf
import net.minecraft.nbt.NbtCompound
import net.minecraft.nbt.NbtElement
import net.minecraft.nbt.NbtList
@@ -102,7 +103,7 @@ class MoveSet : Iterable<Move> {
/**
* Writes the MoveSet to Buffer
*/
fun saveToBuffer(buffer: PacketByteBuf) {
fun saveToBuffer(buffer: RegistryByteBuf) {
buffer.writeSizedInt(IntSize.U_BYTE, getMoves().size)
getMoves().forEach {
it.saveToBuffer(buffer)
@@ -161,7 +162,7 @@ class MoveSet : Iterable<Move> {
/**
* Returns a MoveSet build from given Buffer
*/
fun loadFromBuffer(buffer: PacketByteBuf): MoveSet {
fun loadFromBuffer(buffer: RegistryByteBuf): MoveSet {
doWithoutEmitting {
clear()
val amountMoves = buffer.readSizedInt(IntSize.U_BYTE)
@@ -12,7 +12,6 @@ import com.bedrockk.molang.runtime.struct.MoStruct
import com.bedrockk.molang.runtime.struct.QueryStruct
import com.bedrockk.molang.runtime.value.DoubleValue
import com.bedrockk.molang.runtime.value.StringValue
import com.cobblemon.mod.common.api.molang.MoLangFunctions.addFunction
import com.cobblemon.mod.common.api.moves.animations.ActionEffectTimeline
import com.cobblemon.mod.common.api.moves.categories.DamageCategories
import com.cobblemon.mod.common.api.moves.categories.DamageCategory
@@ -11,8 +11,11 @@ package com.cobblemon.mod.common.api.moves.animations
import com.bedrockk.molang.Expression
import com.bedrockk.molang.runtime.MoLangRuntime
import com.bedrockk.molang.runtime.struct.VariableStruct
import com.cobblemon.mod.common.api.molang.ExpressionLike
import com.cobblemon.mod.common.api.moves.animations.keyframes.ActionEffectKeyframe
import com.cobblemon.mod.common.api.scheduling.ScheduledTask
import com.cobblemon.mod.common.util.asExpressionLike
import com.cobblemon.mod.common.util.asExpressions
import com.cobblemon.mod.common.util.asExpression
import com.cobblemon.mod.common.util.resolveBoolean
import java.util.concurrent.CompletableFuture
@@ -29,7 +32,7 @@ import net.minecraft.entity.Entity
*/
class ActionEffectTimeline(
val timeline: List<ActionEffectKeyframe> = mutableListOf(),
val condition: Expression = "true".asExpression()
val condition: ExpressionLike = "true".asExpressionLike()
) {
companion object {
val NONE = ActionEffectTimeline()
@@ -43,6 +46,9 @@ class ActionEffectTimeline(
// .toList copy because I'm paranoid about iterators being trying to share between identical effects playing
chainKeyframes(context, timeline.toList().iterator(), finalFuture)
finalFuture
}.exceptionallyCompose {
it.printStackTrace()
CompletableFuture.completedFuture(Unit)
}
}
@@ -55,6 +61,7 @@ class ActionEffectTimeline(
keyframe.play(context)
.thenRun { context.currentKeyframes.remove(keyframe) }
.thenApply { chainKeyframes(context, iterator, finalFuture) }
.exceptionally { finalFuture.completeExceptionally(it) }
}
}
}
@@ -62,7 +62,7 @@ object ActionEffects : JsonDataRegistry<ActionEffectTimeline> {
.disableHtmlEscaping()
.setPrettyPrinting()
.registerTypeAdapter(ActionEffectKeyframe::class.java, ActionEffectKeyframeAdapter)
.registerTypeAdapter(NumberRange.FloatRange::class.java, FloatNumberRangeAdapter)
.registerTypeAdapter(NumberRange.DoubleRange::class.java, FloatNumberRangeAdapter)
.registerTypeAdapter(TypeToken.getParameterized(Collection::class.java, Box::class.java).type, BoxCollectionAdapter)
.registerTypeAdapter(Box::class.java, BoxAdapter)
.registerTypeAdapter(Vec3d::class.java, VerboseVec3dAdapter)
@@ -14,7 +14,7 @@ import com.cobblemon.mod.common.api.moves.animations.ActionEffectContext
import com.cobblemon.mod.common.api.moves.animations.EntityProvider
import com.cobblemon.mod.common.api.moves.animations.UsersProvider
import com.cobblemon.mod.common.api.scheduling.delayedFuture
import com.cobblemon.mod.common.net.messages.client.animation.PlayPoseableAnimationPacket
import com.cobblemon.mod.common.net.messages.client.animation.PlayPosableAnimationPacket
import com.cobblemon.mod.common.util.asExpressionLike
import java.util.concurrent.CompletableFuture
import net.minecraft.server.world.ServerWorld
@@ -45,10 +45,10 @@ class AnimationActionEffectKeyframe : ConditionalActionEffectKeyframe(), EntityC
for (entity in entities) {
val world = entity.world as ServerWorld
val players = world.getPlayers { it.distanceTo(entity) <= visibilityRange }
val pkt = PlayPoseableAnimationPacket(entity.id, animation = animation, expressions = expressions)
val pkt = PlayPosableAnimationPacket(entity.id, animation = animation, expressions = expressions)
players.forEach { it.sendPacket(pkt) }
}
return delayedFuture(seconds = delay.resolveFloat(context.runtime), serverThread = true)
return delayedFuture(seconds = delay.resolveFloat(context.runtime))
}
}
@@ -12,7 +12,6 @@ import com.bedrockk.molang.runtime.struct.QueryStruct
import com.bedrockk.molang.runtime.value.DoubleValue
import com.bedrockk.molang.runtime.value.StringValue
import com.cobblemon.mod.common.api.molang.ExpressionLike
import com.cobblemon.mod.common.api.molang.MoLangFunctions.getQueryStruct
import com.cobblemon.mod.common.api.moves.animations.ActionEffectContext
import net.minecraft.entity.Entity
@@ -26,7 +25,7 @@ interface EntityConditionalActionEffectKeyframe {
val entityCondition: ExpressionLike
fun test(context: ActionEffectContext, entity: Entity, isUser: Boolean): Boolean {
// TODO this should use the entity's own query struct
context.runtime.environment.getQueryStruct().addFunction("entity") {
context.runtime.environment.query.addFunction("entity") {
QueryStruct(hashMapOf())
.addFunction("uuid") { StringValue(entity.uuidAsString) }
.addFunction("is_user") { DoubleValue(isUser) }
@@ -46,6 +46,6 @@ class EntityMoLangActionEffectKeyframe : ConditionalActionEffectKeyframe(), Enti
players.forEach { it.sendPacket(pkt) }
}
return delayedFuture(seconds = delay.resolveFloat(context.runtime), serverThread = true)
return delayedFuture(seconds = delay.resolveFloat(context.runtime))
}
}

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