Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
09a0cd6c30 | ||
|
|
30f82bbad6 | ||
|
|
1823eb4979 | ||
|
|
ae4af68797 | ||
|
|
da7f4a2682 | ||
|
|
73c4762801 | ||
|
|
43abfa3c17 | ||
|
|
fb87220fe9 | ||
|
|
84a0ceb7e1 | ||
|
|
ccde7ffbb1 | ||
|
|
4e79ed9f7e | ||
|
|
f11f88c71a | ||
|
|
4f86c6f322 |
No files matched your search
@@ -1,8 +1,9 @@
|
||||
|
||||
import utilities.isSnapshot
|
||||
import utilities.version
|
||||
import java.time.OffsetDateTime
|
||||
import java.time.ZoneOffset
|
||||
import java.time.format.DateTimeFormatter
|
||||
import utilities.isSnapshot
|
||||
import utilities.version
|
||||
|
||||
/*
|
||||
*
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.llamalad7.mixinextras.sugar.Local;
|
||||
import net.minecraft.client.Camera;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import org.joml.Matrix3f;
|
||||
import org.joml.Quaternionf;
|
||||
@@ -34,31 +35,49 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(Camera.class)
|
||||
public abstract class CameraMixin {
|
||||
@Shadow private Entity entity;
|
||||
@Shadow @Final private Quaternionf rotation;
|
||||
@Shadow @Final private Vector3f forwards;
|
||||
@Shadow @Final private Vector3f up;
|
||||
@Shadow @Final private Vector3f left;
|
||||
@Shadow private float xRot;
|
||||
@Shadow private float yRot;
|
||||
@Shadow
|
||||
private Entity entity;
|
||||
@Shadow
|
||||
@Final
|
||||
private Quaternionf rotation;
|
||||
@Shadow
|
||||
@Final
|
||||
private Vector3f forwards;
|
||||
@Shadow
|
||||
@Final
|
||||
private Vector3f up;
|
||||
@Shadow
|
||||
@Final
|
||||
private Vector3f left;
|
||||
@Shadow
|
||||
private float xRot;
|
||||
@Shadow
|
||||
private float yRot;
|
||||
|
||||
@Shadow private float eyeHeight;
|
||||
@Shadow private float eyeHeightOld;
|
||||
@Shadow
|
||||
private float eyeHeight;
|
||||
@Shadow
|
||||
private float eyeHeightOld;
|
||||
|
||||
@Shadow protected abstract void setPosition(Vec3 pos);
|
||||
@Shadow
|
||||
protected abstract void setPosition(Vec3 pos);
|
||||
|
||||
@Unique private float returnTimer = 0;
|
||||
@Unique private float rollAngleStart = 0;
|
||||
@Unique Minecraft minecraft = Minecraft.getInstance();
|
||||
@Unique
|
||||
private float returnTimer = 0;
|
||||
@Unique
|
||||
private float rollAngleStart = 0;
|
||||
@Unique
|
||||
Minecraft minecraft = Minecraft.getInstance();
|
||||
|
||||
@Unique boolean disableRollableCameraDebug = false;
|
||||
@Unique
|
||||
boolean disableRollableCameraDebug = false;
|
||||
|
||||
@Inject(method = "setRotation", at = @At("HEAD"), cancellable = true)
|
||||
public void cobblemon$setRotation(float f, float g, CallbackInfo ci) {
|
||||
if (!(this.entity instanceof OrientationControllable controllable) || disableRollableCameraDebug) return;
|
||||
var controller = controllable.getOrientationController();
|
||||
if (!controller.isActive() && controller.getOrientation() != null) {
|
||||
if(this.returnTimer < 1) {
|
||||
if (this.returnTimer < 1) {
|
||||
//Rotation is taken from entity since we no longer handle mouse ourselves
|
||||
//Stops a period of time when you can't input anything.
|
||||
controller.getOrientation().set(
|
||||
@@ -66,16 +85,17 @@ public abstract class CameraMixin {
|
||||
.rotateY((float) Math.toRadians(180 - this.entity.getYRot()))
|
||||
.rotateX((float) Math.toRadians(-this.entity.getXRot()))
|
||||
);
|
||||
if(rollAngleStart == 0){
|
||||
if (rollAngleStart == 0) {
|
||||
this.returnTimer = 1;
|
||||
controller.reset();
|
||||
return;
|
||||
}
|
||||
controller.getOrientation().rotateZ((float) Math.toRadians(-rollAngleStart*(1-returnTimer)));
|
||||
controller.getOrientation().rotateZ((float) Math.toRadians(-rollAngleStart * (1 - returnTimer)));
|
||||
cobblemon$applyRotation();
|
||||
this.returnTimer += .05F;
|
||||
ci.cancel();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
this.returnTimer = 1;
|
||||
controller.reset();
|
||||
}
|
||||
@@ -89,26 +109,16 @@ public abstract class CameraMixin {
|
||||
ci.cancel();
|
||||
}
|
||||
|
||||
@Inject(method = "setup", at = @At("HEAD"))
|
||||
private void cobblemon$tickAnimationPreRenders(BlockGetter level, Entity entity, boolean detached, boolean thirdPersonReverse, float partialTick, CallbackInfo ci) {
|
||||
MountedPokemonAnimationRenderController.INSTANCE.reset();
|
||||
}
|
||||
|
||||
@WrapOperation(method = "setup", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Camera;setPosition(DDD)V"))
|
||||
public void cobblemon$positionCamera(Camera instance, double x, double y, double z, Operation<Void> original, @Local(ordinal = 1, argsOnly = true) boolean thirdPersonReverse) {
|
||||
Entity entity = instance.getEntity();
|
||||
Entity vehicle = entity.getVehicle();
|
||||
MountedPokemonAnimationRenderController.INSTANCE.reset();
|
||||
|
||||
if(vehicle instanceof Rideable){
|
||||
Vec3 position = MountedCameraRenderer.INSTANCE.getCameraPosition(
|
||||
instance,
|
||||
entity,
|
||||
vehicle,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
thirdPersonReverse,
|
||||
eyeHeightOld,
|
||||
eyeHeight
|
||||
);
|
||||
|
||||
if(position != null){
|
||||
if (cobblemon$isRidingPokemon(entity)) {
|
||||
Vec3 position = MountedCameraRenderer.INSTANCE.getCameraPosition(instance, entity, entity.getVehicle(), thirdPersonReverse, eyeHeightOld, eyeHeight);
|
||||
if (position != null) {
|
||||
setPosition(position);
|
||||
return;
|
||||
}
|
||||
@@ -118,12 +128,18 @@ public abstract class CameraMixin {
|
||||
}
|
||||
|
||||
@Unique
|
||||
private void cobblemon$applyRotation(){
|
||||
if (!(this.entity instanceof OrientationControllable controllable) || controllable.getOrientationController().getOrientation() == null) return;
|
||||
private boolean cobblemon$isRidingPokemon(Entity entity) {
|
||||
return entity.getVehicle() instanceof PokemonEntity;
|
||||
}
|
||||
|
||||
@Unique
|
||||
private void cobblemon$applyRotation() {
|
||||
if (!(this.entity instanceof OrientationControllable controllable) || controllable.getOrientationController().getOrientation() == null)
|
||||
return;
|
||||
var controller = controllable.getOrientationController();
|
||||
var newRotation = controller.getOrientation().normal(new Matrix3f()).getNormalizedRotation(new Quaternionf());
|
||||
if (this.minecraft.options.getCameraType().isMirrored()) {
|
||||
newRotation.rotateY((float)Math.toRadians(180));
|
||||
newRotation.rotateY((float) Math.toRadians(180));
|
||||
}
|
||||
this.rotation.set(newRotation);
|
||||
this.xRot = controller.getPitch();
|
||||
@@ -138,7 +154,7 @@ public abstract class CameraMixin {
|
||||
Entity entity = instance.getEntity();
|
||||
Entity vehicle = entity.getVehicle();
|
||||
|
||||
if (!(vehicle instanceof PokemonEntity) || Cobblemon.config.getThirdPersonViewBobbing()) {
|
||||
if (!(vehicle instanceof PokemonEntity) || Cobblemon.config.getViewBobTranslation()) {
|
||||
original.call(instance, zoom, dy, dx);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -525,13 +525,14 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
|
||||
}
|
||||
})*/
|
||||
|
||||
@JvmField
|
||||
// todo we might need to wait on these for later?
|
||||
/*@JvmField
|
||||
val CHOICE_DUMPLING = noSettingsItem("choice_dumpling") // todo make a ChoiceDumpingItem class for breeding purposes
|
||||
@JvmField
|
||||
val SWAP_SNACK = noSettingsItem("swap_snack") // todo make a SwapSnackItem class for breeding purposes
|
||||
@JvmField
|
||||
val TWICE_SPICED_BEETROOT = noSettingsItem("twice_spiced_beetroot") // todo make a TwiceSpiceBeetrootItem class for breeding purposes
|
||||
|
||||
*/
|
||||
@JvmField
|
||||
val POTATO_MOCHI = create("potato_mochi", object : Item(Properties().stacksTo(16)
|
||||
.food(FoodProperties.Builder()
|
||||
@@ -598,6 +599,8 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
// todo etc?
|
||||
|
||||
//@JvmField
|
||||
|
||||
@@ -344,6 +344,8 @@ object CobblemonClient {
|
||||
private fun registerItemColors() {
|
||||
implementation.registerItemColors(AprijuiceItemColorProvider, *CobblemonItems.aprijuices.toTypedArray())
|
||||
implementation.registerItemColors(PokeBaitItemColorProvider, CobblemonItems.POKE_BAIT)
|
||||
implementation.registerItemColors(PokeBaitItemColorProvider, CobblemonItems.LURE_CAKE)
|
||||
implementation.registerItemColors(PokeBaitItemColorProvider, CobblemonItems.POKE_CAKE)
|
||||
}
|
||||
|
||||
fun reloadCodedAssets(resourceManager: ResourceManager) {
|
||||
|
||||
@@ -0,0 +1,308 @@
|
||||
package com.cobblemon.mod.common.client.render.camera
|
||||
|
||||
import com.cobblemon.mod.common.Cobblemon
|
||||
import com.cobblemon.mod.common.OrientationControllable
|
||||
import com.cobblemon.mod.common.api.riding.Seat
|
||||
import com.cobblemon.mod.common.client.MountedPokemonAnimationRenderController
|
||||
import com.cobblemon.mod.common.client.entity.PokemonClientDelegate
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.FloatingState
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.repository.VaryingModelRepository.getPoser
|
||||
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
|
||||
import com.cobblemon.mod.common.mixin.accessor.CameraAccessor
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import com.cobblemon.mod.common.util.toVec3d
|
||||
import net.minecraft.client.Camera
|
||||
import net.minecraft.client.Minecraft
|
||||
import net.minecraft.resources.ResourceLocation
|
||||
import net.minecraft.util.Mth
|
||||
import net.minecraft.world.entity.Entity
|
||||
import net.minecraft.world.level.ClipContext
|
||||
import net.minecraft.world.phys.HitResult
|
||||
import net.minecraft.world.phys.Vec3
|
||||
import org.joml.Matrix3f
|
||||
import org.joml.Quaternionf
|
||||
import org.joml.Vector3f
|
||||
|
||||
object CameraTransformationController {
|
||||
|
||||
private val transformers = mutableMapOf<Int, MutableList<CameraTransformer>>(
|
||||
1 to mutableListOf(RidingCameraTransformer()),
|
||||
)
|
||||
|
||||
fun register(priority: Int, transformer: CameraTransformer) {
|
||||
if (transformers[priority] == null) {
|
||||
transformers[priority] = mutableListOf()
|
||||
}
|
||||
transformers[priority]!!.add(transformer)
|
||||
}
|
||||
|
||||
fun tick(current: CameraTransformation, delta: Float, context: CameraContext): CameraTransformation {
|
||||
val transformers = transformers.toSortedMap().reversed().values.flatten()
|
||||
transformers.forEach {
|
||||
if (it.condition(context)) {
|
||||
return it.tick(current, delta, context)
|
||||
}
|
||||
}
|
||||
return current
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
interface CameraTransformer {
|
||||
val key: ResourceLocation
|
||||
val condition: (CameraContext) -> Boolean
|
||||
|
||||
fun tick(current: CameraTransformation, delta: Float, context: CameraContext): CameraTransformation
|
||||
fun onStart() {}
|
||||
fun onStop() {}
|
||||
}
|
||||
|
||||
data class CameraTransformation(val position: Vec3, val rotation: Quaternionf, val fov: Int)
|
||||
|
||||
data class CameraContext(
|
||||
val camera: Camera,
|
||||
val entity: Entity,
|
||||
val eyeHeight: Float,
|
||||
val eyeHeightO: Float,
|
||||
val perspective: CameraPerspective
|
||||
)
|
||||
|
||||
enum class CameraPerspective {
|
||||
FIRST_PERSON,
|
||||
THIRD_PERSON_BACK,
|
||||
THIRD_PERSON_FRONT
|
||||
}
|
||||
|
||||
class RidingCameraTransformer : CameraTransformer {
|
||||
override val key = cobblemonResource("camera/riding")
|
||||
override val condition: (CameraContext) -> Boolean = { it.entity.vehicle is PokemonEntity }
|
||||
|
||||
val positionTransformer = RidingCameraPositionTransformer()
|
||||
val viewBobPositionTransformer = RidingCameraViewBobPositionTransformer()
|
||||
val rotationTransformer = OrientationControllerRotationTransformer()
|
||||
val viewBobRotationTransformer = RidingCameraViewBobRotationTransformer()
|
||||
|
||||
override fun tick(current: CameraTransformation, delta: Float, context: CameraContext): CameraTransformation {
|
||||
val vehicle = context.entity.vehicle as? PokemonEntity ?: return current
|
||||
MountedPokemonAnimationRenderController.setup(vehicle, delta)
|
||||
val position = getPosition(delta, context, vehicle)
|
||||
val rotation = getRotation(current, context)
|
||||
val fov = Minecraft.getInstance().options.fov().get()
|
||||
return CameraTransformation(position, rotation, fov)
|
||||
}
|
||||
|
||||
private fun getPosition(delta: Float, context: CameraContext, vehicle: PokemonEntity): Vec3 {
|
||||
if (context.perspective == CameraPerspective.FIRST_PERSON || Cobblemon.config.viewBobTranslation) {
|
||||
return viewBobPositionTransformer.getPosition(delta, context, vehicle)
|
||||
} else {
|
||||
return positionTransformer.getPosition(delta, context, vehicle)
|
||||
}
|
||||
}
|
||||
|
||||
private fun getRotation(current: CameraTransformation, context: CameraContext): Quaternionf {
|
||||
if (Cobblemon.config.viewBobRotation) {
|
||||
return viewBobRotationTransformer.getRotation()
|
||||
}
|
||||
else {
|
||||
return rotationTransformer.getRotation(current.rotation, context)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class RidingCameraPositionTransformer {
|
||||
|
||||
fun getPosition(delta: Float, context: CameraContext, vehicle: PokemonEntity): Vec3 {
|
||||
val position = Vec3(
|
||||
Mth.lerp(delta.toDouble(), vehicle.xOld, vehicle.x),
|
||||
Mth.lerp(delta.toDouble(), vehicle.yOld, vehicle.y),
|
||||
Mth.lerp(delta.toDouble(), vehicle.zOld, vehicle.z)
|
||||
)
|
||||
|
||||
val orientation = getOrientation(context.entity)
|
||||
|
||||
var offset = Vec3.ZERO
|
||||
offset = applyThirdPersonToOffset(offset, context, vehicle)
|
||||
offset = applyRollingToOffset(offset, orientation)
|
||||
offset = applyZoomToOffset(offset, position, context)
|
||||
|
||||
val pivotOffset = applyPivotToOffset(vehicle, context.entity, orientation)
|
||||
return position.add(pivotOffset).add(offset)
|
||||
}
|
||||
fun applyPivotToOffset(vehicle: PokemonEntity, passenger: Entity, orientation: Matrix3f): Vec3 {
|
||||
val seatIndex: Int = vehicle.passengers.indexOf(passenger)
|
||||
if (seatIndex < 0) return Vec3.ZERO
|
||||
val seat: Seat = vehicle.seats[seatIndex]
|
||||
val model = getPoser(vehicle.pokemon.species.resourceIdentifier, FloatingState())
|
||||
val center = Vec3(0.0, passenger.bbHeight / 2.0, 0.0)
|
||||
|
||||
val pivotOffsets = model.thirdPersonPivotOffset
|
||||
if (!pivotOffsets.containsKey(seat.locator)) return Vec3.ZERO
|
||||
|
||||
val pivotOffset = pivotOffsets[seat.locator]!!
|
||||
val rotatedOffset = orientation.transform(pivotOffset.subtract(center).toVector3f())
|
||||
return rotatedOffset.toVec3d().add(center)
|
||||
}
|
||||
|
||||
fun applyThirdPersonToOffset(offset: Vec3, context: CameraContext, vehicle: PokemonEntity): Vec3 {
|
||||
if (context.perspective == CameraPerspective.FIRST_PERSON) return offset
|
||||
|
||||
val model = getPoser(vehicle.pokemon.species.resourceIdentifier, FloatingState())
|
||||
val cameraOffsets = model.thirdPersonCameraOffset
|
||||
|
||||
val seatIndex: Int = vehicle.passengers.indexOf(context.entity)
|
||||
if (seatIndex < 0) return offset
|
||||
val seat: Seat = vehicle.seats[seatIndex]
|
||||
|
||||
val thirdPartyOffset = getThirdPartyOffset(seat, cameraOffsets, context)
|
||||
return offset.add(thirdPartyOffset)
|
||||
}
|
||||
|
||||
private fun getThirdPartyOffset(seat: Seat, offsets: MutableMap<String, Vec3>, context: CameraContext): Vec3 {
|
||||
val locatorName = when (context.perspective) {
|
||||
CameraPerspective.FIRST_PERSON -> seat.locator
|
||||
CameraPerspective.THIRD_PERSON_FRONT -> seat.locator
|
||||
CameraPerspective.THIRD_PERSON_BACK -> "${seat.locator}_reverse"
|
||||
}
|
||||
if (!offsets.containsKey(locatorName)) return Vec3.ZERO
|
||||
|
||||
val offset = offsets[locatorName]!!
|
||||
return when (context.perspective) {
|
||||
CameraPerspective.FIRST_PERSON -> Vec3.ZERO
|
||||
CameraPerspective.THIRD_PERSON_FRONT -> offset
|
||||
CameraPerspective.THIRD_PERSON_BACK -> offset.multiply(1.0, 1.0, -1.0)
|
||||
}
|
||||
}
|
||||
|
||||
fun applyRollingToOffset(offset: Vec3, orientation: Matrix3f): Vec3 {
|
||||
return orientation.transform(offset.toVector3f()).toVec3d()
|
||||
}
|
||||
|
||||
fun applyZoomToOffset(offset: Vec3, pivot: Vec3, context: CameraContext): Vec3 {
|
||||
val offsetDistance = offset.length()
|
||||
val offsetDirection = offset.multiply(1 / offsetDistance, 1 / offsetDistance, 1 / offsetDistance)
|
||||
val maxZoom = getMaxZoom(offsetDistance.toFloat(), offsetDirection.toVector3f(), pivot.toVector3f(), context.camera).toDouble()
|
||||
return offset.multiply(maxZoom, maxZoom, maxZoom)
|
||||
}
|
||||
|
||||
private fun getMaxZoom(maxZoom: Float, directionVector: Vector3f, positionVector: Vector3f, instance: Camera): Float {
|
||||
var maxZoom = maxZoom
|
||||
val pos = Vec3(positionVector)
|
||||
for (i in 0 .. 7) {
|
||||
val g = ((i and 1) * 2 - 1).toFloat()
|
||||
val h = ((i shr 1 and 1) * 2 - 1).toFloat()
|
||||
val j = ((i shr 2 and 1) * 2 - 1).toFloat()
|
||||
val vec3 = pos.add((g * 0.1f).toDouble(), (h * 0.1f).toDouble(), (j * 0.1f).toDouble())
|
||||
val vec32 = vec3.add(Vec3(directionVector).scale(maxZoom.toDouble()))
|
||||
val level = (instance as CameraAccessor).level
|
||||
val hitResult: HitResult =
|
||||
level.clip(ClipContext(vec3, vec32, ClipContext.Block.VISUAL, ClipContext.Fluid.NONE, instance.entity))
|
||||
if (hitResult.type != HitResult.Type.MISS) {
|
||||
val k = hitResult.getLocation().distanceToSqr(pos).toFloat()
|
||||
if (k < Mth.square(maxZoom)) {
|
||||
maxZoom = Mth.sqrt(k)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return maxZoom
|
||||
}
|
||||
|
||||
fun getOrientation(passenger: Entity): Matrix3f {
|
||||
val xRot = (-1 * Math.toRadians(passenger.xRot.toDouble())).toFloat()
|
||||
val controller = (passenger as? OrientationControllable)?.getOrientationController()
|
||||
if (controller == null || !controller.isActive() || controller.orientation == null) {
|
||||
return Matrix3f()
|
||||
.rotateY(Math.toRadians((180f - passenger.yRot).toDouble()).toFloat())
|
||||
.rotateX(xRot)
|
||||
}
|
||||
return controller.orientation!!
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class RidingCameraViewBobPositionTransformer {
|
||||
|
||||
fun getPosition(delta: Float, context: CameraContext, vehicle: PokemonEntity): Vec3 {
|
||||
val position = Vec3(
|
||||
Mth.lerp(delta.toDouble(), vehicle.xOld, vehicle.x),
|
||||
Mth.lerp(delta.toDouble(), vehicle.yOld, vehicle.y),
|
||||
Mth.lerp(delta.toDouble(), vehicle.zOld, vehicle.z)
|
||||
)
|
||||
|
||||
var offset = Vec3.ZERO
|
||||
// Add eye level
|
||||
offset = applyAABBToOffset(context, delta, offset, context.entity)
|
||||
// Add first person offset from poser if found
|
||||
offset = applyFirstPersonToOffset(context, offset, vehicle, context.entity)
|
||||
// Transform the offset based on the entity's orientation
|
||||
offset = applyRollingToOffset(offset, delta, context.entity)
|
||||
// Add the offset from the locator
|
||||
offset = applyLocatorToOffset(offset, vehicle, context.entity)
|
||||
|
||||
return position.add(offset)
|
||||
}
|
||||
|
||||
private fun applyLocatorToOffset(offset: Vec3, vehicle: PokemonEntity, passenger: Entity): Vec3 {
|
||||
val seatIndex: Int = vehicle.passengers.indexOf(passenger)
|
||||
if (seatIndex < 0) return offset
|
||||
val seat: Seat = vehicle.seats[seatIndex]
|
||||
val delegate = vehicle.delegate as PokemonClientDelegate
|
||||
val locator = delegate.locatorStates[seat.locator] ?: return offset
|
||||
return offset.add(Vec3(locator.matrix.getTranslation(Vector3f())))
|
||||
}
|
||||
|
||||
private fun applyAABBToOffset(context: CameraContext, delta: Float, offset: Vec3, passenger: Entity): Vec3 {
|
||||
val currEyeHeight: Double =
|
||||
Mth.lerp(delta.toDouble(), context.eyeHeight.toDouble(), context.eyeHeightO.toDouble())
|
||||
return offset.add(0.0, currEyeHeight - (passenger.bbHeight / 2), 0.0)
|
||||
}
|
||||
|
||||
private fun applyRollingToOffset(offset: Vec3, delta: Float, passenger: Entity): Vec3 {
|
||||
val rollable = passenger as? OrientationControllable ?: return offset
|
||||
val controller = rollable.getOrientationController()
|
||||
if (!controller.isActive()) return offset
|
||||
|
||||
return controller.getRenderOrientation(delta).transform(offset.toVector3f()).toVec3d()
|
||||
}
|
||||
|
||||
private fun applyFirstPersonToOffset(
|
||||
context: CameraContext,
|
||||
offset: Vec3,
|
||||
vehicle: PokemonEntity,
|
||||
passenger: Entity
|
||||
): Vec3 {
|
||||
if (context.perspective != CameraPerspective.FIRST_PERSON) return offset
|
||||
|
||||
val model = getPoser(vehicle.pokemon.species.resourceIdentifier, FloatingState())
|
||||
val seatIndex: Int = vehicle.passengers.indexOf(passenger)
|
||||
val seat: Seat = vehicle.seats[seatIndex]
|
||||
val cameraOffsets = model.firstPersonCameraOffset
|
||||
|
||||
return when (cameraOffsets.containsKey(seat.locator)) {
|
||||
true -> cameraOffsets[seat.locator]!!
|
||||
false -> Vec3.ZERO
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class RidingCameraViewBobRotationTransformer {
|
||||
|
||||
fun getRotation(): Quaternionf {
|
||||
TODO()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class OrientationControllerRotationTransformer {
|
||||
|
||||
fun getRotation(current: Quaternionf, context: CameraContext): Quaternionf {
|
||||
val entity = context.entity
|
||||
val controllable = entity as? OrientationControllable ?: return current
|
||||
|
||||
val controller = controllable.getOrientationController()
|
||||
val orientation = controller.orientation ?: return current
|
||||
return orientation.normal(Matrix3f()).getNormalizedRotation(Quaternionf())
|
||||
}
|
||||
|
||||
}
|
||||
@@ -33,9 +33,6 @@ object MountedCameraRenderer
|
||||
instance: Camera,
|
||||
entity: Entity,
|
||||
vehicle: Entity,
|
||||
x: Double,
|
||||
y: Double,
|
||||
z: Double,
|
||||
thirdPersonReverse: Boolean,
|
||||
eyeHeightOld: Double,
|
||||
eyeHeight: Double
|
||||
@@ -59,7 +56,7 @@ object MountedCameraRenderer
|
||||
|
||||
|
||||
// First person and view bobbing are handled the same way.
|
||||
if (!instance.isDetached || Cobblemon.config.thirdPersonViewBobbing) {
|
||||
if (!instance.isDetached || Cobblemon.config.viewBobTranslation) {
|
||||
val delegate = vehicle.delegate as PokemonClientDelegate
|
||||
val locator = delegate.locatorStates[seat.locator]
|
||||
|
||||
@@ -176,4 +173,4 @@ object MountedCameraRenderer
|
||||
|
||||
return maxZoom
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -262,8 +262,11 @@ class CobblemonConfig {
|
||||
@CobblemonConfigField(Category.Interface, lang = "party_portrait_animations")
|
||||
var partyPortraitAnimations = PortraitStyle.NEVER_ANIMATE
|
||||
|
||||
@CobblemonConfigField(Category.Riding, lang = "third_person_view_bobbing")
|
||||
var thirdPersonViewBobbing = false
|
||||
@CobblemonConfigField(Category.Riding, lang = "view_bob_translation")
|
||||
var viewBobTranslation = false
|
||||
|
||||
@CobblemonConfigField(Category.Riding, lang = "view_bob_rotation")
|
||||
var viewBobRotation = false
|
||||
|
||||
@CobblemonConfigField(Category.Riding, lang = "invert_roll")
|
||||
var invertRoll = false
|
||||
|
||||
@@ -10,6 +10,8 @@ package com.cobblemon.mod.common.entity.npc
|
||||
|
||||
import com.bedrockk.molang.runtime.MoLangRuntime
|
||||
import com.bedrockk.molang.runtime.struct.VariableStruct
|
||||
import com.bedrockk.molang.runtime.value.DoubleValue
|
||||
import com.bedrockk.molang.runtime.value.MoValue
|
||||
import com.cobblemon.mod.common.*
|
||||
import com.cobblemon.mod.common.CobblemonNetwork.sendPacket
|
||||
import com.cobblemon.mod.common.api.entity.PokemonSender
|
||||
@@ -320,6 +322,22 @@ class NPCEntity(world: Level) : AgeableMob(CobblemonEntities.NPC, world), Npc, P
|
||||
DebugPackets.sendPathFindingPacket(level(), this, this.navigation.path, this.navigation.path?.distToTarget ?: 0F)
|
||||
}
|
||||
|
||||
override fun broadcastToPlayer(player: ServerPlayer): Boolean {
|
||||
if(handleHideNPC(player, this)) {
|
||||
return false
|
||||
}
|
||||
return super.broadcastToPlayer(player)
|
||||
}
|
||||
|
||||
private fun handleHideNPC(player: Player, npc: NPCEntity): Boolean {
|
||||
val value = Cobblemon.molangData.load(player.uuid).map[npc.stringUUID]
|
||||
if (value is VariableStruct) {
|
||||
val hide = value.map["hide"] as? DoubleValue
|
||||
return hide?.asDouble() == 1.0
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
override fun saveWithoutId(nbt: CompoundTag): CompoundTag {
|
||||
super.saveWithoutId(nbt)
|
||||
nbt.put(DataKeys.NPC_DATA, MoLangFunctions.writeMoValueToNBT(data))
|
||||
|
||||
@@ -20,13 +20,13 @@ import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
* @author Hiroku
|
||||
* @since November 28th, 2021
|
||||
*/
|
||||
abstract class PokemonUpdatePacket<T>(val pokemon: () -> Pokemon) : NetworkPacket<T> where T : NetworkPacket<T> {
|
||||
abstract class PokemonUpdatePacket<T>(val pokemon: () -> Pokemon?) : NetworkPacket<T> where T : NetworkPacket<T> {
|
||||
|
||||
final override fun encode(buffer: RegistryFriendlyByteBuf) {
|
||||
val pokemon = pokemon()
|
||||
// This won't ever happen in instances where packets get sent out, but they protect us from NPEs on fields that require synchronization on load/save
|
||||
buffer.writeUUID(pokemon.storeCoordinates.get()?.store?.uuid ?: UUID.randomUUID())
|
||||
buffer.writeUUID(pokemon.uuid)
|
||||
buffer.writeUUID(pokemon?.storeCoordinates?.get()?.store?.uuid ?: UUID.randomUUID())
|
||||
buffer.writeUUID(pokemon?.uuid ?: UUID.randomUUID())
|
||||
encodeDetails(buffer)
|
||||
}
|
||||
|
||||
@@ -41,12 +41,12 @@ abstract class PokemonUpdatePacket<T>(val pokemon: () -> Pokemon) : NetworkPacke
|
||||
* Reads the current Pokémon from the given [buffer].
|
||||
*
|
||||
* @param buffer The [ByteBuf] being decoded.
|
||||
* @return The [Pokemon] found.
|
||||
* @return The [Pokemon] found. Can be null in flashback replays
|
||||
*/
|
||||
fun decodePokemon(buffer: RegistryFriendlyByteBuf) : () -> Pokemon {
|
||||
fun decodePokemon(buffer: RegistryFriendlyByteBuf) : () -> Pokemon? {
|
||||
val storeId = buffer.readUUID()
|
||||
val pokemonId = buffer.readUUID()
|
||||
return { CobblemonClient.storage.locatePokemon(storeId, pokemonId)!! }
|
||||
return { CobblemonClient.storage.locatePokemon(storeId, pokemonId) }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
* @author Hiroku
|
||||
* @since November 1st, 2022
|
||||
*/
|
||||
class AbilityUpdatePacket(pokemon: () -> Pokemon, ability: AbilityTemplate) : SingleUpdatePacket<AbilityTemplate, AbilityUpdatePacket>(pokemon, ability) {
|
||||
class AbilityUpdatePacket(pokemon: () -> Pokemon?, ability: AbilityTemplate) : SingleUpdatePacket<AbilityTemplate, AbilityUpdatePacket>(pokemon, ability) {
|
||||
|
||||
override val id = ID
|
||||
|
||||
|
||||
@@ -11,10 +11,12 @@ package com.cobblemon.mod.common.net.messages.client.pokemon.update
|
||||
import com.cobblemon.mod.common.api.mark.Mark
|
||||
import com.cobblemon.mod.common.api.mark.Marks
|
||||
import com.cobblemon.mod.common.pokemon.Pokemon
|
||||
import com.cobblemon.mod.common.util.*
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import com.cobblemon.mod.common.util.readIdentifier
|
||||
import com.cobblemon.mod.common.util.writeIdentifier
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
|
||||
class ActiveMarkUpdatePacket(pokemon: () -> Pokemon, value: Mark?): SingleUpdatePacket<Mark?, ActiveMarkUpdatePacket>(pokemon, value) {
|
||||
class ActiveMarkUpdatePacket(pokemon: () -> Pokemon?, value: Mark?): SingleUpdatePacket<Mark?, ActiveMarkUpdatePacket>(pokemon, value) {
|
||||
override val id = ID
|
||||
override fun encodeValue(buffer: RegistryFriendlyByteBuf) {
|
||||
buffer.writeNullable(this.value) { _, v -> buffer.writeIdentifier(v.identifier) }
|
||||
|
||||
@@ -15,7 +15,7 @@ import com.cobblemon.mod.common.util.writeString
|
||||
import io.netty.buffer.ByteBuf
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
|
||||
class AspectsUpdatePacket(pokemon: () -> Pokemon, value: Set<String>): SingleUpdatePacket<Set<String>, AspectsUpdatePacket>(pokemon, value) {
|
||||
class AspectsUpdatePacket(pokemon: () -> Pokemon?, value: Set<String>): SingleUpdatePacket<Set<String>, AspectsUpdatePacket>(pokemon, value) {
|
||||
override val id = ID
|
||||
override fun encodeValue(buffer: RegistryFriendlyByteBuf) {
|
||||
buffer.writeCollection(this.value) { pb, value -> pb.writeString(value) }
|
||||
|
||||
@@ -13,7 +13,7 @@ import com.cobblemon.mod.common.pokemon.Pokemon
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
|
||||
class BenchedMovesUpdatePacket(pokemon: () -> Pokemon, value: BenchedMoves): SingleUpdatePacket<BenchedMoves, BenchedMovesUpdatePacket>(pokemon, value) {
|
||||
class BenchedMovesUpdatePacket(pokemon: () -> Pokemon?, value: BenchedMoves): SingleUpdatePacket<BenchedMoves, BenchedMovesUpdatePacket>(pokemon, value) {
|
||||
override val id = ID
|
||||
override fun encodeValue(buffer: RegistryFriendlyByteBuf) {
|
||||
this.value.saveToBuffer(buffer)
|
||||
|
||||
@@ -18,7 +18,7 @@ import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
* @author Deltric
|
||||
* @since January 13th, 2022
|
||||
*/
|
||||
abstract class BooleanUpdatePacket<T : NetworkPacket<T>>(pokemon: () -> Pokemon, value: Boolean) : SingleUpdatePacket<Boolean, T>(pokemon, value) {
|
||||
abstract class BooleanUpdatePacket<T : NetworkPacket<T>>(pokemon: () -> Pokemon?, value: Boolean) : SingleUpdatePacket<Boolean, T>(pokemon, value) {
|
||||
override fun encodeValue(buffer: RegistryFriendlyByteBuf) {
|
||||
buffer.writeBoolean(this.value)
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ import com.cobblemon.mod.common.util.readIdentifier
|
||||
import com.cobblemon.mod.common.util.writeIdentifier
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
|
||||
class CaughtBallUpdatePacket(pokemon: () -> Pokemon, value: PokeBall): SingleUpdatePacket<PokeBall, CaughtBallUpdatePacket>(pokemon, value) {
|
||||
class CaughtBallUpdatePacket(pokemon: () -> Pokemon?, value: PokeBall): SingleUpdatePacket<PokeBall, CaughtBallUpdatePacket>(pokemon, value) {
|
||||
override val id = ID
|
||||
override fun encodeValue(buffer: RegistryFriendlyByteBuf) {
|
||||
buffer.writeIdentifier(this.value.name)
|
||||
|
||||
@@ -15,7 +15,7 @@ import com.cobblemon.mod.common.util.writeItemStack
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
import net.minecraft.world.item.ItemStack
|
||||
|
||||
class CosmeticItemUpdatePacket(pokemon: () -> Pokemon, value: ItemStack) : SingleUpdatePacket<ItemStack, CosmeticItemUpdatePacket>(pokemon, value) {
|
||||
class CosmeticItemUpdatePacket(pokemon: () -> Pokemon?, value: ItemStack) : SingleUpdatePacket<ItemStack, CosmeticItemUpdatePacket>(pokemon, value) {
|
||||
override val id = ID
|
||||
|
||||
override fun encodeValue(buffer: RegistryFriendlyByteBuf) {
|
||||
|
||||
@@ -20,7 +20,7 @@ import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
* @author Segfault Guy
|
||||
* @since July 27, 2023
|
||||
*/
|
||||
class DmaxLevelUpdatePacket(pokemon: () -> Pokemon, value: Int) : IntUpdatePacket<DmaxLevelUpdatePacket>(pokemon, value) {
|
||||
class DmaxLevelUpdatePacket(pokemon: () -> Pokemon?, value: Int) : IntUpdatePacket<DmaxLevelUpdatePacket>(pokemon, value) {
|
||||
override val id = ID
|
||||
override fun getSize() = IntSize.U_BYTE
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import com.cobblemon.mod.common.util.readSizedInt
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
|
||||
class ExperienceUpdatePacket(pokemon: () -> Pokemon, value: Int) : IntUpdatePacket<ExperienceUpdatePacket>(pokemon, value) {
|
||||
class ExperienceUpdatePacket(pokemon: () -> Pokemon?, value: Int) : IntUpdatePacket<ExperienceUpdatePacket>(pokemon, value) {
|
||||
override val id = ID
|
||||
override fun getSize() = IntSize.INT
|
||||
override fun set(pokemon: Pokemon, value: Int) = pokemon.setExperienceAndUpdateLevel(value)
|
||||
|
||||
@@ -14,7 +14,7 @@ import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
import net.minecraft.resources.ResourceLocation
|
||||
|
||||
class FormUpdatePacket(pokemon: () -> Pokemon, form: FormData) : SingleUpdatePacket<FormData, FormUpdatePacket>(pokemon, form) {
|
||||
class FormUpdatePacket(pokemon: () -> Pokemon?, form: FormData) : SingleUpdatePacket<FormData, FormUpdatePacket>(pokemon, form) {
|
||||
override fun encodeValue(buffer: RegistryFriendlyByteBuf) {
|
||||
this.value.encode(buffer)
|
||||
}
|
||||
@@ -30,7 +30,7 @@ class FormUpdatePacket(pokemon: () -> Pokemon, form: FormData) : SingleUpdatePac
|
||||
fun decode(buffer: RegistryFriendlyByteBuf): FormUpdatePacket {
|
||||
val pokemon = decodePokemon(buffer)
|
||||
val form = FormData()
|
||||
form.species = pokemon().species
|
||||
form.species = pokemon()!!.species
|
||||
form.decode(buffer)
|
||||
return FormUpdatePacket(pokemon, form)
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import com.cobblemon.mod.common.util.readSizedInt
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
|
||||
class FriendshipUpdatePacket(pokemon: () -> Pokemon, value: Int) : IntUpdatePacket<FriendshipUpdatePacket>(pokemon, value) {
|
||||
class FriendshipUpdatePacket(pokemon: () -> Pokemon?, value: Int) : IntUpdatePacket<FriendshipUpdatePacket>(pokemon, value) {
|
||||
override val id = ID
|
||||
override fun getSize() = IntSize.U_BYTE
|
||||
override fun set(pokemon: Pokemon, value: Int) {
|
||||
|
||||
@@ -15,7 +15,7 @@ import com.cobblemon.mod.common.util.readEnumConstant
|
||||
import com.cobblemon.mod.common.util.writeEnumConstant
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
|
||||
class GenderUpdatePacket(pokemon: () -> Pokemon, value: Gender): SingleUpdatePacket<Gender, GenderUpdatePacket>(pokemon, value) {
|
||||
class GenderUpdatePacket(pokemon: () -> Pokemon?, value: Gender): SingleUpdatePacket<Gender, GenderUpdatePacket>(pokemon, value) {
|
||||
override val id = ID
|
||||
override fun encodeValue(buffer: RegistryFriendlyByteBuf) {
|
||||
buffer.writeEnumConstant(this.value)
|
||||
|
||||
@@ -18,7 +18,7 @@ import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
* @author Segfault Guy
|
||||
* @since July 27, 2023
|
||||
*/
|
||||
class GmaxFactorUpdatePacket(pokemon: () -> Pokemon, value: Boolean) : BooleanUpdatePacket<GmaxFactorUpdatePacket>(pokemon, value) {
|
||||
class GmaxFactorUpdatePacket(pokemon: () -> Pokemon?, value: Boolean) : BooleanUpdatePacket<GmaxFactorUpdatePacket>(pokemon, value) {
|
||||
override val id = ID
|
||||
|
||||
override fun set(pokemon: Pokemon, value: Boolean) {
|
||||
|
||||
@@ -20,7 +20,7 @@ import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
* @author Hiroku
|
||||
* @since February 12, 2022
|
||||
*/
|
||||
class HealthUpdatePacket(pokemon: () -> Pokemon, value: Int) : IntUpdatePacket<HealthUpdatePacket>(pokemon, value) {
|
||||
class HealthUpdatePacket(pokemon: () -> Pokemon?, value: Int) : IntUpdatePacket<HealthUpdatePacket>(pokemon, value) {
|
||||
override val id = ID
|
||||
override fun getSize() = IntSize.U_SHORT
|
||||
override fun set(pokemon: Pokemon, value: Int) {
|
||||
|
||||
@@ -15,7 +15,7 @@ import com.cobblemon.mod.common.util.writeItemStack
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
import net.minecraft.world.item.ItemStack
|
||||
|
||||
class HeldItemUpdatePacket(pokemon: () -> Pokemon, value: ItemStack): SingleUpdatePacket<ItemStack, HeldItemUpdatePacket>(pokemon, value) {
|
||||
class HeldItemUpdatePacket(pokemon: () -> Pokemon?, value: ItemStack): SingleUpdatePacket<ItemStack, HeldItemUpdatePacket>(pokemon, value) {
|
||||
|
||||
override val id = ID
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
* @author Hiroku
|
||||
* @since November 28th, 2021
|
||||
*/
|
||||
abstract class IntUpdatePacket<T : NetworkPacket<T>>(pokemon: () -> Pokemon, value: Int) : SingleUpdatePacket<Int, T>(pokemon, value) {
|
||||
abstract class IntUpdatePacket<T : NetworkPacket<T>>(pokemon: () -> Pokemon?, value: Int) : SingleUpdatePacket<Int, T>(pokemon, value) {
|
||||
|
||||
abstract fun getSize(): IntSize
|
||||
|
||||
|
||||
@@ -11,10 +11,12 @@ package com.cobblemon.mod.common.net.messages.client.pokemon.update
|
||||
import com.cobblemon.mod.common.api.mark.Mark
|
||||
import com.cobblemon.mod.common.api.mark.Marks
|
||||
import com.cobblemon.mod.common.pokemon.Pokemon
|
||||
import com.cobblemon.mod.common.util.*
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import com.cobblemon.mod.common.util.readIdentifier
|
||||
import com.cobblemon.mod.common.util.writeIdentifier
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
|
||||
class MarkAddUpdatePacket(pokemon: () -> Pokemon, value: Mark?): SingleUpdatePacket<Mark?, MarkAddUpdatePacket>(pokemon, value) {
|
||||
class MarkAddUpdatePacket(pokemon: () -> Pokemon?, value: Mark?): SingleUpdatePacket<Mark?, MarkAddUpdatePacket>(pokemon, value) {
|
||||
override val id = ID
|
||||
override fun encodeValue(buffer: RegistryFriendlyByteBuf) {
|
||||
buffer.writeNullable(this.value) { _, v -> buffer.writeIdentifier(v.identifier) }
|
||||
|
||||
@@ -11,10 +11,12 @@ package com.cobblemon.mod.common.net.messages.client.pokemon.update
|
||||
import com.cobblemon.mod.common.api.mark.Mark
|
||||
import com.cobblemon.mod.common.api.mark.Marks
|
||||
import com.cobblemon.mod.common.pokemon.Pokemon
|
||||
import com.cobblemon.mod.common.util.*
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import com.cobblemon.mod.common.util.readIdentifier
|
||||
import com.cobblemon.mod.common.util.writeIdentifier
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
|
||||
class MarkPotentialAddUpdatePacket(pokemon: () -> Pokemon, value: Mark?): SingleUpdatePacket<Mark?, MarkPotentialAddUpdatePacket>(pokemon, value) {
|
||||
class MarkPotentialAddUpdatePacket(pokemon: () -> Pokemon?, value: Mark?): SingleUpdatePacket<Mark?, MarkPotentialAddUpdatePacket>(pokemon, value) {
|
||||
override val id = ID
|
||||
override fun encodeValue(buffer: RegistryFriendlyByteBuf) {
|
||||
buffer.writeNullable(this.value) { _, v -> buffer.writeIdentifier(v.identifier) }
|
||||
|
||||
@@ -11,10 +11,12 @@ package com.cobblemon.mod.common.net.messages.client.pokemon.update
|
||||
import com.cobblemon.mod.common.api.mark.Mark
|
||||
import com.cobblemon.mod.common.api.mark.Marks
|
||||
import com.cobblemon.mod.common.pokemon.Pokemon
|
||||
import com.cobblemon.mod.common.util.*
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import com.cobblemon.mod.common.util.readIdentifier
|
||||
import com.cobblemon.mod.common.util.writeIdentifier
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
|
||||
class MarkRemoveUpdatePacket(pokemon: () -> Pokemon, value: Mark?): SingleUpdatePacket<Mark?, MarkRemoveUpdatePacket>(pokemon, value) {
|
||||
class MarkRemoveUpdatePacket(pokemon: () -> Pokemon?, value: Mark?): SingleUpdatePacket<Mark?, MarkRemoveUpdatePacket>(pokemon, value) {
|
||||
override val id = ID
|
||||
override fun encodeValue(buffer: RegistryFriendlyByteBuf) {
|
||||
buffer.writeNullable(this.value) { _, v -> buffer.writeIdentifier(v.identifier) }
|
||||
|
||||
@@ -13,7 +13,7 @@ import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import io.netty.buffer.ByteBuf
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
|
||||
class MarkingsUpdatePacket(pokemon: () -> Pokemon, value: List<Int>): SingleUpdatePacket<List<Int>, MarkingsUpdatePacket>(pokemon, value) {
|
||||
class MarkingsUpdatePacket(pokemon: () -> Pokemon?, value: List<Int>): SingleUpdatePacket<List<Int>, MarkingsUpdatePacket>(pokemon, value) {
|
||||
override val id = ID
|
||||
override fun encodeValue(buffer: RegistryFriendlyByteBuf) {
|
||||
buffer.writeCollection(this.value) { pb, value -> pb.writeInt(value) }
|
||||
|
||||
@@ -11,11 +11,13 @@ package com.cobblemon.mod.common.net.messages.client.pokemon.update
|
||||
import com.cobblemon.mod.common.api.mark.Mark
|
||||
import com.cobblemon.mod.common.api.mark.Marks
|
||||
import com.cobblemon.mod.common.pokemon.Pokemon
|
||||
import com.cobblemon.mod.common.util.*
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import com.cobblemon.mod.common.util.readIdentifier
|
||||
import com.cobblemon.mod.common.util.writeIdentifier
|
||||
import io.netty.buffer.ByteBuf
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
|
||||
class MarksPotentialUpdatePacket(pokemon: () -> Pokemon, value: MutableSet<Mark>): SingleUpdatePacket<MutableSet<Mark>, MarksPotentialUpdatePacket>(pokemon, value) {
|
||||
class MarksPotentialUpdatePacket(pokemon: () -> Pokemon?, value: MutableSet<Mark>): SingleUpdatePacket<MutableSet<Mark>, MarksPotentialUpdatePacket>(pokemon, value) {
|
||||
override val id = ID
|
||||
override fun encodeValue(buffer: RegistryFriendlyByteBuf) {
|
||||
buffer.writeCollection(this.value) { pb, value -> pb.writeIdentifier(value.identifier) }
|
||||
|
||||
@@ -11,11 +11,13 @@ package com.cobblemon.mod.common.net.messages.client.pokemon.update
|
||||
import com.cobblemon.mod.common.api.mark.Mark
|
||||
import com.cobblemon.mod.common.api.mark.Marks
|
||||
import com.cobblemon.mod.common.pokemon.Pokemon
|
||||
import com.cobblemon.mod.common.util.*
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import com.cobblemon.mod.common.util.readIdentifier
|
||||
import com.cobblemon.mod.common.util.writeIdentifier
|
||||
import io.netty.buffer.ByteBuf
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
|
||||
class MarksUpdatePacket(pokemon: () -> Pokemon, value: MutableSet<Mark>): SingleUpdatePacket<MutableSet<Mark>, MarksUpdatePacket>(pokemon, value) {
|
||||
class MarksUpdatePacket(pokemon: () -> Pokemon?, value: MutableSet<Mark>): SingleUpdatePacket<MutableSet<Mark>, MarksUpdatePacket>(pokemon, value) {
|
||||
override val id = ID
|
||||
override fun encodeValue(buffer: RegistryFriendlyByteBuf) {
|
||||
buffer.writeCollection(this.value) { pb, value -> pb.writeIdentifier(value.identifier) }
|
||||
|
||||
@@ -13,7 +13,7 @@ import com.cobblemon.mod.common.pokemon.Pokemon
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
|
||||
class MoveSetUpdatePacket(pokemon: () -> Pokemon, value: MoveSet) : SingleUpdatePacket<MoveSet, MoveSetUpdatePacket>(pokemon, value) {
|
||||
class MoveSetUpdatePacket(pokemon: () -> Pokemon?, value: MoveSet) : SingleUpdatePacket<MoveSet, MoveSetUpdatePacket>(pokemon, value) {
|
||||
override val id = ID
|
||||
override fun encodeValue(buffer: RegistryFriendlyByteBuf) {
|
||||
this.value.saveToBuffer(buffer)
|
||||
|
||||
@@ -19,7 +19,7 @@ import com.cobblemon.mod.common.util.writeIdentifier
|
||||
import com.cobblemon.mod.common.util.writeNullable
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
|
||||
class NatureUpdatePacket(pokemon: () -> Pokemon, val nature: Nature?, val minted: Boolean) : PokemonUpdatePacket<NatureUpdatePacket>(pokemon) {
|
||||
class NatureUpdatePacket(pokemon: () -> Pokemon?, val nature: Nature?, val minted: Boolean) : PokemonUpdatePacket<NatureUpdatePacket>(pokemon) {
|
||||
|
||||
override val id = ID
|
||||
|
||||
@@ -31,7 +31,7 @@ class NatureUpdatePacket(pokemon: () -> Pokemon, val nature: Nature?, val minted
|
||||
override fun applyToPokemon() {
|
||||
// Check for removing mint
|
||||
if (minted && nature == null) {
|
||||
pokemon().mintedNature = null
|
||||
pokemon()!!.mintedNature = null
|
||||
return
|
||||
} else {
|
||||
// Validate the nature locally
|
||||
@@ -42,9 +42,9 @@ class NatureUpdatePacket(pokemon: () -> Pokemon, val nature: Nature?, val minted
|
||||
|
||||
// Check which nature to modify
|
||||
if (!minted) {
|
||||
pokemon().nature = nature
|
||||
pokemon()!!.nature = nature
|
||||
} else {
|
||||
pokemon().mintedNature = nature
|
||||
pokemon()!!.mintedNature = nature
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import com.cobblemon.mod.common.util.writeText
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
import net.minecraft.network.chat.MutableComponent
|
||||
|
||||
class NicknameUpdatePacket(pokemon: () -> Pokemon, value: MutableComponent?): SingleUpdatePacket<MutableComponent?, NicknameUpdatePacket>(pokemon, value) {
|
||||
class NicknameUpdatePacket(pokemon: () -> Pokemon?, value: MutableComponent?): SingleUpdatePacket<MutableComponent?, NicknameUpdatePacket>(pokemon, value) {
|
||||
override val id = ID
|
||||
|
||||
override fun encodeValue(buffer: RegistryFriendlyByteBuf) {
|
||||
|
||||
@@ -14,7 +14,7 @@ import com.cobblemon.mod.common.util.readString
|
||||
import com.cobblemon.mod.common.util.writeString
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
|
||||
class OriginalTrainerUpdatePacket(pokemon: () -> Pokemon, username: String?) : SingleUpdatePacket<String?, OriginalTrainerUpdatePacket>(pokemon, username) {
|
||||
class OriginalTrainerUpdatePacket(pokemon: () -> Pokemon?, username: String?) : SingleUpdatePacket<String?, OriginalTrainerUpdatePacket>(pokemon, username) {
|
||||
override val id = ID
|
||||
|
||||
override fun encodeValue(buffer: RegistryFriendlyByteBuf) {
|
||||
|
||||
@@ -13,7 +13,7 @@ import com.cobblemon.mod.common.pokemon.activestate.PokemonState
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
|
||||
class PokemonStateUpdatePacket(pokemon: () -> Pokemon, value: PokemonState): SingleUpdatePacket<PokemonState, PokemonStateUpdatePacket>(pokemon, value) {
|
||||
class PokemonStateUpdatePacket(pokemon: () -> Pokemon?, value: PokemonState): SingleUpdatePacket<PokemonState, PokemonStateUpdatePacket>(pokemon, value) {
|
||||
|
||||
override val id = ID
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import com.cobblemon.mod.common.util.readEnumConstant
|
||||
import com.cobblemon.mod.common.util.writeEnumConstant
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
|
||||
class RideBoostsUpdatePacket(pokemon: () -> Pokemon, rideBoosts: Map<RidingStat, Float>) : SingleUpdatePacket<Map<RidingStat, Float>, RideBoostsUpdatePacket>(pokemon, rideBoosts) {
|
||||
class RideBoostsUpdatePacket(pokemon: () -> Pokemon?, rideBoosts: Map<RidingStat, Float>) : SingleUpdatePacket<Map<RidingStat, Float>, RideBoostsUpdatePacket>(pokemon, rideBoosts) {
|
||||
companion object {
|
||||
val ID = cobblemonResource("ride_boosts_update")
|
||||
fun decode(buffer: RegistryFriendlyByteBuf): RideBoostsUpdatePacket {
|
||||
@@ -37,4 +37,4 @@ class RideBoostsUpdatePacket(pokemon: () -> Pokemon, rideBoosts: Map<RidingStat,
|
||||
override fun set(pokemon: Pokemon, value: Map<RidingStat, Float>) {
|
||||
pokemon.setRideBoosts(value)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ import com.cobblemon.mod.common.pokemon.Pokemon
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
|
||||
class ShinyUpdatePacket(pokemon: () -> Pokemon, value: Boolean) : BooleanUpdatePacket<ShinyUpdatePacket>(pokemon, value) {
|
||||
class ShinyUpdatePacket(pokemon: () -> Pokemon?, value: Boolean) : BooleanUpdatePacket<ShinyUpdatePacket>(pokemon, value) {
|
||||
override val id = ID
|
||||
override fun set(pokemon: Pokemon, value: Boolean) { pokemon.shiny = value }
|
||||
companion object {
|
||||
|
||||
@@ -21,14 +21,15 @@ import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
* @author Hiroku
|
||||
* @since November 28th, 2021
|
||||
*/
|
||||
abstract class SingleUpdatePacket<T, N : NetworkPacket<N>>(pokemon: () -> Pokemon, val value: T) : PokemonUpdatePacket<N>(pokemon) {
|
||||
abstract class SingleUpdatePacket<T, N : NetworkPacket<N>>(pokemon: () -> Pokemon?, val value: T) : PokemonUpdatePacket<N>(pokemon) {
|
||||
|
||||
override fun encodeDetails(buffer: RegistryFriendlyByteBuf) {
|
||||
this.encodeValue(buffer)
|
||||
}
|
||||
|
||||
override fun applyToPokemon() {
|
||||
set(this.pokemon(), this.value)
|
||||
val pokemon = pokemon() ?: return
|
||||
set(pokemon, this.value)
|
||||
}
|
||||
|
||||
abstract fun encodeValue(buffer: RegistryFriendlyByteBuf)
|
||||
|
||||
@@ -27,7 +27,7 @@ import net.minecraft.resources.ResourceLocation
|
||||
* @author Hiroku
|
||||
* @since November 13th, 2023
|
||||
*/
|
||||
class SpeciesFeatureUpdatePacket(pokemon: () -> Pokemon, val species: ResourceLocation, speciesFeature: SynchronizedSpeciesFeature) : SingleUpdatePacket<SynchronizedSpeciesFeature, SpeciesFeatureUpdatePacket>(pokemon, speciesFeature) {
|
||||
class SpeciesFeatureUpdatePacket(pokemon: () -> Pokemon?, val species: ResourceLocation, speciesFeature: SynchronizedSpeciesFeature) : SingleUpdatePacket<SynchronizedSpeciesFeature, SpeciesFeatureUpdatePacket>(pokemon, speciesFeature) {
|
||||
companion object {
|
||||
val ID = cobblemonResource("species_feature_update")
|
||||
fun decode(buffer: RegistryFriendlyByteBuf): SpeciesFeatureUpdatePacket {
|
||||
|
||||
@@ -16,7 +16,7 @@ import com.cobblemon.mod.common.util.readIdentifier
|
||||
import com.cobblemon.mod.common.util.writeIdentifier
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
|
||||
class SpeciesUpdatePacket(pokemon: () -> Pokemon, value: Species) : SingleUpdatePacket<Species, SpeciesUpdatePacket>(pokemon, value) {
|
||||
class SpeciesUpdatePacket(pokemon: () -> Pokemon?, value: Species) : SingleUpdatePacket<Species, SpeciesUpdatePacket>(pokemon, value) {
|
||||
override val id = ID
|
||||
override fun encodeValue(buffer: RegistryFriendlyByteBuf) {
|
||||
buffer.writeIdentifier(this.value.resourceIdentifier)
|
||||
|
||||
@@ -20,7 +20,7 @@ import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
* @author Hiroku
|
||||
* @since November 23rd, 2022
|
||||
*/
|
||||
class EVsUpdatePacket(pokemon: () -> Pokemon, eVs: EVs) : SingleUpdatePacket<EVs, EVsUpdatePacket>(pokemon, eVs) {
|
||||
class EVsUpdatePacket(pokemon: () -> Pokemon?, eVs: EVs) : SingleUpdatePacket<EVs, EVsUpdatePacket>(pokemon, eVs) {
|
||||
override val id = ID
|
||||
override fun encodeValue(buffer: RegistryFriendlyByteBuf) {
|
||||
this.value.saveToBuffer(buffer)
|
||||
@@ -42,7 +42,7 @@ class EVsUpdatePacket(pokemon: () -> Pokemon, eVs: EVs) : SingleUpdatePacket<EVs
|
||||
* @author Hiroku
|
||||
* @since November 23rd, 2022
|
||||
*/
|
||||
class IVsUpdatePacket(pokemon: () -> Pokemon, iVs: IVs) : SingleUpdatePacket<IVs, IVsUpdatePacket>(pokemon, iVs) {
|
||||
class IVsUpdatePacket(pokemon: () -> Pokemon?, iVs: IVs) : SingleUpdatePacket<IVs, IVsUpdatePacket>(pokemon, iVs) {
|
||||
override val id = ID
|
||||
override fun encodeValue(buffer: RegistryFriendlyByteBuf) {
|
||||
this.value.saveToBuffer(buffer)
|
||||
|
||||
@@ -13,13 +13,11 @@ import com.cobblemon.mod.common.pokemon.Pokemon
|
||||
import com.cobblemon.mod.common.pokemon.status.PersistentStatus
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import com.cobblemon.mod.common.util.readIdentifier
|
||||
import com.cobblemon.mod.common.util.readNullable
|
||||
import com.cobblemon.mod.common.util.writeIdentifier
|
||||
import com.cobblemon.mod.common.util.writeNullable
|
||||
import io.netty.buffer.ByteBuf
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
|
||||
class StatusUpdatePacket(pokemon: () -> Pokemon, value: PersistentStatus?): SingleUpdatePacket<PersistentStatus?, StatusUpdatePacket>(pokemon, value) {
|
||||
class StatusUpdatePacket(pokemon: () -> Pokemon?, value: PersistentStatus?): SingleUpdatePacket<PersistentStatus?, StatusUpdatePacket>(pokemon, value) {
|
||||
override val id = ID
|
||||
override fun encodeValue(buffer: RegistryFriendlyByteBuf) {
|
||||
buffer.writeNullable(this.value) { pb, value -> pb.writeIdentifier(value.name) }
|
||||
|
||||
@@ -22,7 +22,7 @@ import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
* @author Segfault Guy
|
||||
* @since July 19, 2023
|
||||
*/
|
||||
class TeraTypeUpdatePacket(pokemon: () -> Pokemon, value: TeraType) : SingleUpdatePacket<TeraType, TeraTypeUpdatePacket>(pokemon, value) {
|
||||
class TeraTypeUpdatePacket(pokemon: () -> Pokemon?, value: TeraType) : SingleUpdatePacket<TeraType, TeraTypeUpdatePacket>(pokemon, value) {
|
||||
override val id = ID
|
||||
|
||||
override fun encodeValue(buffer: RegistryFriendlyByteBuf) {
|
||||
|
||||
@@ -10,10 +10,6 @@ package com.cobblemon.mod.common.net.messages.client.pokemon.update
|
||||
|
||||
import com.cobblemon.mod.common.pokemon.Pokemon
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import com.cobblemon.mod.common.util.readNullable
|
||||
import com.cobblemon.mod.common.util.readUUID
|
||||
import com.cobblemon.mod.common.util.writeNullable
|
||||
import com.cobblemon.mod.common.util.writeUUID
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
import java.util.UUID
|
||||
|
||||
@@ -23,7 +19,7 @@ import java.util.UUID
|
||||
* @author Hiroku
|
||||
* @since April 4th, 2023
|
||||
*/
|
||||
class TetheringUpdatePacket(pokemon: () -> Pokemon, tetheringId: UUID?) : SingleUpdatePacket<UUID?, TetheringUpdatePacket>(pokemon, tetheringId) {
|
||||
class TetheringUpdatePacket(pokemon: () -> Pokemon?, tetheringId: UUID?) : SingleUpdatePacket<UUID?, TetheringUpdatePacket>(pokemon, tetheringId) {
|
||||
|
||||
override val id = ID
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
* @author Hiroku
|
||||
* @since October 7th, 2023
|
||||
*/
|
||||
class TradeableUpdatePacket(pokemon: () -> Pokemon, value: Boolean) : SingleUpdatePacket<Boolean, TradeableUpdatePacket>(pokemon, value) {
|
||||
class TradeableUpdatePacket(pokemon: () -> Pokemon?, value: Boolean) : SingleUpdatePacket<Boolean, TradeableUpdatePacket>(pokemon, value) {
|
||||
override val id = ID
|
||||
override fun encodeValue(buffer: RegistryFriendlyByteBuf) {
|
||||
buffer.writeBoolean(value)
|
||||
|
||||
@@ -21,7 +21,7 @@ import io.netty.buffer.ByteBuf
|
||||
import net.minecraft.core.RegistryAccess
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
|
||||
class AddEvolutionPacket(pokemon: () -> Pokemon, value: EvolutionDisplay) : SingleUpdatePacket<EvolutionDisplay, AddEvolutionPacket>(pokemon, value) {
|
||||
class AddEvolutionPacket(pokemon: () -> Pokemon?, value: EvolutionDisplay) : SingleUpdatePacket<EvolutionDisplay, AddEvolutionPacket>(pokemon, value) {
|
||||
|
||||
override val id = ID
|
||||
|
||||
|
||||
@@ -13,14 +13,14 @@ import com.cobblemon.mod.common.pokemon.Pokemon
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
|
||||
class ClearEvolutionsPacket(pokemon: () -> Pokemon) : PokemonUpdatePacket<ClearEvolutionsPacket>(pokemon) {
|
||||
class ClearEvolutionsPacket(pokemon: () -> Pokemon?) : PokemonUpdatePacket<ClearEvolutionsPacket>(pokemon) {
|
||||
|
||||
override val id = ID
|
||||
|
||||
override fun encodeDetails(buffer: RegistryFriendlyByteBuf) {}
|
||||
|
||||
override fun applyToPokemon() {
|
||||
this.pokemon().evolutionProxy.client().clear()
|
||||
this.pokemon()?.evolutionProxy?.client()?.clear()
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -19,7 +19,7 @@ import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import net.minecraft.core.RegistryAccess
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
|
||||
class RemoveEvolutionPacket(pokemon: () -> Pokemon, value: EvolutionDisplay) : SingleUpdatePacket<EvolutionDisplay, RemoveEvolutionPacket>(pokemon, value) {
|
||||
class RemoveEvolutionPacket(pokemon: () -> Pokemon?, value: EvolutionDisplay) : SingleUpdatePacket<EvolutionDisplay, RemoveEvolutionPacket>(pokemon, value) {
|
||||
|
||||
override val id = ID
|
||||
|
||||
|
||||
@@ -2431,8 +2431,10 @@
|
||||
"cobblemon.config.ui.party_portrait_animations.animate_selected.tooltip": "Selected Pokémon animates unless fainted",
|
||||
"cobblemon.config.ui.party_portrait_animations.always_animate": "Always animate",
|
||||
"cobblemon.config.ui.party_portrait_animations.always_animate.tooltip": "Entire party animates unless fainted",
|
||||
"cobblemon.config.ui.third_person_view_bobbing": "Third Person View Bobbing",
|
||||
"cobblemon.config.ui.third_person_view_bobbing.tooltip": "If true then use default Minecraft behavior to follow directly behind the player's head. If false then follow a fixed offset from the pokemon.",
|
||||
"cobblemon.config.ui.view_bob_translation": "View Bob Translation",
|
||||
"cobblemon.config.ui.view_bob_translation.tooltip": "If true then use default Minecraft behavior to follow directly behind the player's head. If false then follow a fixed offset from the pokemon.",
|
||||
"cobblemon.config.ui.view_bob_rotation": "View Bob Rotation",
|
||||
"cobblemon.config.ui.view_bob_rotation.tooltip": "If true then will rotate the camera based on the Pokemon's movements. If false then no rotation will occur.",
|
||||
"cobblemon.config.ui.invert_pitch": "Invert Pitch",
|
||||
"cobblemon.config.ui.invert_pitch.tooltip": "Invert the direction for pitch (left and right).",
|
||||
"cobblemon.config.ui.invert_yaw": "Invert Yaw",
|
||||
@@ -8899,4 +8901,4 @@
|
||||
"cobblemon.ability.teraformzero.desc": "When Terapagos changes into its Stellar Form, it uses its hidden powers to eliminate all effects of weather and terrain, reducing them to zero.",
|
||||
"cobblemon.ability.poisonpuppeteer": "Poison Puppeteer",
|
||||
"cobblemon.ability.poisonpuppeteer.desc": "Pokémon poisoned by Pecharunt's moves will also become confused."
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "cobblemon:item/candied_berry"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "cobblemon:item/jelly_doughnut"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "cobblemon:item/lure_cake",
|
||||
"layer1": "cobblemon:item/lure_cake_overlay1",
|
||||
"layer2": "cobblemon:item/lure_cake_overlay2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "cobblemon:item/lure_cake",
|
||||
"layer1": "cobblemon:item/lure_cake_overlay1",
|
||||
"layer2": "cobblemon:item/lure_cake_overlay2"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 236 B |
|
Before Width: | Height: | Size: 408 B After Width: | Height: | Size: 371 B |
|
After Width: | Height: | Size: 408 B |
|
After Width: | Height: | Size: 270 B |
|
After Width: | Height: | Size: 332 B |
|
After Width: | Height: | Size: 204 B |
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"type": "cobblemon:cooking_pot_shapeless",
|
||||
"category": "foods",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:apple"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:stick"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:sugar"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:honey_bottle"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"id": "cobblemon:candied_apple",
|
||||
"count": 1
|
||||
},
|
||||
"seasoningProcessors": []
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"type": "cobblemon:cooking_pot_shapeless",
|
||||
"category": "foods",
|
||||
"ingredients": [
|
||||
{
|
||||
"tag": "cobblemon:berries"
|
||||
},
|
||||
{
|
||||
"tag": "cobblemon:berries"
|
||||
},
|
||||
{
|
||||
"tag": "cobblemon:berries"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:stick"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:sugar"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:honey_bottle"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"id": "cobblemon:candied_berry",
|
||||
"count": 1
|
||||
},
|
||||
"seasoningProcessors": []
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"type": "cobblemon:cooking_pot_shapeless",
|
||||
"category": "misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "cobblemon:hearty_grains"
|
||||
},
|
||||
{
|
||||
"item": "cobblemon:hearty_grains"
|
||||
},
|
||||
{
|
||||
"item": "cobblemon:hearty_grains"
|
||||
},
|
||||
{
|
||||
"item": "cobblemon:qualot_berry"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"id": "cobblemon:clever_mochi",
|
||||
"count": 3
|
||||
},
|
||||
"seasoningProcessors": []
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"type": "cobblemon:cooking_pot_shapeless",
|
||||
"category": "misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "cobblemon:hearty_grains"
|
||||
},
|
||||
{
|
||||
"item": "cobblemon:hearty_grains"
|
||||
},
|
||||
{
|
||||
"item": "cobblemon:hearty_grains"
|
||||
},
|
||||
{
|
||||
"item": "cobblemon:enigma_berry"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"id": "cobblemon:fresh_start_mochi",
|
||||
"count": 3
|
||||
},
|
||||
"seasoningProcessors": []
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"type": "cobblemon:cooking_pot_shapeless",
|
||||
"category": "misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:bowl"
|
||||
},
|
||||
{
|
||||
"item": "cobblemon:hearty_grains"
|
||||
},
|
||||
{
|
||||
"item": "cobblemon:hearty_grains"
|
||||
},
|
||||
{
|
||||
"item": "cobblemon:hearty_grains"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"id": "cobblemon:fried_rice",
|
||||
"count": 1
|
||||
},
|
||||
"seasoningProcessors": []
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"type": "cobblemon:cooking_pot_shapeless",
|
||||
"category": "misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "cobblemon:hearty_grains"
|
||||
},
|
||||
{
|
||||
"item": "cobblemon:hearty_grains"
|
||||
},
|
||||
{
|
||||
"item": "cobblemon:hearty_grains"
|
||||
},
|
||||
{
|
||||
"item": "cobblemon:hondew_berry"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"id": "cobblemon:genius_mochi",
|
||||
"count": 3
|
||||
},
|
||||
"seasoningProcessors": []
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"type": "cobblemon:cooking_pot_shapeless",
|
||||
"category": "misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "cobblemon:hearty_grains"
|
||||
},
|
||||
{
|
||||
"item": "cobblemon:hearty_grains"
|
||||
},
|
||||
{
|
||||
"item": "cobblemon:hearty_grains"
|
||||
},
|
||||
{
|
||||
"item": "cobblemon:pomeg_berry"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"id": "cobblemon:health_mochi",
|
||||
"count": 3
|
||||
},
|
||||
"seasoningProcessors": []
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"type": "cobblemon:cooking_pot_shapeless",
|
||||
"category": "foods",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "cobblemon:hearty_grains"
|
||||
},
|
||||
{
|
||||
"tag": "cobblemon:berries"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:dried_kelp"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"id": "cobblemon:jelly_doughnut",
|
||||
"count": 1
|
||||
},
|
||||
"seasoningProcessors": []
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"type": "cobblemon:cooking_pot_shapeless",
|
||||
"category": "misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "cobblemon:hearty_grains"
|
||||
},
|
||||
{
|
||||
"item": "cobblemon:hearty_grains"
|
||||
},
|
||||
{
|
||||
"item": "cobblemon:hearty_grains"
|
||||
},
|
||||
{
|
||||
"item": "cobblemon:kelpsy_berry"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"id": "cobblemon:muscle_mochi",
|
||||
"count": 3
|
||||
},
|
||||
"seasoningProcessors": []
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"type": "cobblemon:cooking_pot_shapeless",
|
||||
"category": "foods",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "cobblemon:hearty_grains"
|
||||
},
|
||||
{
|
||||
"item": "cobblemon:hearty_grains"
|
||||
},
|
||||
{
|
||||
"item": "cobblemon:hearty_grains"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:potato"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"id": "cobblemon:potato_mochi",
|
||||
"count": 3
|
||||
},
|
||||
"seasoningProcessors": []
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"type": "cobblemon:cooking_pot_shapeless",
|
||||
"category": "misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "cobblemon:hearty_grains"
|
||||
},
|
||||
{
|
||||
"item": "cobblemon:hearty_grains"
|
||||
},
|
||||
{
|
||||
"item": "cobblemon:hearty_grains"
|
||||
},
|
||||
{
|
||||
"item": "cobblemon:qualot_berry"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"id": "cobblemon:resist_mochi",
|
||||
"count": 3
|
||||
},
|
||||
"seasoningProcessors": []
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"type": "cobblemon:cooking_pot_shapeless",
|
||||
"category": "misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "cobblemon:hearty_grains"
|
||||
},
|
||||
{
|
||||
"item": "cobblemon:hearty_grains"
|
||||
},
|
||||
{
|
||||
"item": "cobblemon:hearty_grains"
|
||||
},
|
||||
{
|
||||
"item": "cobblemon:tamato_berry"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"id": "cobblemon:swift_mochi",
|
||||
"count": 3
|
||||
},
|
||||
"seasoningProcessors": []
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
"effects": [
|
||||
{
|
||||
"type": "cobblemon:ev",
|
||||
"subcategory": "def",
|
||||
"subcategory": "spd",
|
||||
"chance": 1.0,
|
||||
"value": 100.0
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"effects": [
|
||||
{
|
||||
"type": "cobblemon:ev",
|
||||
"subcategory": "spd",
|
||||
"subcategory": "spa",
|
||||
"chance": 1.0,
|
||||
"value": 100.0
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"effects": [
|
||||
{
|
||||
"type": "cobblemon:ev",
|
||||
"subcategory": "spa",
|
||||
"subcategory": "atk",
|
||||
"chance": 1.0,
|
||||
"value": 100.0
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"effects": [
|
||||
{
|
||||
"type": "cobblemon:ev",
|
||||
"subcategory": "spe",
|
||||
"subcategory": "def",
|
||||
"chance": 1.0,
|
||||
"value": 100.0
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"effects": [
|
||||
{
|
||||
"type": "cobblemon:ev",
|
||||
"subcategory": "atk",
|
||||
"subcategory": "spe",
|
||||
"chance": 1.0,
|
||||
"value": 100.0
|
||||
}
|
||||
|
||||