Compare commits

..
Author SHA1 Message Date
Konoha 642ad77228 Attempt to allow for visibility preconditions on NPCs 2025-09-09 21:28:29 -04:00
454 changed files with 13089 additions and 63869 deletions

No files matched your search

-1
View File
@@ -22,7 +22,6 @@
### Changes
- Slots in pastures will now have darker backgrounds and italicised Pokémon names if the Pokémon is not owned by the player.
- The pasture slot will show the name of the Pokémon owner when hovered if the Pokémon is not owned.
- Increased the default PC box count from 30 to 40 to accommodate the fact that we have way more Pokémon now. If you've changed this config option then you'll need to edit it again after starting up with 1.7!
### Developer
- Added `RenamePCBoxEvent.Pre` and `RenamePCBoxEvent.Post` events to prevent players from renaming a box or changing their input.
-1
View File
@@ -4,7 +4,6 @@
### Fixes
- Fixed the "enabled" property in spawn files not actually being respected. Where do they find these devs?
- Fixed Terralith's shrubland not counting as plains for spawning purposes the way it was intended to.
### Developer
- Spawning Influences now have the context of what the other buckets are when adjusting bucket weights. This will break existing influences that do bucket weight adjustment.
-11
View File
@@ -143,8 +143,6 @@
- Dedenne
- Noibat
- Noivern
- Furfrou
- You can change Furfrou's form by using shears on it while it holds a certain dye in its cosmetic slot.
#### Gen 7
- Yungoos
@@ -279,10 +277,6 @@
- Parasect
- Bastiodon
- Amaura
- Varoom
- Revavroom
- Bouffalant
- Lickilicky
### Model updates for the following Pokémon
- Cleffa
@@ -389,10 +383,6 @@
- Starly
- Staravia
- Staraptor
- Varoom
- Revavroom
- Nickit
- Thievul
### Changes
- Changed pokemon caught and seen count to update based on the current pokedex being looked
@@ -538,7 +528,6 @@
- Fixed Pokémon with alternate forms being created with an incorrect 'forced' tag on their ability.
- Fixed busted abilities and moves in Pokémon data due to removed datapacks etc. causing storage corruption. It now just rerolls their ability / uses Tackle.
- Fixed singular Pokémon corruption causing entire storage corruption. Storages will now skip corrupted Pokémon and print an error to console.
- Fixed species additions not being able to properly mark a species as implemented.
### Developer
- A finished battle now has winners and losers set inside of `PokemonBattle` instead of them always being empty.
+1 -1
View File
@@ -94,4 +94,4 @@ sourceSets {
}
}
}
}
}
@@ -25,9 +25,9 @@ public class TargetingConditionsMixin {
@Inject(method = "test", at = @At("HEAD"), cancellable = true)
public void test(@Nullable LivingEntity baseEntity, LivingEntity targetEntity, CallbackInfoReturnable<Boolean> ci) {
if (targetEntity instanceof ServerPlayer player) {
if (player.level().getGameRules().getBoolean(CobblemonGameRules.MOB_TARGET_IN_BATTLE)) return;
boolean canTargetInBattle = player.level().getGameRules().getBoolean(CobblemonGameRules.MOB_TARGET_IN_BATTLE);
boolean targetInBattle = Cobblemon.INSTANCE.getBattleRegistry().getBattleByParticipatingPlayer(player) != null;
if (targetInBattle) ci.setReturnValue(false);
if (!canTargetInBattle && targetInBattle) ci.setReturnValue(false);
}
}
}
@@ -11,10 +11,7 @@ package com.cobblemon.mod.common.mixin.entity;
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity;
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.Level;
import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
@@ -42,17 +39,10 @@ public abstract class EntityMixin {
target = "Lnet/minecraft/world/entity/Entity;onGround()Z"
)
)
public boolean cobblemon$forceOnGroundForStepUp(Entity entity, Operation<Boolean> original) {
public boolean cobblemon$forceOnGroundForStepUp(Entity entity, Operation<Boolean> original)
{
if (entity instanceof PokemonEntity && entity.hasControllingPassenger()) {
BlockPos below = entity.blockPosition().below();
Level level = entity.level();
var blockStateBelow = level.getBlockState(below);
boolean isAirOrLiquid = blockStateBelow.isAir() || !blockStateBelow.getFluidState().isEmpty();
boolean canSupportEntity = blockStateBelow.isFaceSturdy(level, below, Direction.UP);
boolean standingOnSolid = canSupportEntity && !isAirOrLiquid;
if (standingOnSolid) {
return true;
}
return true;
}
return original.call(entity);
}
@@ -22,7 +22,6 @@ import com.cobblemon.mod.common.block.BerryBlock
import com.cobblemon.mod.common.block.MintBlock
import com.cobblemon.mod.common.block.MintBlock.MintType
import com.cobblemon.mod.common.client.pokedex.PokedexType
import com.cobblemon.mod.common.block.campfirepot.CampfirePotColor
import com.cobblemon.mod.common.entity.boat.CobblemonBoatType
import com.cobblemon.mod.common.item.*
import com.cobblemon.mod.common.item.armor.CobblemonArmorTrims
@@ -193,19 +192,19 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
val campfire_pots = mutableListOf<CampfirePotItem>()
@JvmField
val CAMPFIRE_POT_RED = campfirePotItem(CobblemonBlocks.RED_CAMPFIRE_POT, CampfirePotColor.RED)
val CAMPFIRE_POT_RED = campfirePotItem(CobblemonBlocks.RED_CAMPFIRE_POT, "red")
@JvmField
val CAMPFIRE_POT_YELLOW = campfirePotItem(CobblemonBlocks.YELLOW_CAMPFIRE_POT, CampfirePotColor.YELLOW)
val CAMPFIRE_POT_YELLOW = campfirePotItem(CobblemonBlocks.YELLOW_CAMPFIRE_POT, "yellow")
@JvmField
val CAMPFIRE_POT_GREEN = campfirePotItem(CobblemonBlocks.GREEN_CAMPFIRE_POT, CampfirePotColor.GREEN)
val CAMPFIRE_POT_GREEN = campfirePotItem(CobblemonBlocks.GREEN_CAMPFIRE_POT, "green")
@JvmField
val CAMPFIRE_POT_BLUE = campfirePotItem(CobblemonBlocks.BLUE_CAMPFIRE_POT, CampfirePotColor.BLUE)
val CAMPFIRE_POT_BLUE = campfirePotItem(CobblemonBlocks.BLUE_CAMPFIRE_POT, "blue")
@JvmField
val CAMPFIRE_POT_PINK = campfirePotItem(CobblemonBlocks.PINK_CAMPFIRE_POT, CampfirePotColor.PINK)
val CAMPFIRE_POT_PINK = campfirePotItem(CobblemonBlocks.PINK_CAMPFIRE_POT, "pink")
@JvmField
val CAMPFIRE_POT_BLACK = campfirePotItem(CobblemonBlocks.BLACK_CAMPFIRE_POT, CampfirePotColor.BLACK)
val CAMPFIRE_POT_BLACK = campfirePotItem(CobblemonBlocks.BLACK_CAMPFIRE_POT, "black")
@JvmField
val CAMPFIRE_POT_WHITE = campfirePotItem(CobblemonBlocks.WHITE_CAMPFIRE_POT, CampfirePotColor.WHITE)
val CAMPFIRE_POT_WHITE = campfirePotItem(CobblemonBlocks.WHITE_CAMPFIRE_POT, "white")
@JvmField
val HEARTY_GRAINS = compostableItem("hearty_grains", ItemNameBlockItem(CobblemonBlocks.HEARTY_GRAINS, Properties().rarity(Rarity.COMMON)))
@@ -1501,8 +1500,8 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
}
)
private fun campfirePotItem(block: Block, color: CampfirePotColor): CampfirePotItem {
val item = create("campfire_pot_${color.suffix}", CampfirePotItem(block, color))
private fun campfirePotItem(block: Block, type: String): CampfirePotItem {
val item = create("campfire_pot_${type}", CampfirePotItem(block))
campfire_pots.add(item)
return item
}
@@ -1649,4 +1648,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()))
}
}
}
@@ -9,7 +9,6 @@
package com.cobblemon.mod.common
import com.cobblemon.mod.common.api.ai.CobblemonAttackTargetData
import com.cobblemon.mod.common.api.ai.CobblemonAvoidTargetData
import com.cobblemon.mod.common.api.ai.CobblemonWanderControl
import com.cobblemon.mod.common.api.dialogue.ActiveDialogue
import com.cobblemon.mod.common.api.moves.animations.ActionEffectContext
@@ -58,7 +57,6 @@ object CobblemonMemories {
/** how many are following me rn? */
val HERD_SIZE = register<Int>("herd_size") // Don't bother saving it, we'll try to keep count roughly.
val ATTACK_TARGET_DATA = register<CobblemonAttackTargetData>("attack_target_data") // This is used to store additional information about the attack target, such as when to give up pursuit.
val AVOID_TARGET_DATA = register<CobblemonAvoidTargetData>("avoid_target_data") // This is used to store additional information about the avoid target, such as how fast to move.
val WANDER_CONTROL = register<CobblemonWanderControl>("wander_control")
val DISABLE_WALK_TO_WANTED_ITEM = register<Boolean>("disable_walk_to_wanted_item")
val TIME_TRYING_TO_REACH_WANTED_ITEM = register<Int>("time_trying_to_wanted_item")
@@ -157,7 +157,6 @@ import com.cobblemon.mod.common.net.messages.server.callback.party.PartyPokemonS
import com.cobblemon.mod.common.net.messages.server.callback.party.PartySelectCancelledPacket
import com.cobblemon.mod.common.net.messages.server.callback.partymove.PartyMoveSelectCancelledPacket
import com.cobblemon.mod.common.net.messages.server.callback.partymove.PartyPokemonMoveSelectedPacket
import com.cobblemon.mod.common.net.messages.server.debug.ServerboundUpdateRidingSettingsPacket
import com.cobblemon.mod.common.net.messages.server.debug.ServerboundUpdateRidingStatRangePacket
import com.cobblemon.mod.common.net.messages.server.debug.ServerboundUpdateRidingStatsPacket
import com.cobblemon.mod.common.net.messages.server.dialogue.EscapeDialoguePacket
@@ -209,7 +208,6 @@ import com.cobblemon.mod.common.net.serverhandling.callback.party.PartyPokemonSe
import com.cobblemon.mod.common.net.serverhandling.callback.party.PartySelectCancelledHandler
import com.cobblemon.mod.common.net.serverhandling.callback.partymove.PartyMoveSelectCancelledHandler
import com.cobblemon.mod.common.net.serverhandling.callback.partymove.PartyPokemonMoveSelectedHandler
import com.cobblemon.mod.common.net.serverhandling.debug.ServerboundUpdateRidingSettingsHandler
import com.cobblemon.mod.common.net.serverhandling.debug.ServerboundUpdateRidingStatRangeHandler
import com.cobblemon.mod.common.net.serverhandling.debug.ServerboundUpdateRidingStatsHandler
import com.cobblemon.mod.common.net.serverhandling.dialogue.EscapeDialogueHandler
@@ -580,7 +578,6 @@ object CobblemonNetwork {
list.add(PacketRegisterInfo(ServerboundUpdateRidingStatePacket.ID, ServerboundUpdateRidingStatePacket::decode, ServerboundUpdateRidingStateHandler))
list.add(PacketRegisterInfo(ServerboundUpdateRidingStatsPacket.ID, ServerboundUpdateRidingStatsPacket::decode, ServerboundUpdateRidingStatsHandler))
list.add(PacketRegisterInfo(ServerboundUpdateRidingStatRangePacket.ID, ServerboundUpdateRidingStatRangePacket::decode, ServerboundUpdateRidingStatRangeHandler))
list.add(PacketRegisterInfo(ServerboundUpdateRidingSettingsPacket.ID, ServerboundUpdateRidingSettingsPacket::decode, ServerboundUpdateRidingSettingsHandler))
list.add(PacketRegisterInfo(DismountPokemonPacket.ID, DismountPokemonPacket::decode, DismountPokemonPacketHandler))
list.add(PacketRegisterInfo(ServerboundUpdateDriverInputPacket.ID, ServerboundUpdateDriverInputPacket::decode, DriverInputPacketHandler))
@@ -20,8 +20,6 @@ import com.cobblemon.mod.common.util.asExpression
import com.cobblemon.mod.common.util.asIdentifierDefaultingNamespace
import com.cobblemon.mod.common.util.resolve
import net.minecraft.world.entity.Entity
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.ai.memory.MemoryModuleType
/**
* This is used in the AI system to store optional additional information about the attack target,
@@ -43,21 +41,15 @@ import net.minecraft.world.entity.ai.memory.MemoryModuleType
class CobblemonAttackTargetData(
/** An expression that returns false when the target is no longer worth attacking. */
var shouldContinue: Expression = "true".asExpression(),
var dealtHitsUntilDisengage: Int = -1, // -1 means no limit
var disengageAction: (entity: LivingEntity) -> Unit = ::defaultDisengage
var hitsUntilDisengage: Int = -1, // -1 means no limit
var disengageAction: (entity: Entity) -> Unit = {}
) {
companion object {
fun defaultDisengage(entity: LivingEntity) {
entity.brain.eraseMemory(MemoryModuleType.ATTACK_TARGET)
entity.brain.updateActivityFromSchedule(entity.level().dayTime, entity.level().gameTime)
}
}
val struct = ObjectValue<CobblemonAttackTargetData>(this).also {
it.addFunction("dealt_hits_until_disengage") { DoubleValue(dealtHitsUntilDisengage.toDouble()) }
it.addFunction("set_dealt_hits_until_disengage") { params ->
it.addFunction("hits_until_disengage") { DoubleValue(hitsUntilDisengage.toDouble()) }
it.addFunction("set_hits_until_disengage") { params ->
val value = params.getDouble(0)
dealtHitsUntilDisengage = value.toInt()
DoubleValue(dealtHitsUntilDisengage.toDouble())
hitsUntilDisengage = value.toInt()
DoubleValue(hitsUntilDisengage.toDouble())
}
it.addFunction("set_disengage_action") { params ->
val script = params.getString(0).asIdentifierDefaultingNamespace()
@@ -72,15 +64,8 @@ class CobblemonAttackTargetData(
}
DoubleValue.ONE
}
it.addFunction("reset") {
shouldContinue = "true".asExpression()
dealtHitsUntilDisengage = -1
disengageAction = ::defaultDisengage
DoubleValue.ONE
}
it.addFunction("unset_disengage_action") { params ->
disengageAction = ::defaultDisengage
disengageAction = {}
}
}
}
@@ -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.api.ai
import com.bedrockk.molang.runtime.value.DoubleValue
import com.cobblemon.mod.common.api.molang.ObjectValue
import com.cobblemon.mod.common.util.getDoubleOrNull
class CobblemonAvoidTargetData {
var walkSpeed: Float? = null
@Transient
val struct = ObjectValue<CobblemonAvoidTargetData>(this).also {
it.addFunction("walk_speed") { DoubleValue(walkSpeed) }
it.addFunction("set_walk_speed") { walkSpeed = it.getDoubleOrNull(0)?.toFloat() }
}
}
@@ -13,6 +13,7 @@ import com.cobblemon.mod.common.util.getBooleanOrNull
import com.cobblemon.mod.common.util.getDoubleOrNull
import kotlin.math.sqrt
import net.minecraft.core.BlockPos
import net.minecraft.world.entity.PathfinderMob
/**
* Used to maintain some settings around how the entity should wander this tick. The idea is you
@@ -29,8 +30,7 @@ class CobblemonWanderControl(
var allowWater: Boolean = false,
var allowAir: Boolean = false,
var pathCooldownTicks: Int = 20 * 5, // Used to mitigate the cost of pathfinding.
var speedMultiplier: Float = 1F,
var wanderChance: Float? = null
var wanderSpeed: Float = 0.35F,
) {
class WanderCenter(val x: Number, val y: Number, val z: Number, val minRange: Float, val maxRange: Float)
@@ -46,7 +46,7 @@ class CobblemonWanderControl(
.addFunction("allow_water") { if (allowWater) 1.0 else 0.0 }
.addFunction("allow_air") { if (allowAir) 1.0 else 0.0 }
.addFunction("path_cooldown_ticks") { pathCooldownTicks.toDouble() }
.addFunction("speed_multiplier") { speedMultiplier }
.addFunction("wander_speed") { wanderSpeed }
.addFunction("set_center") { params ->
if (params.params.size < 3) {
throw IllegalArgumentException("set_center requires at least 3 parameters: x, y, z")
@@ -69,19 +69,15 @@ class CobblemonWanderControl(
.addFunction("set_allow_water") { params -> allowWater = params.getBooleanOrNull(0) ?: false }
.addFunction("set_allow_air") { params -> allowAir = params.getBooleanOrNull(0) ?: false }
.addFunction("set_path_cooldown_ticks") { params -> pathCooldownTicks = params.getDoubleOrNull(0)?.toInt() ?: (20 * 5) }
.addFunction("set_speed_multiplier") { params -> speedMultiplier = params.getDoubleOrNull(0)?.toFloat() ?: 0.35F }
.addFunction("set_wander_chance") { params ->
wanderChance = params.getDoubleOrNull(0)?.toFloat()
}
.addFunction("set_wander_speed") { params -> wanderSpeed = params.getDoubleOrNull(0)?.toFloat() ?: 0.35F }
.addFunction("reset") {
center = null
allowLand = false
allowWater = false
allowAir = false
pathCooldownTicks = 20 * 5
speedMultiplier = 1F
wanderSpeed = 0.35F
maxAttempts = 4
wanderChance = null
}
fun isSuitable(position: BlockPos): Boolean {
@@ -12,9 +12,11 @@ import com.cobblemon.mod.common.CobblemonMemories
import com.cobblemon.mod.common.api.ai.BehaviourConfigurationContext
import com.cobblemon.mod.common.api.ai.ExpressionOrEntityVariable
import com.cobblemon.mod.common.api.ai.asVariables
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asMostSpecificMoLangValue
import com.cobblemon.mod.common.api.npc.configuration.MoLangConfigVariable
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.util.asExpression
import com.cobblemon.mod.common.util.withQueryValue
import com.mojang.datafixers.util.Either
import kotlin.jvm.optionals.getOrNull
import net.minecraft.world.entity.LivingEntity
@@ -25,9 +27,7 @@ import net.minecraft.world.entity.ai.memory.MemoryModuleType
import net.minecraft.world.entity.ai.sensing.SensorType
/**
* Checks nearby entities and counts how many have nominated this entity as their leader. We normally update this
* as people join and leave the herd, but this is a fallback to make sure we don't get stuck with an incorrect value
* like if the entities die or whatever.
* Checks nearby entities and counts how many have nominated this entity as their leader.
*
* @author Hiroku
* @since June 17th, 2025
@@ -8,16 +8,17 @@
package com.cobblemon.mod.common.api.ai.config.task
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.CobblemonMemories
import com.cobblemon.mod.common.api.ai.BehaviourConfigurationContext
import com.cobblemon.mod.common.api.ai.ExpressionOrEntityVariable
import com.cobblemon.mod.common.api.ai.asVariables
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asMostSpecificMoLangValue
import com.cobblemon.mod.common.api.npc.configuration.MoLangConfigVariable
import com.cobblemon.mod.common.api.storage.party.PartyStore
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.pokemon.ai.ToleratedHerdLeader
import com.cobblemon.mod.common.util.asExpression
import com.cobblemon.mod.common.util.withQueryValue
import com.mojang.datafixers.util.Either
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.ai.behavior.BehaviorControl
@@ -56,21 +57,21 @@ class FindHerdLeaderTaskConfig : SingleTaskConfig {
!it.brain.hasMemoryValue(CobblemonMemories.POKEMON_DROWSY)
}.forEach { possibleLeader ->
possibleLeader as PokemonEntity
val bestMatchingHerdLeader = entity.behaviour.herd.bestMatchLeader(entity, possibleLeader) ?: return@forEach
val possibleLeaderIsAlreadyALeader = possibleLeader.brain.hasMemoryValue(CobblemonMemories.HERD_SIZE)
val currentLeaderHerdTier = currentLeaderEntity?.getHerdTier() ?: entity.getHerdTier()
if (currentLeaderHerdTier >= bestMatchingHerdLeader.tier) {
val matchingHerdLeader = entity.behaviour.herd.bestMatchLeader(entity, possibleLeader) ?: return@forEach
val alreadyIsALeader = possibleLeader.brain.hasMemoryValue(CobblemonMemories.HERD_SIZE)
val nestedHerdTier = currentLeaderEntity?.getHerdTier() ?: 0
if (nestedHerdTier >= matchingHerdLeader.tier) {
return@forEach // This leader is following a leader of a higher tier, we can't replace them
}
val distance = entity.distanceTo(possibleLeader)
if (bestMatchingHerdLeader.tier < bestTier) {
if (matchingHerdLeader.tier < bestTier) {
return@forEach // No need to check further if this leader is worse than the best found so far
} else if ((distance > bestDistance && !possibleLeaderIsAlreadyALeader) && bestMatchingHerdLeader.tier == bestTier) {
} else if ((distance > bestDistance && !alreadyIsALeader) && matchingHerdLeader.tier == bestTier) {
return@forEach // No need to check further if this leader is farther than the best found so far, unless they are already a leader - I'd prefer to join a pack
} else {
bestLeader = possibleLeader
bestDistance = distance
bestTier = bestMatchingHerdLeader.tier
bestTier = matchingHerdLeader.tier
}
}
return bestLeader ?: currentLeaderEntity
@@ -118,7 +119,6 @@ class FindHerdLeaderTaskConfig : SingleTaskConfig {
herdLeader.set(bestLeader.uuid.toString())
bestLeader.brain.eraseMemory(CobblemonMemories.HERD_LEADER)
bestLeader.adjustHerdSize(1)
return@Trigger true
}
}
@@ -14,19 +14,15 @@ import com.cobblemon.mod.common.api.ai.BehaviourConfigurationContext
import com.cobblemon.mod.common.api.ai.ExpressionOrEntityVariable
import com.cobblemon.mod.common.api.ai.WrapperLivingEntityTask
import com.cobblemon.mod.common.api.ai.asVariables
import com.cobblemon.mod.common.api.molang.ExpressionLike
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.entity.pokemon.ai.tasks.FindRestingPlaceTask
import com.cobblemon.mod.common.util.asExpression
import com.cobblemon.mod.common.util.asExpressionLike
import com.cobblemon.mod.common.util.resolveBoolean
import com.mojang.datafixers.util.Either
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.ai.behavior.BehaviorControl
import net.minecraft.world.entity.ai.memory.MemoryModuleType
class FindRestingPlaceTaskConfig : SingleTaskConfig {
val condition: ExpressionLike = "true".asExpressionLike()
val horizontalSearchDistance: ExpressionOrEntityVariable = Either.left("16".asExpression())
val verticalSearchDistance: ExpressionOrEntityVariable = Either.left("5".asExpression())
@@ -35,13 +31,6 @@ class FindRestingPlaceTaskConfig : SingleTaskConfig {
entity: LivingEntity,
behaviourConfigurationContext: BehaviourConfigurationContext
): BehaviorControl<in LivingEntity>? {
if (entity !is PokemonEntity) {
return null
}
if (!behaviourConfigurationContext.runtime.resolveBoolean(condition)) {
return null
}
behaviourConfigurationContext.addMemories(
CobblemonMemories.PATH_COOLDOWN,
CobblemonMemories.POKEMON_DROWSY,
@@ -11,20 +11,15 @@ package com.cobblemon.mod.common.api.ai.config.task
import com.cobblemon.mod.common.CobblemonMemories
import com.cobblemon.mod.common.CobblemonSensors
import com.cobblemon.mod.common.api.ai.BehaviourConfigurationContext
import com.cobblemon.mod.common.api.ai.ExpressionOrEntityVariable
import com.cobblemon.mod.common.api.ai.WrapperLivingEntityTask
import com.cobblemon.mod.common.api.npc.configuration.MoLangConfigVariable
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.entity.pokemon.ai.tasks.GoToSleepTask
import com.cobblemon.mod.common.util.asExpression
import com.cobblemon.mod.common.util.resolveBoolean
import com.mojang.datafixers.util.Either
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.ai.behavior.BehaviorControl
import net.minecraft.world.entity.ai.memory.MemoryModuleType
class GoToSleepTaskConfig : SingleTaskConfig {
var onlyFromStatus: ExpressionOrEntityVariable = Either.left("false".asExpression())
override fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) = emptyList<MoLangConfigVariable>()
override fun createTask(
entity: LivingEntity,
@@ -39,6 +34,6 @@ class GoToSleepTaskConfig : SingleTaskConfig {
CobblemonMemories.POKEMON_SLEEPING
)
behaviourConfigurationContext.addSensors(CobblemonSensors.POKEMON_DROWSY)
return WrapperLivingEntityTask(GoToSleepTask.create(onlyFromStatus.resolveBoolean(behaviourConfigurationContext.runtime)), PokemonEntity::class.java)
return WrapperLivingEntityTask(GoToSleepTask.create(), PokemonEntity::class.java)
}
}
@@ -10,28 +10,17 @@ package com.cobblemon.mod.common.api.ai.config.task
import com.cobblemon.mod.common.CobblemonMemories
import com.cobblemon.mod.common.api.ai.BehaviourConfigurationContext
import com.cobblemon.mod.common.api.ai.ExpressionOrEntityVariable
import com.cobblemon.mod.common.api.npc.configuration.MoLangConfigVariable
import com.cobblemon.mod.common.entity.npc.ai.LookAtSpeakerTask
import com.cobblemon.mod.common.util.asExpression
import com.mojang.datafixers.util.Either
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.ai.behavior.BehaviorControl
import net.minecraft.world.entity.ai.memory.MemoryModuleType
class LookAtSpeakerTaskConfig : SingleTaskConfig {
val condition: ExpressionOrEntityVariable = Either.left("true".asExpression())
override fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) = emptyList<MoLangConfigVariable>()
override fun createTask(
entity: LivingEntity,
behaviourConfigurationContext: BehaviourConfigurationContext
): BehaviorControl<in LivingEntity>? {
if (!condition.resolveBoolean(behaviourConfigurationContext.runtime)) {
return null
}
return LookAtSpeakerTask.create().also {
behaviourConfigurationContext.addMemories(MemoryModuleType.LOOK_TARGET, CobblemonMemories.DIALOGUES)
}
) = LookAtSpeakerTask.create().also {
behaviourConfigurationContext.addMemories(MemoryModuleType.LOOK_TARGET, CobblemonMemories.DIALOGUES)
}
}
@@ -8,14 +8,15 @@
package com.cobblemon.mod.common.api.ai.config.task
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.CobblemonMemories
import com.cobblemon.mod.common.api.ai.BehaviourConfigurationContext
import com.cobblemon.mod.common.api.ai.ExpressionOrEntityVariable
import com.cobblemon.mod.common.api.ai.asVariables
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asMostSpecificMoLangValue
import com.cobblemon.mod.common.api.npc.configuration.MoLangConfigVariable
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.util.asExpression
import com.cobblemon.mod.common.util.withQueryValue
import com.mojang.datafixers.util.Either
import java.util.UUID
import net.minecraft.world.entity.LivingEntity
@@ -81,8 +82,6 @@ class MaintainHerdLeaderTaskConfig : SingleTaskConfig {
if (bestLeader != null && bestLeader != leader) {
bestLeader.brain.eraseMemory(CobblemonMemories.HERD_LEADER)
entity.brain.setMemory(CobblemonMemories.HERD_LEADER, bestLeader.uuid.toString())
bestLeader.adjustHerdSize(1)
leader.adjustHerdSize(-1)
}
}
return@Trigger true
@@ -1,87 +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.ai.config.task
import com.cobblemon.mod.common.api.ai.BehaviourConfigurationContext
import com.cobblemon.mod.common.api.ai.ExpressionOrEntityVariable
import com.cobblemon.mod.common.api.ai.asVariables
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asMostSpecificMoLangValue
import com.cobblemon.mod.common.entity.EntityCallbacks
import com.cobblemon.mod.common.entity.MoLangScriptingEntity
import com.cobblemon.mod.common.util.asExpression
import com.mojang.datafixers.util.Either
import net.minecraft.server.level.ServerLevel
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.ai.behavior.Behavior
import net.minecraft.world.entity.ai.behavior.BehaviorControl
import net.minecraft.world.entity.ai.memory.MemoryModuleType
import net.minecraft.world.entity.ai.memory.MemoryStatus
import net.minecraft.world.entity.ai.sensing.SensorType
/**
* Frequently checks a diff on the visibility of entities around the given entity so EntityCallbacks can be triggered.
*
* @author Hiroku
* @since August 7th, 2025
*/
class NotifyAboutEntityVisibilityTaskConfig : SingleTaskConfig {
val ticksBetweenChecks: ExpressionOrEntityVariable = Either.left("20".asExpression())
override fun getVariables(entity: LivingEntity, behaviourConfigurationContext: BehaviourConfigurationContext) = listOf(ticksBetweenChecks).asVariables()
override fun createTask(
entity: LivingEntity,
behaviourConfigurationContext: BehaviourConfigurationContext
): BehaviorControl<in LivingEntity>? {
if (entity !is MoLangScriptingEntity) {
return null
}
val ticksBetweenChecks = ticksBetweenChecks.resolveInt(behaviourConfigurationContext.runtime)
behaviourConfigurationContext.addMemories(MemoryModuleType.NEAREST_LIVING_ENTITIES)
behaviourConfigurationContext.addSensors(SensorType.NEAREST_LIVING_ENTITIES)
return object : Behavior<LivingEntity>(mapOf(MemoryModuleType.NEAREST_LIVING_ENTITIES to MemoryStatus.VALUE_PRESENT), Int.MAX_VALUE) {
override fun canStillUse(level: ServerLevel, entity: LivingEntity, gameTime: Long) = true
override fun checkExtraStartConditions(level: ServerLevel, owner: LivingEntity) = true
// Buffer of known entities
val knownEntities = mutableListOf<LivingEntity>()
override fun tick(level: ServerLevel, owner: LivingEntity, gameTime: Long) {
if (gameTime % ticksBetweenChecks != 0L) {
return
}
val visibleEntities = owner.getBrain().getMemory(MemoryModuleType.NEAREST_LIVING_ENTITIES)
.orElse(emptyList<LivingEntity>())
.filter { it.isAlive }
val newEntities = visibleEntities.filterNot { it in knownEntities }
val removedEntities = knownEntities.filterNot { it in visibleEntities }
newEntities.forEach {
entity.callbacks.process(
type = EntityCallbacks.SAW_ENTITY,
functions = mapOf("other_entity" to { _ -> it.asMostSpecificMoLangValue() })
)
}
removedEntities.forEach {
entity.callbacks.process(
type = EntityCallbacks.LOST_ENTITY,
functions = mapOf("other_entity" to { _ -> it.asMostSpecificMoLangValue() })
)
}
knownEntities.clear()
knownEntities.addAll(visibleEntities)
}
}
}
}
@@ -120,7 +120,6 @@ interface TaskConfig {
cobblemonResource("target_entity") to TargetEntityTaskConfig::class.java,
cobblemonResource("memory_aspect") to MemoryAspectTaskConfig::class.java,
cobblemonResource("activity_change") to ActivityChangeTaskConfig::class.java,
cobblemonResource("notify_about_entity_visibility") to NotifyAboutEntityVisibilityTaskConfig::class.java,
)
}
@@ -133,7 +133,7 @@ class WanderTaskConfig : SingleTaskConfig {
val wanderControl = it.tryGet(wanderControl).orElse(null) ?: CobblemonWanderControl()
mainThreadRuntime.withQueryValue("entity", entity.asMostSpecificMoLangValue())
val avoidsTargetingAir = avoidTargetingAir.resolveBoolean(mainThreadRuntime)
val wanderChance = wanderControl.wanderChance ?: mainThreadRuntime.resolveFloat(wanderChanceExpression)
val wanderChance = mainThreadRuntime.resolveFloat(wanderChanceExpression)
if (wanderChance <= 0 || world.random.nextFloat() > wanderChance || !wanderControl.allowLand) {
return@Trigger false
}
@@ -180,7 +180,7 @@ class WanderTaskConfig : SingleTaskConfig {
walkTarget.set(
CobblemonWalkTarget(
pos = pos,
speedModifier = speedMultiplier.resolveFloat(mainThreadRuntime) * wanderControl.speedMultiplier,
speedModifier = speedMultiplier.resolveFloat(mainThreadRuntime),
completionRange = 0,
nodeTypeFilter = { nodeType -> nodeType !in listOf(PathType.WATER, PathType.WATER_BORDER) },
destinationNodeTypeFilter = { nodeType -> !avoidsTargetingAir || nodeType !in listOf(PathType.OPEN) }
@@ -78,7 +78,7 @@ class WaterWanderTaskConfig : SingleTaskConfig {
}
mainThreadRuntime.withQueryValue("entity", entity.asMostSpecificMoLangValue())
val wanderChance = wanderControl.wanderChance ?: mainThreadRuntime.resolveFloat(wanderChanceExpression)
val wanderChance = mainThreadRuntime.resolveFloat(wanderChanceExpression)
if (wanderChance <= 0 || world.random.nextFloat() > wanderChance) {
return@Trigger false
}
@@ -104,7 +104,7 @@ class WaterWanderTaskConfig : SingleTaskConfig {
CobblemonWalkTarget(
pos = pos,
nodeTypeFilter = { it == PathType.WATER || it == PathType.WATER_BORDER },
speedModifier = speedMultiplier.resolveFloat(mainThreadRuntime) * wanderControl.speedMultiplier,
speedModifier = speedMultiplier.resolveFloat(mainThreadRuntime),
completionRange = 0
)
)
@@ -12,6 +12,7 @@ import com.bedrockk.molang.runtime.MoLangEnvironment
import com.bedrockk.molang.runtime.MoLangRuntime
import com.bedrockk.molang.runtime.MoParams
import com.bedrockk.molang.runtime.struct.ArrayStruct
import com.bedrockk.molang.runtime.struct.MoStruct
import com.bedrockk.molang.runtime.struct.QueryStruct
import com.bedrockk.molang.runtime.struct.VariableStruct
import com.bedrockk.molang.runtime.value.DoubleValue
@@ -24,8 +25,6 @@ import com.cobblemon.mod.common.CobblemonMemories
import com.cobblemon.mod.common.CobblemonUnlockableWallpapers
import com.cobblemon.mod.common.Environment
import com.cobblemon.mod.common.api.ai.CobblemonBlockPosTracker
import com.cobblemon.mod.common.api.ai.CobblemonAttackTargetData
import com.cobblemon.mod.common.api.ai.CobblemonAvoidTargetData
import com.cobblemon.mod.common.api.ai.CobblemonWanderControl
import com.cobblemon.mod.common.api.battles.interpreter.BattleMessage
import com.cobblemon.mod.common.api.battles.model.PokemonBattle
@@ -349,7 +348,10 @@ object MoLangFunctions {
val b = format.parse(dateB)
DoubleValue(a.after(b))
},
"create_simple_party_provider" to java.util.function.Function { SimplePartyProvider().struct },
"create_simple_party_provider" to java.util.function.Function { params ->
val partyProvider = SimplePartyProvider()
return@Function partyProvider.struct
},
"create_pickup_item" to java.util.function.Function { params ->
val item = params.getOrNull<MoValue>(0)?.asString()?.let(ObtainableItemCondition::parseFromString)
val pickupPriority = params.getIntOrNull(1) ?: 0
@@ -362,7 +364,6 @@ object MoLangFunctions {
{ worldHolder ->
val world = worldHolder.value()
val map = hashMapOf<String, java.util.function.Function<MoParams, Any>>()
map.put("id") { StringValue(world.dimension().location().toString()) }
map.put("is_time_of_day") { params ->
val timeOfDay = TimeRange.timeRanges[params.getString(0).lowercase()]
?: return@put DoubleValue.ZERO
@@ -806,13 +807,6 @@ object MoLangFunctions {
val source = DamageSource(entity.level().registryAccess().registryOrThrow(Registries.DAMAGE_TYPE).getHolder(DamageTypes.GENERIC).get())
entity.hurt(source, amount.toFloat())
}
map.put("damage_source") { params ->
val registry = entity.level().registryAccess().registryOrThrow(Registries.DAMAGE_TYPE)
val type = params.getStringOrNull(0)?.asIdentifierDefaultingNamespace()?.let(registry::getHolder)
?: registry.getHolder(DamageTypes.GENERIC)
val damageSource = DamageSource(type.get(), entity)
return@put damageSource.asMoLangValue()
}
map.put("distance_to_owner") {
if (entity !is TamableAnimal) {
return@put DoubleValue.ZERO
@@ -936,10 +930,6 @@ object MoLangFunctions {
map.put("is_on_fire") { _ -> DoubleValue(entity.isOnFire) }
map.put("is_invisible") { _ -> DoubleValue(entity.isInvisible) }
map.put("is_riding") { _ -> DoubleValue(entity.isPassenger) }
map.put("distance_to_entity") { params ->
val otherEntity = params.get<MoValue>(0) as? ObjectValue<Entity> ?: return@put DoubleValue.ZERO
return@put DoubleValue(entity.distanceTo(otherEntity.obj))
}
map.put("distance_to_pos") { params ->
val x = params.getDouble(0)
val y = params.getDouble(1)
@@ -1073,19 +1063,7 @@ object MoLangFunctions {
}
)
val damageSourceFunctions: MutableList<(DamageSource) -> java.util.HashMap<String, java.util.function.Function<MoParams, Any>>> = mutableListOf(
{ source ->
val map = hashMapOf<String, java.util.function.Function<MoParams, Any>>()
map.put("direct_entity") { source.directEntity?.asMostSpecificMoLangValue() ?: DoubleValue.ZERO }
map.put("entity") { source.entity?.asMostSpecificMoLangValue() ?: DoubleValue.ZERO }
map.put("is_food_exhaustion") { DoubleValue(source.foodExhaustion) }
map.put("is_direct") { DoubleValue(source.isDirect) }
map.put("type") { StringValue(source.typeHolder().unwrapKey().get().location().toString()) }
return@mutableListOf map
}
)
val livingEntityFunctions: MutableList<(LivingEntity) -> HashMap<String, java.util.function.Function<MoParams, Any>>> = mutableListOf(
val livingEntityFunctions: MutableList<(LivingEntity) -> HashMap<String, java.util.function.Function<MoParams, Any>>> = mutableListOf<(LivingEntity) -> HashMap<String, java.util.function.Function<MoParams, Any>>>(
{ entity ->
val map = hashMapOf<String, java.util.function.Function<MoParams, Any>>()
map.put("is_player") { _ -> DoubleValue(entity is Player) }
@@ -1127,23 +1105,6 @@ object MoLangFunctions {
val amount = params.getDouble(0)
entity.heal(amount.toFloat())
}
map.put("reset_activity") { _ ->
entity.brain.updateActivityFromSchedule(entity.level().dayTime, entity.level().gameTime)
DoubleValue.ONE
}
map.put("activity") { _ ->
return@put entity.brain.activeNonCoreActivity.map { StringValue(it.name) }.orElse(null) ?: DoubleValue.ZERO
}
map.put("set_activity") { params ->
val activityId = params.getString(0).asIdentifierDefaultingNamespace()
val activity = BuiltInRegistries.ACTIVITY.get(activityId)
if (activity != null) {
entity.brain.setActiveActivityIfPossible(activity)
return@put DoubleValue.ONE
} else {
return@put DoubleValue.ZERO
}
}
map.put("is_looking_at") { params ->
val targetEntity = params.get<MoValue>(0)
val maxDistance = params.getDoubleOrNull(1)?.toFloat() ?: 2.0F
@@ -1170,26 +1131,6 @@ object MoLangFunctions {
val brain = entity.brain
brain.setMemoryWithExpiry(MemoryModuleType.LOOK_TARGET, CobblemonBlockPosTracker(Vec3(x, y, z), flags.toSet()), duration.toLong())
}
map.put("is_doing_activity") { params ->
val identifiers = params.params.map { it.asString().asIdentifierDefaultingNamespace(namespace = "minecraft") }
val activities = identifiers.mapNotNull(BuiltInRegistries.ACTIVITY::get)
if (activities.isNotEmpty()) {
return@put DoubleValue(activities.any(entity.brain::isActive))
} else {
return@put DoubleValue.ZERO
}
}
map.put("get_attack_target_data_memory") {
val value = entity.brain.getMemorySafely(CobblemonMemories.ATTACK_TARGET_DATA).orElse(null)
?: CobblemonAttackTargetData()
if (
!entity.brain.checkMemory(CobblemonMemories.ATTACK_TARGET_DATA, MemoryStatus.VALUE_PRESENT)
&& entity.brain.checkMemory(CobblemonMemories.ATTACK_TARGET_DATA, MemoryStatus.REGISTERED)
) {
entity.brain.setMemory(CobblemonMemories.ATTACK_TARGET_DATA, value)
}
return@put value.struct
}
map.put("get_wander_control_memory") {
val value = entity.brain.getMemorySafely(CobblemonMemories.WANDER_CONTROL).orElse(null)
?: CobblemonWanderControl()
@@ -1201,17 +1142,6 @@ object MoLangFunctions {
}
return@put value.struct
}
map.put("get_avoid_target_data_memory") {
val value = entity.brain.getMemorySafely(CobblemonMemories.AVOID_TARGET_DATA).orElse(null)
?: CobblemonAvoidTargetData()
if (
!entity.brain.checkMemory(CobblemonMemories.AVOID_TARGET_DATA, MemoryStatus.VALUE_PRESENT)
&& entity.brain.checkMemory(CobblemonMemories.AVOID_TARGET_DATA, MemoryStatus.REGISTERED)
) {
entity.brain.setMemory(CobblemonMemories.AVOID_TARGET_DATA, value)
}
return@put value.struct
}
map.put("get_position_memory") { params ->
val id = params.getString(0).asIdentifierDefaultingNamespace()
val memoryType = BuiltInRegistries.MEMORY_MODULE_TYPE.get(id)
@@ -1238,30 +1168,6 @@ object MoLangFunctions {
return@put DoubleValue.ZERO
}
}
map.put("get_entity_memory") { params ->
val id = params.getString(0).asIdentifierDefaultingNamespace()
val memoryType = BuiltInRegistries.MEMORY_MODULE_TYPE.get(id)
if (entity.brain.checkMemory(memoryType, MemoryStatus.VALUE_PRESENT)) {
val memory = entity.brain.getMemory(memoryType).get()
return@put when (memory) {
is Entity -> memory.asMostSpecificMoLangValue()
else -> DoubleValue.ZERO
}
} else {
return@put DoubleValue.ZERO
}
}
map.put("set_entity_memory") { params ->
val memory = params.getString(0).asIdentifierDefaultingNamespace().let(BuiltInRegistries.MEMORY_MODULE_TYPE::get) as MemoryModuleType<LivingEntity>
val entityValue = (params.get<MoValue>(1) as? ObjectValue<*>)?.obj as? LivingEntity ?: return@put DoubleValue.ZERO
val expiry = params.getIntOrNull(2) ?: -1
if (expiry != -1) {
entity.brain.setMemoryWithExpiry(memory, entityValue, expiry.toLong())
} else {
entity.brain.setMemory(memory, entityValue)
}
return@put DoubleValue.ONE
}
map.put("set_uuid_memory") { params ->
val memory = params.getString(0).asIdentifierDefaultingNamespace().let(BuiltInRegistries.MEMORY_MODULE_TYPE::get) as MemoryModuleType<UUID>
val uuid = params.getString(1).asUUID ?: return@put DoubleValue.ZERO
@@ -1308,18 +1214,6 @@ object MoLangFunctions {
return@put DoubleValue.ZERO
}
}
map.put("is_visible_entity") { params ->
val otherEntity = params.get<ObjectValue<*>>(0)?.obj as? LivingEntity ?: return@put DoubleValue.ZERO
val visibleMobs = entity.brain.getMemorySafely(MemoryModuleType.NEAREST_VISIBLE_LIVING_ENTITIES).orElse(null)
?: return@put DoubleValue.ZERO
return@put DoubleValue(visibleMobs.contains(otherEntity))
}
map.put("is_nearby_entity") { params ->
val otherEntity = params.get<ObjectValue<*>>(0)?.obj as? LivingEntity ?: return@put DoubleValue.ZERO
val nearbyMobs = entity.brain.getMemorySafely(MemoryModuleType.NEAREST_LIVING_ENTITIES).orElse(null)
?: return@put DoubleValue.ZERO
return@put DoubleValue(nearbyMobs.contains(otherEntity))
}
if (entity is PathfinderMob) {
map.put("walk_to") { params ->
val x = params.getDouble(0)
@@ -1342,7 +1236,7 @@ object MoLangFunctions {
}
}
map.put("has_walk_target") { _ ->
DoubleValue(entity.brain.getMemorySafely(MemoryModuleType.WALK_TARGET).isPresent || entity.isPathFinding)
DoubleValue(entity.brain.getMemory(MemoryModuleType.WALK_TARGET).isPresent || entity.isPathFinding)
}
}
map
@@ -1358,6 +1252,15 @@ object MoLangFunctions {
map.put("in_battle") { DoubleValue(npc.isInBattle()) }
map.put("battles") { ArrayStruct(npc.battleIds.mapNotNull { BattleRegistry.getBattle(it)?.struct }.mapIndexed { index, value -> "$index" to value }.toMap()) }
map.put("stop_battles") { _ -> npc.battleIds.forEach { BattleRegistry.getBattle(it)?.stop() } }
map.put("is_doing_activity") { params ->
val identifiers = params.params.map { it.asString().asIdentifierDefaultingNamespace(namespace = "minecraft") }
val activities = identifiers.mapNotNull { identifier -> BuiltInRegistries.ACTIVITY.get(identifier) }
if (activities.isNotEmpty()) {
return@put DoubleValue(activities.any { activity -> npc.brain.isActive(activity) })
} else {
return@put DoubleValue.ZERO
}
}
map.put("run_script_on_client") { params ->
val world = npc.level()
if (world is ServerLevel) {
@@ -2568,15 +2471,6 @@ object MoLangFunctions {
return value
}
fun DamageSource.asMoLangValue(): ObjectValue<DamageSource> {
val value = ObjectValue(
obj = this,
stringify = { it.toString() }
)
value.addFunctions(damageSourceFunctions.flatMap { it(this).entries.map { it.key to it.value } }.toMap())
return value
}
/**
* Different functions exist depending on the entity type, this tries to make the struct that's most specific to the type.
*/
@@ -57,6 +57,7 @@ class NPCClass {
var isMovable: Boolean = true
var isInvulnerable = false
var isLeashable = true
var visibilityCondition = true
var allowProjectileHits = true
var hideNameTag = false
@@ -98,6 +99,7 @@ class NPCClass {
buffer.writeBoolean(isMovable)
buffer.writeBoolean(isInvulnerable)
buffer.writeBoolean(isLeashable)
buffer.writeBoolean(visibilityCondition)
buffer.writeBoolean(allowProjectileHits)
buffer.writeBoolean(hideNameTag)
}
@@ -150,6 +152,7 @@ class NPCClass {
isMovable = buffer.readBoolean()
isInvulnerable = buffer.readBoolean()
isLeashable = buffer.readBoolean()
visibilityCondition = buffer.readBoolean()
allowProjectileHits = buffer.readBoolean()
hideNameTag = buffer.readBoolean()
}
@@ -37,6 +37,7 @@ class NPCPreset {
var isMovable: Boolean? = null
var isInvulnerable: Boolean? = null
var isLeashable: Boolean? = null
var visibilityCondition: Boolean? = null
var allowProjectileHits: Boolean? = null
var hideNameTag: Boolean? = null
@@ -63,6 +64,7 @@ class NPCPreset {
isMovable?.let { npcClass.isMovable = it }
isInvulnerable?.let { npcClass.isInvulnerable = it }
isLeashable?.let { npcClass.isLeashable = it }
visibilityCondition?.let { npcClass.visibilityCondition = it }
allowProjectileHits?.let { npcClass.allowProjectileHits = it }
hideNameTag?.let { npcClass.hideNameTag = it }
}
@@ -43,6 +43,7 @@ import com.cobblemon.mod.common.api.riding.stats.RidingStatDefinition
import com.cobblemon.mod.common.api.spawning.TimeRange
import com.cobblemon.mod.common.api.types.ElementalType
import com.cobblemon.mod.common.api.types.adapters.ElementalTypeAdapter
import com.cobblemon.mod.common.battles.runner.ShowdownService
import com.cobblemon.mod.common.net.messages.client.data.SpeciesRegistrySyncPacket
import com.cobblemon.mod.common.pokemon.FormData
import com.cobblemon.mod.common.pokemon.Species
@@ -56,6 +57,7 @@ import com.cobblemon.mod.common.pokemon.evolution.adapters.LegacyItemConditionWr
import com.cobblemon.mod.common.pokemon.helditem.CobblemonHeldItemManager
import com.cobblemon.mod.common.util.adapters.*
import com.cobblemon.mod.common.util.cobblemonResource
import com.cobblemon.mod.common.util.ifClient
import com.google.common.collect.HashBasedTable
import com.google.gson.Gson
import com.google.gson.GsonBuilder
@@ -63,11 +65,13 @@ import com.google.gson.reflect.TypeToken
import com.mojang.datafixers.util.Either
import net.minecraft.advancements.critereon.ItemPredicate
import net.minecraft.core.registries.BuiltInRegistries
import net.minecraft.core.registries.Registries
import net.minecraft.nbt.CompoundTag
import net.minecraft.network.chat.Component
import net.minecraft.resources.ResourceLocation
import net.minecraft.server.level.ServerPlayer
import net.minecraft.server.packs.PackType
import net.minecraft.tags.TagKey
import net.minecraft.world.effect.MobEffect
import net.minecraft.world.entity.EntityDimensions
import net.minecraft.world.entity.ai.memory.MemoryModuleType
@@ -147,12 +151,17 @@ object PokemonSpecies : JsonDataRegistry<Species> {
val species: Collection<Species>
get() = this.speciesByIdentifier.values
val implemented: List<Species>
get() = this.species.filter { it.implemented }
val implemented = mutableListOf<Species>()
init {
SpeciesAdditions.observable.subscribe {
implemented.clear()
this.species.forEach(Species::initialize)
this.species.forEach {
if (it.implemented) {
this.implemented.add(it)
}
}
this.species.forEach(Species::resolveEvolutionMoves)
Cobblemon.showdownThread.queue {
it.resetRegistryData("species")
@@ -224,6 +233,7 @@ object PokemonSpecies : JsonDataRegistry<Species> {
override fun reload(data: Map<ResourceLocation, Species>) {
this.speciesByIdentifier.clear()
this.implemented.clear()
this.speciesByDex.clear()
data.forEach { (identifier, species) ->
species.resourceIdentifier = identifier
@@ -231,6 +241,11 @@ object PokemonSpecies : JsonDataRegistry<Species> {
this.speciesByDex.remove(old.resourceIdentifier.namespace, old.nationalPokedexNumber)
}
this.speciesByDex.put(species.resourceIdentifier.namespace, species.nationalPokedexNumber, species)
ifClient {
if (species.implemented) {
this.implemented.add(species)
}
}
}
}
@@ -21,7 +21,6 @@ import com.cobblemon.mod.common.api.riding.sound.RideSoundSettingsList
import com.cobblemon.mod.common.api.riding.stats.RidingStat
import com.cobblemon.mod.common.entity.PoseType
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.pokemon.Pokemon
import com.cobblemon.mod.common.util.*
import com.cobblemon.mod.common.util.math.geometry.toRadians
import net.minecraft.client.Minecraft
@@ -75,21 +74,6 @@ class BirdBehaviour : RidingBehaviour<BirdSettings, BirdState> {
) {
if(vehicle.level().isClientSide) {
tickStamina(settings, state, vehicle, driver)
checkUpsideDown(state, vehicle, driver)
}
}
private fun checkUpsideDown(
state: BirdState,
vehicle: PokemonEntity,
driver: Player,
) {
val controller = (driver as OrientationControllable).orientationController
if (cos(controller.roll.toRadians()) < 0.0) {
val upsideDownRate = 1.0 / (2.0 * 20.0) // 2 seconds to max out upsideDown force
state.currUpsideDownForce.set( min(1.0, state.currUpsideDownForce.get() + upsideDownRate * abs(cos(controller.roll.toRadians()))))
} else { // Its right side up so reset it
state.currUpsideDownForce.set(0.0)
}
}
@@ -108,8 +92,7 @@ class BirdBehaviour : RidingBehaviour<BirdSettings, BirdState> {
val stamDrainRate = (1.0f / totalStam).toFloat()
val newStam = if (driver.zza > 0.0) max(0.0f,stam - stamDrainRate)
else if (!state.gliding.get()) max(0.0f,stam - stamDrainRate * 0.5f) // if hovering half the stam drain
else min(1.0f,stam + stamDrainRate * 0.2f)
else min(1.0f,stam + stamDrainRate)
state.stamina.set(newStam)
}
@@ -130,6 +113,8 @@ class BirdBehaviour : RidingBehaviour<BirdSettings, BirdState> {
driver: Player,
input: Vec3
): Vec3 {
var yVel = 0.0
var leftForce = 0.0
var upForce = 0.0
var forwardForce = 0.0
@@ -148,11 +133,7 @@ class BirdBehaviour : RidingBehaviour<BirdSettings, BirdState> {
forwardForce += sin(Math.toRadians(controller.pitch.toDouble())) * state.rideVelocity.get().y
}
// The downward force used to encourage players to stop flying upside down.
val extraDownwardForce = if(state.stamina.get() == 0.0f) -0.3
else state.currUpsideDownForce.get().pow(2) * -0.3 // 6 blocks a second downward
val velocity = Vec3(state.rideVelocity.get().x , upForce + extraDownwardForce, forwardForce)
val velocity = Vec3(state.rideVelocity.get().x , upForce, forwardForce)
return velocity
}
@@ -247,7 +228,7 @@ class BirdBehaviour : RidingBehaviour<BirdSettings, BirdState> {
//Check if the ride should be gliding
if (driver.isLocalPlayer) {
if ((activeInput && state.stamina.get() > 0.0) || state.rideVelocity.get().z < 0.2) {
if (activeInput && state.stamina.get() > 0.0) {
state.gliding.set(false)
} else {
state.gliding.set(true)
@@ -473,12 +454,11 @@ class BirdBehaviour : RidingBehaviour<BirdSettings, BirdState> {
val xInput = mouseXSmoother.getNewDeltaValue(mouseXc * 0.1, deltaTime * smoothingSpeed);
val yInput = mouseYSmoother.getNewDeltaValue(mouseYc * 0.1, deltaTime * smoothingSpeed);
val currSpeed = state.rideVelocity.get().length()
val currHorzSpeed = state.rideVelocity.get().horizontalDistance()
val hoverSpeed = 0.1
// Yaw locally when at or below hoverSpeed
val yawDampen = abs(cos(controller.pitch.toRadians())).pow(2) * abs(cos(controller.roll.toRadians())).pow(2)
val localYaw = if (currHorzSpeed < hoverSpeed) xInput * (1 - sqrt(RidingBehaviour.scaleToRange(currHorzSpeed, hoverSpeed, topSpeed))).coerceIn(0.0, 1.0)
val localYaw = if (currSpeed < hoverSpeed) xInput * (1 - sqrt(RidingBehaviour.scaleToRange(currSpeed, hoverSpeed, topSpeed))).coerceIn(0.0, 1.0)
else xInput * 0.4 * cos(controller.roll.toRadians()).coerceIn(0.0f, 1.0f) * yawDampen
// Pitch locally up or down depending upon a number of factors:
@@ -487,14 +467,14 @@ class BirdBehaviour : RidingBehaviour<BirdSettings, BirdState> {
// - pitch faster at higher speeds
val p = 1.0 - vehicle.runtime.resolveDouble(settings.horizontalPitchExpr)
var localPitch = yInput * (1 - abs(sin(controller.roll.toRadians())).pow(2) * p * hypot(controller.forwardVector.x.toDouble(), controller.forwardVector.z.toDouble()).toFloat())
localPitch *= if (currHorzSpeed > hoverSpeed) RidingBehaviour.scaleToRange(currHorzSpeed, hoverSpeed, topSpeed)
localPitch *= if (currSpeed > hoverSpeed) RidingBehaviour.scaleToRange(currSpeed, hoverSpeed, topSpeed)
else 0.0
// Roll less when slow and not at all when at hoverSpeed or lower.
// Apply a roll righting force when trying to pitch hard while rolled sideways. This nudges the player towards
// pitching globally
val pitchInfluencedRollCorrection = 0.0
val rollForce = if (currHorzSpeed > hoverSpeed) xInput * sqrt(abs(RidingBehaviour.scaleToRange(currHorzSpeed, hoverSpeed, topSpeed)).coerceIn(0.0,1.0)) + pitchInfluencedRollCorrection
val pitchInfluencedRollCorrection = 0.0 // if ( currSpeed > hoverSpeed * 2) 0.4*(abs(yInput - localPitch) * controller.roll.sign * -1.0) else 0.0
val rollForce = if (currSpeed > hoverSpeed) xInput * sqrt(abs(RidingBehaviour.scaleToRange(currSpeed, hoverSpeed, topSpeed)).coerceIn(0.0,1.0)) + pitchInfluencedRollCorrection
else 0.0
//yaw, pitch, roll
@@ -608,17 +588,6 @@ class BirdBehaviour : RidingBehaviour<BirdSettings, BirdState> {
return false
}
override fun damageOnCollision(
settings: BirdSettings,
state: BirdState,
vehicle: PokemonEntity,
impactVec: Vec3
): Boolean {
if (!state.gliding.get()) return false
val impactSpeed = impactVec.horizontalDistance().toFloat() * 10f
return vehicle.causeFallDamage(impactSpeed, 1f, vehicle.damageSources().flyIntoWall())
}
override fun getRideSounds(
settings: BirdSettings,
state: BirdState,
@@ -643,15 +612,15 @@ class BirdSettings : RidingBehaviourSettings {
var timeToRollCorrect: Expression = "0.5".asExpression()
private set
var handlingExpr: Expression = "q.get_ride_stats('SKILL', 'AIR', 45.0, 10.0)".asExpression()
var handlingExpr: Expression = "q.get_ride_stats('SKILL', 'AIR', 90.0, 45.0)".asExpression()
var horizontalPitchExpr: Expression = "q.get_ride_stats('SKILL', 'AIR', 0.2, 0.1)".asExpression()
var mouseInputMult: Expression = "q.get_ride_stats('SKILL', 'AIR', 1.2, 0.8)".asExpression()
var speedExpr: Expression = "q.get_ride_stats('SPEED', 'AIR', 20.0, 4.0)".asExpression()
var speedExpr: Expression = "q.get_ride_stats('SPEED', 'AIR', 14.0, 8.0)".asExpression()
// Seconds from stationary to top speed
var accelerationExpr: Expression = "q.get_ride_stats('ACCELERATION', 'AIR', 2.0, 8.0)".asExpression()
var staminaExpr: Expression = "q.get_ride_stats('STAMINA', 'AIR', 15.0, 2.0)".asExpression()
var accelerationExpr: Expression = "q.get_ride_stats('ACCELERATION', 'AIR', 2.0, 5.0)".asExpression()
var staminaExpr: Expression = "q.get_ride_stats('STAMINA', 'AIR', 22.0, 12.0)".asExpression()
var glidespeedExpr: Expression = "q.get_ride_stats('JUMP', 'AIR', 2.0, 1.0)".asExpression()
var glidespeedExpr: Expression = "q.get_ride_stats('JUMP', 'AIR', 2.2, 1.5)".asExpression()
private set
var rideSounds: RideSoundSettingsList = RideSoundSettingsList()
@@ -694,10 +663,10 @@ class BirdState : RidingBehaviourState() {
var currRollCorrectionForce = ridingState(0.0, Side.CLIENT)
var currPitchCorrectionForce = ridingState(0.0, Side.CLIENT)
var noInputTime = ridingState(0.0, Side.CLIENT)
var currUpsideDownForce = ridingState(0.0, Side.CLIENT)
override fun encode(buffer: FriendlyByteBuf) {
super.encode(buffer)
buffer.writeFloat(stamina.get())
buffer.writeBoolean(gliding.get())
}
@@ -97,31 +97,7 @@ class HoverBehaviour : RidingBehaviour<HoverSettings, HoverState> {
driver: Player,
input: Vec3
) {
if(vehicle.level().isClientSide) {
tickStamina(settings, state, vehicle)
checkTooHigh(settings, state, vehicle)
}
}
fun checkTooHigh(
settings: HoverSettings,
state: HoverState,
vehicle: PokemonEntity,
) {
val heightLimit = vehicle.runtime.resolveDouble(settings.jumpExpr)
val pos = vehicle.position()
val level = Minecraft.getInstance().player?.level() ?: return
val hit = level.clip(
ClipContext(
pos,
pos.subtract(0.0, heightLimit, 0.0),
ClipContext.Block.COLLIDER,
ClipContext.Fluid.NONE,
vehicle
)
)
state.tooHigh.set(hit.type == HitResult.Type.MISS)
tickStamina(settings, state, vehicle)
}
fun tickStamina(
@@ -132,7 +108,7 @@ class HoverBehaviour : RidingBehaviour<HoverSettings, HoverState> {
val stam = state.stamina.get()
val stamDrainRate = (1.0f / vehicle.runtime.resolveDouble(settings.staminaExpr)).toFloat() / 20.0f
val newStam = if (state.tooHigh.get()) max(0.0f, stam - stamDrainRate) else min(1.0f,stam + stamDrainRate)
val newStam = min(1.0f,stam + stamDrainRate)
state.stamina.set(newStam)
}
@@ -230,7 +206,6 @@ class HoverBehaviour : RidingBehaviour<HoverSettings, HoverState> {
// Vertical movement based on driver input.
val vertInput = when {
state.stamina.get() == 0.0f -> -1.0
driver.jumping -> 1.0
driver.isShiftKeyDown -> -1.0
else -> 0.0
@@ -244,6 +219,28 @@ class HoverBehaviour : RidingBehaviour<HoverSettings, HoverState> {
driver.zza.sign.toDouble()
).normalize()
/******************************************************
* Boosting Logic
*****************************************************/
if (driver.level().isClientSide) {
if(Minecraft.getInstance().options.keySprint.isDown() && state.stamina.get() == 1.0f && !state.isBoosting.get()) {
state.isBoosting.set(true)
val localBoostVel = if (inputVel.horizontalDistance() == 0.0) Vec3(0.0, 0.0, 1.0) else Vec3(inputVel.x, 0.0, inputVel.z)
state.boostVec.set(localBoostVel)
state.boostTicks.set(0)
state.stamina.set(0.0f)
}
}
val maxBoostTicks = 20
val boostPower = (topSpeed * 20) * 0.1 * vehicle.runtime.resolveDouble(settings.jumpExpr)
if (state.isBoosting.get() && state.boostTicks.get() < maxBoostTicks) {
newVelocity = newVelocity.add(state.boostVec.get().scale(boostPower / maxBoostTicks))
state.boostTicks.set(state.boostTicks.get() + 1)
} else if (state.isBoosting.get()) {
state.isBoosting.set(false)
}
// Air Friction/Resistance
// When the dot between friction and input is -1 we want to apply none of it.
// In short we want to avoid applying friction that opposes our input force.
@@ -434,24 +431,24 @@ class HoverSettings : RidingBehaviourSettings {
private set
// Speed in block per second
var speedExpr: Expression = "q.get_ride_stats('SPEED', 'AIR', 7.0, 1.0)".asExpression()
var speedExpr: Expression = "q.get_ride_stats('SPEED', 'AIR', 13.0, 6.0)".asExpression()
private set
// Acceleration in number of seconds to top speed
var accelerationExpr: Expression =
"q.get_ride_stats('ACCELERATION', 'AIR', 2.0, 8.0)".asExpression()
"q.get_ride_stats('ACCELERATION', 'AIR', 2.0, 5.0)".asExpression()
private set
// Amount of seconds between boosts
var staminaExpr: Expression = "q.get_ride_stats('STAMINA', 'AIR', 30.0, 2.0)".asExpression()
var staminaExpr: Expression = "q.get_ride_stats('STAMINA', 'AIR', 1, 4)".asExpression()
private set
// Blocks before stamina drain
var jumpExpr: Expression = "q.get_ride_stats('JUMP', 'AIR', 16.0, 2.0)".asExpression()
// Power of boost as a fraction of top speed
var jumpExpr: Expression = "q.get_ride_stats('JUMP', 'AIR', 1.2, 0.2)".asExpression()
private set
// Turn rate in degrees per second when stationary
var handlingExpr: Expression = "q.get_ride_stats('SKILL', 'AIR', 270.0, 45.0)".asExpression()
var handlingExpr: Expression = "q.get_ride_stats('SKILL', 'AIR', 360.0, 90)".asExpression()
private set
var rideSounds: RideSoundSettingsList = RideSoundSettingsList()
@@ -484,20 +481,17 @@ class HoverState : RidingBehaviourState() {
var isBoosting = ridingState(false, Side.BOTH)
var boostVec = ridingState(Vec3.ZERO, Side.CLIENT)
var boostTicks = ridingState(0, Side.CLIENT)
var tooHigh = ridingState(false, Side.CLIENT)
override fun encode(buffer: FriendlyByteBuf) {
super.encode(buffer)
buffer.writeDouble(speed.get())
buffer.writeBoolean(isBoosting.get())
buffer.writeBoolean(tooHigh.get())
}
override fun decode(buffer: FriendlyByteBuf) {
super.decode(buffer)
speed.set(buffer.readDouble(), forced = true)
isBoosting.set(buffer.readBoolean(), forced = true)
tooHigh.set(buffer.readBoolean(), forced = true)
}
override fun reset() {
@@ -506,7 +500,6 @@ class HoverState : RidingBehaviourState() {
isBoosting.set(false, forced = true)
boostVec.set(Vec3.ZERO, forced = true)
boostTicks.set(0, forced = true)
tooHigh.set(false, forced = true)
}
override fun copy() = HoverState().also {
@@ -515,7 +508,6 @@ class HoverState : RidingBehaviourState() {
it.isBoosting.set(this.isBoosting.get(), forced = true)
it.boostVec.set(this.boostVec.get(), forced = true)
it.boostTicks.set(this.boostTicks.get(), forced = true)
it.tooHigh.set(this.tooHigh.get(), forced = true)
}
override fun shouldSync(previous: RidingBehaviourState): Boolean {
@@ -114,10 +114,10 @@ class JetBehaviour : RidingBehaviour<JetSettings, JetState> {
val stamDrainRate = (1.0f / vehicle.runtime.resolveDouble(settings.staminaExpr)).toFloat() / 20.0f
if (state.boosting.get()) {
newStam = max(0.0f,stam - stamDrainRate * 1.5f)
newStam = max(0.0f,stam - stamDrainRate)
} else {
newStam = max(0.0f,stam - stamDrainRate)
newStam = min(1.0f,stam + stamDrainRate * 0.25f)
}
state.stamina.set(newStam)
@@ -149,15 +149,11 @@ class JetBehaviour : RidingBehaviour<JetSettings, JetState> {
//Translate ride space velocity to world space velocity.
if (controller != null) {
upForce = if(state.stamina.get() != 0.0f) -1.0 * sin(Math.toRadians(controller.pitch.toDouble())) * state.rideVelocity.get().z
else min(0.0, -1.0 * sin(Math.toRadians(controller.pitch.toDouble())) * state.rideVelocity.get().z)
upForce = -1.0 * sin(Math.toRadians(controller.pitch.toDouble())) * state.rideVelocity.get().z
forwardForce = cos(Math.toRadians(controller.pitch.toDouble())) * state.rideVelocity.get().z
}
// The downward force used to encourage players to stop flying upside down.
val extraDownwardForce = if(state.stamina.get() == 0.0f) -0.3 else 0.0 // 6 blocks a second downward
val velocity = Vec3(0.0, upForce + extraDownwardForce, forwardForce)
val velocity = Vec3(0.0, upForce, forwardForce)
return velocity
}
@@ -181,17 +177,7 @@ class JetBehaviour : RidingBehaviour<JetSettings, JetState> {
val boostAccel = accel * boostMult
//speed up and slow down based on input
if (state.stamina.get() == 0.0f) {
// Decelerate currently always a constant half of max acceleration.
state.rideVelocity.set(
Vec3(
state.rideVelocity.get().x,
state.rideVelocity.get().y,
max(state.rideVelocity.get().z - ((accel) / 2), minSpeed * 0.5)
)
)
}
else if (state.boosting.get() && speed < boostTopSpeed) {
if (state.boosting.get() && speed < boostTopSpeed) {
state.rideVelocity.set(
Vec3(
state.rideVelocity.get().x,
@@ -319,8 +305,7 @@ class JetBehaviour : RidingBehaviour<JetSettings, JetState> {
state.currMouseYForce.set((state.currMouseYForce.get() + (0.0015 * mouseY)).coerceIn(-1.0, 1.0))
//Get handling in degrees per second
val handlingDebuff = if(state.stamina.get() == 0.0f) 0.5 else 1.0
var handling = vehicle.runtime.resolveDouble(settings.handlingExpr) * handlingDebuff
var handling = vehicle.runtime.resolveDouble(settings.handlingExpr)
//convert it to delta time
handling *= (cappedDeltaTime)
@@ -373,8 +358,7 @@ class JetBehaviour : RidingBehaviour<JetSettings, JetState> {
state.currMouseYForce.set((state.currMouseYForce.get() + (0.0015 * mouseY)).coerceIn(-1.0, 1.0))
//Get handling in degrees per second
val handlingDebuff = if(state.stamina.get() == 0.0f) 0.5 else 1.0
var handling = vehicle.runtime.resolveDouble(settings.handlingExpr) * handlingDebuff
var handling = vehicle.runtime.resolveDouble(settings.handlingExpr)
//convert it to delta time
handling *= (cappedDeltaTime)
@@ -537,21 +521,21 @@ class JetSettings : RidingBehaviourSettings {
private set
// Boost power. Mult for top speed and accel while boosting
var jumpExpr: Expression = "q.get_ride_stats('JUMP', 'AIR', 2.0, 1.0)".asExpression()
var jumpExpr: Expression = "q.get_ride_stats('JUMP', 'AIR', 1.7, 1.2)".asExpression()
private set
// Turn rate in degrees per second
var handlingExpr: Expression = "q.get_ride_stats('SKILL', 'AIR', 60.0, 20.0)".asExpression()
var handlingExpr: Expression = "q.get_ride_stats('SKILL', 'AIR', 120.0, 60.0)".asExpression()
private set
// Top Speed in blocks per second
var speedExpr: Expression = "q.get_ride_stats('SPEED', 'AIR', 24.0, 4.0)".asExpression()
var speedExpr: Expression = "q.get_ride_stats('SPEED', 'AIR', 36.0, 20.0)".asExpression()
private set
// Acceleration in blocks per s^2
var accelerationExpr: Expression =
"q.get_ride_stats('ACCELERATION', 'AIR', 4.0, 1.0)".asExpression()
"q.get_ride_stats('ACCELERATION', 'AIR', 5.0, 2.5)".asExpression()
private set
// Time in seconds to drain full bar of stamina flying
var staminaExpr: Expression = "q.get_ride_stats('STAMINA', 'AIR', 60.0, 4.0)".asExpression()
// Time in seconds to drain full bar of stamina when boosting
var staminaExpr: Expression = "q.get_ride_stats('STAMINA', 'AIR', 8.0, 4.0)".asExpression()
private set
var rideSounds: RideSoundSettingsList = RideSoundSettingsList()
@@ -86,7 +86,7 @@ class RocketBehaviour : RidingBehaviour<RocketSettings, RocketState> {
// Use this as a "tick" function and check to see if the driver is "boosting"
if(vehicle.level().isClientSide) {
handleBoosting(settings, state, vehicle, driver)
tickStamina(settings, state, vehicle, driver)
tickStamina(settings, state, vehicle)
}
return state.rideVelocity.get().length().toFloat()
@@ -101,6 +101,7 @@ class RocketBehaviour : RidingBehaviour<RocketSettings, RocketState> {
//If the forward key is not held then it cannot be boosting
if(Minecraft.getInstance().options.keyUp.isDown() && state.stamina.get() != 0.0f) {
val boostKeyPressed = Minecraft.getInstance().options.keySprint.isDown()
if (state.stamina.get() >= 0.25f) {
//If on the previous tick the boost key was held then don't change if the ride is boosting
if(state.boostIsToggleable.get() && boostKeyPressed) {
//flip the boosting state if boost key is pressed
@@ -108,6 +109,7 @@ class RocketBehaviour : RidingBehaviour<RocketSettings, RocketState> {
}
//If the boost key is not held then next tick boosting is toggleable
state.boostIsToggleable.set(!boostKeyPressed)
}
} else {
//Turn off boost and reset boost params
state.boostIsToggleable.set(true)
@@ -119,8 +121,7 @@ class RocketBehaviour : RidingBehaviour<RocketSettings, RocketState> {
fun tickStamina(
settings: RocketSettings,
state: RocketState,
vehicle: PokemonEntity,
driver: Player
vehicle: PokemonEntity
) {
val stam = state.stamina.get()
@@ -130,7 +131,8 @@ class RocketBehaviour : RidingBehaviour<RocketSettings, RocketState> {
val boostTime = vehicle.runtime.resolveDouble(settings.staminaExpr) * 20.0f
val stamDrainRate = (1.0f / boostTime).toFloat()
val newStam = if(state.boosting.get() || driver.jumping) max(0.0f,stam - stamDrainRate) else stam
val newStam = if (state.boosting.get()) max(0.0f,stam - stamDrainRate)
else min(1.0f,stam + stamDrainRate)
state.stamina.set(newStam)
}
@@ -264,7 +266,7 @@ class RocketBehaviour : RidingBehaviour<RocketSettings, RocketState> {
if(state.canSpeedBurst.get()) {
burst = 0.5f
state.stamina.set(max(0.0f,state.stamina.get() - 0.05f))
state.stamina.set(max(0.0f,state.stamina.get() - 0.1f))
state.canSpeedBurst.set(false)
}
@@ -299,7 +301,7 @@ class RocketBehaviour : RidingBehaviour<RocketSettings, RocketState> {
} else {
if (driver.jumping && !(vehicle.deltaMovement.y > maxVertSpeed && (newVelocity.y.sign.toFloat() > 0.0))) {
// More force if traveling downwards to allow for quicker fall stops
vertInput = (if (state.stamina.get() == 0.0f) -1.0f else if(newVelocity.y < 0) jump.toFloat() * 3.0f else jump.toFloat()).toDouble()
vertInput = if (newVelocity.y < 0) jump * 3 else jump
// Reset falldistance if upward motion is detected
vehicle.resetFallDistance()
newVelocity = Vec3(
@@ -472,18 +474,6 @@ class RocketBehaviour : RidingBehaviour<RocketSettings, RocketState> {
return false
}
override fun damageOnCollision(
settings: RocketSettings,
state: RocketState,
vehicle: PokemonEntity,
impactVec: Vec3
): Boolean {
if (!state.boosting.get()) return false
val impactSpeed = impactVec.horizontalDistance().toFloat() * 10f
return vehicle.causeFallDamage(impactSpeed, 1f, vehicle.damageSources().flyIntoWall())
}
override fun getRideSounds(
settings: RocketSettings,
state: RocketState,
@@ -519,8 +509,8 @@ class RocketSettings : RidingBehaviourSettings {
"q.get_ride_stats('ACCELERATION', 'AIR', (1.0 / (20.0 * 1.5)), (1.0 / (20.0 * 3.0))) * 0.5".asExpression()
private set
// air time in seconds
var staminaExpr: Expression = "q.get_ride_stats('STAMINA', 'AIR', 20.0, 10.0)".asExpression()
// Boost time in seconds
var staminaExpr: Expression = "q.get_ride_stats('STAMINA', 'AIR', 7.5, 2.5)".asExpression()
private set
var jumpExpr: Expression = "q.get_ride_stats('JUMP', 'AIR', 2.0, 1.0)".asExpression()
@@ -520,7 +520,7 @@ class HorseSettings : RidingBehaviourSettings {
private set
//Between a one block jump and a six block jump
var jumpExpr: Expression = "q.get_ride_stats('JUMP', 'LAND', 1.0, 0.38)".asExpression()
var jumpExpr: Expression = "q.get_ride_stats('JUMP', 'LAND', 1.2, 0.45)".asExpression()
private set
var handlingExpr: Expression = "q.get_ride_stats('SKILL', 'LAND', 180.0, 40.0)".asExpression()
@@ -100,7 +100,7 @@ class HeartyGrainsBlock(settings: Properties) : CropBlock(settings), SimpleWater
override fun randomTick(state: BlockState, world: ServerLevel, pos: BlockPos, random: RandomSource) {
if (state.getValue(HALF) == DoubleBlockHalf.UPPER || !canGrow(world, pos, state)) return
if (hasSufficientLight(world, pos) && random.nextInt(16) == 0) {
if (hasSufficientLight(world, pos) && random.nextInt(7) == 0) {
grow(world, pos, state, 1)
}
}
@@ -1,19 +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.block.campfirepot
enum class CampfirePotColor(val suffix: String) {
RED("red"),
BLUE("blue"),
GREEN("green"),
PINK("pink"),
WHITE("white"),
YELLOW("yellow"),
BLACK("black");
}
@@ -56,7 +56,7 @@ class CookingPotMenu : RecipeBookMenu<CraftingInput, CookingPotRecipeBase>, Cont
CampfireBlockEntity.Companion.CRAFTING_GRID_WIDTH
)
this.resultContainer = ResultContainer()
this.containerData = SimpleContainerData(4)
this.containerData = SimpleContainerData(3)
this.addDataSlots(containerData)
this.player = playerInventory.player
this.level = playerInventory.player.level()
@@ -280,4 +280,4 @@ class CookingPotMenu : RecipeBookMenu<CraftingInput, CookingPotRecipeBase>, Cont
value: Int
) {
}
}
}
@@ -57,8 +57,8 @@ import net.minecraft.world.level.block.state.BlockState
import net.minecraft.world.level.gameevent.GameEvent
import net.minecraft.world.phys.Vec3
import org.joml.Vector4f
import com.cobblemon.mod.common.item.CampfirePotItem
import java.util.*
import kotlin.math.sign
class CampfireBlockEntity(pos: BlockPos, state: BlockState) : BaseContainerBlockEntity(
CobblemonBlockEntities.CAMPFIRE,
@@ -84,7 +84,6 @@ class CampfireBlockEntity(pos: BlockPos, state: BlockState) : BaseContainerBlock
const val COOKING_PROGRESS_INDEX = 0
const val COOKING_PROGRESS_TOTAL_TIME_INDEX = 1
const val IS_LID_OPEN_INDEX = 2
const val COOKING_POT_COLOR_INDEX = 3
const val BASE_BROTH_COLOR = 0xFDFACF
const val BASE_BROTH_BUBBLE_COLOR = 0xFFFEFDE4.toInt()
@@ -243,7 +242,6 @@ class CampfireBlockEntity(pos: BlockPos, state: BlockState) : BaseContainerBlock
COOKING_PROGRESS_INDEX -> this@CampfireBlockEntity.cookingProgress
COOKING_PROGRESS_TOTAL_TIME_INDEX -> this@CampfireBlockEntity.cookingTotalTime
IS_LID_OPEN_INDEX -> if (this@CampfireBlockEntity.blockState.getValue(CampfireBlock.LID)) 0 else 1
COOKING_POT_COLOR_INDEX -> (this@CampfireBlockEntity.getPotItem()?.item as? CampfirePotItem)?.color?.ordinal ?: 0
else -> 0
}
}
@@ -253,12 +251,11 @@ class CampfireBlockEntity(pos: BlockPos, state: BlockState) : BaseContainerBlock
COOKING_PROGRESS_INDEX -> this@CampfireBlockEntity.cookingProgress = value
COOKING_PROGRESS_TOTAL_TIME_INDEX -> this@CampfireBlockEntity.cookingTotalTime = value
IS_LID_OPEN_INDEX -> this@CampfireBlockEntity.toggleLid(value == 1)
COOKING_POT_COLOR_INDEX -> {}
}
}
override fun getCount(): Int {
return 4
return 3
}
}
@@ -484,4 +481,4 @@ class CampfireBlockEntity(pos: BlockPos, state: BlockState) : BaseContainerBlock
}
}
}
@@ -10,7 +10,6 @@ package com.cobblemon.mod.common.client.gui.cookingpot
import com.cobblemon.mod.common.api.gui.blitk
import com.cobblemon.mod.common.util.cobblemonResource
import com.cobblemon.mod.common.block.campfirepot.CampfirePotColor
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.GuiGraphics
import net.minecraft.client.gui.components.Button
@@ -22,7 +21,6 @@ import net.minecraft.sounds.SoundEvents
class CookButton(
pX: Int, pY: Int,
var selected: Boolean = false,
var color: CampfirePotColor,
onPress: OnPress
): Button(pX, pY, SIZE.toInt(), SIZE.toInt(), Component.literal("Cook"), onPress, DEFAULT_NARRATION) {
@@ -30,11 +28,11 @@ class CookButton(
private const val SIZE = 20F
private val buttonResource = cobblemonResource("textures/gui/campfirepot/button.png")
private val buttonIconResource = cobblemonResource("textures/item/campfire_pots/campfire_pot_red.png")
private val buttonIconOpenResource = cobblemonResource("textures/item/campfire_pots/campfire_pot_red_open.png")
}
override fun renderWidget(context: GuiGraphics, pMouseX: Int, pMouseY: Int, pPartialTicks: Float) {
val closedIcon = cobblemonResource("textures/item/campfire_pots/campfire_pot_${color.suffix}.png")
val openIcon = cobblemonResource("textures/item/campfire_pots/campfire_pot_${color.suffix}_open.png")
blitk(
matrixStack = context.pose(),
texture = buttonResource,
@@ -48,7 +46,7 @@ class CookButton(
blitk(
matrixStack = context.pose(),
texture = if (selected) closedIcon else openIcon,
texture = if (selected) buttonIconResource else buttonIconOpenResource,
x = x + 2,
y = y + 2,
width = 16,
@@ -11,10 +11,8 @@ package com.cobblemon.mod.common.client.gui.cookingpot
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.CobblemonNetwork.sendToServer
import com.cobblemon.mod.common.api.gui.blitk
import com.cobblemon.mod.common.block.campfirepot.CampfirePotColor
import com.cobblemon.mod.common.block.campfirepot.CookingPotMenu
import com.cobblemon.mod.common.block.campfirepot.SeasoningSlot
import com.cobblemon.mod.common.block.entity.CampfireBlockEntity.Companion.COOKING_POT_COLOR_INDEX
import com.cobblemon.mod.common.block.entity.CampfireBlockEntity.Companion.IS_LID_OPEN_INDEX
import com.cobblemon.mod.common.integration.jei.CobblemonJeiPlugin
import com.cobblemon.mod.common.integration.jei.cooking.CampfirePotRecipeCategory
@@ -120,8 +118,7 @@ class CookingPotScreen(
this.titleLabelY = 6
if (::cookButton.isInitialized) removeWidget(cookButton)
val color = CampfirePotColor.entries[menu.containerData.get(COOKING_POT_COLOR_INDEX).coerceIn(0, CampfirePotColor.entries.lastIndex)]
cookButton = CookButton(this.leftPos + 97, topPos + 56, menu.containerData.get(IS_LID_OPEN_INDEX) == 0, color) {
cookButton = CookButton(this.leftPos + 97, topPos + 56, menu.containerData.get(IS_LID_OPEN_INDEX) == 0) {
val isLidClosed = menu.containerData.get(IS_LID_OPEN_INDEX) == 0
sendToServer(ToggleCookingPotLidPacket(isLidClosed))
}
@@ -164,7 +161,6 @@ class CookingPotScreen(
mouseY: Int,
partialTicks: Float
) {
cookButton.color = CampfirePotColor.entries[menu.containerData.get(COOKING_POT_COLOR_INDEX).coerceIn(0, CampfirePotColor.entries.lastIndex)]
cookButton.selected = menu.containerData.get(IS_LID_OPEN_INDEX) == 0
cookButton.setPosition(this.leftPos + 97, topPos + 56)
@@ -1,179 +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.gui.debug.riding
import com.bedrockk.molang.Expression
import com.cobblemon.mod.common.CobblemonNetwork
import com.cobblemon.mod.common.api.riding.RidingStyle
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviourSettings
import com.cobblemon.mod.common.api.text.text
import com.cobblemon.mod.common.client.gui.CobblemonRenderable
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.net.messages.server.debug.ServerboundUpdateRidingSettingsPacket
import com.cobblemon.mod.common.net.messages.server.debug.ServerboundUpdateRidingStatsPacket
import com.cobblemon.mod.common.net.serverhandling.debug.ServerboundUpdateRidingSettingsHandler
import com.cobblemon.mod.common.util.asExpression
import com.cobblemon.mod.common.util.getString
import com.cobblemon.mod.common.util.lang
import com.cobblemon.mod.common.util.resolve
import net.minecraft.client.gui.GuiGraphics
import net.minecraft.client.gui.components.Button
import net.minecraft.client.gui.components.EditBox
import net.minecraft.client.gui.screens.Screen
import java.awt.Color
/**
* Ride Settings Editor to change the underlying expressions and
* stat mins and maxes of your ride on the fly (pun intended)
*
* Description
*
* @author Jackson
* @since September 13, 2025
*/
class RideSettingsEditorGUI(val parentScreen: Screen, val vehicle: PokemonEntity, val rideStyle: RidingStyle, val rideSettings: RidingBehaviourSettings) : Screen(lang("ui.debug.riding_settings")), CobblemonRenderable {
private val settingWidgets = mutableListOf<Pair<String, EditBox>>()
private val originalValues = mutableMapOf<String, String>() // Used to keep track of saved state of editboxes
override fun init() {
super.init()
clearWidgets()
// Take note of the current saved values in the settings
if (originalValues.isEmpty()) {
val expressionVariables = getExpressionVariables(rideSettings)
for ((name, value) in expressionVariables) {
originalValues[name] = value
}
}
addRenderableWidget(
Button.builder("Back".text()) {
this.minecraft?.setScreen(parentScreen)
}.bounds(10, 10, 40, 20).build()
)
addRenderableWidget(
Button.builder("Save".text()) { button ->
saveRideSettings()
}.bounds(300 + 110, 10, 40, 20).build()
)
createExpressionEditBoxes()
}
override fun render(guiGraphics: GuiGraphics, mouseX: Int, mouseY: Int, partialTick: Float) {
// Make the background blank and transparent?
guiGraphics.fill(0, 0, width, height, Color(0, 0, 0, 100).rgb)
super.render(guiGraphics, mouseX, mouseY, partialTick)
for ((name, editBox) in settingWidgets) {
// Position the text next to the EditBox
guiGraphics.drawString(font, name, editBox.x - 105, editBox.y + 5, 0xFFFFFF)
}
}
private fun createExpressionEditBoxes() {
val expressionVariables = getExpressionVariables(rideSettings)
var currentY = 40
for (variable in expressionVariables) {
val (name, value) = variable
val editBox = EditBox(this.minecraft!!.font, 110, currentY, 300, 20, name.text())
editBox.setMaxLength(256)
editBox.value = value
// Dry run expression changes and if valid then turn white and if
// invalid then turn red. If it remains the same it is green
editBox.setResponder { newExpression ->
when {
!validateExpression(newExpression) -> editBox.setTextColor(0xFF5555)
newExpression == originalValues[name] -> editBox.setTextColor(0x55FF55)
else -> editBox.setTextColor(0xFFFFFF)
}
}
// Set all Boxes to green as they are currently saved
editBox.setTextColor(0x55FF55)
// Add widget
addRenderableWidget(editBox)
// Add widget to list
settingWidgets.add(name to editBox)
currentY += 25
}
}
private fun saveRideSettings() {
for ((name, editBox) in settingWidgets) {
// If expression is valid then save and turn green
if (validateExpression(editBox.value)) {
ServerboundUpdateRidingSettingsHandler.modifyRideSettingsExpression(
vehicle,
rideStyle,
name,
editBox.value
)
// Update the running list of last saved values too
originalValues[name] = editBox.value
// Update server with
CobblemonNetwork.sendToServer(
ServerboundUpdateRidingSettingsPacket(
vehicle.id,
rideStyle,
name,
editBox.value
)
)
editBox.setTextColor(0x55FF55)
}
}
}
private fun validateExpression(expression: String): Boolean {
return try {
// Attempt to parse as expression
val parsedExpression = expression.asExpression()
// Dry run to ensure its not borked.
vehicle.runtime.resolve(parsedExpression)
true
} catch (e: Exception) {
false
}
}
private fun getExpressionVariables(settings: RidingBehaviourSettings): List<Pair<String, String>> {
val clazz = settings.javaClass
val fields = clazz.declaredFields
// Iterate through all expression fields and return the list of those that
// aer expressions
return fields.mapNotNull { field ->
if (field.type == Expression::class.java) {
field.isAccessible = true // Make private fields accessible
val name = field.name
// Get the value, cast it, and call .getString() on it
val value = (field.get(settings) as Expression).getString()
// Create the pair and return it for the list
name to value
} else {
// If it's not an Expression (they all honestly should be if being used by the
// behaviour in question) then ignore
null
}
}
}
}
@@ -33,28 +33,26 @@ class RidingStatsDebugGUI(val vehicle: PokemonEntity) : Screen(lang("ui.debug.ri
var ridingStyle: RidingStyle = RidingStyle.LAND
private lateinit var changeRidingStyle: Button
val changeRidingStyle: Button
private lateinit var speedSlider: SettingsSlider
private lateinit var accelerationSlider: SettingsSlider
private lateinit var skillSlider: SettingsSlider
private lateinit var jumpSlider: SettingsSlider
private lateinit var staminaSlider: SettingsSlider
val speedSlider: SettingsSlider
val accelerationSlider: SettingsSlider
val skillSlider: SettingsSlider
val jumpSlider: SettingsSlider
val staminaSlider: SettingsSlider
private lateinit var minSpeedInput: RidingStatInputWidget
private lateinit var maxSpeedInput: RidingStatInputWidget
private lateinit var minAccelerationInput: RidingStatInputWidget
private lateinit var maxAccelerationInput: RidingStatInputWidget
private lateinit var minSkillInput: RidingStatInputWidget
private lateinit var maxSkillInput: RidingStatInputWidget
private lateinit var minJumpInput: RidingStatInputWidget
private lateinit var maxJumpInput: RidingStatInputWidget
private lateinit var minStaminaInput: RidingStatInputWidget
private lateinit var maxStaminaInput: RidingStatInputWidget
val minSpeedInput: RidingStatInputWidget
val maxSpeedInput: RidingStatInputWidget
val minAccelerationInput: RidingStatInputWidget
val maxAccelerationInput: RidingStatInputWidget
val minSkillInput: RidingStatInputWidget
val maxSkillInput: RidingStatInputWidget
val minJumpInput: RidingStatInputWidget
val maxJumpInput: RidingStatInputWidget
val minStaminaInput: RidingStatInputWidget
val maxStaminaInput: RidingStatInputWidget
public override fun init() {
super.init()
clearWidgets()
init {
ridingStyle = vehicle.ifRidingAvailableSupply(RidingStyle.LAND) { behaviour, settings, state ->
behaviour.getRidingStyle(settings, state)
}
@@ -96,15 +94,6 @@ class RidingStatsDebugGUI(val vehicle: PokemonEntity) : Screen(lang("ui.debug.ri
}.bounds(getScaledWidth() - 210, 220, 200, 20).build()
)
addRenderableWidget(
Button.builder("Edit Ride Settings".text()) { button ->
// Grab the ride settings for the currently being configured style
val rideSettings = vehicle.ridingController?.behaviours?.get(ridingStyle) ?: return@builder
// Open up GUI for editing the given settings
this.minecraft?.setScreen(RideSettingsEditorGUI(this, vehicle, ridingStyle, rideSettings))
}.bounds(10, 240, 200, 20).build()
)
refresh()
}
@@ -266,7 +266,6 @@ class PCGUI(
tooltipKey = "ui.sort.${typeName}",
label = "sort_${typeName}"
) {
storageWidget.resetSelected()
SortPCBoxPacket(pc.uuid, storageWidget.box, sortType, hasShiftDown()).sendToServer()
}.also {
it.visible = displayOptions
@@ -720,7 +719,7 @@ class PCGUI(
if (pasture.pastureScrollList.isHovered) pasture.pastureScrollList.mouseScrolled(mouseX, mouseY, amount, verticalAmount)
}
if (storageWidget.isHovered && mouseX < (storageWidget.x + StorageWidget.SCREEN_WIDTH)) this.storageWidget.box -= verticalAmount.toInt()
if (::wallpaperWidget.isInitialized && wallpaperWidget.isHovered) wallpaperWidget.mouseScrolled(mouseX, mouseY, amount, verticalAmount)
if (wallpaperWidget.isHovered) wallpaperWidget.mouseScrolled(mouseX, mouseY, amount, verticalAmount)
val infoBoxX = ((width - BASE_WIDTH) / 2) + 9
val infoBoxY = ((height - BASE_HEIGHT) / 2) + 128
@@ -492,7 +492,7 @@ class StorageWidget(
}
}
fun resetSelected() {
private fun resetSelected() {
selectedPosition = null
grabbedSlot = null
pcGui.setPreviewPokemon(null)
@@ -10,7 +10,6 @@ package com.cobblemon.mod.common.client.keybind.keybinds
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.CobblemonNetwork.sendToServer
import com.cobblemon.mod.common.api.riding.RidingStyle
import com.cobblemon.mod.common.battles.BattleFormat
import com.cobblemon.mod.common.client.CobblemonClient
import com.cobblemon.mod.common.client.battle.ClientBattle
@@ -85,7 +84,7 @@ object PartySendBinding : CobblemonBlockingKeyBinding(
if (isRidingPokemon(player) && canAttemptDismount(player, selectedPartyPokemon)) {
sendToServer(DismountPokemonPacket())
}
else if (!isRidingSelectedPokemon(player, selectedPartyPokemon)){
else {
checkForTargetInteractions(player, selectedPartyPokemon)
}
}
@@ -146,11 +145,6 @@ object PartySendBinding : CobblemonBlockingKeyBinding(
if (player != vehicle.controllingPassenger) {
return true
}
val isAirRide = vehicle.ridingController?.context?.style == RidingStyle.AIR
val hasLandRide = vehicle.rideProp.behaviours?.get(RidingStyle.LAND) != null
if (isAirRide && hasLandRide) {
return false
}
else {
return vehicle.pokemon.uuid == selectedPartyPokemon.uuid
}
@@ -163,14 +157,6 @@ object PartySendBinding : CobblemonBlockingKeyBinding(
return true
}
private fun isRidingSelectedPokemon(player: LocalPlayer, selectedPartyPokemon: Pokemon, ignoreControlling: Boolean = false): Boolean {
if (!player.isPassenger) return false
if (player.vehicle !is PokemonEntity) return false
val vehicle = player.vehicle as PokemonEntity
if (ignoreControlling && player.vehicle!!.controllingPassenger == player) return false
return vehicle.pokemon.uuid == selectedPartyPokemon.uuid
}
override fun onPress() {
}
}
@@ -231,8 +231,8 @@ data class BedrockAnimation(
if (!timeline.scale.isEmpty()) {
var scale = timeline.scale.resolve(animationSeconds.toDouble(), runtime)
// If the goal is to make the invisible then kick that into gear after or on 0.5. Maybe could work better somehow else.
if (scale == Vec3.ZERO && intensity >= 0.5) {
// If the goal is to make the invisible then kick that into gear after 0.5. Maybe could work better somehow else.
if (scale == Vec3.ZERO && intensity > 0.5) {
part.xScale *= scale.x.toFloat()
part.yScale *= scale.y.toFloat()
part.zScale *= scale.z.toFloat()
@@ -0,0 +1,88 @@
/*
* 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.pokemon.gen1
import com.cobblemon.mod.common.client.render.models.blockbench.createTransformation
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
import com.cobblemon.mod.common.client.render.models.blockbench.pose.ModelPartTransformation
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
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.geom.ModelPart
import net.minecraft.world.phys.Vec3
class MewModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame {
override val rootPart = root.registerChildWithAllChildren("mew")
override val head = getPart("head")
override var portraitScale = 2.3F
override var portraitTranslation = Vec3(-0.15, 0.4, 0.0)
override var profileScale = 0.7F
override var profileTranslation = Vec3(0.0, 0.65, 0.0)
lateinit var standing: Pose
lateinit var walk: Pose
lateinit var shoulderLeft: Pose
lateinit var shoulderRight: Pose
val shoulderOffset = 1.5
override fun registerPoses() {
standing = registerPose(
poseName = "standing",
poseTypes = STATIONARY_POSES + UI_POSES,
animations = arrayOf(
singleBoneLook(),
bedrock("mew", "ground_idle")
)
)
walk = registerPose(
poseName = "walk",
poseTypes = MOVING_POSES,
animations = arrayOf(
singleBoneLook(),
bedrock("mew", "ground_walk")
)
)
shoulderLeft = registerPose(
poseType = PoseType.SHOULDER_LEFT,
//quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("mew", "ground_idle")
),
transformedParts = arrayOf(
rootPart.createTransformation().addPosition(ModelPartTransformation.X_AXIS, shoulderOffset)
)
)
shoulderRight = registerPose(
poseType = PoseType.SHOULDER_RIGHT,
//quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("mew", "ground_idle")
),
transformedParts = arrayOf(
rootPart.createTransformation().addPosition(ModelPartTransformation.X_AXIS, -shoulderOffset)
)
)
}
// override fun getFaintAnimation(
// pokemonEntity: PokemonEntity,
// state: PosableState<PokemonEntity>
// ) = if (state.isPosedIn(standing, walk)) bedrockStateful("mew", "faint") else null
}
@@ -0,0 +1,65 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen3
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
import com.cobblemon.mod.common.client.render.models.blockbench.animation.BimanualSwingAnimation
import com.cobblemon.mod.common.client.render.models.blockbench.animation.BipedWalkAnimation
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BimanualFrame
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.pose.Pose
import com.cobblemon.mod.common.entity.PoseType
import net.minecraft.client.model.geom.ModelPart
import net.minecraft.world.phys.Vec3
class NuzleafModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame, BipedFrame, BimanualFrame {
override val rootPart = root.registerChildWithAllChildren("nuzleaf")
override val head = getPart("head")
override val leftArm = getPart("arm_left")
override val rightArm = getPart("arm_right")
override val leftLeg = getPart("leg_left")
override val rightLeg = getPart("leg_right")
override var portraitScale = 2.6F
override var portraitTranslation = Vec3(-0.15, -0.65, 0.0)
override var profileScale = 0.9F
override var profileTranslation = Vec3(0.0, 0.44, 0.0)
lateinit var standing: Pose
lateinit var walk: Pose
override fun registerPoses() {
val blink = quirk { bedrockStateful("nuzleaf", "blink") }
standing = registerPose(
poseName = "standing",
poseTypes = PoseType.STATIONARY_POSES + PoseType.UI_POSES,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("nuzleaf", "ground_idle")
)
)
walk = registerPose(
poseName = "walk",
poseTypes = PoseType.MOVING_POSES,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("nuzleaf", "ground_idle"),
BipedWalkAnimation(this, periodMultiplier = 0.6F, amplitudeMultiplier = 0.9F),
BimanualSwingAnimation(this, swingPeriodMultiplier = 0.6F, amplitudeMultiplier = 0.9F)
//bedrock("nuzleaf", "ground_walk")
)
)
}
}
@@ -0,0 +1,55 @@
/*
* 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.pokemon.gen3
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.pokemon.PokemonPosableModel
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
import com.cobblemon.mod.common.entity.PoseType
import net.minecraft.client.model.geom.ModelPart
import net.minecraft.world.phys.Vec3
class SeedotModel (root: ModelPart) : PokemonPosableModel(root), BipedFrame {
override val rootPart = root.registerChildWithAllChildren("seedot")
override val leftLeg = getPart("foot_left")
override val rightLeg = getPart("foot_right")
override var portraitScale = 2.8F
override var portraitTranslation = Vec3(-0.1, -2.5, 0.0)
override var profileScale = 1.0F
override var profileTranslation = Vec3(0.0, 0.3, 0.0)
lateinit var standing: Pose
lateinit var walk: Pose
override fun registerPoses() {
val blink = quirk { bedrockStateful("seedot", "blink") }
standing = registerPose(
poseName = "standing",
poseTypes = PoseType.STATIONARY_POSES + PoseType.UI_POSES,
quirks = arrayOf(blink),
animations = arrayOf(
bedrock("seedot", "idle")
)
)
walk = registerPose(
poseName = "walk",
poseTypes = PoseType.MOVING_POSES,
quirks = arrayOf(blink),
animations = arrayOf(
BipedWalkAnimation(this, amplitudeMultiplier = 0.9F, periodMultiplier = 1F),
bedrock("seedot", "idle")
)
)
}
}
@@ -0,0 +1,65 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen3
import com.cobblemon.mod.common.client.render.models.blockbench.animation.BimanualSwingAnimation
import com.cobblemon.mod.common.client.render.models.blockbench.animation.BipedWalkAnimation
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BimanualFrame
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.PokemonPosableModel
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
import com.cobblemon.mod.common.entity.PoseType
import net.minecraft.client.model.geom.ModelPart
import net.minecraft.world.phys.Vec3
class ShiftryModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame, BipedFrame, BimanualFrame {
override val rootPart = root.registerChildWithAllChildren("shiftry")
override val head = getPart("head")
override val leftArm = getPart("arm_left")
override val rightArm = getPart("arm_right")
override val leftLeg = getPart("leg_left")
override val rightLeg = getPart("leg_right")
override var portraitScale = 2.0F
override var portraitTranslation = Vec3(-0.15, 0.5, 0.0)
override var profileScale = 0.74F
override var profileTranslation = Vec3(0.0, 0.7, 0.0)
lateinit var standing: Pose
lateinit var walk: Pose
override fun registerPoses() {
val blink = quirk { bedrockStateful("shiftry", "blink") }
standing = registerPose(
poseName = "standing",
poseTypes = PoseType.STATIONARY_POSES + PoseType.UI_POSES,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("shiftry", "idle")
)
)
walk = registerPose(
poseName = "walk",
poseTypes = PoseType.MOVING_POSES,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("shiftry", "idle"),
BipedWalkAnimation(this, periodMultiplier = 0.6F, amplitudeMultiplier = 0.9F),
BimanualSwingAnimation(this, swingPeriodMultiplier = 0.6F, amplitudeMultiplier = 0.9F)
//bedrock("shiftry", "ground_walk")
)
)
}
}
@@ -0,0 +1,90 @@
/*
* 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.pokemon.gen4
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BimanualFrame
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.pose.Pose
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 com.cobblemon.mod.common.util.isBattling
import net.minecraft.client.model.geom.ModelPart
import net.minecraft.world.phys.Vec3
class LickilickyModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame, BipedFrame, BimanualFrame {
override val rootPart = root.registerChildWithAllChildren("lickilicky")
override val head = getPart("head")
override val leftLeg = getPart("left_leg")
override val rightLeg = getPart("right_leg")
override val leftArm = getPart("left_upper_arm")
override val rightArm = getPart("right_upper_arm")
override var portraitScale = 1.4F
override var portraitTranslation = Vec3(-0.2, 1.8, 0.0)
override var profileScale = 0.5F
override var profileTranslation = Vec3(0.0, 1.0, 0.0)
lateinit var standing: Pose
lateinit var walk: Pose
lateinit var battleidle: Pose
lateinit var sleep: Pose
override fun registerPoses() {
val blink = quirk { bedrockStateful("lickilicky", "blink") }
sleep = registerPose(
poseType = PoseType.SLEEP,
animations = arrayOf(bedrock("lickilicky", "sleep"))
)
standing = registerPose(
poseName = "standing",
poseTypes = STATIONARY_POSES + UI_POSES,
quirks = arrayOf(blink),
condition = { !it.isBattling },
animations = arrayOf(
singleBoneLook(),
bedrock("lickilicky", "ground_idle")
)
)
walk = registerPose(
poseName = "walk",
poseTypes = MOVING_POSES,
condition = { !it.isBattling },
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("lickilicky", "ground_walk")
)
)
battleidle = registerPose(
poseName = "battle_idle",
poseTypes = PoseType.STATIONARY_POSES,
transformTicks = 10,
quirks = arrayOf(blink),
condition = { it.isBattling },
animations = arrayOf(
singleBoneLook(),
bedrock("lickilicky", "battle_idle")
)
)
}
// override fun getFaintAnimation(
// pokemonEntity: PokemonEntity,
// state: PosableState<PokemonEntity>
// ) = if (state.isPosedIn(standing, walk, battleidle, sleep)) bedrockStateful("lickilicky", "faint") else null
}
@@ -0,0 +1,100 @@
/*
* 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.pokemon.gen4
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
import com.cobblemon.mod.common.client.render.models.blockbench.animation.BipedWalkAnimation
import com.cobblemon.mod.common.client.render.models.blockbench.createTransformation
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.pose.ModelPartTransformation
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
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.geom.ModelPart
import net.minecraft.world.phys.Vec3
class PachirisuModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame, BipedFrame {
override val rootPart = root.registerChildWithAllChildren("pachirisu")
override val head = getPart("head")
override val leftLeg = getPart("leftfoot")
override val rightLeg = getPart("rightfoot")
override var portraitScale = 2.3F
override var portraitTranslation = Vec3(-0.2, -1.1, 0.0)
override var profileScale = 0.8F
override var profileTranslation = Vec3(0.0, 0.55, 0.0)
lateinit var standing: Pose
lateinit var walk: Pose
lateinit var shoulderLeft: Pose
lateinit var shoulderRight: Pose
val shoulderOffset = 5
val shoulderZOffset = 4.8
override fun registerPoses() {
val blink = quirk { bedrockStateful("pachirisu", "blink") }
standing = registerPose(
poseName = "standing",
poseTypes = STATIONARY_POSES + UI_POSES,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("pachirisu", "ground_idle")
)
)
walk = registerPose(
poseName = "walk",
poseTypes = MOVING_POSES,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
BipedWalkAnimation(this, periodMultiplier = 0.8F, amplitudeMultiplier = 0.7F),
bedrock("pachirisu", "ground_idle")
)
)
shoulderLeft = registerPose(
poseType = PoseType.SHOULDER_LEFT,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("pachirisu", "ground_idle")
),
transformedParts = arrayOf(
rootPart.createTransformation().addPosition(ModelPartTransformation.X_AXIS, shoulderOffset),
rootPart.createTransformation().addPosition(ModelPartTransformation.Z_AXIS, shoulderZOffset)
)
)
shoulderRight = registerPose(
poseType = PoseType.SHOULDER_RIGHT,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("pachirisu", "ground_idle")
),
transformedParts = arrayOf(
rootPart.createTransformation().addPosition(ModelPartTransformation.X_AXIS, -shoulderOffset),
rootPart.createTransformation().addPosition(ModelPartTransformation.Z_AXIS, shoulderZOffset)
)
)
}
// override fun getFaintAnimation(
// pokemonEntity: PokemonEntity,
// state: PosableState<PokemonEntity>
// ) = if (state.isPosedIn(standing, walk)) bedrockStateful("pachirisu", "faint") else null
}
@@ -0,0 +1,93 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen8
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
import com.cobblemon.mod.common.client.render.models.blockbench.PosableState
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.frame.QuadrupedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
import com.cobblemon.mod.common.entity.PoseType
import com.cobblemon.mod.common.util.isBattling
import net.minecraft.client.model.geom.ModelPart
import net.minecraft.world.phys.Vec3
class NickitModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame, QuadrupedFrame {
override val rootPart = root.registerChildWithAllChildren("nickit")
override val head = getPart("head")
override val foreLeftLeg = getPart("leg_front_left")
override val foreRightLeg = getPart("leg_front_right")
override val hindLeftLeg = getPart("leg_back_left")
override val hindRightLeg = getPart("leg_back_right")
override var portraitScale = 1.8F
override var portraitTranslation = Vec3(-0.3, -0.1, 0.0)
override var profileScale = 0.75F
override var profileTranslation = Vec3(0.0, 0.65, 0.0)
lateinit var standing: Pose
lateinit var walk: Pose
lateinit var sleep: Pose
lateinit var battleidle: Pose
override val cryAnimation = CryProvider { bedrockStateful("nickit", "cry") }
override fun registerPoses() {
val blink = quirk { bedrockStateful("nickit", "blink")}
val glanceleft = quirk { bedrockStateful("nickit", "quirk_shiftyglance_left")}
val glanceright = quirk { bedrockStateful("nickit", "quirk_shiftyglance_right")}
val eartwitchleft = quirk { bedrockStateful("nickit", "quirk_eartwitch_left")}
val eartwitchright = quirk { bedrockStateful("nickit", "quirk_eartwitch_right")}
sleep = registerPose(
poseType = PoseType.SLEEP,
animations = arrayOf(bedrock("nickit", "sleep"))
)
standing = registerPose(
poseName = "standing",
poseTypes = PoseType.STATIONARY_POSES + PoseType.UI_POSES,
transformTicks = 10,
quirks = arrayOf(blink, glanceleft, glanceright, eartwitchleft, eartwitchright),
condition = { !it.isBattling },
animations = arrayOf(
singleBoneLook(),
bedrock("nickit", "ground_idle")
)
)
walk = registerPose(
poseName = "walk",
poseTypes = PoseType.MOVING_POSES,
transformTicks = 10,
quirks = arrayOf(blink, eartwitchleft, eartwitchright),
animations = arrayOf(
singleBoneLook(),
bedrock("nickit", "ground_walk")
)
)
battleidle = registerPose(
poseName = "battle_idle",
poseTypes = PoseType.STATIONARY_POSES,
transformTicks = 10,
quirks = arrayOf(blink, glanceleft, glanceright, eartwitchleft, eartwitchright),
condition = { it.isBattling },
animations = arrayOf(
singleBoneLook(),
bedrock("nickit", "battle_idle")
)
)
}
override fun getFaintAnimation(state: PosableState) = if (state.isPosedIn(standing, walk, sleep, battleidle)) bedrockStateful("nickit", "faint") else null
}
@@ -0,0 +1,93 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen8
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.frame.QuadrupedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
import com.cobblemon.mod.common.entity.PoseType
import com.cobblemon.mod.common.util.isBattling
import net.minecraft.client.model.geom.ModelPart
import net.minecraft.world.phys.Vec3
class ThievulModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame, QuadrupedFrame {
override val rootPart = root.registerChildWithAllChildren("thievul")
override val head = getPart("head")
override val foreLeftLeg = getPart("leg_front_left")
override val foreRightLeg = getPart("leg_front_right")
override val hindLeftLeg = getPart("leg_back_left")
override val hindRightLeg = getPart("leg_back_right")
override var portraitScale = 2.0F
override var portraitTranslation = Vec3(-0.7, 1.11, 0.0)
override var profileScale = 0.65F
override var profileTranslation = Vec3(0.0, 0.7, 0.0)
lateinit var standing: Pose
lateinit var walk: Pose
lateinit var sleep: Pose
lateinit var battleidle: Pose
override val cryAnimation = CryProvider { bedrockStateful("thievul", "cry") }
override fun registerPoses() {
val blink = quirk { bedrockStateful("thievul", "blink")}
val sleepquirk = quirk { bedrockStateful("thievul", "quirk_sleep")}
sleep = registerPose(
poseType = PoseType.SLEEP,
quirks = arrayOf(sleepquirk),
animations = arrayOf(bedrock("thievul", "sleep"))
)
standing = registerPose(
poseName = "standing",
poseTypes = PoseType.STATIONARY_POSES + PoseType.UI_POSES,
transformTicks = 10,
quirks = arrayOf(blink),
condition = { !it.isBattling },
animations = arrayOf(
singleBoneLook(),
bedrock("thievul", "ground_idle")
)
)
walk = registerPose(
poseName = "walk",
poseTypes = PoseType.MOVING_POSES,
transformTicks = 10,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("thievul", "ground_walk")
)
)
battleidle = registerPose(
poseName = "battle_idle",
poseTypes = PoseType.STATIONARY_POSES,
transformTicks = 10,
quirks = arrayOf(blink),
condition = { it.isBattling },
animations = arrayOf(
singleBoneLook(),
bedrock("thievul", "battle_idle")
)
)
}
// override fun getFaintAnimation(
// pokemonEntity: PokemonEntity,
// state: PosableState<PokemonEntity>
// ) = if (state.isPosedIn(standing, walk, sleep, battleidle)) bedrockStateful("thievul", "faint") else null
}
@@ -0,0 +1,89 @@
/*
* 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.pokemon.gen9
import com.cobblemon.mod.common.client.render.models.blockbench.PosableState
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BimanualFrame
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BipedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
import com.cobblemon.mod.common.entity.PoseType
import com.cobblemon.mod.common.util.isBattling
import net.minecraft.client.model.geom.ModelPart
import net.minecraft.world.phys.Vec3
class AnnihilapeModel (root: ModelPart) : PokemonPosableModel(root), BipedFrame, BimanualFrame {
override val rootPart = root.registerChildWithAllChildren("annihilape")
override val leftArm = getPart("arm_left")
override val rightArm = getPart("arm_right")
override val leftLeg = getPart("leg_left")
override val rightLeg = getPart("leg_right")
override var portraitScale = 1.4F
override var portraitTranslation = Vec3(0.0, 0.1, 0.0)
override var profileScale = 0.85F
override var profileTranslation = Vec3(0.0, 0.45, 0.0)
lateinit var standing: Pose
lateinit var walking: Pose
lateinit var sleep: Pose
lateinit var battleidle: Pose
override val cryAnimation = CryProvider { bedrockStateful("annihilape", "cry") }
override fun registerPoses() {
val blink = quirk { bedrockStateful("annihilape", "blink") }
sleep = registerPose(
poseType = PoseType.SLEEP,
animations = arrayOf(
bedrock("annihilape", "sleep"),
bedrock("annihilape", "hair_overlay")
)
)
standing = registerPose(
poseName = "standing",
poseTypes = PoseType.STATIONARY_POSES + PoseType.UI_POSES,
transformTicks = 10,
condition = { !it.isBattling },
quirks = arrayOf(blink),
animations = arrayOf(
bedrock("annihilape", "ground_idle"),
bedrock("annihilape", "hair_overlay")
)
)
walking = registerPose(
poseName = "walking",
poseTypes = PoseType.MOVING_POSES,
transformTicks = 10,
quirks = arrayOf(blink),
animations = arrayOf(
bedrock("annihilape", "ground_walk"),
bedrock("annihilape", "hair_overlay")
)
)
battleidle = registerPose(
poseName = "battle_idle",
poseTypes = PoseType.STATIONARY_POSES,
transformTicks = 10,
quirks = arrayOf(blink),
condition = { it.isBattling },
animations = arrayOf(
bedrock("annihilape", "battle_idle"),
bedrock("annihilape", "hair_overlay")
)
)
}
override fun getFaintAnimation(state: PosableState) = if (state.isPosedIn(standing, walking, battleidle, sleep)) bedrockStateful("annihilape", "faint") else null
}
@@ -0,0 +1,60 @@
/*
* 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.pokemon.gen9
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
import com.cobblemon.mod.common.entity.PoseType
import net.minecraft.client.model.geom.ModelPart
import net.minecraft.world.phys.Vec3
class RevavroomModel (root: ModelPart) : PokemonPosableModel(root) {
override val rootPart = root.registerChildWithAllChildren("revavroom")
override var portraitScale = 3.1F
override var portraitTranslation = Vec3(-1.4, -1.7, 1.1)
override var profileScale = 0.9F
override var profileTranslation = Vec3(-0.2, 0.3, 1.1)
lateinit var standing: Pose
lateinit var walk: Pose
lateinit var sleep: Pose
override val cryAnimation = CryProvider { bedrockStateful("revavroom", "cry") }
override fun registerPoses() {
val blink = quirk { bedrockStateful("revavroom", "blink") }
sleep = registerPose(
poseType = PoseType.SLEEP,
animations = arrayOf(bedrock("revavroom", "sleep"))
)
standing = registerPose(
poseName = "standing",
poseTypes = PoseType.STATIONARY_POSES + PoseType.UI_POSES,
transformTicks = 10,
quirks = arrayOf(blink),
animations = arrayOf(
bedrock("revavroom", "ground_idle")
)
)
walk = registerPose(
poseName = "walk",
poseTypes = PoseType.MOVING_POSES,
transformTicks = 10,
quirks = arrayOf(blink),
animations = arrayOf(
bedrock("revavroom", "ground_walk")
)
)
}
}
@@ -0,0 +1,60 @@
/*
* 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.pokemon.gen9
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
import com.cobblemon.mod.common.entity.PoseType
import net.minecraft.client.model.geom.ModelPart
import net.minecraft.world.phys.Vec3
class VaroomModel (root: ModelPart) : PokemonPosableModel(root) {
override val rootPart = root.registerChildWithAllChildren("varoom")
override var portraitScale = 3.0F
override var portraitTranslation = Vec3(0.5, -2.5, 0.0)
override var profileScale = 1.1F
override var profileTranslation = Vec3(0.0, 0.0, 0.0)
lateinit var standing: Pose
lateinit var walk: Pose
lateinit var sleep: Pose
override val cryAnimation = CryProvider { bedrockStateful("varoom", "cry") }
override fun registerPoses() {
val blink = quirk { bedrockStateful("varoom", "blink") }
sleep = registerPose(
poseType = PoseType.SLEEP,
animations = arrayOf(bedrock("varoom", "sleep"))
)
standing = registerPose(
poseName = "standing",
poseTypes = PoseType.STATIONARY_POSES + PoseType.UI_POSES,
transformTicks = 0,
quirks = arrayOf(blink),
animations = arrayOf(
bedrock("varoom", "ground_idle")
)
)
walk = registerPose(
poseName = "walk",
poseTypes = PoseType.MOVING_POSES,
transformTicks = 0,
quirks = arrayOf(blink),
animations = arrayOf(
bedrock("varoom", "ground_walk")
)
)
}
}
@@ -278,6 +278,7 @@ object VaryingModelRepository {
inbuilt("lickitung", ::LickitungModel)
inbuilt("marowak", ::MarowakModel)
inbuilt("meowth", ::MeowthModel)
inbuilt("mew", ::MewModel)
inbuilt("nidoqueen", ::NidoqueenModel)
inbuilt("nidoranf", ::NidoranfModel)
inbuilt("nidoranm", ::NidoranmModel)
@@ -305,6 +306,7 @@ object VaryingModelRepository {
inbuilt("smoochum", ::SmoochumModel)
inbuilt("hitmontop", ::HitmontopModel)
inbuilt("electivire", ::ElectivireModel)
inbuilt("lickilicky", ::LickilickyModel)
inbuilt("tangrowth", ::TangrowthModel)
inbuilt("blissey", ::BlisseyModel)
inbuilt("piloswine", ::PiloswineModel)
@@ -319,6 +321,7 @@ object VaryingModelRepository {
inbuilt("buneary", ::BunearyModel)
inbuilt("lopunny", ::LopunnyModel)
inbuilt("mamoswine", ::MamoswineModel)
inbuilt("pachirisu", ::PachirisuModel)
inbuilt("piplup", ::PiplupModel)
inbuilt("yanmega", ::YanmegaModel)
inbuilt("basculin", ::BasculinModel)
@@ -387,6 +390,9 @@ object VaryingModelRepository {
inbuilt("chimchar", :: ChimcharModel)
inbuilt("monferno", :: MonfernoModel)
inbuilt("infernape", :: InfernapeModel)
inbuilt("seedot", ::SeedotModel)
inbuilt("nuzleaf", ::NuzleafModel)
inbuilt("shiftry", ::ShiftryModel)
inbuilt("kricketot", ::KricketotModel)
inbuilt("kricketune", ::KricketuneModel)
inbuilt("durant", ::DurantModel)
@@ -421,6 +427,8 @@ object VaryingModelRepository {
inbuilt("tandemaus", ::TandemausModel)
inbuilt("maushold", ::MausholdModel)
inbuilt("mausholdfour", ::MausholdfourModel)
inbuilt("varoom", ::VaroomModel)
inbuilt("revavroom", ::RevavroomModel)
inbuilt("lanturn", ::LanturnModel)
inbuilt("chingling", ::ChinglingModel)
inbuilt("chimecho", ::ChimechoModel)
@@ -456,6 +464,8 @@ object VaryingModelRepository {
inbuilt("sirfetchd", ::SirfetchdModel)
inbuilt("duskull", ::DuskullModel)
inbuilt("dusclops", ::DusclopsModel)
inbuilt("nickit", ::NickitModel)
inbuilt("thievul", ::ThievulModel)
inbuilt("glimmet", ::GlimmetModel)
inbuilt("glimmora", ::GlimmoraModel)
inbuilt("bonsly", ::BonslyModel)
@@ -490,6 +500,7 @@ object VaryingModelRepository {
inbuilt("shroodle", ::ShroodleModel)
inbuilt("grafaiai", ::GrafaiaiModel)
inbuilt("squawkabilly", ::SquawkabillyModel)
inbuilt("annihilape", ::AnnihilapeModel)
inbuilt("ponyta_galarian", ::PonytaGalarianModel)
inbuilt("rapidash_galarian", ::RapidashGalarianModel)
inbuilt("volbeat", ::VolbeatModel)
@@ -55,8 +55,7 @@ class CobblemonConfig {
@CobblemonConfigField(Category.Storage, lang = "default_box_count")
@IntConstraint(min = 1, max = 1000)
@LastChangedVersion("1.7.0")
var defaultBoxCount = 40
var defaultBoxCount = 30
@CobblemonConfigField(Category.Storage, lang = "pokemon_save_interval_seconds")
@IntConstraint(min = 1, max = 120)
var pokemonSaveIntervalSeconds = 30
@@ -38,7 +38,6 @@ class EntityCallbacks(val entity: Entity) : HashMap<ResourceLocation, MutableLis
companion object {
val HIT_BY_POKEBALL = cobblemonResource("hit_by_pokeball")
val SAW_ENTITY = cobblemonResource("saw_entity")
val LOST_ENTITY = cobblemonResource("lost_sight_of_entity")
val HURT = cobblemonResource("hurt")
val DIED = cobblemonResource("died")
}
@@ -13,7 +13,6 @@ import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.entity.pokemon.ai.PokemonMoveControl
import com.google.common.collect.ImmutableMap
import java.util.UUID
import kotlin.math.pow
import net.minecraft.server.level.ServerLevel
import net.minecraft.world.entity.ai.behavior.Behavior
import net.minecraft.world.entity.ai.memory.MemoryModuleType
@@ -31,8 +30,6 @@ class FollowHerdLeaderTask : Behavior<PokemonEntity>(
var leader: PokemonEntity? = null
var tooFar = 8F
var closeEnough = 4F
/** Chance per tick of following the herd leader. */
val chance = 1 / 20F
override fun checkExtraStartConditions(level: ServerLevel, owner: PokemonEntity): Boolean {
leader = level.getEntity(owner.brain.getMemory(CobblemonMemories.HERD_LEADER).map(UUID::fromString).orElse(null) ?: return false) as? PokemonEntity
@@ -77,7 +74,7 @@ class FollowHerdLeaderTask : Behavior<PokemonEntity>(
CobblemonWalkTarget(
pos = leader.blockPosition(),
speedModifier = 0.4F,
completionRange = 1
completionRange = 0
)
)
} else {
@@ -90,17 +87,8 @@ class FollowHerdLeaderTask : Behavior<PokemonEntity>(
)
}
} else if (leader.brain.hasMemoryValue(MemoryModuleType.WALK_TARGET)) {
if (entity.random.nextFloat() > chance) {
return // Not this tick
}
// Go to the leader's walk target, roughly.
val walkTarget = leader.brain.getMemory(MemoryModuleType.WALK_TARGET).orElse(null) ?: return
if (entity.distanceToSqr(walkTarget.target.currentPosition()) < leader.distanceToSqr(walkTarget.target.currentPosition())) {
return // We're already closer to the walk target than the leader is, so no need to move, if anything we should get out of the way
}
entity.brain.setMemory(
MemoryModuleType.WALK_TARGET,
CobblemonWalkTarget(
@@ -421,6 +421,10 @@ class NPCEntity(world: Level) : AgeableMob(CobblemonEntities.NPC, world), Npc, P
val hide = value.map["hide"] as? DoubleValue
return hide?.asDouble() == 1.0
}
val conditionValue = npc.visibilityCondition
if (!conditionValue) {
return true
}
return false
}
@@ -644,20 +648,6 @@ class NPCEntity(world: Level) : AgeableMob(CobblemonEntities.NPC, world), Npc, P
return InteractionResult.SUCCESS
}
override fun hurt(source: DamageSource, amount: Float): Boolean {
if (super.hurt(source, amount)) {
callbacks.process(
type = EntityCallbacks.HURT,
functions = mapOf(
"source" to { source.asMoLangValue() },
"amount" to { DoubleValue(amount.toDouble()) },
)
)
return true
}
return false
}
override fun recalling(pokemonEntity: PokemonEntity): CompletableFuture<Unit> {
playAnimation(RECALL_ANIMATION, pokemonExpressions(pokemonEntity.pokemon))
return delayedFuture(seconds = 1.6F)
@@ -9,9 +9,7 @@
package com.cobblemon.mod.common.entity.npc.ai
import com.bedrockk.molang.Expression
import com.cobblemon.mod.common.CobblemonMemories
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asMostSpecificMoLangValue
import com.cobblemon.mod.common.util.getMemorySafely
import com.cobblemon.mod.common.util.mainThreadRuntime
import com.cobblemon.mod.common.util.resolveFloat
import com.cobblemon.mod.common.util.resolveInt
@@ -26,11 +24,9 @@ object MeleeAttackTask {
fun create(range: Expression, cooldownTicks: Expression): OneShot<LivingEntity> = BehaviorBuilder.create {
it.group(
it.present(MemoryModuleType.ATTACK_TARGET),
it.absent(MemoryModuleType.ATTACK_COOLING_DOWN),
it.absent(MemoryModuleType.ATTACK_COOLING_DOWN)
).apply(it) { attackTarget, cooldown ->
Trigger { world, entity, _ ->
val attackTargetData = entity.brain.getMemorySafely(CobblemonMemories.ATTACK_TARGET_DATA).orElse(null)
mainThreadRuntime.withQueryValue("entity", entity.asMostSpecificMoLangValue())
val range = mainThreadRuntime.resolveFloat(range)
val cooldownTicks = mainThreadRuntime.resolveInt(cooldownTicks)
@@ -39,14 +35,6 @@ object MeleeAttackTask {
if (entity.distanceTo(attackTarget) <= range) {
entity.doHurtTarget(attackTarget)
cooldown.setWithExpiry(true, cooldownTicks.toLong())
if (attackTargetData != null) {
if (attackTargetData.dealtHitsUntilDisengage == 1) {
attackTargetData.dealtHitsUntilDisengage = 0
attackTargetData.disengageAction(entity)
} else if (attackTargetData.dealtHitsUntilDisengage > 0){
attackTargetData.dealtHitsUntilDisengage--
}
}
true
} else {
false
@@ -26,8 +26,8 @@ import com.cobblemon.mod.common.api.events.CobblemonEvents
import com.cobblemon.mod.common.api.events.entity.PokemonEntityLoadEvent
import com.cobblemon.mod.common.api.events.entity.PokemonEntitySaveEvent
import com.cobblemon.mod.common.api.events.entity.PokemonEntitySaveToWorldEvent
import com.cobblemon.mod.common.api.events.pokemon.RidePokemonEvent
import com.cobblemon.mod.common.api.events.pokemon.ShoulderMountEvent
import com.cobblemon.mod.common.api.events.pokemon.RidePokemonEvent
import com.cobblemon.mod.common.api.interaction.PokemonEntityInteraction
import com.cobblemon.mod.common.api.interaction.PokemonInteractions
import com.cobblemon.mod.common.api.mark.Marks
@@ -36,7 +36,6 @@ import com.cobblemon.mod.common.api.molang.MoLangFunctions.addLivingEntityFuncti
import com.cobblemon.mod.common.api.molang.MoLangFunctions.addPokemonEntityFunctions
import com.cobblemon.mod.common.api.molang.MoLangFunctions.addPokemonFunctions
import com.cobblemon.mod.common.api.molang.MoLangFunctions.addStandardFunctions
import com.cobblemon.mod.common.api.molang.MoLangFunctions.asMoLangValue
import com.cobblemon.mod.common.api.molang.MoLangFunctions.setup
import com.cobblemon.mod.common.api.molang.ObjectValue
import com.cobblemon.mod.common.api.net.serializers.PlatformTypeDataSerializer
@@ -57,6 +56,7 @@ import com.cobblemon.mod.common.api.riding.Seat
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviour
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviourSettings
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviourState
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviours
import com.cobblemon.mod.common.api.riding.behaviour.RidingController
import com.cobblemon.mod.common.api.riding.events.SelectDriverEvent
import com.cobblemon.mod.common.api.riding.sound.RideSoundManager
@@ -147,6 +147,7 @@ import net.minecraft.resources.ResourceLocation
import net.minecraft.server.level.ServerEntity
import net.minecraft.server.level.ServerLevel
import net.minecraft.server.level.ServerPlayer
import net.minecraft.sounds.SoundEvent
import net.minecraft.sounds.SoundEvents
import net.minecraft.sounds.SoundSource
import net.minecraft.tags.FluidTags
@@ -498,10 +499,9 @@ open class PokemonEntity(
}
override fun canStandOnFluid(state: FluidState): Boolean {
// If the pokemon is currently ridden then return false to prevent mounts that can transition
// from the air to the water from getting stuck on the water surface.
if (this.passengers.filterIsInstance<LivingEntity>().isNotEmpty() && this.controllingPassenger != null) return false
// val node = navigation.currentPath?.currentNode
// val targetPos = node?.blockPos
// if (targetPos == null || world.getBlockState(targetPos.up()).isAir) {
return if (state.`is`(FluidTags.WATER) && !isEyeInFluid(FluidTags.WATER)) {
exposedForm.behaviour.moving.swim.canWalkOnWater || platform != PlatformType.NONE
} else if (state.`is`(FluidTags.LAVA) && !isEyeInFluid(FluidTags.LAVA)) {
@@ -509,6 +509,9 @@ open class PokemonEntity(
} else {
super.canStandOnFluid(state)
}
// }
//
// return super.canWalkOnFluid(state)
}
override fun canSprint() = true
@@ -1221,14 +1224,6 @@ open class PokemonEntity(
// Only touch battle HP for non-wild Pokémon so that quick ball et. al. aren't owerpowered.
pokemon.currentHealth = (pokemon.maxHealth * (this.health / this.maxHealth)).toInt()
}
callbacks.process(
type = EntityCallbacks.HURT,
functions = mapOf(
"source" to { source.asMoLangValue() },
"amount" to { DoubleValue(amount.toDouble()) },
)
)
true
} else false
}
@@ -1722,13 +1717,15 @@ open class PokemonEntity(
val velocity = ifRidingAvailableSupply(fallback = Vec3.ZERO) { behaviour, settings, state ->
behaviour.velocity(settings, state, this, this.controllingPassenger as Player, deltaMovement)
}
// Handle ridden pokemon differently to allow vector lerp instead of simple addition.
//Handle ridden pokemon differently to allow vector lerp instead of simple addition.
val v = getInputVector(velocity, 1.0f, this.yRot)
// Changing this will give the ride more or less inertia/handling/drift
//changing this will give the ride more or less inertia/handling/drift
val inertia = ifRidingAvailableSupply(fallback = 0.5) { behaviour, settings, state ->
behaviour.inertia(settings, state,this)
}
// TODO: jackowes look over this so I don't accidentally break anything
// TODO: Talk to landon about why this was needed
this.deltaMovement = this.deltaMovement.lerp(v, inertia)
var pos = this.deltaMovement.scale(this.speed.toDouble())
if (super.onGround() && this.deltaMovement.y == 0.0) {
@@ -1800,12 +1797,6 @@ open class PokemonEntity(
val delta = triedMovement.subtract(this.deltaMovement)
if (behaviour.damageOnCollision(settings, state, this, delta)) {
DamageOnCollisionPacket(delta).sendToServer()
for (passenger in this.passengers) {
passenger.deltaMovement = this.deltaMovement
}
this.ejectPassengers()
// Reset ride velocity
state.rideVelocity.set(state.rideVelocity.get().multiply(0.0, 1.0, 0.0))
}
@@ -2432,17 +2423,6 @@ open class PokemonEntity(
}
}
internal fun adjustHerdSize(difference: Int): Int {
val currentSize = brain.getMemorySafely(CobblemonMemories.HERD_SIZE).orElse(0)
val newSize = (currentSize + difference).coerceAtLeast(0)
if (newSize == 0) {
brain.eraseMemory(CobblemonMemories.HERD_SIZE)
} else {
brain.setMemory(CobblemonMemories.HERD_SIZE, newSize)
}
return newSize
}
/**
* Figures out what the strongest tier applied to this herd is from the perspective of this entity. This can be a
* bit confusing so bear with me.
@@ -20,9 +20,7 @@ import net.minecraft.world.entity.ai.behavior.declarative.Trigger
import net.minecraft.world.entity.ai.memory.MemoryModuleType
object GoToSleepTask {
fun create(
onlyFromStatus: Boolean
): OneShot<PokemonEntity> {
fun create(): OneShot<PokemonEntity> {
return BehaviorBuilder.create {
it.group(
it.absent(MemoryModuleType.WALK_TARGET),
@@ -30,11 +28,8 @@ object GoToSleepTask {
).apply(it) { _, pokemonDrowsy ->
Trigger { _, entity, _ ->
val hasSleepStatus = entity.pokemon.status?.status === Statuses.SLEEP
if (entity.behaviour.resting.canSleep && ((it.tryGet(pokemonDrowsy).orElse(false) && entity.canSleepAt(entity.blockPosition().below())) || hasSleepStatus)) {
if (entity.behaviour.resting.canSleep && ((it.tryGet(pokemonDrowsy).orElse(false) && entity.canSleepAt(entity.blockPosition().below())) || hasSleepStatus) && entity.pokemon.storeCoordinates.get()?.store !is PartyStore) {
if (!hasSleepStatus) {
if (onlyFromStatus) {
return@Trigger false
}
entity.pokemon.status = PersistentStatusContainer(Statuses.SLEEP)
}
entity.brain.eraseMemory(MemoryModuleType.WALK_TARGET)
@@ -15,6 +15,7 @@ import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import net.minecraft.world.entity.ai.behavior.OneShot
import net.minecraft.world.entity.ai.behavior.declarative.BehaviorBuilder
import net.minecraft.world.entity.ai.behavior.declarative.Trigger
import net.minecraft.world.entity.ai.memory.MemoryModuleType
object WakeUpTask {
fun create(): OneShot<PokemonEntity> {
@@ -22,17 +23,15 @@ object WakeUpTask {
it.group(
it.absent(CobblemonMemories.POKEMON_DROWSY)
).apply(it) { _ ->
Trigger { _, entity, _ ->
val hasSleepStatus = entity.pokemon.status?.status == Statuses.SLEEP
if (hasSleepStatus && entity.pokemon.storeCoordinates.get()?.store is PartyStore) {
return@Trigger false // You can't wake up if you're in the party with the sleep status.
}
if (hasSleepStatus) {
Trigger { world, entity, _ ->
if (entity.pokemon.status?.status == Statuses.SLEEP && entity.pokemon.storeCoordinates.get()?.store !is PartyStore) {
entity.pokemon.status = null
entity.brain.eraseMemory(CobblemonMemories.POKEMON_SLEEPING)
entity.brain.useDefaultActivity()
return@Trigger true
} else {
return@Trigger false
}
entity.brain.eraseMemory(CobblemonMemories.POKEMON_SLEEPING)
entity.brain.useDefaultActivity()
return@Trigger true
}
}
}
@@ -81,7 +81,7 @@ class AprijuiceItem(val type: Apricorn): CobblemonItem(Properties().stacksTo(16)
override fun canUseOnPokemon(stack: ItemStack, pokemon: Pokemon): Boolean {
val boosts = getBoosts(stack, pokemon)
return boosts.isNotEmpty() && boosts.any { pokemon.canAddRideBoost(it.key) } && super.canUseOnPokemon(stack, pokemon)
return boosts.isNotEmpty() && boosts.any { pokemon.canAddRideBoost(it.key, it.value) } && super.canUseOnPokemon(stack, pokemon)
}
fun getBoosts(stack: ItemStack, pokemon: Pokemon): Map<RidingStat, Float> {
@@ -9,7 +9,6 @@
package com.cobblemon.mod.common.item
import com.cobblemon.mod.common.CobblemonBlocks
import com.cobblemon.mod.common.block.campfirepot.CampfirePotColor
import com.cobblemon.mod.common.CobblemonSounds
import net.minecraft.core.Direction
import net.minecraft.sounds.SoundSource
@@ -23,7 +22,7 @@ import net.minecraft.world.level.block.CampfireBlock
import net.minecraft.world.level.block.HorizontalDirectionalBlock
import net.minecraft.world.level.block.entity.CampfireBlockEntity
class CampfirePotItem(block: Block, val color: CampfirePotColor): BlockItem(block, Properties()) {
class CampfirePotItem(block: Block): BlockItem(block, Properties()) {
override fun useOn(context: UseOnContext): InteractionResult {
val world = context.level
@@ -9,11 +9,7 @@
package com.cobblemon.mod.common.item.group
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.CobblemonItemComponents
import com.cobblemon.mod.common.CobblemonItems
import com.cobblemon.mod.common.api.cooking.Flavour
import com.cobblemon.mod.common.item.AprijuiceItem
import com.cobblemon.mod.common.item.components.FlavourComponent
import com.cobblemon.mod.common.util.cobblemonResource
import net.minecraft.core.registries.BuiltInRegistries
import net.minecraft.world.level.ItemLike
@@ -531,27 +527,14 @@ object CobblemonItemGroups {
entries.accept(CobblemonItems.POKE_CAKE)
entries.accept(CobblemonItems.POKE_PUFF)
entries.accept(defaultAprijuice(CobblemonItems.APRIJUICE_RED))
entries.accept(defaultAprijuice(CobblemonItems.APRIJUICE_YELLOW))
entries.accept(defaultAprijuice(CobblemonItems.APRIJUICE_GREEN))
entries.accept(defaultAprijuice(CobblemonItems.APRIJUICE_BLUE))
entries.accept(defaultAprijuice(CobblemonItems.APRIJUICE_PINK))
entries.accept(defaultAprijuice(CobblemonItems.APRIJUICE_BLACK))
entries.accept(defaultAprijuice(CobblemonItems.APRIJUICE_WHITE))
}
//entries.accept(CobblemonItems.APRIJUICE_RED) // TODO uncomment for 1.7.X
//entries.accept(CobblemonItems.APRIJUICE_YELLOW)
//entries.accept(CobblemonItems.APRIJUICE_GREEN)
//entries.accept(CobblemonItems.APRIJUICE_BLUE)
//entries.accept(CobblemonItems.APRIJUICE_PINK)
//entries.accept(CobblemonItems.APRIJUICE_BLACK)
//entries.accept(CobblemonItems.APRIJUICE_WHITE)
private fun defaultAprijuice(item: AprijuiceItem): ItemStack {
return ItemStack(item).apply {
this.set(CobblemonItemComponents.FLAVOUR, FlavourComponent(
mapOf(
Flavour.SPICY to 10,
Flavour.DRY to 10,
Flavour.SWEET to 10,
Flavour.BITTER to 10,
Flavour.SOUR to 10,
)
))
}
}
private fun evolutionItemEntries(displayContext: ItemDisplayParameters, entries: Output) {
@@ -804,8 +787,6 @@ object CobblemonItemGroups {
injector.putAfter(CobblemonItems.POKE_CAKE, Items.CAKE)
injector.putAfter(CobblemonItems.SINISTER_TEA, Items.MILK_BUCKET)
}
private fun toolsAndUtilitiesInjections(injector: Injector) {
@@ -1,44 +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.server.debug
import com.cobblemon.mod.common.api.net.NetworkPacket
import com.cobblemon.mod.common.api.riding.RidingStyle
import com.cobblemon.mod.common.util.cobblemonResource
import com.cobblemon.mod.common.util.readString
import com.cobblemon.mod.common.util.writeString
import net.minecraft.network.RegistryFriendlyByteBuf
class ServerboundUpdateRidingSettingsPacket(
val entity: Int,
val ridingStyle: RidingStyle,
val variable: String,
val expression: String
) : NetworkPacket<ServerboundUpdateRidingSettingsPacket> {
override val id = ID
override fun encode(buffer: RegistryFriendlyByteBuf) {
buffer.writeInt(entity)
buffer.writeEnum(ridingStyle)
buffer.writeString(variable)
buffer.writeString(expression)
}
companion object {
val ID = cobblemonResource("c2s_update_ride_settings")
fun decode(buffer: RegistryFriendlyByteBuf): ServerboundUpdateRidingSettingsPacket {
return ServerboundUpdateRidingSettingsPacket(
entity = buffer.readInt(),
ridingStyle = buffer.readEnum(RidingStyle::class.java),
variable = buffer.readString(),
expression = buffer.readString()
)
}
}
}
@@ -1,41 +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.serverhandling.debug
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.api.net.ServerNetworkPacketHandler
import com.cobblemon.mod.common.api.riding.RidingStyle
import com.cobblemon.mod.common.api.riding.stats.RidingStat
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.net.messages.server.debug.ServerboundUpdateRidingSettingsPacket
import com.cobblemon.mod.common.net.messages.server.debug.ServerboundUpdateRidingStatsPacket
import com.cobblemon.mod.common.util.asExpression
import net.minecraft.server.MinecraftServer
import net.minecraft.server.level.ServerPlayer
object ServerboundUpdateRidingSettingsHandler : ServerNetworkPacketHandler<ServerboundUpdateRidingSettingsPacket> {
override fun handle(packet: ServerboundUpdateRidingSettingsPacket, server: MinecraftServer, player: ServerPlayer) {
if (!Cobblemon.config.enableDebugKeys) return
val entity = player.level().getEntity(packet.entity) ?: return
if (entity !is PokemonEntity) return
if (entity.controllingPassenger != player) return
this.modifyRideSettingsExpression(entity, packet.ridingStyle, packet.variable, packet.expression)
}
internal fun modifyRideSettingsExpression(vehicle: PokemonEntity, ridingStyle: RidingStyle, variable: String, expression: String) {
val rideSettings = vehicle.ridingController?.behaviours?.get(ridingStyle) ?: return
val clazz = rideSettings.javaClass
val field = clazz.declaredFields.firstOrNull { it.name == variable } ?: return
field.isAccessible = true
field.set(rideSettings, expression.asExpression())
}
}
@@ -1833,14 +1833,14 @@ open class Pokemon : ShowdownIdentifiable {
return rideBoosts.toMap()
}
fun canAddRideBoost(stat: RidingStat): Boolean {
fun canAddRideBoost(stat: RidingStat, boost: Float): Boolean {
val max = getMaxRideBoost(stat)
val current = rideBoosts[stat] ?: 0F
return current < max
return current + boost <= max
}
fun addRideBoost(stat: RidingStat, boost: Float): Boolean {
if (!canAddRideBoost(stat)) {
if (!canAddRideBoost(stat, boost)) {
return false
}
val max = getMaxRideBoost(stat)
@@ -67,12 +67,12 @@ class FormPokemonBehaviour {
val entityInteract: EntityBehaviour
get() = _entityInteract ?: parent.entityInteract
val blockInteract: BlockBehavior
get() = _blockInteract ?: parent.blockInteract
val dampensVibrations: Boolean
get() = _dampensVibrations ?: parent.dampensVibrations
val blockInteract: BlockBehavior
get() = _blockInteract ?: parent.blockInteract
val combat: CombatBehaviour
get() = _combat ?: parent.combat
@@ -35,6 +35,5 @@ class MoveBehaviour {
it.addFunction("wander_chance") { DoubleValue(wanderChance) }
it.addFunction("wander_speed") { DoubleValue(wanderSpeed) }
it.addFunction("can_look") { DoubleValue(canLook) }
it.addFunction("can_move") { DoubleValue(walk.canWalk || swim.canSwimInLava || swim.canSwimInWater || fly.canFly) }
}
}
@@ -242,7 +242,7 @@ object PokemonBrain {
}
add(0 toDF ChooseLandWanderTargetTask.create(pokemon.form.behaviour.moving.wanderChance, horizontalRange = 10, verticalRange = 5, walkSpeed = 0.33F, completionRange = 1))
add(0 toDF GoToSleepTask.create(onlyFromStatus = false))
add(0 toDF GoToSleepTask.create())
add(0 toDF FindRestingPlaceTask.create(16, 8))
// add(0 toDF EatGrassTask())
add(0 toDF AttackAngryAtTask.create())
@@ -81,6 +81,7 @@ object NPCClassAdapter : JsonDeserializer<NPCClass> {
obj.get("isMovable")?.let { npcClass.isMovable = it.asBoolean }
obj.get("isInvulnerable")?.let { npcClass.isInvulnerable = it.asBoolean }
obj.get("isLeashable")?.let { npcClass.isLeashable = it.asBoolean }
obj.get("visibilityCondition")?.let { npcClass.visibilityCondition = it.asBoolean }
obj.get("allowProjectileHits")?.let { npcClass.allowProjectileHits = it.asBoolean }
obj.get("hideNameTag")?.let { npcClass.hideNameTag = it.asBoolean }
@@ -1,56 +0,0 @@
{
"format_version": "1.10.0",
"particle_effect": {
"description": {
"identifier": "cobblemon:annihilapeglare",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particles/generic/sparkle/bigsparkle"
}
},
"components": {
"minecraft:emitter_local_space": {
"position": true,
"rotation": false
},
"minecraft:emitter_rate_instant": {
"num_particles": 1
},
"minecraft:emitter_lifetime_once": {
"active_time": 1
},
"minecraft:emitter_shape_point": {},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 0.3
},
"minecraft:particle_initial_speed": 0,
"minecraft:particle_motion_dynamic": {},
"minecraft:particle_appearance_billboard": {
"size": [0.2, 0.2],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 16,
"texture_height": 96,
"flipbook": {
"base_UV": [0, 0],
"size_UV": [16, 16],
"step_UV": [0, 16],
"frames_per_second": 6,
"max_frame": 6,
"stretch_to_lifetime": true
}
}
},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.particle_age / v.particle_lifetime",
"gradient": {
"0.0": "#ffffffff",
"0.68": "#FFFF0000",
"1.0": "#FF1F0505"
}
}
}
}
}
}
@@ -1,82 +0,0 @@
{
"format_version": "1.10.0",
"particle_effect": {
"description": {
"identifier": "cobblemon:poodle_hair_black",
"basic_render_parameters": {
"material": "particles_blend",
"texture": "textures/particles/generic/cotton"
}
},
"events": {
"event_sound": {
"expression": "q.sound('minecraft:entity.sheep.shear', 1, math.random(0.9,1.1))",
"particle_effect": {
"effect": "cobblemon:poodle_hair_particles",
"type": "particle"
}
}
},
"components": {
"minecraft:emitter_rate_steady": {
"spawn_rate": 64,
"max_particles": 64
},
"minecraft:emitter_lifetime_once": {
"active_time": 0.8
},
"minecraft:emitter_lifetime_events": {
"timeline": {
"0.10": "event_sound",
"0.30": "event_sound"
}
},
"minecraft:emitter_shape_point": {
"offset": [0, "math.random(-0.3,0.8)", 0],
"direction": ["math.random(-3,3)", "math.random(0,2)", "math.random(-3,3)"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 0.7
},
"minecraft:particle_initial_spin": {
"rotation": "math.random_integer(1,4) * 90"
},
"minecraft:particle_initial_speed": 7,
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, -5, 0],
"linear_drag_coefficient": 5
},
"minecraft:particle_appearance_billboard": {
"size": [0.4, 0.4],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 48,
"texture_height": 256,
"flipbook": {
"base_UV": ["math.floor(v.particle_random_2*3)*16", 0],
"size_UV": [16, 16],
"step_UV": [0, 16],
"frames_per_second": 24,
"max_frame": 16
}
}
},
"minecraft:particle_motion_collision": {
"collision_drag": 5,
"collision_radius": 0.1
},
"minecraft:particle_appearance_lighting": {},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.emitter_age",
"gradient": {
"0.0": "#FFFFFFFF",
"0.6": "#ffffffff",
"0.72": "#FF2F2C3B",
"1.0": "#FF2F2C3B"
}
}
}
}
}
}
@@ -1,82 +0,0 @@
{
"format_version": "1.10.0",
"particle_effect": {
"description": {
"identifier": "cobblemon:poodle_hair_blue",
"basic_render_parameters": {
"material": "particles_blend",
"texture": "textures/particles/generic/cotton"
}
},
"events": {
"event_sound": {
"expression": "q.sound('minecraft:entity.sheep.shear', 1, math.random(0.9,1.1))",
"particle_effect": {
"effect": "cobblemon:poodle_hair_particles",
"type": "particle"
}
}
},
"components": {
"minecraft:emitter_rate_steady": {
"spawn_rate": 64,
"max_particles": 64
},
"minecraft:emitter_lifetime_once": {
"active_time": 0.8
},
"minecraft:emitter_lifetime_events": {
"timeline": {
"0.10": "event_sound",
"0.30": "event_sound"
}
},
"minecraft:emitter_shape_point": {
"offset": [0, "math.random(-0.3,0.8)", 0],
"direction": ["math.random(-3,3)", "math.random(0,2)", "math.random(-3,3)"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 0.7
},
"minecraft:particle_initial_spin": {
"rotation": "math.random_integer(1,4) * 90"
},
"minecraft:particle_initial_speed": 7,
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, -5, 0],
"linear_drag_coefficient": 5
},
"minecraft:particle_appearance_billboard": {
"size": [0.4, 0.4],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 48,
"texture_height": 256,
"flipbook": {
"base_UV": ["math.floor(v.particle_random_2*3)*16", 0],
"size_UV": [16, 16],
"step_UV": [0, 16],
"frames_per_second": 24,
"max_frame": 16
}
}
},
"minecraft:particle_motion_collision": {
"collision_drag": 5,
"collision_radius": 0.1
},
"minecraft:particle_appearance_lighting": {},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.emitter_age",
"gradient": {
"0.0": "#FFFFFFFF",
"0.6": "#ffffffff",
"0.72": "#FF5B83DE",
"1.0": "#FF5B83DE"
}
}
}
}
}
}
@@ -1,82 +0,0 @@
{
"format_version": "1.10.0",
"particle_effect": {
"description": {
"identifier": "cobblemon:poodle_hair_brown",
"basic_render_parameters": {
"material": "particles_blend",
"texture": "textures/particles/generic/cotton"
}
},
"events": {
"event_sound": {
"expression": "q.sound('minecraft:entity.sheep.shear', 1, math.random(0.9,1.1))",
"particle_effect": {
"effect": "cobblemon:poodle_hair_particles",
"type": "particle"
}
}
},
"components": {
"minecraft:emitter_rate_steady": {
"spawn_rate": 64,
"max_particles": 64
},
"minecraft:emitter_lifetime_once": {
"active_time": 0.8
},
"minecraft:emitter_lifetime_events": {
"timeline": {
"0.10": "event_sound",
"0.30": "event_sound"
}
},
"minecraft:emitter_shape_point": {
"offset": [0, "math.random(-0.3,0.8)", 0],
"direction": ["math.random(-3,3)", "math.random(0,2)", "math.random(-3,3)"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 0.7
},
"minecraft:particle_initial_spin": {
"rotation": "math.random_integer(1,4) * 90"
},
"minecraft:particle_initial_speed": 7,
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, -5, 0],
"linear_drag_coefficient": 5
},
"minecraft:particle_appearance_billboard": {
"size": [0.4, 0.4],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 48,
"texture_height": 256,
"flipbook": {
"base_UV": ["math.floor(v.particle_random_2*3)*16", 0],
"size_UV": [16, 16],
"step_UV": [0, 16],
"frames_per_second": 24,
"max_frame": 16
}
}
},
"minecraft:particle_motion_collision": {
"collision_drag": 5,
"collision_radius": 0.1
},
"minecraft:particle_appearance_lighting": {},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.emitter_age",
"gradient": {
"0.0": "#FFFFFFFF",
"0.6": "#ffffffff",
"0.72": "#FF8E5F45",
"1.0": "#FF8E5F45"
}
}
}
}
}
}
@@ -1,82 +0,0 @@
{
"format_version": "1.10.0",
"particle_effect": {
"description": {
"identifier": "cobblemon:poodle_hair_cyan",
"basic_render_parameters": {
"material": "particles_blend",
"texture": "textures/particles/generic/cotton"
}
},
"events": {
"event_sound": {
"expression": "q.sound('minecraft:entity.sheep.shear', 1, math.random(0.9,1.1))",
"particle_effect": {
"effect": "cobblemon:poodle_hair_particles",
"type": "particle"
}
}
},
"components": {
"minecraft:emitter_rate_steady": {
"spawn_rate": 64,
"max_particles": 64
},
"minecraft:emitter_lifetime_once": {
"active_time": 0.8
},
"minecraft:emitter_lifetime_events": {
"timeline": {
"0.10": "event_sound",
"0.30": "event_sound"
}
},
"minecraft:emitter_shape_point": {
"offset": [0, "math.random(-0.3,0.8)", 0],
"direction": ["math.random(-3,3)", "math.random(0,2)", "math.random(-3,3)"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 0.7
},
"minecraft:particle_initial_spin": {
"rotation": "math.random_integer(1,4) * 90"
},
"minecraft:particle_initial_speed": 7,
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, -5, 0],
"linear_drag_coefficient": 5
},
"minecraft:particle_appearance_billboard": {
"size": [0.4, 0.4],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 48,
"texture_height": 256,
"flipbook": {
"base_UV": ["math.floor(v.particle_random_2*3)*16", 0],
"size_UV": [16, 16],
"step_UV": [0, 16],
"frames_per_second": 24,
"max_frame": 16
}
}
},
"minecraft:particle_motion_collision": {
"collision_drag": 5,
"collision_radius": 0.1
},
"minecraft:particle_appearance_lighting": {},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.emitter_age",
"gradient": {
"0.0": "#FFFFFFFF",
"0.6": "#ffffffff",
"0.72": "#FF37A5B3",
"1.0": "#FF37A5B3"
}
}
}
}
}
}
@@ -1,82 +0,0 @@
{
"format_version": "1.10.0",
"particle_effect": {
"description": {
"identifier": "cobblemon:poodle_hair_gray",
"basic_render_parameters": {
"material": "particles_blend",
"texture": "textures/particles/generic/cotton"
}
},
"events": {
"event_sound": {
"expression": "q.sound('minecraft:entity.sheep.shear', 1, math.random(0.9,1.1))",
"particle_effect": {
"effect": "cobblemon:poodle_hair_particles",
"type": "particle"
}
}
},
"components": {
"minecraft:emitter_rate_steady": {
"spawn_rate": 64,
"max_particles": 64
},
"minecraft:emitter_lifetime_once": {
"active_time": 0.8
},
"minecraft:emitter_lifetime_events": {
"timeline": {
"0.10": "event_sound",
"0.30": "event_sound"
}
},
"minecraft:emitter_shape_point": {
"offset": [0, "math.random(-0.3,0.8)", 0],
"direction": ["math.random(-3,3)", "math.random(0,2)", "math.random(-3,3)"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 0.7
},
"minecraft:particle_initial_spin": {
"rotation": "math.random_integer(1,4) * 90"
},
"minecraft:particle_initial_speed": 7,
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, -5, 0],
"linear_drag_coefficient": 5
},
"minecraft:particle_appearance_billboard": {
"size": [0.4, 0.4],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 48,
"texture_height": 256,
"flipbook": {
"base_UV": ["math.floor(v.particle_random_2*3)*16", 0],
"size_UV": [16, 16],
"step_UV": [0, 16],
"frames_per_second": 24,
"max_frame": 16
}
}
},
"minecraft:particle_motion_collision": {
"collision_drag": 5,
"collision_radius": 0.1
},
"minecraft:particle_appearance_lighting": {},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.emitter_age",
"gradient": {
"0.0": "#FFFFFFFF",
"0.6": "#ffffffff",
"0.72": "#FF5C646D",
"1.0": "#FF5C646D"
}
}
}
}
}
}
@@ -1,82 +0,0 @@
{
"format_version": "1.10.0",
"particle_effect": {
"description": {
"identifier": "cobblemon:poodle_hair_green",
"basic_render_parameters": {
"material": "particles_blend",
"texture": "textures/particles/generic/cotton"
}
},
"events": {
"event_sound": {
"expression": "q.sound('minecraft:entity.sheep.shear', 1, math.random(0.9,1.1))",
"particle_effect": {
"effect": "cobblemon:poodle_hair_particles",
"type": "particle"
}
}
},
"components": {
"minecraft:emitter_rate_steady": {
"spawn_rate": 64,
"max_particles": 64
},
"minecraft:emitter_lifetime_once": {
"active_time": 0.8
},
"minecraft:emitter_lifetime_events": {
"timeline": {
"0.10": "event_sound",
"0.30": "event_sound"
}
},
"minecraft:emitter_shape_point": {
"offset": [0, "math.random(-0.3,0.8)", 0],
"direction": ["math.random(-3,3)", "math.random(0,2)", "math.random(-3,3)"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 0.7
},
"minecraft:particle_initial_spin": {
"rotation": "math.random_integer(1,4) * 90"
},
"minecraft:particle_initial_speed": 7,
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, -5, 0],
"linear_drag_coefficient": 5
},
"minecraft:particle_appearance_billboard": {
"size": [0.4, 0.4],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 48,
"texture_height": 256,
"flipbook": {
"base_UV": ["math.floor(v.particle_random_2*3)*16", 0],
"size_UV": [16, 16],
"step_UV": [0, 16],
"frames_per_second": 24,
"max_frame": 16
}
}
},
"minecraft:particle_motion_collision": {
"collision_drag": 5,
"collision_radius": 0.1
},
"minecraft:particle_appearance_lighting": {},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.emitter_age",
"gradient": {
"0.0": "#FFFFFFFF",
"0.6": "#ffffffff",
"0.72": "#FF366623",
"1.0": "#FF366623"
}
}
}
}
}
}
@@ -1,82 +0,0 @@
{
"format_version": "1.10.0",
"particle_effect": {
"description": {
"identifier": "cobblemon:poodle_hair_light_blue",
"basic_render_parameters": {
"material": "particles_blend",
"texture": "textures/particles/generic/cotton"
}
},
"events": {
"event_sound": {
"expression": "q.sound('minecraft:entity.sheep.shear', 1, math.random(0.9,1.1))",
"particle_effect": {
"effect": "cobblemon:poodle_hair_particles",
"type": "particle"
}
}
},
"components": {
"minecraft:emitter_rate_steady": {
"spawn_rate": 64,
"max_particles": 64
},
"minecraft:emitter_lifetime_once": {
"active_time": 0.8
},
"minecraft:emitter_lifetime_events": {
"timeline": {
"0.10": "event_sound",
"0.30": "event_sound"
}
},
"minecraft:emitter_shape_point": {
"offset": [0, "math.random(-0.3,0.8)", 0],
"direction": ["math.random(-3,3)", "math.random(0,2)", "math.random(-3,3)"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 0.7
},
"minecraft:particle_initial_spin": {
"rotation": "math.random_integer(1,4) * 90"
},
"minecraft:particle_initial_speed": 7,
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, -5, 0],
"linear_drag_coefficient": 5
},
"minecraft:particle_appearance_billboard": {
"size": [0.4, 0.4],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 48,
"texture_height": 256,
"flipbook": {
"base_UV": ["math.floor(v.particle_random_2*3)*16", 0],
"size_UV": [16, 16],
"step_UV": [0, 16],
"frames_per_second": 24,
"max_frame": 16
}
}
},
"minecraft:particle_motion_collision": {
"collision_drag": 5,
"collision_radius": 0.1
},
"minecraft:particle_appearance_lighting": {},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.emitter_age",
"gradient": {
"0.0": "#FFFFFFFF",
"0.6": "#ffffffff",
"0.72": "#FF95B8EC",
"1.0": "#FF95B8EC"
}
}
}
}
}
}
@@ -1,82 +0,0 @@
{
"format_version": "1.10.0",
"particle_effect": {
"description": {
"identifier": "cobblemon:poodle_hair_light_gray",
"basic_render_parameters": {
"material": "particles_blend",
"texture": "textures/particles/generic/cotton"
}
},
"events": {
"event_sound": {
"expression": "q.sound('minecraft:entity.sheep.shear', 1, math.random(0.9,1.1))",
"particle_effect": {
"effect": "cobblemon:poodle_hair_particles",
"type": "particle"
}
}
},
"components": {
"minecraft:emitter_rate_steady": {
"spawn_rate": 64,
"max_particles": 64
},
"minecraft:emitter_lifetime_once": {
"active_time": 0.8
},
"minecraft:emitter_lifetime_events": {
"timeline": {
"0.10": "event_sound",
"0.30": "event_sound"
}
},
"minecraft:emitter_shape_point": {
"offset": [0, "math.random(-0.3,0.8)", 0],
"direction": ["math.random(-3,3)", "math.random(0,2)", "math.random(-3,3)"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 0.7
},
"minecraft:particle_initial_spin": {
"rotation": "math.random_integer(1,4) * 90"
},
"minecraft:particle_initial_speed": 7,
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, -5, 0],
"linear_drag_coefficient": 5
},
"minecraft:particle_appearance_billboard": {
"size": [0.4, 0.4],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 48,
"texture_height": 256,
"flipbook": {
"base_UV": ["math.floor(v.particle_random_2*3)*16", 0],
"size_UV": [16, 16],
"step_UV": [0, 16],
"frames_per_second": 24,
"max_frame": 16
}
}
},
"minecraft:particle_motion_collision": {
"collision_drag": 5,
"collision_radius": 0.1
},
"minecraft:particle_appearance_lighting": {},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.emitter_age",
"gradient": {
"0.0": "#FFFFFFFF",
"0.6": "#ffffffff",
"0.72": "#FFB1B1BE",
"1.0": "#FFB1B1BE"
}
}
}
}
}
}
@@ -1,82 +0,0 @@
{
"format_version": "1.10.0",
"particle_effect": {
"description": {
"identifier": "cobblemon:poodle_hair_lime",
"basic_render_parameters": {
"material": "particles_blend",
"texture": "textures/particles/generic/cotton"
}
},
"events": {
"event_sound": {
"expression": "q.sound('minecraft:entity.sheep.shear', 1, math.random(0.9,1.1))",
"particle_effect": {
"effect": "cobblemon:poodle_hair_particles",
"type": "particle"
}
}
},
"components": {
"minecraft:emitter_rate_steady": {
"spawn_rate": 64,
"max_particles": 64
},
"minecraft:emitter_lifetime_once": {
"active_time": 0.8
},
"minecraft:emitter_lifetime_events": {
"timeline": {
"0.10": "event_sound",
"0.30": "event_sound"
}
},
"minecraft:emitter_shape_point": {
"offset": [0, "math.random(-0.3,0.8)", 0],
"direction": ["math.random(-3,3)", "math.random(0,2)", "math.random(-3,3)"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 0.7
},
"minecraft:particle_initial_spin": {
"rotation": "math.random_integer(1,4) * 90"
},
"minecraft:particle_initial_speed": 7,
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, -5, 0],
"linear_drag_coefficient": 5
},
"minecraft:particle_appearance_billboard": {
"size": [0.4, 0.4],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 48,
"texture_height": 256,
"flipbook": {
"base_UV": ["math.floor(v.particle_random_2*3)*16", 0],
"size_UV": [16, 16],
"step_UV": [0, 16],
"frames_per_second": 24,
"max_frame": 16
}
}
},
"minecraft:particle_motion_collision": {
"collision_drag": 5,
"collision_radius": 0.1
},
"minecraft:particle_appearance_lighting": {},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.emitter_age",
"gradient": {
"0.0": "#FFFFFFFF",
"0.6": "#ffffffff",
"0.72": "#FFB7FF42",
"1.0": "#FFB7FF42"
}
}
}
}
}
}
@@ -1,82 +0,0 @@
{
"format_version": "1.10.0",
"particle_effect": {
"description": {
"identifier": "cobblemon:poodle_hair_magenta",
"basic_render_parameters": {
"material": "particles_blend",
"texture": "textures/particles/generic/cotton"
}
},
"events": {
"event_sound": {
"expression": "q.sound('minecraft:entity.sheep.shear', 1, math.random(0.9,1.1))",
"particle_effect": {
"effect": "cobblemon:poodle_hair_particles",
"type": "particle"
}
}
},
"components": {
"minecraft:emitter_rate_steady": {
"spawn_rate": 64,
"max_particles": 64
},
"minecraft:emitter_lifetime_once": {
"active_time": 0.8
},
"minecraft:emitter_lifetime_events": {
"timeline": {
"0.10": "event_sound",
"0.30": "event_sound"
}
},
"minecraft:emitter_shape_point": {
"offset": [0, "math.random(-0.3,0.8)", 0],
"direction": ["math.random(-3,3)", "math.random(0,2)", "math.random(-3,3)"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 0.7
},
"minecraft:particle_initial_spin": {
"rotation": "math.random_integer(1,4) * 90"
},
"minecraft:particle_initial_speed": 7,
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, -5, 0],
"linear_drag_coefficient": 5
},
"minecraft:particle_appearance_billboard": {
"size": [0.4, 0.4],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 48,
"texture_height": 256,
"flipbook": {
"base_UV": ["math.floor(v.particle_random_2*3)*16", 0],
"size_UV": [16, 16],
"step_UV": [0, 16],
"frames_per_second": 24,
"max_frame": 16
}
}
},
"minecraft:particle_motion_collision": {
"collision_drag": 5,
"collision_radius": 0.1
},
"minecraft:particle_appearance_lighting": {},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.emitter_age",
"gradient": {
"0.0": "#FFFFFFFF",
"0.6": "#ffffffff",
"0.72": "#FFFDA6D5",
"1.0": "#FFFDA6D5"
}
}
}
}
}
}
@@ -1,82 +0,0 @@
{
"format_version": "1.10.0",
"particle_effect": {
"description": {
"identifier": "cobblemon:poodle_hair_orange",
"basic_render_parameters": {
"material": "particles_blend",
"texture": "textures/particles/generic/cotton"
}
},
"events": {
"event_sound": {
"expression": "q.sound('minecraft:entity.sheep.shear', 1, math.random(0.9,1.1))",
"particle_effect": {
"effect": "cobblemon:poodle_hair_particles",
"type": "particle"
}
}
},
"components": {
"minecraft:emitter_rate_steady": {
"spawn_rate": 64,
"max_particles": 64
},
"minecraft:emitter_lifetime_once": {
"active_time": 0.8
},
"minecraft:emitter_lifetime_events": {
"timeline": {
"0.10": "event_sound",
"0.30": "event_sound"
}
},
"minecraft:emitter_shape_point": {
"offset": [0, "math.random(-0.3,0.8)", 0],
"direction": ["math.random(-3,3)", "math.random(0,2)", "math.random(-3,3)"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 0.7
},
"minecraft:particle_initial_spin": {
"rotation": "math.random_integer(1,4) * 90"
},
"minecraft:particle_initial_speed": 7,
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, -5, 0],
"linear_drag_coefficient": 5
},
"minecraft:particle_appearance_billboard": {
"size": [0.4, 0.4],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 48,
"texture_height": 256,
"flipbook": {
"base_UV": ["math.floor(v.particle_random_2*3)*16", 0],
"size_UV": [16, 16],
"step_UV": [0, 16],
"frames_per_second": 24,
"max_frame": 16
}
}
},
"minecraft:particle_motion_collision": {
"collision_drag": 5,
"collision_radius": 0.1
},
"minecraft:particle_appearance_lighting": {},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.emitter_age",
"gradient": {
"0.0": "#FFFFFFFF",
"0.6": "#ffffffff",
"0.72": "#FFF6AE46",
"1.0": "#FFF6AE46"
}
}
}
}
}
}
@@ -1,47 +0,0 @@
{
"format_version": "1.10.0",
"particle_effect": {
"description": {
"identifier": "cobblemon:poodle_hair_particles",
"basic_render_parameters": {
"material": "particles_blend",
"texture": "textures/particles/generic/confetti"
}
},
"components": {
"minecraft:emitter_rate_steady": {
"spawn_rate": 12,
"max_particles": 100
},
"minecraft:emitter_lifetime_once": {
"active_time": 0.5
},
"minecraft:emitter_shape_sphere": {
"radius": 0.4,
"direction": ["math.random(-3,3)", "math.random(0,3)", "math.random(-3,3)"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 1
},
"minecraft:particle_initial_speed": 9,
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, -12, 0],
"linear_drag_coefficient": 4
},
"minecraft:particle_appearance_billboard": {
"size": [0.05, 0.05],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 16,
"texture_height": 16,
"uv": [0, 0],
"uv_size": [16, 16]
}
},
"minecraft:particle_motion_collision": {
"collision_drag": 5,
"collision_radius": 0.01
}
}
}
}
@@ -1,82 +0,0 @@
{
"format_version": "1.10.0",
"particle_effect": {
"description": {
"identifier": "cobblemon:poodle_hair_pink",
"basic_render_parameters": {
"material": "particles_blend",
"texture": "textures/particles/generic/cotton"
}
},
"events": {
"event_sound": {
"expression": "q.sound('minecraft:entity.sheep.shear', 1, math.random(0.9,1.1))",
"particle_effect": {
"effect": "cobblemon:poodle_hair_particles",
"type": "particle"
}
}
},
"components": {
"minecraft:emitter_rate_steady": {
"spawn_rate": 64,
"max_particles": 64
},
"minecraft:emitter_lifetime_once": {
"active_time": 0.8
},
"minecraft:emitter_lifetime_events": {
"timeline": {
"0.10": "event_sound",
"0.30": "event_sound"
}
},
"minecraft:emitter_shape_point": {
"offset": [0, "math.random(-0.3,0.8)", 0],
"direction": ["math.random(-3,3)", "math.random(0,2)", "math.random(-3,3)"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 0.7
},
"minecraft:particle_initial_spin": {
"rotation": "math.random_integer(1,4) * 90"
},
"minecraft:particle_initial_speed": 7,
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, -5, 0],
"linear_drag_coefficient": 5
},
"minecraft:particle_appearance_billboard": {
"size": [0.4, 0.4],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 48,
"texture_height": 256,
"flipbook": {
"base_UV": ["math.floor(v.particle_random_2*3)*16", 0],
"size_UV": [16, 16],
"step_UV": [0, 16],
"frames_per_second": 24,
"max_frame": 16
}
}
},
"minecraft:particle_motion_collision": {
"collision_drag": 5,
"collision_radius": 0.1
},
"minecraft:particle_appearance_lighting": {},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.emitter_age",
"gradient": {
"0.0": "#FFFFFFFF",
"0.6": "#ffffffff",
"0.72": "#FFCE69CC",
"1.0": "#FFCE69CC"
}
}
}
}
}
}
@@ -1,82 +0,0 @@
{
"format_version": "1.10.0",
"particle_effect": {
"description": {
"identifier": "cobblemon:poodle_hair_purple",
"basic_render_parameters": {
"material": "particles_blend",
"texture": "textures/particles/generic/cotton"
}
},
"events": {
"event_sound": {
"expression": "q.sound('minecraft:entity.sheep.shear', 1, math.random(0.9,1.1))",
"particle_effect": {
"effect": "cobblemon:poodle_hair_particles",
"type": "particle"
}
}
},
"components": {
"minecraft:emitter_rate_steady": {
"spawn_rate": 64,
"max_particles": 64
},
"minecraft:emitter_lifetime_once": {
"active_time": 0.8
},
"minecraft:emitter_lifetime_events": {
"timeline": {
"0.10": "event_sound",
"0.30": "event_sound"
}
},
"minecraft:emitter_shape_point": {
"offset": [0, "math.random(-0.3,0.8)", 0],
"direction": ["math.random(-3,3)", "math.random(0,2)", "math.random(-3,3)"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 0.7
},
"minecraft:particle_initial_spin": {
"rotation": "math.random_integer(1,4) * 90"
},
"minecraft:particle_initial_speed": 7,
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, -5, 0],
"linear_drag_coefficient": 5
},
"minecraft:particle_appearance_billboard": {
"size": [0.4, 0.4],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 48,
"texture_height": 256,
"flipbook": {
"base_UV": ["math.floor(v.particle_random_2*3)*16", 0],
"size_UV": [16, 16],
"step_UV": [0, 16],
"frames_per_second": 24,
"max_frame": 16
}
}
},
"minecraft:particle_motion_collision": {
"collision_drag": 5,
"collision_radius": 0.1
},
"minecraft:particle_appearance_lighting": {},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.emitter_age",
"gradient": {
"0.0": "#FFFFFFFF",
"0.6": "#ffffffff",
"0.72": "#FF925AC4",
"1.0": "#FF925AC4"
}
}
}
}
}
}
@@ -1,82 +0,0 @@
{
"format_version": "1.10.0",
"particle_effect": {
"description": {
"identifier": "cobblemon:poodle_hair_red",
"basic_render_parameters": {
"material": "particles_blend",
"texture": "textures/particles/generic/cotton"
}
},
"events": {
"event_sound": {
"expression": "q.sound('minecraft:entity.sheep.shear', 1, math.random(0.9,1.1))",
"particle_effect": {
"effect": "cobblemon:poodle_hair_particles",
"type": "particle"
}
}
},
"components": {
"minecraft:emitter_rate_steady": {
"spawn_rate": 64,
"max_particles": 64
},
"minecraft:emitter_lifetime_once": {
"active_time": 0.8
},
"minecraft:emitter_lifetime_events": {
"timeline": {
"0.10": "event_sound",
"0.30": "event_sound"
}
},
"minecraft:emitter_shape_point": {
"offset": [0, "math.random(-0.3,0.8)", 0],
"direction": ["math.random(-3,3)", "math.random(0,2)", "math.random(-3,3)"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 0.7
},
"minecraft:particle_initial_spin": {
"rotation": "math.random_integer(1,4) * 90"
},
"minecraft:particle_initial_speed": 7,
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, -5, 0],
"linear_drag_coefficient": 5
},
"minecraft:particle_appearance_billboard": {
"size": [0.4, 0.4],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 48,
"texture_height": 256,
"flipbook": {
"base_UV": ["math.floor(v.particle_random_2*3)*16", 0],
"size_UV": [16, 16],
"step_UV": [0, 16],
"frames_per_second": 24,
"max_frame": 16
}
}
},
"minecraft:particle_motion_collision": {
"collision_drag": 5,
"collision_radius": 0.1
},
"minecraft:particle_appearance_lighting": {},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.emitter_age",
"gradient": {
"0.0": "#FFFFFFFF",
"0.6": "#ffffffff",
"0.72": "#FFDB4C4C",
"1.0": "#FFDB4C4C"
}
}
}
}
}
}
@@ -1,70 +0,0 @@
{
"format_version": "1.10.0",
"particle_effect": {
"description": {
"identifier": "cobblemon:poodle_hair_white",
"basic_render_parameters": {
"material": "particles_blend",
"texture": "textures/particles/generic/cotton"
}
},
"events": {
"event_sound": {
"expression": "q.sound('minecraft:entity.sheep.shear', 1, math.random(0.9,1.1))",
"particle_effect": {
"effect": "cobblemon:poodle_hair_particles",
"type": "particle"
}
}
},
"components": {
"minecraft:emitter_rate_steady": {
"spawn_rate": 64,
"max_particles": 64
},
"minecraft:emitter_lifetime_once": {
"active_time": 0.8
},
"minecraft:emitter_lifetime_events": {
"timeline": {
"0.10": "event_sound",
"0.30": "event_sound"
}
},
"minecraft:emitter_shape_point": {
"offset": [0, "math.random(-0.3,0.8)", 0],
"direction": ["math.random(-3,3)", "math.random(0,2)", "math.random(-3,3)"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 0.7
},
"minecraft:particle_initial_spin": {
"rotation": "math.random_integer(1,4) * 90"
},
"minecraft:particle_initial_speed": 7,
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, -5, 0],
"linear_drag_coefficient": 5
},
"minecraft:particle_appearance_billboard": {
"size": [0.4, 0.4],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 48,
"texture_height": 256,
"flipbook": {
"base_UV": ["math.floor(v.particle_random_2*3)*16", 0],
"size_UV": [16, 16],
"step_UV": [0, 16],
"frames_per_second": 24,
"max_frame": 16
}
}
},
"minecraft:particle_motion_collision": {
"collision_drag": 5,
"collision_radius": 0.1
}
}
}
}
@@ -1,82 +0,0 @@
{
"format_version": "1.10.0",
"particle_effect": {
"description": {
"identifier": "cobblemon:poodle_hair_yellow",
"basic_render_parameters": {
"material": "particles_blend",
"texture": "textures/particles/generic/cotton"
}
},
"events": {
"event_sound": {
"expression": "q.sound('minecraft:entity.sheep.shear', 1, math.random(0.9,1.1))",
"particle_effect": {
"effect": "cobblemon:poodle_hair_particles",
"type": "particle"
}
}
},
"components": {
"minecraft:emitter_rate_steady": {
"spawn_rate": 64,
"max_particles": 64
},
"minecraft:emitter_lifetime_once": {
"active_time": 0.8
},
"minecraft:emitter_lifetime_events": {
"timeline": {
"0.10": "event_sound",
"0.30": "event_sound"
}
},
"minecraft:emitter_shape_point": {
"offset": [0, "math.random(-0.3,0.8)", 0],
"direction": ["math.random(-3,3)", "math.random(0,2)", "math.random(-3,3)"]
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": 0.7
},
"minecraft:particle_initial_spin": {
"rotation": "math.random_integer(1,4) * 90"
},
"minecraft:particle_initial_speed": 7,
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [0, -5, 0],
"linear_drag_coefficient": 5
},
"minecraft:particle_appearance_billboard": {
"size": [0.4, 0.4],
"facing_camera_mode": "rotate_xyz",
"uv": {
"texture_width": 48,
"texture_height": 256,
"flipbook": {
"base_UV": ["math.floor(v.particle_random_2*3)*16", 0],
"size_UV": [16, 16],
"step_UV": [0, 16],
"frames_per_second": 24,
"max_frame": 16
}
}
},
"minecraft:particle_motion_collision": {
"collision_drag": 5,
"collision_radius": 0.1
},
"minecraft:particle_appearance_lighting": {},
"minecraft:particle_appearance_tinting": {
"color": {
"interpolant": "v.emitter_age",
"gradient": {
"0.0": "#FFFFFFFF",
"0.6": "#ffffffff",
"0.72": "#FFE7DB4D",
"1.0": "#FFE7DB4D"
}
}
}
}
}
}
@@ -12,22 +12,31 @@
"rotation": [15, 15, 30]
},
"tail2": {
"rotation": [35, 0, 0]
"rotation": [45, 0, 0]
},
"tail3": {
"rotation": [30, 0, 0]
"rotation": [45, 0, 0]
},
"tail4": {
"rotation": [25, 0, 0]
"rotation": [-55, 0, 0]
},
"tail": {
"leg_left": {
"rotation": [15, 0, 0]
},
"foot_left": {
"rotation": [15, 0, 0]
},
"tail": {
"rotation": [17.5, 0, 0]
},
"tail5": {
"rotation": [-35, 0, 0]
"rotation": [-52.5, 0, 0]
},
"tail6": {
"rotation": [-35, 0, 0]
"rotation": [-60, 0, 0]
},
"tail7": {
"rotation": [-37.5, 0, 0]
},
"leg_right": {
"rotation": [15, 0, 0]
@@ -40,30 +49,6 @@
},
"arm_right": {
"rotation": [15, -15, -30]
},
"tail7": {
"rotation": [-35, 0, 0]
},
"tail8": {
"rotation": [-35, 0, 0]
},
"tail9": {
"rotation": [-40, 0, 0]
},
"tail10": {
"rotation": [-30, 0, 0]
},
"tail11": {
"rotation": [10, 0, 0]
},
"leg_left": {
"rotation": [15, 0, 0]
},
"foot_left": {
"rotation": [15, 0, 0]
},
"locator_item": {
"position": [0, "math.sin(q.anim_time*90*0.5)*0.2", 0]
}
}
},
@@ -89,12 +74,21 @@
"tail4": {
"rotation": [-10, 0, 0]
},
"leg_left": {
"rotation": [15, 0, 0]
},
"foot_left": {
"rotation": [30, 0, 0]
},
"tail5": {
"rotation": [-20, 0, 0]
},
"tail6": {
"rotation": [-17.5, 0, 0]
},
"tail7": {
"rotation": [-15, 0, 0]
},
"leg_right": {
"rotation": [15, 0, 0]
},
@@ -106,227 +100,25 @@
},
"arm_right": {
"rotation": [15, 0, -30]
},
"tail7": {
"rotation": [-15, 0, 0]
},
"leg_left": {
"rotation": [15, 0, 0]
},
"foot_left": {
"rotation": [30, 0, 0]
},
"tail8": {
"rotation": [10, 0, 0]
},
"tail9": {
"rotation": [15, 0, 0]
},
"tail10": {
"rotation": [5, 0, 0]
},
"tail11": {
"rotation": [10, 0, 0]
},
"locator_item": {
"position": [0, "math.sin(q.anim_time*90*0.5)*0.2", 0]
}
}
},
"animation.mew.blink": {
"animation_length": 0.1667,
"animation_length": 0.16667,
"bones": {
"eyelid_left": {
"position": {
"0.0": [0.1, 0, -0.1],
"0.1667": {"pre": [0.1, 0, -0.1], "post": [0, 0, 0]}
"0.125": [0.1, 0, -0.1],
"0.1667": [0, 0, 0]
}
},
"eyelid_right": {
"position": {
"0.0": [-0.1, 0, -0.1],
"0.1667": {"pre": [-0.1, 0, -0.1], "post": [0, 0, 0]}
"0.125": [-0.1, 0, -0.1],
"0.1667": [0, 0, 0]
}
},
"eye_left": {
"position": {
"0.0": [-0.1, 0, 0.1],
"0.1667": {"pre": [-0.1, 0, 0.1], "post": [0, 0, 0]}
}
},
"eye_right": {
"position": {
"0.0": [0.1, 0, 0.1],
"0.1667": {"pre": [0.1, 0, 0.1], "post": [0, 0, 0]}
}
}
}
},
"animation.mew.pose": {
"loop": true,
"bones": {
"body": {
"rotation": [15, -35, 0],
"position": [0, 5, 0]
},
"arm_left": {
"rotation": [-8.6, 39.5, 33.5]
},
"tail2": {
"rotation": [18.5, -22, -4]
},
"tail3": {
"rotation": [32, -19.5, -11.5]
},
"tail4": {
"rotation": [45.5, -12.5, -6.5]
},
"tail": {
"rotation": [-65.5, -7, 10.5]
},
"tail5": {
"rotation": [35.5, 7, 7]
},
"tail6": {
"rotation": [20.5, 8, 6]
},
"tail11": {
"rotation": [27.5, 17.5, 0]
},
"leg_right": {
"rotation": [35.2, 24.5, 27.75]
},
"foot_right": {
"rotation": [7.5, 1.5, -9.5]
},
"head": {
"rotation": [-55, 66.7, -57]
},
"torso": {
"rotation": [25, 0, 0]
},
"torso2": {
"rotation": [-17.5, 0.85, 4.95]
},
"arm_left2": {
"rotation": [0, 0, 15]
},
"arm_right": {
"rotation": [-25.5, -31.8, -27.6]
},
"arm_right2": {
"rotation": [0, 0, -17.5]
},
"torso3": {
"rotation": [-15, -1.3, -7.4]
},
"foot_right2": {
"rotation": [10, 0, 0]
},
"leg_right2": {
"rotation": [14.6, 12.5, 9.25]
},
"leg_left": {
"rotation": [24.5, -18.5, -32.5]
},
"leg_left2": {
"rotation": [25.75, 10.25, 11.7]
},
"foot_left": {
"rotation": [15, 2.5, 0.65]
},
"foot_left2": {
"rotation": [7.5, 0, 0]
},
"tail9": {
"rotation": [35.5, 8.5, 9.5]
},
"tail8": {
"rotation": [35.5, 7.5, 7]
},
"tail7": {
"rotation": [30, 3.5, 3.5]
},
"tail10": {
"rotation": [31.5, 11.5, 13]
}
}
},
"animation.mew.angry": {
"loop": true,
"bones": {
"eyelid_angry_left": {
"position": [0, 0, -0.1]
},
"eyelid_angry_right": {
"position": [0, 0, -0.1]
},
"mouth_open": {
"position": [0, -0.1, 0]
}
}
},
"animation.mew.annoyed": {
"loop": true,
"bones": {
"eyelid_annoyed_left": {
"position": [0.1, 0, -0.1]
},
"eyelid_annoyed_right": {
"position": [-0.1, 0, -0.1]
}
}
},
"animation.mew.sad": {
"loop": true,
"bones": {
"eyelid_sad_left": {
"position": [0.1, 0, -0.1]
},
"eyelid_sad_right": {
"position": [-0.1, 0, -0.1]
},
"eyeshine_left": {
"position": [-0.25, 0, 0],
"scale": 1.1
},
"eyeshine_right": {
"position": [0.25, 0, 0],
"scale": 1.1
}
}
},
"animation.mew.happy": {
"loop": true,
"bones": {
"eyelid_happy_left": {
"position": [0.1, 0, -0.1]
},
"eyelid_happy_right": {
"position": [-0.1, 0, -0.1]
},
"eye_left": {
"position": [-0.1, 0, 0.1]
},
"eye_right": {
"position": [0.1, 0, 0.1]
}
}
},
"animation.mew.hurt": {
"loop": true,
"bones": {
"eye_left": {
"position": [-0.1, 0, 0.1]
},
"eyelid_hurt_left": {
"position": [0.1, 0, -0.1]
},
"eye_right": {
"position": [0.1, 0, 0.1]
},
"eyelid_hurt_right": {
"position": [-0.1, 0, -0.1]
}
}
}
@@ -630,27 +630,6 @@
},
"shoulder_tuft_right5": {
"rotation": [0, "math.sin(q.anim_time*90*8/3-90)*12", 0]
},
"locator_seat_1": {
"rotation": [-20, 0, 0],
"position": [0, -1.75, 0]
}
}
},
"animation.ursaring.ride_ground_walk": {
"loop": true,
"bones": {
"torso": {
"rotation": [0, "q.r.yaw_change(0)*10", 0]
},
"waist": {
"rotation": [0, "q.r.yaw_change(0)*10", 0]
},
"chest": {
"rotation": [0, "q.r.yaw_change(0)*10", 0]
},
"head": {
"rotation": [0, "q.r.yaw_change(0)*20", 0]
}
}
},
@@ -1129,152 +1108,6 @@
"lerp_mode": "catmullrom"
}
}
},
"locator_seat_1": {
"rotation": [-45, 0, 0],
"position": [0, -3, 0]
}
}
},
"animation.ursaring.ride_ground_run": {
"loop": true,
"bones": {
"torso": {
"rotation": [0, "q.r.yaw_change(0)*10", 0]
},
"waist": {
"rotation": [0, "q.r.yaw_change(0)*10", 0]
},
"chest": {
"rotation": [0, "q.r.yaw_change(0)*10", 0]
},
"head": {
"rotation": [0, "q.r.yaw_change(0)*10", "q.r.yaw_change(0)*-10"]
}
}
},
"animation.ursaring.ride_jump": {
"loop": true,
"bones": {
"torso": {
"rotation": ["q.r.velocity_y(0)*10+math.sin(q.anim_time*90*12-90)*-1", 0, 0]
},
"waist": {
"rotation": ["q.r.velocity_y(0)*-10", 0, 0]
},
"chest": {
"rotation": ["q.r.velocity_y(0)*-10+math.sin(q.anim_time*90*12-90)*2", 0, 0]
},
"head": {
"rotation": ["q.r.velocity_y(0)*-10", 0, 0]
},
"ear_right": {
"rotation": [-20, 0, "-(math.sin(q.anim_time*90*20))"]
},
"ear_left": {
"rotation": [-20, 0, "math.sin(q.anim_time*90*20)"]
},
"shoulder_tufts_left": {
"rotation": [0, 0, "q.r.velocity_y(0)*20"]
},
"shoulder_tuft_left1": {
"rotation": [0, 0, "math.sin(q.anim_time*90*20-90)"]
},
"shoulder_tuft_left2": {
"rotation": [0, 0, "math.sin(q.anim_time*90*20-120)"]
},
"shoulder_tuft_left3": {
"rotation": [0, 0, "math.sin(q.anim_time*90*20-150)"]
},
"shoulder_tuft_left4": {
"rotation": [0, 0, "math.sin(q.anim_time*90*20-180)"]
},
"shoulder_tuft_left5": {
"rotation": [0, 0, "math.sin(q.anim_time*90*20-210)"]
},
"shoulder_left": {
"rotation": [0, "q.r.velocity_y(0)*-20", "20+q.r.velocity_y(0)*30+math.sin(q.anim_time*90*20)"]
},
"arm_left2": {
"rotation": [0, "32.5+math.sin(q.anim_time*90*20-90)*1.5", 0]
},
"hand_left": {
"rotation": [0, 0, 12.5]
},
"thumb_left": {
"rotation": [37.5, 0, 0]
},
"finger_left1": {
"rotation": [0, 0, 20]
},
"finger_left2": {
"rotation": [0, 0, 12.5]
},
"finger_left3": {
"rotation": [0, 0, 7.5]
},
"shoulder_tufts_right": {
"rotation": [0, 0, "-(q.r.velocity_y(0)*20)"]
},
"shoulder_tuft_right1": {
"rotation": [0, 0, "-(math.sin(q.anim_time*90*20-90))"]
},
"shoulder_tuft_right2": {
"rotation": [0, 0, "-(math.sin(q.anim_time*90*20-120))"]
},
"shoulder_tuft_right3": {
"rotation": [0, 0, "-(math.sin(q.anim_time*90*20-150))"]
},
"shoulder_tuft_right4": {
"rotation": [0, 0, "-(math.sin(q.anim_time*90*20-180))"]
},
"shoulder_tuft_right5": {
"rotation": [0, 0, "-(math.sin(q.anim_time*90*20-210))"]
},
"shoulder_right": {
"rotation": [0, "q.r.velocity_y(0)*20", "-20+q.r.velocity_y(0)*-30-math.sin(q.anim_time*90*20)"]
},
"arm_right2": {
"rotation": [0, "-32.5-math.sin(q.anim_time*90*20-90)*1.5", 0]
},
"hand_right": {
"rotation": [0, 0, -12.5]
},
"thumb_right": {
"rotation": [37.5, 0, 0]
},
"finger_right1": {
"rotation": [0, 0, -20]
},
"finger_right2": {
"rotation": [0, 0, -12.5]
},
"finger_right3": {
"rotation": [0, 0, -7.5]
},
"tail": {
"rotation": ["q.r.velocity_y(0)*-20+math.sin(q.anim_time*90*20)*2", 0, 0]
},
"leg_left": {
"rotation": ["-10+q.r.velocity_y(0)*20+math.sin(q.anim_time*90*20)", -17.5, 0]
},
"knee_left": {
"rotation": ["math.clamp((q.r.velocity_y(0)*32.5),0,32.5)+math.sin(q.anim_time*90*20-90)", 0, 0]
},
"foot_left": {
"rotation": [12.5, 0, 0]
},
"leg_right": {
"rotation": ["-42.5+q.r.velocity_y(0)*20+math.sin(q.anim_time*90*20)", 12.5, 0]
},
"knee_right": {
"rotation": ["math.clamp((q.r.velocity_y(0)*32.5),0,32.5)+math.sin(q.anim_time*90*20-90)", 0, 0]
},
"foot_right": {
"rotation": [12.5, 0, 0]
},
"body": {
"position": [0, "0+math.sin(q.anim_time*90*12)*0.2", 0]
}
}
},
@@ -1,78 +1,29 @@
{
"format_version": "1.8.0",
"animations": {
"animation.seedot.ground_idle": {
"loop": true,
"bones": {
"foot_left": {
"rotation": [0, -10, 0]
},
"foot_right": {
"rotation": [0, 10, 0]
}
}
},
"animation.seedot.sleep": {
"loop": true,
"bones": {
"torso": {
"rotation": [15, 0, 0],
"position": [0, -0.5, 0]
},
"pupil_right": {
"position": [0, 0, 0.1]
},
"pupil_left": {
"position": [0, 0, 0.1]
},
"eyelid_right": {
"position": [-0.1, 0, -0.1]
},
"eyelid_left": {
"position": [0.1, 0, -0.1]
},
"foot_left": {
"rotation": [0, -22.5, 0]
},
"foot_right": {
"rotation": [0, 22.5, 0]
}
}
"animation.seedot.idle": {
"loop": true
},
"animation.seedot.blink": {
"animation_length": 0.1667,
"animation_length": 0.16667,
"bones": {
"pupil_right": {
"eyelid_right": {
"position": {
"0.0": [0, 0, 0.1],
"0.125": {"pre": [0, 0, 0.1], "post": [0, 0, 0.1]},
"0.1667": {"pre": [0, 0, 0.1], "post": [0, 0, 0]}
}
},
"pupil_left": {
"position": {
"0.0": [0, 0, 0.1],
"0.125": {"pre": [0, 0, 0.1], "post": [0, 0, 0.1]},
"0.1667": {"pre": [0, 0, 0.1], "post": [0, 0, 0]}
"0.0": [0, 0, -0.1],
"0.125": [0, 0, -0.1],
"0.1667": [0, 0, 0]
}
},
"eyelid_left": {
"position": {
"0.0": [0.1, 0, -0.1],
"0.125": {"pre": [0.1, 0, -0.1], "post": [0.1, 0, -0.1]},
"0.1667": {"pre": [0.1, 0, -0.1], "post": [0, 0, 0]}
}
},
"eyelid_right": {
"position": {
"0.0": [-0.1, 0, -0.1],
"0.125": {"pre": [-0.1, 0, -0.1], "post": [-0.1, 0, -0.1]},
"0.1667": {"pre": [-0.1, 0, -0.1], "post": [0, 0, 0]}
"0.0": [0, 0, -0.1],
"0.125": [0, 0, -0.1],
"0.1667": [0, 0, 0]
}
}
}
},
"animation.seedot.cry": {
"animation.seedot.call": {
"animation_length": 1.5,
"bones": {
"torso": {
@@ -84,98 +35,6 @@
}
}
}
},
"animation.seedot.happy": {
"loop": true,
"bones": {
"pupil_right": {
"position": [0, -0.4, 0],
"scale": [2.2, 1.2, 1]
},
"pupil_left": {
"position": [0, -0.4, 0],
"scale": [2.2, 1.2, 1]
}
}
},
"animation.seedot.hurt": {
"loop": true,
"bones": {
"pupil_right": {
"position": [0, 0, 0.1]
},
"pupil_left": {
"position": [0, 0, 0.1]
},
"eyelid_left": {
"position": [0.1, 0, -0.1]
},
"eyelid_emote_middle_left": {
"position": [0, 0.5, 0]
},
"eyelid_emote_outer_left": {
"position": [0, 0.5, 0]
},
"eyelid_right": {
"position": [-0.1, 0, -0.1]
},
"eyelid_emote_middle_right": {
"position": [0, 0.5, 0]
},
"eyelid_emote_outer_right": {
"position": [0, 0.5, 0]
}
}
},
"animation.seedot.judgy": {
"loop": true,
"bones": {
"eyelid_emote_inner_left": {
"position": [0.1, 1.7, -0.1]
},
"eyelid_emote_middle_left": {
"position": [0.1, 1.7, -0.1]
},
"eyelid_emote_outer_left": {
"position": [0.1, 1.7, -0.1]
},
"eyelid_emote_inner_right": {
"position": [-0.1, 1.7, -0.1]
},
"eyelid_emote_middle_right": {
"position": [-0.1, 1.7, -0.1]
},
"eyelid_emote_outer_right": {
"position": [-0.1, 1.7, -0.1]
}
}
},
"animation.seedot.new": {
"loop": true,
"bones": {
"torso": {
"rotation": [15, 0, 0],
"position": [0, -0.5, 0]
},
"pupil_right": {
"position": [0, 0, 0.1]
},
"pupil_left": {
"position": [0, 0, 0.1]
},
"eyelid_right": {
"position": [-0.1, 0, -0.1]
},
"eyelid_left": {
"position": [0.1, 0, -0.1]
},
"foot_left": {
"rotation": [0, -22.5, 0]
},
"foot_right": {
"rotation": [0, 22.5, 0]
}
}
}
}
}
@@ -1,326 +1,60 @@
{
"format_version": "1.8.0",
"animations": {
"animation.shiftry.ground_idle": {
"animation.shiftry.idle": {
"loop": true,
"bones": {
"hair3": {
"rotation": [10, 0, 0]
},
"hair4": {
"rotation": [5, 0, 0]
},
"hair5": {
"rotation": [70, 0, 0]
},
"hair6": {
"rotation": [5, 0, 0]
"arm_left": {
"rotation": [0, 0, 40]
},
"arm_right": {
"rotation": [5, 0, -15]
},
"arm_left": {
"rotation": [5, 0, 15]
},
"leg_right": {
"rotation": [0, 10, 0]
"rotation": [0, 0, -40]
},
"leg_left": {
"rotation": [0, -10, 0]
}
}
},
"animation.shiftry.sleep": {
"loop": true,
"bones": {
"hair3": {
"rotation": [10, 0, 0]
"rotation": [0, -15, 0]
},
"hair4": {
"rotation": [-7.5, 0, 0]
},
"hair5": {
"rotation": [67.5, 0, 0]
},
"hair6": {
"rotation": [5, 0, 0]
},
"arm_right": {
"rotation": [0, -12.5, -20]
},
"arm_left": {
"rotation": [0, 12.5, 20]
},
"torso": {
"rotation": [10, 0, 0]
},
"iris_right": {
"position": [0, 0, 0.1]
},
"eyelid_right": {
"position": [0, 0, -0.1]
},
"iris_left": {
"position": [0, 0, 0.1]
},
"eyelid_left": {
"position": [0, 0, -0.1]
}
}
},
"animation.shiftry.mouth_open_example": {
"animation_length": 1,
"bones": {
"mouth_closed": {
"scale": {
"0.0": [1, 1, 1],
"0.1667": [1, 1, 1],
"0.2083": [0, 0, 0],
"0.7917": [0, 0, 0],
"0.8333": [1, 1, 1],
"1.0": [1, 1, 1]
}
}
}
},
"animation.shiftry.happy": {
"loop": true,
"bones": {
"mouth_closed": {
"scale": 0
},
"iris_right": {
"position": [0, 0, 0.1]
},
"eyelid_right": {
"position": [0, 0.2, -0.1]
},
"eyelid_inner_right": {
"position": [0, -0.2, 0]
},
"eyelid_middle_right": {
"position": [0, 0.5, 0]
},
"eyelid_outer_right": {
"position": [0, -0.2, 0]
},
"iris_left": {
"position": [0, 0, 0.1]
},
"eyelid_left": {
"position": [0, 0.2, -0.1]
},
"eyelid_inner_left": {
"position": [0, -0.2, 0]
},
"eyelid_middle_left": {
"position": [0, 0.5, 0]
},
"eyelid_outer_left": {
"position": [0, -0.2, 0]
},
"iris_cover": {
"position": [0, 0, 0.1]
},
"eye_emote_left": {
"position": [0.3, 0, 0],
"scale": [0.8, 1, 1]
},
"eye_emote_right": {
"position": [-0.3, 0, 0],
"scale": [0.8, 1, 1]
}
}
},
"animation.shiftry.sad": {
"loop": true,
"bones": {
"iris_emote_left": {
"position": [0, 0, 0.1]
},
"iris_emote_right": {
"position": [0, 0, 0.1]
},
"eye_emote_right": {
"position": [-0.625, 0, 0],
"scale": [0.58, 1, 1]
},
"eye_emote_left": {
"position": [0.625, 0, 0],
"scale": [0.58, 1, 1]
}
}
},
"animation.shiftry.hurt": {
"loop": true,
"bones": {
"iris_right": {
"position": [0, 0, 0.1]
},
"eyelid_right": {
"position": [0, 0, -0.1]
},
"eyelid_middle_right": {
"position": [0, 0.5, 0]
},
"eyelid_outer_right": {
"position": [0, 0.5, 0]
},
"iris_left": {
"position": [0, 0, 0.1]
},
"eyelid_left": {
"position": [0, 0, -0.1]
},
"eyelid_middle_left": {
"position": [0, 0.5, 0]
},
"eyelid_outer_left": {
"position": [0, 0.5, 0]
},
"iris_cover": {
"position": [0, 0, 0]
}
}
},
"animation.shiftry.surprised": {
"loop": true,
"bones": {
"mouth_closed": {
"scale": 0
},
"eye_right": {
"scale": [1, 1.2, 1]
},
"iris_right": {
"position": [0.2, 0, 0],
"scale": [0.8, 1, 1]
},
"pupil_right": {
"position": [-0.1, 0, 0],
"scale": [0.8, 0.5, 1]
},
"eye_left": {
"scale": [1, 1.2, 1]
},
"iris_left": {
"position": [-0.2, 0, 0],
"scale": [0.8, 1, 1]
},
"pupil_left": {
"position": [0.1, 0, 0],
"scale": [0.8, 0.5, 1]
},
"iris_cover": {
"position": [0, 0, 0.1]
},
"eye_emote_right": {
"position": [-0.25, 0, 0],
"scale": [0.83, 1, 1]
},
"eye_emote_left": {
"position": [0.25, 0, 0],
"scale": [0.83, 1, 1]
},
"iris_emote_right": {
"position": [-0.3, 0, 0],
"scale": [0.7, 1, 1]
},
"iris_emote_left": {
"position": [0.3, 0, 0],
"scale": [0.7, 1, 1]
}
}
},
"animation.shiftry.angry": {
"loop": true,
"bones": {
"eye_emote_right": {
"position": [-1, 0, 0],
"scale": [0.35, 2, 1]
},
"iris_emote_right": {
"position": [-0.7, 0, 0],
"scale": [0.3, 1, 1]
},
"eye_emote_left": {
"position": [1, 0, 0],
"scale": [0.35, 2, 1]
},
"iris_emote_left": {
"position": [0.7, 0, 0],
"scale": [0.3, 1, 1]
}
}
},
"animation.shiftry.disintrested": {
"loop": true,
"bones": {
"eye_emote_right": {
"position": [0, -0.5, 0]
},
"iris_emote_right": {
"position": [-0.4, -0.5, 0],
"scale": [0.6, 1, 1]
},
"eye_emote_left": {
"position": [0, -0.5, 0]
},
"iris_emote_left": {
"position": [0.4, -0.5, 0],
"scale": [0.6, 1, 1]
"leg_right": {
"rotation": [0, 15, 0]
}
}
},
"animation.shiftry.blink": {
"animation_length": 0.1667,
"animation_length": 0.16667,
"bones": {
"iris_right": {
"eyelid_left": {
"position": {
"0.0": [0, 0, 0.1],
"0.125": {"pre": [0, 0, 0.1], "post": [0, 0, 0.1]},
"0.1667": {"pre": [0, 0, 0.1], "post": [0, 0, 0]}
"0.0": [0.1, 0, -0.1],
"0.125": [0.1, 0, -0.1],
"0.1667": [0, 0, 0]
}
},
"eyelid_right": {
"position": {
"0.0": [0, 0, -0.1],
"0.125": {"pre": [0, 0, -0.1], "post": [0, 0, -0.1]},
"0.1667": {"pre": [0, 0, -0.1], "post": [0, 0, 0]}
}
},
"iris_left": {
"position": {
"0.0": [0, 0, 0.1],
"0.125": {"pre": [0, 0, 0.1], "post": [0, 0, 0.1]},
"0.1667": {"pre": [0, 0, 0.1], "post": [0, 0, 0]}
}
},
"eyelid_left": {
"position": {
"0.0": [0, 0, -0.1],
"0.125": {"pre": [0, 0, -0.1], "post": [0, 0, -0.1]},
"0.1667": {"pre": [0, 0, -0.1], "post": [0, 0, 0]}
"0.0": [-0.1, 0, -0.1],
"0.125": [-0.1, 0, -0.1],
"0.1667": [0, 0, 0]
}
}
}
},
"animation.shiftry.side_eye": {
"loop": true,
"animation.shiftry.call": {
"animation_length": 1.5,
"bones": {
"iris_right": {
"position": [-0.1, 0, 0],
"scale": [1.3, 1, 1]
"head": {
"rotation": {
"0.0": [0, 0, 0],
"0.25": [0, 0, 0],
"1.25": [0, 0, 0],
"1.5": [0, 0, 0]
}
},
"pupil_right": {
"position": [-0.6, 0, 0],
"scale": [0.75, 1, 1]
},
"iris_left": {
"position": [-0.1, 0, 0]
},
"pupil_left": {
"position": [-0.1, 0, 0]
"teeth2": {
"position": {
"0.0": [0, 0, 0],
"0.25": [0, -1, 0],
"1.25": [0, -1, 0],
"1.5": [0, 0, 0]
}
}
}
}
@@ -1,111 +1,39 @@
{
"format_version": "1.8.0",
"animations": {
"animation.pachirisu.render": {
"loop": true,
"bones": {
"body": {
"rotation": [0, 27.5, 0],
"position": [0, 0.75, 0]
},
"waist": {
"rotation": [7.5, 0, 0]
},
"torso": {
"rotation": [-7.5, -2.5, -5]
},
"head": {
"rotation": [-4.99917, -2.27268, 7.70829]
},
"arm_left": {
"rotation": [15, 0, 0]
},
"hand_left": {
"rotation": [0, 60, 0]
},
"tail": {
"rotation": [10.34721, 12.06754, 3.28396]
},
"tail2": {
"rotation": [17.5, 0, 0]
},
"tail3": {
"rotation": [22.5, 0, 0]
},
"tail4": {
"rotation": [15, 0, 0]
},
"foot_left": {
"rotation": [22.51606, -32.78202, 3.82048]
},
"foot_left2": {
"rotation": [-12.5, 0, 0]
},
"foot_right": {
"rotation": [28.1141, 35.62807, -3.0733]
},
"foot_right2": {
"rotation": [-20, 0, 0]
},
"arm_right": {
"rotation": [20, 0, 0],
"position": [0, 0.5, 0]
},
"hand_right": {
"rotation": [0, -60, 0]
},
"mouth_open": {
"position": [0, 0, -0.1]
}
}
},
"animation.pachirisu.ground_idle": {
"loop": true,
"bones": {
"body": {
"position": [0, 0.5, 0]
"lefthand": {
"rotation": [30, 15, 0]
},
"waist": {
"rotation": [7.5, 0, 0]
"righthand": {
"rotation": [30, -15, 0]
},
"torso": {
"rotation": [-7.5, 0, 0]
"leftfoot": {
"rotation": [0, 5, 0]
},
"arm_left": {
"rotation": [15, 0, 0]
"rightfoot": {
"rotation": [0, -5, 0]
}
}
},
"animation.pachirisu.blink": {
"animation_length": 0.16667,
"bones": {
"eyelid_right": {
"position": {
"0.0": [0, 0, -0.1],
"0.125": [0, 0, -0.1],
"0.1667": [0, 0, 0]
}
},
"hand_left": {
"rotation": [0, 60, 0]
},
"tail": {
"rotation": [15, 0, 0]
},
"tail2": {
"rotation": [17.5, 0, 0]
},
"tail3": {
"rotation": [22.5, 0, 0]
},
"tail4": {
"rotation": [15, 0, 0]
},
"foot_left": {
"rotation": [30, -22.5, 0]
},
"foot_left2": {
"rotation": [-17.5, 0, 0]
},
"foot_right": {
"rotation": [30, 22.5, 0]
},
"foot_right2": {
"rotation": [-17.5, 0, 0]
},
"arm_right": {
"rotation": [15, 0, 0]
},
"hand_right": {
"rotation": [0, -60, 0]
"eyelid_left": {
"position": {
"0.0": [0, 0, -0.1],
"0.125": [0, 0, -0.1],
"0.1667": [0, 0, 0]
}
}
}
}
@@ -213,7 +213,7 @@
},
"animation.lickilicky.ground_walk": {
"loop": true,
"animation_length": 1.3333,
"animation_length": 1.33333,
"bones": {
"torso": {
"rotation": ["5+math.sin(q.anim_time*90*6-120+180)*2", "0+math.sin(q.anim_time*90*3-75+180)*7", "0+math.sin(q.anim_time*90*3+15)*7.5"],
@@ -294,18 +294,11 @@
},
"right_foot": {
"rotation": ["0+math.clamp(math.sin(query.anim_time*90*3*1-90+180)*12.5,-0,12)+math.clamp(math.sin(query.anim_time*90*3*1-190+180)*17.5,-17,0)", 0, 0]
},
"locator_seat_1": {
"rotation": [0, 0, "0+math.sin(q.anim_time*90*3-75)*4"]
},
"locator_seat_2": {
"rotation": [0, 0, "0+math.sin(q.anim_time*90*3-75)*4"]
}
}
},
"animation.lickilicky.ground_run": {
"loop": true,
"animation_length": 0.7917,
"bones": {
"torso": {
"rotation": ["-10+math.sin(q.anim_time*90*10-120+180)*2", "0+math.sin(q.anim_time*90*5-75+180)*8.5", "0+math.sin(q.anim_time*90*5+15)*7.5"],
@@ -383,12 +376,6 @@
},
"jaw": {
"position": [0, 0, 0]
},
"locator_seat_1": {
"rotation": [7.5, 0, "math.sin(q.anim_time*90*5-75)*4"]
},
"locator_seat_2": {
"rotation": [7.5, 0, "math.sin(q.anim_time*90*5-75)*4"]
}
}
},
@@ -465,7 +452,7 @@
}
},
"animation.lickilicky.blink": {
"animation_length": 0.1667,
"animation_length": 0.16667,
"bones": {
"closed": {
"position": {
@@ -524,139 +511,6 @@
}
}
}
},
"animation.lickilicky.ride_ground_walk": {
"loop": true,
"bones": {
"body": {
"rotation": [0, "0-q.r.yaw_change(0)*5", 0]
},
"torso": {
"rotation": [0, "0-q.r.yaw_change(0)*5", "0+q.r.yaw_change(0)*2"]
},
"upper_torso": {
"rotation": [0, 0, 0]
},
"head": {
"rotation": [0, "0-q.r.yaw_change(0)*7.5", 0]
}
}
},
"animation.lickilicky.ride_ground_run": {
"loop": true,
"bones": {
"body": {
"rotation": [0, "0-q.r.yaw_change(0)*7.5", 0]
},
"torso": {
"rotation": [0, "0-q.r.yaw_change(0)*7.5", "0+q.r.yaw_change(0)*7.5"]
},
"upper_torso": {
"rotation": [0, 0, 0]
},
"head": {
"rotation": [0, "0-q.r.yaw_change(0)*7.5", 0]
},
"cowlick": {
"rotation": [0, 0, "0-q.r.yaw_change(0)*5"]
},
"locator_seat_1": {
"rotation": [0, 0, 0]
}
}
},
"animation.lickilicky.ride_jump": {
"loop": true,
"bones": {
"body": {
"rotation": ["0+(q.r.velocity_up(1)*10)+Math.cos((query.anim_time)*90*20-90)*-0.2", "0-q.r.yaw_change(0)*12.5", 0],
"position": [0, "2+Math.cos((query.anim_time)*90*20+0)*0.1", 0]
},
"torso": {
"rotation": ["-5+(q.r.velocity_up(1)*5)", "0-q.r.yaw_change(0)*2.5", "0-q.r.yaw_change(0)*2.5"],
"position": [0, "0+Math.cos((query.anim_time)*90*20-50)*0.05", 0]
},
"upper_torso": {
"rotation": ["0-(q.r.velocity_up(1)*7.5)", 0, 0]
},
"head": {
"rotation": ["0-(q.r.velocity_up(1)*7.5)+Math.cos((query.anim_time)*90*20+90)*0.4", 0, "0+q.r.yaw_change(0)*1.5"]
},
"cowlick": {
"rotation": ["0+(q.r.velocity_up(1)*10)+Math.cos((query.anim_time)*90*20+60)*0.5", 0, "0+Math.cos((query.anim_time)*90*20-30)*0.35"]
},
"jaw": {
"position": [0, 0, 0]
},
"tongue_1": {
"position": [0, 0, 2]
},
"tongue_2": {
"position": [0, 0, 9]
},
"tongue_3": {
"position": [0, 0, 8.75]
},
"tongue_4": {
"rotation": ["7.5+(q.r.velocity_up(1)*25)+Math.cos((query.anim_time)*90*20+90)*1", "0+Math.cos((query.anim_time)*90*20+0)*0.5", 0],
"position": [0, 0, "0.2-(q.r.velocity_up(1)*0.2)"]
},
"tongue_5": {
"rotation": ["15+(q.r.velocity_up(1)*40)+Math.cos((query.anim_time)*90*20+50)*1", "0+Math.cos((query.anim_time)*90*20-50)*1", 0],
"position": [0, 0, "0.3-(q.r.velocity_up(1)*0.3)"]
},
"left_upper_arm": {
"rotation": [
"0+(q.r.velocity_up(1)*30)",
"-20-(q.r.velocity_up(1)*10)+Math.cos((query.anim_time)*90*20+90)*0.5",
"5+(q.r.velocity_up(1)*25)+Math.cos((query.anim_time)*90*20+0)*0.75"
],
"position": ["-1.25+(q.r.velocity_up(1)*0.625)", 0, "1-(q.r.velocity_up(1)*1)"]
},
"left_lower_arm": {
"rotation": [0, "15-(q.r.velocity_up(1)*15)", 0]
},
"right_upper_arm": {
"rotation": [
"0+(q.r.velocity_up(1)*30)",
"20+(q.r.velocity_up(1)*10)-Math.cos((query.anim_time)*90*20+90)*0.5",
"-5-(q.r.velocity_up(1)*25)-Math.cos((query.anim_time)*90*20+0)*0.75"
],
"position": ["1.25-(q.r.velocity_up(1)*0.625)", 0, "1-(q.r.velocity_up(1)*1)"]
},
"right_lower_arm": {
"rotation": [0, "-15+(q.r.velocity_up(1)*15)", 0]
},
"tail_1": {
"rotation": ["0-(q.r.velocity_up(1)*10)+Math.cos((query.anim_time)*90*20+90)*0.5", "0+Math.cos((query.anim_time)*90*20+0)*0.5", 0]
},
"tail_2": {
"rotation": ["0-(q.r.velocity_up(1)*7.5)", 0, 0]
},
"tail_3": {
"rotation": ["-1.5-(q.r.velocity_up(1)*2.5)", 0, 0]
},
"left_leg": {
"rotation": [
"-5+(q.r.velocity_up(1)*30)+Math.cos((query.anim_time)*90*20+0)*0.5",
"-10+(q.r.velocity_up(1)*10)",
"0+Math.cos((query.anim_time)*90*20+90)*0.75"
]
},
"left_foot": {
"rotation": ["5-(q.r.velocity_up(1)*5)", 0, 0]
},
"right_leg": {
"rotation": [
"-5+(q.r.velocity_up(1)*30)+Math.cos((query.anim_time)*90*20+0)*0.5",
"10-(q.r.velocity_up(1)*10)",
"0-Math.cos((query.anim_time)*90*20+90)*0.75"
]
},
"right_foot": {
"rotation": ["5-(q.r.velocity_up(1)*5)", 0, 0]
}
}
}
}
}
Loaded 100 of 454 files, more files were not shown because too many files have changed in this diff. Show more