Compare commits

..
Author SHA1 Message Date
Hiroku 45a9ad866e Fixed heaps of transformations passively activating outside of battle 2026-09-26 18:46:42 +10:00
Hiroku 9c3066e787 Labelled many more forms as temporary 2026-09-20 11:34:59 +10:00
Hiroku eb8598278f Various form change corrections and marked cherrim sunshine as a temporary form in the data 2026-09-20 11:02:04 +10:00
Hiroku 6777c8d57d Merge remote-tracking branch 'origin/main' into form_changes
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/api/molang/function/EvolutionMoLangFunctions.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/api/molang/function/PokemonMoLangFunctions.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/item/interactive/PPUpItem.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/pokemon/requirements/StatCompareRequirement.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/pokemon/requirements/StatEqualRequirement.kt
#	gradle.properties
2026-09-20 10:23:05 +10:00
Polymeta bf7d40c9b5 Merge branch 'small-jvm-fix' into 'main'
Added JvmField to Some values in Cobblemon Blocks cause it was forgotten

See merge request cable-mc/cobblemon!2419
2026-09-18 18:30:24 +00:00
Polymeta 5abb3d7f97 Merge branch 'fix/molang-delete-variables-fn' into 'main'
fix: reintroduce `delete_variables` general molang fn

See merge request cable-mc/cobblemon!2421
2026-09-18 18:29:23 +00:00
Gitoido 975ad8186a chore: dangling variable 2026-09-18 18:03:41 +00:00
Gitoido 26b6419f04 fix: reintroduce delete_variables general molang fn 2026-09-18 18:00:44 +00:00
Aram 89e43945a3 Edit CobblemonBlocks.kt 2026-09-16 14:25:26 +02:00
Aram bd8dcddf35 Edit CobblemonBlocks.kt 2026-09-16 14:24:31 +02:00
Polymeta dd372f3160 Merge branch 'recipe-booking' into 'main'
Recipe Book Tweaks

Closes #2088

See merge request cable-mc/cobblemon!2418
2026-09-16 10:03:42 +00:00
dhi_holo c56aab28d4 Recipe Book Tweaks
Closes #2088 as well as fixes a lot of similar issues for gameplay consistency
2026-09-16 18:41:05 +10:00
Polymeta 3cdf28ffdd Merge branch 'Chorus-Briar-Fix' into 'main'
I'm never doing an update where I have to keep track of 650+ structure files again

See merge request cable-mc/cobblemon!2414
2026-09-14 21:18:29 +00:00
Slippy c6fb18ea51 I'm never doing an update hwere I have to keep track of 650+ structure files again 2026-09-14 10:48:01 -05:00
Polymeta 2d851cb134 Merge branch 'tm-crafting-corrections' into 'main'
TM Recipes

See merge request cable-mc/cobblemon!2413
2026-09-14 13:03:40 +00:00
dhi_holo f685be0aab TM Recipes
Corrected two incorrect TM recieps, both in the jsons and the spreadsheets
2026-09-14 16:30:06 +10:00
Polymeta 6ab5ad52ec Merge branch 'typegem-advancement-trigger' into 'main'
Adds typegem item advancement trigger

Closes #2086

See merge request cable-mc/cobblemon!2411
2026-09-13 20:58:08 +00:00
PieDuck 079b2ae766 Merge branch 'typegem-advancement-trigger' of https://gitlab.com/dmnaru/cobblemon into typegem-advancement-trigger 2026-09-13 21:51:29 +01:00
PieDuck 34eea827e7 changelog 2026-09-13 21:51:09 +01:00
PieDuck 06c6ee5a9c Merge branch cobblemon:main into typegem-advancement-trigger 2026-09-13 21:37:22 +01:00
PieDuck 54748c20ea Add type gem item advancement trigger 2026-09-13 21:36:18 +01:00
Polymeta 02e63b6fc8 Merge branch 'gem-block-alert' into 'main'
Fixed Missing Recipe Advancements

See merge request cable-mc/cobblemon!2409
2026-09-13 14:41:13 +00:00
Polymeta 3aebcf66ec rename lang file to match convention 2026-09-13 14:26:44 +00:00
dhi_holo 49a5f716b7 Fixed Missing Recipe Advancements
Why were the advancements in the recipes..?
2026-09-13 22:05:44 +10:00
Hiroku 0bd7b4dab3 Merge branch 'decorative-items-restored' into 'main'
Decorative Items Project Returns

See merge request cable-mc/cobblemon!2343
2026-09-13 02:24:00 +00:00
Hiroku 8cbada0cf5 Fix changelog whackiness [skip-ci] 2026-09-13 12:23:40 +10:00
Hiroku f0784fec2d Merge remote-tracking branch 'origin/main' into decorative-items-restored 2026-09-13 12:21:54 +10:00
Hiroku cfe0c5e0a5 Snap on 2026-09-13 11:27:40 +10:00
Paul f6dbb1387c lil bit of doco [skip-ci] 2026-09-08 18:23:00 +10:00
Paul 1a27e14bec Wait that's meant to be withSuffix 2026-09-08 18:17:37 +10:00
dhi_holo 75bc03fdcb Merge branch 'main' into decorative-items-restored 2026-09-07 15:19:27 +10:00
Paul 7915f3f94e Merge branch 'version/1.9' into form_changes
# Conflicts:
#	common/src/main/java/com/cobblemon/mod/common/mixin/ClientPacketListenerMixin.java
#	common/src/main/kotlin/com/cobblemon/mod/common/api/tms/TechnicalMachines.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/block/entity/PokeSnackBlockEntity.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/block/tmmachine/TMMachineMenu.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/gui/summary/Summary.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen1/RattataAlolanModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen1/RattataModel.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/net/messages/client/pokemon/update/evolution/ClientboundSeatAssignmentPacket.kt
#	common/src/main/resources/data/cobblemon/species/generation5/panpour.json
#	common/src/main/resources/data/cobblemon/species/generation8/duraludon.json
2026-09-07 11:46:52 +10:00
Paul 396ab13164 1.9 in gradle properties 2026-09-06 20:01:10 +10:00
dhi_holo 309ff3da13 Loaded Cleanup
Added Loaded Dice, cleaned up some particles
2026-08-12 20:15:52 +10:00
dhi_holo 3af91e2a74 Further Tweaking 2026-08-12 14:26:20 +10:00
dhi_holo 2e027e3db7 Some Visual and Auditory Tweaks 2026-08-12 14:13:21 +10:00
dhi_holo fc40fb02c0 Next Batch
Never-Melt Ice, Wide, Scope, and Zoom Lens, as well as new designs for Upgrade and Dubious Disc
2026-08-12 13:52:13 +10:00
dhi_holo 2c1c0299f9 SPHERICAL!
Adds Flame Orb, Life Orb, Toxic Orb, Light Ball, and Smoke Ball blocks
2026-08-12 12:24:21 +10:00
dhi_holo 08cbbaf68c Merge branch 'main' into decorative-items-restored 2026-08-10 10:21:06 +10:00
Sterrezo 6e911acf01 Sound tweaks
Swapped pot sound types from tumblestone to decorated pots and rock sounds from tumblestone to deepslate.
2026-08-09 12:20:13 +02:00
dhi_holo f6d82a1b28 Changelog
and some last second sound tweaks
2026-08-09 19:17:19 +10:00
dhi_holo 702126aeab Adds Throat Spray and Iron Ball
Adds in Throat Spray and Iron Ball blocks, finishes clean up of King's Rock to look a bit more consistent
2026-08-09 19:04:08 +10:00
dhi_holo df566e8fcb Wearable Hat Cleanup
Fixed King's Rock Blockstate and loot table as well

Wearable "Hat" Items can now be prevented from swapping when trying to open the interaction wheel (sneak right-click), making it not a nightmare to give certain items to Pokemon. Yippee!
2026-08-09 18:53:58 +10:00
dhi_holo c83e0f33b5 Wearable Items Mostly Working Better
Wearable Items now can either be "Blocks" or "Hats"
"Blocks" can be placed as blocks in the world, while "Hats" can be put on the player's head by right clicking them in hand
Need to add some form of override when crouching and looking at a Pokemon though
2026-08-09 17:30:49 +10:00
dhi_holo f279f936b6 Generified Plaque/Wreath/Magnet Code
Moved shared code to a singular class
2026-08-09 16:04:22 +10:00
dhi_holo f8e20bafd9 Import Cleanup 2026-08-09 12:23:19 +10:00
dhi_holo a5211ca7ff Convention Alignment
Changed all stackable item blockstates/model files to utilise the convention from vanilla (seen on blocks such as pink petals)
This commit adds no files, and removes no files, it purely renames and swaps out numbers
2026-08-09 12:06:01 +10:00
dhi_holo 2f7bedf001 Update scribblenotes - Decorative Items.txt 2026-08-08 18:05:17 +10:00
dhi_holo 44c31a9ddb Update StackableItemBlock.kt
Simplified the way the hitboxes are defined, to allow for future planned hitboxes to actually work as intended
2026-08-08 17:33:34 +10:00
dhi_holo cfc8a15db1 Update scribblenotes - Decorative Items.txt 2026-08-06 18:35:29 +10:00
dhi_holo d5ba22a86c Removal of Unneeded Lines
deprecate deez nuts
2026-08-06 15:01:34 +10:00
dhi_holo a38505f1c5 Update scribblenotes - Decorative Items.txt
Documenting ideas and plans for future me
2026-08-05 19:28:29 +10:00
dhi_holo 3cf1ba1fb3 Tag Tweaks
Added stuff to relevant tags, removed unused tag from removed feature
2026-08-05 18:36:38 +10:00
dhi_holo 9f5d595827 Import Cleanup
Just removing some imports from reverted changes that snuck into commits
2026-08-05 18:03:06 +10:00
dhi_holo 75673f0204 Mild Polish 2026-08-05 17:09:40 +10:00
dhi_holo b43a7571ff Eject Button
Now with cleaner code, I hope this is more acceptable
2026-08-05 16:13:24 +10:00
dhi_holo b071dc04d3 Metronome
Reimplemented the Metronome, the code has been genericized to allow for more items to be implemented off the same base, although a little bit more work does need to be done there with the comparator output specifically
2026-08-05 15:34:32 +10:00
dhi_holo 12f9ff1647 Wreath, Magnet, and some tweaks to Plaques
Plaques now place the way I had originally set them up, and Galarica Wreaths along with the Magnet are back
2026-08-05 14:34:41 +10:00
dhi_holo 3256a302df Ring Target
Could maybe be polished up, but is good
2026-08-05 13:06:07 +10:00
dhi_holo edbe447477 Basic Decorations
Reimplemented Galarica Cuff, Teapots, Teacups, Weather Rocks, Sachet, Metal Powder, Quick Powder, Bright Powder, Destiny Knot, and Luminous Moss
2026-08-05 12:04:48 +10:00
Gertimoshka 2f43910368 Cleaner Implementation with less duplicate code 2026-08-04 22:21:58 +03:00
dhi_holo c2e87e4cfa Placeable Vitamins Experiment A
Need coder feedback regarding this
Makes Mochi and Feathers require clicking in the air or directly on a Pokemon, if it thinks it can place as a block it prevents usage
2026-08-04 19:25:13 +10:00
dhi_holo e40d2ee806 Create scribblenotes - Decorative Items.txt
Making this a unique commit so it's easy to reference back to later
2026-08-04 14:53:53 +10:00
dhi_holo ba74e7603b Wearables 1
Made Sharp Beak, Covert Cloak, and Shell Helmet wearable
2026-08-04 13:51:49 +10:00
dhi_holo 19c3fe6dc4 Update StackableItemBlock.kt
Fixed hitbox oversight
2026-08-04 13:35:17 +10:00
dhi_holo d0778dd124 Missing Stackables 1
Reimplemented Metal Coat, PP Up, and PP Max's placeable logic
Began work for other Vitamins to work (incomplete)
Added models, textures, blockstates, and loot tables for most incoming blocks
2026-08-04 13:16:46 +10:00
1123 changed files with 15893 additions and 4929 deletions
+41 -34
View File
@@ -1,41 +1,48 @@
# Changelog
## [1.8.1 (September 13th, 2026)](#1-8-1)
## [1.8.2 (MONTH xth, 2026)](#1-8-2)
### Additions
- The following items can now be placed on the ground as blocks:
- King's Rock, Galarica Cuff, Unremarkable Teacup, Masterpiece Teacup, Chipped Pot, Cracked Pot, Sachet, Metal Powder, Quick Powder, Bright Powder, Icy Rock, Heat Rock, Smooth Rock, Damp Rock, Destiny Knot, Luminous Moss, Never-Melt Ice, Wide Lens, Scope Lens, and Zoom Lens.
- Iron Ball, Metal Coat, Throat Spray, HP Up, Protein, Iron, Carbos, Calcium, Zinc, PP Up, PP Max, Upgrade, Dubious Disc, and Loaded Dice.
- The following items can now be placed on various surfaces:
- Galarica Wreath, Magnet, Flame Orb, Life Orb, Toxic Orb, Light Ball, and Smoke Ball.
- The following items can now be placed as blocks, and have additional functionality:
- Ring Target, Metronome, and Eject Button.
- The following items can now be worn by Players and Pokémon:
- Galarica Wreath, Cleanse Tag, Spell Tag, Sharp Beak, Covert Cloak, Shell Helmet, and Never-Melt Ice.
- Wearable items can now be equipped by a player by holding it and right-clicking (or rebound use/interact)
- Wearable items that can be placed down are exempt from this behaviour.
### New rideable Pokémon
### Pokémon Added
#### Regional Forms
### Model updates for the following Pokémon
### Animation updates for the following Pokémon
- Flapple, Appletun, Dipplin, Hydrapple (placeholder animations only).
#### Added sounds to the following moves
### Changes
- Updated various recipes to display in Recipe Groups within the Recipe Book
- Updated most recipes to display more logically/consistently within the Recipe Book's categories
### Fixes
- Fixed a potential world generation stall caused by Type Gem clusters.
- Fixed Pokémon on shoulders not animating if they are visibly holding a held item.
- Fixed NPCs getting their own TM progress file.
- Fixed odd NeoForge crash due to a dependency being outdated. It will now correctly flag the dependency for being outdated.
- Fixed the TM Machine refusing move selections that the `unlockAllMoveDexMovesByDefault` config had made visible, leaving the move slot blank and the craft button unresponsive.
- Fixed the Beast Ball not applying its 0.1× penalty to Pokémon that are not Ultra Beasts.
- Fixed the Moon Ball reading the world's total elapsed time instead of the time of day, so its bonus applied during the day instead.
- Fixed the Love Ball never awarding its 2.5× opposite gender bonus, and matching species by display name instead of identifier.
- Fixed the Timer Ball being weaker than a regular Poké Ball on early turns and only reaching 4× on turn 14 instead of turn 10.
- Fixed the Luxury Ball only doubling Friendship gains of 1, leaving level up and berry gains unaffected.
- Fixed Rufflet, Braviary, and Hisuian Braviary flooding logs with errors about missing sound events.
- Fixed Pokémon property typos in Pangoro and Dedenne herd spawn files.
- Fixed unintentional watermelon cosmetic for Hisuian Electrode.
- Fixed Blastoise having an unintentional passenger seat.
- Fixed form typo in Rockruff-Dusk spawn, preventing it from being able to spawn.
- Fixed the `stat_compare` and `stat_equal` evolution requirements crashing the game when given `special_attack` or `special_defence`, and made them treat any non-permanent stat as a failed requirement instead of crashing.
- Fixed Rowap and Jacoba berries not correctly altering Pokémon sizes when used as bait.
- Fixed Ampharos' eyes not emitting particles.
- Fixed Alolan Raticate's cry not playing.
- Fixed several incorrect light-based spawning conditions for ghosts and bugs.
- Removed unused, placeholder habitat pools.
- Fixed Mantyke, Mantine, and Quaxly getting stuck in a recoil 'expression' during battles due to having an expression assigned as a recoil animation.
- Fixed Lucario's aura particles not emitting.
- Fixed Lycanroc's head movement.
- Added head movement to Archaludon.
- Fixed Duraludon line not having their sleep animations.
- Fixed Diglett line not having their faint animations.
- Fixed Kingambit moving its legs while walking.
- Correctly grants "They're Minerals!" advancement when planting a type gem
- Type Gem Blocks now have advancements to give you the recipe in the recipe book (the data for the advancements were inside the recipes somehow??)
- Some other recipes without advancements have also been corrected
- Corrected the TM Recipes for Charge Beam and Payday
### Developer
### Molang & Datapacks
### Particles
#### New Move Animations
### Localization
- Updated translations for:
- Brazilian Portuguese
- Simplified Chinese
- Japanese
- Updated translations for:
+41
View File
@@ -0,0 +1,41 @@
# Changelog
## [1.8.1 (September 13th, 2026)](#1-8-1)
### Animation updates for the following Pokémon
- Flapple, Appletun, Dipplin, Hydrapple (placeholder animations only).
### Fixes
- Fixed a potential world generation stall caused by Type Gem clusters.
- Fixed Pokémon on shoulders not animating if they are visibly holding a held item.
- Fixed NPCs getting their own TM progress file.
- Fixed odd NeoForge crash due to a dependency being outdated. It will now correctly flag the dependency for being outdated.
- Fixed the TM Machine refusing move selections that the `unlockAllMoveDexMovesByDefault` config had made visible, leaving the move slot blank and the craft button unresponsive.
- Fixed the Beast Ball not applying its 0.1× penalty to Pokémon that are not Ultra Beasts.
- Fixed the Moon Ball reading the world's total elapsed time instead of the time of day, so its bonus applied during the day instead.
- Fixed the Love Ball never awarding its 2.5× opposite gender bonus, and matching species by display name instead of identifier.
- Fixed the Timer Ball being weaker than a regular Poké Ball on early turns and only reaching 4× on turn 14 instead of turn 10.
- Fixed the Luxury Ball only doubling Friendship gains of 1, leaving level up and berry gains unaffected.
- Fixed Rufflet, Braviary, and Hisuian Braviary flooding logs with errors about missing sound events.
- Fixed Pokémon property typos in Pangoro and Dedenne herd spawn files.
- Fixed unintentional watermelon cosmetic for Hisuian Electrode.
- Fixed Blastoise having an unintentional passenger seat.
- Fixed form typo in Rockruff-Dusk spawn, preventing it from being able to spawn.
- Fixed the `stat_compare` and `stat_equal` evolution requirements crashing the game when given `special_attack` or `special_defence`, and made them treat any non-permanent stat as a failed requirement instead of crashing.
- Fixed Rowap and Jacoba berries not correctly altering Pokémon sizes when used as bait.
- Fixed Ampharos' eyes not emitting particles.
- Fixed Alolan Raticate's cry not playing.
- Fixed several incorrect light-based spawning conditions for ghosts and bugs.
- Removed unused, placeholder habitat pools.
- Fixed Mantyke, Mantine, and Quaxly getting stuck in a recoil 'expression' during battles due to having an expression assigned as a recoil animation.
- Fixed Lucario's aura particles not emitting.
- Fixed Lycanroc's head movement.
- Added head movement to Archaludon.
- Fixed Duraludon line not having their sleep animations.
- Fixed Diglett line not having their faint animations.
- Fixed Kingambit moving its legs while walking.
### Localization
- Updated translations for:
- Brazilian Portuguese
- Simplified Chinese
- Japanese
@@ -8,6 +8,7 @@
package com.cobblemon.mod.common.mixin;
import com.cobblemon.mod.common.CobblemonNetwork;
import com.cobblemon.mod.common.OrientationControllable;
import com.cobblemon.mod.common.api.orientation.OrientationController;
import com.cobblemon.mod.common.api.pokemon.effect.ShoulderEffectRegistry;
@@ -17,6 +18,7 @@ import com.cobblemon.mod.common.api.riding.behaviour.types.liquid.SubmarineBehav
import com.cobblemon.mod.common.client.entity.PokemonClientDelegate;
import com.cobblemon.mod.common.client.render.MatrixWrapper;
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity;
import com.cobblemon.mod.common.net.messages.server.orientation.ServerboundUpdateOrientationPacket;
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import net.minecraft.server.level.ServerPlayer;
@@ -16,6 +16,8 @@ import com.cobblemon.mod.common.block.MintBlock.MintType
import com.cobblemon.mod.common.block.campfirepot.CampfireBlock
import com.cobblemon.mod.common.block.campfirepot.CampfirePotBlock
import com.cobblemon.mod.common.block.chest.GildedChestBlock
import com.cobblemon.mod.common.block.decor.ActivatableDecorationBlock
import com.cobblemon.mod.common.block.decor.RingTargetBlock
import com.cobblemon.mod.common.block.general.BaleBlock
import com.cobblemon.mod.common.block.general.HorizontalRotationCarpetBlock
import com.cobblemon.mod.common.block.general.HorizontalRotationalBlock
@@ -620,6 +622,88 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, ResourceKey<Registry<
@JvmField
val WEAKNESS_POLICY = create("weakness_policy", WallAttachedDirectionalShapeBlock(BlockBehaviour.Properties.of().sound(CobblemonSounds.ITEM_BLOCK_PAPER_LARGE_SOUNDS).mapColor(MapColor.NONE).noOcclusion().noCollission(), 14, 12, 1))
@JvmField
val RING_TARGET = create("ring_target", RingTargetBlock(BlockBehaviour.Properties.of().sound(SoundType.WOOD).mapColor(MapColor.NONE).noOcclusion().strength(0.125f)))
@JvmField
val MAGNET = create("magnet", MagnetBlock(BlockBehaviour.Properties.of().sound(SoundType.METAL).mapColor(MapColor.NONE).noOcclusion().strength(0.075f)))
@JvmField
val GALARICA_WREATH = create("galarica_wreath", GalaricaWreathBlock(BlockBehaviour.Properties.of().sound(SoundType.AZALEA_LEAVES).mapColor(MapColor.NONE).noOcclusion().noCollission()))
@JvmField
val FLAME_ORB = create("flame_orb", OrbBlock(BlockBehaviour.Properties.of().sound(SoundType.GLASS).mapColor(MapColor.NONE).noOcclusion().lightLevel{15}))
@JvmField
val TOXIC_ORB = create("toxic_orb", OrbBlock(BlockBehaviour.Properties.of().sound(SoundType.GLASS).mapColor(MapColor.NONE).noOcclusion()))
@JvmField
val LIFE_ORB = create("life_orb", OrbBlock(BlockBehaviour.Properties.of().sound(SoundType.GLASS).mapColor(MapColor.NONE).noOcclusion().lightLevel{7}))
@JvmField
val LIGHT_BALL = create("light_ball", OrbBlock(BlockBehaviour.Properties.of().sound(SoundType.GLASS).mapColor(MapColor.NONE).noOcclusion().lightLevel{13}))
@JvmField
val SMOKE_BALL = create("smoke_ball", OrbBlock(BlockBehaviour.Properties.of().sound(SoundType.GLASS).mapColor(MapColor.NONE).noOcclusion()))
@JvmField
val KINGS_ROCK = create("kings_rock", DecorativeItemBlock(BlockBehaviour.Properties.of().sound(CobblemonSounds.TUMBLESTONE_BLOCK_SOUNDS).mapColor(MapColor.NONE).noOcclusion(), DecorativeItemBlock.DecorativeItemBlockType.CENTERED_6x))
@JvmField
val GALARICA_CUFF = create("galarica_cuff", DecorativeItemBlock(BlockBehaviour.Properties.of().sound(SoundType.AZALEA_LEAVES).mapColor(MapColor.NONE).noCollission().noOcclusion(), DecorativeItemBlock.DecorativeItemBlockType.FLATTENED_10x4))
@JvmField
val UNREMARKABLE_TEACUP = create("unremarkable_teacup", DecorativeItemBlock(BlockBehaviour.Properties.of().sound(SoundType.DECORATED_POT).mapColor(MapColor.NONE).noOcclusion(), DecorativeItemBlock.DecorativeItemBlockType.TEACUP))
@JvmField
val MASTERPIECE_TEACUP = create("masterpiece_teacup", DecorativeItemBlock(BlockBehaviour.Properties.of().sound(SoundType.DECORATED_POT).mapColor(MapColor.NONE).noOcclusion(), DecorativeItemBlock.DecorativeItemBlockType.TEACUP))
@JvmField
val CHIPPED_POT = create("chipped_pot", DecorativeItemBlock(BlockBehaviour.Properties.of().sound(SoundType.DECORATED_POT).mapColor(MapColor.NONE).noOcclusion(), DecorativeItemBlock.DecorativeItemBlockType.TEAPOT))
@JvmField
val CRACKED_POT = create("cracked_pot", DecorativeItemBlock(BlockBehaviour.Properties.of().sound(SoundType.DECORATED_POT).mapColor(MapColor.NONE).noOcclusion(), DecorativeItemBlock.DecorativeItemBlockType.TEAPOT))
@JvmField
val SACHET = create("sachet", DecorativeItemBlock(BlockBehaviour.Properties.of().sound(SoundType.WOOL).mapColor(MapColor.NONE).noOcclusion(), DecorativeItemBlock.DecorativeItemBlockType.POUCH))
@JvmField
val METAL_POWDER = create("metal_powder", DecorativeItemBlock(BlockBehaviour.Properties.of().sound(SoundType.WOOL).mapColor(MapColor.NONE).noOcclusion(), DecorativeItemBlock.DecorativeItemBlockType.POUCH))
@JvmField
val QUICK_POWDER = create("quick_powder", DecorativeItemBlock(BlockBehaviour.Properties.of().sound(SoundType.WOOL).mapColor(MapColor.NONE).noOcclusion(), DecorativeItemBlock.DecorativeItemBlockType.POUCH))
@JvmField
val BRIGHT_POWDER = create("bright_powder", DecorativeItemBlock(BlockBehaviour.Properties.of().sound(SoundType.WOOL).mapColor(MapColor.NONE).noOcclusion().lightLevel{3}, DecorativeItemBlock.DecorativeItemBlockType.POUCH))
@JvmField
val NEVER_MELT_ICE = create("never_melt_ice", DecorativeItemBlock(BlockBehaviour.Properties.of().sound(SoundType.GLASS).mapColor(MapColor.NONE).noOcclusion().friction(0.989F), DecorativeItemBlock.DecorativeItemBlockType.NEVERMELT))
@JvmField
val SCOPE_LENS = create("scope_lens", DecorativeItemBlock(BlockBehaviour.Properties.of().sound(SoundType.COPPER).mapColor(MapColor.NONE).noOcclusion(), DecorativeItemBlock.DecorativeItemBlockType.SCOPE))
@JvmField
val WIDE_LENS = create("wide_lens", DecorativeItemBlock(BlockBehaviour.Properties.of().sound(SoundType.COPPER).mapColor(MapColor.NONE).noOcclusion(), DecorativeItemBlock.DecorativeItemBlockType.WIDE))
@JvmField
val ZOOM_LENS = create("zoom_lens", DecorativeItemBlock(BlockBehaviour.Properties.of().sound(SoundType.COPPER).mapColor(MapColor.NONE).noOcclusion(), DecorativeItemBlock.DecorativeItemBlockType.ZOOM))
@JvmField
val ICY_ROCK = create("icy_rock", DecorativeItemBlock(BlockBehaviour.Properties.of().sound(SoundType.DEEPSLATE).mapColor(MapColor.NONE).noOcclusion(), DecorativeItemBlock.DecorativeItemBlockType.FLATTENED_8x4))
@JvmField
val HEAT_ROCK = create("heat_rock", DecorativeItemBlock(BlockBehaviour.Properties.of().sound(SoundType.DEEPSLATE).mapColor(MapColor.NONE).noOcclusion(), DecorativeItemBlock.DecorativeItemBlockType.FLATTENED_8x4))
@JvmField
val SMOOTH_ROCK = create("smooth_rock", DecorativeItemBlock(BlockBehaviour.Properties.of().sound(SoundType.DEEPSLATE).mapColor(MapColor.NONE).noOcclusion(), DecorativeItemBlock.DecorativeItemBlockType.FLATTENED_8x4))
@JvmField
val DAMP_ROCK = create("damp_rock", DecorativeItemBlock(BlockBehaviour.Properties.of().sound(SoundType.DEEPSLATE).mapColor(MapColor.NONE).noOcclusion(), DecorativeItemBlock.DecorativeItemBlockType.FLATTENED_8x6))
@JvmField
val DESTINY_KNOT = create("destiny_knot", DecorativeItemBlock(BlockBehaviour.Properties.of().sound(SoundType.WOOL).mapColor(MapColor.NONE).noOcclusion(), DecorativeItemBlock.DecorativeItemBlockType.KNOT))
@JvmField
val LUMINOUS_MOSS = create("luminous_moss", DecorativeItemBlock(BlockBehaviour.Properties.of().sound(SoundType.MOSS).mapColor(MapColor.NONE).noOcclusion().lightLevel{5}, DecorativeItemBlock.DecorativeItemBlockType.CENTERED_8x))
@JvmField
val METRONOME = create("metronome", ActivatableDecorationBlock(BlockBehaviour.Properties.of().sound(SoundType.METAL).mapColor(MapColor.NONE).pushReaction(PushReaction.DESTROY).noOcclusion(), ActivatableDecorationBlock.ActivatableDecorationBlockType.METRONOME))
@JvmField
val EJECT_BUTTON = create("eject_button", EjectButtonBlock(BlockBehaviour.Properties.of().sound(SoundType.METAL).mapColor(MapColor.NONE).pushReaction(PushReaction.DESTROY).noOcclusion().strength(0.125f), 40))
@JvmField
val LOADED_DICE = create("loaded_dice", StackableItemBlock(BlockBehaviour.Properties.of().sound(SoundType.CANDLE).mapColor(MapColor.NONE).noOcclusion(), StackableItemBlock.StackableItemBlockType.DICE))
@JvmField
val IRON_BALL = create("iron_ball", StackableItemBlock(BlockBehaviour.Properties.of().sound(SoundType.METAL).mapColor(MapColor.NONE).noOcclusion(), StackableItemBlock.StackableItemBlockType.IRON_BALL))
@JvmField
val METAL_COAT = create("metal_coat", StackableItemBlock(BlockBehaviour.Properties.of().sound(SoundType.METAL).mapColor(MapColor.NONE).noOcclusion(), StackableItemBlock.StackableItemBlockType.METAL_COAT))
@JvmField
val UPGRADE = create("upgrade", StackableItemBlock(BlockBehaviour.Properties.of().sound(SoundType.CANDLE).mapColor(MapColor.NONE).noOcclusion(), StackableItemBlock.StackableItemBlockType.UPGRADE))
@JvmField
val DUBIOUS_DISC = create("dubious_disc", StackableItemBlock(BlockBehaviour.Properties.of().sound(SoundType.CANDLE).mapColor(MapColor.NONE).noOcclusion(), StackableItemBlock.StackableItemBlockType.UPGRADE))
@JvmField
val THROAT_SPRAY = create("throat_spray", StackableItemBlock(BlockBehaviour.Properties.of().sound(SoundType.CANDLE).mapColor(MapColor.NONE).noOcclusion(), StackableItemBlock.StackableItemBlockType.THROAT_SPRAY))
@JvmField
val FULL_HEAL = create("full_heal", StackableItemBlock(BlockBehaviour.Properties.of().sound(SoundType.CANDLE).mapColor(MapColor.NONE).noOcclusion(), StackableItemBlock.StackableItemBlockType.STATUS_RESTORE))
@JvmField
@@ -670,6 +754,23 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, ResourceKey<Registry<
@JvmField
val X_SPEED = create("x_${Stats.SPEED.identifier.path}", StackableItemBlock(BlockBehaviour.Properties.of().sound(SoundType.CANDLE).mapColor(MapColor.NONE).noOcclusion(), StackableItemBlock.StackableItemBlockType.BATTLE_ITEM))
@JvmField
val HP_UP = create("hp_up", StackableItemBlock(BlockBehaviour.Properties.of().sound(SoundType.CANDLE).mapColor(MapColor.NONE).noOcclusion(), StackableItemBlock.StackableItemBlockType.VITAMIN))
@JvmField
val PROTEIN = create("protein", StackableItemBlock(BlockBehaviour.Properties.of().sound(SoundType.CANDLE).mapColor(MapColor.NONE).noOcclusion(), StackableItemBlock.StackableItemBlockType.VITAMIN))
@JvmField
val IRON = create("iron", StackableItemBlock(BlockBehaviour.Properties.of().sound(SoundType.CANDLE).mapColor(MapColor.NONE).noOcclusion(), StackableItemBlock.StackableItemBlockType.VITAMIN))
@JvmField
val CARBOS = create("carbos", StackableItemBlock(BlockBehaviour.Properties.of().sound(SoundType.CANDLE).mapColor(MapColor.NONE).noOcclusion(), StackableItemBlock.StackableItemBlockType.VITAMIN))
@JvmField
val CALCIUM = create("calcium", StackableItemBlock(BlockBehaviour.Properties.of().sound(SoundType.CANDLE).mapColor(MapColor.NONE).noOcclusion(), StackableItemBlock.StackableItemBlockType.VITAMIN))
@JvmField
val ZINC = create("zinc", StackableItemBlock(BlockBehaviour.Properties.of().sound(SoundType.CANDLE).mapColor(MapColor.NONE).noOcclusion(), StackableItemBlock.StackableItemBlockType.VITAMIN))
@JvmField
val PP_UP = create("pp_up", StackableItemBlock(BlockBehaviour.Properties.of().sound(SoundType.CANDLE).mapColor(MapColor.NONE).noOcclusion(), StackableItemBlock.StackableItemBlockType.VITAMIN))
@JvmField
val PP_MAX = create("pp_max", StackableItemBlock(BlockBehaviour.Properties.of().sound(SoundType.CANDLE).mapColor(MapColor.NONE).noOcclusion(), StackableItemBlock.StackableItemBlockType.VITAMIN))
@JvmField
val MONITOR = create("monitor", MonitorBlock(BlockBehaviour.Properties.of().mapColor(MapColor.METAL).sound(SoundType.METAL).pushReaction(PushReaction.BLOCK).requiresCorrectToolForDrops().strength(5.0F, 6.0F).lightLevel { if (it.getValue(MonitorBlock.SCREEN) != MonitorBlock.MonitorScreen.OFF) 13 else 0 }))
@JvmField
@@ -685,6 +786,7 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, ResourceKey<Registry<
@JvmField
val PC = create("pc", PCBlock(BlockBehaviour.Properties.of().mapColor(MapColor.METAL).sound(SoundType.METAL).pushReaction(PushReaction.BLOCK).strength(2F).noOcclusion().lightLevel { if ((it.getValue(PCBlock.ON) as Boolean) && (it.getValue(PCBlock.PART) == PCBlock.PCPart.TOP)) 13 else 0 }))
@JvmField
val TM_MACHINE = create(
"tm_machine",
TMMachineBlock(
@@ -713,7 +815,7 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, ResourceKey<Registry<
@JvmField
val PASTURE = create("pasture", PastureBlock(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_BROWN).sound(SoundType.WOOD).strength(2F).noOcclusion().pushReaction(PushReaction.BLOCK).lightLevel { if ((it.getValue(PastureBlock.ON) as Boolean) && (it.getValue(PastureBlock.PART) == PastureBlock.PasturePart.TOP)) 13 else 0 }))
@JvmField
val RED_MINT = create("red_mint", MintBlock(MintType.RED, BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_RED).noCollission().randomTicks().instabreak().sound(CobblemonSounds.MINT_SOUNDS).pushReaction(PushReaction.DESTROY)))
@JvmField
val BLUE_MINT = create("blue_mint", MintBlock(MintType.BLUE, BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_BLUE).noCollission().randomTicks().instabreak().sound(CobblemonSounds.MINT_SOUNDS).pushReaction(PushReaction.DESTROY)))
@@ -41,8 +41,6 @@ object CobblemonCommands {
HeldItemCommand.register(dispatcher, registry)
PcCommand.register(dispatcher)
SpawnPokemonFromPool.register(dispatcher)
SpawnMeteorCommand.register(dispatcher)
SetMegaBondCommand.register(dispatcher)
PokeboxCommand.register(dispatcher)
PokedexCommand.register(dispatcher)
TestStoreCommand.register(dispatcher)
@@ -16,7 +16,6 @@ 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.entity.projectile.FallingStarEntity
import com.cobblemon.mod.common.platform.PlatformRegistry
import com.cobblemon.mod.common.util.cobblemonResource
import net.minecraft.core.Registry
@@ -96,15 +95,6 @@ object CobblemonEntities : PlatformRegistry<Registry<EntityType<*>>, ResourceKey
EntityType.Builder.of({ _, world -> NPCEntity(world) }, MobCategory.CREATURE).build("$NPC_KEY")
)
@JvmField
val FALLING_STAR_KEY = cobblemonResource("falling_star")
@JvmField
val FALLING_STAR: EntityType<FallingStarEntity> = create(
FALLING_STAR_KEY.path,
EntityType.Builder.of(::FallingStarEntity, MobCategory.MISC).sized(0.5F, 0.5F).clientTrackingRange(8)
.build(FALLING_STAR_KEY.toString())
)
fun registerAttributes(consumer: (EntityType<out LivingEntity>, AttributeSupplier.Builder) -> Unit) {
consumer(POKEMON, PokemonEntity.createAttributes())
consumer(NPC, NPCEntity.createAttributes())
@@ -33,12 +33,6 @@ object CobblemonItemComponents : PlatformRegistry<Registry<DataComponentType<*>>
.networkSynchronized(HeldItemEffectComponent.PACKET_CODEC)
.build())
@JvmField
val MEGA_BOND: DataComponentType<MegaBondComponent> = create("mega_bond", DataComponentType.builder<MegaBondComponent>()
.persistent(MegaBondComponent.CODEC)
.networkSynchronized(MegaBondComponent.PACKET_CODEC)
.build())
@JvmField
val BAIT: DataComponentType<RodBaitComponent> = create("bait", DataComponentType.builder<RodBaitComponent>()
.persistent(RodBaitComponent.CODEC)
@@ -472,9 +472,9 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
// Evolution items
@JvmField val LINK_CABLE = create("link_cable", LinkCableItem())
@JvmField val DRAGON_SCALE = noSettingsItem("dragon_scale")
@JvmField val METAL_COAT = noSettingsItem("metal_coat")
@JvmField val UPGRADE = noSettingsItem("upgrade")
@JvmField val DUBIOUS_DISC = noSettingsItem("dubious_disc")
@JvmField val METAL_COAT = itemNameBlockItem("metal_coat", CobblemonBlocks.METAL_COAT)
@JvmField val UPGRADE = itemNameBlockItem("upgrade", CobblemonBlocks.UPGRADE)
@JvmField val DUBIOUS_DISC = itemNameBlockItem("dubious_disc", CobblemonBlocks.DUBIOUS_DISC)
@JvmField val DEEP_SEA_SCALE = noSettingsItem("deep_sea_scale")
@JvmField val DEEP_SEA_TOOTH = noSettingsItem("deep_sea_tooth")
@JvmField val ELECTIRIZER = noSettingsItem("electirizer")
@@ -483,7 +483,7 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
@JvmField val PROTECTOR = noSettingsItem("protector")
@JvmField val REAPER_CLOTH = noSettingsItem("reaper_cloth")
@JvmField val PRISM_SCALE = noSettingsItem("prism_scale")
@JvmField val SACHET = noSettingsItem("sachet")
@JvmField val SACHET = itemNameBlockItem("sachet", CobblemonBlocks.SACHET)
@JvmField val WHIPPED_DREAM = create("whipped_dream", foodItem(8, 0.3f))
@JvmField val STRAWBERRY_SWEET = create("strawberry_sweet", foodItem(6, 0.125f))
@JvmField val LOVE_SWEET = create("love_sweet", foodItem(6, 0.125f))
@@ -492,22 +492,20 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
@JvmField val FLOWER_SWEET = create("flower_sweet", foodItem(6, 0.125f))
@JvmField val STAR_SWEET = create("star_sweet", foodItem(6, 0.125f))
@JvmField val RIBBON_SWEET = create("ribbon_sweet", foodItem(6, 0.125f))
@JvmField val CHIPPED_POT = noSettingsItem("chipped_pot")
@JvmField val CRACKED_POT = noSettingsItem("cracked_pot")
@JvmField val MASTERPIECE_TEACUP = noSettingsItem("masterpiece_teacup")
@JvmField val UNREMARKABLE_TEACUP = noSettingsItem("unremarkable_teacup")
@JvmField val CHIPPED_POT = itemNameBlockItem("chipped_pot", CobblemonBlocks.CHIPPED_POT)
@JvmField val CRACKED_POT = itemNameBlockItem("cracked_pot", CobblemonBlocks.CRACKED_POT)
@JvmField val MASTERPIECE_TEACUP = itemNameBlockItem("masterpiece_teacup", CobblemonBlocks.MASTERPIECE_TEACUP)
@JvmField val UNREMARKABLE_TEACUP = itemNameBlockItem("unremarkable_teacup", CobblemonBlocks.UNREMARKABLE_TEACUP)
@JvmField val SWEET_APPLE = compostableItem("sweet_apple", foodItem(4, 0.3f), 0.65f)
@JvmField val TART_APPLE = compostableItem("tart_apple", foodItem(4, 0.3f), 0.65f)
@JvmField val SYRUPY_APPLE = compostableItem("syrupy_apple", foodItem(4, 0.3f), 0.65f)
@JvmField val GALARICA_CUFF = noSettingsItem("galarica_cuff")
@JvmField val GALARICA_WREATH = noSettingsItem("galarica_wreath")
@JvmField val GALARICA_CUFF = itemNameBlockItem("galarica_cuff", CobblemonBlocks.GALARICA_CUFF)
@JvmField val BLACK_AUGURITE = noSettingsItem("black_augurite")
@JvmField val PEAT_BLOCK = noSettingsItem("peat_block")
@JvmField val RAZOR_CLAW = noSettingsItem("razor_claw")
@JvmField val RAZOR_FANG = noSettingsItem("razor_fang")
@JvmField val AUSPICIOUS_ARMOR = heldItem("auspicious_armor")
@JvmField val MALICIOUS_ARMOR = heldItem("malicious_armor")
@JvmField val SHELL_HELMET = heldItem("shell_helmet")
@JvmField val METAL_ALLOY = noSettingsItem("metal_alloy")
@JvmField val SCROLL_OF_DARKNESS = noSettingsItem("scroll_of_darkness")
@JvmField val SCROLL_OF_WATERS = noSettingsItem("scroll_of_waters")
@@ -651,17 +649,17 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
@JvmField
val EXPERIENCE_CANDY_XL = candyItem("exp_candy_xl") { _, _ -> CandyItem.DEFAULT_XL_CANDY_YIELD }
@JvmField
val CALCIUM = create("calcium", VitaminItem(Stats.SPECIAL_ATTACK))
val CALCIUM = create("calcium", VitaminItem(Stats.SPECIAL_ATTACK, CobblemonBlocks.CALCIUM))
@JvmField
val CARBOS = create("carbos", VitaminItem(Stats.SPEED))
val CARBOS = create("carbos", VitaminItem(Stats.SPEED, CobblemonBlocks.CARBOS))
@JvmField
val HP_UP = create("hp_up", VitaminItem(Stats.HP))
val HP_UP = create("hp_up", VitaminItem(Stats.HP, CobblemonBlocks.HP_UP))
@JvmField
val IRON = create("iron", VitaminItem(Stats.DEFENCE))
val IRON = create("iron", VitaminItem(Stats.DEFENCE, CobblemonBlocks.IRON))
@JvmField
val PROTEIN = create("protein", VitaminItem(Stats.ATTACK))
val PROTEIN = create("protein", VitaminItem(Stats.ATTACK, CobblemonBlocks.PROTEIN))
@JvmField
val ZINC = create("zinc", VitaminItem(Stats.SPECIAL_DEFENCE))
val ZINC = create("zinc", VitaminItem(Stats.SPECIAL_DEFENCE, CobblemonBlocks.ZINC))
@JvmField
val HEALTH_MOCHI = create("health_mochi", MochiItem(Stats.HP))
@JvmField
@@ -743,9 +741,9 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
@JvmField
val MAX_REVIVE = create("max_revive", ReviveItem(max = true))
@JvmField
val PP_UP = create("pp_up", PPUpItem(1))
val PP_UP = create("pp_up", PPUpItem(1, CobblemonBlocks.PP_UP))
@JvmField
val PP_MAX = create("pp_max", PPUpItem(3))
val PP_MAX = create("pp_max", PPUpItem(3, CobblemonBlocks.PP_MAX))
@JvmField
val RED_MINT_SEEDS = mintSeed("red", MintType.RED.getCropBlock())
@@ -914,10 +912,6 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
val THUNDER_STONE = noSettingsItem("thunder_stone")
@JvmField
val WATER_STONE = noSettingsItem("water_stone")
@JvmField
val MEGA_SHARD = noSettingsItem("mega_shard")
@JvmField
val DORMANT_MEGA_STONE = heldItem("dormant_mega_stone")
val wearables = mutableListOf<WearableItem>()
//Wearable items (these items should have a corresponding 3D model)
@@ -926,44 +920,31 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
@JvmField val CHOICE_SPECS = wearableItem("choice_specs")
@JvmField val EXP_SHARE = wearableItem("exp_share")
@JvmField val FOCUS_BAND = wearableItem("focus_band")
@JvmField val KINGS_ROCK = wearableItem("kings_rock")
@JvmField val KINGS_ROCK = wearableBlockItem("kings_rock", CobblemonBlocks.KINGS_ROCK)
@JvmField val NEVER_MELT_ICE = wearableBlockItem("never_melt_ice", CobblemonBlocks.NEVER_MELT_ICE)
@JvmField val MUSCLE_BAND = wearableItem("muscle_band")
@JvmField val ROCKY_HELMET = wearableItem("rocky_helmet")
@JvmField val SAFETY_GOGGLES = wearableItem("safety_goggles")
@JvmField val WISE_GLASSES = wearableItem("wise_glasses")
@JvmField val SHARP_BEAK = wearableItem("sharp_beak")
@JvmField val COVERT_CLOAK = wearableItem("covert_cloak")
@JvmField val SHELL_HELMET = wearableItem("shell_helmet")
@JvmField val GALARICA_WREATH = wearableBlockItem("galarica_wreath", CobblemonBlocks.GALARICA_WREATH)
@JvmField val CLEANSE_TAG = wearableBlockItem("cleanse_tag", CobblemonBlocks.CLEANSE_TAG)
@JvmField val SPELL_TAG = wearableBlockItem("spell_tag", CobblemonBlocks.SPELL_TAG)
// Held Items
@JvmField
val ABILITY_SHIELD = heldItem("ability_shield")
@JvmField
val ABOMASITE = heldItem("abomasite")
@JvmField
val ABSOLITE = heldItem("absolite")
@JvmField
val ABSORB_BULB = heldItem("absorb_bulb")
@JvmField
val AERODACTYLITE = heldItem("aerodactylite")
@JvmField
val AGGRONITE = heldItem("aggronite")
@JvmField
val AIR_BALLOON = heldItem("air_balloon")
@JvmField
val ALAKAZITE = heldItem("alakazite")
@JvmField
val ALTARIANITE = heldItem("altarianite")
@JvmField
val AMPHAROSITE = heldItem("ampharosite")
@JvmField
val ASSAULT_VEST = heldItem("assault_vest")
@JvmField
val BIG_ROOT = compostableBlockItem("big_root", CobblemonBlocks.BIG_ROOT, 0.30f)
@JvmField
val AUDINITE = heldItem("audinite")
@JvmField
val BANETTITE = heldItem("banettite")
@JvmField
val BEEDRILLITE = heldItem("beedrillite")
@JvmField
val BINDING_BAND = heldItem("binding_band")
@JvmField
val BLACK_BELT = heldItem("black_belt")
@@ -972,35 +953,19 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
@JvmField
val BLUNDER_POLICY = itemNameBlockItem("blunder_policy", CobblemonBlocks.BLUNDER_POLICY)
@JvmField
val BLASTOISINITE = heldItem("blastoisinite")
@JvmField
val BLAZIKENITE = heldItem("blazikenite")
@JvmField
val CAMERUPTITE = heldItem("cameruptite")
@JvmField
val CELL_BATTERY = heldItem("cell_battery")
@JvmField
val CHARCOAL = heldItem("charcoal_stick", remappedName = "charcoal")
@JvmField
val CHARIZARDITE_X = heldItem("charizardite_x")
@JvmField
val CHARIZARDITE_Y = heldItem("charizardite_y")
@JvmField
val CHOICE_SCARF = heldItem("choice_scarf")
@JvmField
val CLEANSE_TAG = itemNameBlockItem("cleanse_tag", CobblemonBlocks.CLEANSE_TAG)
@JvmField
val CLEAR_AMULET = heldItem("clear_amulet")
@JvmField
val COVERT_CLOAK = heldItem("covert_cloak")
@JvmField
val DESTINY_KNOT = heldItem("destiny_knot")
@JvmField
val DIANCITE = heldItem("diancite")
val DESTINY_KNOT = itemNameBlockItem("destiny_knot", CobblemonBlocks.DESTINY_KNOT)
@JvmField
val DRAGON_FANG = heldItem("dragon_fang")
@JvmField
val EJECT_BUTTON = heldItem("eject_button")
val EJECT_BUTTON = itemNameBlockItem("eject_button", CobblemonBlocks.EJECT_BUTTON)
@JvmField
val EJECT_PACK = heldItem("eject_pack")
@JvmField
@@ -1014,90 +979,46 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
@JvmField
val FAIRY_FEATHER = heldItem("fairy_feather")
@JvmField
val FLAME_ORB = heldItem("flame_orb")
val FLAME_ORB = itemNameBlockItem("flame_orb", CobblemonBlocks.FLAME_ORB)
@JvmField
val FLOAT_STONE = heldItem("float_stone")
@JvmField
val FOCUS_SASH = heldItem("focus_sash")
@JvmField
val GALLADITE = heldItem("galladite")
@JvmField
val GARCHOMPITE = heldItem("garchompite")
@JvmField
val GARDEVOIRITE = heldItem("gardevoirite")
@JvmField
val GENGARITE = heldItem("gengarite")
@JvmField
val GLALITITE = heldItem("glalitite")
@JvmField
val GRASSY_SEED = heldItem("grassy_seed")
@JvmField
val GRIP_CLAW = heldItem("grip_claw")
@JvmField
val GYARADOSITE = heldItem("gyaradosite")
@JvmField
val HARD_STONE = heldItem("hard_stone")
@JvmField
val HEAVY_DUTY_BOOTS = heldItem("heavy_duty_boots")
@JvmField
val HERACRONITE = heldItem("heracronite")
@JvmField
val HOUNDOOMINITE = heldItem("houndoominite")
@JvmField
val IRON_BALL = heldItem("iron_ball")
@JvmField
val KANGASKHANITE = heldItem("kangaskhanite")
val IRON_BALL = itemNameBlockItem("iron_ball", CobblemonBlocks.IRON_BALL)
@JvmField
val LAGGING_TAIL = heldItem("lagging_tail")
@JvmField
val LEFTOVERS = compostableHeldItem("leftovers", null, 0.50f)
@JvmField
val LATIASITE = heldItem("latiasite")
val LIFE_ORB = itemNameBlockItem("life_orb", CobblemonBlocks.LIFE_ORB)
@JvmField
val LATIOSITE = heldItem("latiosite")
@JvmField
val LIFE_ORB = heldItem("life_orb")
@JvmField
val LIGHT_BALL = heldItem("light_ball")
val LIGHT_BALL = itemNameBlockItem("light_ball", CobblemonBlocks.LIGHT_BALL)
@JvmField
val LIGHT_CLAY = heldItem("light_clay")
@JvmField
val LOADED_DICE = heldItem("loaded_dice")
@JvmField
val LOPUNNITE = heldItem("lopunnite")
@JvmField
val LUCARIONITE = heldItem("lucarionite")
val LOADED_DICE = itemNameBlockItem("loaded_dice", CobblemonBlocks.LOADED_DICE)
@JvmField
val LUCKY_EGG = heldItem("lucky_egg")
@JvmField
val LUMINOUS_MOSS = heldItem("luminous_moss")
val LUMINOUS_MOSS = itemNameBlockItem("luminous_moss", CobblemonBlocks.LUMINOUS_MOSS)
@JvmField
val MAGNET = heldItem("magnet")
val MAGNET = itemNameBlockItem("magnet", CobblemonBlocks.MAGNET)
@JvmField
val MANECTITE = heldItem("manectite")
@JvmField
val MAWILITE = heldItem("mawilite")
@JvmField
val MEDICHAMITE = heldItem("medichamite")
@JvmField
val METAGROSSITE = heldItem("metagrossite")
@JvmField
val METRONOME = heldItem("metronome")
@JvmField
val MEWTWONITE_X = heldItem("mewtwonite_x")
@JvmField
val MEWTWONITE_Y = heldItem("mewtwonite_y")
val METRONOME = itemNameBlockItem("metronome", CobblemonBlocks.METRONOME)
@JvmField
val MIRACLE_SEED = heldItem("miracle_seed")
@JvmField
val MYSTIC_WATER = heldItem("mystic_water")
@JvmField
val NEVER_MELT_ICE = heldItem("never_melt_ice")
@JvmField
val PIDGEOTITE = heldItem("pidgeotite")
@JvmField
val PINSIRITE = heldItem("pinsirite")
@JvmField
val POISON_BARB = heldItem("poison_barb")
@JvmField
val POWER_ANKLET = heldItem("power_anklet")
@@ -1122,23 +1043,11 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
@JvmField
val RED_CARD = heldItem("red_card")
@JvmField
val RING_TARGET = heldItem("ring_target")
val RING_TARGET = itemNameBlockItem("ring_target", CobblemonBlocks.RING_TARGET)
@JvmField
val ROOM_SERVICE = heldItem("room_service")
@JvmField
val SABLENITE = heldItem("sablenite")
@JvmField
val SALAMENCITE = heldItem("salamencite")
@JvmField
val SCEPTILITE = heldItem("sceptilite")
@JvmField
val SCIZORITE = heldItem("scizorite")
@JvmField
val SCOPE_LENS = heldItem("scope_lens")
@JvmField
val SHARP_BEAK = heldItem("sharp_beak")
@JvmField
val SHARPEDONITE = heldItem("sharpedonite")
val SCOPE_LENS = itemNameBlockItem("scope_lens", CobblemonBlocks.SCOPE_LENS)
@JvmField
val SHED_SHELL = heldItem("shed_shell")
@JvmField
@@ -1148,41 +1057,29 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
@JvmField
val SILVER_POWDER = heldItem("silver_powder")
@JvmField
val SLOWBRONITE = heldItem("slowbronite")
@JvmField
val SOFT_SAND = heldItem("soft_sand")
@JvmField
val SPELL_TAG = itemNameBlockItem("spell_tag", CobblemonBlocks.SPELL_TAG)
@JvmField
val SMOKE_BALL = heldItem("smoke_ball")
val SMOKE_BALL = itemNameBlockItem("smoke_ball", CobblemonBlocks.SMOKE_BALL)
@JvmField
val SOOTHE_BELL = heldItem("soothe_bell")
@JvmField
val STEELIXITE = heldItem("steelixite")
@JvmField
val STICKY_BARB = heldItem("sticky_barb")
@JvmField
val SWAMPERTITE = heldItem("swampertite")
@JvmField
val TERRAIN_EXTENDER = heldItem("terrain_extender")
@JvmField
val THROAT_SPRAY = heldItem("throat_spray")
val THROAT_SPRAY = itemNameBlockItem("throat_spray", CobblemonBlocks.THROAT_SPRAY)
@JvmField
val TOXIC_ORB = heldItem("toxic_orb")
val TOXIC_ORB = itemNameBlockItem("toxic_orb", CobblemonBlocks.TOXIC_ORB)
@JvmField
val TWISTED_SPOON = heldItem("twisted_spoon")
@JvmField
val TYRANITARITE = heldItem("tyranitarite")
@JvmField
val UTILITY_UMBRELLA = heldItem("utility_umbrella")
@JvmField
val WEAKNESS_POLICY = itemNameBlockItem("weakness_policy", CobblemonBlocks.WEAKNESS_POLICY)
@JvmField
val VENUSAURITE = heldItem("venusaurite")
val WIDE_LENS = itemNameBlockItem("wide_lens", CobblemonBlocks.WIDE_LENS)
@JvmField
val WIDE_LENS = heldItem("wide_lens")
@JvmField
val ZOOM_LENS = heldItem("zoom_lens")
val ZOOM_LENS = itemNameBlockItem("zoom_lens", CobblemonBlocks.ZOOM_LENS)
@JvmField
val MENTAL_HERB = compostableHeldItem("mental_herb", null, 0.85F)
@JvmField
@@ -1194,19 +1091,19 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
@JvmField
val WHITE_HERB = compostableHeldItem("white_herb", null, 0.85F)
@JvmField
val BRIGHT_POWDER = heldItem("bright_powder")
val BRIGHT_POWDER = itemNameBlockItem("bright_powder", CobblemonBlocks.BRIGHT_POWDER)
@JvmField
val METAL_POWDER = heldItem("metal_powder")
val METAL_POWDER = itemNameBlockItem("metal_powder", CobblemonBlocks.METAL_POWDER)
@JvmField
val QUICK_POWDER = heldItem("quick_powder")
val QUICK_POWDER = itemNameBlockItem("quick_powder", CobblemonBlocks.QUICK_POWDER)
@JvmField
val DAMP_ROCK = heldItem("damp_rock")
val DAMP_ROCK = itemNameBlockItem("damp_rock", CobblemonBlocks.DAMP_ROCK)
@JvmField
val HEAT_ROCK = heldItem("heat_rock")
val HEAT_ROCK = itemNameBlockItem("heat_rock", CobblemonBlocks.HEAT_ROCK)
@JvmField
val SMOOTH_ROCK = heldItem("smooth_rock")
val SMOOTH_ROCK = itemNameBlockItem("smooth_rock", CobblemonBlocks.SMOOTH_ROCK)
@JvmField
val ICY_ROCK = heldItem("icy_rock")
val ICY_ROCK = itemNameBlockItem("icy_rock", CobblemonBlocks.ICY_ROCK)
// Mulch
@JvmField
@@ -1697,7 +1594,16 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
private fun wearableItem(name: String, heldItemRemappedName: String? = null): CobblemonItem = create(
name,
WearableItem(name).also {
WearableHatItem(name).also {
wearables.add(it)
if (heldItemRemappedName != null) {
CobblemonHeldItemManager.registerRemap(it, heldItemRemappedName)
}
}
)
private fun wearableBlockItem(name: String, block: Block, heldItemRemappedName: String? = null): WearableBlockItem = create(
name,
WearableBlockItem(name, block).also {
wearables.add(it)
if (heldItemRemappedName != null) {
CobblemonHeldItemManager.registerRemap(it, heldItemRemappedName)
@@ -1854,4 +1760,4 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
private fun foodItem(nutrition: Int, saturationModifier: Float): Item {
return CobblemonItem(Item.Properties().food(FoodProperties.Builder().nutrition(nutrition).saturationModifier(saturationModifier).build()))
}
}
}
@@ -114,7 +114,6 @@ import com.cobblemon.mod.common.net.messages.client.settings.OpenCobblemonConfig
import com.cobblemon.mod.common.net.messages.client.settings.ServerSettingsPacket
import com.cobblemon.mod.common.net.messages.client.sound.UnvalidatedPlaySoundS2CPacket
import com.cobblemon.mod.common.net.messages.client.spawn.SpawnGenericBedrockPacket
import com.cobblemon.mod.common.net.messages.client.spawn.SpawnFallingStarPacket
import com.cobblemon.mod.common.net.messages.client.spawn.SpawnNPCPacket
import com.cobblemon.mod.common.net.messages.client.spawn.SpawnPokeballPacket
import com.cobblemon.mod.common.net.messages.client.spawn.SpawnPokemonPacket
@@ -465,7 +464,6 @@ object CobblemonNetwork {
list.add(PacketRegisterInfo(SpawnPokemonPacket.ID, SpawnPokemonPacket::decode, SpawnExtraDataEntityHandler()))
list.add(PacketRegisterInfo(SpawnPokeballPacket.ID, SpawnPokeballPacket::decode, SpawnExtraDataEntityHandler()))
list.add(PacketRegisterInfo(SpawnGenericBedrockPacket.ID, SpawnGenericBedrockPacket::decode, SpawnExtraDataEntityHandler()))
list.add(PacketRegisterInfo(SpawnFallingStarPacket.ID, SpawnFallingStarPacket::decode, SpawnExtraDataEntityHandler()))
list.add(PacketRegisterInfo(SpawnNPCPacket.ID, SpawnNPCPacket::decode, SpawnExtraDataEntityHandler()))
list.add(PacketRegisterInfo(ToastPacket.ID, ToastPacket::decode, ToastPacketHandler))
@@ -9,7 +9,6 @@
package com.cobblemon.mod.common.api.item
import com.cobblemon.mod.common.api.data.DataRegistry
import com.cobblemon.mod.common.api.data.ShowdownIdentifiable
import com.cobblemon.mod.common.api.reactive.SimpleObservable
import com.cobblemon.mod.common.battles.runner.ShowdownService
import com.cobblemon.mod.common.pokemon.helditem.CobblemonHeldItemManager
@@ -30,11 +29,9 @@ object HeldItems : DataRegistry {
// val heldItems = PrioritizedList<BagItemLike>()
internal val heldItemsScripts = mutableMapOf<String, String>() // showdown item ID to JavaScript
val showdownItems = hashSetOf<String>()
val megaStones = hashMapOf<String, String>()
override fun reload(manager: ResourceManager) {
heldItemsScripts.clear()
megaStones.clear()
ShowdownService.service.resetRegistryData("heldItem")
manager.listResources("held_items") { it.path.endsWith(".js") }.forEach { (identifier, resource) ->
resource.open().use { stream ->
@@ -51,9 +48,6 @@ object HeldItems : DataRegistry {
for (i in 0 until itemsJson.size()) {
val jsItem = itemsJson[i].asJsonObject
showdownItems += jsItem.get("id").asString
if (jsItem.has("megaEvolves")) {
megaStones[jsItem.get("id").asString] = ShowdownIdentifiable.REGEX.replace(jsItem.get("megaEvolves").asString.lowercase(), "")
}
}
CobblemonHeldItemManager.load()
@@ -22,8 +22,8 @@ object EvolutionMoLangFunctions : AbstractMoLangFunctionHolder<Transformation>()
val evolution = this
val functions = hashMapOf<String, (MoParams) -> Any>()
functions["reevaluate"] = { DoubleValue(evolution.reevaluate) }
functions["is_optional"] = { DoubleValue(evolution.optional) }
functions["reevaluate"] = { DoubleValue(evolution.reevaluate) }
if (evolution is Evolution) {
functions["result"] = { evolution.result.asMoLangValue() }
@@ -55,6 +55,11 @@ object GeneralMoLangFunctions {
struct.map.remove(variable)
DoubleValue.ONE
}
functions["delete_variables"] = { params ->
val struct = params.get<VariableStruct>(0)
struct.map.clear()
DoubleValue.ONE
}
functions["get_variable"] = { params ->
val struct = params.get<VariableStruct>(0)
val variable = params.getString(1)
@@ -67,10 +67,6 @@ object CobblemonPermissions {
val SPAWN_POKEMON = this.create("${COMMAND_PREFIX}spawnpokemon", PermissionLevel.CHEAT_COMMANDS_AND_COMMAND_BLOCKS)
@JvmStatic
val SPAWN_NPC = this.create("${COMMAND_PREFIX}spawnnpc", PermissionLevel.CHEAT_COMMANDS_AND_COMMAND_BLOCKS)
@JvmStatic
val SPAWN_METEOR = this.create("${COMMAND_PREFIX}spawnmeteor", PermissionLevel.CHEAT_COMMANDS_AND_COMMAND_BLOCKS)
@JvmStatic
val SET_MEGA_BOND = this.create("${COMMAND_PREFIX}setmegabond", PermissionLevel.CHEAT_COMMANDS_AND_COMMAND_BLOCKS)
@JvmStatic
@@ -6,10 +6,8 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.entity.projectile
package com.cobblemon.mod.common.api.pokemon.transformation.trigger
enum class FallingStarResultType {
MINIOR,
ITEM,
POKEMON
}
object NoTrigger : TransformationTrigger {
override fun testTrigger(context: ContextTrigger.Context?) = false
}
@@ -19,7 +19,6 @@ import com.cobblemon.mod.common.api.spawning.condition.SpawningCondition
import com.cobblemon.mod.common.api.spawning.condition.SubmergedSpawningCondition
import com.cobblemon.mod.common.api.spawning.condition.SurfaceSpawningCondition
import com.cobblemon.mod.common.api.spawning.detail.EmptySpawnDetail
import com.cobblemon.mod.common.api.spawning.detail.FallingStarSpawnDetail
import com.cobblemon.mod.common.api.spawning.detail.NPCSpawnDetail
import com.cobblemon.mod.common.api.spawning.detail.PokemonHerdSpawnDetail
import com.cobblemon.mod.common.api.spawning.detail.PokemonSpawnDetail
@@ -123,7 +122,6 @@ object BestSpawner {
SpawnDetail.registerSpawnType(name = NPCSpawnDetail.TYPE, NPCSpawnDetail::class.java)
SpawnDetail.registerSpawnType(name = PokemonHerdSpawnDetail.TYPE, PokemonHerdSpawnDetail::class.java)
SpawnDetail.registerSpawnType(name = EmptySpawnDetail.TYPE, EmptySpawnDetail::class.java)
SpawnDetail.registerSpawnType(name = FallingStarSpawnDetail.TYPE, FallingStarSpawnDetail::class.java)
LOGGER.info("Loaded ${SpawnDetail.spawnDetailTypes.size} spawn detail types.")
loadConfig()
@@ -1,47 +0,0 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.spawning.detail
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.CobblemonEntities
import com.cobblemon.mod.common.api.spawning.position.SpawnablePosition
import com.cobblemon.mod.common.entity.projectile.FallingStarEntity
import kotlin.math.min
import kotlin.random.Random
import net.minecraft.world.phys.Vec3
class FallingStarSpawnAction(
spawnablePosition: SpawnablePosition,
bucket: String,
override val detail: FallingStarSpawnDetail
) : SpawnAction<EntitySpawnResult>(spawnablePosition, bucket, detail) {
override fun run(): EntitySpawnResult {
Cobblemon.LOGGER.info("Falling towards ${spawnablePosition.position}")
val world = spawnablePosition.world
val fallingStar = FallingStarEntity(CobblemonEntities.FALLING_STAR, world)
fallingStar.resultType = detail.resultType
val spawnPos = spawnablePosition.position
fallingStar.horizontalDirection = Random.nextDouble(2 * Math.PI).toFloat()
val skyHeight = min(spawnPos.y + 64, world.maxBuildHeight - 10).toDouble()
val fallDistance = skyHeight - spawnPos.y
val ticksToFall = kotlin.math.sqrt(fallDistance / 0.015)
val horizontalDistance = ticksToFall * 0.8
val offsetX = -kotlin.math.sin(fallingStar.horizontalDirection) * horizontalDistance
val offsetZ = -kotlin.math.cos(fallingStar.horizontalDirection) * horizontalDistance
val skyPos = Vec3(spawnPos.x + 0.5 + offsetX, skyHeight, spawnPos.z + 0.5 + offsetZ)
fallingStar.setPos(skyPos)
world.addFreshEntity(fallingStar)
return EntitySpawnResult(listOf(fallingStar))
}
}
@@ -1,28 +0,0 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.api.spawning.detail
import com.cobblemon.mod.common.api.spawning.position.SpawnablePosition
import com.cobblemon.mod.common.api.spawning.selection.SpawnSelectionData
import com.cobblemon.mod.common.entity.projectile.FallingStarResultType
class FallingStarSpawnDetail : SpawnDetail() {
companion object {
const val TYPE = "falling_star"
}
override val type = TYPE
var resultType: FallingStarResultType = FallingStarResultType.MINIOR
override fun createSpawnAction(
spawnablePosition: SpawnablePosition,
bucket: String,
selectionData: SpawnSelectionData
) = FallingStarSpawnAction(spawnablePosition, bucket, this)
}
@@ -161,7 +161,7 @@ open class PlayerPartyStore(
} else {
form.performRevert(
pokemonEntity = entity,
context =ActionEffectContext.fromPokemonEntity(
context = ActionEffectContext.fromPokemonEntity(
actionEffect = form.revertActionEffect,
pokemonEntity = entity
)
@@ -17,8 +17,6 @@ import com.cobblemon.mod.common.util.*
import com.google.gson.*
import com.google.gson.reflect.TypeToken
import net.minecraft.network.RegistryFriendlyByteBuf
import net.minecraft.world.entity.EquipmentSlot
import net.minecraft.world.item.Items
import java.lang.Integer.max
import java.lang.reflect.Type
import java.util.*
@@ -82,8 +80,7 @@ class ShowdownActionRequest(
ShowdownMoveset.Gimmick.TERASTALLIZATION -> cobblemonResource("tera_orb")
else -> cobblemonResource("z_ring")
}
// lets do something silly like an iron helmet for now in place of a keystone TODO change this later lol
if (!player.hasKeyItem(triggerItem) && !player.getItemBySlot(EquipmentSlot.HEAD).`is`(Items.IRON_HELMET)) moveset.blockGimmick(gimmick)
if (!player.hasKeyItem(triggerItem)) moveset.blockGimmick(gimmick)
}
}
}
@@ -103,7 +103,7 @@ class FormChangeInstruction(val message: BattleMessage): ActionEffectInstruction
val lang = when (formId) {
"busted", "hero", "complete" -> return@dispatchWaiting
"school", "wishiwashi", "meteor", "minior" -> battleLang("formechange.$formId", pokemonName)
speciesName -> battleLang("formechange.default.temporary.end", pokemonName)
speciesName -> battleLang("formechange.default.temporary.ended", pokemonName)
else -> battleLang("formechange.default.$typeKey", pokemonName, formId)
}
battle.sendSidedUpdate(
@@ -0,0 +1,137 @@
/*
* 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.block.decor
import com.cobblemon.mod.common.util.rotateShape
import com.mojang.serialization.MapCodec
import com.mojang.serialization.codecs.RecordCodecBuilder
import net.minecraft.core.BlockPos
import net.minecraft.core.Direction
import net.minecraft.util.StringRepresentable
import net.minecraft.world.InteractionResult
import net.minecraft.world.entity.player.Player
import net.minecraft.world.item.context.BlockPlaceContext
import net.minecraft.world.level.BlockGetter
import net.minecraft.world.level.Level
import net.minecraft.world.level.LevelAccessor
import net.minecraft.world.level.block.*
import net.minecraft.world.level.block.state.BlockState
import net.minecraft.world.level.block.state.StateDefinition
import net.minecraft.world.level.block.state.properties.BlockStateProperties.HORIZONTAL_FACING
import net.minecraft.world.level.block.state.properties.BlockStateProperties.WATERLOGGED
import net.minecraft.world.level.block.state.properties.BooleanProperty
import net.minecraft.world.level.gameevent.GameEvent
import net.minecraft.world.level.material.FluidState
import net.minecraft.world.level.material.Fluids
import net.minecraft.world.phys.BlockHitResult
import net.minecraft.world.phys.shapes.CollisionContext
import net.minecraft.world.phys.shapes.Shapes
import net.minecraft.world.phys.shapes.VoxelShape
class ActivatableDecorationBlock(settings: Properties, val type: ActivatableDecorationBlockType) : HorizontalDirectionalBlock(settings), SimpleWaterloggedBlock {
enum class ActivatableDecorationBlockType: StringRepresentable {
//For basic use, also ignore camelcase errors, it's just dumb
CENTERED_8x,
//For specific items
METRONOME;
override fun getSerializedName(): String = this.name.lowercase()
companion object {
val CODEC = StringRepresentable.fromEnum(::values)
}
}
companion object {
val CODEC: MapCodec<ActivatableDecorationBlock> = RecordCodecBuilder.mapCodec { it.group(
propertiesCodec(),
ActivatableDecorationBlockType.CODEC.fieldOf("type").forGetter(ActivatableDecorationBlock::type)
).apply(it, ::ActivatableDecorationBlock) }
val ACTIVE = BooleanProperty.create("active")
val CENTERED_8x = Shapes.box(0.25, 0.0, 0.25, 0.75, 0.5, 0.75)
val METRONOME_HITBOX = Shapes.box(0.25, 0.0, 0.375, 0.75, 0.8125, 0.75)
fun getShape(type: ActivatableDecorationBlockType): VoxelShape {
return when (type) {
ActivatableDecorationBlockType.METRONOME -> METRONOME_HITBOX
else -> CENTERED_8x
}
}
}
init {
registerDefaultState(stateDefinition.any()
.setValue(HORIZONTAL_FACING, Direction.NORTH)
.setValue(ACTIVE, false)
.setValue(WATERLOGGED, false)
)
}
override fun codec(): MapCodec<ActivatableDecorationBlock> = CODEC
override fun createBlockStateDefinition(builder: StateDefinition.Builder<Block, BlockState>) {
builder.add(HORIZONTAL_FACING, ACTIVE, WATERLOGGED)
}
override fun getFluidState(blockState: BlockState): FluidState? = if (blockState.getValue(WATERLOGGED)) Fluids.WATER.getSource(false) else super.getFluidState(blockState)
override fun updateShape(state: BlockState, direction: Direction, neighborState: BlockState, world: LevelAccessor, pos: BlockPos, neighborPos: BlockPos): BlockState {
if (state.getValue(WATERLOGGED)) {
world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world))
}
return if (state.getValue(HORIZONTAL_FACING).opposite == direction && !state.canSurvive(world, pos)) Blocks.AIR.defaultBlockState()
else super.updateShape(state, direction, neighborState, world, pos, neighborPos)
}
override fun getCollisionShape(state: BlockState, level: BlockGetter, pos: BlockPos, context: CollisionContext): VoxelShape {
val direction = state.getValue(HORIZONTAL_FACING)
return rotateShape(Direction.NORTH, direction, getShape(type))
}
override fun getShape(state: BlockState, level: BlockGetter, pos: BlockPos, context: CollisionContext): VoxelShape {
return getCollisionShape(state, level, pos, context).singleEncompassing()
}
override fun getStateForPlacement(context: BlockPlaceContext): BlockState? {
val fluidState = context.level.getFluidState(context.clickedPos)
return super.getStateForPlacement(context)?.setValue(HORIZONTAL_FACING, context.horizontalDirection.opposite)?.setValue(WATERLOGGED, fluidState.type === Fluids.WATER)
}
override fun useWithoutItem(
state: BlockState,
level: Level,
pos: BlockPos,
player: Player,
hitResult: BlockHitResult
): InteractionResult {
if (level.isClientSide) {
level.setBlockAndUpdate(pos, state.cycle(ACTIVE))
return InteractionResult.SUCCESS
} else {
this.push(state, level, pos, null as Player?)
return InteractionResult.CONSUME
}
}
fun push(state: BlockState, level: Level, pos: BlockPos?, player: Player?) {
var state = state
state = state.cycle(ACTIVE)
level.setBlock(pos!!, state, 3)
level.gameEvent(player, if (state.getValue(ACTIVE)) GameEvent.BLOCK_ACTIVATE else GameEvent.BLOCK_DEACTIVATE, pos)
}
override fun hasAnalogOutputSignal(state: BlockState): Boolean {
return true
}
//TODO: Replace this forced 4 with a value that can be set by the block, only relevant when more blocks of this class are added.
override fun getAnalogOutputSignal(state: BlockState, level: Level, pos: BlockPos): Int {
return if (level.getBlockState(pos).getValue(ACTIVE) as Boolean) 4 else 0
}
}
@@ -0,0 +1,130 @@
/*
* 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.block
import com.cobblemon.mod.common.util.rotateShape
import com.mojang.serialization.MapCodec
import com.mojang.serialization.codecs.RecordCodecBuilder
import net.minecraft.core.BlockPos
import net.minecraft.core.Direction
import net.minecraft.util.StringRepresentable
import net.minecraft.world.item.context.BlockPlaceContext
import net.minecraft.world.level.BlockGetter
import net.minecraft.world.level.LevelAccessor
import net.minecraft.world.level.block.Block
import net.minecraft.world.level.block.Blocks
import net.minecraft.world.level.block.HorizontalDirectionalBlock
import net.minecraft.world.level.block.SimpleWaterloggedBlock
import net.minecraft.world.level.block.state.BlockState
import net.minecraft.world.level.block.state.StateDefinition
import net.minecraft.world.level.block.state.properties.BlockStateProperties.HORIZONTAL_FACING
import net.minecraft.world.level.block.state.properties.BlockStateProperties.WATERLOGGED
import net.minecraft.world.level.material.FluidState
import net.minecraft.world.level.material.Fluids
import net.minecraft.world.phys.shapes.CollisionContext
import net.minecraft.world.phys.shapes.Shapes
import net.minecraft.world.phys.shapes.VoxelShape
class DecorativeItemBlock(settings: Properties, val type: DecorativeItemBlockType): HorizontalDirectionalBlock(settings), SimpleWaterloggedBlock {
enum class DecorativeItemBlockType: StringRepresentable {
//For basic use, also ignore camelcase errors, it's just dumb
CENTERED_8x,
CENTERED_6x,
FLATTENED_8x6,
FLATTENED_8x4,
FLATTENED_10x4,
//For specific items
TEACUP,
TEAPOT,
KNOT,
POUCH,
NEVERMELT,
SCOPE,
WIDE,
ZOOM;
override fun getSerializedName(): String = this.name.lowercase()
companion object {
val CODEC = StringRepresentable.fromEnum(::values)
}
}
companion object {
val CODEC: MapCodec<DecorativeItemBlock> = RecordCodecBuilder.mapCodec { it.group(
propertiesCodec(),
DecorativeItemBlockType.CODEC.fieldOf("type").forGetter(DecorativeItemBlock::type)
).apply(it, ::DecorativeItemBlock) }
val CENTERED_8x = Shapes.box(0.25, 0.0, 0.25, 0.75, 0.5, 0.75)
val CENTERED_6x = Shapes.box(0.3125, 0.0, 0.3125, 0.6875, 0.375, 0.6875)
val FLAT6_HITBOX = Shapes.box(0.25, 0.0, 0.25, 0.75, 0.375, 0.75)
val FLAT4_HITBOX = Shapes.box(0.25, 0.0, 0.25, 0.75, 0.25, 0.75)
val SMOOSHED4_HITBOX = Shapes.box(0.1875, 0.0, 0.1875, 0.8125, 0.25, 0.8125)
val TEACUP_HITBOX = Shapes.box(0.3125, 0.0, 0.3125, 0.6875, 0.25, 0.6875)
val TEAPOT_HITBOX = Shapes.box(0.1875, 0.0, 0.1875, 0.8125, 0.625, 0.8125)
val KNOT_HITBOX = Shapes.box(0.375, 0.0, 0.375, 0.75, 0.375, 0.75)
val POUCH_HITBOX = Shapes.box(0.3125, 0.0, 0.3125, 0.6875, 0.3125, 0.6875)
val NEVERMELT_HITBOX = Shapes.box(0.25, 0.0, 0.3125, 0.6875, 0.25, 0.75)
val SCOPE_HITBOX = Shapes.box(0.625, 0.0, 0.4375, 0.9375, 0.125, 0.75)
val WIDE_HITBOX = Shapes.box(0.625, 0.0, 0.125, 0.9375, 0.0625, 0.625)
val ZOOM_HITBOX = Shapes.box(0.125, 0.0, 0.1875, 0.375, 0.1875, 0.5)
fun getShape(type: DecorativeItemBlockType): VoxelShape {
return when (type) {
DecorativeItemBlockType.TEAPOT -> TEAPOT_HITBOX
DecorativeItemBlockType.TEACUP -> TEACUP_HITBOX
DecorativeItemBlockType.KNOT -> KNOT_HITBOX
DecorativeItemBlockType.POUCH -> POUCH_HITBOX
DecorativeItemBlockType.NEVERMELT -> NEVERMELT_HITBOX
DecorativeItemBlockType.SCOPE -> SCOPE_HITBOX
DecorativeItemBlockType.WIDE -> WIDE_HITBOX
DecorativeItemBlockType.ZOOM -> ZOOM_HITBOX
DecorativeItemBlockType.FLATTENED_10x4 -> SMOOSHED4_HITBOX
DecorativeItemBlockType.FLATTENED_8x4 -> FLAT4_HITBOX
DecorativeItemBlockType.FLATTENED_8x6 -> FLAT6_HITBOX
DecorativeItemBlockType.CENTERED_6x -> CENTERED_6x
else -> CENTERED_8x
}
}
}
init {
registerDefaultState(stateDefinition.any()
.setValue(HORIZONTAL_FACING, Direction.NORTH)
.setValue(WATERLOGGED, false))
}
override fun codec(): MapCodec<DecorativeItemBlock> = CODEC
override fun createBlockStateDefinition(builder: StateDefinition.Builder<Block, BlockState>) {
builder.add(HORIZONTAL_FACING, WATERLOGGED)
}
override fun getFluidState(blockState: BlockState): FluidState? = if (blockState.getValue(WATERLOGGED)) Fluids.WATER.getSource(false) else super.getFluidState(blockState)
override fun updateShape(state: BlockState, direction: Direction, neighborState: BlockState, world: LevelAccessor, pos: BlockPos, neighborPos: BlockPos): BlockState {
if (state.getValue(WATERLOGGED)) {
world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world))
}
return if (state.getValue(HORIZONTAL_FACING).opposite == direction && !state.canSurvive(world, pos)) Blocks.AIR.defaultBlockState()
else super.updateShape(state, direction, neighborState, world, pos, neighborPos)
}
override fun getShape(state: BlockState, level: BlockGetter, pos: BlockPos, context: CollisionContext): VoxelShape {
val direction = state.getValue(HORIZONTAL_FACING)
return rotateShape(Direction.NORTH, direction, getShape(type))
}
override fun getStateForPlacement(context: BlockPlaceContext): BlockState? {
val fluidState = context.level.getFluidState(context.clickedPos)
return super.getStateForPlacement(context)?.setValue(HORIZONTAL_FACING, context.horizontalDirection.opposite)?.setValue(WATERLOGGED, fluidState.type === Fluids.WATER)
}
}
@@ -0,0 +1,139 @@
/*
* 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.block
import com.cobblemon.mod.common.util.rotateShape
import net.minecraft.core.BlockPos
import net.minecraft.core.Direction
import net.minecraft.world.item.context.BlockPlaceContext
import net.minecraft.world.level.BlockGetter
import net.minecraft.world.level.LevelAccessor
import net.minecraft.world.level.LevelReader
import net.minecraft.world.level.block.Block
import net.minecraft.world.level.block.Blocks
import net.minecraft.world.level.block.ButtonBlock
import net.minecraft.world.level.block.SimpleWaterloggedBlock
import net.minecraft.world.level.block.state.BlockState
import net.minecraft.world.level.block.state.StateDefinition
import net.minecraft.world.level.block.state.properties.AttachFace
import net.minecraft.world.level.block.state.properties.BlockSetType
import net.minecraft.world.level.block.state.properties.BlockStateProperties.WATERLOGGED
import net.minecraft.world.level.material.FluidState
import net.minecraft.world.level.material.Fluids
import net.minecraft.world.phys.shapes.CollisionContext
import net.minecraft.world.phys.shapes.Shapes
import net.minecraft.world.phys.shapes.VoxelShape
class EjectButtonBlock(properties: Properties, ticksToStayPressed: Int) : ButtonBlock(BlockSetType.IRON, ticksToStayPressed, properties), SimpleWaterloggedBlock {
companion object {
val FLOOR_UNPOWERED = Shapes.or(
Shapes.box(0.125, 0.0, 0.125, 0.875, 0.1875, 0.875),
Shapes.box(0.375, 0.1875, 0.375, 0.625, 0.3125, 0.625) )
val FLOOR_POWERED = Shapes.or(
Shapes.box(0.125, 0.0, 0.125, 0.875, 0.1875, 0.875),
Shapes.box(0.375, 0.1875, 0.375, 0.625, 0.25, 0.625) )
val FLOOR_PANEL = Shapes.box(0.125, 0.0, 0.125, 0.875, 0.1875, 0.875)
val CEILING_UNPOWERED = Shapes.or(
Shapes.box(0.125, 0.8125, 0.125, 0.875, 1.0, 0.875),
Shapes.box(0.375, 0.6875, 0.375, 0.625, 0.8125, 0.625) )
val CEILING_POWERED = Shapes.or(
Shapes.box(0.125, 0.8125, 0.125, 0.875, 1.0, 0.875),
Shapes.box(0.375, 0.75, 0.375, 0.625, 0.8125, 0.625) )
val CEILING_PANEL = Shapes.box(0.125, 0.8125, 0.125, 0.875, 1.0, 0.875)
val WALL_UNPOWERED = Shapes.or(
Shapes.box(0.125, 0.125, 0.8125, 0.875, 0.875, 1.0),
Shapes.box(0.375, 0.375, 0.6875, 0.625, 0.625, 0.8125) )
val WALL_POWERED = Shapes.or(
Shapes.box(0.125, 0.125, 0.8125, 0.875, 0.875, 1.0),
Shapes.box(0.375, 0.375, 0.75, 0.625, 0.625, 0.8125) )
val WALL_PANEL = Shapes.box(0.125, 0.125, 0.8125, 0.875, 0.875, 1.0)
}
init {
registerDefaultState(stateDefinition.any()
.setValue(FACING, Direction.NORTH)
.setValue(FACE, AttachFace.WALL)
.setValue(POWERED, false)
.setValue(WATERLOGGED, false)
)
}
override fun createBlockStateDefinition(builder: StateDefinition.Builder<Block, BlockState>) {
builder.add(FACING, FACE, POWERED, WATERLOGGED)
}
override fun getFluidState(blockState: BlockState): FluidState? {
return if (blockState.getValue(WATERLOGGED)) Fluids.WATER.getSource(false) else super.getFluidState(blockState);
}
override fun getStateForPlacement(context: BlockPlaceContext): BlockState? {
val fluidState = context.level.getFluidState(context.clickedPos)
for (direction in context.nearestLookingDirections) {
val blockState: BlockState
if (direction.getAxis() === Direction.Axis.Y) {
blockState = (defaultBlockState()
.setValue(FACE, if (direction == Direction.UP) AttachFace.CEILING else AttachFace.FLOOR) as BlockState)
.setValue(FACING, context.horizontalDirection.opposite)
.setValue(WATERLOGGED, fluidState.type === Fluids.WATER
) as BlockState
} else {
blockState = (defaultBlockState()
.setValue(FACE, AttachFace.WALL) as BlockState)
.setValue(FACING, direction.opposite)
.setValue(WATERLOGGED, fluidState.type === Fluids.WATER
) as BlockState
}
if (blockState.canSurvive(context.getLevel(), context.getClickedPos())) {
return blockState
}
}
return null
}
override fun getShape(state: BlockState, blockGetter: BlockGetter, pos: BlockPos, collisionContext: CollisionContext): VoxelShape {
val direction = state.getValue(FACING)
return when (state.getValue(FACE)) {
AttachFace.FLOOR -> if (state.getValue(POWERED)) {FLOOR_POWERED} else {FLOOR_UNPOWERED}
AttachFace.WALL ->
when (direction) {
Direction.NORTH, Direction.UP, Direction.DOWN -> if (state.getValue(POWERED)) {WALL_POWERED} else {WALL_UNPOWERED}
else -> rotateShape(Direction.NORTH, direction, if (state.getValue(POWERED)) {WALL_POWERED} else {WALL_UNPOWERED})
}
AttachFace.CEILING -> if (state.getValue(POWERED)) {CEILING_POWERED} else {CEILING_UNPOWERED}
}
}
override fun getCollisionShape(state: BlockState, level: BlockGetter, pos: BlockPos, context: CollisionContext): VoxelShape {
val direction = state.getValue(FACING)
return when (state.getValue(FACE)) {
AttachFace.FLOOR -> FLOOR_PANEL
AttachFace.WALL -> when (direction) {
Direction.NORTH, Direction.UP, Direction.DOWN -> WALL_PANEL
else -> rotateShape(Direction.NORTH, direction, WALL_PANEL)
}
AttachFace.CEILING -> CEILING_PANEL
}
}
override fun updateShape(state: BlockState, direction: Direction, neighborState: BlockState, world: LevelAccessor, pos: BlockPos, neighborPos: BlockPos): BlockState {
if (state.getValue(WATERLOGGED)) {
world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world))
}
return if (getConnectedDirection(state).opposite == direction && !state.canSurvive(world, pos)) Blocks.AIR.defaultBlockState()
else super.updateShape(state, direction, neighborState, world, pos, neighborPos)
}
override fun canSurvive(state: BlockState, level: LevelReader, pos: BlockPos): Boolean {
return if (state.getValue(FACE) != AttachFace.WALL) {
val direction = getConnectedDirection(state)
canSupportCenter(level, pos.relative(direction.opposite), direction)
} else {
level.getBlockState(pos.relative(state.getValue(FACING).opposite)).isSolid
}
}
}
@@ -0,0 +1,63 @@
/*
* 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.block
import com.cobblemon.mod.common.util.rotateShape
import com.mojang.serialization.MapCodec
import com.mojang.serialization.codecs.RecordCodecBuilder
import net.minecraft.core.BlockPos
import net.minecraft.core.Direction
import net.minecraft.world.level.BlockGetter
import net.minecraft.world.level.block.state.BlockState
import net.minecraft.world.level.block.state.properties.AttachFace
import net.minecraft.world.level.block.state.properties.BlockStateProperties.WATERLOGGED
import net.minecraft.world.phys.shapes.CollisionContext
import net.minecraft.world.phys.shapes.Shapes
import net.minecraft.world.phys.shapes.VoxelShape
class GalaricaWreathBlock(properties: Properties) : SixFaceRotationalBlock(properties) {
companion object {
val CODEC: MapCodec<GalaricaWreathBlock> = RecordCodecBuilder.mapCodec {
it.group(propertiesCodec()).apply(it, ::GalaricaWreathBlock)
}
val FLOOR_NORTH = Shapes.box(0.125, 0.0, 0.125, 0.875, 0.25, 0.875)
val WALL_NORTH = Shapes.box(0.125, 0.125, 0.75, 0.875, 0.875, 1.0)
val CEILING_NORTH = Shapes.box(0.125, 0.125, 0.375, 0.875, 0.625, 0.5625)
}
init {
registerDefaultState(stateDefinition.any()
.setValue(FACING, Direction.NORTH)
.setValue(FACE, AttachFace.WALL)
.setValue(WATERLOGGED, false)
)
}
override fun codec(): MapCodec<GalaricaWreathBlock> = CODEC
override fun getShape(state: BlockState, blockGetter: BlockGetter, pos: BlockPos, collisionContext: CollisionContext): VoxelShape {
val direction = state.getValue(FACING)
return when (state.getValue(FACE)) {
AttachFace.FLOOR ->
if (direction.axis === Direction.Axis.X) {
rotateShape(Direction.NORTH, Direction.WEST, FLOOR_NORTH)
} else FLOOR_NORTH
AttachFace.WALL ->
when (direction) {
Direction.NORTH, Direction.UP, Direction.DOWN -> WALL_NORTH
else -> rotateShape(Direction.NORTH, direction, WALL_NORTH)
}
AttachFace.CEILING ->
if (direction.axis === Direction.Axis.X) {
rotateShape(Direction.NORTH, Direction.WEST, CEILING_NORTH)
} else CEILING_NORTH
}
}
}
@@ -0,0 +1,68 @@
/*
* 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.block
import com.cobblemon.mod.common.util.rotateShape
import com.mojang.serialization.MapCodec
import com.mojang.serialization.codecs.RecordCodecBuilder
import net.minecraft.core.BlockPos
import net.minecraft.core.Direction
import net.minecraft.world.level.BlockGetter
import net.minecraft.world.level.LevelReader
import net.minecraft.world.level.block.state.BlockState
import net.minecraft.world.level.block.state.properties.AttachFace
import net.minecraft.world.level.block.state.properties.BlockStateProperties.WATERLOGGED
import net.minecraft.world.phys.shapes.CollisionContext
import net.minecraft.world.phys.shapes.Shapes
import net.minecraft.world.phys.shapes.VoxelShape
class MagnetBlock(properties: Properties) : SixFaceRotationalBlock(properties) {
companion object {
val CODEC: MapCodec<MagnetBlock> = RecordCodecBuilder.mapCodec {
it.group(propertiesCodec()).apply(it, ::MagnetBlock)
}
val FLOOR_NORTH = Shapes.box(0.25, 0.0, 0.25, 0.75, 0.1875, 0.75)
val WALL_NORTH = Shapes.box(0.25, 0.25, 0.8125, 0.75, 0.75, 1.0)
val CEILING_NORTH = Shapes.box(0.25, 0.8125, 0.25, 0.75, 1.0, 0.75)
}
init {
registerDefaultState(stateDefinition.any()
.setValue(FACING, Direction.NORTH)
.setValue(FACE, AttachFace.WALL)
.setValue(WATERLOGGED, false)
)
}
override fun codec(): MapCodec<MagnetBlock> = CODEC
override fun getShape(state: BlockState, blockGetter: BlockGetter, pos: BlockPos, collisionContext: CollisionContext): VoxelShape {
val direction = state.getValue(FACING)
return when (state.getValue(FACE)) {
AttachFace.FLOOR ->
if (direction.axis === Direction.Axis.X) {
rotateShape(Direction.NORTH, Direction.WEST, FLOOR_NORTH)
} else FLOOR_NORTH
AttachFace.WALL ->
when (direction) {
Direction.NORTH, Direction.UP, Direction.DOWN -> WALL_NORTH
else -> rotateShape(Direction.NORTH, direction, WALL_NORTH)
}
AttachFace.CEILING ->
if (direction.axis === Direction.Axis.X) {
rotateShape(Direction.NORTH, Direction.WEST, CEILING_NORTH)
} else CEILING_NORTH
}
}
override fun canSurvive(state: BlockState, level: LevelReader, pos: BlockPos): Boolean {
return true
}
}
@@ -0,0 +1,68 @@
/*
* 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.block
import com.cobblemon.mod.common.util.rotateShape
import com.mojang.serialization.MapCodec
import com.mojang.serialization.codecs.RecordCodecBuilder
import net.minecraft.core.BlockPos
import net.minecraft.core.Direction
import net.minecraft.world.level.BlockGetter
import net.minecraft.world.level.LevelReader
import net.minecraft.world.level.block.state.BlockState
import net.minecraft.world.level.block.state.properties.AttachFace
import net.minecraft.world.level.block.state.properties.BlockStateProperties.WATERLOGGED
import net.minecraft.world.phys.shapes.CollisionContext
import net.minecraft.world.phys.shapes.Shapes
import net.minecraft.world.phys.shapes.VoxelShape
class OrbBlock(properties: Properties) : SixFaceRotationalBlock(properties) {
companion object {
val CODEC: MapCodec<OrbBlock> = RecordCodecBuilder.mapCodec {
it.group(propertiesCodec()).apply(it, ::OrbBlock)
}
val FLOOR_NORTH = Shapes.box(0.3125, 0.0, 0.3125, 0.6875, 0.375, 0.6875)
val WALL_NORTH = Shapes.box(0.3125, 0.3125, 0.625, 0.6875, 0.6875, 1.0)
val CEILING_NORTH = Shapes.box(0.3125, 0.625, 0.375, 0.6875, 1.0, 0.6875)
}
init {
registerDefaultState(stateDefinition.any()
.setValue(FACING, Direction.NORTH)
.setValue(FACE, AttachFace.WALL)
.setValue(WATERLOGGED, false)
)
}
override fun codec(): MapCodec<OrbBlock> = CODEC
override fun getShape(state: BlockState, blockGetter: BlockGetter, pos: BlockPos, collisionContext: CollisionContext): VoxelShape {
val direction = state.getValue(FACING)
return when (state.getValue(FACE)) {
AttachFace.FLOOR ->
if (direction.axis === Direction.Axis.X) {
rotateShape(Direction.NORTH, Direction.WEST, FLOOR_NORTH)
} else FLOOR_NORTH
AttachFace.WALL ->
when (direction) {
Direction.NORTH, Direction.UP, Direction.DOWN -> WALL_NORTH
else -> rotateShape(Direction.NORTH, direction, WALL_NORTH)
}
AttachFace.CEILING ->
if (direction.axis === Direction.Axis.X) {
rotateShape(Direction.NORTH, Direction.WEST, CEILING_NORTH)
} else CEILING_NORTH
}
}
override fun canSurvive(state: BlockState, level: LevelReader, pos: BlockPos): Boolean {
return true
}
}
@@ -13,25 +13,15 @@ import com.mojang.serialization.MapCodec
import com.mojang.serialization.codecs.RecordCodecBuilder
import net.minecraft.core.BlockPos
import net.minecraft.core.Direction
import net.minecraft.world.item.context.BlockPlaceContext
import net.minecraft.world.level.BlockGetter
import net.minecraft.world.level.LevelAccessor
import net.minecraft.world.level.LevelReader
import net.minecraft.world.level.block.Block
import net.minecraft.world.level.block.Blocks
import net.minecraft.world.level.block.FaceAttachedHorizontalDirectionalBlock
import net.minecraft.world.level.block.SimpleWaterloggedBlock
import net.minecraft.world.level.block.state.BlockState
import net.minecraft.world.level.block.state.StateDefinition
import net.minecraft.world.level.block.state.properties.AttachFace
import net.minecraft.world.level.block.state.properties.BlockStateProperties.WATERLOGGED
import net.minecraft.world.level.material.FluidState
import net.minecraft.world.level.material.Fluids
import net.minecraft.world.phys.shapes.CollisionContext
import net.minecraft.world.phys.shapes.Shapes
import net.minecraft.world.phys.shapes.VoxelShape
class PlaqueBlock(properties : Properties) : FaceAttachedHorizontalDirectionalBlock(properties), SimpleWaterloggedBlock {
class PlaqueBlock(properties : Properties) : SixFaceRotationalBlock(properties) {
companion object {
val CODEC: MapCodec<PlaqueBlock> = RecordCodecBuilder.mapCodec {
it.group(propertiesCodec()).apply(it, ::PlaqueBlock)
@@ -54,40 +44,6 @@ class PlaqueBlock(properties : Properties) : FaceAttachedHorizontalDirectionalBl
)
}
override fun createBlockStateDefinition(builder: StateDefinition.Builder<Block, BlockState>) {
builder.add(FACING, FACE, WATERLOGGED)
}
override fun getFluidState(blockState: BlockState): FluidState? {
return if (blockState.getValue(WATERLOGGED)) Fluids.WATER.getSource(false) else super.getFluidState(blockState);
}
override fun getStateForPlacement(context: BlockPlaceContext): BlockState? {
val fluidState = context.level.getFluidState(context.clickedPos)
for (direction in context.nearestLookingDirections) {
val blockState: BlockState
if (direction.getAxis() === Direction.Axis.Y) {
blockState = (defaultBlockState()
.setValue(FACE, if (direction == Direction.UP) AttachFace.CEILING else AttachFace.FLOOR) as BlockState)
.setValue(FACING, context.horizontalDirection.opposite)
.setValue(WATERLOGGED, fluidState.type === Fluids.WATER
) as BlockState
} else {
blockState = (defaultBlockState()
.setValue(FACE, AttachFace.WALL) as BlockState)
.setValue(FACING, direction.opposite)
.setValue(WATERLOGGED, fluidState.type === Fluids.WATER
) as BlockState
}
if (blockState.canSurvive(context.getLevel(), context.getClickedPos())) {
return blockState
}
}
return null
}
override fun codec(): MapCodec<PlaqueBlock> = CODEC
override fun getShape(state: BlockState, blockGetter: BlockGetter, pos: BlockPos, collisionContext: CollisionContext): VoxelShape {
@@ -108,21 +64,4 @@ class PlaqueBlock(properties : Properties) : FaceAttachedHorizontalDirectionalBl
} else CEILING_NORTH
}
}
override fun updateShape(state: BlockState, direction: Direction, neighborState: BlockState, world: LevelAccessor, pos: BlockPos, neighborPos: BlockPos): BlockState {
if (state.getValue(WATERLOGGED)) {
world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world))
}
return if (getConnectedDirection(state).opposite == direction && !state.canSurvive(world, pos)) Blocks.AIR.defaultBlockState()
else super.updateShape(state, direction, neighborState, world, pos, neighborPos)
}
override fun canSurvive(state: BlockState, level: LevelReader, pos: BlockPos): Boolean {
return if (state.getValue(FACE) == AttachFace.CEILING) {
val direction = getConnectedDirection(state)
canSupportCenter(level, pos.relative(direction.opposite), direction)
} else {
super.canSurvive(state, level, pos)
}
}
}
@@ -0,0 +1,116 @@
/*
* 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.block.decor
import com.mojang.serialization.MapCodec
import com.mojang.serialization.codecs.RecordCodecBuilder
import net.minecraft.core.BlockPos
import net.minecraft.core.Direction
import net.minecraft.world.item.context.BlockPlaceContext
import net.minecraft.world.level.BlockGetter
import net.minecraft.world.level.LevelAccessor
import net.minecraft.world.level.LevelReader
import net.minecraft.world.level.block.*
import net.minecraft.world.level.block.HorizontalDirectionalBlock.FACING
import net.minecraft.world.level.block.state.BlockState
import net.minecraft.world.level.block.state.StateDefinition
import net.minecraft.world.level.block.state.properties.BlockStateProperties
import net.minecraft.world.level.block.state.properties.BlockStateProperties.WATERLOGGED
import net.minecraft.world.level.block.state.properties.Property
import net.minecraft.world.level.material.FluidState
import net.minecraft.world.level.material.Fluids
import net.minecraft.world.phys.shapes.CollisionContext
import net.minecraft.world.phys.shapes.Shapes
import net.minecraft.world.phys.shapes.VoxelShape
class RingTargetBlock(settings: Properties) : TargetBlock(settings), SimpleWaterloggedBlock {
init {
registerDefaultState(stateDefinition.any()
.setValue(FACING, Direction.NORTH)
.setValue(WATERLOGGED, false)
.setValue(OUTPUT_POWER, 0))
}
override fun getStateForPlacement(ctx: BlockPlaceContext): BlockState? {
var blockState = defaultBlockState()
.setValue(WATERLOGGED, ctx.level.getFluidState(ctx.clickedPos).type == Fluids.WATER)
val worldView = ctx.level
val blockPos = ctx.clickedPos
ctx.nearestLookingDirections.forEach { direction ->
if (direction.axis.isHorizontal) {
blockState = blockState.setValue(FACING, direction.opposite) as BlockState
if (blockState.canSurvive(worldView, blockPos)) {
return blockState
}
}
}
return null
}
override fun getFluidState(blockState: BlockState): FluidState? {
return if (blockState.getValue(WATERLOGGED)) Fluids.WATER.getSource(false) else super.getFluidState(blockState)
}
override fun createBlockStateDefinition(builder: StateDefinition.Builder<Block, BlockState>) {
builder.add(FACING)
builder.add(WATERLOGGED)
builder.add(*arrayOf<Property<*>>(OUTPUT_POWER))
}
override fun getShape(
state: BlockState,
blockGetter: BlockGetter,
pos: BlockPos,
collisionContext: CollisionContext
): VoxelShape {
return when (state.getValue(FACING)) {
Direction.SOUTH -> FULL_PLANE_SOUTH
Direction.WEST -> FULL_PLANE_WEST
Direction.EAST -> FULL_PLANE_EAST
else -> FULL_PLANE_NORTH
}
}
override fun updateShape(
state: BlockState,
direction: Direction,
neighborState: BlockState,
world: LevelAccessor,
pos: BlockPos,
neighborPos: BlockPos
): BlockState {
if (state.getValue(WATERLOGGED)) {
world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world))
}
return if (direction.opposite == state.getValue(FACING) && !state.canSurvive(world, pos)) Blocks.AIR.defaultBlockState()
else super.updateShape(state, direction, neighborState, world, pos, neighborPos)
}
override fun rotate(state: BlockState, rotation: Rotation): BlockState {
return state.setValue(FACING, rotation.rotate(state.getValue(FACING)))
}
override fun canSurvive(state: BlockState, level: LevelReader, pos: BlockPos): Boolean {
return level.getBlockState(pos.relative(state.getValue(FACING).opposite)).isSolid
}
companion object {
val CODEC: MapCodec<RingTargetBlock> = RecordCodecBuilder.mapCodec {
it.group(
propertiesCodec()
).apply(it, ::RingTargetBlock) }
val OUTPUT_POWER = BlockStateProperties.POWER;
val FULL_PLANE_NORTH = Shapes.box(0.0, 0.0, 0.925, 1.0, 1.0, 1.0)
val FULL_PLANE_WEST = Shapes.box(0.925, 0.0, 0.0, 1.0, 1.0, 1.0)
val FULL_PLANE_SOUTH = Shapes.box(0.0, 0.0, 0.0, 1.0, 1.0, 0.075)
val FULL_PLANE_EAST = Shapes.box(0.0, 0.0, 0.0, 0.075, 1.0, 1.0)
}
}
@@ -0,0 +1,87 @@
/*
* 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.block
import com.mojang.serialization.MapCodec
import net.minecraft.core.BlockPos
import net.minecraft.core.Direction
import net.minecraft.world.item.context.BlockPlaceContext
import net.minecraft.world.level.LevelAccessor
import net.minecraft.world.level.LevelReader
import net.minecraft.world.level.block.Block
import net.minecraft.world.level.block.Blocks
import net.minecraft.world.level.block.FaceAttachedHorizontalDirectionalBlock
import net.minecraft.world.level.block.SimpleWaterloggedBlock
import net.minecraft.world.level.block.state.BlockState
import net.minecraft.world.level.block.state.StateDefinition
import net.minecraft.world.level.block.state.properties.AttachFace
import net.minecraft.world.level.block.state.properties.BlockStateProperties.WATERLOGGED
import net.minecraft.world.level.material.FluidState
import net.minecraft.world.level.material.Fluids
open class SixFaceRotationalBlock(properties : Properties) : FaceAttachedHorizontalDirectionalBlock(properties), SimpleWaterloggedBlock {
companion object {
val CODEC = simpleCodec(::SixFaceRotationalBlock)
}
override fun codec(): MapCodec<out SixFaceRotationalBlock> = CODEC
override fun createBlockStateDefinition(builder: StateDefinition.Builder<Block, BlockState>) {
builder.add(FACING, FACE, WATERLOGGED)
}
override fun getFluidState(blockState: BlockState): FluidState? {
return if (blockState.getValue(WATERLOGGED)) Fluids.WATER.getSource(false) else super.getFluidState(blockState);
}
override fun getStateForPlacement(context: BlockPlaceContext): BlockState? {
val fluidState = context.level.getFluidState(context.clickedPos)
for (direction in context.nearestLookingDirections) {
val blockState: BlockState
if (direction.getAxis() === Direction.Axis.Y) {
blockState = (defaultBlockState()
.setValue(FACE, if (direction == Direction.UP) AttachFace.CEILING else AttachFace.FLOOR) as BlockState)
.setValue(FACING, context.horizontalDirection.opposite)
.setValue(WATERLOGGED, fluidState.type === Fluids.WATER
) as BlockState
} else {
blockState = (defaultBlockState()
.setValue(FACE, AttachFace.WALL) as BlockState)
.setValue(FACING, direction.opposite)
.setValue(WATERLOGGED, fluidState.type === Fluids.WATER
) as BlockState
}
if (blockState.canSurvive(context.getLevel(), context.getClickedPos())) {
return blockState
}
}
return null
}
override fun updateShape(state: BlockState, direction: Direction, neighborState: BlockState, world: LevelAccessor, pos: BlockPos, neighborPos: BlockPos): BlockState {
if (state.getValue(WATERLOGGED)) {
world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world))
}
return if (getConnectedDirection(state).opposite == direction && !state.canSurvive(world, pos)) Blocks.AIR.defaultBlockState()
else super.updateShape(state, direction, neighborState, world, pos, neighborPos)
}
override fun canSurvive(state: BlockState, level: LevelReader, pos: BlockPos): Boolean {
return if (state.getValue(FACE) == AttachFace.CEILING) {
val direction = getConnectedDirection(state)
canSupportCenter(level, pos.relative(direction.opposite), direction)
} else if (state.getValue(FACE) == AttachFace.WALL) {
level.getBlockState(pos.relative(state.getValue(FACING).opposite)).isSolid
} else {
super.canSurvive(state, level, pos)
}
}
}
@@ -39,7 +39,13 @@ class StackableItemBlock(settings: Properties, val type: StackableItemBlockType)
ETHER,
MAX_POTION,
POTION,
STATUS_RESTORE;
STATUS_RESTORE,
VITAMIN,
METAL_COAT,
IRON_BALL,
THROAT_SPRAY,
UPGRADE,
DICE;
override fun getSerializedName(): String = this.name.lowercase()
@@ -57,98 +63,78 @@ class StackableItemBlock(settings: Properties, val type: StackableItemBlockType)
StackableItemBlockType.CODEC.fieldOf("type").forGetter(StackableItemBlock::type)
).apply(it, ::StackableItemBlock) }
val northShapeMap: Map<StackableItemBlockType, List<VoxelShape>> = mapOf(
StackableItemBlockType.BATTLE_ITEM to listOf(
Shapes.box(0.34375, 0.0, 0.34375, 0.65625, 0.4375, 0.65625),
Shapes.or(
Shapes.box(0.09375, 0.0, 0.34375, 0.40625, 0.4375, 0.65625),
Shapes.box(0.59375, 0.0, 0.40625, 0.90625, 0.4375, 0.71875)
val northShapeMap: Map<StackableItemBlockType, List<VoxelShape>>
get() = mapOf(
StackableItemBlockType.BATTLE_ITEM to listOf(
Shapes.box(0.34375, 0.0, 0.34375, 0.65625, 0.4375, 0.65625),
Shapes.box(0.09375, 0.0, 0.34375, 0.90625, 0.4375, 0.71875),
Shapes.box(0.09375, 0.0, 0.09375, 0.90625, 0.4375, 0.90625),
Shapes.box(0.09375, 0.0, 0.09375, 0.96875, 0.4375, 0.90625)
),
Shapes.or(
Shapes.box(0.59375, 0.0, 0.59375, 0.90625, 0.4375, 0.90625),
Shapes.box(0.09375, 0.0, 0.53125, 0.40625, 0.4375, 0.84375),
Shapes.box(0.34375, 0.0, 0.09375, 0.65625, 0.4375, 0.40625)
StackableItemBlockType.ETHER to listOf(
Shapes.box(0.375, 0.0, 0.3125, 0.625, 0.5, 0.6875),
Shapes.box(0.125, 0.0, 0.3125, 0.875, 0.5, 0.75),
Shapes.box(0.125, 0.0, 0.125, 0.875, 0.5, 1.0),
Shapes.box(0.125, 0.0, 0.0625, 0.9375, 0.5, 1.0)
),
Shapes.or(
Shapes.box(0.09375, 0.0, 0.09375, 0.40625, 0.4375, 0.40625),
Shapes.box(0.59375, 0.0, 0.15625, 0.90625, 0.4375, 0.46875),
Shapes.box(0.65625, 0.0, 0.59375, 0.96875, 0.4375, 0.90625),
Shapes.box(0.15625, 0.0, 0.53125, 0.46875, 0.4375, 0.84375)
)
),
StackableItemBlockType.ETHER to listOf(
Shapes.box(0.375, 0.0, 0.3125, 0.625, 0.5, 0.6875),
Shapes.or(
Shapes.box(0.625, 0.0, 0.375, 0.875, 0.5, 0.75),
Shapes.box(0.125, 0.0, 0.3125, 0.375, 0.5, 0.6875)
StackableItemBlockType.MAX_POTION to listOf(
Shapes.box(0.34375, 0.0, 0.3125, 0.65625, 0.5, 0.6875),
Shapes.box(0.09375, 0.0, 0.3125, 0.90625, 0.5, 0.75),
Shapes.box(0.09375, 0.0, 0.0625, 0.90625, 0.5, 1.0),
Shapes.box(0.09375, 0.0, 0.0625, 0.96875, 0.5, 1.0)
),
Shapes.or(
Shapes.box(0.375, 0.0, 0.125, 0.625, 0.5, 0.5),
Shapes.box(0.125, 0.0, 0.5625, 0.375, 0.5, 0.9375),
Shapes.box(0.625, 0.0, 0.625, 0.875, 0.5, 1.0)
StackableItemBlockType.POTION to listOf(
Shapes.box(0.375, 0.0, 0.3125, 0.625, 0.5625, 0.75),
Shapes.box(0.125, 0.0, 0.3125, 0.875, 0.5625, 0.8125),
Shapes.box(0.125, 0.0, 0.0625, 0.875, 0.5625, 1.0),
Shapes.box(0.125, 0.0, 0.0, 0.9375, 0.5625, 1.0)
),
Shapes.or(
Shapes.box(0.125, 0.0, 0.0625, 0.375, 0.5, 0.4375),
Shapes.box(0.625, 0.0, 0.125, 0.875, 0.5, 0.5),
Shapes.box(0.6875, 0.0, 0.625, 0.9375, 0.5, 1.0),
Shapes.box(0.1875, 0.0, 0.5625, 0.4375, 0.5, 0.9375)
)
),
StackableItemBlockType.MAX_POTION to listOf(
Shapes.box(0.34375, 0.0, 0.3125, 0.65625, 0.5, 0.6875),
Shapes.or(
Shapes.box(0.09375, 0.0, 0.3125, 0.40625, 0.5, 0.6875),
Shapes.box(0.59375, 0.0, 0.375, 0.90625, 0.5, 0.75)
StackableItemBlockType.STATUS_RESTORE to listOf(
Shapes.box(0.375, 0.0, 0.3125, 0.625, 0.4375, 0.6875),
Shapes.box(0.125, 0.0, 0.3125, 0.875, 0.4375, 0.75),
Shapes.box(0.125, 0.0, 0.0625, 0.875, 0.4375, 0.9375),
Shapes.box(0.125, 0.0, 0.0, 0.9375, 0.4375, 0.9375)
),
Shapes.or(
Shapes.box(0.34375, 0.0, 0.0625, 0.65625, 0.5, 0.4375),
Shapes.box(0.09375, 0.0, 0.5625, 0.40625, 0.5, 0.9375),
Shapes.box(0.59375, 0.0, 0.625, 0.90625, 0.5, 1.0)
StackableItemBlockType.METAL_COAT to listOf(
Shapes.box(0.3125, 0.0, 0.3125, 0.6875, 0.375, 0.6875),
Shapes.box(0.125, 0.0, 0.125, 0.875, 0.375, 0.875),
Shapes.box(0.125, 0.0, 0.0625, 0.9375, 0.375, 0.875),
Shapes.box(0.0625, 0.0, 0.0625, 0.9375, 0.375, 0.9375)
),
Shapes.or(
Shapes.box(0.09375, 0.0, 0.0625, 0.40625, 0.5, 0.4375),
Shapes.box(0.15625, 0.0, 0.5625, 0.46875, 0.5, 0.9375),
Shapes.box(0.65625, 0.0, 0.625, 0.96875, 0.5, 1.0),
Shapes.box(0.59375, 0.0, 0.125, 0.90625, 0.5, 0.5)
).singleEncompassing()
),
StackableItemBlockType.POTION to listOf(
Shapes.box(0.375, 0.0, 0.3125, 0.625, 0.5625, 0.75),
Shapes.or(
Shapes.box(0.125, 0.0, 0.3125, 0.375, 0.5625, 0.75),
Shapes.box(0.625, 0.0, 0.375, 0.875, 0.5625, 0.8125)
StackableItemBlockType.VITAMIN to listOf(
Shapes.box(0.375, 0.0, 0.375, 0.625, 0.4375, 0.625),
Shapes.box(0.1875, 0.0, 0.3125, 0.8125, 0.4375, 0.6875),
Shapes.box(0.1875, 0.0, 0.1875, 0.8125, 0.4375, 0.8125),
Shapes.box(0.125, 0.0, 0.125, 0.875, 0.4375, 0.875)
),
Shapes.or(
Shapes.box(0.375, 0.0, 0.0625, 0.625, 0.5625, 0.5),
Shapes.box(0.625, 0.0, 0.5625, 0.875, 0.5625, 1.0),
Shapes.box(0.125, 0.0, 0.5, 0.375, 0.5625, 0.9375)
StackableItemBlockType.IRON_BALL to listOf(
Shapes.box(0.25, 0.0, 0.25, 0.75, 0.4375, 0.75),
Shapes.box(0.0, 0.0, 0.1875, 1.0, 0.4375, 0.8125),
Shapes.box(0.0, 0.0, 0.0, 1.0, 0.4375, 1.0),
Shapes.or(
Shapes.box(0.0, 0.0, 0.0, 1.0, 0.4375, 1.0),
Shapes.box(0.25, 0.4375, 0.3125, 0.6875, 0.875, 0.75)
)
),
Shapes.or(
Shapes.box(0.125, 0.0, 0.0, 0.375, 0.5625, 0.4375),
Shapes.box(0.625, 0.0, 0.0625, 0.875, 0.5625, 0.5),
Shapes.box(0.6875, 0.0, 0.5625, 0.9375, 0.5625, 1.0),
Shapes.box(0.1875, 0.0, 0.5, 0.4375, 0.5625, 0.9375)
)
),
StackableItemBlockType.STATUS_RESTORE to listOf(
Shapes.box(0.375, 0.0, 0.3125, 0.625, 0.4375, 0.6875),
Shapes.or(
Shapes.box(0.125, 0.0, 0.3125, 0.375, 0.4375, 0.75),
Shapes.box(0.625, 0.0, 0.375, 0.875, 0.4375, 0.75)
StackableItemBlockType.THROAT_SPRAY to listOf(
Shapes.box(0.375, 0.0, 0.1875, 0.625, 0.5625, 0.75),
Shapes.box(0.125, 0.0, 0.1875, 0.875, 0.5625, 0.8125),
Shapes.box(0.125, 0.0, 0.0, 0.875, 0.5625, 1.0),
Shapes.box(0.075, 0.0, 0.0, 0.9375, 0.5625, 1.0)
),
Shapes.or(
Shapes.box(0.125, 0.0, 0.5, 0.375, 0.4375, 0.875),
Shapes.box(0.625, 0.0, 0.5625, 0.875, 0.4375, 0.9375),
Shapes.box(0.375, 0.0, 0.0625, 0.625, 0.4375, 0.4375)
StackableItemBlockType.UPGRADE to listOf(
Shapes.box(0.3125, 0.0, 0.3125, 0.6875, 0.125, 0.6875),
Shapes.box(0.3125, 0.0, 0.3125, 0.6875, 0.25, 0.6875),
Shapes.box(0.3125, 0.0, 0.3125, 0.6875, 0.375, 0.6875),
Shapes.box(0.3125, 0.0, 0.3125, 0.6875, 0.5, 0.6875)
),
Shapes.or(
Shapes.box(0.1875, 0.0, 0.5, 0.4375, 0.4375, 0.875),
Shapes.box(0.125, 0.0, 0.0, 0.375, 0.4375, 0.375),
Shapes.box(0.625, 0.0, 0.0625, 0.875, 0.4375, 0.4375),
Shapes.box(0.6875, 0.0, 0.5625, 0.9375, 0.4375, 0.9375)
StackableItemBlockType.DICE to listOf(
Shapes.box(0.125, 0.0, 0.6875, 0.3125, 0.1875, 0.875),
Shapes.box(0.125, 0.0, 0.625, 0.5625, 0.1875, 0.875),
Shapes.box(0.125, 0.0, 0.4375, 0.5625, 0.1875, 0.875),
Shapes.box(0.125, 0.0, 0.4375, 0.5625, 0.375, 0.875)
)
)
)
fun getShape(type: StackableItemBlockType, count: Int): VoxelShape = northShapeMap[type]?.let { list -> list[(count - 1).coerceIn(0, list.lastIndex)] } ?: Shapes.block()
fun getMaxAmount(type: StackableItemBlockType): Int = min(northShapeMap[type]?.size ?: 1 , MAX_AMOUNT)
@@ -184,7 +170,7 @@ class StackableItemBlock(settings: Properties, val type: StackableItemBlockType)
}
override fun getShape(state: BlockState, level: BlockGetter, pos: BlockPos, context: CollisionContext): VoxelShape {
return getCollisionShape(state, level, pos, context).singleEncompassing()
return getCollisionShape(state, level, pos, context)
}
override fun getStateForPlacement(context: BlockPlaceContext): BlockState? {
@@ -22,12 +22,7 @@ import net.minecraft.world.Container
import net.minecraft.world.SimpleContainer
import net.minecraft.world.entity.player.Inventory
import net.minecraft.world.entity.player.Player
import net.minecraft.world.inventory.AbstractContainerMenu
import net.minecraft.world.inventory.ContainerData
import net.minecraft.world.inventory.ContainerListener
import net.minecraft.world.inventory.MenuType
import net.minecraft.world.inventory.SimpleContainerData
import net.minecraft.world.inventory.Slot
import net.minecraft.world.inventory.*
import net.minecraft.world.item.ItemStack
class TMMachineMenu(menuType: MenuType<*>, syncId: Int) : AbstractContainerMenu(menuType, syncId), ContainerListener {
@@ -22,6 +22,7 @@ import com.cobblemon.mod.common.api.storage.player.client.ClientPokedexManager
import com.cobblemon.mod.common.api.storage.player.client.ClientTMMoveManager
import com.cobblemon.mod.common.api.tags.CobblemonItemTags
import com.cobblemon.mod.common.block.entity.TintBlockEntity
import com.cobblemon.mod.common.block.sign.CobblemonSignBlock
import com.cobblemon.mod.common.client.battle.ClientBattle
import com.cobblemon.mod.common.client.gui.PartyOverlay
import com.cobblemon.mod.common.client.gui.PartyOverlayDataControl
@@ -52,7 +53,6 @@ import com.cobblemon.mod.common.client.render.models.blockbench.repository.Varyi
import com.cobblemon.mod.common.client.render.npc.NPCRenderer
import com.cobblemon.mod.common.client.render.pokeball.PokeBallRenderer
import com.cobblemon.mod.common.client.render.pokemon.PokemonRenderer
import com.cobblemon.mod.common.client.render.fallingstar.FallingStarRenderer
import com.cobblemon.mod.common.client.requests.ClientPlayerActionRequests
import com.cobblemon.mod.common.client.sound.BattleMusicController
import com.cobblemon.mod.common.client.sound.EntitySoundTracker
@@ -61,7 +61,6 @@ import com.cobblemon.mod.common.client.tooltips.AprijuiceTooltipGenerator
import com.cobblemon.mod.common.client.tooltips.CobblemonTooltipGenerator
import com.cobblemon.mod.common.client.tooltips.FishingBaitTooltipGenerator
import com.cobblemon.mod.common.client.tooltips.FishingRodTooltipGenerator
import com.cobblemon.mod.common.client.tooltips.MegaBondTooltipGenerator
import com.cobblemon.mod.common.client.tooltips.PokePuffTooltipGenerator
import com.cobblemon.mod.common.client.tooltips.RecipeSeasoningAbsorptionTooltipGenerator
import com.cobblemon.mod.common.client.tooltips.SeasoningTooltipGenerator
@@ -207,7 +206,6 @@ object CobblemonClient {
TooltipManager.registerTooltipGenerator(AprijuiceTooltipGenerator)
TooltipManager.registerTooltipGenerator(TechnicalMachineTooltipGenerator)
TooltipManager.registerTooltipGenerator(PokePuffTooltipGenerator)
TooltipManager.registerTooltipGenerator(MegaBondTooltipGenerator)
}
fun registerFlywheelRenderers() {
@@ -241,6 +239,12 @@ object CobblemonClient {
CobblemonBlocks.POKE_CAKE
)
this.implementation.registerBlockRenderType(
RenderType.translucent(),
CobblemonBlocks.UPGRADE,
CobblemonBlocks.DUBIOUS_DISC
)
this.implementation.registerBlockRenderType(
RenderType.cutout(),
CobblemonBlocks.GILDED_CHEST,
@@ -386,7 +390,31 @@ object CobblemonClient {
CobblemonBlocks.X_SP_ATK,
CobblemonBlocks.X_SP_DEF,
CobblemonBlocks.X_SPEED,
CobblemonBlocks.TM_MACHINE
CobblemonBlocks.TM_MACHINE,
CobblemonBlocks.GALARICA_CUFF,
CobblemonBlocks.GALARICA_WREATH,
CobblemonBlocks.CHIPPED_POT,
CobblemonBlocks.CRACKED_POT,
CobblemonBlocks.UNREMARKABLE_TEACUP,
CobblemonBlocks.MASTERPIECE_TEACUP,
CobblemonBlocks.LUMINOUS_MOSS,
CobblemonBlocks.ICY_ROCK,
CobblemonBlocks.HEAT_ROCK,
CobblemonBlocks.SMOOTH_ROCK,
CobblemonBlocks.DAMP_ROCK,
CobblemonBlocks.DESTINY_KNOT,
CobblemonBlocks.METRONOME,
CobblemonBlocks.KINGS_ROCK,
CobblemonBlocks.FLAME_ORB,
CobblemonBlocks.LIFE_ORB,
CobblemonBlocks.TOXIC_ORB,
CobblemonBlocks.LIGHT_BALL,
CobblemonBlocks.SMOKE_BALL,
CobblemonBlocks.NEVER_MELT_ICE,
CobblemonBlocks.WIDE_LENS,
CobblemonBlocks.ZOOM_LENS,
CobblemonBlocks.SCOPE_LENS
)
this.createBoatModelLayers()
@@ -459,8 +487,6 @@ object CobblemonClient {
this.implementation.registerEntityRenderer(CobblemonEntities.POKE_BOBBER) { ctx -> PokeBobberEntityRenderer(ctx) }
LOGGER.info("Registering NPC renderer")
this.implementation.registerEntityRenderer(CobblemonEntities.NPC, ::NPCRenderer)
LOGGER.info("Registering Falling Star renderer")
this.implementation.registerEntityRenderer(CobblemonEntities.FALLING_STAR, ::FallingStarRenderer)
}
private fun registerItemColors() {
@@ -513,4 +539,4 @@ object CobblemonClient {
*/
/** Checks if the player is preoccupied and cannot accept an action. */
fun isBusy() = battle != null || trade != null
}
}
@@ -1,36 +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.client.entity
import com.cobblemon.mod.common.api.entity.EntitySideDelegate
import com.cobblemon.mod.common.client.render.models.blockbench.PosableState
import com.cobblemon.mod.common.entity.projectile.FallingStarEntity
class FallingStarClientDelegate : EntitySideDelegate<FallingStarEntity>, PosableState() {
lateinit var currentEntity: FallingStarEntity
override val schedulingTracker
get() = getEntity().schedulingTracker
override fun getEntity() = currentEntity
override fun initialize(entity: FallingStarEntity) {
super.initialize(entity)
this.currentEntity = entity
this.age = entity.tickCount
}
override fun tick(entity: FallingStarEntity) {
super.tick(entity)
updateLocatorPosition(entity.position())
incrementAge(entity)
}
override fun updatePartialTicks(partialTicks: Float) {
this.currentPartialTicks = partialTicks
}
}
@@ -22,6 +22,13 @@ import com.cobblemon.mod.common.client.CobblemonClient
import com.cobblemon.mod.common.client.CobblemonResources
import com.cobblemon.mod.common.client.gui.*
import com.cobblemon.mod.common.client.gui.summary.widgets.*
import com.cobblemon.mod.common.client.gui.CobblemonRenderable
import com.cobblemon.mod.common.client.gui.ExitButton
import com.cobblemon.mod.common.client.gui.TypeIcon
import com.cobblemon.mod.common.client.gui.summary.widgets.MarkingsWidget
import com.cobblemon.mod.common.client.gui.summary.widgets.ModelWidget
import com.cobblemon.mod.common.client.gui.summary.widgets.NicknameEntryWidget
import com.cobblemon.mod.common.client.gui.summary.widgets.PartyWidget
import com.cobblemon.mod.common.client.gui.summary.widgets.screens.SummaryTab
import com.cobblemon.mod.common.client.gui.summary.widgets.screens.info.InfoWidget
import com.cobblemon.mod.common.client.gui.summary.widgets.screens.marks.MarksWidget
@@ -1,58 +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.client.render.fallingstar
import com.cobblemon.mod.common.client.entity.FallingStarClientDelegate
import com.cobblemon.mod.common.client.render.models.blockbench.projectile.PosableFallingStarEntityModel
import com.cobblemon.mod.common.client.render.models.blockbench.repository.VaryingModelRepository
import com.cobblemon.mod.common.entity.projectile.FallingStarEntity
import com.cobblemon.mod.common.util.cobblemonResource
import com.mojang.blaze3d.vertex.PoseStack
import com.mojang.math.Axis
import net.minecraft.client.renderer.MultiBufferSource
import net.minecraft.client.renderer.RenderType
import net.minecraft.client.renderer.entity.EntityRenderer
import net.minecraft.client.renderer.entity.EntityRendererProvider
import net.minecraft.client.renderer.texture.OverlayTexture
class FallingStarRenderer(context: EntityRendererProvider.Context) : EntityRenderer<FallingStarEntity>(context) {
val model = PosableFallingStarEntityModel()
val identifier = cobblemonResource("falling_star")
override fun getTextureLocation(entity: FallingStarEntity) = VaryingModelRepository.getTexture(identifier, (entity.delegate as FallingStarClientDelegate))
override fun render(entity: FallingStarEntity, yaw: Float, partialTicks: Float, poseStack: PoseStack, buffer: MultiBufferSource, packedLight: Int) {
if (entity.isInvisible) {
return
}
val state = entity.delegate as FallingStarClientDelegate
state.currentAspects = emptySet()
val model = VaryingModelRepository.getPoser(identifier, state)
this.model.posableModel = model
model.context = this.model.context
this.model.setupEntityTypeContext(entity)
poseStack.pushPose()
poseStack.scale(1.0F, -1.0F, 1.0F)
poseStack.mulPose(Axis.YP.rotationDegrees(yaw))
val vertexConsumer = buffer.getBuffer(RenderType.entityCutout(getTextureLocation(entity)))
state.updatePartialTicks(partialTicks)
model.setLayerContext(buffer, state, VaryingModelRepository.getLayers(identifier, state))
this.model.setupAnim(entity, 0f, 0f, entity.tickCount + partialTicks, 0F, 0F)
this.model.renderToBuffer(poseStack, vertexConsumer, packedLight, OverlayTexture.NO_OVERLAY, -0x1)
model.green = 1F
model.blue = 1F
model.red = 1F
model.resetLayerContext()
poseStack.popPose()
super.render(entity, yaw, partialTicks, poseStack, buffer, packedLight)
}
}
@@ -1,21 +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.client.render.models.blockbench.projectile
import com.cobblemon.mod.common.client.render.models.blockbench.PosableEntityModel
import com.cobblemon.mod.common.client.render.models.blockbench.repository.RenderContext
import com.cobblemon.mod.common.entity.projectile.FallingStarEntity
import net.minecraft.world.entity.Entity
class PosableFallingStarEntityModel : PosableEntityModel<FallingStarEntity>() {
override fun setupEntityTypeContext(entity: Entity?) {
super.setupEntityTypeContext(entity)
context.put(RenderContext.ASPECTS, emptySet())
}
}
@@ -85,7 +85,6 @@ object VaryingModelRepository {
"poke_balls",
"generic",
"block_entities",
"falling_star"
)
val poserDirectories: List<Pair<String, Class<out PosableModel>>> = listOf(
@@ -96,7 +95,6 @@ object VaryingModelRepository {
"bedrock/npcs/posers" to PosableModel::class.java,
"bedrock/poke_balls/posers" to PosableModel::class.java,
"bedrock/generic/posers" to PosableModel::class.java,
"bedrock/falling_star/posers" to PosableModel::class.java,
)
val variationDirectories: List<String> = listOf(
@@ -1,23 +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.client.tooltips
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.CobblemonItemComponents
import com.cobblemon.mod.common.api.text.aqua
import com.cobblemon.mod.common.util.lang
import net.minecraft.network.chat.Component
import net.minecraft.world.item.ItemStack
object MegaBondTooltipGenerator : TooltipGenerator() {
override fun generateAdditionalTooltip(stack: ItemStack, lines: MutableList<Component>): MutableList<Component>? {
val component = stack.get(CobblemonItemComponents.MEGA_BOND) ?: return null
return mutableListOf(lang("tooltip.mega_bond", component.bond, Cobblemon.config.maxPokemonFriendship).aqua())
}
}
@@ -1,62 +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.command
import com.cobblemon.mod.common.CobblemonItemComponents
import com.cobblemon.mod.common.CobblemonItems
import com.cobblemon.mod.common.api.permission.CobblemonPermissions
import com.cobblemon.mod.common.api.text.green
import com.cobblemon.mod.common.command.argument.PartySlotArgumentType
import com.cobblemon.mod.common.item.components.MegaBondComponent
import com.cobblemon.mod.common.net.messages.client.pokemon.update.HeldItemUpdatePacket
import com.cobblemon.mod.common.pokemon.megastone.MegaBondImprinting
import com.cobblemon.mod.common.util.commandLang
import com.cobblemon.mod.common.util.permission
import com.mojang.brigadier.Command
import com.mojang.brigadier.CommandDispatcher
import com.mojang.brigadier.arguments.IntegerArgumentType
import com.mojang.brigadier.context.CommandContext
import com.mojang.brigadier.exceptions.SimpleCommandExceptionType
import net.minecraft.commands.CommandSourceStack
import net.minecraft.commands.Commands
import net.minecraft.commands.Commands.literal
object SetMegaBondCommand {
const val NAME = "setmegabond"
private val NOT_HOLDING = SimpleCommandExceptionType(commandLang("setmegabond.not_holding"))
fun register(dispatcher: CommandDispatcher<CommandSourceStack>) {
dispatcher.register(literal(NAME)
.permission(CobblemonPermissions.SET_MEGA_BOND)
.then(Commands.argument("slot", PartySlotArgumentType.partySlot())
.then(Commands.argument("bond", IntegerArgumentType.integer(0))
.executes { context -> execute(context, IntegerArgumentType.getInteger(context, "bond")) }
)
)
)
}
private fun execute(context: CommandContext<CommandSourceStack>, bond: Int): Int {
val pokemon = PartySlotArgumentType.getPokemon(context, "slot")
val stack = pokemon.heldItemNoCopy()
if (!stack.`is`(CobblemonItems.DORMANT_MEGA_STONE)) {
throw NOT_HOLDING.create()
}
stack.set(CobblemonItemComponents.MEGA_BOND, MegaBondComponent(pokemon.uuid, bond))
pokemon.onChange(HeldItemUpdatePacket({ pokemon }, stack))
val converted = MegaBondImprinting.convertToMegaStone(pokemon)
if (converted != null) {
context.source.sendSystemMessage(commandLang("$NAME.converted", pokemon.getDisplayName(), converted.description).green())
} else {
context.source.sendSystemMessage(commandLang(NAME, pokemon.getDisplayName(), bond).green())
}
return Command.SINGLE_SUCCESS
}
}
@@ -1,90 +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.command
import com.cobblemon.mod.common.CobblemonEntities
import com.cobblemon.mod.common.api.permission.CobblemonPermissions
import com.cobblemon.mod.common.api.text.green
import com.cobblemon.mod.common.entity.projectile.FallingStarEntity
import com.cobblemon.mod.common.entity.projectile.FallingStarResultType
import com.cobblemon.mod.common.util.alias
import com.cobblemon.mod.common.util.commandLang
import com.cobblemon.mod.common.util.permission
import com.mojang.brigadier.Command
import com.mojang.brigadier.CommandDispatcher
import com.mojang.brigadier.arguments.StringArgumentType
import com.mojang.brigadier.context.CommandContext
import com.mojang.brigadier.exceptions.SimpleCommandExceptionType
import kotlin.math.cos
import kotlin.math.min
import kotlin.math.sin
import kotlin.math.sqrt
import kotlin.random.Random
import net.minecraft.commands.CommandSourceStack
import net.minecraft.commands.Commands
import net.minecraft.commands.Commands.literal
import net.minecraft.commands.SharedSuggestionProvider
import net.minecraft.commands.arguments.coordinates.Vec3Argument
import net.minecraft.server.level.ServerLevel
import net.minecraft.world.phys.Vec3
object SpawnMeteorCommand {
const val NAME = "spawnmeteor"
const val ALIAS = "meteor"
private val INVALID_RESULT_TYPE = SimpleCommandExceptionType(commandLang("spawnmeteor.invalid_result_type"))
private val RESULT_TYPE_NAMES = FallingStarResultType.entries.map { it.name }
fun register(dispatcher: CommandDispatcher<CommandSourceStack>) {
val command = dispatcher.register(literal(NAME)
.permission(CobblemonPermissions.SPAWN_METEOR)
.then(Commands.argument("pos", Vec3Argument.vec3())
.then(Commands.argument("resultType", StringArgumentType.word())
.suggests { _, builder -> SharedSuggestionProvider.suggest(RESULT_TYPE_NAMES, builder) }
.executes { context ->
execute(context, Vec3Argument.getVec3(context, "pos"), resultTypeOf(context))
}
)
.executes { context -> execute(context, Vec3Argument.getVec3(context, "pos"), FallingStarResultType.entries.random()) }
)
.executes { context -> execute(context, context.source.position, FallingStarResultType.entries.random()) }
)
dispatcher.register(command.alias(ALIAS))
}
private fun execute(context: CommandContext<CommandSourceStack>, target: Vec3, resultType: FallingStarResultType): Int {
val world = context.source.level as? ServerLevel ?: return 0
val fallingStar = FallingStarEntity(CobblemonEntities.FALLING_STAR, world)
fallingStar.resultType = resultType
fallingStar.horizontalDirection = Random.nextDouble(2 * Math.PI).toFloat()
val skyHeight = min(target.y + 64, world.maxBuildHeight - 10.0)
val ticksToFall = sqrt((skyHeight - target.y) / 0.015)
val horizontalDistance = ticksToFall * 0.8
fallingStar.setPos(
target.x - sin(fallingStar.horizontalDirection) * horizontalDistance,
skyHeight,
target.z - cos(fallingStar.horizontalDirection) * horizontalDistance
)
world.addFreshEntity(fallingStar)
context.source.sendSystemMessage(
commandLang("spawnmeteor", resultType.name, target.x.toInt(), target.y.toInt(), target.z.toInt()).green()
)
return Command.SINGLE_SUCCESS
}
private fun resultTypeOf(context: CommandContext<CommandSourceStack>): FallingStarResultType {
val name = StringArgumentType.getString(context, "resultType")
return FallingStarResultType.entries.firstOrNull { it.name.equals(name, ignoreCase = true) }
?: throw INVALID_RESULT_TYPE.create()
}
}
@@ -1,159 +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.entity.projectile
import com.bedrockk.molang.runtime.struct.QueryStruct
import com.cobblemon.mod.common.api.net.serializers.PoseTypeDataSerializer
import com.cobblemon.mod.common.api.pokemon.PokemonProperties
import com.cobblemon.mod.common.api.scheduling.Schedulable
import com.cobblemon.mod.common.api.scheduling.SchedulingTracker
import com.cobblemon.mod.common.client.entity.FallingStarClientDelegate
import com.cobblemon.mod.common.entity.PosableEntity
import com.cobblemon.mod.common.entity.PoseType
import com.cobblemon.mod.common.net.messages.client.spawn.SpawnFallingStarPacket
import com.cobblemon.mod.common.util.cobblemonResource
import net.minecraft.core.particles.ParticleTypes
import net.minecraft.core.registries.Registries
import net.minecraft.nbt.CompoundTag
import net.minecraft.network.protocol.Packet
import net.minecraft.resources.ResourceKey
import net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket
import net.minecraft.network.protocol.game.ClientGamePacketListener
import net.minecraft.network.protocol.game.ClientboundAddEntityPacket
import net.minecraft.network.syncher.SynchedEntityData
import net.minecraft.server.level.ServerEntity
import net.minecraft.server.level.ServerLevel
import net.minecraft.sounds.SoundEvents
import net.minecraft.sounds.SoundSource
import net.minecraft.world.entity.EntityType
import net.minecraft.world.entity.item.ItemEntity
import net.minecraft.world.entity.projectile.ThrowableProjectile
import net.minecraft.world.level.Level
import net.minecraft.world.level.storage.loot.LootParams
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets
import net.minecraft.world.level.storage.loot.parameters.LootContextParams
import net.minecraft.world.phys.BlockHitResult
import net.minecraft.world.phys.EntityHitResult
import net.minecraft.world.phys.Vec3
class FallingStarEntity(
entityType: EntityType<out FallingStarEntity>,
level: Level
) : ThrowableProjectile(entityType, level), PosableEntity, Schedulable {
override val schedulingTracker = SchedulingTracker()
override val delegate = if (level.isClientSide) {
FallingStarClientDelegate()
} else {
FallingStarServerDelegate()
}
override val struct: QueryStruct = QueryStruct(hashMapOf())
var horizontalDirection = 0F // radians
var resultType: FallingStarResultType = FallingStarResultType.MINIOR
var poseType: PoseType
get() = entityData.get(POSE_TYPE)
set(value) { entityData.set(POSE_TYPE, value) }
init {
delegate.initialize(this)
addPosableFunctions(struct)
}
override fun setDeltaMovement(deltaMovement: Vec3) {
if (poseType == PoseType.NONE) {
super.setDeltaMovement(
Vec3(
kotlin.math.sin(horizontalDirection) * 0.8,
deltaMovement.y,
kotlin.math.cos(horizontalDirection) * 0.8
)
)
} else {
super.setDeltaMovement(Vec3.ZERO)
}
}
override fun tick() {
super.tick()
delegate.tick(this)
schedulingTracker.update(1/20F)
if (level().isClientSide) {
repeat(times = 3) {
level().addParticle(
ParticleTypes.FLAME,
x + (random.nextDouble() - 0.5) * 0.5,
y + (random.nextDouble() - 0.5) * 0.5,
z + (random.nextDouble() - 0.5) * 0.5,
0.0, 0.0, 0.0
)
}
}
}
override fun onHitBlock(result: BlockHitResult) {
if (!level().isClientSide && poseType == PoseType.NONE) {
poseType = PoseType.STAND
val vec3 = result.getLocation().subtract(this.x, this.y, this.z)
val vec32 = vec3.normalize().scale(0.05)
this.setPosRaw(this.x - vec32.x, this.y - vec32.y, this.z - vec32.z)
// based on our result type we should probably choose the item based on a loot table (not sure if we want other mons besides minior though..)
when (resultType) {
FallingStarResultType.ITEM -> {
val world = level() as ServerLevel
val lootTable = world.server.reloadableRegistries().getLootTable(ResourceKey.create(Registries.LOOT_TABLE, cobblemonResource("gameplay/falling_star")))
val lootParams = LootParams.Builder(world)
.withParameter(LootContextParams.ORIGIN, result.location)
.create(LootContextParamSets.COMMAND)
lootTable.getRandomItems(lootParams).forEach { stack ->
world.addFreshEntity(ItemEntity(world, result.location.x, result.location.y, result.location.z, stack).also { it.setDefaultPickUpDelay() })
}
}
else -> level().addFreshEntity(PokemonProperties.parse("minior").createEntity(level()).also { it.moveTo(result.location.x, result.location.y, result.location.z) })
}
level().playSound(null, blockPosition(), SoundEvents.GENERIC_EXPLODE.value(), SoundSource.NEUTRAL, 1F, 1F)
discard()
}
}
override fun onHitEntity(result: EntityHitResult) {
if (!level().isClientSide && poseType == PoseType.NONE) {
poseType = PoseType.STAND
// TODO deal damage - you got killed by a star bro
level().playSound(null, blockPosition(), SoundEvents.GENERIC_EXPLODE.value(), SoundSource.NEUTRAL, 1F, 1F)
}
}
override fun defineSynchedData(builder: SynchedEntityData.Builder) {
builder.define(POSE_TYPE, PoseType.NONE)
}
override fun readAdditionalSaveData(compound: CompoundTag) {
// TODO("Not yet implemented")
}
override fun addAdditionalSaveData(compound: CompoundTag) {
// TODO("Not yet implemented")
}
override fun getCurrentPoseType(): PoseType = PoseType.NONE
override fun getAddEntityPacket(entityTrackerEntry: ServerEntity) = ClientboundCustomPayloadPacket(
SpawnFallingStarPacket(
poseType = poseType,
horizontalDirection = horizontalDirection,
vanillaSpawnPacket = super.getAddEntityPacket(entityTrackerEntry) as ClientboundAddEntityPacket
)
) as Packet<ClientGamePacketListener>
companion object {
val POSE_TYPE = SynchedEntityData.defineId(FallingStarEntity::class.java, PoseTypeDataSerializer)
}
}
@@ -30,6 +30,7 @@ import com.cobblemon.mod.common.item.TumblestoneItem
import net.minecraft.world.item.BlockItem
import com.cobblemon.mod.common.platform.events.ServerPlayerEvent
import com.cobblemon.mod.common.api.storage.player.PlayerInstancedDataStoreTypes
import com.cobblemon.mod.common.item.GemItem
import com.cobblemon.mod.common.platform.events.PlatformEvents
import com.cobblemon.mod.common.util.effectiveName
import com.cobblemon.mod.common.util.getPlayer
@@ -40,6 +41,7 @@ object AdvancementHandler : EventHandler {
override fun registerListeners() {
PlatformEvents.RIGHT_CLICK_BLOCK.subscribe(Priority.LOWEST, ::onTumbleStonePlaced)
PlatformEvents.RIGHT_CLICK_BLOCK.subscribe(Priority.LOWEST, ::onTypeGemClusterPlaced)
PlatformEvents.RIGHT_CLICK_BLOCK.subscribe(Priority.LOWEST, ::onTypeGemItemPlaced)
POKEMON_CAPTURED.subscribe(Priority.LOWEST, ::onCapture)
BATTLE_VICTORY.subscribe(Priority.LOWEST, ::onWinBattle)
EVOLUTION_COMPLETE.subscribe(Priority.LOWEST, ::onEvolve)
@@ -206,6 +208,12 @@ object AdvancementHandler : EventHandler {
CobblemonCriteria.PLANT_TYPE_GEM.trigger(event.player, PlantTypeGemContext(event.pos, block))
}
fun onTypeGemItemPlaced(event: ServerPlayerEvent.RightClickBlock){
val item = event.player.getItemInHand(event.hand).item as? GemItem ?: return
val block = item.block as? TypeGemClusterBlock ?: return
CobblemonCriteria.PLANT_TYPE_GEM.trigger(event.player, PlantTypeGemContext(event.pos, block))
}
fun startRiding(event: RidePokemonEvent.Post) {
CobblemonCriteria.RIDING_STAT_BOOST.trigger(event.player, RidingStatBoostContext(event.pokemon))
}
@@ -6,9 +6,11 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.entity.projectile
package com.cobblemon.mod.common.item
import com.cobblemon.mod.common.api.entity.EntitySideDelegate
import net.minecraft.world.item.ItemNameBlockItem
import net.minecraft.world.level.block.Block
class FallingStarServerDelegate : EntitySideDelegate<FallingStarEntity> {
}
class WearableBlockItem(override val name: String, block: Block): ItemNameBlockItem(block, Properties()), WearableItem{
}
@@ -0,0 +1,32 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.item
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.util.traceFirstEntityCollision
import net.minecraft.world.InteractionHand
import net.minecraft.world.InteractionResultHolder
import net.minecraft.world.entity.player.Player
import net.minecraft.world.item.ItemStack
import net.minecraft.world.level.Level
class WearableHatItem(override val name: String): CobblemonItem(Properties()), WearableItem {
override fun use(level: Level, player: Player, usedHand: InteractionHand): InteractionResultHolder<ItemStack> {
val itemStack = player.getItemInHand(usedHand)
val hitPokemon = player.traceFirstEntityCollision(
entityClass = PokemonEntity::class.java,
maxDistance = player.entityInteractionRange().toFloat()
)
// If the player is looking at a Pokémon within range, block the ability to swap the item onto their head
return if (player.isCrouching && hitPokemon != null && hitPokemon.isOwnedBy(player)) {
InteractionResultHolder.fail(itemStack)
} else this.swapWithEquipmentSlot(this, level, player, usedHand)
}
}
@@ -13,7 +13,9 @@ import net.minecraft.resources.ResourceLocation
import net.minecraft.world.entity.EquipmentSlot
import net.minecraft.world.item.Equipable
class WearableItem(val name: String): CobblemonItem(Properties()), Equipable {
interface WearableItem: Equipable {
val name: String
companion object {
const val MODEL_PATH = "item/wearable"
}
@@ -1,30 +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.item.components
import com.mojang.serialization.Codec
import com.mojang.serialization.codecs.RecordCodecBuilder
import io.netty.buffer.ByteBuf
import java.util.UUID
import net.minecraft.core.UUIDUtil
import net.minecraft.network.codec.ByteBufCodecs
import net.minecraft.network.codec.StreamCodec
data class MegaBondComponent(val owner: UUID, val bond: Int) {
companion object {
val CODEC: Codec<MegaBondComponent> = RecordCodecBuilder.create { instance ->
instance.group(
UUIDUtil.CODEC.fieldOf("owner").forGetter { it.owner },
Codec.INT.fieldOf("bond").forGetter { it.bond }
).apply(instance, ::MegaBondComponent)
}
val PACKET_CODEC: StreamCodec<ByteBuf, MegaBondComponent> = ByteBufCodecs.fromCodec(CODEC)
}
}
@@ -672,8 +672,6 @@ object CobblemonItemGroups {
entries.accept(CobblemonItems.DUSK_STONE)
entries.accept(CobblemonItems.DAWN_STONE)
entries.accept(CobblemonItems.ICE_STONE)
entries.accept(CobblemonItems.MEGA_SHARD)
entries.accept(CobblemonItems.DORMANT_MEGA_STONE)
entries.accept(CobblemonItems.LINK_CABLE)
entries.accept(CobblemonItems.KINGS_ROCK)
entries.accept(CobblemonItems.GALARICA_CUFF)
@@ -720,33 +718,18 @@ object CobblemonItemGroups {
private fun heldItemEntries(displayContext: ItemDisplayParameters, entries: Output) {
entries.accept(CobblemonItems.ABILITY_SHIELD)
entries.accept(CobblemonItems.ABOMASITE)
entries.accept(CobblemonItems.ABSOLITE)
entries.accept(CobblemonItems.ABSORB_BULB)
entries.accept(CobblemonItems.AERODACTYLITE)
entries.accept(CobblemonItems.AGGRONITE)
entries.accept(CobblemonItems.AIR_BALLOON)
entries.accept(CobblemonItems.ALAKAZITE)
entries.accept(CobblemonItems.ALTARIANITE)
entries.accept(CobblemonItems.AMPHAROSITE)
entries.accept(CobblemonItems.ASSAULT_VEST)
entries.accept(CobblemonItems.AUDINITE)
entries.accept(CobblemonItems.BANETTITE)
entries.accept(CobblemonItems.BEEDRILLITE)
entries.accept(CobblemonItems.BIG_ROOT)
entries.accept(CobblemonItems.BINDING_BAND)
entries.accept(CobblemonItems.BLACK_BELT)
entries.accept(CobblemonItems.BLACK_GLASSES)
entries.accept(CobblemonItems.BLACK_SLUDGE)
entries.accept(CobblemonItems.BLASTOISINITE)
entries.accept(CobblemonItems.BLAZIKENITE)
entries.accept(CobblemonItems.BLUNDER_POLICY)
entries.accept(CobblemonItems.BRIGHT_POWDER)
entries.accept(CobblemonItems.CAMERUPTITE)
entries.accept(CobblemonItems.CELL_BATTERY)
entries.accept(CobblemonItems.CHARCOAL)
entries.accept(CobblemonItems.CHARIZARDITE_X)
entries.accept(CobblemonItems.CHARIZARDITE_Y)
entries.accept(CobblemonItems.CHOICE_BAND)
entries.accept(CobblemonItems.CHOICE_SCARF)
entries.accept(CobblemonItems.CHOICE_SPECS)
@@ -757,7 +740,6 @@ object CobblemonItemGroups {
entries.accept(CobblemonItems.DEEP_SEA_SCALE)
entries.accept(CobblemonItems.DEEP_SEA_TOOTH)
entries.accept(CobblemonItems.DESTINY_KNOT)
entries.accept(CobblemonItems.DIANCITE)
entries.accept(CobblemonItems.DRAGON_FANG)
entries.accept(CobblemonItems.EJECT_BUTTON)
entries.accept(CobblemonItems.EJECT_PACK)
@@ -770,52 +752,31 @@ object CobblemonItemGroups {
entries.accept(CobblemonItems.FLOAT_STONE)
entries.accept(CobblemonItems.FOCUS_BAND)
entries.accept(CobblemonItems.FOCUS_SASH)
entries.accept(CobblemonItems.GALLADITE)
entries.accept(CobblemonItems.GARCHOMPITE)
entries.accept(CobblemonItems.GARDEVOIRITE)
entries.accept(CobblemonItems.GENGARITE)
entries.accept(CobblemonItems.GLALITITE)
entries.accept(CobblemonItems.GRIP_CLAW)
entries.accept(CobblemonItems.GYARADOSITE)
entries.accept(CobblemonItems.HARD_STONE)
entries.accept(CobblemonItems.HEAT_ROCK)
entries.accept(CobblemonItems.HEAVY_DUTY_BOOTS)
entries.accept(CobblemonItems.HERACRONITE)
entries.accept(CobblemonItems.HOUNDOOMINITE)
entries.accept(CobblemonItems.ICY_ROCK)
entries.accept(CobblemonItems.IRON_BALL)
entries.accept(CobblemonItems.KANGASKHANITE)
entries.accept(CobblemonItems.KINGS_ROCK)
entries.accept(CobblemonItems.LAGGING_TAIL)
entries.accept(CobblemonItems.LATIASITE)
entries.accept(CobblemonItems.LATIOSITE)
entries.accept(CobblemonItems.LEFTOVERS)
entries.accept(CobblemonItems.LIFE_ORB)
entries.accept(CobblemonItems.LIGHT_BALL)
entries.accept(CobblemonItems.LIGHT_CLAY)
entries.accept(CobblemonItems.LOADED_DICE)
entries.accept(CobblemonItems.LOPUNNITE)
entries.accept(CobblemonItems.LUCARIONITE)
entries.accept(CobblemonItems.LUCKY_EGG)
entries.accept(CobblemonItems.LUMINOUS_MOSS)
entries.accept(CobblemonItems.MAGNET)
entries.accept(CobblemonItems.MANECTITE)
entries.accept(CobblemonItems.MAWILITE)
entries.accept(CobblemonItems.MEDICHAMITE)
entries.accept(CobblemonItems.MENTAL_HERB)
entries.accept(CobblemonItems.METAGROSSITE)
entries.accept(CobblemonItems.METAL_COAT)
entries.accept(CobblemonItems.METAL_POWDER)
entries.accept(CobblemonItems.METRONOME)
entries.accept(CobblemonItems.MEWTWONITE_X)
entries.accept(CobblemonItems.MEWTWONITE_Y)
entries.accept(CobblemonItems.MIRACLE_SEED)
entries.accept(CobblemonItems.MIRROR_HERB)
entries.accept(CobblemonItems.MUSCLE_BAND)
entries.accept(CobblemonItems.MYSTIC_WATER)
entries.accept(CobblemonItems.NEVER_MELT_ICE)
entries.accept(CobblemonItems.PIDGEOTITE)
entries.accept(CobblemonItems.PINSIRITE)
entries.accept(CobblemonItems.POISON_BARB)
entries.accept(CobblemonItems.POWER_ANKLET)
entries.accept(CobblemonItems.POWER_BAND)
@@ -834,34 +795,24 @@ object CobblemonItemGroups {
entries.accept(CobblemonItems.RING_TARGET)
entries.accept(CobblemonItems.ROCKY_HELMET)
entries.accept(CobblemonItems.ROOM_SERVICE)
entries.accept(CobblemonItems.SABLENITE)
entries.accept(CobblemonItems.SAFETY_GOGGLES)
entries.accept(CobblemonItems.SALAMENCITE)
entries.accept(CobblemonItems.SCEPTILITE)
entries.accept(CobblemonItems.SCIZORITE)
entries.accept(CobblemonItems.SCOPE_LENS)
entries.accept(CobblemonItems.SHARPEDONITE)
entries.accept(CobblemonItems.SHARP_BEAK)
entries.accept(CobblemonItems.SHED_SHELL)
entries.accept(CobblemonItems.SHELL_BELL)
entries.accept(CobblemonItems.SILK_SCARF)
entries.accept(CobblemonItems.SILVER_POWDER)
entries.accept(CobblemonItems.SLOWBRONITE)
entries.accept(CobblemonItems.SMOKE_BALL)
entries.accept(CobblemonItems.SMOOTH_ROCK)
entries.accept(CobblemonItems.SOFT_SAND)
entries.accept(CobblemonItems.SOOTHE_BELL)
entries.accept(CobblemonItems.SPELL_TAG)
entries.accept(CobblemonItems.STEELIXITE)
entries.accept(CobblemonItems.STICKY_BARB)
entries.accept(CobblemonItems.SWAMPERTITE)
entries.accept(CobblemonItems.TERRAIN_EXTENDER)
entries.accept(CobblemonItems.THROAT_SPRAY)
entries.accept(CobblemonItems.TOXIC_ORB)
entries.accept(CobblemonItems.TWISTED_SPOON)
entries.accept(CobblemonItems.TYRANITARITE)
entries.accept(CobblemonItems.UTILITY_UMBRELLA)
entries.accept(CobblemonItems.VENUSAURITE)
entries.accept(CobblemonItems.WEAKNESS_POLICY)
entries.accept(CobblemonItems.WHITE_HERB)
entries.accept(CobblemonItems.WIDE_LENS)
@@ -1072,4 +1023,4 @@ object CobblemonItemGroups {
}
}
}
@@ -11,28 +11,27 @@ package com.cobblemon.mod.common.item.interactive
import com.cobblemon.mod.common.api.item.PokemonSelectingItem
import com.cobblemon.mod.common.api.pokemon.stats.ItemEvSource
import com.cobblemon.mod.common.api.pokemon.stats.Stat
import com.cobblemon.mod.common.item.CobblemonItem
import com.cobblemon.mod.common.item.battle.BagItem
import com.cobblemon.mod.common.pokemon.EVs
import com.cobblemon.mod.common.pokemon.Pokemon
import com.cobblemon.mod.common.util.giveOrDropItemStack
import net.minecraft.server.level.ServerPlayer
import net.minecraft.sounds.SoundEvent
import net.minecraft.world.InteractionHand
import net.minecraft.world.InteractionResultHolder
import net.minecraft.world.entity.player.Player
import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.Items
import net.minecraft.world.level.Level
abstract class EVIncreaseItem(
val stat: Stat,
val evIncreaseAmount: Int,
) : CobblemonItem(Properties()), PokemonSelectingItem {
override val bagItem = null
interface EVIncreaseItem: PokemonSelectingItem {
val stat: Stat
val evIncreaseAmount: Int
override val bagItem: BagItem?
get() = null
override fun canUseOnPokemon(stack: ItemStack, pokemon: Pokemon) = pokemon.evs.getOrDefault(stat) < EVs.MAX_STAT_VALUE &&
super.canUseOnPokemon(stack, pokemon)
abstract val sound: SoundEvent
val sound: SoundEvent
override fun applyToPokemon(
player: ServerPlayer,
@@ -51,11 +50,4 @@ abstract class EVIncreaseItem(
InteractionResultHolder.fail(stack)
}
}
override fun use(world: Level, user: Player, hand: InteractionHand): InteractionResultHolder<ItemStack> {
if (user is ServerPlayer) {
return use(user, user.getItemInHand(hand))
}
return InteractionResultHolder.success(user.getItemInHand(hand))
}
}
@@ -10,8 +10,23 @@ package com.cobblemon.mod.common.item.interactive
import com.cobblemon.mod.common.CobblemonSounds
import com.cobblemon.mod.common.api.pokemon.stats.Stat
import com.cobblemon.mod.common.item.CobblemonItem
import net.minecraft.server.level.ServerPlayer
import net.minecraft.sounds.SoundEvent
import net.minecraft.world.InteractionHand
import net.minecraft.world.InteractionResultHolder
import net.minecraft.world.entity.player.Player
import net.minecraft.world.item.ItemStack
import net.minecraft.world.level.Level
class FeatherItem(stat: Stat) : EVIncreaseItem(stat, 1) {
class FeatherItem(override val stat: Stat): CobblemonItem(Properties()), EVIncreaseItem {
override val evIncreaseAmount: Int = 1
override val sound: SoundEvent = CobblemonSounds.MEDICINE_FEATHER_USE
override fun use(world: Level, user: Player, hand: InteractionHand): InteractionResultHolder<ItemStack> {
if (user is ServerPlayer) {
return use(user, user.getItemInHand(hand))
}
return InteractionResultHolder.success(user.getItemInHand(hand))
}
}
@@ -9,14 +9,19 @@
package com.cobblemon.mod.common.item.interactive
import com.cobblemon.mod.common.CobblemonSounds
import com.cobblemon.mod.common.api.pokemon.stats.Stats
import com.cobblemon.mod.common.api.pokemon.stats.Stat
import com.cobblemon.mod.common.item.CobblemonItem
import com.cobblemon.mod.common.pokemon.Pokemon
import net.minecraft.server.level.ServerPlayer
import net.minecraft.sounds.SoundEvent
import net.minecraft.world.InteractionHand
import net.minecraft.world.InteractionResultHolder
import net.minecraft.world.entity.player.Player
import net.minecraft.world.item.ItemStack
import net.minecraft.world.level.Level
class MochiItem(stat: Stats): EVIncreaseItem(stat, 4) {
class MochiItem(override val stat: Stat): CobblemonItem(Properties()), EVIncreaseItem {
override val evIncreaseAmount: Int = 4
override val sound: SoundEvent = CobblemonSounds.MOCHI_USE
override fun applyToPokemon(player: ServerPlayer, stack: ItemStack, pokemon: Pokemon): InteractionResultHolder<ItemStack> {
@@ -28,4 +33,11 @@ class MochiItem(stat: Stats): EVIncreaseItem(stat, 4) {
return super.applyToPokemon(player, stack, pokemon)
}
override fun use(world: Level, user: Player, hand: InteractionHand): InteractionResultHolder<ItemStack> {
if (user is ServerPlayer) {
return use(user, user.getItemInHand(hand))
}
return InteractionResultHolder.success(user.getItemInHand(hand))
}
}
@@ -11,21 +11,22 @@ package com.cobblemon.mod.common.item.interactive
import com.cobblemon.mod.common.CobblemonSounds
import com.cobblemon.mod.common.api.item.PokemonAndMoveSelectingItem
import com.cobblemon.mod.common.api.moves.Move
import com.cobblemon.mod.common.item.CobblemonItem
import com.cobblemon.mod.common.pokemon.Pokemon
import com.cobblemon.mod.common.util.giveOrDropItemStack
import net.minecraft.server.level.ServerPlayer
import net.minecraft.world.InteractionHand
import net.minecraft.world.InteractionResultHolder
import net.minecraft.world.item.ItemNameBlockItem
import net.minecraft.world.entity.player.Player
import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.Items
import net.minecraft.world.item.Rarity
import net.minecraft.world.level.Level
import net.minecraft.world.level.block.Block
class PPUpItem(
val amount: Int
) : CobblemonItem(Properties().apply {
val amount: Int, block: Block
) : ItemNameBlockItem(block, Properties().apply {
if (amount>1) rarity(Rarity.UNCOMMON)
}), PokemonAndMoveSelectingItem {
@@ -9,9 +9,25 @@
package com.cobblemon.mod.common.item.interactive
import com.cobblemon.mod.common.CobblemonSounds
import com.cobblemon.mod.common.api.pokemon.stats.Stats
import com.cobblemon.mod.common.api.pokemon.stats.Stat
import net.minecraft.server.level.ServerPlayer
import net.minecraft.sounds.SoundEvent
import net.minecraft.world.InteractionHand
import net.minecraft.world.InteractionResultHolder
import net.minecraft.world.entity.player.Player
import net.minecraft.world.item.ItemNameBlockItem
import net.minecraft.world.item.ItemStack
import net.minecraft.world.level.Level
import net.minecraft.world.level.block.Block
class VitaminItem(stat: Stats) : EVIncreaseItem(stat, 10) {
class VitaminItem(override val stat: Stat, block: Block): ItemNameBlockItem(block, Properties()), EVIncreaseItem {
override val evIncreaseAmount: Int = 10
override val sound: SoundEvent = CobblemonSounds.MEDICINE_PILLS_USE
override fun use(world: Level, user: Player, hand: InteractionHand): InteractionResultHolder<ItemStack> {
if (user is ServerPlayer) {
return use(user, user.getItemInHand(hand))
}
return InteractionResultHolder.success(user.getItemInHand(hand))
}
}
@@ -9,6 +9,9 @@
package com.cobblemon.mod.common.net.messages.client.pokemon.update.evolution
import com.cobblemon.mod.common.api.net.NetworkPacket
import com.cobblemon.mod.common.api.pokeball.PokeBalls
import com.cobblemon.mod.common.net.messages.client.pokemon.update.SingleUpdatePacket
import com.cobblemon.mod.common.pokemon.Pokemon
import com.cobblemon.mod.common.util.cobblemonResource
import com.cobblemon.mod.common.util.readMap
import com.cobblemon.mod.common.util.readIdentifier
@@ -1,51 +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.net.messages.client.spawn
import com.cobblemon.mod.common.entity.PoseType
import com.cobblemon.mod.common.entity.projectile.FallingStarEntity
import com.cobblemon.mod.common.net.IntSize
import com.cobblemon.mod.common.util.cobblemonResource
import com.cobblemon.mod.common.util.readSizedInt
import com.cobblemon.mod.common.util.writeSizedInt
import net.minecraft.client.multiplayer.ClientLevel
import net.minecraft.network.RegistryFriendlyByteBuf
import net.minecraft.network.protocol.game.ClientboundAddEntityPacket
import net.minecraft.resources.ResourceLocation
import net.minecraft.world.entity.Entity
class SpawnFallingStarPacket(
val poseType: PoseType,
val horizontalDirection: Float,
vanillaSpawnPacket: ClientboundAddEntityPacket
) : SpawnExtraDataEntityPacket<SpawnFallingStarPacket, FallingStarEntity>(vanillaSpawnPacket) {
override val id: ResourceLocation = ID
override fun applyData(entity: FallingStarEntity, level: ClientLevel) {
entity.poseType = this.poseType
entity.horizontalDirection = this.horizontalDirection
}
override fun checkType(entity: Entity): Boolean = entity is FallingStarEntity
override fun encodeEntityData(buffer: RegistryFriendlyByteBuf) {
buffer.writeSizedInt(size = IntSize.U_BYTE, poseType.ordinal)
buffer.writeFloat(horizontalDirection)
}
companion object {
val ID = cobblemonResource("spawn_falling_star_entity")
fun decode(buffer: RegistryFriendlyByteBuf): SpawnFallingStarPacket {
val poseType = PoseType.entries[buffer.readSizedInt(IntSize.U_BYTE)]
val horizontalDirection = buffer.readFloat()
val vanillaPacket = decodeVanillaPacket(buffer)
return SpawnFallingStarPacket(poseType, horizontalDirection, vanillaPacket)
}
}
}
@@ -378,7 +378,11 @@ abstract class FormData(
* @return The literal Showdown ID of this form only. If this is the [Species.standardForm], this will be an empty
* string.
*/
fun formOnlyShowdownId(): String = if (this is TemporaryForm) this.parentForm.formOnlyShowdownId() + ShowdownIdentifiable.REGEX.replace(this.name.lowercase(), "") else ""
fun formOnlyShowdownId(): String = if (this is TemporaryForm) {
this.parentForm.formOnlyShowdownId() + ShowdownIdentifiable.REGEX.replace(this.name.lowercase(), "")
} else if (this is PermanentForm && this !is StandardForm) {
ShowdownIdentifiable.REGEX.replace(this.name.lowercase(), "")
} else ""
// TODO - will including 'standard' cause breakage?
@@ -97,7 +97,6 @@ import com.cobblemon.mod.common.pokemon.activestate.SentOutState
import com.cobblemon.mod.common.pokemon.activestate.ShoulderedState
import com.cobblemon.mod.common.pokemon.feature.SeasonFeatureHandler
import com.cobblemon.mod.common.pokemon.feature.StashHandler
import com.cobblemon.mod.common.pokemon.megastone.MegaBondImprinting
import com.cobblemon.mod.common.pokemon.properties.BattleCloneProperty
import com.cobblemon.mod.common.pokemon.properties.UncatchableProperty
import com.cobblemon.mod.common.pokemon.status.PersistentStatus
@@ -1647,9 +1646,6 @@ open class Pokemon : ShowdownIdentifiable {
if (!this.isPossibleFriendship(sanitizedAmount)) {
return false
}
if (sanitizedAmount > this.friendship) {
MegaBondImprinting.increaseBond(this, sanitizedAmount - this.friendship)
}
this.friendship = sanitizedAmount
return true
}
@@ -1664,8 +1660,6 @@ open class Pokemon : ShowdownIdentifiable {
* @return True if mutation was successful
*/
fun incrementFriendship(amount : Int, coerceSafe: Boolean = true): Boolean {
// increase mega bond even if friendship is maxxed out
MegaBondImprinting.increaseBond(this, amount.absoluteValue)
val sanitizedAmount = if (coerceSafe) amount.absoluteValue.coerceAtMost(Cobblemon.config.maxPokemonFriendship - this.friendship) else amount.absoluteValue
val newValue = this.friendship + sanitizedAmount
if (this.isPossibleFriendship(newValue)) {
@@ -1,63 +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.pokemon.megastone
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.CobblemonItemComponents
import com.cobblemon.mod.common.CobblemonItems
import com.cobblemon.mod.common.api.item.HeldItems
import com.cobblemon.mod.common.item.components.MegaBondComponent
import com.cobblemon.mod.common.net.messages.client.pokemon.update.HeldItemUpdatePacket
import com.cobblemon.mod.common.pokemon.Pokemon
import com.cobblemon.mod.common.pokemon.helditem.CobblemonHeldItemManager
import net.minecraft.core.registries.BuiltInRegistries
import net.minecraft.world.item.Item
import net.minecraft.world.item.ItemStack
object MegaBondImprinting {
fun increaseBond(pokemon: Pokemon, amount: Int) {
// exit early if it is on the client, friendship is not a positive numbah or if the item held isn't a dormant megga stone
if (pokemon.isClient || amount <= 0 || !pokemon.heldItemNoCopy().`is`(CobblemonItems.DORMANT_MEGA_STONE)) {
return
}
val speciesId = pokemon.species.showdownId()
if (!HeldItems.megaStones.containsValue(speciesId)) {
return
}
// keep the existing bond only if the stone is already tied to the current pokemon and if not start back at no bondd
val existingBond = pokemon.heldItemNoCopy().get(CobblemonItemComponents.MEGA_BOND)?.takeIf { it.owner == pokemon.uuid }?.bond ?: 0
val bond = (existingBond + amount).coerceAtMost(Cobblemon.config.maxPokemonFriendship)
pokemon.heldItemNoCopy().set(CobblemonItemComponents.MEGA_BOND, MegaBondComponent(pokemon.uuid, bond))
pokemon.onChange(HeldItemUpdatePacket({ pokemon }, pokemon.heldItemNoCopy()))
convertToMegaStone(pokemon)
}
fun convertToMegaStone(pokemon: Pokemon): Item? {
// putting this check here again because we may want to keep the command version of setting the mega bond
// we may want to keep the client check too?
if (!pokemon.heldItemNoCopy().`is`(CobblemonItems.DORMANT_MEGA_STONE)) {
return null
}
val stoneMegaBond = pokemon.heldItemNoCopy().get(CobblemonItemComponents.MEGA_BOND) ?: return null
// is the dormant stone already bonded with the current pokemon? Maybe it came from another pokemon and needs reset
if (stoneMegaBond.owner != pokemon.uuid || stoneMegaBond.bond < Cobblemon.config.maxPokemonFriendship) {
return null
}
val speciesId = pokemon.species.showdownId()
// we gotta get the mega stone that it should turn into which is kind of a task
val megaStone = HeldItems.megaStones.filterValues { it == speciesId }.keys.mapNotNull(::getCobblemonItemFromShowdownID).randomOrNull() ?: return null
pokemon.swapHeldItem(ItemStack(megaStone), decrement = false)
return megaStone
}
// The mega stones ids come from showdown I think so we cant look them up by a resource location directly
fun getCobblemonItemFromShowdownID(showdownId: String): Item? = BuiltInRegistries.ITEM.firstOrNull { CobblemonHeldItemManager.showdownIdOf(it) == showdownId }
}
@@ -8,9 +8,9 @@
package com.cobblemon.mod.common.pokemon.requirements
import com.cobblemon.mod.common.api.pokemon.transformation.requirement.TransformationRequirement
import com.cobblemon.mod.common.api.pokemon.stats.Stat
import com.cobblemon.mod.common.api.pokemon.stats.Stats
import com.cobblemon.mod.common.api.pokemon.transformation.requirement.TransformationRequirement
import com.cobblemon.mod.common.pokemon.Pokemon
class StatCompareRequirement : TransformationRequirement {
@@ -8,9 +8,9 @@
package com.cobblemon.mod.common.pokemon.requirements
import com.cobblemon.mod.common.api.pokemon.transformation.requirement.TransformationRequirement
import com.cobblemon.mod.common.api.pokemon.stats.Stat
import com.cobblemon.mod.common.api.pokemon.stats.Stats
import com.cobblemon.mod.common.api.pokemon.transformation.requirement.TransformationRequirement
import com.cobblemon.mod.common.pokemon.Pokemon
class StatEqualRequirement : TransformationRequirement {
@@ -16,6 +16,8 @@ import com.cobblemon.mod.common.api.pokemon.transformation.requirement.Transform
import com.cobblemon.mod.common.pokemon.requirements.AdvancementRequirement
import com.cobblemon.mod.common.pokemon.requirements.ChanceRequirement
import com.cobblemon.mod.common.pokemon.requirements.OwnerHoldsItemRequirement
import com.cobblemon.mod.common.pokemon.requirements.StatCompareRequirement
import com.cobblemon.mod.common.pokemon.requirements.StatEqualRequirement
import com.cobblemon.mod.common.pokemon.transformation.requirements.*
import com.cobblemon.mod.common.util.adapters.ExpressionLikeAdapter
import com.cobblemon.mod.common.util.adapters.IdentifierAdapter
@@ -20,6 +20,7 @@ import com.cobblemon.mod.common.api.pokemon.transformation.Transformation
import com.cobblemon.mod.common.api.pokemon.transformation.evolution.PreEvolution
import com.cobblemon.mod.common.api.pokemon.transformation.requirement.TransformationRequirement
import com.cobblemon.mod.common.api.pokemon.transformation.trigger.ContextTrigger
import com.cobblemon.mod.common.api.pokemon.transformation.trigger.NoTrigger
import com.cobblemon.mod.common.api.pokemon.transformation.trigger.TransformationTrigger
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.pokemon.FormData
@@ -27,7 +28,6 @@ import com.cobblemon.mod.common.pokemon.Pokemon
import com.cobblemon.mod.common.pokemon.Species
import com.cobblemon.mod.common.pokemon.activestate.ShoulderedState
import com.cobblemon.mod.common.pokemon.transformation.evolution.Evolution
import com.cobblemon.mod.common.pokemon.transformation.triggers.LevelUpTrigger
import com.cobblemon.mod.common.util.asIdentifierDefaultingNamespace
import com.cobblemon.mod.common.util.cobblemonResource
import net.minecraft.resources.ResourceLocation
@@ -51,7 +51,7 @@ open class TemporaryForm (
/** Whether this form can be freely toggled after requirements are initially met. */
val toggleable: Boolean = false,
/** The [TransformationTrigger] to change to this form OUTSIDE of battle. */
override val trigger: TransformationTrigger = LevelUpTrigger(),
override val trigger: TransformationTrigger = NoTrigger,
/** The [TransformationRequirement]s that need to be satisfied for this form OUTSIDE of battle. */
override val requirements: Set<TransformationRequirement> = mutableSetOf(),
/** If this form can be deferred and started whenever rather than immediately on trigger. */
@@ -70,7 +70,8 @@ open class TemporaryForm (
?: throw Exception()
val revertActionEffect: ActionEffectTimeline
get() = ActionEffects.actionEffects[actionEffectIdentifier?.withPath { "revert" } ?: cobblemonResource("form_${name.lowercase()}_revert")]
get() = actionEffectIdentifier?.withSuffix("_revert")?.let(ActionEffects.actionEffects::get)
?: ActionEffects.actionEffects[cobblemonResource("form_${name.lowercase()}_revert")]
?: ActionEffects.actionEffects["generic_form_revert".asIdentifierDefaultingNamespace()]
?: throw Exception()
@@ -181,9 +182,7 @@ open class TemporaryForm (
}
fun revert(pokemon: Pokemon) {
if (toggleable) {
pokemon.form = parentForm
}
pokemon.form = parentForm
}
override fun convertToDisplay(pokemon: Pokemon): FormDisplay {
@@ -1,33 +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.pokemon.transformation.requirements
import com.cobblemon.mod.common.api.pokemon.stats.Stat
import com.cobblemon.mod.common.api.pokemon.stats.Stats
import com.cobblemon.mod.common.api.pokemon.transformation.requirement.TransformationRequirement
import com.cobblemon.mod.common.pokemon.Pokemon
/**
* A [TransformationRequirement] that checks if one of a [Pokemon]'s stats is greater than another.
*
* @property highStat The [Stat] expecting to be greater.
* @property lowStat The [Stat] comparing against.
*
* @author TimInc
* @since May 14, 2024
*/
class StatCompareRequirement(val highStat: Stat = Stats.ATTACK, val lowStat: Stat = Stats.DEFENCE) : TransformationRequirement {
companion object {
const val ADAPTER_VARIANT = "stat_compare"
}
override fun check(pokemon: Pokemon): Boolean {
return pokemon.getStat(highStat) > pokemon.getStat(lowStat)
}
}
@@ -1,33 +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.pokemon.transformation.requirements
import com.cobblemon.mod.common.api.pokemon.stats.Stat
import com.cobblemon.mod.common.api.pokemon.transformation.requirement.TransformationRequirement
import com.cobblemon.mod.common.api.pokemon.stats.Stats
import com.cobblemon.mod.common.pokemon.Pokemon
/**
* A [TransformationRequirement] that checks if two of a [Pokemon]'s stats are equal.
*
* @property statOne The [Stat] comparing with.
* @property statTwo The [Stat] comparing against.
*
* @author TimInc
* @since May 14, 2024
*/
class StatEqualRequirement(val statOne: Stat = Stats.ATTACK, val statTwo: Stat = Stats.DEFENCE) : TransformationRequirement {
companion object {
const val ADAPTER_VARIANT = "stat_equal"
}
override fun check(pokemon: Pokemon): Boolean {
return pokemon.getStat(statOne) == pokemon.getStat(statTwo)
}
}
@@ -1,13 +0,0 @@
{
"format_version": "1.8.0",
"animations": {
"animation.falling_star.idle": {
"loop": "hold_on_last_frame",
"particle_effects": {
"0.0": {
"effect": "falling_star"
}
}
}
}
}
@@ -1,25 +0,0 @@
{
"format_version": "1.12.0",
"minecraft:geometry": [
{
"description": {
"identifier": "geometry.falling_star",
"texture_width": 16,
"texture_height": 16,
"visible_bounds_width": 3,
"visible_bounds_height": 2.5,
"visible_bounds_offset": [0, 0.75, 0]
},
"bones": [
{
"name": "falling_star",
"pivot": [0, 0, 0],
"cubes": [
{"origin": [-6, 2.6, -6], "size": [12, 12, 12], "uv": [8, 4]},
{"origin": [-6, 2.6, -6], "size": [12, 12, 12], "pivot": [0, 8.6, 0], "rotation": [-45, 45, 0], "uv": [8, 4]}
]
}
]
}
]
}
@@ -1,10 +0,0 @@
{
"poses": {
"normal": {
"poseName": "normal",
"transformTicks": 0,
"poseTypes": ["NONE"],
"animations": ["q.bedrock('falling_star', 'idle')"]
}
}
}
@@ -1,13 +0,0 @@
{
"name": "cobblemon:falling_star",
"order": 0,
"variations": [
{
"aspects": [],
"poser": "cobblemon:falling_star",
"model": "cobblemon:falling_star.geo",
"texture": "cobblemon:textures/falling_star/falling_star.png",
"layers": []
}
]
}
@@ -1,66 +0,0 @@
{
"format_version": "1.10.0",
"particle_effect": {
"description": {
"identifier": "cobblemon:falling_star",
"basic_render_parameters": {
"material": "particles_blend",
"texture": "textures/particles/generic/sparkle/glowingsparkle_yellow"
}
},
"components": {
"minecraft:emitter_rate_steady": {
"spawn_rate": 30,
"max_particles": 60
},
"minecraft:emitter_lifetime_looping": {
"active_time": 1
},
"minecraft:emitter_shape_point": {},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": 0.5,
"minecraft:particle_motion_dynamic": {},
"minecraft:particle_appearance_billboard": {
"size": [
0.05,
0.05
],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 8,
"texture_height": 32,
"flipbook": {
"base_UV": [
0,
0
],
"size_UV": [
8,
8
],
"step_UV": [
0,
8
],
"frames_per_second": 24,
"max_frame": 4,
"loop": true
}
}
},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.particle_age / v.particle_lifetime",
"gradient": {
"0.0": "#FFFF9BAF",
"0.38": "#FFFFF864",
"0.73": "#FFB63EFB",
"1.0": "#006EFFEC"
}
}
}
}
}
}
@@ -1,63 +1,63 @@
{
"variants": {
"facing=north,amount=1": {
"model": "cobblemon:block/antidote_0"
"model": "cobblemon:block/antidote_1"
},
"facing=east,amount=1": {
"model": "cobblemon:block/antidote_0",
"model": "cobblemon:block/antidote_1",
"y": 90
},
"facing=south,amount=1": {
"model": "cobblemon:block/antidote_0",
"model": "cobblemon:block/antidote_1",
"y": 180
},
"facing=west,amount=1": {
"model": "cobblemon:block/antidote_0",
"model": "cobblemon:block/antidote_1",
"y": 270
},
"facing=north,amount=2": {
"model": "cobblemon:block/antidote_1"
"model": "cobblemon:block/antidote_2"
},
"facing=east,amount=2": {
"model": "cobblemon:block/antidote_1",
"model": "cobblemon:block/antidote_2",
"y": 90
},
"facing=south,amount=2": {
"model": "cobblemon:block/antidote_1",
"model": "cobblemon:block/antidote_2",
"y": 180
},
"facing=west,amount=2": {
"model": "cobblemon:block/antidote_1",
"model": "cobblemon:block/antidote_2",
"y": 270
},
"facing=north,amount=3": {
"model": "cobblemon:block/antidote_2"
"model": "cobblemon:block/antidote_3"
},
"facing=east,amount=3": {
"model": "cobblemon:block/antidote_2",
"model": "cobblemon:block/antidote_3",
"y": 90
},
"facing=south,amount=3": {
"model": "cobblemon:block/antidote_2",
"model": "cobblemon:block/antidote_3",
"y": 180
},
"facing=west,amount=3": {
"model": "cobblemon:block/antidote_2",
"model": "cobblemon:block/antidote_3",
"y": 270
},
"facing=north,amount=4": {
"model": "cobblemon:block/antidote_3"
"model": "cobblemon:block/antidote_4"
},
"facing=east,amount=4": {
"model": "cobblemon:block/antidote_3",
"model": "cobblemon:block/antidote_4",
"y": 90
},
"facing=south,amount=4": {
"model": "cobblemon:block/antidote_3",
"model": "cobblemon:block/antidote_4",
"y": 180
},
"facing=west,amount=4": {
"model": "cobblemon:block/antidote_3",
"model": "cobblemon:block/antidote_4",
"y": 270
}
}
@@ -1,63 +1,63 @@
{
"variants": {
"facing=north,amount=1": {
"model": "cobblemon:block/awakening_0"
"model": "cobblemon:block/awakening_1"
},
"facing=east,amount=1": {
"model": "cobblemon:block/awakening_0",
"model": "cobblemon:block/awakening_1",
"y": 90
},
"facing=south,amount=1": {
"model": "cobblemon:block/awakening_0",
"model": "cobblemon:block/awakening_1",
"y": 180
},
"facing=west,amount=1": {
"model": "cobblemon:block/awakening_0",
"model": "cobblemon:block/awakening_1",
"y": 270
},
"facing=north,amount=2": {
"model": "cobblemon:block/awakening_1"
"model": "cobblemon:block/awakening_2"
},
"facing=east,amount=2": {
"model": "cobblemon:block/awakening_1",
"model": "cobblemon:block/awakening_2",
"y": 90
},
"facing=south,amount=2": {
"model": "cobblemon:block/awakening_1",
"model": "cobblemon:block/awakening_2",
"y": 180
},
"facing=west,amount=2": {
"model": "cobblemon:block/awakening_1",
"model": "cobblemon:block/awakening_2",
"y": 270
},
"facing=north,amount=3": {
"model": "cobblemon:block/awakening_2"
"model": "cobblemon:block/awakening_3"
},
"facing=east,amount=3": {
"model": "cobblemon:block/awakening_2",
"model": "cobblemon:block/awakening_3",
"y": 90
},
"facing=south,amount=3": {
"model": "cobblemon:block/awakening_2",
"model": "cobblemon:block/awakening_3",
"y": 180
},
"facing=west,amount=3": {
"model": "cobblemon:block/awakening_2",
"model": "cobblemon:block/awakening_3",
"y": 270
},
"facing=north,amount=4": {
"model": "cobblemon:block/awakening_3"
"model": "cobblemon:block/awakening_4"
},
"facing=east,amount=4": {
"model": "cobblemon:block/awakening_3",
"model": "cobblemon:block/awakening_4",
"y": 90
},
"facing=south,amount=4": {
"model": "cobblemon:block/awakening_3",
"model": "cobblemon:block/awakening_4",
"y": 180
},
"facing=west,amount=4": {
"model": "cobblemon:block/awakening_3",
"model": "cobblemon:block/awakening_4",
"y": 270
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/bright_powder",
"y": 180
},
"facing=west": {
"model": "cobblemon:block/bright_powder",
"y": 270
},
"facing=north": {
"model": "cobblemon:block/bright_powder"
},
"facing=east": {
"model": "cobblemon:block/bright_powder",
"y": 90
}
}
}
@@ -1,63 +1,63 @@
{
"variants": {
"facing=north,amount=1": {
"model": "cobblemon:block/burn_heal_0"
"model": "cobblemon:block/burn_heal_1"
},
"facing=east,amount=1": {
"model": "cobblemon:block/burn_heal_0",
"model": "cobblemon:block/burn_heal_1",
"y": 90
},
"facing=south,amount=1": {
"model": "cobblemon:block/burn_heal_0",
"model": "cobblemon:block/burn_heal_1",
"y": 180
},
"facing=west,amount=1": {
"model": "cobblemon:block/burn_heal_0",
"model": "cobblemon:block/burn_heal_1",
"y": 270
},
"facing=north,amount=2": {
"model": "cobblemon:block/burn_heal_1"
"model": "cobblemon:block/burn_heal_2"
},
"facing=east,amount=2": {
"model": "cobblemon:block/burn_heal_1",
"model": "cobblemon:block/burn_heal_2",
"y": 90
},
"facing=south,amount=2": {
"model": "cobblemon:block/burn_heal_1",
"model": "cobblemon:block/burn_heal_2",
"y": 180
},
"facing=west,amount=2": {
"model": "cobblemon:block/burn_heal_1",
"model": "cobblemon:block/burn_heal_2",
"y": 270
},
"facing=north,amount=3": {
"model": "cobblemon:block/burn_heal_2"
"model": "cobblemon:block/burn_heal_3"
},
"facing=east,amount=3": {
"model": "cobblemon:block/burn_heal_2",
"model": "cobblemon:block/burn_heal_3",
"y": 90
},
"facing=south,amount=3": {
"model": "cobblemon:block/burn_heal_2",
"model": "cobblemon:block/burn_heal_3",
"y": 180
},
"facing=west,amount=3": {
"model": "cobblemon:block/burn_heal_2",
"model": "cobblemon:block/burn_heal_3",
"y": 270
},
"facing=north,amount=4": {
"model": "cobblemon:block/burn_heal_3"
"model": "cobblemon:block/burn_heal_4"
},
"facing=east,amount=4": {
"model": "cobblemon:block/burn_heal_3",
"model": "cobblemon:block/burn_heal_4",
"y": 90
},
"facing=south,amount=4": {
"model": "cobblemon:block/burn_heal_3",
"model": "cobblemon:block/burn_heal_4",
"y": 180
},
"facing=west,amount=4": {
"model": "cobblemon:block/burn_heal_3",
"model": "cobblemon:block/burn_heal_4",
"y": 270
}
}
@@ -0,0 +1,64 @@
{
"variants": {
"amount=1,facing=north": {
"model": "cobblemon:block/calcium_1"
},
"amount=1,facing=east": {
"model": "cobblemon:block/calcium_1",
"y": 90
},
"amount=1,facing=south": {
"model": "cobblemon:block/calcium_1",
"y": 180
},
"amount=1,facing=west": {
"model": "cobblemon:block/calcium_1",
"y": 270
},
"amount=2,facing=north": {
"model": "cobblemon:block/calcium_2"
},
"amount=2,facing=east": {
"model": "cobblemon:block/calcium_2",
"y": 90
},
"amount=2,facing=south": {
"model": "cobblemon:block/calcium_2",
"y": 180
},
"amount=2,facing=west": {
"model": "cobblemon:block/calcium_2",
"y": 270
},
"amount=3,facing=north": {
"model": "cobblemon:block/calcium_3"
},
"amount=3,facing=east": {
"model": "cobblemon:block/calcium_3",
"y": 90
},
"amount=3,facing=south": {
"model": "cobblemon:block/calcium_3",
"y": 180
},
"amount=3,facing=west": {
"model": "cobblemon:block/calcium_3",
"y": 270
},
"amount=4,facing=north": {
"model": "cobblemon:block/calcium_4"
},
"amount=4,facing=east": {
"model": "cobblemon:block/calcium_4",
"y": 90
},
"amount=4,facing=south": {
"model": "cobblemon:block/calcium_4",
"y": 180
},
"amount=4,facing=west": {
"model": "cobblemon:block/calcium_4",
"y": 270
}
}
}
@@ -0,0 +1,64 @@
{
"variants": {
"amount=1,facing=north": {
"model": "cobblemon:block/carbos_1"
},
"amount=1,facing=east": {
"model": "cobblemon:block/carbos_1",
"y": 90
},
"amount=1,facing=south": {
"model": "cobblemon:block/carbos_1",
"y": 180
},
"amount=1,facing=west": {
"model": "cobblemon:block/carbos_1",
"y": 270
},
"amount=2,facing=north": {
"model": "cobblemon:block/carbos_2"
},
"amount=2,facing=east": {
"model": "cobblemon:block/carbos_2",
"y": 90
},
"amount=2,facing=south": {
"model": "cobblemon:block/carbos_2",
"y": 180
},
"amount=2,facing=west": {
"model": "cobblemon:block/carbos_2",
"y": 270
},
"amount=3,facing=north": {
"model": "cobblemon:block/carbos_3"
},
"amount=3,facing=east": {
"model": "cobblemon:block/carbos_3",
"y": 90
},
"amount=3,facing=south": {
"model": "cobblemon:block/carbos_3",
"y": 180
},
"amount=3,facing=west": {
"model": "cobblemon:block/carbos_3",
"y": 270
},
"amount=4,facing=north": {
"model": "cobblemon:block/carbos_4"
},
"amount=4,facing=east": {
"model": "cobblemon:block/carbos_4",
"y": 90
},
"amount=4,facing=south": {
"model": "cobblemon:block/carbos_4",
"y": 180
},
"amount=4,facing=west": {
"model": "cobblemon:block/carbos_4",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/chipped_pot",
"y": 180
},
"facing=west": {
"model": "cobblemon:block/chipped_pot",
"y": 270
},
"facing=north": {
"model": "cobblemon:block/chipped_pot"
},
"facing=east": {
"model": "cobblemon:block/chipped_pot",
"y": 90
}
}
}
@@ -1,123 +1,123 @@
{
"variants": {
"facing=north,amount=1": {
"model": "cobblemon:block/cleanse_tag_0"
"model": "cobblemon:block/cleanse_tag_1"
},
"facing=east,amount=1": {
"model": "cobblemon:block/cleanse_tag_0",
"model": "cobblemon:block/cleanse_tag_1",
"y": 90
},
"facing=south,amount=1": {
"model": "cobblemon:block/cleanse_tag_0",
"model": "cobblemon:block/cleanse_tag_1",
"y": 180
},
"facing=west,amount=1": {
"model": "cobblemon:block/cleanse_tag_0",
"model": "cobblemon:block/cleanse_tag_1",
"y": 270
},
"facing=north,amount=2": {
"model": "cobblemon:block/cleanse_tag_1"
"model": "cobblemon:block/cleanse_tag_2"
},
"facing=east,amount=2": {
"model": "cobblemon:block/cleanse_tag_1",
"model": "cobblemon:block/cleanse_tag_2",
"y": 90
},
"facing=south,amount=2": {
"model": "cobblemon:block/cleanse_tag_1",
"model": "cobblemon:block/cleanse_tag_2",
"y": 180
},
"facing=west,amount=2": {
"model": "cobblemon:block/cleanse_tag_1",
"model": "cobblemon:block/cleanse_tag_2",
"y": 270
},
"facing=north,amount=3": {
"model": "cobblemon:block/cleanse_tag_2"
"model": "cobblemon:block/cleanse_tag_3"
},
"facing=east,amount=3": {
"model": "cobblemon:block/cleanse_tag_2",
"model": "cobblemon:block/cleanse_tag_3",
"y": 90
},
"facing=south,amount=3": {
"model": "cobblemon:block/cleanse_tag_2",
"model": "cobblemon:block/cleanse_tag_3",
"y": 180
},
"facing=west,amount=3": {
"model": "cobblemon:block/cleanse_tag_2",
"model": "cobblemon:block/cleanse_tag_3",
"y": 270
},
"facing=north,amount=4": {
"model": "cobblemon:block/cleanse_tag_3"
"model": "cobblemon:block/cleanse_tag_4"
},
"facing=east,amount=4": {
"model": "cobblemon:block/cleanse_tag_3",
"model": "cobblemon:block/cleanse_tag_4",
"y": 90
},
"facing=south,amount=4": {
"model": "cobblemon:block/cleanse_tag_3",
"model": "cobblemon:block/cleanse_tag_4",
"y": 180
},
"facing=west,amount=4": {
"model": "cobblemon:block/cleanse_tag_3",
"model": "cobblemon:block/cleanse_tag_4",
"y": 270
},
"facing=north,amount=5": {
"model": "cobblemon:block/cleanse_tag_4"
"model": "cobblemon:block/cleanse_tag_5"
},
"facing=east,amount=5": {
"model": "cobblemon:block/cleanse_tag_4",
"model": "cobblemon:block/cleanse_tag_5",
"y": 90
},
"facing=south,amount=5": {
"model": "cobblemon:block/cleanse_tag_4",
"model": "cobblemon:block/cleanse_tag_5",
"y": 180
},
"facing=west,amount=5": {
"model": "cobblemon:block/cleanse_tag_4",
"model": "cobblemon:block/cleanse_tag_5",
"y": 270
},
"facing=north,amount=6": {
"model": "cobblemon:block/cleanse_tag_5"
"model": "cobblemon:block/cleanse_tag_6"
},
"facing=east,amount=6": {
"model": "cobblemon:block/cleanse_tag_5",
"model": "cobblemon:block/cleanse_tag_6",
"y": 90
},
"facing=south,amount=6": {
"model": "cobblemon:block/cleanse_tag_5",
"model": "cobblemon:block/cleanse_tag_6",
"y": 180
},
"facing=west,amount=6": {
"model": "cobblemon:block/cleanse_tag_5",
"model": "cobblemon:block/cleanse_tag_6",
"y": 270
},
"facing=north,amount=7": {
"model": "cobblemon:block/cleanse_tag_6"
"model": "cobblemon:block/cleanse_tag_7"
},
"facing=east,amount=7": {
"model": "cobblemon:block/cleanse_tag_6",
"model": "cobblemon:block/cleanse_tag_7",
"y": 90
},
"facing=south,amount=7": {
"model": "cobblemon:block/cleanse_tag_6",
"model": "cobblemon:block/cleanse_tag_7",
"y": 180
},
"facing=west,amount=7": {
"model": "cobblemon:block/cleanse_tag_6",
"model": "cobblemon:block/cleanse_tag_7",
"y": 270
},
"facing=north,amount=8": {
"model": "cobblemon:block/cleanse_tag_7"
"model": "cobblemon:block/cleanse_tag_8"
},
"facing=east,amount=8": {
"model": "cobblemon:block/cleanse_tag_7",
"model": "cobblemon:block/cleanse_tag_8",
"y": 90
},
"facing=south,amount=8": {
"model": "cobblemon:block/cleanse_tag_7",
"model": "cobblemon:block/cleanse_tag_8",
"y": 180
},
"facing=west,amount=8": {
"model": "cobblemon:block/cleanse_tag_7",
"model": "cobblemon:block/cleanse_tag_8",
"y": 270
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/cracked_pot",
"y": 180
},
"facing=west": {
"model": "cobblemon:block/cracked_pot",
"y": 270
},
"facing=north": {
"model": "cobblemon:block/cracked_pot"
},
"facing=east": {
"model": "cobblemon:block/cracked_pot",
"y": 90
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/damp_rock",
"y": 180
},
"facing=west": {
"model": "cobblemon:block/damp_rock",
"y": 270
},
"facing=north": {
"model": "cobblemon:block/damp_rock"
},
"facing=east": {
"model": "cobblemon:block/damp_rock",
"y": 90
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/destiny_knot",
"y": 180
},
"facing=west": {
"model": "cobblemon:block/destiny_knot",
"y": 270
},
"facing=north": {
"model": "cobblemon:block/destiny_knot"
},
"facing=east": {
"model": "cobblemon:block/destiny_knot",
"y": 90
}
}
}
@@ -1,63 +1,63 @@
{
"variants": {
"facing=north,amount=1": {
"model": "cobblemon:block/dire_hit_0"
"model": "cobblemon:block/dire_hit_1"
},
"facing=east,amount=1": {
"model": "cobblemon:block/dire_hit_0",
"model": "cobblemon:block/dire_hit_1",
"y": 90
},
"facing=south,amount=1": {
"model": "cobblemon:block/dire_hit_0",
"model": "cobblemon:block/dire_hit_1",
"y": 180
},
"facing=west,amount=1": {
"model": "cobblemon:block/dire_hit_0",
"model": "cobblemon:block/dire_hit_1",
"y": 270
},
"facing=north,amount=2": {
"model": "cobblemon:block/dire_hit_1"
"model": "cobblemon:block/dire_hit_2"
},
"facing=east,amount=2": {
"model": "cobblemon:block/dire_hit_1",
"model": "cobblemon:block/dire_hit_2",
"y": 90
},
"facing=south,amount=2": {
"model": "cobblemon:block/dire_hit_1",
"model": "cobblemon:block/dire_hit_2",
"y": 180
},
"facing=west,amount=2": {
"model": "cobblemon:block/dire_hit_1",
"model": "cobblemon:block/dire_hit_2",
"y": 270
},
"facing=north,amount=3": {
"model": "cobblemon:block/dire_hit_2"
"model": "cobblemon:block/dire_hit_3"
},
"facing=east,amount=3": {
"model": "cobblemon:block/dire_hit_2",
"model": "cobblemon:block/dire_hit_3",
"y": 90
},
"facing=south,amount=3": {
"model": "cobblemon:block/dire_hit_2",
"model": "cobblemon:block/dire_hit_3",
"y": 180
},
"facing=west,amount=3": {
"model": "cobblemon:block/dire_hit_2",
"model": "cobblemon:block/dire_hit_3",
"y": 270
},
"facing=north,amount=4": {
"model": "cobblemon:block/dire_hit_3"
"model": "cobblemon:block/dire_hit_4"
},
"facing=east,amount=4": {
"model": "cobblemon:block/dire_hit_3",
"model": "cobblemon:block/dire_hit_4",
"y": 90
},
"facing=south,amount=4": {
"model": "cobblemon:block/dire_hit_3",
"model": "cobblemon:block/dire_hit_4",
"y": 180
},
"facing=west,amount=4": {
"model": "cobblemon:block/dire_hit_3",
"model": "cobblemon:block/dire_hit_4",
"y": 270
}
}
@@ -0,0 +1,64 @@
{
"variants": {
"facing=north,amount=1": {
"model": "cobblemon:block/dubious_disc_1"
},
"facing=east,amount=1": {
"model": "cobblemon:block/dubious_disc_1",
"y": 90
},
"facing=south,amount=1": {
"model": "cobblemon:block/dubious_disc_1",
"y": 180
},
"facing=west,amount=1": {
"model": "cobblemon:block/dubious_disc_1",
"y": 270
},
"facing=north,amount=2": {
"model": "cobblemon:block/dubious_disc_2"
},
"facing=east,amount=2": {
"model": "cobblemon:block/dubious_disc_2",
"y": 90
},
"facing=south,amount=2": {
"model": "cobblemon:block/dubious_disc_2",
"y": 180
},
"facing=west,amount=2": {
"model": "cobblemon:block/dubious_disc_2",
"y": 270
},
"facing=north,amount=3": {
"model": "cobblemon:block/dubious_disc_3"
},
"facing=east,amount=3": {
"model": "cobblemon:block/dubious_disc_3",
"y": 90
},
"facing=south,amount=3": {
"model": "cobblemon:block/dubious_disc_3",
"y": 180
},
"facing=west,amount=3": {
"model": "cobblemon:block/dubious_disc_3",
"y": 270
},
"facing=north,amount=4": {
"model": "cobblemon:block/dubious_disc_4"
},
"facing=east,amount=4": {
"model": "cobblemon:block/dubious_disc_4",
"y": 90
},
"facing=south,amount=4": {
"model": "cobblemon:block/dubious_disc_4",
"y": 180
},
"facing=west,amount=4": {
"model": "cobblemon:block/dubious_disc_4",
"y": 270
}
}
}
@@ -0,0 +1,110 @@
{
"variants": {
"face=ceiling,facing=east,powered=false": {
"model": "cobblemon:block/eject_button",
"x": 180,
"y": 270
},
"face=ceiling,facing=east,powered=true": {
"model": "cobblemon:block/eject_button_pressed",
"x": 180,
"y": 270
},
"face=ceiling,facing=north,powered=false": {
"model": "cobblemon:block/eject_button",
"x": 180,
"y": 180
},
"face=ceiling,facing=north,powered=true": {
"model": "cobblemon:block/eject_button_pressed",
"x": 180,
"y": 180
},
"face=ceiling,facing=south,powered=false": {
"model": "cobblemon:block/eject_button",
"x": 180
},
"face=ceiling,facing=south,powered=true": {
"model": "cobblemon:block/eject_button_pressed",
"x": 180
},
"face=ceiling,facing=west,powered=false": {
"model": "cobblemon:block/eject_button",
"x": 180,
"y": 90
},
"face=ceiling,facing=west,powered=true": {
"model": "cobblemon:block/eject_button_pressed",
"x": 180,
"y": 90
},
"face=floor,facing=east,powered=false": {
"model": "cobblemon:block/eject_button",
"y": 90
},
"face=floor,facing=east,powered=true": {
"model": "cobblemon:block/eject_button_pressed",
"y": 90
},
"face=floor,facing=north,powered=false": {
"model": "cobblemon:block/eject_button"
},
"face=floor,facing=north,powered=true": {
"model": "cobblemon:block/eject_button_pressed"
},
"face=floor,facing=south,powered=false": {
"model": "cobblemon:block/eject_button",
"y": 180
},
"face=floor,facing=south,powered=true": {
"model": "cobblemon:block/eject_button_pressed",
"y": 180
},
"face=floor,facing=west,powered=false": {
"model": "cobblemon:block/eject_button",
"y": 270
},
"face=floor,facing=west,powered=true": {
"model": "cobblemon:block/eject_button_pressed",
"y": 270
},
"face=wall,facing=east,powered=false": {
"model": "cobblemon:block/eject_button",
"x": 90,
"y": 90
},
"face=wall,facing=east,powered=true": {
"model": "cobblemon:block/eject_button_pressed",
"x": 90,
"y": 90
},
"face=wall,facing=north,powered=false": {
"model": "cobblemon:block/eject_button",
"x": 90
},
"face=wall,facing=north,powered=true": {
"model": "cobblemon:block/eject_button_pressed",
"x": 90
},
"face=wall,facing=south,powered=false": {
"model": "cobblemon:block/eject_button",
"x": 90,
"y": 180
},
"face=wall,facing=south,powered=true": {
"model": "cobblemon:block/eject_button_pressed",
"x": 90,
"y": 180
},
"face=wall,facing=west,powered=false": {
"model": "cobblemon:block/eject_button",
"x": 90,
"y": 270
},
"face=wall,facing=west,powered=true": {
"model": "cobblemon:block/eject_button_pressed",
"x": 90,
"y": 270
}
}
}
@@ -1,63 +1,63 @@
{
"variants": {
"facing=north,amount=1": {
"model": "cobblemon:block/elixir_0"
"model": "cobblemon:block/elixir_1"
},
"facing=east,amount=1": {
"model": "cobblemon:block/elixir_0",
"model": "cobblemon:block/elixir_1",
"y": 90
},
"facing=south,amount=1": {
"model": "cobblemon:block/elixir_0",
"model": "cobblemon:block/elixir_1",
"y": 180
},
"facing=west,amount=1": {
"model": "cobblemon:block/elixir_0",
"model": "cobblemon:block/elixir_1",
"y": 270
},
"facing=north,amount=2": {
"model": "cobblemon:block/elixir_1"
"model": "cobblemon:block/elixir_2"
},
"facing=east,amount=2": {
"model": "cobblemon:block/elixir_1",
"model": "cobblemon:block/elixir_2",
"y": 90
},
"facing=south,amount=2": {
"model": "cobblemon:block/elixir_1",
"model": "cobblemon:block/elixir_2",
"y": 180
},
"facing=west,amount=2": {
"model": "cobblemon:block/elixir_1",
"model": "cobblemon:block/elixir_2",
"y": 270
},
"facing=north,amount=3": {
"model": "cobblemon:block/elixir_2"
"model": "cobblemon:block/elixir_3"
},
"facing=east,amount=3": {
"model": "cobblemon:block/elixir_2",
"model": "cobblemon:block/elixir_3",
"y": 90
},
"facing=south,amount=3": {
"model": "cobblemon:block/elixir_2",
"model": "cobblemon:block/elixir_3",
"y": 180
},
"facing=west,amount=3": {
"model": "cobblemon:block/elixir_2",
"model": "cobblemon:block/elixir_3",
"y": 270
},
"facing=north,amount=4": {
"model": "cobblemon:block/elixir_3"
"model": "cobblemon:block/elixir_4"
},
"facing=east,amount=4": {
"model": "cobblemon:block/elixir_3",
"model": "cobblemon:block/elixir_4",
"y": 90
},
"facing=south,amount=4": {
"model": "cobblemon:block/elixir_3",
"model": "cobblemon:block/elixir_4",
"y": 180
},
"facing=west,amount=4": {
"model": "cobblemon:block/elixir_3",
"model": "cobblemon:block/elixir_4",
"y": 270
}
}
@@ -1,63 +1,63 @@
{
"variants": {
"facing=north,amount=1": {
"model": "cobblemon:block/ether_0"
"model": "cobblemon:block/ether_1"
},
"facing=east,amount=1": {
"model": "cobblemon:block/ether_0",
"model": "cobblemon:block/ether_1",
"y": 90
},
"facing=south,amount=1": {
"model": "cobblemon:block/ether_0",
"model": "cobblemon:block/ether_1",
"y": 180
},
"facing=west,amount=1": {
"model": "cobblemon:block/ether_0",
"model": "cobblemon:block/ether_1",
"y": 270
},
"facing=north,amount=2": {
"model": "cobblemon:block/ether_1"
"model": "cobblemon:block/ether_2"
},
"facing=east,amount=2": {
"model": "cobblemon:block/ether_1",
"model": "cobblemon:block/ether_2",
"y": 90
},
"facing=south,amount=2": {
"model": "cobblemon:block/ether_1",
"model": "cobblemon:block/ether_2",
"y": 180
},
"facing=west,amount=2": {
"model": "cobblemon:block/ether_1",
"model": "cobblemon:block/ether_2",
"y": 270
},
"facing=north,amount=3": {
"model": "cobblemon:block/ether_2"
"model": "cobblemon:block/ether_3"
},
"facing=east,amount=3": {
"model": "cobblemon:block/ether_2",
"model": "cobblemon:block/ether_3",
"y": 90
},
"facing=south,amount=3": {
"model": "cobblemon:block/ether_2",
"model": "cobblemon:block/ether_3",
"y": 180
},
"facing=west,amount=3": {
"model": "cobblemon:block/ether_2",
"model": "cobblemon:block/ether_3",
"y": 270
},
"facing=north,amount=4": {
"model": "cobblemon:block/ether_3"
"model": "cobblemon:block/ether_4"
},
"facing=east,amount=4": {
"model": "cobblemon:block/ether_3",
"model": "cobblemon:block/ether_4",
"y": 90
},
"facing=south,amount=4": {
"model": "cobblemon:block/ether_3",
"model": "cobblemon:block/ether_4",
"y": 180
},
"facing=west,amount=4": {
"model": "cobblemon:block/ether_3",
"model": "cobblemon:block/ether_4",
"y": 270
}
}
@@ -0,0 +1,49 @@
{
"variants": {
"face=ceiling,facing=east": {
"model": "cobblemon:block/flame_orb_ceiling",
"y": 90
},
"face=ceiling,facing=north": {
"model": "cobblemon:block/flame_orb_ceiling"
},
"face=ceiling,facing=south": {
"model": "cobblemon:block/flame_orb_ceiling",
"y": 180
},
"face=ceiling,facing=west": {
"model": "cobblemon:block/flame_orb_ceiling",
"y": 270
},
"face=floor,facing=east": {
"model": "cobblemon:block/flame_orb_floor",
"y": 90
},
"face=floor,facing=north": {
"model": "cobblemon:block/flame_orb_floor"
},
"face=floor,facing=south": {
"model": "cobblemon:block/flame_orb_floor",
"y": 180
},
"face=floor,facing=west": {
"model": "cobblemon:block/flame_orb_floor",
"y": 270
},
"face=wall,facing=east": {
"model": "cobblemon:block/flame_orb_wall",
"y": 90
},
"face=wall,facing=north": {
"model": "cobblemon:block/flame_orb_wall"
},
"face=wall,facing=south": {
"model": "cobblemon:block/flame_orb_wall",
"y": 180
},
"face=wall,facing=west": {
"model": "cobblemon:block/flame_orb_wall",
"y": 270
}
}
}
@@ -1,63 +1,63 @@
{
"variants": {
"facing=north,amount=1": {
"model": "cobblemon:block/full_heal_0"
"model": "cobblemon:block/full_heal_1"
},
"facing=east,amount=1": {
"model": "cobblemon:block/full_heal_0",
"model": "cobblemon:block/full_heal_1",
"y": 90
},
"facing=south,amount=1": {
"model": "cobblemon:block/full_heal_0",
"model": "cobblemon:block/full_heal_1",
"y": 180
},
"facing=west,amount=1": {
"model": "cobblemon:block/full_heal_0",
"model": "cobblemon:block/full_heal_1",
"y": 270
},
"facing=north,amount=2": {
"model": "cobblemon:block/full_heal_1"
"model": "cobblemon:block/full_heal_2"
},
"facing=east,amount=2": {
"model": "cobblemon:block/full_heal_1",
"model": "cobblemon:block/full_heal_2",
"y": 90
},
"facing=south,amount=2": {
"model": "cobblemon:block/full_heal_1",
"model": "cobblemon:block/full_heal_2",
"y": 180
},
"facing=west,amount=2": {
"model": "cobblemon:block/full_heal_1",
"model": "cobblemon:block/full_heal_2",
"y": 270
},
"facing=north,amount=3": {
"model": "cobblemon:block/full_heal_2"
"model": "cobblemon:block/full_heal_3"
},
"facing=east,amount=3": {
"model": "cobblemon:block/full_heal_2",
"model": "cobblemon:block/full_heal_3",
"y": 90
},
"facing=south,amount=3": {
"model": "cobblemon:block/full_heal_2",
"model": "cobblemon:block/full_heal_3",
"y": 180
},
"facing=west,amount=3": {
"model": "cobblemon:block/full_heal_2",
"model": "cobblemon:block/full_heal_3",
"y": 270
},
"facing=north,amount=4": {
"model": "cobblemon:block/full_heal_3"
"model": "cobblemon:block/full_heal_4"
},
"facing=east,amount=4": {
"model": "cobblemon:block/full_heal_3",
"model": "cobblemon:block/full_heal_4",
"y": 90
},
"facing=south,amount=4": {
"model": "cobblemon:block/full_heal_3",
"model": "cobblemon:block/full_heal_4",
"y": 180
},
"facing=west,amount=4": {
"model": "cobblemon:block/full_heal_3",
"model": "cobblemon:block/full_heal_4",
"y": 270
}
}
@@ -1,63 +1,63 @@
{
"variants": {
"facing=north,amount=1": {
"model": "cobblemon:block/full_restore_0"
"model": "cobblemon:block/full_restore_1"
},
"facing=east,amount=1": {
"model": "cobblemon:block/full_restore_0",
"model": "cobblemon:block/full_restore_1",
"y": 90
},
"facing=south,amount=1": {
"model": "cobblemon:block/full_restore_0",
"model": "cobblemon:block/full_restore_1",
"y": 180
},
"facing=west,amount=1": {
"model": "cobblemon:block/full_restore_0",
"model": "cobblemon:block/full_restore_1",
"y": 270
},
"facing=north,amount=2": {
"model": "cobblemon:block/full_restore_1"
"model": "cobblemon:block/full_restore_2"
},
"facing=east,amount=2": {
"model": "cobblemon:block/full_restore_1",
"model": "cobblemon:block/full_restore_2",
"y": 90
},
"facing=south,amount=2": {
"model": "cobblemon:block/full_restore_1",
"model": "cobblemon:block/full_restore_2",
"y": 180
},
"facing=west,amount=2": {
"model": "cobblemon:block/full_restore_1",
"model": "cobblemon:block/full_restore_2",
"y": 270
},
"facing=north,amount=3": {
"model": "cobblemon:block/full_restore_2"
"model": "cobblemon:block/full_restore_3"
},
"facing=east,amount=3": {
"model": "cobblemon:block/full_restore_2",
"model": "cobblemon:block/full_restore_3",
"y": 90
},
"facing=south,amount=3": {
"model": "cobblemon:block/full_restore_2",
"model": "cobblemon:block/full_restore_3",
"y": 180
},
"facing=west,amount=3": {
"model": "cobblemon:block/full_restore_2",
"model": "cobblemon:block/full_restore_3",
"y": 270
},
"facing=north,amount=4": {
"model": "cobblemon:block/full_restore_3"
"model": "cobblemon:block/full_restore_4"
},
"facing=east,amount=4": {
"model": "cobblemon:block/full_restore_3",
"model": "cobblemon:block/full_restore_4",
"y": 90
},
"facing=south,amount=4": {
"model": "cobblemon:block/full_restore_3",
"model": "cobblemon:block/full_restore_4",
"y": 180
},
"facing=west,amount=4": {
"model": "cobblemon:block/full_restore_3",
"model": "cobblemon:block/full_restore_4",
"y": 270
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/galarica_cuff",
"y": 180
},
"facing=west": {
"model": "cobblemon:block/galarica_cuff",
"y": 270
},
"facing=north": {
"model": "cobblemon:block/galarica_cuff"
},
"facing=east": {
"model": "cobblemon:block/galarica_cuff",
"y": 90
}
}
}
@@ -0,0 +1,129 @@
{
"multipart": [
{
"when": {
"face": "ceiling"
},
"apply": {
"model": "cobblemon:block/galarica_wreath_chain"
}
},
{
"when": {
"face": "ceiling",
"facing": "east"
},
"apply": {
"model": "cobblemon:block/galarica_wreath_ceiling",
"y": 90
}
},
{
"when": {
"face": "ceiling",
"facing": "north"
},
"apply": {
"model": "cobblemon:block/galarica_wreath_ceiling"
}
},
{
"when": {
"face": "ceiling",
"facing": "south"
},
"apply": {
"model": "cobblemon:block/galarica_wreath_ceiling",
"y": 180
}
},
{
"when": {
"face": "ceiling",
"facing": "west"
},
"apply": {
"model": "cobblemon:block/galarica_wreath_ceiling",
"y": 270
}
},
{
"when": {
"face": "floor",
"facing": "east"
},
"apply": {
"model": "cobblemon:block/galarica_wreath_floor",
"y": 90
}
},
{
"when": {
"face": "floor",
"facing": "north"
},
"apply": {
"model": "cobblemon:block/galarica_wreath_floor"
}
},
{
"when": {
"face": "floor",
"facing": "south"
},
"apply": {
"model": "cobblemon:block/galarica_wreath_floor",
"y": 180
}
},
{
"when": {
"face": "floor",
"facing": "west"
},
"apply": {
"model": "cobblemon:block/galarica_wreath_floor",
"y": 270
}
},
{
"when": {
"face": "wall",
"facing": "east"
},
"apply": {
"model": "cobblemon:block/galarica_wreath_wall",
"y": 90
}
},
{
"when": {
"face": "wall",
"facing": "north"
},
"apply": {
"model": "cobblemon:block/galarica_wreath_wall"
}
},
{
"when": {
"face": "wall",
"facing": "south"
},
"apply": {
"model": "cobblemon:block/galarica_wreath_wall",
"y": 180
}
},
{
"when": {
"face": "wall",
"facing": "west"
},
"apply": {
"model": "cobblemon:block/galarica_wreath_wall",
"y": 270
}
}
]
}
@@ -1,63 +1,63 @@
{
"variants": {
"facing=north,amount=1": {
"model": "cobblemon:block/guard_spec_0"
"model": "cobblemon:block/guard_spec_1"
},
"facing=east,amount=1": {
"model": "cobblemon:block/guard_spec_0",
"model": "cobblemon:block/guard_spec_1",
"y": 90
},
"facing=south,amount=1": {
"model": "cobblemon:block/guard_spec_0",
"model": "cobblemon:block/guard_spec_1",
"y": 180
},
"facing=west,amount=1": {
"model": "cobblemon:block/guard_spec_0",
"model": "cobblemon:block/guard_spec_1",
"y": 270
},
"facing=north,amount=2": {
"model": "cobblemon:block/guard_spec_1"
"model": "cobblemon:block/guard_spec_2"
},
"facing=east,amount=2": {
"model": "cobblemon:block/guard_spec_1",
"model": "cobblemon:block/guard_spec_2",
"y": 90
},
"facing=south,amount=2": {
"model": "cobblemon:block/guard_spec_1",
"model": "cobblemon:block/guard_spec_2",
"y": 180
},
"facing=west,amount=2": {
"model": "cobblemon:block/guard_spec_1",
"model": "cobblemon:block/guard_spec_2",
"y": 270
},
"facing=north,amount=3": {
"model": "cobblemon:block/guard_spec_2"
"model": "cobblemon:block/guard_spec_3"
},
"facing=east,amount=3": {
"model": "cobblemon:block/guard_spec_2",
"model": "cobblemon:block/guard_spec_3",
"y": 90
},
"facing=south,amount=3": {
"model": "cobblemon:block/guard_spec_2",
"model": "cobblemon:block/guard_spec_3",
"y": 180
},
"facing=west,amount=3": {
"model": "cobblemon:block/guard_spec_2",
"model": "cobblemon:block/guard_spec_3",
"y": 270
},
"facing=north,amount=4": {
"model": "cobblemon:block/guard_spec_3"
"model": "cobblemon:block/guard_spec_4"
},
"facing=east,amount=4": {
"model": "cobblemon:block/guard_spec_3",
"model": "cobblemon:block/guard_spec_4",
"y": 90
},
"facing=south,amount=4": {
"model": "cobblemon:block/guard_spec_3",
"model": "cobblemon:block/guard_spec_4",
"y": 180
},
"facing=west,amount=4": {
"model": "cobblemon:block/guard_spec_3",
"model": "cobblemon:block/guard_spec_4",
"y": 270
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/heat_rock",
"y": 180
},
"facing=west": {
"model": "cobblemon:block/heat_rock",
"y": 270
},
"facing=north": {
"model": "cobblemon:block/heat_rock"
},
"facing=east": {
"model": "cobblemon:block/heat_rock",
"y": 90
}
}
}
@@ -0,0 +1,64 @@
{
"variants": {
"amount=1,facing=north": {
"model": "cobblemon:block/hp_up_1"
},
"amount=1,facing=east": {
"model": "cobblemon:block/hp_up_1",
"y": 90
},
"amount=1,facing=south": {
"model": "cobblemon:block/hp_up_1",
"y": 180
},
"amount=1,facing=west": {
"model": "cobblemon:block/hp_up_1",
"y": 270
},
"amount=2,facing=north": {
"model": "cobblemon:block/hp_up_2"
},
"amount=2,facing=east": {
"model": "cobblemon:block/hp_up_2",
"y": 90
},
"amount=2,facing=south": {
"model": "cobblemon:block/hp_up_2",
"y": 180
},
"amount=2,facing=west": {
"model": "cobblemon:block/hp_up_2",
"y": 270
},
"amount=3,facing=north": {
"model": "cobblemon:block/hp_up_3"
},
"amount=3,facing=east": {
"model": "cobblemon:block/hp_up_3",
"y": 90
},
"amount=3,facing=south": {
"model": "cobblemon:block/hp_up_3",
"y": 180
},
"amount=3,facing=west": {
"model": "cobblemon:block/hp_up_3",
"y": 270
},
"amount=4,facing=north": {
"model": "cobblemon:block/hp_up_4"
},
"amount=4,facing=east": {
"model": "cobblemon:block/hp_up_4",
"y": 90
},
"amount=4,facing=south": {
"model": "cobblemon:block/hp_up_4",
"y": 180
},
"amount=4,facing=west": {
"model": "cobblemon:block/hp_up_4",
"y": 270
}
}
}
@@ -1,63 +1,63 @@
{
"variants": {
"facing=north,amount=1": {
"model": "cobblemon:block/hyper_potion_0"
"model": "cobblemon:block/hyper_potion_1"
},
"facing=east,amount=1": {
"model": "cobblemon:block/hyper_potion_0",
"model": "cobblemon:block/hyper_potion_1",
"y": 90
},
"facing=south,amount=1": {
"model": "cobblemon:block/hyper_potion_0",
"model": "cobblemon:block/hyper_potion_1",
"y": 180
},
"facing=west,amount=1": {
"model": "cobblemon:block/hyper_potion_0",
"model": "cobblemon:block/hyper_potion_1",
"y": 270
},
"facing=north,amount=2": {
"model": "cobblemon:block/hyper_potion_1"
"model": "cobblemon:block/hyper_potion_2"
},
"facing=east,amount=2": {
"model": "cobblemon:block/hyper_potion_1",
"model": "cobblemon:block/hyper_potion_2",
"y": 90
},
"facing=south,amount=2": {
"model": "cobblemon:block/hyper_potion_1",
"model": "cobblemon:block/hyper_potion_2",
"y": 180
},
"facing=west,amount=2": {
"model": "cobblemon:block/hyper_potion_1",
"model": "cobblemon:block/hyper_potion_2",
"y": 270
},
"facing=north,amount=3": {
"model": "cobblemon:block/hyper_potion_2"
"model": "cobblemon:block/hyper_potion_3"
},
"facing=east,amount=3": {
"model": "cobblemon:block/hyper_potion_2",
"model": "cobblemon:block/hyper_potion_3",
"y": 90
},
"facing=south,amount=3": {
"model": "cobblemon:block/hyper_potion_2",
"model": "cobblemon:block/hyper_potion_3",
"y": 180
},
"facing=west,amount=3": {
"model": "cobblemon:block/hyper_potion_2",
"model": "cobblemon:block/hyper_potion_3",
"y": 270
},
"facing=north,amount=4": {
"model": "cobblemon:block/hyper_potion_3"
"model": "cobblemon:block/hyper_potion_4"
},
"facing=east,amount=4": {
"model": "cobblemon:block/hyper_potion_3",
"model": "cobblemon:block/hyper_potion_4",
"y": 90
},
"facing=south,amount=4": {
"model": "cobblemon:block/hyper_potion_3",
"model": "cobblemon:block/hyper_potion_4",
"y": 180
},
"facing=west,amount=4": {
"model": "cobblemon:block/hyper_potion_3",
"model": "cobblemon:block/hyper_potion_4",
"y": 270
}
}
@@ -1,63 +1,63 @@
{
"variants": {
"facing=north,amount=1": {
"model": "cobblemon:block/ice_heal_0"
"model": "cobblemon:block/ice_heal_1"
},
"facing=east,amount=1": {
"model": "cobblemon:block/ice_heal_0",
"model": "cobblemon:block/ice_heal_1",
"y": 90
},
"facing=south,amount=1": {
"model": "cobblemon:block/ice_heal_0",
"model": "cobblemon:block/ice_heal_1",
"y": 180
},
"facing=west,amount=1": {
"model": "cobblemon:block/ice_heal_0",
"model": "cobblemon:block/ice_heal_1",
"y": 270
},
"facing=north,amount=2": {
"model": "cobblemon:block/ice_heal_1"
"model": "cobblemon:block/ice_heal_2"
},
"facing=east,amount=2": {
"model": "cobblemon:block/ice_heal_1",
"model": "cobblemon:block/ice_heal_2",
"y": 90
},
"facing=south,amount=2": {
"model": "cobblemon:block/ice_heal_1",
"model": "cobblemon:block/ice_heal_2",
"y": 180
},
"facing=west,amount=2": {
"model": "cobblemon:block/ice_heal_1",
"model": "cobblemon:block/ice_heal_2",
"y": 270
},
"facing=north,amount=3": {
"model": "cobblemon:block/ice_heal_2"
"model": "cobblemon:block/ice_heal_3"
},
"facing=east,amount=3": {
"model": "cobblemon:block/ice_heal_2",
"model": "cobblemon:block/ice_heal_3",
"y": 90
},
"facing=south,amount=3": {
"model": "cobblemon:block/ice_heal_2",
"model": "cobblemon:block/ice_heal_3",
"y": 180
},
"facing=west,amount=3": {
"model": "cobblemon:block/ice_heal_2",
"model": "cobblemon:block/ice_heal_3",
"y": 270
},
"facing=north,amount=4": {
"model": "cobblemon:block/ice_heal_3"
"model": "cobblemon:block/ice_heal_4"
},
"facing=east,amount=4": {
"model": "cobblemon:block/ice_heal_3",
"model": "cobblemon:block/ice_heal_4",
"y": 90
},
"facing=south,amount=4": {
"model": "cobblemon:block/ice_heal_3",
"model": "cobblemon:block/ice_heal_4",
"y": 180
},
"facing=west,amount=4": {
"model": "cobblemon:block/ice_heal_3",
"model": "cobblemon:block/ice_heal_4",
"y": 270
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/icy_rock",
"y": 180
},
"facing=west": {
"model": "cobblemon:block/icy_rock",
"y": 270
},
"facing=north": {
"model": "cobblemon:block/icy_rock"
},
"facing=east": {
"model": "cobblemon:block/icy_rock",
"y": 90
}
}
}
@@ -0,0 +1,64 @@
{
"variants": {
"amount=1,facing=north": {
"model": "cobblemon:block/iron_1"
},
"amount=1,facing=east": {
"model": "cobblemon:block/iron_1",
"y": 90
},
"amount=1,facing=south": {
"model": "cobblemon:block/iron_1",
"y": 180
},
"amount=1,facing=west": {
"model": "cobblemon:block/iron_1",
"y": 270
},
"amount=2,facing=north": {
"model": "cobblemon:block/iron_2"
},
"amount=2,facing=east": {
"model": "cobblemon:block/iron_2",
"y": 90
},
"amount=2,facing=south": {
"model": "cobblemon:block/iron_2",
"y": 180
},
"amount=2,facing=west": {
"model": "cobblemon:block/iron_2",
"y": 270
},
"amount=3,facing=north": {
"model": "cobblemon:block/iron_3"
},
"amount=3,facing=east": {
"model": "cobblemon:block/iron_3",
"y": 90
},
"amount=3,facing=south": {
"model": "cobblemon:block/iron_3",
"y": 180
},
"amount=3,facing=west": {
"model": "cobblemon:block/iron_3",
"y": 270
},
"amount=4,facing=north": {
"model": "cobblemon:block/iron_4"
},
"amount=4,facing=east": {
"model": "cobblemon:block/iron_4",
"y": 90
},
"amount=4,facing=south": {
"model": "cobblemon:block/iron_4",
"y": 180
},
"amount=4,facing=west": {
"model": "cobblemon:block/iron_4",
"y": 270
}
}
}
@@ -0,0 +1,64 @@
{
"variants": {
"facing=north,amount=1": {
"model": "cobblemon:block/iron_ball_1"
},
"facing=east,amount=1": {
"model": "cobblemon:block/iron_ball_1",
"y": 90
},
"facing=south,amount=1": {
"model": "cobblemon:block/iron_ball_1",
"y": 180
},
"facing=west,amount=1": {
"model": "cobblemon:block/iron_ball_1",
"y": 270
},
"facing=north,amount=2": {
"model": "cobblemon:block/iron_ball_2"
},
"facing=east,amount=2": {
"model": "cobblemon:block/iron_ball_2",
"y": 90
},
"facing=south,amount=2": {
"model": "cobblemon:block/iron_ball_2",
"y": 180
},
"facing=west,amount=2": {
"model": "cobblemon:block/iron_ball_2",
"y": 270
},
"facing=north,amount=3": {
"model": "cobblemon:block/iron_ball_3"
},
"facing=east,amount=3": {
"model": "cobblemon:block/iron_ball_3",
"y": 90
},
"facing=south,amount=3": {
"model": "cobblemon:block/iron_ball_3",
"y": 180
},
"facing=west,amount=3": {
"model": "cobblemon:block/iron_ball_3",
"y": 270
},
"facing=north,amount=4": {
"model": "cobblemon:block/iron_ball_4"
},
"facing=east,amount=4": {
"model": "cobblemon:block/iron_ball_4",
"y": 90
},
"facing=south,amount=4": {
"model": "cobblemon:block/iron_ball_4",
"y": 180
},
"facing=west,amount=4": {
"model": "cobblemon:block/iron_ball_4",
"y": 270
}
}
}

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