Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
da82eb8d61 | ||
|
|
2dc93f3336 | ||
|
|
e8864418d4 | ||
|
|
82b418d54d |
No files matched your search
+1
-7
@@ -302,11 +302,6 @@
|
||||
- Restored Ninjask's ability to do barrel rolls
|
||||
- Fixed a crash caused by adding enchanted items to the Resurrection Machine
|
||||
- Fixed a crash that could occur when starting a PvN battle with only fainted Pokémon.
|
||||
- Fixed the Remember Riding Camera config not being respected when dismounting and resolved the incompatibility with the Auto Third Person mod
|
||||
- Fixed Full Heal block not dropping Full Heals
|
||||
- Fixed status cure items not returning an empty bottle when used
|
||||
- Fixed Panpour consuming its held item when evolving with a Water Stone
|
||||
- Fixed Smoked Tail Curry returning a Wooden Bowl when consumed despite it not being included in the recipe
|
||||
|
||||
### Fixes
|
||||
- Fixed Croagunk's walkspeed
|
||||
@@ -367,8 +362,7 @@
|
||||
- Separated all the functions of MoLangFunctions.kt into their own files.
|
||||
- Spawn buckets and their base weights are now provided by the spawner, with different base weights for world, fishing, snack, and habitat spawn buckets.
|
||||
- Removed "SpawnBucket" class in favour of just storing maps of bucket names to weights.
|
||||
- Fixed nicknames not being applied to Pokémon spawned from `spawn_pool_world` files.
|
||||
- Added support for `profilePokedexScale`, `profilePokedexTranslation`, `profileSummaryScale`, and `profileSummaryTranslation` in poser files for finer control over profile displays.
|
||||
- Fixed nicknames not being applied to Pokémon spawned from `spawn_pool_world` files
|
||||
|
||||
### Molang & Datapacks
|
||||
- Added `moveset_builders` datapack folder for different styles of movesets.
|
||||
|
||||
@@ -10,13 +10,11 @@ package com.cobblemon.mod.common.mixin.client;
|
||||
|
||||
import com.cobblemon.mod.common.OrientationControllable;
|
||||
import com.cobblemon.mod.common.client.render.player.MountedPlayerRenderer;
|
||||
import com.cobblemon.mod.common.client.render.player.RecallArmAnimationTracker;
|
||||
import com.cobblemon.mod.common.duck.RidePassenger;
|
||||
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity;
|
||||
import net.minecraft.client.model.HumanoidModel;
|
||||
import net.minecraft.client.model.geom.ModelPart;
|
||||
import net.minecraft.client.player.AbstractClientPlayer;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
@@ -98,26 +96,4 @@ public class HumanoidModelMixin {
|
||||
MountedPlayerRenderer.INSTANCE.animate((HumanoidModel<AbstractClientPlayer>)(Object)this, pokemonEntity, player, netHeadYaw, headPitch, ageInTicks, limbSwing, limbSwingAmount);
|
||||
}
|
||||
}
|
||||
|
||||
// Pose the right arm forward while recalling so the held Poké Ball sits out in front.
|
||||
@Inject(method = "setupAnim*", at = @At("TAIL"))
|
||||
public void cobblemon$poseRecallArm(
|
||||
LivingEntity entity,
|
||||
float limbSwing,
|
||||
float limbSwingAmount,
|
||||
float ageInTicks,
|
||||
float netHeadYaw,
|
||||
float headPitch,
|
||||
CallbackInfo ci
|
||||
) {
|
||||
if (!(entity instanceof AbstractClientPlayer player)) return;
|
||||
// Skip while riding so we don't override the mounted-riding arm animation.
|
||||
if (entity.getVehicle() instanceof PokemonEntity) return;
|
||||
float raise = RecallArmAnimationTracker.INSTANCE.raiseFactor(player.getUUID());
|
||||
if (raise <= 0f) return;
|
||||
float armForwardXRot = (float) (-Math.PI / 2.0);
|
||||
this.rightArm.xRot = Mth.lerp(raise, this.rightArm.xRot, armForwardXRot);
|
||||
this.rightArm.yRot = Mth.lerp(raise, this.rightArm.yRot, 0f);
|
||||
this.rightArm.zRot = Mth.lerp(raise, this.rightArm.zRot, 0f);
|
||||
}
|
||||
}
|
||||
@@ -1,45 +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.mixin.client;
|
||||
|
||||
import com.cobblemon.mod.common.client.render.player.RecallArmAnimationTracker;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.minecraft.client.renderer.MultiBufferSource;
|
||||
import net.minecraft.client.renderer.entity.layers.ItemInHandLayer;
|
||||
import net.minecraft.world.entity.HumanoidArm;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.item.ItemDisplayContext;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
/**
|
||||
* Hides the player's right-hand item while recalling so it doesn't overlap the recall Poké Ball
|
||||
* drawn by PlayerRecallBallRenderer.
|
||||
*/
|
||||
@Mixin(ItemInHandLayer.class)
|
||||
public class ItemInHandLayerMixin {
|
||||
@Inject(method = "renderArmWithItem", at = @At("HEAD"), cancellable = true)
|
||||
private void cobblemon$hideRecallHandItem(
|
||||
LivingEntity entity,
|
||||
ItemStack itemStack,
|
||||
ItemDisplayContext itemDisplayContext,
|
||||
HumanoidArm humanoidArm,
|
||||
PoseStack poseStack,
|
||||
MultiBufferSource multiBufferSource,
|
||||
int light,
|
||||
CallbackInfo ci
|
||||
) {
|
||||
if (humanoidArm == HumanoidArm.RIGHT && RecallArmAnimationTracker.INSTANCE.isRecalling(entity.getUUID())) {
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
-8
@@ -9,8 +9,6 @@
|
||||
package com.cobblemon.mod.common.mixin.client;
|
||||
|
||||
import com.cobblemon.mod.common.OrientationControllable;
|
||||
import com.cobblemon.mod.common.client.render.player.FirstPersonRecallBallRenderer;
|
||||
import com.cobblemon.mod.common.client.render.player.RecallArmAnimationTracker;
|
||||
import com.cobblemon.mod.common.item.PokedexItem;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -33,12 +31,6 @@ public class ItemInHandRendererMixin {
|
||||
if (abstractClientPlayer.isUsingItem() && abstractClientPlayer.getUseItem().getItem() instanceof PokedexItem) {
|
||||
ci.cancel();
|
||||
}
|
||||
// While recalling, swap the main-hand item for the rising Poké Ball.
|
||||
else if (interactionHand == InteractionHand.MAIN_HAND
|
||||
&& RecallArmAnimationTracker.INSTANCE.isRecalling(abstractClientPlayer.getUUID())
|
||||
&& FirstPersonRecallBallRenderer.INSTANCE.render(poseStack, multiBufferSource, j, f)) {
|
||||
ci.cancel();
|
||||
}
|
||||
else if (abstractClientPlayer instanceof OrientationControllable controllable && controllable.getOrientationController().isActive()) {
|
||||
|
||||
}
|
||||
|
||||
@@ -405,7 +405,7 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
|
||||
@JvmField
|
||||
val BIG_MALASADA = regionalFoodItem("big_malasada", 64, 7, 0.3f, false)
|
||||
@JvmField
|
||||
val SMOKED_TAIL_CURRY = regionalFoodItem("smoked_tail_curry", 64, 10, 0.6f, false)
|
||||
val SMOKED_TAIL_CURRY = regionalFoodItem("smoked_tail_curry", 64, 10, 0.6f, false, ItemStack(Items.BOWL, 1))
|
||||
@JvmField
|
||||
val JUBILIFE_MUFFIN = regionalFoodItem("jubilife_muffin", 64, 7, 0.3f, false)
|
||||
@JvmField
|
||||
|
||||
@@ -44,7 +44,6 @@ import com.cobblemon.mod.common.client.render.entity.PokeBobberEntityRenderer
|
||||
import com.cobblemon.mod.common.client.render.generic.GenericBedrockRenderer
|
||||
import com.cobblemon.mod.common.client.render.item.CobblemonBuiltinItemRendererRegistry
|
||||
import com.cobblemon.mod.common.client.render.item.PokemonItemRenderer
|
||||
import com.cobblemon.mod.common.client.render.layer.PlayerRecallBallRenderer
|
||||
import com.cobblemon.mod.common.client.render.layer.PokemonOnShoulderRenderer
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.bedrock.animation.BedrockAnimationRepository
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.repository.BerryModelRepository
|
||||
@@ -406,10 +405,8 @@ object CobblemonClient {
|
||||
var renderer: LivingEntityRenderer<Player, PlayerModel<Player>>? =
|
||||
skinMap?.get(PlayerSkin.Model.WIDE) as LivingEntityRenderer<Player, PlayerModel<Player>>
|
||||
renderer?.addLayer(PokemonOnShoulderRenderer(renderer))
|
||||
renderer?.addLayer(PlayerRecallBallRenderer(renderer))
|
||||
renderer = skinMap[PlayerSkin.Model.SLIM] as LivingEntityRenderer<Player, PlayerModel<Player>>?
|
||||
renderer?.addLayer(PokemonOnShoulderRenderer(renderer))
|
||||
renderer?.addLayer(PlayerRecallBallRenderer(renderer))
|
||||
}
|
||||
|
||||
private fun registerMenuScreens() {
|
||||
|
||||
@@ -49,7 +49,7 @@ object MountedCameraTypeHandler {
|
||||
return
|
||||
}
|
||||
val currentCameraType = mc.options.cameraType
|
||||
if (Cobblemon.config.rememberRidingCamera && currentCameraType != unmountedCameraType) {
|
||||
if (currentCameraType != unmountedCameraType) {
|
||||
mc.options.cameraType = unmountedCameraType
|
||||
}
|
||||
val data = ClientPersistedData.ridingPerspectives
|
||||
|
||||
@@ -32,7 +32,6 @@ import com.cobblemon.mod.common.client.render.models.blockbench.PosableState
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.animation.ActiveAnimation
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.animation.PrimaryAnimation
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.repository.VaryingModelRepository
|
||||
import com.cobblemon.mod.common.client.render.player.RecallArmAnimationTracker
|
||||
import com.cobblemon.mod.common.client.render.pokemon.PokemonRenderer.Companion.ease
|
||||
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
|
||||
import com.cobblemon.mod.common.net.messages.server.pokemon.update.ServerboundUpdateRidingStatePacket
|
||||
@@ -321,13 +320,6 @@ class PokemonClientDelegate : PosableState(), PokemonSideDelegate {
|
||||
ballOffset = 0f
|
||||
ballRotOffset = 0f
|
||||
sendOutPosition = null
|
||||
// If a player is recalling, have them hold the matching Poké Ball out in their
|
||||
// right hand for the duration of the beam (see ourRecallArmAnimationTracker class).
|
||||
currentEntity.ownerUUID?.let { ownerId ->
|
||||
if (currentEntity.level().getPlayerByUUID(ownerId) != null) {
|
||||
RecallArmAnimationTracker.start(ownerId, currentEntity.exposedBall, emptySet())
|
||||
}
|
||||
}
|
||||
afterOnClient(seconds = BEAM_EXTEND_TIME) {
|
||||
activeSendoutScale = 1F
|
||||
|
||||
|
||||
@@ -27,18 +27,10 @@ import net.minecraft.client.renderer.RenderType
|
||||
import net.minecraft.client.renderer.texture.OverlayTexture
|
||||
import net.minecraft.resources.ResourceLocation
|
||||
import net.minecraft.util.Mth
|
||||
import net.minecraft.world.phys.Vec3
|
||||
import org.joml.Quaternionf
|
||||
import org.joml.Vector3f
|
||||
import kotlin.math.atan
|
||||
|
||||
enum class ProfileTransformType {
|
||||
PROFILE,
|
||||
NONE,
|
||||
POKEDEX,
|
||||
SUMMARY,
|
||||
}
|
||||
|
||||
fun drawProfilePokemon(
|
||||
renderablePokemon: RenderablePokemon,
|
||||
matrixStack: PoseStack,
|
||||
@@ -47,7 +39,7 @@ fun drawProfilePokemon(
|
||||
state: PosableState,
|
||||
partialTicks: Float,
|
||||
scale: Float = 20F,
|
||||
profileTransformType: ProfileTransformType = ProfileTransformType.PROFILE,
|
||||
applyProfileTransform: Boolean = true,
|
||||
applyBaseScale: Boolean = false,
|
||||
r: Float = 1F,
|
||||
g: Float = 1F,
|
||||
@@ -64,7 +56,7 @@ fun drawProfilePokemon(
|
||||
state = state.also { it.currentAspects = renderablePokemon.aspects },
|
||||
partialTicks = partialTicks,
|
||||
scale = scale,
|
||||
profileTransformType = profileTransformType,
|
||||
applyProfileTransform = applyProfileTransform,
|
||||
applyBaseScale = applyBaseScale,
|
||||
r = r,
|
||||
g = g,
|
||||
@@ -83,7 +75,7 @@ fun drawProfilePokemon(
|
||||
state: PosableState,
|
||||
partialTicks: Float,
|
||||
scale: Float = 20F,
|
||||
profileTransformType: ProfileTransformType = ProfileTransformType.PROFILE,
|
||||
applyProfileTransform: Boolean = true,
|
||||
applyBaseScale: Boolean = false,
|
||||
doQuirks: Boolean = false,
|
||||
r: Float = 1F,
|
||||
@@ -122,38 +114,18 @@ fun drawProfilePokemon(
|
||||
state.setPoseToFirstSuitable(poseType)
|
||||
state.updatePartialTicks(partialTicks)
|
||||
|
||||
if (profileTransformType == ProfileTransformType.NONE) {
|
||||
if (applyProfileTransform) {
|
||||
matrixStack.translate(
|
||||
model.profileTranslation.x,
|
||||
model.profileTranslation.y + 1.5 * model.profileScale,
|
||||
model.profileTranslation.z - 4.0
|
||||
)
|
||||
matrixStack.scale(model.profileScale, model.profileScale, 1 / model.profileScale)} else {
|
||||
matrixStack.translate(0F, 0F, -4.0F)
|
||||
if (applyBaseScale) {
|
||||
matrixStack.scale(baseScale, baseScale, 1 / baseScale)
|
||||
}
|
||||
} else {
|
||||
var profileScale: Float
|
||||
var profileTranslation: Vec3
|
||||
|
||||
when (profileTransformType) {
|
||||
ProfileTransformType.POKEDEX -> {
|
||||
profileScale = model.profilePokedexScale ?: model.profileScale
|
||||
profileTranslation = model.profilePokedexTranslation ?: model.profileTranslation
|
||||
}
|
||||
ProfileTransformType.SUMMARY -> {
|
||||
profileScale = model.profileSummaryScale ?: model.profileScale
|
||||
profileTranslation = model.profileSummaryTranslation ?: model.profileTranslation
|
||||
}
|
||||
else -> {
|
||||
profileScale = model.profileScale
|
||||
profileTranslation = model.profileTranslation
|
||||
}
|
||||
}
|
||||
|
||||
matrixStack.translate(
|
||||
profileTranslation.x,
|
||||
profileTranslation.y + 1.5 * profileScale,
|
||||
profileTranslation.z - 4.0
|
||||
)
|
||||
matrixStack.scale(profileScale, profileScale, 1 / profileScale)
|
||||
}
|
||||
|
||||
matrixStack.mulPose(rotation)
|
||||
|
||||
model.applyAnimations(null, state, 0F, 0F, 0F, headYaw, headPitch)
|
||||
|
||||
@@ -1,97 +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
|
||||
|
||||
import com.cobblemon.mod.common.Cobblemon
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.FloatingState
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.repository.VaryingModelRepository
|
||||
import com.mojang.blaze3d.platform.InputConstants
|
||||
import net.minecraft.client.Minecraft
|
||||
import net.minecraft.network.chat.Component
|
||||
import net.minecraft.resources.ResourceLocation
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
fun handleProfileDebugKeys(keyCode: Int, poserResourceLocation: ResourceLocation, state: FloatingState) {
|
||||
if (!Cobblemon.config.enableDebugKeys) {
|
||||
return
|
||||
}
|
||||
val model = VaryingModelRepository.getPoser(poserResourceLocation, state)
|
||||
|
||||
val delta = when (keyCode) {
|
||||
InputConstants.KEY_UP -> Vec3(0.0, -0.01, 0.0)
|
||||
InputConstants.KEY_DOWN -> Vec3(0.0, 0.01, 0.0)
|
||||
InputConstants.KEY_LEFT -> Vec3(-0.01, 0.0, 0.0)
|
||||
InputConstants.KEY_RIGHT -> Vec3(0.01, 0.0, 0.0)
|
||||
else -> null
|
||||
}
|
||||
|
||||
if (delta != null) {
|
||||
model.profileTranslation = model.profileTranslation.add(delta)
|
||||
model.profileSummaryTranslation = model.profileSummaryTranslation?.add(delta)
|
||||
model.profilePokedexTranslation = model.profilePokedexTranslation?.add(delta)
|
||||
}
|
||||
|
||||
val scaleDelta = when (keyCode) {
|
||||
InputConstants.KEY_EQUALS -> 0.01F
|
||||
InputConstants.KEY_MINUS -> -0.01F
|
||||
else -> null
|
||||
}
|
||||
|
||||
if (scaleDelta != null) {
|
||||
model.profileScale += scaleDelta
|
||||
model.profileSummaryScale = model.profileSummaryScale?.plus(scaleDelta)
|
||||
model.profilePokedexScale = model.profilePokedexScale?.plus(scaleDelta)
|
||||
}
|
||||
}
|
||||
|
||||
fun logProfileTranslations(poserResourceLocation: ResourceLocation, state: FloatingState) {
|
||||
if (!Cobblemon.config.enableDebugKeys) {
|
||||
return
|
||||
}
|
||||
|
||||
val model = VaryingModelRepository.getPoser(poserResourceLocation, state)
|
||||
val player = Minecraft.getInstance().player
|
||||
|
||||
fun Double.f2() = "%.2f".format(this)
|
||||
fun Float.f2() = "%.2f".format(this)
|
||||
|
||||
fun sendTranslation(name: String, translation: Vec3) {
|
||||
player?.sendSystemMessage(Component.literal("$name Translation: (${translation.x.f2()}, ${translation.y.f2()}, ${translation.z.f2()})"))
|
||||
}
|
||||
|
||||
fun sendScale(name: String, scale: Float) {
|
||||
player?.sendSystemMessage(Component.literal("$name Scale: ${scale.f2()}"))
|
||||
}
|
||||
|
||||
fun logTranslation(name: String, translation: Vec3) {
|
||||
Cobblemon.LOGGER.info("override var ${name.replaceFirstChar(Char::lowercase)}Translation = Vec3(${translation.x.f2()}, ${translation.y.f2()}, ${translation.z.f2()})")
|
||||
}
|
||||
|
||||
fun logScale(name: String, scale: Float) {
|
||||
Cobblemon.LOGGER.info("override var ${name.replaceFirstChar(Char::lowercase)}Scale = ${scale.f2()}F")
|
||||
}
|
||||
|
||||
sendTranslation("Profile", model.profileTranslation)
|
||||
sendScale("Profile", model.profileScale)
|
||||
|
||||
model.profileSummaryTranslation?.let { sendTranslation("Summary Profile", it) }
|
||||
model.profileSummaryScale?.let { sendScale("Summary Profile", it) }
|
||||
|
||||
model.profilePokedexTranslation?.let { sendTranslation("Pokedex Profile", it) }
|
||||
model.profilePokedexScale?.let { sendScale("Pokedex Profile", it) }
|
||||
|
||||
logTranslation("Profile", model.profileTranslation)
|
||||
logScale("Profile", model.profileScale)
|
||||
|
||||
model.profileSummaryTranslation?.let { logTranslation("ProfileSummary", it) }
|
||||
model.profileSummaryScale?.let { logScale("ProfileSummary", it) }
|
||||
|
||||
model.profilePokedexTranslation?.let { logTranslation("ProfilePokedex", it) }
|
||||
model.profilePokedexScale?.let { logScale("ProfilePokedex", it) }
|
||||
}
|
||||
@@ -32,8 +32,6 @@ import com.cobblemon.mod.common.client.ClientMoLangFunctions.setupClient
|
||||
import com.cobblemon.mod.common.client.CobblemonClient
|
||||
import com.cobblemon.mod.common.client.CobblemonResources
|
||||
import com.cobblemon.mod.common.client.gui.CobblemonRenderable
|
||||
import com.cobblemon.mod.common.client.gui.handleProfileDebugKeys
|
||||
import com.cobblemon.mod.common.client.gui.logProfileTranslations
|
||||
import com.cobblemon.mod.common.client.gui.pokedex.PokedexGUIConstants.BASE_HEIGHT
|
||||
import com.cobblemon.mod.common.client.gui.pokedex.PokedexGUIConstants.BASE_WIDTH
|
||||
import com.cobblemon.mod.common.client.gui.pokedex.PokedexGUIConstants.HALF_OVERLAY_WIDTH
|
||||
@@ -429,11 +427,6 @@ class PokedexGUI private constructor(
|
||||
override fun onClose() {
|
||||
if (blockPos != null) AdjustBlockEntityViewerCountPacket(blockPos, false).sendToServer()
|
||||
playSound(CobblemonSounds.POKEDEX_CLOSE)
|
||||
|
||||
selectedEntry?.speciesId?.let { speciesId ->
|
||||
logProfileTranslations(speciesId, pokemonInfoWidget.state)
|
||||
}
|
||||
|
||||
super.onClose()
|
||||
}
|
||||
|
||||
@@ -764,12 +757,6 @@ class PokedexGUI private constructor(
|
||||
return true
|
||||
}
|
||||
|
||||
if (!searchWidget.isFocused) {
|
||||
selectedEntry?.speciesId?.let { speciesId ->
|
||||
handleProfileDebugKeys(keyCode, speciesId, pokemonInfoWidget.state)
|
||||
}
|
||||
}
|
||||
|
||||
return super.keyPressed(keyCode, scanCode, modifiers)
|
||||
}
|
||||
|
||||
|
||||
+1
-3
@@ -22,7 +22,6 @@ import com.cobblemon.mod.common.api.types.ElementalType
|
||||
import com.cobblemon.mod.common.client.ClientMoLangFunctions.setupClient
|
||||
import com.cobblemon.mod.common.client.CobblemonClient
|
||||
import com.cobblemon.mod.common.client.CobblemonResources
|
||||
import com.cobblemon.mod.common.client.gui.ProfileTransformType
|
||||
import com.cobblemon.mod.common.client.gui.TypeIcon
|
||||
import com.cobblemon.mod.common.client.gui.drawProfilePokemon
|
||||
import com.cobblemon.mod.common.client.gui.pokedex.PokedexGUIConstants.HALF_OVERLAY_HEIGHT
|
||||
@@ -387,8 +386,7 @@ class PokemonInfoWidget(val pX: Int, val pY: Int, val updateForm: (PokedexForm)
|
||||
partialTicks = delta,
|
||||
rotation = Quaternionf().fromEulerXYZDegrees(rotationVector),
|
||||
state = state,
|
||||
blockLight = 15,
|
||||
profileTransformType = ProfileTransformType.POKEDEX,
|
||||
blockLight = 15
|
||||
)
|
||||
|
||||
matrices.popPose()
|
||||
|
||||
+1
-2
@@ -11,7 +11,6 @@ package com.cobblemon.mod.common.client.gui.pokedex.widgets
|
||||
import com.cobblemon.mod.common.api.gui.blitk
|
||||
import com.cobblemon.mod.common.api.text.bold
|
||||
import com.cobblemon.mod.common.client.CobblemonResources
|
||||
import com.cobblemon.mod.common.client.gui.ProfileTransformType
|
||||
import com.cobblemon.mod.common.client.gui.drawProfilePokemon
|
||||
import com.cobblemon.mod.common.client.gui.pokedex.PokedexGUIConstants.HALF_OVERLAY_WIDTH
|
||||
import com.cobblemon.mod.common.client.gui.pokedex.PokedexGUIConstants.POKEMON_DESCRIPTION_HEIGHT
|
||||
@@ -91,7 +90,7 @@ class SizeWidget(val pX: Int, val pY: Int) : SoundlessWidget(
|
||||
rotation = Quaternionf().fromEulerXYZDegrees(Vector3f(0F, 0F, 0F)),
|
||||
state = FloatingState(),
|
||||
scale = modelScale,
|
||||
profileTransformType = ProfileTransformType.NONE,
|
||||
applyProfileTransform = false,
|
||||
applyBaseScale = true,
|
||||
r = 0F,
|
||||
g = 0F,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
package com.cobblemon.mod.common.client.gui.summary
|
||||
|
||||
import com.cobblemon.mod.common.Cobblemon
|
||||
import com.cobblemon.mod.common.CobblemonItems
|
||||
import com.cobblemon.mod.common.CobblemonNetwork.sendToServer
|
||||
import com.cobblemon.mod.common.CobblemonSounds
|
||||
@@ -20,8 +21,14 @@ import com.cobblemon.mod.common.api.text.bold
|
||||
import com.cobblemon.mod.common.api.text.text
|
||||
import com.cobblemon.mod.common.client.CobblemonClient
|
||||
import com.cobblemon.mod.common.client.CobblemonResources
|
||||
import com.cobblemon.mod.common.client.gui.*
|
||||
import com.cobblemon.mod.common.client.gui.summary.widgets.*
|
||||
import com.cobblemon.mod.common.client.gui.CobblemonRenderable
|
||||
import com.cobblemon.mod.common.client.gui.ExitButton
|
||||
import com.cobblemon.mod.common.client.gui.TypeIcon
|
||||
import com.cobblemon.mod.common.client.gui.summary.widgets.EvolutionSelectScreen
|
||||
import com.cobblemon.mod.common.client.gui.summary.widgets.MarkingsWidget
|
||||
import com.cobblemon.mod.common.client.gui.summary.widgets.ModelWidget
|
||||
import com.cobblemon.mod.common.client.gui.summary.widgets.NicknameEntryWidget
|
||||
import com.cobblemon.mod.common.client.gui.summary.widgets.PartyWidget
|
||||
import com.cobblemon.mod.common.client.gui.summary.widgets.screens.SummaryTab
|
||||
import com.cobblemon.mod.common.client.gui.summary.widgets.screens.info.InfoWidget
|
||||
import com.cobblemon.mod.common.client.gui.summary.widgets.screens.marks.MarksWidget
|
||||
@@ -30,6 +37,7 @@ import com.cobblemon.mod.common.client.gui.summary.widgets.screens.moves.MovesWi
|
||||
import com.cobblemon.mod.common.client.gui.summary.widgets.screens.stats.StatWidget
|
||||
import com.cobblemon.mod.common.client.keybind.keybinds.SummaryBinding
|
||||
import com.cobblemon.mod.common.client.render.drawScaledText
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.repository.VaryingModelRepository
|
||||
import com.cobblemon.mod.common.net.messages.server.pokemon.update.SetItemHiddenPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.storage.party.MovePartyPokemonPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.storage.party.SwapPartyPokemonPacket
|
||||
@@ -707,9 +715,27 @@ class Summary private constructor(party: Collection<Pokemon?>, private val edita
|
||||
) {
|
||||
this.focused = null
|
||||
}
|
||||
|
||||
handleProfileDebugKeys(keyCode, selectedPokemon.species.resourceIdentifier, modelWidget.state)
|
||||
|
||||
if (Cobblemon.config.enableDebugKeys) {
|
||||
val model = VaryingModelRepository.getPoser(selectedPokemon.species.resourceIdentifier, modelWidget.state)
|
||||
if (keyCode == InputConstants.KEY_UP) {
|
||||
model.profileTranslation = model.profileTranslation.add(0.0, -0.01, 0.0)
|
||||
}
|
||||
if (keyCode == InputConstants.KEY_DOWN) {
|
||||
model.profileTranslation = model.profileTranslation.add(0.0, 0.01, 0.0)
|
||||
}
|
||||
if (keyCode == InputConstants.KEY_LEFT) {
|
||||
model.profileTranslation = model.profileTranslation.add(-0.01, 0.0, 0.0)
|
||||
}
|
||||
if (keyCode == InputConstants.KEY_RIGHT) {
|
||||
model.profileTranslation = model.profileTranslation.add(0.01, 0.0, 0.0)
|
||||
}
|
||||
if (keyCode == InputConstants.KEY_EQUALS) {
|
||||
model.profileScale += 0.01F
|
||||
}
|
||||
if (keyCode == InputConstants.KEY_MINUS) {
|
||||
model.profileScale -= 0.01F
|
||||
}
|
||||
}
|
||||
return super.keyPressed(keyCode, scanCode, modifiers)
|
||||
}
|
||||
|
||||
@@ -718,8 +744,13 @@ class Summary private constructor(party: Collection<Pokemon?>, private val edita
|
||||
}
|
||||
|
||||
override fun onClose() {
|
||||
logProfileTranslations(selectedPokemon.species.resourceIdentifier, modelWidget.state)
|
||||
|
||||
if (Cobblemon.config.enableDebugKeys) {
|
||||
val model = VaryingModelRepository.getPoser(selectedPokemon.species.resourceIdentifier, modelWidget.state)
|
||||
Minecraft.getInstance().player?.sendSystemMessage(Component.literal("Profile Translation: ${model.profileTranslation}"))
|
||||
Minecraft.getInstance().player?.sendSystemMessage(Component.literal("Profile Scale: ${model.profileScale}"))
|
||||
Cobblemon.LOGGER.info("override var profileTranslation = Vec3d(${model.profileTranslation.x}, ${model.profileTranslation.y}, ${model.profileTranslation.z})")
|
||||
Cobblemon.LOGGER.info("override var profileScale = ${model.profileScale}F")
|
||||
}
|
||||
super.onClose()
|
||||
}
|
||||
}
|
||||
+1
-3
@@ -11,7 +11,6 @@ package com.cobblemon.mod.common.client.gui.summary.widgets
|
||||
import com.bedrockk.molang.runtime.value.DoubleValue
|
||||
import com.cobblemon.mod.common.Cobblemon
|
||||
import com.cobblemon.mod.common.api.tags.CobblemonItemTags
|
||||
import com.cobblemon.mod.common.client.gui.ProfileTransformType
|
||||
import com.cobblemon.mod.common.client.gui.drawProfilePokemon
|
||||
import com.cobblemon.mod.common.client.gui.calculateHeadYawAndPitch
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.FloatingState
|
||||
@@ -117,8 +116,7 @@ class ModelWidget(
|
||||
partialTicks = partialTicks,
|
||||
headYaw = currentYawAndPitch.first,
|
||||
headPitch = currentYawAndPitch.second,
|
||||
blockLight = blockLight,
|
||||
profileTransformType = ProfileTransformType.SUMMARY,
|
||||
blockLight = blockLight
|
||||
)
|
||||
|
||||
heldItemRenderer.renderOnModel(
|
||||
|
||||
-127
@@ -1,127 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.client.render.layer
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.repository.RenderContext
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.repository.VaryingModelRepository
|
||||
import com.cobblemon.mod.common.client.render.player.RecallArmAnimationTracker
|
||||
import com.mojang.blaze3d.vertex.PoseStack
|
||||
import com.mojang.math.Axis
|
||||
import net.minecraft.client.Minecraft
|
||||
import net.minecraft.client.model.PlayerModel
|
||||
import net.minecraft.client.renderer.MultiBufferSource
|
||||
import net.minecraft.client.renderer.RenderType
|
||||
import net.minecraft.client.renderer.entity.ItemRenderer
|
||||
import net.minecraft.client.renderer.entity.RenderLayerParent
|
||||
import net.minecraft.client.renderer.entity.layers.RenderLayer
|
||||
import net.minecraft.client.renderer.texture.OverlayTexture
|
||||
import net.minecraft.world.entity.HumanoidArm
|
||||
import net.minecraft.world.entity.player.Player
|
||||
import net.minecraft.world.phys.Vec3
|
||||
import org.joml.Vector3f
|
||||
|
||||
/**
|
||||
* Draws the matching Poké Ball in a recalling player's right hand and records where the recall beam
|
||||
* should start. Driven by [RecallArmAnimationTracker]; the right arm is posed forward in
|
||||
* HumanoidModelMixin so [PlayerModel.translateToHand] lands on the extended hand.
|
||||
*
|
||||
* The local player in first person is handled by FirstPersonRecallBallRenderer instead, so it's
|
||||
* skipped here.
|
||||
*/
|
||||
class PlayerRecallBallRenderer<T : Player>(
|
||||
renderLayerParent: RenderLayerParent<T, PlayerModel<T>>
|
||||
) : RenderLayer<T, PlayerModel<T>>(renderLayerParent) {
|
||||
|
||||
companion object {
|
||||
private const val BALL_SCALE = 0.5F
|
||||
|
||||
private const val HAND_X = 0.0625
|
||||
private const val HAND_Y = 0.125
|
||||
private const val HAND_Z = -0.625
|
||||
|
||||
private const val BALL_YAW_SPIN = 180F
|
||||
private const val BALL_INFLATE = 1.08F
|
||||
|
||||
private const val BEAM_X_OFFSET = 0F
|
||||
private const val BEAM_Y_OFFSET = 0.18F
|
||||
private const val BEAM_Z_OFFSET = -0.30F
|
||||
}
|
||||
|
||||
private val ballContext = RenderContext().also {
|
||||
it.put(RenderContext.RENDER_STATE, RenderContext.RenderState.WORLD)
|
||||
}
|
||||
|
||||
override fun render(
|
||||
matrixStack: PoseStack,
|
||||
buffer: MultiBufferSource,
|
||||
packedLight: Int,
|
||||
player: T,
|
||||
limbSwing: Float,
|
||||
limbSwingAmount: Float,
|
||||
partialTicks: Float,
|
||||
ageInTicks: Float,
|
||||
netHeadYaw: Float,
|
||||
headPitch: Float
|
||||
) {
|
||||
val anim = RecallArmAnimationTracker.get(player.uuid) ?: return
|
||||
val mc = Minecraft.getInstance()
|
||||
if (player === mc.player && mc.options.cameraType.isFirstPerson) return
|
||||
|
||||
matrixStack.pushPose()
|
||||
getParentModel().translateToHand(HumanoidArm.RIGHT, matrixStack)
|
||||
matrixStack.mulPose(Axis.XP.rotationDegrees(-90F))
|
||||
matrixStack.mulPose(Axis.YP.rotationDegrees(180F))
|
||||
matrixStack.translate(HAND_X, HAND_Y, HAND_Z)
|
||||
|
||||
renderBall(anim, matrixStack, buffer, packedLight, partialTicks)
|
||||
|
||||
matrixStack.popPose()
|
||||
}
|
||||
|
||||
private fun renderBall(
|
||||
anim: RecallArmAnimationTracker.RecallAnim,
|
||||
matrixStack: PoseStack,
|
||||
buffer: MultiBufferSource,
|
||||
packedLight: Int,
|
||||
partialTicks: Float
|
||||
) {
|
||||
val state = anim.ballState
|
||||
val ball = anim.ball
|
||||
matrixStack.pushPose()
|
||||
matrixStack.scale(BALL_INFLATE, BALL_INFLATE, BALL_INFLATE)
|
||||
matrixStack.translate(0.0, (-8.0 / 16.0) * BALL_SCALE, 0.0)
|
||||
matrixStack.scale(BALL_SCALE, -BALL_SCALE, -BALL_SCALE)
|
||||
matrixStack.mulPose(Axis.YP.rotationDegrees(BALL_YAW_SPIN))
|
||||
|
||||
val model = VaryingModelRepository.getPoser(ball.name, state)
|
||||
val texture = VaryingModelRepository.getTexture(ball.name, state)
|
||||
state.updatePartialTicks(partialTicks)
|
||||
model.context = ballContext
|
||||
ballContext.put(RenderContext.ASPECTS, state.aspects)
|
||||
ballContext.put(RenderContext.POSABLE_STATE, state)
|
||||
|
||||
model.applyAnimations(null, state, 0F, 0F, 0F, 0F, 0F)
|
||||
|
||||
state.locatorStates["beam"]?.let { beamLocator ->
|
||||
matrixStack.pushPose()
|
||||
matrixStack.mulPose(beamLocator.matrix)
|
||||
val camRelative = matrixStack.last().pose().transformPosition(Vector3f(BEAM_X_OFFSET, BEAM_Y_OFFSET, BEAM_Z_OFFSET))
|
||||
matrixStack.popPose()
|
||||
val camera = Minecraft.getInstance().gameRenderer.mainCamera.position
|
||||
anim.beamOrigin = Vec3(camera.x + camRelative.x, camera.y + camRelative.y, camera.z + camRelative.z)
|
||||
}
|
||||
val consumer = ItemRenderer.getFoilBufferDirect(buffer, RenderType.entityCutout(texture), false, false)
|
||||
model.render(ballContext, matrixStack, consumer, packedLight, OverlayTexture.NO_OVERLAY, -0x1)
|
||||
model.red = 1F
|
||||
model.green = 1F
|
||||
model.blue = 1F
|
||||
model.resetLayerContext()
|
||||
matrixStack.popPose()
|
||||
}
|
||||
}
|
||||
-5
@@ -134,11 +134,6 @@ open class PosableModel(@Transient override val rootPart: Bone) : ModelFrame {
|
||||
*/
|
||||
open var profileTranslation = Vec3(0.0, 0.0, 0.0)
|
||||
|
||||
open var profilePokedexScale: Float? = null
|
||||
open var profilePokedexTranslation: Vec3? = null
|
||||
open var profileSummaryScale: Float? = null
|
||||
open var profileSummaryTranslation: Vec3? = null
|
||||
|
||||
var red = 1F
|
||||
var green = 1F
|
||||
var blue = 1F
|
||||
|
||||
-76
@@ -1,76 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.client.render.player
|
||||
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.repository.RenderContext
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.repository.VaryingModelRepository
|
||||
import com.mojang.blaze3d.vertex.PoseStack
|
||||
import com.mojang.math.Axis
|
||||
import net.minecraft.client.Minecraft
|
||||
import net.minecraft.client.renderer.MultiBufferSource
|
||||
import net.minecraft.client.renderer.RenderType
|
||||
import net.minecraft.client.renderer.entity.ItemRenderer
|
||||
import net.minecraft.client.renderer.texture.OverlayTexture
|
||||
|
||||
/**
|
||||
* Draws the recalling player's Poké Ball in first person, rising into view from the bottom of the
|
||||
* screen in place of their held item. The world-space beam still starts near the hand (the eye/look
|
||||
* fallback in PokemonRenderer), so this is cosmetic only.
|
||||
*
|
||||
* Called from ItemInHandRendererMixin, which cancels the vanilla main-hand item while recalling.
|
||||
*/
|
||||
object FirstPersonRecallBallRenderer {
|
||||
|
||||
/** Resting position of the ball in view space (right, up, forward). */
|
||||
private const val REST_X = 0.45
|
||||
private const val REST_Y = -0.55
|
||||
private const val REST_Z = -.6
|
||||
/** How far below REST_Y the ball starts before rising into view. */
|
||||
private const val RISE_DISTANCE = 0.6
|
||||
private const val BALL_SCALE = 0.45F
|
||||
|
||||
private val ballContext = RenderContext().also {
|
||||
it.put(RenderContext.RENDER_STATE, RenderContext.RenderState.WORLD)
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if a recall ball was rendered (so the caller should cancel the vanilla item).
|
||||
*/
|
||||
fun render(poseStack: PoseStack, buffer: MultiBufferSource, packedLight: Int, partialTicks: Float): Boolean {
|
||||
val player = Minecraft.getInstance().player ?: return false
|
||||
val anim = RecallArmAnimationTracker.get(player.uuid) ?: return false
|
||||
val rise = RecallArmAnimationTracker.raiseFactor(player.uuid)
|
||||
|
||||
poseStack.pushPose()
|
||||
poseStack.translate(REST_X, REST_Y - RISE_DISTANCE * (1.0 - rise), REST_Z)
|
||||
poseStack.scale(BALL_SCALE, -BALL_SCALE, -BALL_SCALE)
|
||||
|
||||
poseStack.mulPose(Axis.YP.rotationDegrees(180F))
|
||||
poseStack.mulPose(Axis.XP.rotationDegrees(15F))
|
||||
|
||||
val state = anim.ballState
|
||||
val ball = anim.ball
|
||||
val model = VaryingModelRepository.getPoser(ball.name, state)
|
||||
val texture = VaryingModelRepository.getTexture(ball.name, state)
|
||||
state.updatePartialTicks(partialTicks)
|
||||
model.context = ballContext
|
||||
ballContext.put(RenderContext.ASPECTS, state.aspects)
|
||||
ballContext.put(RenderContext.POSABLE_STATE, state)
|
||||
model.applyAnimations(null, state, 0F, 0F, 0F, 0F, 0F)
|
||||
val consumer = ItemRenderer.getFoilBufferDirect(buffer, RenderType.entityCutout(texture), false, false)
|
||||
model.render(ballContext, poseStack, consumer, packedLight, OverlayTexture.NO_OVERLAY, -0x1)
|
||||
model.red = 1F
|
||||
model.green = 1F
|
||||
model.blue = 1F
|
||||
model.resetLayerContext()
|
||||
|
||||
poseStack.popPose()
|
||||
return true
|
||||
}
|
||||
}
|
||||
-73
@@ -1,73 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.client.render.player
|
||||
|
||||
import com.cobblemon.mod.common.client.battle.ClientBallDisplay
|
||||
import com.cobblemon.mod.common.pokeball.PokeBall
|
||||
import java.util.UUID
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import net.minecraft.util.Mth
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
/**
|
||||
* Tracks which players are recalling a Pokémon so we can pose their arm, draw the Poké Ball in their
|
||||
* hand, and start the recall beam from it.
|
||||
*
|
||||
* Keyed by player UUID. Entries time out on their own once the beam is done, and a new recall resets
|
||||
* the timer, so nothing has to clear them.
|
||||
*
|
||||
* Written by PokemonClientDelegate on recall (beamMode 3); read by HumanoidModelMixin, the ball
|
||||
* renderers, and PokemonRenderer.
|
||||
*/
|
||||
object RecallArmAnimationTracker {
|
||||
|
||||
// How long the arm stays raised, in seconds.
|
||||
const val ARM_HOLD_SECONDS = 0.8
|
||||
|
||||
// Fraction of the hold spent easing the arm up at the start and down at the end.
|
||||
private const val EASE_SECONDS = 0.15
|
||||
|
||||
class RecallAnim(
|
||||
val ball: PokeBall,
|
||||
val aspects: Set<String>,
|
||||
val startTimeMs: Long
|
||||
) {
|
||||
val ballState = ClientBallDisplay(ball, aspects)
|
||||
var beamOrigin: Vec3? = null
|
||||
}
|
||||
|
||||
private val activeRecalls = ConcurrentHashMap<UUID, RecallAnim>()
|
||||
|
||||
fun start(playerUuid: UUID, ball: PokeBall, aspects: Set<String>) {
|
||||
activeRecalls[playerUuid] = RecallAnim(ball, aspects, System.currentTimeMillis())
|
||||
}
|
||||
|
||||
/** Returns the active recall for the player, or null if there is none or if it has expired. */
|
||||
fun get(playerUuid: UUID): RecallAnim? {
|
||||
val anim = activeRecalls[playerUuid] ?: return null
|
||||
if (secondsSince(anim) > ARM_HOLD_SECONDS) {
|
||||
activeRecalls.remove(playerUuid)
|
||||
return null
|
||||
}
|
||||
return anim
|
||||
}
|
||||
|
||||
fun isRecalling(playerUuid: UUID): Boolean = get(playerUuid) != null
|
||||
|
||||
private fun secondsSince(anim: RecallAnim) = (System.currentTimeMillis() - anim.startTimeMs) / 1000.0
|
||||
|
||||
/** 0..1 ramp: eases in at the start, holds at 1, eases out at the end. 0 when not recalling. */
|
||||
fun raiseFactor(playerUuid: UUID): Float {
|
||||
val anim = get(playerUuid) ?: return 0F
|
||||
val elapsed = secondsSince(anim)
|
||||
val riseIn = Mth.clamp((elapsed / EASE_SECONDS).toFloat(), 0F, 1F)
|
||||
val fallOut = Mth.clamp(((ARM_HOLD_SECONDS - elapsed) / EASE_SECONDS).toFloat(), 0F, 1F)
|
||||
return minOf(riseIn, fallOut)
|
||||
}
|
||||
}
|
||||
+4
-14
@@ -26,7 +26,6 @@ import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PosableP
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.repository.MiscModelRepository
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.repository.RenderContext
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.repository.VaryingModelRepository
|
||||
import com.cobblemon.mod.common.client.render.player.RecallArmAnimationTracker
|
||||
import com.cobblemon.mod.common.client.render.pokeball.PokeBallPosableState
|
||||
import com.cobblemon.mod.common.client.render.renderBeaconBeam
|
||||
import com.cobblemon.mod.common.client.settings.ServerSettings
|
||||
@@ -61,7 +60,6 @@ import net.minecraft.network.chat.Style
|
||||
import net.minecraft.resources.ResourceLocation
|
||||
import net.minecraft.util.Mth
|
||||
import net.minecraft.world.entity.Entity
|
||||
import net.minecraft.world.entity.player.Player
|
||||
import net.minecraft.world.phys.Vec3
|
||||
import org.joml.*
|
||||
import kotlin.math.*
|
||||
@@ -71,9 +69,6 @@ class PokemonRenderer(
|
||||
) : MobRenderer<PokemonEntity, PosablePokemonEntityModel>(context, PosablePokemonEntityModel(), 0.5f) {
|
||||
companion object {
|
||||
val recallBeamColour = Vector4f(1F, 0.1F, 0.1F, 1F)
|
||||
private const val CAPTURE_BEAM_X_OFFSET = 0.0
|
||||
private const val CAPTURE_BEAM_Y_OFFSET = 0.2
|
||||
private const val CAPTURE_BEAM_Z_OFFSET = 0.45
|
||||
fun ease(x: Double): Double {
|
||||
return 1 - (1 - x).pow(3)
|
||||
}
|
||||
@@ -147,6 +142,8 @@ class PokemonRenderer(
|
||||
}
|
||||
|
||||
modelNow.setLayerContext(buffer, clientDelegate, VaryingModelRepository.getLayers(entity.pokemon.species.resourceIdentifier, clientDelegate))
|
||||
|
||||
|
||||
if (entity.passengers.isNotEmpty()) {
|
||||
renderRiding(entity, entityYaw, partialTicks, poseMatrix, buffer, packedLight)
|
||||
} else {
|
||||
@@ -319,15 +316,8 @@ class PokemonRenderer(
|
||||
fun renderBeam(matrixStack: PoseStack, partialTicks: Float, entity: PokemonEntity, beamTarget: Entity, buffer: MultiBufferSource, offset: Vec3) {
|
||||
val clientDelegate = entity.delegate as PokemonClientDelegate
|
||||
val pokemonPosition = entity.position().add(0.0, entity.bbHeight / 2.0 * clientDelegate.activeSendoutScale.toDouble(), 0.0)
|
||||
|
||||
// If a player is recalling, start the beam from the Poké Ball held in their hand
|
||||
val recallBallOrigin = (beamTarget as? Player)?.let { RecallArmAnimationTracker.get(it.uuid)?.beamOrigin }
|
||||
var beamSourcePosition = if (recallBallOrigin != null) {
|
||||
recallBallOrigin
|
||||
} else if (beamTarget is EmptyPokeBallEntity) {
|
||||
(beamTarget.delegate as PokeBallPosableState).locatorStates["beam"]
|
||||
?.transformPosition(Vec3(CAPTURE_BEAM_X_OFFSET, CAPTURE_BEAM_Y_OFFSET, CAPTURE_BEAM_Z_OFFSET))
|
||||
?: beamTarget.position()
|
||||
var beamSourcePosition = if (beamTarget is EmptyPokeBallEntity) {
|
||||
(beamTarget.delegate as PokeBallPosableState).locatorStates["beam"]?.getOrigin() ?: beamTarget.position()
|
||||
} else {
|
||||
if (beamTarget.uuid == Minecraft.getInstance().player?.uuid) {
|
||||
val lookVec = beamTarget.lookAngle.yRot((PI / 2).toFloat()).multiply(1.0, 0.0, 1.0).normalize()
|
||||
|
||||
@@ -36,7 +36,7 @@ import net.minecraft.world.level.block.Block
|
||||
class StatusCureItem(val itemName: String, vararg val status: Status, block: Block) : ItemNameBlockItem(block, Properties()), PokemonSelectingItem {
|
||||
override val bagItem = object : BagItem {
|
||||
override val itemName = this@StatusCureItem.itemName
|
||||
override val returnItem = Items.GLASS_BOTTLE
|
||||
override val returnItem = Items.AIR
|
||||
override fun canUse(stack: ItemStack, battle: PokemonBattle, target: BattlePokemon) = canUseOnPokemon(stack, target.effectedPokemon)
|
||||
override fun getShowdownInput(actor: BattleActor, battlePokemon: BattlePokemon, data: String?) = "cure_status${status.takeIf { it.isNotEmpty() }?.let { " ${it.joinToString(separator = " ") { it.showdownName } }" } ?: "" }"
|
||||
}
|
||||
|
||||
+1
-2
@@ -2,8 +2,7 @@
|
||||
"portraitScale": 1.03,
|
||||
"portraitTranslation": [-0.31, 0.12, 0],
|
||||
"profileScale": 0.47,
|
||||
"profileTranslation": [0.07, 0.98, 0.0],
|
||||
"profilePokedexTranslation": [0, 0.98, 0],
|
||||
"profileTranslation": [0, 0.98, 0.0],
|
||||
"rootBone": "venusaur",
|
||||
"firstPersonCameraOffset": {
|
||||
"seat_1": [0, 0.25, 0]
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"portraitScale": 1.89,
|
||||
"portraitTranslation": [-0.13, 0.91, 0],
|
||||
"profileScale": 0.77,
|
||||
"profileTranslation": [0, 0.65, 0],
|
||||
"profileScale": 0.63,
|
||||
"profileTranslation": [0, 0.81, 0],
|
||||
"rootBone": "charmeleon",
|
||||
"animations": {
|
||||
"cry": "q.bedrock_stateful('charmeleon', 'cry')"
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"portraitScale": 2.1,
|
||||
"portraitTranslation": [-1.11, 2.43, 0],
|
||||
"profileScale": 0.54,
|
||||
"profileTranslation": [0, 0.92, -10],
|
||||
"profileTranslation": [0, 0.96, -10],
|
||||
"rootBone": "charizard",
|
||||
"firstPersonCameraOffset": {
|
||||
"seat_1": [0, 0.45, 0]
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"portraitScale": 1.89,
|
||||
"portraitTranslation": [-0.8, 1.36, 0.0],
|
||||
"profileScale": 0.57,
|
||||
"profileTranslation": [0, 0.81, 0.0],
|
||||
"profileScale": 0.59,
|
||||
"profileTranslation": [0, 0.84, 0.0],
|
||||
"rootBone": "nidoking",
|
||||
"animations": {
|
||||
"cry": "q.bedrock_stateful('nidoking', 'cry')",
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"portraitScale": 1.8,
|
||||
"portraitTranslation": [-0.35, -0.8, 0],
|
||||
"profileScale": 0.8,
|
||||
"profileTranslation": [0, 0.52, 0.0],
|
||||
"profileTranslation": [0, 0.45, 0.0],
|
||||
"rootBone": "parasect",
|
||||
"firstPersonCameraOffset": {
|
||||
"seat_1": [0, 0.45, 0]
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"portraitScale": 1.96,
|
||||
"portraitTranslation": [ -0.3, 1.86, 0],
|
||||
"portraitTranslation": [ -0.48, 1.61, 0],
|
||||
"profileScale": 0.53,
|
||||
"profileTranslation": [0, 0.92, 0],
|
||||
"rootBone": "mr_rime",
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"portraitScale": 1.73,
|
||||
"portraitTranslation": [-0.45, -1.17, 0],
|
||||
"profileScale": 0.7,
|
||||
"profileTranslation": [0, 0.59, 0],
|
||||
"profileTranslation": [-0.06, 0.59, 0],
|
||||
"rootBone": "dunsparce",
|
||||
"animations": {
|
||||
"cry": "q.bedrock_stateful('dunsparce', 'cry')",
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"portraitScale": 1.73,
|
||||
"portraitTranslation": [-0.09, 0.26, 0],
|
||||
"profileScale": 0.60,
|
||||
"profileTranslation": [0, 0.90, 0],
|
||||
"profileTranslation": [0.16, 0.90, 0],
|
||||
"rootBone": "beautifly",
|
||||
"poses": {
|
||||
"battle-standing": {
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"portraitScale": 1.65,
|
||||
"portraitTranslation": [-0.10, 0.16, 0],
|
||||
"profileScale": 0.63,
|
||||
"profileTranslation": [0, 0.64, 0],
|
||||
"profileTranslation": [0.13, 0.64, 0],
|
||||
"rootBone": "dustox",
|
||||
"poses": {
|
||||
"battle-standing": {
|
||||
|
||||
+1
-3
@@ -2,9 +2,7 @@
|
||||
"portraitScale": 1.63,
|
||||
"portraitTranslation": [-1.76, 1.25, 0],
|
||||
"profileScale": 0.53,
|
||||
"profileTranslation": [0.49, 0.96, 0],
|
||||
"profilePokedexTranslation": [0, 0.96, 0],
|
||||
"profileSummaryTranslation": [-0.30, 0.87, 0],
|
||||
"profileTranslation": [-0.09, 0.92, 0],
|
||||
"rootBone": "drapion",
|
||||
"animations": {
|
||||
"cry": "q.bedrock_stateful('drapion', 'cry')"
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"portraitScale": 1.98,
|
||||
"portraitTranslation": [-0.96, 1.39, 0],
|
||||
"profileScale": 0.59,
|
||||
"profileTranslation": [0, 0.84, 0],
|
||||
"profileTranslation": [0.13, 0.82, 0],
|
||||
"rootBone": "pyroar_female",
|
||||
"animations": {
|
||||
"cry": "q.bedrock_stateful('pyroar_female', 'cry')"
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"portraitScale": 1.89,
|
||||
"portraitTranslation": [-1.12, 1.78, 0],
|
||||
"profileScale": 0.51,
|
||||
"profileTranslation": [0, 0.97, 0],
|
||||
"profileTranslation": [0.12, 0.94, 0],
|
||||
"rootBone": "pyroar_male",
|
||||
"animations": {
|
||||
"cry": "q.bedrock_stateful('pyroar_male', 'cry')"
|
||||
|
||||
+1
-2
@@ -2,8 +2,7 @@
|
||||
"portraitScale": 1.1,
|
||||
"portraitTranslation": [-1.2, -0.009, 0],
|
||||
"profileScale": 0.5,
|
||||
"profileTranslation": [0, 0.96, 0],
|
||||
"profileSummaryTranslation": [-0.20, 0.87, 0],
|
||||
"profileTranslation": [-0.18, 0.96, 0],
|
||||
"rootBone": "dudunsparce",
|
||||
"firstPersonCameraOffset": {
|
||||
"seat_1": [0, 0.45, 0],
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"portraitScale": 1.1,
|
||||
"portraitTranslation": [-0.8, -0.009, 0],
|
||||
"profileScale": 0.5,
|
||||
"profileTranslation": [0, 0.96, 0],
|
||||
"profileTranslation": [-0.18, 0.96, 0],
|
||||
"rootBone": "dudunsparce",
|
||||
"firstPersonCameraOffset": {
|
||||
"seat_1": [0, 0.45, 0],
|
||||
|
||||
@@ -819,7 +819,7 @@
|
||||
"advancements.cobblemon.first_catch.description": "モンスターボールを投げて、ポケモンを捕まえる",
|
||||
"advancements.cobblemon.full_party": "フルハウス",
|
||||
"advancements.cobblemon.full_party.description": "ポケモンをもっとゲットし、手持ちを6匹にする",
|
||||
"advancements.cobblemon.first_evolution": "てれ てれん",
|
||||
"advancements.cobblemon.first_evolution": "新たなる姿",
|
||||
"advancements.cobblemon.first_evolution.description": "進化条件を満たし、ポケモンを進化させる",
|
||||
"advancements.cobblemon.first_battle_victory": "勝利は目の前?",
|
||||
"advancements.cobblemon.first_battle_victory.description": "他のトレーナーに勝利する",
|
||||
@@ -831,7 +831,7 @@
|
||||
"advancements.cobblemon.obtain_leek.description": "淡水で育つ野草、クスリソウを手に入れる",
|
||||
"advancements.cobblemon.medicinal_brew": "町のジョーイさん",
|
||||
"advancements.cobblemon.medicinal_brew.description": "クスリソウを醸造して溶媒のクスリチャを作る",
|
||||
"advancements.cobblemon.brew_potion": "そんな装備で大丈夫か?",
|
||||
"advancements.cobblemon.brew_potion": "お砂糖ひとさじ",
|
||||
"advancements.cobblemon.brew_potion.description": "クスリチャを溶媒にオレンのみを醸造してキズぐすりを作る",
|
||||
"advancements.cobblemon.brew_full_restore": "チャンピオン御用達",
|
||||
"advancements.cobblemon.brew_full_restore.description": "まんたんのくすりを溶媒にラムのみを醸造してかいふくのくすりを作る",
|
||||
@@ -9237,7 +9237,7 @@
|
||||
"cobblemon.ui.edit.habitat.validation.species": "種族名は有効なポケモン名でなければなりません。",
|
||||
"cobblemon.ui.edit.habitat.validation.weight": "重量は0より大きくなければなりません。",
|
||||
"cobblemon.ui.edit.habitat.validation.modifiers": "修飾子の形式が無効です。",
|
||||
"cobblemon.ui.edit.habitat.validation.phases_list": "フェーズには有効な月の満ち欠け(0-7)を指定する必要があります。例:1-3、または1、3-5、6。",
|
||||
"cobblemon.ui.edit.habitat.validation.phases_list": "フェーズでは、整数の範囲を表す際に有効な形式を使用する必要があります。例:1-3、または1、3-5、6。",
|
||||
"cobblemon.ui.edit.habitat.validation.min_light": "最小明るさ度の値は0から15の間でなければなりません。",
|
||||
"cobblemon.ui.edit.habitat.validation.max_light": "最大明るさ度の値は0から15の間でなければなりません。",
|
||||
"cobblemon.ui.moves.learnset.tm.discovered": "発見済み",
|
||||
@@ -9358,5 +9358,25 @@
|
||||
"cobblemon.config.ui.alpha_pokemon_size_extra_large_multiplier.tooltip": "当たり判定が10ブロック以上のポケモンに対するオヤブンサイズ倍率。",
|
||||
"cobblemon.config.ui.alpha_pokemon_size_extra_large_multiplier": "とても大きいオヤブンサイズ倍率",
|
||||
"cobblemon.config.ui.baby_pokemon_level_duration": "ベイビィポケモン期間レベル",
|
||||
"cobblemon.config.ui.baby_pokemon_level_duration.tooltip": "ポケモンが通常よりも小さく見える「ベイビィポケモン」とみなされるレベル数。"
|
||||
"cobblemon.config.ui.baby_pokemon_level_duration.tooltip": "ポケモンが通常よりも小さく見える「ベイビィポケモン」とみなされるレベル数。",
|
||||
"cobblemon.config.ui.baby_pokemon_size_multiplier": "ベイビィポケモンの最小サイズ",
|
||||
"cobblemon.config.ui.baby_pokemon_size_multiplier.tooltip": "レベル1のポケモンに適用されるサイズ倍率。",
|
||||
"cobblemon.config.ui.minimum_riding_scale": "ライドするための最低限のポケモンスケール値",
|
||||
"cobblemon.config.ui.minimum_riding_scale.tooltip": "ポケモンに乗れなくなる限界のスケール。",
|
||||
"cobblemon.config.ui.unlock_all_move_dex_moves_by_default.tooltip": "この機能を有効にすると、わざマシンやレベルアップで覚える技が解放され、わざマシンマシンやポケモン図鑑の技一覧で確認できるようになります。",
|
||||
"cobblemon.config.ui.unlock_all_move_dex_moves_by_default": "全ての技をアンロック",
|
||||
"cobblemon.config.ui.infinite_tm_uses": "わざマシン無限化",
|
||||
"cobblemon.config.ui.infinite_tm_uses.tooltip": "わざマシンで技を教える際、わざマシンが消費されなくなります。",
|
||||
"advancements.cobblemon.use_healing_machine.description": "かいふく装置のチャージを待ち、使用して手持ちのポケモンを回復させる",
|
||||
"advancements.cobblemon.use_healing_machine": "てん てん てれれん",
|
||||
"advancements.cobblemon.plant_all_apricorn_sprouts.description": "あらゆる色のぼんぐりの新芽を植える",
|
||||
"advancements.cobblemon.plant_all_apricorn_sprouts": "ぼんぐりころころぼんぐりこ",
|
||||
"advancements.cobblemon.use_mint.description": "ミントを使ってポケモンのステータスの得意不得意を変える",
|
||||
"advancements.cobblemon.use_mint": "結果にコミント!",
|
||||
"advancements.cobblemon.brew_medicinal_brew.description": "クスリソウを煎じて、薬の基礎となるものを作る",
|
||||
"advancements.cobblemon.brew_medicinal_brew": "ネギらうおくすり",
|
||||
"advancements.cobblemon.brew_all_potions.description": "クスリソウを使って、ありとあらゆるアイテムを作成する",
|
||||
"advancements.cobblemon.brew_all_potions": "一番良いのを頼む",
|
||||
"advancements.cobblemon.use_exp_candy.description": "ポケモンにけいけんアメを使う",
|
||||
"advancements.cobblemon.use_exp_candy": "甘美な経験"
|
||||
}
|
||||
@@ -9258,7 +9258,7 @@
|
||||
"cobblemon.item_class.technical_machine": "招式学习器",
|
||||
"block.cobblemon.damaged_monitor": "损坏的数据显示器",
|
||||
"block.cobblemon.tm_machine": "招式学习器机",
|
||||
"block.cobblemon.disc_shelf": "唱片架",
|
||||
"block.cobblemon.disc_shelf": "光盘架",
|
||||
"cobblemon.fishing_bait_effects.mark_chance.tooltip": "%1$s%% - 证章出现率+%3$s%%",
|
||||
"cobblemon.fishing_bait_effects.alpha_chance.tooltip": "%1$s%% - 头目宝可梦出现率",
|
||||
"cobblemon.fishing_bait_effects.size.tooltip": "%1$s%% - 体型%3$s%%",
|
||||
@@ -9333,5 +9333,11 @@
|
||||
"cobblemon.tms.cannot_learn": "%1$s 不能学习 %2$s!",
|
||||
"cobblemon.tms.unlock_tm": "你解锁了 %1$s 招式学习器!",
|
||||
"cobblemon.tms.new_tms_learned": "学会了新的招式学习器!",
|
||||
"cobblemon.tms.check_tmm": "查看招式学习器机"
|
||||
"cobblemon.tms.check_tmm": "查看招式学习器机",
|
||||
"cobblemon.ui.party.party_select_title": "更改同行队伍选中",
|
||||
"cobblemon.ui.party.party_select_description": "按下 %1$s/%2$s 或长按 %3$s 滑动鼠标滚轮。",
|
||||
"cobblemon.ui.category": "分类",
|
||||
"cobblemon.ui.pp": "PP",
|
||||
"cobblemon.ui.pokemon.alpha": "头目",
|
||||
"cobblemon.ui.edit.habitat.validation.phases_list": "阶段的格式必须使用有效的整数范围,例如:1-3或者1,3-5,6。"
|
||||
}
|
||||
File renamed without changes.
@@ -190,7 +190,7 @@
|
||||
"id": "panpour_simipour",
|
||||
"variant": "item_interact",
|
||||
"result": "simipour",
|
||||
"consumeHeldItem": false,
|
||||
"consumeHeldItem": true,
|
||||
"learnableMoves": [],
|
||||
"requirements": [],
|
||||
"requiredContext": "cobblemon:water_stone"
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
"client.EntryListWidgetMixin",
|
||||
"client.GameRendererMixin",
|
||||
"client.HumanoidModelMixin",
|
||||
"client.ItemInHandLayerMixin",
|
||||
"client.ItemInHandRendererMixin",
|
||||
"client.ItemRendererMixin",
|
||||
"client.LivingEntityRendererMixin",
|
||||
|
||||
Reference in new issue
Block a user