Compare commits

...
Author SHA1 Message Date
apion aa19ff2c95 Added entity scale as a particle param 2024-05-17 20:57:10 -04:00
apion 5753443ab2 Optimized a player lookup 2024-05-17 20:39:27 -04:00
apion c6b7186032 Merge branch 'refs/heads/main' into 1.5.1
# Conflicts:
#	CHANGELOG.md
2024-05-17 20:35:50 -04:00
apion 32f3be2687 Changelog 2024-05-17 20:33:24 -04:00
apion 9012d78806 Apparently Kotlin uses .equals when using ==, === is Java == behavior 2024-05-17 20:30:18 -04:00
apion fffdfb7654 Fixes bug with InvMove, closes #847 2024-05-17 20:28:57 -04:00
Hiroku b314733f0b Merge branch 'Frank's-Bug-Fixing-Farm' into 'main'
Frank's bug fixing farm

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

Closes #844

See merge request cable-mc/cobblemon!1022
2024-05-17 01:41:41 +00:00
apion 8d1a64136f Fix recoil evo bug 2024-05-16 20:33:19 -04:00
Hiroku bfd34eb621 Merge branch '1.5.1' into 'main'
Fixes a few issues

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

See merge request cable-mc/cobblemon!1012
2024-05-16 22:46:10 +00:00
Hiroku 2dc2c96176 Update CHANGELOG.md [skip-ci] 2024-05-16 22:44:00 +00:00
Hiroku df4db17cfd Removed println 2024-05-16 22:40:56 +00:00
apion 45bec488f1 Fixed bug with pasture block 2024-05-15 20:41:32 -04:00
apion 9287374504 Merge branch 'refs/heads/main' into 1.5.1 2024-05-15 18:24:56 -04:00
apion 90c5180712 Revert "update Forge to current RB, update Fabric deps to latest"
This reverts commit 7139d4708b.
2024-05-15 18:17:29 -04:00
apion f2a36cd74a Merge branch 'refs/heads/main' into 1.5.1
# Conflicts:
#	CHANGELOG.md
2024-05-15 14:51:45 -04:00
Nick 158aa05f24 Merge branch 'fix/downgrade-loom' into 'main'
fix: resolve mapping issues by downgrading loom

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

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

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

See merge request cable-mc/cobblemon!1017
2024-05-15 10:23:14 +00:00
MoeBoy76 7139d4708b update Forge to current RB, update Fabric deps to latest 2024-05-15 11:11:02 +10:00
dhi_holo 50e99736a3 Partial Fix
Origin Ball now plays correctly in resource pack, but not in the mod itself, updated jsons to match, so all that's left is working out why the mod refuses to read the new jsons even though the new jsons are read in the files, in intellij, and in github desktop.
2024-05-15 10:43:09 +10:00
MoeBoy76 68c4acf0eb Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon 2024-05-15 09:21:22 +10:00
broccoli 5b5e7109f5 fix: resolve mapping issues by downgrading loom
fixes regression in fd7b82dbe3
2024-05-14 23:17:16 +01:00
Hiroku 37596523db Merge branch 'tmetcalfe89/abstract-stat-ratio-requirement' into 'main'
abstracted stat ratio requirement

See merge request cable-mc/cobblemon!1011
2024-05-14 20:15:13 +00:00
tmetcalfe89 eb80c20dbf updated readme 2024-05-14 09:11:16 -07:00
apion 7ab3951613 Fix gilded chest item drops 2024-05-14 11:16:33 -04:00
apion e6d51c4d56 A little more fossil machine clean up 2024-05-14 10:26:25 -04:00
Apion 3813ec3c92 Merge branch 'sound' into 'main'
Renamed Relic Coin Sack sound assets. Added new sounds for Relic Coin Pouches.

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

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

Needs testing on one issue before MR
2024-05-14 15:35:32 +10:00
MoeBoy76 93db0e1cda Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon 2024-05-14 08:57:15 +10:00
apion 4a4d292228 Fixes #828 2024-05-13 17:01:38 -04:00
apion 0fef9eec3d Fixes #826 2024-05-13 17:01:27 -04:00
apion 5f3dc395ec Fixes #832 2024-05-13 12:17:47 -04:00
Hiroku 1bf9d36dbd Merge branch 'wheres-the-tag-drake' into 'main'
Updated fossils.json Item Tag

Closes #834

See merge request cable-mc/cobblemon!1009
2024-05-13 09:45:38 +00:00
dhi_holo b19c5ed125 Updated fossils.json Item Tag
Sorted the fossils tag to match the order on Bulbapedia (just to make sure all other fossils were there, and because it looks a little nicer), and added Fossilized Drake to the tag
2024-05-13 17:51:19 +10:00
Paul e3cca0d9cf SpawnAction#complete returns R instead of Boolean 2024-05-13 15:08:55 +10:00
tmetcalfe89 1aa55f8199 replaced entity ref with originalPokemon 2024-05-12 21:49:58 -07:00
Paul 4c16b2ce2e Track friendship on client entities, tweaks to dataTracker initializing, MoLang in pose & quirk conditions 2024-05-13 12:47:53 +10:00
MoeBoy76 a0b263e392 Merge branch 'main' of https://gitlab.com/cable-mc/cobblemon 2024-05-03 10:45:11 +10:00
112 changed files with 611 additions and 303 deletions

No files matched your search

+1
View File
@@ -36,6 +36,7 @@ common/src/main/resources/assets/cobblemon/showdown
*/generated/resources/*
/fabric/src/generated/resources/cobblemon-common.accesswidener
/.ignored/
common/.fabric
# MacOS
.DS_Store
+33 -3
View File
@@ -2,10 +2,40 @@
## [1.5.1](#1-5-1)
### Fixes
-Fixed a bug in which adding organic material to the fossil tank via right click was adding the full count of the stack currently in hand
### Additions
- Added unique send out particles for Cherish, Dream, Beast, and Ancient Origin balls.
## [1.5.0 - The Ruins and Revival Update (May Xth, 2024)](#1-5-0)
### Changes
- Sounds for Relic Coin Sacks have been correctly renamed. Relic Coin Pouches received new sounds for breaking and placing.
- Readjusted Petilil portraits
### Fixes
- Fixed a bug in which adding organic material to the fossil tank via right click was adding the full count of the stack currently in hand
- Fixed a niche issue where some properties of entities were not initialized correctly, causing Pokémon that appeared to be level 1 until you battle them.
- Fixed Fossilized Drake being missing from the Fossils item tag.
- Fixed Gilded Chest block entity not being cleared on block break
- Fixed sherd brokenness on Forge/Supplementaries incompat
- Fixed Fossil Compartment crash with Jade / WAILA forks
- Fixed PCStore#resize not allowing PC boxes size reduction.
- Fixed pasture block PC lookups when the player is offline.
- Fixed Hisuian Decidueye not being Grass/Fighting
- Fixed both Decidueye forms learning both Triple Arrows and Spirit Shackle
- Fixed Pineco being unable to evolve into Shulker Forretress
- Fixed Kabutops T-posing when underwater. It still does not have proper swimming animations yet though.
- Fixed Pidgey's missing walk animation.
- Fixed recoil evo condition.
- Fixed issue where poser debug tools didnt work on JSON posers
- Fixed issue where gilded chests dont close when going far away
### Developer
- Changed SpawnAction#complete to return a nullable generic R (the spawn action result) instead of a boolean. More information this way.
### Data Pack & Resource Pack Creators
- Added support for MoLang conditions for quirks and poses.
- Changed the AttackDefenceRatio requirement to StatCompare and StatEqual.
## [1.5.0 - The Ruins and Revival Update (May 12th, 2024)](#1-5-0)
#### "You're telling me that Mojang has added archaeology to the game? Hmm... that gives me an idea."
### Additions
@@ -102,7 +102,6 @@ import com.cobblemon.mod.common.pokemon.properties.HiddenAbilityPropertyType
import com.cobblemon.mod.common.pokemon.properties.UncatchableProperty
import com.cobblemon.mod.common.pokemon.properties.tags.PokemonFlagProperty
import com.cobblemon.mod.common.pokemon.stat.CobblemonStatProvider
import com.cobblemon.mod.common.sherds.CobblemonSherds
import com.cobblemon.mod.common.starter.CobblemonStarterHandler
import com.cobblemon.mod.common.trade.TradeManager
import com.cobblemon.mod.common.util.DataKeys
@@ -416,7 +415,6 @@ object Cobblemon {
).ifSuccessful { it.mute = true }
}
CobblemonSherds.registerSherds()
}
fun getLevel(dimension: RegistryKey<World>): World? {
@@ -234,7 +234,7 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, RegistryKey<Registry<
"relic_coin_pouch",
CoinPouchBlock(
AbstractBlock.Settings.create()
.sounds(CobblemonSounds.COIN_POUCH_SOUNDS)
.sounds(CobblemonSounds.RELIC_COIN_POUCH_SOUNDS)
.pistonBehavior(PistonBehavior.DESTROY)
.strength(0.4f)
.nonOpaque(), true
@@ -245,7 +245,7 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, RegistryKey<Registry<
"relic_coin_sack",
CoinPouchBlock(
AbstractBlock.Settings.create()
.sounds(CobblemonSounds.COIN_POUCH_SOUNDS)
.sounds(CobblemonSounds.RELIC_COIN_SACK_SOUNDS)
.pistonBehavior(PistonBehavior.DESTROY)
.strength(0.4f), false
))
@@ -122,13 +122,18 @@ object CobblemonSounds : PlatformRegistry<Registry<SoundEvent>, RegistryKey<Regi
val FOSSIL_MACHINE_UNPROTECTED = this.create("fossil_machine.unprotected")
@JvmField
val COIN_POUCH_BREAK = this.create("coin_pouch.break")
val RELIC_COIN_SACK_BREAK = this.create("relic_coin_sack.break")
@JvmField
val COIN_POUCH_HIT = this.create("coin_pouch.hit")
val RELIC_COIN_SACK_HIT = this.create("relic_coin_sack.hit")
@JvmField
val COIN_POUCH_STEP = this.create("coin_pouch.step")
val RELIC_COIN_SACK_STEP = this.create("relic_coin_sack.step")
@JvmField
val COIN_POUCH_PLACE = this.create("coin_pouch.place")
val RELIC_COIN_SACK_PLACE = this.create("relic_coin_sack.place")
@JvmField
val RELIC_COIN_POUCH_BREAK = this.create("relic_coin_pouch.break")
@JvmField
val RELIC_COIN_POUCH_PLACE = this.create("relic_coin_pouch.place")
@JvmField
val TUMBLESTONE_BREAK = this.create("tumblestone.break")
@JvmField
@@ -189,13 +194,22 @@ object CobblemonSounds : PlatformRegistry<Registry<SoundEvent>, RegistryKey<Regi
val GILDED_CHEST_PLACE = this.create("gilded_chest.place")
@JvmField
val COIN_POUCH_SOUNDS = BlockSoundGroup(1f, 1f,
COIN_POUCH_BREAK,
COIN_POUCH_STEP,
COIN_POUCH_PLACE,
COIN_POUCH_HIT,
COIN_POUCH_STEP
val RELIC_COIN_SACK_SOUNDS = BlockSoundGroup(1f, 1f,
RELIC_COIN_SACK_BREAK,
RELIC_COIN_SACK_STEP,
RELIC_COIN_SACK_PLACE,
RELIC_COIN_SACK_HIT,
RELIC_COIN_SACK_STEP
)
@JvmField
val RELIC_COIN_POUCH_SOUNDS = BlockSoundGroup(1f, 1f,
RELIC_COIN_POUCH_BREAK,
RELIC_COIN_SACK_STEP,
RELIC_COIN_POUCH_PLACE,
RELIC_COIN_SACK_HIT,
RELIC_COIN_SACK_STEP
)
@JvmField
val IMPACT_NORMAL = this.create("impact.normal")
@JvmField
@@ -52,21 +52,24 @@ abstract class MultiblockBlock(properties: Settings) : BlockWithEntity(propertie
if(hand == Hand.OFF_HAND) {
return ActionResult.SUCCESS
}
val entity = world.getBlockEntity(pos) as MultiblockEntity?
if (entity?.multiblockStructure != null) {
return entity.multiblockStructure!!.onUse(state, world, pos, player, hand, hit)
if (!world.isClient) {
val entity = world.getBlockEntity(pos) as MultiblockEntity?
if (entity?.multiblockStructure != null) {
return entity.multiblockStructure!!.onUse(state, world, pos, player, hand, hit)
}
}
return super.onUse(state, world, pos, player, hand, hit)
}
override fun onBreak(world: World, pos: BlockPos, state: BlockState, player: PlayerEntity?) {
super.onBreak(world, pos, state, player)
if (!world.isClient) {
val entity = world.getBlockEntity(pos)
if (entity is MultiblockEntity && entity.multiblockStructure != null) {
entity.multiblockStructure!!.onBreak(world, pos, state, player)
}
entity?.markRemoved()
}
super.onBreak(world, pos, state, player)
}
override fun createBlockEntity(pos: BlockPos, state: BlockState): BlockEntity? {
@@ -78,6 +81,7 @@ abstract class MultiblockBlock(properties: Settings) : BlockWithEntity(propertie
return BlockRenderType.MODEL
}
//This is done so a block picked with NBT doesnt absolutely DESTROY multiblocks
override fun getPickStack(world: BlockView, pos: BlockPos, state: BlockState): ItemStack {
val blockEntity = world.getBlockEntity(pos) as? MultiblockEntity ?: return ItemStack.EMPTY
return if (blockEntity.multiblockStructure == null) super.getPickStack(world, pos, state) else ItemStack.EMPTY
@@ -34,15 +34,19 @@ abstract class SpawnAction<R>(
/**
* Runs the spawn action and processes any non-null result.
*/
open fun complete(): Boolean {
open fun complete(): R? {
if (future.isDone) {
return null
}
ctx.influences.forEach { it.affectAction(this) }
val result = run()
return if (result != null) {
if (result != null) {
future.complete(result)
true
} else {
future.completeExceptionally(Exception("Nothing was spawned."))
false
}
return result
}
}
@@ -99,7 +99,7 @@ open class PCStore(
this.lockedSize = lockNewSize
if (boxes.size > newSize) {
// reduce
val slicedBoxes = boxes.slice(boxes.size until newSize)
val slicedBoxes = boxes.slice(newSize until boxes.size)
boxes.removeAll(slicedBoxes)
slicedBoxes.flatMap { it.asIterable() }.forEach(overflowHandler)
} else {
@@ -54,8 +54,8 @@ class DamageInstruction(
if (recoiling) {
battlePokemon.effectedPokemon.let { pokemon ->
if (RecoilEvolutionProgress.supports(pokemon)) {
val newPercentage = privateMessage.argumentAt(1)?.split("/")?.getOrNull(0)?.toIntOrNull() ?: 0
val newHealth = (pokemon.hp * (newPercentage / 100.0)).roundToInt()
val healthStr = privateMessage.argumentAt(1) ?: throw UnsupportedOperationException("Cant get recoil string")
val newHealth = "([0-9]+).*".toRegex().find(healthStr)?.groups?.get(1)?.value?.toIntOrNull() ?: throw UnsupportedOperationException("Cant get recoil string")
val difference = pokemon.currentHealth - newHealth
if (difference > 0) {
val progress = pokemon.evolutionProxy.current().progressFirstOrCreate({ it is RecoilEvolutionProgress }) { RecoilEvolutionProgress() }
@@ -38,6 +38,7 @@ import net.minecraft.util.shape.VoxelShapes
import net.minecraft.world.BlockView
import net.minecraft.world.World
import net.minecraft.world.WorldAccess
import net.minecraft.world.WorldEvents
import net.minecraft.world.WorldView
@@ -72,10 +73,12 @@ class RestorationTankBlock(properties: Settings) : MultiblockBlock(properties),
override fun onBreak(world: World, pos: BlockPos, state: BlockState, player: PlayerEntity?) {
super.onBreak(world, pos, state, player)
val otherPart = world.getBlockState(getPositionOfOtherPart(state, pos))
if (otherPart.block is RestorationTankBlock) {
world.setBlockState(getPositionOfOtherPart(state, pos), Blocks.AIR.defaultState, 35)
world.syncWorldEvent(player, 2001, getPositionOfOtherPart(state, pos), getRawIdFromState(otherPart))
if (!world.isClient) {
val otherPart = world.getBlockState(getPositionOfOtherPart(state, pos))
if (otherPart.block is RestorationTankBlock) {
world.setBlockState(getPositionOfOtherPart(state, pos), Blocks.AIR.defaultState, Block.NOTIFY_ALL)
world.syncWorldEvent(player, WorldEvents.BLOCK_BROKEN, getPositionOfOtherPart(state, pos), getRawIdFromState(otherPart))
}
}
}
@@ -87,9 +90,9 @@ class RestorationTankBlock(properties: Settings) : MultiblockBlock(properties),
itemStack: ItemStack?
) {
//Place the full block before we call to super to validate the multiblock
world.setBlockState(pos.up(), state.with(PART, TankPart.TOP) as BlockState, 3)
world.setBlockState(pos.up(), state.with(PART, TankPart.TOP) as BlockState, Block.NOTIFY_ALL)
world.updateNeighbors(pos, Blocks.AIR)
state.updateNeighbors(world, pos, 3)
state.updateNeighbors(world, pos, Block.NOTIFY_ALL)
super.onPlaced(world, pos, state, placer, itemStack)
}
@@ -100,7 +103,7 @@ class RestorationTankBlock(properties: Settings) : MultiblockBlock(properties),
val tankBottomPos = pos.down()
val tankBottomState = world.getBlockState(tankBottomPos)
if(tankBottomState.block.equals(CobblemonBlocks.RESTORATION_TANK.asBlock()) && tankBottomState.get(PART) == TankPart.BOTTOM) {
return super.onUse(tankBottomState, world, tankBottomPos, player, hand, hit)
return onUse(tankBottomState, world, tankBottomPos, player, hand, hit)
}
}
return super.onUse(state, world, pos, player, hand, hit)
@@ -27,6 +27,7 @@ import net.minecraft.item.ItemPlacementContext
import net.minecraft.item.ItemStack
import net.minecraft.screen.ScreenHandler
import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.server.world.ServerWorld
import net.minecraft.sound.SoundCategory
import net.minecraft.state.StateManager
import net.minecraft.state.property.BooleanProperty
@@ -37,6 +38,7 @@ import net.minecraft.util.*
import net.minecraft.util.hit.BlockHitResult
import net.minecraft.util.math.BlockPos
import net.minecraft.util.math.Direction
import net.minecraft.util.math.random.Random
import net.minecraft.util.shape.VoxelShape
import net.minecraft.util.shape.VoxelShapes
import net.minecraft.world.BlockView
@@ -125,11 +127,13 @@ class GildedChestBlock(settings: Settings, val type: Type = Type.RED) : BlockWit
fun isFake() = (type == Type.FAKE)
override fun onBreak(world: World, pos: BlockPos, state: BlockState, player: PlayerEntity) {
if (isFake()) {
if (player is ServerPlayerEntity) {
if (!world.isClient) {
if (isFake() && (player is ServerPlayerEntity)) {
spawnPokemon(world, pos, state, player)
}
world.setBlockState(pos, if (state.fluidState.isOf(Fluids.WATER)) Blocks.WATER.defaultState else Blocks.AIR.defaultState)
val bEntity = world.getBlockEntity(pos) as? GildedChestBlockEntity
bEntity?.markRemoved()
} else super.onBreak(world, pos, state, player)
}
@@ -197,9 +201,11 @@ class GildedChestBlock(settings: Settings, val type: Type = Type.RED) : BlockWit
newState: BlockState,
moved: Boolean
) {
if (!state.isOf(newState.block)) {
val chest = world.getBlockEntity(pos) as GildedChestBlockEntity
ItemScatterer.spawn(world, pos, chest.inventoryContents)
if (!state.isOf(newState.block) && !world.isClient) {
val chest = world.getBlockEntity(pos) as? GildedChestBlockEntity
chest?.let {
ItemScatterer.spawn(world, pos, chest.inventoryContents)
}
}
}
@@ -261,4 +267,14 @@ class GildedChestBlock(settings: Settings, val type: Type = Type.RED) : BlockWit
}
}
override fun scheduledTick(
state: BlockState?,
world: ServerWorld?,
pos: BlockPos?,
random: Random?
) {
val blockEntity = world?.getBlockEntity(pos) as? GildedChestBlockEntity ?: return
blockEntity.onScheduledTick()
}
}
@@ -29,11 +29,17 @@ class FossilAnalyzerBlockEntity(
class FossilAnalyzerInventory(val analyzerEntity: FossilAnalyzerBlockEntity) : SidedInventory {
override fun clear() {
TODO("Not yet implemented")
if(analyzerEntity.multiblockStructure != null && analyzerEntity.multiblockStructure is FossilMultiblockStructure) {
val fossilMultiblockStructure = analyzerEntity.multiblockStructure as FossilMultiblockStructure
fossilMultiblockStructure.fossilInventory.clear()
}
}
override fun size(): Int {
TODO("Not yet implemented")
if (analyzerEntity.multiblockStructure != null) {
return 3
}
return 0
}
override fun isEmpty(): Boolean {
@@ -41,19 +47,34 @@ class FossilAnalyzerBlockEntity(
}
override fun getStack(slot: Int): ItemStack {
if (analyzerEntity.multiblockStructure != null && analyzerEntity.multiblockStructure is FossilMultiblockStructure) {
val fossilMultiblockStructure = analyzerEntity.multiblockStructure as FossilMultiblockStructure
if (fossilMultiblockStructure.fossilInventory.size > slot) {
return fossilMultiblockStructure.fossilInventory[slot]
}
}
return ItemStack.EMPTY
}
//Unimplemented since no extract
override fun removeStack(slot: Int, amount: Int): ItemStack {
return ItemStack.EMPTY
return removeStack(slot)
}
override fun removeStack(slot: Int): ItemStack {
// if(analyzerEntity.multiblockStructure is FossilMultiblockStructure) {
// val fossilMultiblockStructure = analyzerEntity.multiblockStructure as FossilMultiblockStructure
// if (fossilMultiblockStructure.fossilInventory.size > slot) {
// val itemStack = fossilMultiblockStructure.fossilInventory.removeAt(slot)
// markDirty()
// return itemStack
// }
// }
return ItemStack.EMPTY
}
override fun setStack(slot: Int, stack: ItemStack) {
if (analyzerEntity.multiblockStructure != null) {
if (analyzerEntity.multiblockStructure != null && analyzerEntity.multiblockStructure is FossilMultiblockStructure) {
val struct = analyzerEntity.multiblockStructure as FossilMultiblockStructure
analyzerEntity.world?.let {
struct.insertFossil(stack, it)
@@ -72,7 +93,10 @@ class FossilAnalyzerBlockEntity(
}
override fun getAvailableSlots(side: Direction?): IntArray {
return IntArray(1)
if(analyzerEntity.multiblockStructure != null && analyzerEntity.multiblockStructure is FossilMultiblockStructure) {
return intArrayOf(0,1,2)
}
return IntArray(0)
}
override fun canInsert(slot: Int, stack: ItemStack?, dir: Direction?): Boolean {
@@ -87,8 +111,8 @@ class FossilAnalyzerBlockEntity(
}
override fun canExtract(slot: Int, stack: ItemStack?, dir: Direction?): Boolean {
// return analyzerEntity.multiblockStructure != null && analyzerEntity.multiblockStructure is FossilMultiblockStructure && dir == Direction.DOWN
return false
}
}
}
@@ -20,6 +20,7 @@ import net.minecraft.entity.player.PlayerEntity
import net.minecraft.entity.player.PlayerInventory
import net.minecraft.inventory.DoubleInventory
import net.minecraft.inventory.Inventories
import net.minecraft.inventory.Inventory
import net.minecraft.inventory.SidedInventory
import net.minecraft.item.ItemStack
import net.minecraft.nbt.NbtCompound
@@ -58,9 +59,7 @@ class GildedChestBlockEntity(pos: BlockPos, state: BlockState, val type: Type =
override fun isPlayerViewing(player: PlayerEntity): Boolean {
if (player.currentScreenHandler is GenericContainerScreenHandler) {
val inventory = (player.currentScreenHandler as GenericContainerScreenHandler).inventory
return inventory === this@GildedChestBlockEntity || inventory is DoubleInventory && inventory.isPart(
this@GildedChestBlockEntity
)
return inventory === this@GildedChestBlockEntity
}
return false
}
@@ -99,7 +98,7 @@ class GildedChestBlockEntity(pos: BlockPos, state: BlockState, val type: Type =
return dir == Direction.DOWN
}
override fun canPlayerUse(player: PlayerEntity) = !player.isSpectator
override fun canPlayerUse(player: PlayerEntity) = !player.isSpectator && Inventory.canPlayerUse(this, player)
override fun getInvStackList(): DefaultedList<ItemStack> = inventoryContents
@@ -164,4 +163,10 @@ class GildedChestBlockEntity(pos: BlockPos, state: BlockState, val type: Type =
Inventories.readNbt(nbt, inventoryContents)
}
}
fun onScheduledTick() {
if (!this.removed) {
stateManager.updateViewerCount(this.getWorld(), this.getPos(), this.cachedState)
}
}
}
@@ -14,6 +14,7 @@ import com.bedrockk.molang.runtime.value.MoValue
import com.bedrockk.molang.runtime.value.StringValue
import com.cobblemon.mod.common.api.molang.MoLangFunctions.addFunctions
import com.cobblemon.mod.common.api.molang.MoLangFunctions.getQueryStruct
import com.cobblemon.mod.common.api.text.text
import com.cobblemon.mod.common.util.asIdentifierDefaultingNamespace
import net.minecraft.client.MinecraftClient
import net.minecraft.client.sound.PositionedSoundInstance
@@ -31,6 +32,13 @@ object ClientMoLangFunctions {
MinecraftClient.getInstance().soundManager.play(PositionedSoundInstance.master(soundEvent, pitch))
}
},
"is_time" to java.util.function.Function { params ->
val time = (MinecraftClient.getInstance().world?.timeOfDay ?: 0) % 24000
val min = params.getInt(0)
val max = params.getInt(1)
time in min..max
},
"say" to java.util.function.Function { params -> MinecraftClient.getInstance().player?.sendMessage(params.getString(0).text()) ?: Unit },
)
fun MoLangRuntime.setupClient(): MoLangRuntime {
@@ -272,6 +272,9 @@ class PokemonClientDelegate : PoseableEntityState<PokemonEntity>(), PokemonSideD
},
"weight" to java.util.function.Function {
return@Function DoubleValue(currentEntity.pokemon.species.weight.toDouble())
},
"friendship" to java.util.function.Function {
return@Function DoubleValue(currentEntity.pokemon.friendship.toDouble())
}
))
}
@@ -10,16 +10,19 @@ package com.cobblemon.mod.common.client.particle
import com.bedrockk.molang.runtime.MoLangRuntime
import com.bedrockk.molang.runtime.value.DoubleValue
import com.cobblemon.mod.common.api.molang.MoLangFunctions.addFunction
import com.cobblemon.mod.common.api.molang.MoLangFunctions.getQueryStruct
import com.cobblemon.mod.common.api.snowstorm.BedrockParticleEffect
import com.cobblemon.mod.common.api.snowstorm.ParticleEmitterAction
import com.cobblemon.mod.common.client.render.MatrixWrapper
import com.cobblemon.mod.common.client.render.SnowstormParticle
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.particle.SnowstormParticleEffect
import com.cobblemon.mod.common.util.math.geometry.transformDirection
import kotlin.random.Random
import net.minecraft.client.MinecraftClient
import net.minecraft.client.particle.NoRenderParticle
import net.minecraft.client.util.ParticleUtil.spawnParticle
import net.minecraft.client.world.ClientWorld
import net.minecraft.entity.Entity
import net.minecraft.util.math.Vec3d
@@ -48,12 +51,14 @@ class ParticleStorm(
.addFunction("entity_height") { DoubleValue(entity.boundingBox.yLength) }
.addFunction("entity_size") { DoubleValue(entity.boundingBox.run { if (xLength > yLength) xLength else yLength }) }
.addFunction("entity_radius") { DoubleValue(entity.boundingBox.run { if (xLength > yLength) xLength else yLength } / 2) }
.addFunction("entity_scale") { DoubleValue((entity as? PokemonEntity)?.scaleFactor ?: 1.0) }
// TODO replace with a generified call to if (entity is MoLangEntity) entity.applyVariables(env) or w/e
runtime.environment.setSimpleVariable("entity_width", DoubleValue(entity.boundingBox.xLength))
runtime.environment.setSimpleVariable("entity_height", DoubleValue(entity.boundingBox.yLength))
val longerDiameter = entity.boundingBox.run { if (xLength > yLength) xLength else yLength }
runtime.environment.setSimpleVariable("entity_size", DoubleValue(longerDiameter))
runtime.environment.setSimpleVariable("entity_radius", DoubleValue(longerDiameter / 2))
runtime.environment.setSimpleVariable("entity_scale", DoubleValue((entity as? PokemonEntity)?.scaleFactor ?: 1.0))
}
MinecraftClient.getInstance().particleManager.addParticle(this)
}
@@ -20,7 +20,10 @@ import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFram
import com.cobblemon.mod.common.client.render.models.blockbench.quirk.SimpleQuirk
import com.cobblemon.mod.common.entity.PoseType
import com.cobblemon.mod.common.util.asExpressionLike
import com.cobblemon.mod.common.util.normalizeToArray
import com.cobblemon.mod.common.util.resolveBoolean
import com.cobblemon.mod.common.util.resolveObject
import com.cobblemon.mod.common.util.singularToPluralList
import com.google.gson.JsonArray
import com.google.gson.JsonObject
import com.google.gson.JsonPrimitive
@@ -34,6 +37,8 @@ class JsonPose<T : Entity>(model: PoseableEntityModel<T>, json: JsonObject) {
it.environment.getQueryStruct().addFunctions(model.functions.functions)
}
val condition: ExpressionLike = json.singularToPluralList("condition").get("condition")?.normalizeToArray()?.map { it.asString }?.asExpressionLike() ?: "true".asExpressionLike()
val poseName = json.get("poseName")?.asString ?: "pose"
val poseTypes = (json.get("poseTypes")?.asJsonArray?.map { name ->
PoseType.values().find { it.name.lowercase() == name.asString.lowercase() }
@@ -81,8 +86,9 @@ class JsonPose<T : Entity>(model: PoseableEntityModel<T>, json: JsonObject) {
}
json as JsonObject
json.singularToPluralList("animation")
val animations: (state: PoseableEntityState<T>) -> List<StatefulAnimation<T, *>> = { _ ->
(json.get("animations")?.asJsonArray ?: JsonArray()).map { animJson ->
(json.get("animations")?.normalizeToArray()?.asJsonArray ?: JsonArray()).map { animJson ->
try {
val expr = animJson.asString.asExpressionLike()
runtime.resolveObject(expr).obj as StatefulAnimation<T, *>
@@ -97,10 +103,11 @@ class JsonPose<T : Entity>(model: PoseableEntityModel<T>, json: JsonObject) {
val loopTimes = json.get("loopTimes")?.asInt ?: 1
val minSeconds = json.get("minSecondsBetweenOccurrences")?.asFloat ?: 8F
val maxSeconds = json.get("maxSecondsBetweenOccurrences")?.asFloat ?: 30F
val condition = json.get("condition")?.asString?.asExpressionLike() ?: "true".asExpressionLike()
model.quirkMultiple(
secondsBetweenOccurrences = minSeconds to maxSeconds,
condition = { true },
condition = { it.runtime.resolveBoolean(condition) },
loopTimes = 1..loopTimes,
animations = animations
)
@@ -46,6 +46,7 @@ import com.cobblemon.mod.common.util.asExpressionLike
import com.cobblemon.mod.common.util.getDoubleOrNull
import com.cobblemon.mod.common.util.getStringOrNull
import com.cobblemon.mod.common.util.plus
import com.cobblemon.mod.common.util.resolveBoolean
import net.minecraft.client.model.ModelPart
import net.minecraft.client.render.OverlayTexture
import net.minecraft.client.render.RenderLayer
@@ -878,6 +879,18 @@ abstract class PoseableEntityModel<T : Entity>(
animations = { listOf(animation(it)) }
)
fun quirkMoLangCondition(
secondsBetweenOccurrences: Pair<Float, Float> = 8F to 30F,
loopTimes: IntRange = 1..1,
conditionExpression: ExpressionLike = "true".asExpressionLike(),
animation: (state: PoseableEntityState<T>) -> StatefulAnimation<T, *>
) = SimpleQuirk<T>(
secondsBetweenOccurrences = secondsBetweenOccurrences,
loopTimes = loopTimes,
condition = { it.runtime.resolveBoolean(conditionExpression) },
animations = { listOf(animation(it)) }
)
fun quirkMultiple(
secondsBetweenOccurrences: Pair<Float, Float> = 8F to 30F,
loopTimes: IntRange = 1..1,
@@ -78,7 +78,7 @@ abstract class PoseableEntityState<T : Entity> : Schedulable {
"anim_time" to java.util.function.Function { return@Function reusableAnimTime.also { it.value = animationSeconds.toDouble() } },
"pose_type" to java.util.function.Function { return@Function StringValue((getEntity() as Poseable).getCurrentPoseType().name) },
"pose" to java.util.function.Function { _ -> return@Function StringValue(currentPose ?: "") },
"say" to java.util.function.Function { params -> MinecraftClient.getInstance().player?.sendMessage(params.getString(0).text()) ?: Unit },
"has_entity" to java.util.function.Function { _ -> return@Function DoubleValue(getEntity() != null) },
"sound" to java.util.function.Function { params ->
val entity = getEntity() ?: return@Function Unit
if (params.get<MoValue>(0) !is StringValue) {
@@ -9,6 +9,7 @@
package com.cobblemon.mod.common.client.render.models.blockbench.pokemon
import com.cobblemon.mod.common.api.molang.ExpressionLike
import com.cobblemon.mod.common.client.entity.PokemonClientDelegate
import com.cobblemon.mod.common.client.render.models.blockbench.JsonPose
import com.cobblemon.mod.common.client.render.models.blockbench.JsonPoseableEntityModel
import com.cobblemon.mod.common.client.render.models.blockbench.PoseableEntityState
@@ -24,6 +25,7 @@ import com.cobblemon.mod.common.util.isDusk
import com.cobblemon.mod.common.util.isStandingOnRedSand
import com.cobblemon.mod.common.util.isStandingOnSand
import com.cobblemon.mod.common.util.isStandingOnSandOrRedSand
import com.cobblemon.mod.common.util.resolveBoolean
import com.google.gson.ExclusionStrategy
import com.google.gson.FieldAttributes
import com.google.gson.GsonBuilder
@@ -84,30 +86,12 @@ class JsonPokemonPoseableModel(override val rootPart: Bone) : PokemonPoseableMod
override val head: Bone by lazy { headJoint?.let { getPart(it) } ?: rootPart }
@SerializedName("portraitScale")
private val _portraitScale: Float? = null
@SerializedName("portraitTranslation")
private val _portraitTranslation: Vec3d? = null
@SerializedName("profileScale")
private val _profileScale: Float? = null
@SerializedName("profileTranslation")
private val _profileTranslation: Vec3d? = null
//Some weirdness going on here, vars have to be initialized, gson doesn't like multiple fields with the same name
@Transient
//Idk, works fine with Blastoise
override var portraitScale = 1F
get() = _portraitScale ?: 1F
@Transient
override var portraitTranslation = Vec3d.ZERO
get() = _portraitTranslation ?: Vec3d(0.0, 0.0, 0.0)
@Transient
override var profileScale = 1F
get() = _profileScale ?: 1F
@Transient
override var profileTranslation = Vec3d.ZERO
get() = _profileTranslation ?: Vec3d(0.0, 0.0, 0.0)
val faint: Supplier<StatefulAnimation<PokemonEntity, ModelFrame>>? = null
@@ -192,6 +176,8 @@ class JsonPokemonPoseableModel(override val rootPart: Bone) : PokemonPoseableMod
conditionsList.add { mustBeDusk == it.isDusk() }
}
conditionsList.add { (it.delegate as PokemonClientDelegate).runtime.resolveBoolean(pose.condition) }
val poseCondition: ((PokemonEntity) -> Boolean)? = if (conditionsList.isEmpty()) null else conditionsList.reduce { acc, function -> { acc(it) && function(it) } }
return Pose(
@@ -8,13 +8,14 @@
package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen1
import com.cobblemon.mod.common.client.render.models.blockbench.animation.BipedWalkAnimation
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BipedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPose
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPoseableModel
import com.cobblemon.mod.common.entity.PoseType
import com.cobblemon.mod.common.entity.PoseType.Companion.MOVING_POSES
import com.cobblemon.mod.common.entity.PoseType.Companion.STATIONARY_POSES
import com.cobblemon.mod.common.entity.PoseType.Companion.UI_POSES
import net.minecraft.client.model.ModelPart
import net.minecraft.util.math.Vec3d
@@ -56,7 +57,7 @@ class KabutopsModel(root: ModelPart) : PokemonPoseableModel(), HeadedFrame, Bipe
standing = registerPose(
poseName = "standing",
poseTypes = UI_POSES + PoseType.STAND,
poseTypes = UI_POSES + STATIONARY_POSES,
condition = { !it.isBattling },
quirks = arrayOf(blink),
idleAnimations = arrayOf(
@@ -67,7 +68,7 @@ class KabutopsModel(root: ModelPart) : PokemonPoseableModel(), HeadedFrame, Bipe
walk = registerPose(
poseName = "walk",
poseType = PoseType.WALK,
poseTypes = MOVING_POSES,
quirks = arrayOf(blink),
idleAnimations = arrayOf(
singleBoneLook(),
@@ -8,21 +8,14 @@
package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen1
import com.cobblemon.mod.common.client.render.models.blockbench.animation.WingFlapIdleAnimation
import com.cobblemon.mod.common.client.render.models.blockbench.createTransformation
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BiWingedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BipedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPose
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPoseableModel
import com.cobblemon.mod.common.client.render.models.blockbench.pose.ModelPartTransformation
import com.cobblemon.mod.common.client.render.models.blockbench.wavefunction.parabolaFunction
import com.cobblemon.mod.common.client.render.models.blockbench.wavefunction.sineFunction
import com.cobblemon.mod.common.entity.PoseType
import com.cobblemon.mod.common.entity.PoseType.Companion.SHOULDER_POSES
import com.cobblemon.mod.common.entity.PoseType.Companion.UI_POSES
import com.cobblemon.mod.common.util.math.geometry.toRadians
import net.minecraft.client.model.ModelPart
import net.minecraft.util.math.Vec3d
@@ -66,7 +59,7 @@ class PidgeyModel(root: ModelPart) : PokemonPoseableModel(), HeadedFrame {
stand = registerPose(
poseName = "standing",
poseTypes = SHOULDER_POSES + UI_POSES + PoseType.STANDING_POSES,
poseTypes = SHOULDER_POSES + UI_POSES + PoseType.STATIONARY_POSES - PoseType.HOVER,
transformTicks = 10,
transformedParts = arrayOf(
wingClosedLeft.createTransformation().withVisibility(visibility = true),
@@ -25,8 +25,8 @@ class PetililHisuiBiasModel (root: ModelPart) : PokemonPoseableModel(), HeadedFr
val leaf_left = getPart("leaf_left_rotation")
val leaf_right = getPart("leaf_right_rotation")
override var portraitScale = 1.75F
override var portraitTranslation = Vec3d(0.01, -0.39, 0.0)
override var portraitScale = 1.52F
override var portraitTranslation = Vec3d(0.1, -0.25, 0.0)
override var profileScale = 0.8F
override var profileTranslation = Vec3d(0.0, 0.5, 0.0)
@@ -22,8 +22,8 @@ class PetililModel (root: ModelPart) : PokemonPoseableModel(), HeadedFrame {
override val rootPart = root.registerChildWithAllChildren("petilil")
override val head = getPart("head")
override var portraitScale = 2.0F
override var portraitTranslation = Vec3d(-0.3, -1.2, 0.0)
override var portraitScale = 1.52F
override var portraitTranslation = Vec3d(0.1, -0.25, 0.0)
override var profileScale = 0.8F
override var profileTranslation = Vec3d(0.0, 0.5, 0.0)
@@ -59,7 +59,6 @@ import com.cobblemon.mod.common.pokemon.evolution.variants.ItemInteractionEvolut
import com.cobblemon.mod.common.pokemon.misc.GimmighoulStashHandler
import com.cobblemon.mod.common.util.*
import com.cobblemon.mod.common.world.gamerules.CobblemonGameRules
import net.minecraft.block.Blocks
import java.util.EnumSet
import java.util.Optional
import java.util.UUID
@@ -136,6 +135,7 @@ open class PokemonEntity(
@JvmStatic val UNBATTLEABLE = DataTracker.registerData(PokemonEntity::class.java, TrackedDataHandlerRegistry.BOOLEAN)
@JvmStatic val COUNTS_TOWARDS_SPAWN_CAP = DataTracker.registerData(PokemonEntity::class.java, TrackedDataHandlerRegistry.BOOLEAN)
@JvmStatic val SPAWN_DIRECTION = DataTracker.registerData(PokemonEntity::class.java, TrackedDataHandlerRegistry.FLOAT)
@JvmStatic val FRIENDSHIP = DataTracker.registerData(PokemonEntity::class.java, TrackedDataHandlerRegistry.INTEGER)
const val BATTLE_LOCK = "battle"
@@ -181,6 +181,8 @@ open class PokemonEntity(
set(value) = dataTracker.set(BATTLE_ID, Optional.ofNullable(value))
val isBattling: Boolean
get() = dataTracker.get(BATTLE_ID).isPresent
val friendship: Int
get() = dataTracker.get(FRIENDSHIP)
var drops: DropTable? = null
@@ -246,7 +248,9 @@ open class PokemonEntity(
dataTracker.startTracking(LABEL_LEVEL, 1)
dataTracker.startTracking(HIDE_LABEL, false)
dataTracker.startTracking(UNBATTLEABLE, false)
dataTracker.startTracking(COUNTS_TOWARDS_SPAWN_CAP, true)
dataTracker.startTracking(SPAWN_DIRECTION, world.random.nextFloat() * 360F)
dataTracker.startTracking(FRIENDSHIP, 0)
}
override fun onTrackedDataSet(data: TrackedData<*>) {
@@ -326,6 +330,18 @@ open class PokemonEntity(
this.tethering = null
this.pokemon.recall()
}
//This is so that pokemon in the pasture block are ALWAYS in sync with the pokemon box
//Before, pokemon entities in pastures would hold an old ref to a pokemon obj and changes to that would not appear to the underlying file
if (this.tethering != null) {
//Only for online players
if (world.getPlayerByUuid(ownerUuid) != null){
val actualPokemon = Cobblemon.storage.getPC(this.ownerUuid!!)[this.pokemon.uuid]!!
//We want to use == over .equals here as we actually want to check the reference
if (actualPokemon !== pokemon) {
pokemon = actualPokemon
}
}
}
schedulingTracker.update(1/20F)
}
@@ -92,10 +92,28 @@ class PokemonServerDelegate : PokemonSideDelegate {
speed = 0.1F
entity.despawner.beginTracking(this)
}
updateTrackedValues()
}
fun getBattle() = entity.battleId?.let(BattleRegistry::getBattle)
fun updateTrackedValues() {
val trackedSpecies = mock?.species ?: entity.pokemon.species.resourceIdentifier.toString()
val trackedNickname = mock?.nickname ?: entity.pokemon.nickname ?: Text.empty()
val trackedAspects = mock?.aspects ?: entity.pokemon.aspects
entity.dataTracker.set(PokemonEntity.SPECIES, trackedSpecies)
if (entity.dataTracker.get(PokemonEntity.NICKNAME) != trackedNickname) {
entity.dataTracker.set(PokemonEntity.NICKNAME, trackedNickname)
}
entity.dataTracker.set(PokemonEntity.ASPECTS, trackedAspects)
entity.dataTracker.set(PokemonEntity.LABEL_LEVEL, entity.pokemon.level)
entity.dataTracker.set(PokemonEntity.MOVING, entity.velocity.multiply(1.0, if (entity.isOnGround) 0.0 else 1.0, 1.0).length() > 0.005F)
entity.dataTracker.set(PokemonEntity.FRIENDSHIP, entity.pokemon.friendship)
updatePoseType()
}
override fun onTrackedDataSet(data: TrackedData<*>) {
super.onTrackedDataSet(data)
if (this::entity.isInitialized) {
@@ -162,19 +180,7 @@ class PokemonServerDelegate : PokemonSideDelegate {
entity.remove(Entity.RemovalReason.DISCARDED)
}
val trackedSpecies = mock?.species ?: entity.pokemon.species.resourceIdentifier.toString()
val trackedNickname = mock?.nickname ?: entity.pokemon.nickname ?: Text.empty()
val trackedAspects = mock?.aspects ?: entity.pokemon.aspects
entity.dataTracker.set(PokemonEntity.SPECIES, trackedSpecies)
if (entity.dataTracker.get(PokemonEntity.NICKNAME) != trackedNickname) {
entity.dataTracker.set(PokemonEntity.NICKNAME, trackedNickname)
}
entity.dataTracker.set(PokemonEntity.ASPECTS, trackedAspects)
entity.dataTracker.set(PokemonEntity.LABEL_LEVEL, entity.pokemon.level)
entity.dataTracker.set(PokemonEntity.MOVING, entity.velocity.multiply(1.0, if (entity.isOnGround) 0.0 else 1.0, 1.0).length() > 0.005F)
updatePoseType()
updateTrackedValues()
}
fun updatePoseType() {
@@ -87,9 +87,7 @@ object AdvancementHandler {
event.battle.actors.forEach { battleActor ->
if (!event.winners.contains(battleActor) && battleActor.type == ActorType.WILD) {
battleActor.pokemonList.forEach { battlePokemon ->
battlePokemon.entity?.pokemon?.let {
advancementData.updateTotalDefeatedCount(it)
}
advancementData.updateTotalDefeatedCount(battlePokemon.originalPokemon)
}
}
}
@@ -39,6 +39,7 @@ class SpawnPokemonPacket(
private val hideLabel: Boolean,
private val caughtBall: Identifier,
private val spawnYaw: Float,
private val friendship: Int,
vanillaSpawnPacket: EntitySpawnS2CPacket
) : SpawnExtraDataEntityPacket<SpawnPokemonPacket, PokemonEntity>(vanillaSpawnPacket) {
@@ -60,6 +61,7 @@ class SpawnPokemonPacket(
entity.dataTracker.get(PokemonEntity.HIDE_LABEL),
entity.pokemon.caughtBall.name,
entity.dataTracker.get(PokemonEntity.SPAWN_DIRECTION),
entity.dataTracker.get(PokemonEntity.FRIENDSHIP),
vanillaSpawnPacket
)
@@ -79,6 +81,7 @@ class SpawnPokemonPacket(
buffer.writeBoolean(this.hideLabel)
buffer.writeIdentifier(this.caughtBall)
buffer.writeFloat(this.spawnYaw)
buffer.writeInt(this.friendship)
}
override fun applyData(entity: PokemonEntity) {
@@ -101,6 +104,7 @@ class SpawnPokemonPacket(
entity.dataTracker.set(PokemonEntity.UNBATTLEABLE, unbattlable)
entity.dataTracker.set(PokemonEntity.HIDE_LABEL, hideLabel)
entity.dataTracker.set(PokemonEntity.SPAWN_DIRECTION, spawnYaw)
entity.dataTracker.set(PokemonEntity.FRIENDSHIP, friendship)
}
override fun checkType(entity: Entity): Boolean = entity is PokemonEntity
@@ -124,9 +128,10 @@ class SpawnPokemonPacket(
val hideLabel = buffer.readBoolean()
val caughtBall = buffer.readIdentifier()
val spawnAngle = buffer.readFloat()
val friendship = buffer.readInt()
val vanillaPacket = decodeVanillaPacket(buffer)
return SpawnPokemonPacket(ownerId, scaleModifier, species, form, aspects, battleId, phasingTargetId, beamModeEmitter, nickname, labelLevel, poseType, unbattlable, hideLabel, caughtBall, spawnAngle, vanillaPacket)
return SpawnPokemonPacket(ownerId, scaleModifier, species, form, aspects, battleId, phasingTargetId, beamModeEmitter, nickname, labelLevel, poseType, unbattlable, hideLabel, caughtBall, spawnAngle, friendship, vanillaPacket)
}
}
@@ -43,7 +43,8 @@ object CobblemonRequirementAdapter : RequirementAdapter {
this.registerType(TimeRangeRequirement.ADAPTER_VARIANT, TimeRangeRequirement::class)
this.registerType(LevelRequirement.ADAPTER_VARIANT, LevelRequirement::class)
this.registerType(WeatherRequirement.ADAPTER_VARIANT, WeatherRequirement::class)
this.registerType(AttackDefenceRatioRequirement.ADAPTER_VARIANT, AttackDefenceRatioRequirement::class)
this.registerType(StatCompareRequirement.ADAPTER_VARIANT, StatCompareRequirement::class)
this.registerType(StatEqualRequirement.ADAPTER_VARIANT, StatEqualRequirement::class)
this.registerType(BattleCriticalHitsRequirement.ADAPTER_VARIANT, BattleCriticalHitsRequirement::class)
this.registerType(DamageTakenRequirement.ADAPTER_VARIANT, DamageTakenRequirement::class)
this.registerType(UseMoveRequirement.ADAPTER_VARIANT, UseMoveRequirement::class)
@@ -9,24 +9,18 @@
package com.cobblemon.mod.common.pokemon.evolution.requirements
import com.cobblemon.mod.common.api.pokemon.evolution.requirement.EvolutionRequirement
import com.cobblemon.mod.common.api.pokemon.stats.Stats
import com.cobblemon.mod.common.pokemon.Pokemon
class AttackDefenceRatioRequirement : EvolutionRequirement {
class StatCompareRequirement : EvolutionRequirement {
companion object {
const val ADAPTER_VARIANT = "attack_defence_ratio"
}
enum class AttackDefenceRatio {
ATTACK_HIGHER,
DEFENCE_HIGHER,
EQUAL
const val ADAPTER_VARIANT = "stat_compare"
}
val ratio = AttackDefenceRatio.ATTACK_HIGHER
val highStat = Stats.ATTACK.name
val lowStat = Stats.DEFENCE.name
override fun check(pokemon: Pokemon): Boolean {
return when (ratio) {
AttackDefenceRatio.ATTACK_HIGHER -> pokemon.attack > pokemon.defence
AttackDefenceRatio.DEFENCE_HIGHER -> pokemon.defence > pokemon.attack
AttackDefenceRatio.EQUAL -> pokemon.attack == pokemon.defence
}
return pokemon.getStat(Stats.getStat(highStat)) > pokemon.getStat(Stats.getStat(lowStat))
}
}
@@ -0,0 +1,26 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.pokemon.evolution.requirements
import com.cobblemon.mod.common.api.pokemon.evolution.requirement.EvolutionRequirement
import com.cobblemon.mod.common.api.pokemon.stats.Stats
import com.cobblemon.mod.common.pokemon.Pokemon
class StatEqualRequirement : EvolutionRequirement {
companion object {
const val ADAPTER_VARIANT = "stat_equal"
}
val statOne = Stats.ATTACK.name
val statTwo = Stats.DEFENCE.name
override fun check(pokemon: Pokemon): Boolean {
return pokemon.getStat(Stats.getStat(statOne)) == pokemon.getStat(Stats.getStat(statTwo))
}
}
@@ -24,7 +24,7 @@ inline fun <reified T> Gson.fromJson(string: String) = fromJson(string, T::class
* the list value identified by the plural name. During runtime only the plural exists, but when
* configuring the JSON the user can use the singular form for a cleaner document.
*/
fun JsonObject.singularToPluralList(rootName: String, pluralName: String = "${rootName}s") {
fun JsonObject.singularToPluralList(rootName: String, pluralName: String = "${rootName}s"): JsonObject {
if (has(rootName)) {
if (!has(pluralName)) {
add(pluralName, JsonArray())
@@ -32,6 +32,7 @@ fun JsonObject.singularToPluralList(rootName: String, pluralName: String = "${ro
get(pluralName).asJsonArray.add(get(rootName))
remove(rootName)
}
return this
}
fun JsonElement.normalizeToArray(): JsonArray {
@@ -5,30 +5,32 @@
"identifier": "cobblemon:ancientoriginball/ballsparkle",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsparkle"
"texture": "textures/particles/balls/originball/originballsparkle"
}
},
"components": {
"minecraft:emitter_rate_steady": {
"spawn_rate": 16,
"max_particles": 16
"spawn_rate": 22,
"max_particles": 24
},
"minecraft:emitter_lifetime_once": {
"active_time": 0.5
},
"minecraft:emitter_shape_sphere": {
"offset": [0, 1.5, 0],
"offset": [0, 2, 0],
"radius": "math.random(0.5,1.5)*1.5",
"surface_only": true,
"direction": [0, 1, 0]
"direction": ["math.random(-9,9)", "math.random(4,7)", "math.random(-9,9)"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": 0.75,
"minecraft:particle_motion_dynamic": {},
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, 2, 0]
},
"minecraft:particle_appearance_billboard": {
"size": [0.2, 0.2],
"size": [0.175, 0.175],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 36,
@@ -5,25 +5,30 @@
"identifier": "cobblemon:ancientoriginball/battle/ballsendsparkle",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsendsparkle"
"texture": "textures/particles/balls/originball/originballsendsparkle"
}
},
"components": {
"minecraft:emitter_rate_instant": {
"num_particles": 8
"minecraft:emitter_initialization": {
"per_update_expression": "variable.radius = 0.6;"
},
"minecraft:emitter_rate_steady": {
"spawn_rate": 100,
"max_particles": 16
},
"minecraft:emitter_lifetime_once": {
"active_time": 1
},
"minecraft:emitter_shape_sphere": {
"direction": ["math.random(-10,10)", "math.random(-0.05,4)*4+0.5", "math.random(-10,10)"]
"radius": "variable.radius*math.cos(variable.emitter_age*2080)",
"direction": ["math.random(-5,5)*1.75", "math.random(-0.05,6)*3+0.5", "math.random(-5,5)*1.75"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": "math.random(4,7)*3",
"minecraft:particle_initial_speed": "math.random(3,7)*4",
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, -5, 0],
"linear_acceleration": [0, "-math.random(5,8)", 0],
"linear_drag_coefficient": 4
},
"minecraft:particle_appearance_billboard": {
@@ -5,38 +5,52 @@
"identifier": "cobblemon:ancientoriginball/battle/ballsparks",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsparks"
"texture": "textures/particles/balls/originball/originballsparks"
}
},
"curves": {
"variable.sizefunny": {
"type": "linear",
"input": "v.particle_age",
"horizontal_range": "v.particle_lifetime",
"nodes": [1, 1, 1, 0.98, 0.93, 0.83, 0.58, -0.01, 0, 0]
}
},
"components": {
"minecraft:emitter_rate_instant": {
"num_particles": 10
"num_particles": 20
},
"minecraft:emitter_lifetime_once": {
"active_time": 1
"active_time": 0.5
},
"minecraft:emitter_shape_sphere": {
"direction": ["math.random(-10,10)", "math.random(-0.1,4)*3+0.5", "math.random(-10,10)"]
"direction": ["math.random(-10,10)", "math.random(-0.1,4)*3+0.25", "math.random(-10,10)"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": "math.random(4,7)*3.5",
"minecraft:particle_initial_speed": "math.random(3.1,4.8)*3.5",
"minecraft:particle_motion_dynamic": {
"linear_drag_coefficient": 4.5
"linear_acceleration": ["math.random(-3.5,3.5)*10", "math.random(-2.5,2.5)*10", "math.random(-3.5,3.5)*10"],
"linear_drag_coefficient": 3.5
},
"minecraft:particle_appearance_billboard": {
"size": [0.15, 0.15],
"size": ["(0.225-(variable.particle_random_3*0.1))*v.sizefunny", "(0.225-(variable.particle_random_3*0.1))*v.sizefunny"],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 80,
"texture_height": 8,
"flipbook": {
"base_UV": [0, 0],
"size_UV": [8, 8],
"step_UV": [8, 0],
"frames_per_second": 18,
"max_frame": 10
"texture_width": 90,
"texture_height": 9,
"uv": ["math.floor(v.particle_random_3*10)*9", 0],
"uv_size": [9, 9]
}
},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.particle_age / v.particle_lifetime",
"gradient": {
"0.14": "#ffffffff",
"0.43": "#FFFF0000",
"0.71": "#FF7B0000"
}
}
}
@@ -5,7 +5,7 @@
"identifier": "cobblemon:ancientoriginball/battle/sendflash",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/battle/sendflash"
"texture": "textures/particles/balls/originball/battle/originsendflash"
}
},
"components": {
@@ -27,14 +27,14 @@
"size": [2.25, 2.25],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 1024,
"texture_width": 1088,
"texture_height": 64,
"flipbook": {
"base_UV": [0, 0],
"size_UV": [64, 64],
"step_UV": [64, 0],
"frames_per_second": 24,
"max_frame": 16
"max_frame": 17
}
}
}
@@ -5,12 +5,12 @@
"identifier": "cobblemon:ancientoriginball/casual/ballsendsparkle",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsendsparkle"
"texture": "textures/particles/balls/originball/originballsendsparkle"
}
},
"components": {
"minecraft:emitter_rate_instant": {
"num_particles": 4
"num_particles": 6
},
"minecraft:emitter_lifetime_once": {
"active_time": 1
@@ -21,7 +21,7 @@
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": "math.random(4,6)*2.5",
"minecraft:particle_initial_speed": "math.random(3,6)*3",
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, -6, 0],
"linear_drag_coefficient": 4
@@ -5,38 +5,52 @@
"identifier": "cobblemon:ancientoriginball/casual/ballsparks",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsparks"
"texture": "textures/particles/balls/originball/originballsparks"
}
},
"curves": {
"variable.sizefunny": {
"type": "linear",
"input": "v.particle_age",
"horizontal_range": "v.particle_lifetime",
"nodes": [1, 1, 1, 0.98, 0.93, 0.83, 0.58, -0.01, 0, 0, 0]
}
},
"components": {
"minecraft:emitter_rate_instant": {
"num_particles": 5
"num_particles": 10
},
"minecraft:emitter_lifetime_once": {
"active_time": 1
"active_time": 0.5
},
"minecraft:emitter_shape_sphere": {
"direction": ["math.random(-10,10)", "math.random(-0.1,4)*3+0.5", "math.random(-10,10)"]
"direction": ["math.random(-10,10)", "math.random(-0.1,4)*3+0.25", "math.random(-10,10)"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": "math.random(4,7)*2.1",
"minecraft:particle_initial_speed": "math.random(3.1,4.8)*2.5",
"minecraft:particle_motion_dynamic": {
"linear_acceleration": ["math.random(-3.5,3.5)*10", "math.random(-2.5,2.5)*10", "math.random(-3.5,3.5)*10"],
"linear_drag_coefficient": 3.5
},
"minecraft:particle_appearance_billboard": {
"size": [0.1, 0.1],
"size": ["(0.225-(variable.particle_random_3*0.1))*v.sizefunny", "(0.225-(variable.particle_random_3*0.1))*v.sizefunny"],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 80,
"texture_height": 8,
"flipbook": {
"base_UV": [0, 0],
"size_UV": [8, 8],
"step_UV": [8, 0],
"frames_per_second": 18,
"max_frame": 10
"texture_width": 90,
"texture_height": 9,
"uv": ["math.floor(v.particle_random_3*10)*9", 0],
"uv_size": [9, 9]
}
},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.particle_age / v.particle_lifetime",
"gradient": {
"0.14": "#ffffffff",
"0.33": "#FFFF0000",
"0.61": "#FF7B0000"
}
}
}
@@ -5,7 +5,7 @@
"identifier": "cobblemon:ancientoriginball/casual/sendflash",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/casual/sendcasual"
"texture": "textures/particles/balls/originball/casual/originsendcasual"
}
},
"components": {
@@ -27,14 +27,14 @@
"size": [1.25, 1.25],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 384,
"texture_width": 416,
"texture_height": 32,
"flipbook": {
"base_UV": [0, 0],
"size_UV": [32, 32],
"step_UV": [32, 0],
"frames_per_second": 24,
"max_frame": 12
"max_frame": 13
}
}
}
@@ -5,30 +5,32 @@
"identifier": "cobblemon:beastball/ballsparkle",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsparkle"
"texture": "textures/particles/balls/beastball/beastballsparkle"
}
},
"components": {
"minecraft:emitter_rate_steady": {
"spawn_rate": 16,
"max_particles": 16
"spawn_rate": 24,
"max_particles": 18
},
"minecraft:emitter_lifetime_once": {
"active_time": 0.5
},
"minecraft:emitter_shape_sphere": {
"offset": [0, 1.5, 0],
"radius": "math.random(0.5,1.5)*1.5",
"offset": [0, 1.75, 0],
"radius": 1.25,
"surface_only": true,
"direction": [0, 1, 0]
"direction": ["math.random(-9,9)", "math.random(4,7)", "math.random(-9,9)"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": 0.75,
"minecraft:particle_motion_dynamic": {},
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, 2, 0]
},
"minecraft:particle_appearance_billboard": {
"size": [0.2, 0.2],
"size": [0.15, 0.15],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 36,
@@ -5,12 +5,12 @@
"identifier": "cobblemon:beastball/battle/ballsendsparkle",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsendsparkle"
"texture": "textures/particles/balls/beastball/beastballsendsparkle"
}
},
"components": {
"minecraft:emitter_rate_instant": {
"num_particles": 8
"num_particles": 14
},
"minecraft:emitter_lifetime_once": {
"active_time": 1
@@ -21,13 +21,13 @@
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": "math.random(4,7)*3",
"minecraft:particle_initial_speed": "math.random(4,7)*4.5",
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, -5, 0],
"linear_drag_coefficient": 4
"linear_acceleration": [0, -6, 0],
"linear_drag_coefficient": 5
},
"minecraft:particle_appearance_billboard": {
"size": [0.15, 0.15],
"size": [0.125, 0.125],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 99,
@@ -5,28 +5,32 @@
"identifier": "cobblemon:beastball/battle/ballsparks",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsparks"
"texture": "textures/particles/balls/beastball/beastballsparks"
}
},
"components": {
"minecraft:emitter_rate_instant": {
"num_particles": 10
"num_particles": 20
},
"minecraft:emitter_lifetime_once": {
"active_time": 1
},
"minecraft:emitter_shape_sphere": {
"direction": ["math.random(-10,10)", "math.random(-0.1,4)*3+0.5", "math.random(-10,10)"]
"direction": ["math.random(-10,10)", "math.random(-0.5,5)*5+0.5", "math.random(-10,10)"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": "math.random(4,7)*3.5",
"minecraft:particle_initial_spin": {
"rotation": "math.random_integer(0,3)*90"
},
"minecraft:particle_initial_speed": "math.random(3,6)*3",
"minecraft:particle_motion_dynamic": {
"linear_drag_coefficient": 4.5
"linear_acceleration": [0, -20, 0],
"linear_drag_coefficient": 2
},
"minecraft:particle_appearance_billboard": {
"size": [0.15, 0.15],
"size": ["0.075+0.075*v.particle_random_2", "0.075+0.075*v.particle_random_2"],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 80,
@@ -5,7 +5,7 @@
"identifier": "cobblemon:beastball/battle/sendflash",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/battle/sendflash"
"texture": "textures/particles/balls/beastball/battle/beastsendflash"
}
},
"components": {
@@ -27,14 +27,14 @@
"size": [2.25, 2.25],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 1024,
"texture_width": 1088,
"texture_height": 64,
"flipbook": {
"base_UV": [0, 0],
"size_UV": [64, 64],
"step_UV": [64, 0],
"frames_per_second": 24,
"max_frame": 16
"max_frame": 17
}
}
}
@@ -5,12 +5,12 @@
"identifier": "cobblemon:beastball/casual/ballsendsparkle",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsendsparkle"
"texture": "textures/particles/balls/beastball/beastballsendsparkle"
}
},
"components": {
"minecraft:emitter_rate_instant": {
"num_particles": 4
"num_particles": 6
},
"minecraft:emitter_lifetime_once": {
"active_time": 1
@@ -21,7 +21,7 @@
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": "math.random(4,6)*2.5",
"minecraft:particle_initial_speed": "math.random(3,6)*3",
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, -6, 0],
"linear_drag_coefficient": 4
@@ -5,28 +5,32 @@
"identifier": "cobblemon:beastball/casual/ballsparks",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsparks"
"texture": "textures/particles/balls/beastball/beastballsparks"
}
},
"components": {
"minecraft:emitter_rate_instant": {
"num_particles": 5
"num_particles": 12
},
"minecraft:emitter_lifetime_once": {
"active_time": 1
},
"minecraft:emitter_shape_sphere": {
"direction": ["math.random(-10,10)", "math.random(-0.1,4)*3+0.5", "math.random(-10,10)"]
"direction": ["math.random(-10,10)", "math.random(-0.5,5)*5+0.5", "math.random(-10,10)"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": "math.random(4,7)*2.1",
"minecraft:particle_initial_spin": {
"rotation": "math.random_integer(0,3)*90"
},
"minecraft:particle_initial_speed": "math.random(3,7)*2",
"minecraft:particle_motion_dynamic": {
"linear_drag_coefficient": 3.5
"linear_acceleration": [0, -15, 0],
"linear_drag_coefficient": 2
},
"minecraft:particle_appearance_billboard": {
"size": [0.1, 0.1],
"size": ["0.05+0.075*v.particle_random_2", "0.05+0.075*v.particle_random_2"],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 80,
@@ -5,7 +5,7 @@
"identifier": "cobblemon:beastball/casual/sendflash",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/casual/sendcasual"
"texture": "textures/particles/balls/beastball/casual/beastsendcasual"
}
},
"components": {
@@ -5,30 +5,32 @@
"identifier": "cobblemon:cherishball/ballsparkle",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsparkle"
"texture": "textures/particles/balls/cherishball/cherishballsparkle"
}
},
"components": {
"minecraft:emitter_rate_steady": {
"spawn_rate": 16,
"max_particles": 16
"spawn_rate": 24,
"max_particles": 18
},
"minecraft:emitter_lifetime_once": {
"active_time": 0.5
},
"minecraft:emitter_shape_sphere": {
"offset": [0, 1.5, 0],
"radius": "math.random(0.5,1.5)*1.5",
"offset": [0, 1.75, 0],
"radius": 1.25,
"surface_only": true,
"direction": [0, 1, 0]
"direction": ["math.random(-9,9)", "math.random(4,7)", "math.random(-9,9)"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": 0.75,
"minecraft:particle_motion_dynamic": {},
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, 2, 0]
},
"minecraft:particle_appearance_billboard": {
"size": [0.2, 0.2],
"size": [0.15, 0.15],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 36,
@@ -41,6 +43,15 @@
"max_frame": 4
}
}
},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.particle_age / v.particle_lifetime",
"gradient": {
"0.0": "#FFFFFFFF",
"0.19": "#FFFF8845"
}
}
}
}
}
@@ -5,12 +5,12 @@
"identifier": "cobblemon:cherishball/battle/ballsendsparkle",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsendsparkle"
"texture": "textures/particles/balls/cherishball/cherishballsendsparkle"
}
},
"components": {
"minecraft:emitter_rate_instant": {
"num_particles": 8
"num_particles": 14
},
"minecraft:emitter_lifetime_once": {
"active_time": 1
@@ -21,13 +21,13 @@
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": "math.random(4,7)*3",
"minecraft:particle_initial_speed": "math.random(4,7)*4.5",
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, -5, 0],
"linear_drag_coefficient": 4
"linear_acceleration": [0, -6, 0],
"linear_drag_coefficient": 5
},
"minecraft:particle_appearance_billboard": {
"size": [0.15, 0.15],
"size": [0.125, 0.125],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 99,
@@ -40,6 +40,17 @@
"max_frame": 11
}
}
},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.particle_age / v.particle_lifetime",
"gradient": {
"0.0": "#FF8DFFC6",
"0.2": "#ffffffff",
"0.35": "#ffffffff",
"0.53": "#FFFF8845"
}
}
}
}
}
@@ -5,12 +5,12 @@
"identifier": "cobblemon:cherishball/battle/ballsparks",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsparks"
"texture": "textures/particles/balls/cherishball/cherishballsparks"
}
},
"components": {
"minecraft:emitter_rate_instant": {
"num_particles": 10
"num_particles": 8
},
"minecraft:emitter_lifetime_once": {
"active_time": 1
@@ -21,9 +21,9 @@
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": "math.random(4,7)*3.5",
"minecraft:particle_initial_speed": "math.random(3,6)*3.75",
"minecraft:particle_motion_dynamic": {
"linear_drag_coefficient": 4.5
"linear_drag_coefficient": 5
},
"minecraft:particle_appearance_billboard": {
"size": [0.15, 0.15],
@@ -39,6 +39,17 @@
"max_frame": 10
}
}
},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.particle_age / v.particle_lifetime",
"gradient": {
"0.0": "#FF8DFFC6",
"0.2": "#ffffffff",
"0.35": "#ffffffff",
"0.53": "#FFFF8845"
}
}
}
}
}
@@ -5,7 +5,7 @@
"identifier": "cobblemon:cherishball/battle/sendflash",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/battle/sendflash"
"texture": "textures/particles/balls/cherishball/battle/cherishsendflash"
}
},
"components": {
@@ -27,14 +27,25 @@
"size": [2.25, 2.25],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 1024,
"texture_width": 1088,
"texture_height": 64,
"flipbook": {
"base_UV": [0, 0],
"size_UV": [64, 64],
"step_UV": [64, 0],
"frames_per_second": 24,
"max_frame": 16
"max_frame": 17
}
}
},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.particle_age / v.particle_lifetime",
"gradient": {
"0.0": "#FF8DFFC6",
"0.2": "#ffffffff",
"0.35": "#ffffffff",
"0.53": "#FFFF8845"
}
}
}
@@ -5,12 +5,12 @@
"identifier": "cobblemon:cherishball/casual/ballsendsparkle",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsendsparkle"
"texture": "textures/particles/balls/cherishball/cherishballsendsparkle"
}
},
"components": {
"minecraft:emitter_rate_instant": {
"num_particles": 4
"num_particles": 6
},
"minecraft:emitter_lifetime_once": {
"active_time": 1
@@ -21,7 +21,7 @@
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": "math.random(4,6)*2.5",
"minecraft:particle_initial_speed": "math.random(3,6)*3",
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, -6, 0],
"linear_drag_coefficient": 4
@@ -40,6 +40,17 @@
"max_frame": 11
}
}
},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.particle_age / v.particle_lifetime",
"gradient": {
"0.0": "#FF8DFFC6",
"0.2": "#ffffffff",
"0.35": "#ffffffff",
"0.53": "#FFFF8845"
}
}
}
}
}
@@ -5,7 +5,7 @@
"identifier": "cobblemon:cherishball/casual/ballsparks",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsparks"
"texture": "textures/particles/balls/cherishball/cherishballsparks"
}
},
"components": {
@@ -21,9 +21,9 @@
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": "math.random(4,7)*2.1",
"minecraft:particle_initial_speed": "math.random(3,7)*2",
"minecraft:particle_motion_dynamic": {
"linear_drag_coefficient": 3.5
"linear_drag_coefficient": 3
},
"minecraft:particle_appearance_billboard": {
"size": [0.1, 0.1],
@@ -39,6 +39,17 @@
"max_frame": 10
}
}
},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.particle_age / v.particle_lifetime",
"gradient": {
"0.0": "#FF8DFFC6",
"0.2": "#ffffffff",
"0.35": "#ffffffff",
"0.53": "#FFFF8845"
}
}
}
}
}
@@ -5,7 +5,7 @@
"identifier": "cobblemon:cherishball/casual/sendflash",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/casual/sendcasual"
"texture": "textures/particles/balls/cherishball/casual/cherishsendcasual"
}
},
"components": {
@@ -27,14 +27,25 @@
"size": [1.25, 1.25],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 384,
"texture_width": 416,
"texture_height": 32,
"flipbook": {
"base_UV": [0, 0],
"size_UV": [32, 32],
"step_UV": [32, 0],
"frames_per_second": 24,
"max_frame": 12
"max_frame": 13
}
}
},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.particle_age / v.particle_lifetime",
"gradient": {
"0.0": "#FF8DFFC6",
"0.2": "#ffffffff",
"0.35": "#ffffffff",
"0.53": "#FFFF8845"
}
}
}
@@ -5,22 +5,22 @@
"identifier": "cobblemon:dreamball/ballsparkle",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsparkle"
"texture": "textures/particles/balls/dreamball/dreamballsparkle"
}
},
"components": {
"minecraft:emitter_rate_steady": {
"spawn_rate": 16,
"max_particles": 16
"spawn_rate": 20,
"max_particles": 14
},
"minecraft:emitter_lifetime_once": {
"active_time": 0.5
},
"minecraft:emitter_shape_sphere": {
"offset": [0, 1.5, 0],
"radius": "math.random(0.5,1.5)*1.5",
"offset": [0, 1.25, 0],
"radius": "1.25",
"surface_only": true,
"direction": [0, 1, 0]
"direction": "outwards"
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
@@ -5,12 +5,12 @@
"identifier": "cobblemon:dreamball/battle/ballsendsparkle",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsendsparkle"
"texture": "textures/particles/balls/dreamball/dreamballsendsparkle"
}
},
"components": {
"minecraft:emitter_rate_instant": {
"num_particles": 8
"num_particles": 14
},
"minecraft:emitter_lifetime_once": {
"active_time": 1
@@ -21,13 +21,13 @@
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": "math.random(4,7)*3",
"minecraft:particle_initial_speed": "math.random(4,7)*4.5",
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, -5, 0],
"linear_drag_coefficient": 4
"linear_acceleration": [0, -6, 0],
"linear_drag_coefficient": 5
},
"minecraft:particle_appearance_billboard": {
"size": [0.15, 0.15],
"size": [0.125, 0.125],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 99,
@@ -5,12 +5,12 @@
"identifier": "cobblemon:dreamball/battle/ballsparks",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsparks"
"texture": "textures/particles/balls/dreamball/dreamballsparks"
}
},
"components": {
"minecraft:emitter_rate_instant": {
"num_particles": 10
"num_particles": 8
},
"minecraft:emitter_lifetime_once": {
"active_time": 1
@@ -21,9 +21,9 @@
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": "math.random(4,7)*3.5",
"minecraft:particle_initial_speed": "math.random(3,6)*3.75",
"minecraft:particle_motion_dynamic": {
"linear_drag_coefficient": 4.5
"linear_drag_coefficient": 5
},
"minecraft:particle_appearance_billboard": {
"size": [0.15, 0.15],
@@ -5,7 +5,7 @@
"identifier": "cobblemon:dreamball/battle/sendflash",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/battle/sendflash"
"texture": "textures/particles/balls/dreamball/battle/dreamsendflash"
}
},
"components": {
@@ -27,14 +27,14 @@
"size": [2.25, 2.25],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 1024,
"texture_width": 1088,
"texture_height": 64,
"flipbook": {
"base_UV": [0, 0],
"size_UV": [64, 64],
"step_UV": [64, 0],
"frames_per_second": 24,
"max_frame": 16
"max_frame": 17
}
}
}
@@ -5,12 +5,12 @@
"identifier": "cobblemon:dreamball/casual/ballsendsparkle",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsendsparkle"
"texture": "textures/particles/balls/dreamball/dreamballsendsparkle"
}
},
"components": {
"minecraft:emitter_rate_instant": {
"num_particles": 4
"num_particles": 6
},
"minecraft:emitter_lifetime_once": {
"active_time": 1
@@ -21,7 +21,7 @@
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": "math.random(4,6)*2.5",
"minecraft:particle_initial_speed": "math.random(3,6)*3",
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, -6, 0],
"linear_drag_coefficient": 4
@@ -5,7 +5,7 @@
"identifier": "cobblemon:dreamball/casual/ballsparks",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/ballsparks"
"texture": "textures/particles/balls/dreamball/dreamballsparks"
}
},
"components": {
@@ -21,9 +21,9 @@
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": "math.random(4,7)*2.1",
"minecraft:particle_initial_speed": "math.random(3,7)*2",
"minecraft:particle_motion_dynamic": {
"linear_drag_coefficient": 3.5
"linear_drag_coefficient": 3
},
"minecraft:particle_appearance_billboard": {
"size": [0.1, 0.1],
@@ -5,7 +5,7 @@
"identifier": "cobblemon:dreamball/casual/sendflash",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/balls/pokeball/casual/sendcasual"
"texture": "textures/particles/balls/dreamball/casual/dreamsendcasual"
}
},
"components": {
@@ -159,36 +159,36 @@
"gimmighoul.reveal": {
"sounds": [ "cobblemon:gimmighoul_reveal" ]
},
"coin_pouch.break": {
"relic_coin_sack.break": {
"sounds": [
"cobblemon:block/coin_pouch/coin_pouch_block_break_1",
"cobblemon:block/coin_pouch/coin_pouch_block_break_2",
"cobblemon:block/coin_pouch/coin_pouch_block_break_3",
"cobblemon:block/coin_pouch/coin_pouch_block_break_4"
"cobblemon:block/relic_coin_sack/relic_coin_sack_break_1",
"cobblemon:block/relic_coin_sack/relic_coin_sack_break_2",
"cobblemon:block/relic_coin_sack/relic_coin_sack_break_3",
"cobblemon:block/relic_coin_sack/relic_coin_sack_break_4"
]
},
"coin_pouch.hit": {
"relic_coin_sack.hit": {
"sounds": [
{ "name": "cobblemon:block/coin_pouch/coin_pouch_block_hit_1", "volume": 0.6 },
{ "name": "cobblemon:block/coin_pouch/coin_pouch_block_hit_2", "volume": 0.6 },
{ "name": "cobblemon:block/coin_pouch/coin_pouch_block_hit_3", "volume": 0.6 },
{ "name": "cobblemon:block/coin_pouch/coin_pouch_block_hit_4", "volume": 0.6 }
{ "name": "cobblemon:block/relic_coin_sack/relic_coin_sack_hit_1", "volume": 0.5 },
{ "name": "cobblemon:block/relic_coin_sack/relic_coin_sack_hit_2", "volume": 0.5 },
{ "name": "cobblemon:block/relic_coin_sack/relic_coin_sack_hit_3", "volume": 0.5 },
{ "name": "cobblemon:block/relic_coin_sack/relic_coin_sack_hit_4", "volume": 0.5 }
]
},
"coin_pouch.place": {
"relic_coin_sack.place": {
"sounds": [
"cobblemon:block/coin_pouch/coin_pouch_block_place_1",
"cobblemon:block/coin_pouch/coin_pouch_block_place_2",
"cobblemon:block/coin_pouch/coin_pouch_block_place_3",
"cobblemon:block/coin_pouch/coin_pouch_block_place_4"
"cobblemon:block/relic_coin_sack/relic_coin_sack_place_1",
"cobblemon:block/relic_coin_sack/relic_coin_sack_place_2",
"cobblemon:block/relic_coin_sack/relic_coin_sack_place_3",
"cobblemon:block/relic_coin_sack/relic_coin_sack_place_4"
]
},
"coin_pouch.step": {
"relic_coin_sack.step": {
"sounds": [
"cobblemon:block/coin_pouch/coin_pouch_block_step_1",
"cobblemon:block/coin_pouch/coin_pouch_block_step_2",
"cobblemon:block/coin_pouch/coin_pouch_block_step_3",
"cobblemon:block/coin_pouch/coin_pouch_block_step_4"
"cobblemon:block/relic_coin_sack/relic_coin_sack_step_1",
"cobblemon:block/relic_coin_sack/relic_coin_sack_step_2",
"cobblemon:block/relic_coin_sack/relic_coin_sack_step_3",
"cobblemon:block/relic_coin_sack/relic_coin_sack_step_4"
]
},
"tumblestone.break": {
@@ -199,6 +199,22 @@
"cobblemon:block/tumblestone/tumblestone_break_4"
]
},
"relic_coin_pouch.break": {
"sounds": [
"cobblemon:block/relic_coin_pouch/relic_coin_pouch_break_1",
"cobblemon:block/relic_coin_pouch/relic_coin_pouch_break_2",
"cobblemon:block/relic_coin_pouch/relic_coin_pouch_break_3",
"cobblemon:block/relic_coin_pouch/relic_coin_pouch_break_4"
]
},
"relic_coin_pouch.place": {
"sounds": [
"cobblemon:block/relic_coin_pouch/relic_coin_pouch_place_1",
"cobblemon:block/relic_coin_pouch/relic_coin_pouch_place_2",
"cobblemon:block/relic_coin_pouch/relic_coin_pouch_place_3",
"cobblemon:block/relic_coin_pouch/relic_coin_pouch_place_4"
]
},
"tumblestone.block_break": {
"sounds": [
"cobblemon:block/tumblestone/tumblestone_block_break_1",
Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Loaded 100 of 112 files, more files were not shown because too many files have changed in this diff. Show more