1.19.4 -> 1.19.3

This commit is contained in:
Sollace 2023-04-10 22:25:09 +02:00
parent cb232cc145
commit 478e7b56a8
15 changed files with 33 additions and 61 deletions

View file

@ -69,6 +69,7 @@ dependencies {
include "com.minelittlepony:mson:${project.mson_version}" include "com.minelittlepony:mson:${project.mson_version}"
modImplementation "com.minelittlepony:hdskins:${project.hd_skins_version}" modImplementation "com.minelittlepony:hdskins:${project.hd_skins_version}"
modImplementation "com.minelittlepony:bigpony:${project.bigpony_version}"
modCompileOnly("com.terraformersmc:modmenu:${project.modmenu_version}") modCompileOnly("com.terraformersmc:modmenu:${project.modmenu_version}")
} }

View file

@ -3,10 +3,10 @@ org.gradle.daemon=false
# Fabric Properties # Fabric Properties
# check these on https://fabricmc.net/develop # check these on https://fabricmc.net/develop
minecraft_version=1.19.4 minecraft_version=1.19.3
yarn_mappings=1.19.4+build.1 yarn_mappings=1.19.3+build.5
loader_version=0.14.17 loader_version=0.14.19
fabric_version=0.76.0+1.19.4 fabric_version=0.76.0+1.19.3
# Mod Properties # Mod Properties
group=com.minelittlepony group=com.minelittlepony
@ -15,12 +15,13 @@ org.gradle.daemon=false
description=Mine Little Pony turns players and mobs into ponies. Press F9 ingame to access settings. description=Mine Little Pony turns players and mobs into ponies. Press F9 ingame to access settings.
# Publishing # Publishing
minecraft_version_range=>=1.19.4 minecraft_version_range=1.19.3
modrinth_loader_type=fabric modrinth_loader_type=fabric
modrinth_project_id=JBjInUXM modrinth_project_id=JBjInUXM
# Dependencies # Dependencies
modmenu_version=6.1.0-rc.4 modmenu_version=5.0.0-alpha.3
kirin_version=1.14.0 kirin_version=1.13.2
hd_skins_version=6.8.0 hd_skins_version=6.7.6
mson_version=1.8.0 bigpony_version=1.8.0+lts
mson_version=1.8.0+lts.1.19.3

View file

@ -58,7 +58,7 @@ public final class PonyPosture {
double offsetAmount = below.getBlock() instanceof StairsBlock ? 1 : 0.05; double offsetAmount = below.getBlock() instanceof StairsBlock ? 1 : 0.05;
Vec3d pos = entity.getPos(); Vec3d pos = entity.getPos();
BlockPos blockpos = BlockPos.ofFloored( BlockPos blockpos = new BlockPos(
pos.x, pos.x,
pos.y - offsetAmount, pos.y - offsetAmount,
pos.z pos.z

View file

@ -10,7 +10,7 @@ import org.jetbrains.annotations.Nullable;
import net.minecraft.client.render.item.HeldItemRenderer; import net.minecraft.client.render.item.HeldItemRenderer;
import net.minecraft.client.render.VertexConsumerProvider; import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.model.json.ModelTransformationMode; import net.minecraft.client.render.model.json.ModelTransformation;
import net.minecraft.client.util.math.MatrixStack; import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -22,7 +22,7 @@ abstract class MixinHeldItemRenderer {
private static final String LivingEntity = "Lnet/minecraft/entity/LivingEntity;"; private static final String LivingEntity = "Lnet/minecraft/entity/LivingEntity;";
private static final String MatrixStack = "Lnet/minecraft/client/util/math/MatrixStack;"; private static final String MatrixStack = "Lnet/minecraft/client/util/math/MatrixStack;";
private static final String ItemStack = "Lnet/minecraft/item/ItemStack;"; private static final String ItemStack = "Lnet/minecraft/item/ItemStack;";
private static final String Mode = "Lnet/minecraft/client/render/model/json/ModelTransformationMode;"; private static final String Mode = "Lnet/minecraft/client/render/model/json/ModelTransformation$Mode;";
private static final String VertexConsumerProvider = "Lnet/minecraft/client/render/VertexConsumerProvider;"; private static final String VertexConsumerProvider = "Lnet/minecraft/client/render/VertexConsumerProvider;";
private static final String World = "Lnet/minecraft/world/World;"; private static final String World = "Lnet/minecraft/world/World;";
private static final String ItemRenderer = "Lnet/minecraft/client/render/item/ItemRenderer;"; private static final String ItemRenderer = "Lnet/minecraft/client/render/item/ItemRenderer;";
@ -36,7 +36,7 @@ abstract class MixinHeldItemRenderer {
private void redirectRenderItem(ItemRenderer target, private void redirectRenderItem(ItemRenderer target,
@Nullable LivingEntity entity, @Nullable LivingEntity entity,
ItemStack item, ItemStack item,
ModelTransformationMode transform, ModelTransformation.Mode transform,
boolean left, boolean left,
MatrixStack stack, MatrixStack stack,
VertexConsumerProvider renderContext, VertexConsumerProvider renderContext,

View file

@ -1,6 +1,6 @@
package com.minelittlepony.client.mixin; package com.minelittlepony.client.mixin;
import net.minecraft.network.packet.Packet; import net.minecraft.network.Packet;
import net.minecraft.network.listener.ServerPlayPacketListener; import net.minecraft.network.listener.ServerPlayPacketListener;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;

View file

@ -5,9 +5,8 @@ import com.minelittlepony.client.HorseCam;
import java.util.Set; import java.util.Set;
import net.minecraft.network.listener.ClientPlayPacketListener; import net.minecraft.network.listener.ClientPlayPacketListener;
import net.minecraft.network.packet.Packet;
import net.minecraft.network.packet.s2c.play.PlayerPositionLookS2CPacket; import net.minecraft.network.packet.s2c.play.PlayerPositionLookS2CPacket;
import net.minecraft.network.packet.s2c.play.PositionFlag; import net.minecraft.network.Packet;
import org.spongepowered.asm.mixin.*; import org.spongepowered.asm.mixin.*;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
@ -19,12 +18,12 @@ abstract class MixinPlayerPositionLookS2CPacket implements Packet<ClientPlayPack
@Shadow @Mutable @Shadow @Mutable
private @Final float pitch; private @Final float pitch;
@Shadow @Shadow
private @Final Set<PositionFlag> flags; private @Final Set<PlayerPositionLookS2CPacket.Flag> flags;
@Inject(method = "apply(Lnet/minecraft/network/listener/ClientPlayPacketListener;)V", @Inject(method = "apply(Lnet/minecraft/network/listener/ClientPlayPacketListener;)V",
at = @At("HEAD")) at = @At("HEAD"))
private void onApply(ClientPlayPacketListener clientPlayPacketListener, CallbackInfo info) { private void onApply(ClientPlayPacketListener clientPlayPacketListener, CallbackInfo info) {
if (!flags.contains(PositionFlag.Y_ROT)) { if (!flags.contains(PlayerPositionLookS2CPacket.Flag.Y_ROT)) {
pitch = HorseCam.transformIncomingServerCameraAngle(pitch); pitch = HorseCam.transformIncomingServerCameraAngle(pitch);
} }
} }

View file

@ -9,7 +9,7 @@ import org.jetbrains.annotations.Nullable;
import net.minecraft.client.render.OverlayTexture; import net.minecraft.client.render.OverlayTexture;
import net.minecraft.client.render.VertexConsumerProvider; import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.item.ItemRenderer; import net.minecraft.client.render.item.ItemRenderer;
import net.minecraft.client.render.model.json.ModelTransformationMode; import net.minecraft.client.render.model.json.ModelTransformation;
import net.minecraft.client.util.math.MatrixStack; import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
@ -31,9 +31,9 @@ public class LevitatingItemRenderer {
/** /**
* Renders an item in first person optionally with a magical overlay. * Renders an item in first person optionally with a magical overlay.
*/ */
public void renderItemInFirstPerson(ItemRenderer itemRenderer, @Nullable LivingEntity entity, ItemStack stack, ModelTransformationMode mode, boolean left, MatrixStack matrix, VertexConsumerProvider renderContext, @Nullable World world, int lightUv, int posLong) { public void renderItemInFirstPerson(ItemRenderer itemRenderer, @Nullable LivingEntity entity, ItemStack stack, ModelTransformation.Mode mode, boolean left, MatrixStack matrix, VertexConsumerProvider renderContext, @Nullable World world, int lightUv, int posLong) {
if (entity instanceof PlayerEntity && (mode.isFirstPerson() || mode == ModelTransformationMode.THIRD_PERSON_LEFT_HAND || mode == ModelTransformationMode.THIRD_PERSON_RIGHT_HAND)) { if (entity instanceof PlayerEntity && (mode.isFirstPerson() || mode == ModelTransformation.Mode.THIRD_PERSON_LEFT_HAND || mode == ModelTransformation.Mode.THIRD_PERSON_RIGHT_HAND)) {
IPony pony = IPony.getManager().getPony((PlayerEntity)entity); IPony pony = IPony.getManager().getPony((PlayerEntity)entity);

View file

@ -45,7 +45,7 @@ public abstract class AbstractPonyRenderer<T extends MobEntity, M extends Entity
} }
protected void addFeatures(EntityRendererFactory.Context context) { protected void addFeatures(EntityRendererFactory.Context context) {
addFeature(new ArmourFeature<>(this, context.getModelManager())); addFeature(new ArmourFeature<>(this));
addFeature(createHeldItemFeature(context)); addFeature(createHeldItemFeature(context));
addFeature(new SkullFeature<>(this, context.getModelLoader())); addFeature(new SkullFeature<>(this, context.getModelLoader()));
addFeature(new ElytraFeature<>(this)); addFeature(new ElytraFeature<>(this));

View file

@ -49,7 +49,7 @@ public class PlayerPonyRenderer extends PlayerEntityRenderer implements IPonyRen
|| feature instanceof ElytraFeatureRenderer || feature instanceof ElytraFeatureRenderer
|| feature instanceof ShoulderParrotFeatureRenderer; || feature instanceof ShoulderParrotFeatureRenderer;
}); });
addLayer(new ArmourFeature<>(this, context.getModelManager())); addLayer(new ArmourFeature<>(this));
addLayer(new HeldItemFeature(this, context.getHeldItemRenderer())); addLayer(new HeldItemFeature(this, context.getHeldItemRenderer()));
addLayer(new DJPon3Feature<>(this)); addLayer(new DJPon3Feature<>(this));
addLayer(new CapeFeature<>(this)); addLayer(new CapeFeature<>(this));

View file

@ -65,8 +65,7 @@ public class PonyStandRenderer extends ArmorStandEntityRenderer {
public Armour(FeatureRendererContext<ArmorStandEntity, ArmorStandArmorEntityModel> renderer, EntityRendererFactory.Context context) { public Armour(FeatureRendererContext<ArmorStandEntity, ArmorStandArmorEntityModel> renderer, EntityRendererFactory.Context context) {
super(renderer, super(renderer,
new ArmorStandArmorEntityModel(context.getPart(EntityModelLayers.ARMOR_STAND_INNER_ARMOR)), new ArmorStandArmorEntityModel(context.getPart(EntityModelLayers.ARMOR_STAND_INNER_ARMOR)),
new ArmorStandArmorEntityModel(context.getPart(EntityModelLayers.ARMOR_STAND_OUTER_ARMOR)), new ArmorStandArmorEntityModel(context.getPart(EntityModelLayers.ARMOR_STAND_OUTER_ARMOR))
context.getModelManager()
); );
pony.applyMetadata(new PonyData(Race.EARTH)); pony.applyMetadata(new PonyData(Race.EARTH));

View file

@ -7,24 +7,18 @@ import com.minelittlepony.client.model.armour.DefaultArmourTextureResolver;
import com.minelittlepony.client.render.IPonyRenderContext; import com.minelittlepony.client.render.IPonyRenderContext;
import com.minelittlepony.common.util.Color; import com.minelittlepony.common.util.Color;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.*; import net.minecraft.client.render.*;
import net.minecraft.client.render.entity.model.*; import net.minecraft.client.render.entity.model.*;
import net.minecraft.client.render.item.ItemRenderer; import net.minecraft.client.render.item.ItemRenderer;
import net.minecraft.client.render.model.BakedModelManager;
import net.minecraft.client.texture.Sprite;
import net.minecraft.client.texture.SpriteAtlasTexture;
import net.minecraft.client.util.math.MatrixStack; import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.EquipmentSlot; import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity;
import net.minecraft.item.*; import net.minecraft.item.*;
import net.minecraft.item.trim.ArmorTrim;
import net.minecraft.resource.featuretoggle.FeatureFlags;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
public class ArmourFeature<T extends LivingEntity, M extends EntityModel<T> & IPonyModel<T>> extends AbstractPonyFeature<T, M> { public class ArmourFeature<T extends LivingEntity, M extends EntityModel<T> & IPonyModel<T>> extends AbstractPonyFeature<T, M> {
public ArmourFeature(IPonyRenderContext<T, M> context, BakedModelManager bakery) { public ArmourFeature(IPonyRenderContext<T, M> context) {
super(context); super(context);
} }
@ -84,18 +78,6 @@ public class ArmourFeature<T extends LivingEntity, M extends EntityModel<T> & IP
m.render(matrices, getArmorConsumer(renderContext, tex, false), light, OverlayTexture.DEFAULT_UV, 1, 1, 1, 1); m.render(matrices, getArmorConsumer(renderContext, tex, false), light, OverlayTexture.DEFAULT_UV, 1, 1, 1, 1);
}); });
} }
if (entity.world.getEnabledFeatures().contains(FeatureFlags.UPDATE_1_20)) {
if (stack.getItem() instanceof ArmorItem armor) {
ArmorTrim.getTrim(entity.world.getRegistryManager(), stack).ifPresent(trim -> {
pony.getArmourModel(stack, layer, ArmourVariant.TRIM)
.filter(m -> m.poseModel(entity, limbAngle, limbDistance, age, headYaw, headPitch, armorSlot, layer, pony.body()))
.ifPresent(m -> {
m.render(matrices, getTrimConsumer(renderContext, armor.getMaterial(), trim, layer, glint), light, OverlayTexture.DEFAULT_UV, 1, 1, 1, 1);
});
});
}
}
}); });
} }
@ -103,14 +85,4 @@ public class ArmourFeature<T extends LivingEntity, M extends EntityModel<T> & IP
return ItemRenderer.getArmorGlintConsumer(provider, RenderLayer.getArmorCutoutNoCull(texture), false, glint); return ItemRenderer.getArmorGlintConsumer(provider, RenderLayer.getArmorCutoutNoCull(texture), false, glint);
} }
private static VertexConsumer getTrimConsumer(VertexConsumerProvider provider, ArmorMaterial material, ArmorTrim trim, ArmourLayer layer, boolean glint) {
SpriteAtlasTexture armorTrimsAtlas = MinecraftClient.getInstance().getBakedModelManager().getAtlas(TexturedRenderLayers.ARMOR_TRIMS_ATLAS_TEXTURE);
Sprite sprite = armorTrimsAtlas.getSprite(
layer == ArmourLayer.INNER ? trim.getLeggingsModelId(material) : trim.getGenericModelId(material)
);
return sprite.getTextureSpecificVertexConsumer(
ItemRenderer.getDirectItemGlintConsumer(provider, TexturedRenderLayers.getArmorTrims(), true, glint)
);
}
} }

View file

@ -9,7 +9,7 @@ import net.minecraft.client.render.entity.feature.HeldItemFeatureRenderer;
import net.minecraft.client.render.entity.model.EntityModel; import net.minecraft.client.render.entity.model.EntityModel;
import net.minecraft.client.render.entity.model.ModelWithArms; import net.minecraft.client.render.entity.model.ModelWithArms;
import net.minecraft.client.render.item.HeldItemRenderer; import net.minecraft.client.render.item.HeldItemRenderer;
import net.minecraft.client.render.model.json.ModelTransformationMode; import net.minecraft.client.render.model.json.ModelTransformation;
import net.minecraft.client.util.math.MatrixStack; import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -46,9 +46,9 @@ public class HeldItemFeature<T extends LivingEntity, M extends EntityModel<T> &
model.transform(BodyPart.LEGS, stack); model.transform(BodyPart.LEGS, stack);
model.getAttributes().heldStack = right; model.getAttributes().heldStack = right;
renderItem(entity, right, ModelTransformationMode.THIRD_PERSON_RIGHT_HAND, Arm.RIGHT, stack, renderContext, lightUv); renderItem(entity, right, ModelTransformation.Mode.THIRD_PERSON_RIGHT_HAND, Arm.RIGHT, stack, renderContext, lightUv);
model.getAttributes().heldStack = left; model.getAttributes().heldStack = left;
renderItem(entity, left, ModelTransformationMode.THIRD_PERSON_LEFT_HAND, Arm.LEFT, stack, renderContext, lightUv); renderItem(entity, left, ModelTransformation.Mode.THIRD_PERSON_LEFT_HAND, Arm.LEFT, stack, renderContext, lightUv);
model.getAttributes().heldStack = ItemStack.EMPTY; model.getAttributes().heldStack = ItemStack.EMPTY;
stack.pop(); stack.pop();
} }

View file

@ -17,7 +17,7 @@ import net.minecraft.client.render.block.entity.SkullBlockEntityModel;
import net.minecraft.client.render.block.entity.SkullBlockEntityRenderer; import net.minecraft.client.render.block.entity.SkullBlockEntityRenderer;
import net.minecraft.client.render.entity.model.EntityModel; import net.minecraft.client.render.entity.model.EntityModel;
import net.minecraft.client.render.entity.model.EntityModelLoader; import net.minecraft.client.render.entity.model.EntityModelLoader;
import net.minecraft.client.render.model.json.ModelTransformationMode; import net.minecraft.client.render.model.json.ModelTransformation;
import net.minecraft.client.util.math.MatrixStack; import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.math.RotationAxis; import net.minecraft.util.math.RotationAxis;
import net.minecraft.entity.EquipmentSlot; import net.minecraft.entity.EquipmentSlot;
@ -76,7 +76,7 @@ public class SkullFeature<T extends LivingEntity, M extends EntityModel<T> & IPo
stack.translate(0, 0.6F, -0.21F); stack.translate(0, 0.6F, -0.21F);
MinecraftClient.getInstance().getItemRenderer() MinecraftClient.getInstance().getItemRenderer()
.renderItem(entity, itemstack, ModelTransformationMode.HEAD, false, stack, renderContext, entity.world, lightUv, OverlayTexture.DEFAULT_UV, entity.getId() + ModelTransformationMode.HEAD.ordinal()); .renderItem(entity, itemstack, ModelTransformation.Mode.HEAD, false, stack, renderContext, entity.world, lightUv, OverlayTexture.DEFAULT_UV, entity.getId() + ModelTransformation.Mode.HEAD.ordinal());
} }
private void renderSkull(MatrixStack stack, VertexConsumerProvider renderContext, ItemStack itemstack, boolean isVillager, float limbDistance, int lightUv) { private void renderSkull(MatrixStack stack, VertexConsumerProvider renderContext, ItemStack itemstack, boolean isVillager, float limbDistance, int lightUv) {

View file

@ -49,7 +49,7 @@ public class IllagerPonyRenderer<T extends IllagerEntity> extends PonyRenderer<T
@Override @Override
public void render(IllusionerEntity entity, float entityYaw, float tickDelta, MatrixStack stack, VertexConsumerProvider renderContext, int lightUv) { public void render(IllusionerEntity entity, float entityYaw, float tickDelta, MatrixStack stack, VertexConsumerProvider renderContext, int lightUv) {
if (entity.isInvisible()) { if (entity.isInvisible()) {
Vec3d[] clones = entity.getMirrorCopyOffsets(tickDelta); Vec3d[] clones = entity.method_7065(tickDelta);
float rotation = getAnimationProgress(entity, tickDelta); float rotation = getAnimationProgress(entity, tickDelta);
for (int i = 0; i < clones.length; ++i) { for (int i = 0; i < clones.length; ++i) {

View file

@ -54,7 +54,7 @@ public interface PonyPosture {
if (RenderPass.getCurrent() == RenderPass.GUI) { if (RenderPass.getCurrent() == RenderPass.GUI) {
Vec3d vec3d = player.getRotationVec(tickDelta); Vec3d vec3d = player.getRotationVec(tickDelta);
Vec3d vec3d2 = ((AbstractClientPlayerEntity)player).lerpVelocity(tickDelta); Vec3d vec3d2 = ((AbstractClientPlayerEntity)player).getVelocity();
double d = vec3d2.horizontalLengthSquared(); double d = vec3d2.horizontalLengthSquared();
double e = vec3d.horizontalLengthSquared(); double e = vec3d.horizontalLengthSquared();
if (d > 0.0 && e > 0.0) { if (d > 0.0 && e > 0.0) {