From 3b3b1740fe3f78c2b7bfd86ec680e21bc3e2bcda Mon Sep 17 00:00:00 2001 From: Sollace Date: Mon, 10 Apr 2023 22:25:09 +0200 Subject: [PATCH] 1.19.4 -> 1.19.3 --- build.gradle | 1 + gradle.properties | 18 +++++++------ .../minelittlepony/api/pony/PonyPosture.java | 2 +- .../client/mixin/MixinHeldItemRenderer.java | 6 ++--- .../mixin/MixinPlayerMoveC2SPacket.java | 2 +- .../MixinPlayerPositionLookS2CPacket.java | 7 +++-- .../client/render/LevitatingItemRenderer.java | 8 +++--- .../render/entity/AbstractPonyRenderer.java | 2 +- .../render/entity/PlayerPonyRenderer.java | 2 +- .../render/entity/PonyStandRenderer.java | 3 +-- .../render/entity/feature/ArmourFeature.java | 27 +------------------ .../entity/feature/HeldItemFeature.java | 6 ++--- .../render/entity/feature/SkullFeature.java | 4 +-- .../entity/npc/IllagerPonyRenderer.java | 2 +- .../client/transform/PonyPosture.java | 2 +- 15 files changed, 34 insertions(+), 58 deletions(-) diff --git a/build.gradle b/build.gradle index 0e1f956c..8da4407b 100644 --- a/build.gradle +++ b/build.gradle @@ -60,6 +60,7 @@ dependencies { include "com.minelittlepony:mson:${project.mson_version}" modImplementation "com.minelittlepony:hdskins:${project.hd_skins_version}" + // modImplementation "com.minelittlepony:bigpony:${project.bigpony_version}" modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}" } diff --git a/gradle.properties b/gradle.properties index ce22ceaa..5165dc8f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,10 +3,10 @@ org.gradle.daemon=false # Fabric Properties # check these on https://fabricmc.net/develop - minecraft_version=1.19.4 - yarn_mappings=1.19.4+build.1 - loader_version=0.14.17 - fabric_version=0.76.0+1.19.4 + minecraft_version=1.19.3 + yarn_mappings=1.19.3+build.5 + loader_version=0.14.19 + fabric_version=0.76.0+1.19.3 # Mod Properties group=com.minelittlepony @@ -16,11 +16,13 @@ org.gradle.daemon=false # Publishing minecraft_version_range=1.19.4 + minecraft_version_range=1.19.3 modrinth_loader_type=fabric modrinth_project_id=JBjInUXM # Dependencies - modmenu_version=6.1.0-rc.4 - kirin_version=1.15.2+1.19.4 - hd_skins_version=6.10.1+1.19.4 - mson_version=1.8.1 + modmenu_version=5.0.0-alpha.3 + kirin_version=1.15.2+1.19.3 + hd_skins_version=6.10.1+1.19.3 + bigpony_version=1.8.0+lts + mson_version=1.8.0+lts.1.19.3 diff --git a/src/main/java/com/minelittlepony/api/pony/PonyPosture.java b/src/main/java/com/minelittlepony/api/pony/PonyPosture.java index a0d61edc..98dc9f72 100644 --- a/src/main/java/com/minelittlepony/api/pony/PonyPosture.java +++ b/src/main/java/com/minelittlepony/api/pony/PonyPosture.java @@ -58,7 +58,7 @@ public final class PonyPosture { double offsetAmount = below.getBlock() instanceof StairsBlock ? 1 : 0.05; Vec3d pos = entity.getPos(); - BlockPos blockpos = BlockPos.ofFloored( + BlockPos blockpos = new BlockPos( pos.x, pos.y - offsetAmount, pos.z diff --git a/src/main/java/com/minelittlepony/client/mixin/MixinHeldItemRenderer.java b/src/main/java/com/minelittlepony/client/mixin/MixinHeldItemRenderer.java index b78e656e..1084284c 100644 --- a/src/main/java/com/minelittlepony/client/mixin/MixinHeldItemRenderer.java +++ b/src/main/java/com/minelittlepony/client/mixin/MixinHeldItemRenderer.java @@ -10,7 +10,7 @@ import org.jetbrains.annotations.Nullable; import net.minecraft.client.render.item.HeldItemRenderer; 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.entity.LivingEntity; 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 MatrixStack = "Lnet/minecraft/client/util/math/MatrixStack;"; 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 World = "Lnet/minecraft/world/World;"; private static final String ItemRenderer = "Lnet/minecraft/client/render/item/ItemRenderer;"; @@ -36,7 +36,7 @@ abstract class MixinHeldItemRenderer { private void redirectRenderItem(ItemRenderer target, @Nullable LivingEntity entity, ItemStack item, - ModelTransformationMode transform, + ModelTransformation.Mode transform, boolean left, MatrixStack stack, VertexConsumerProvider renderContext, diff --git a/src/main/java/com/minelittlepony/client/mixin/MixinPlayerMoveC2SPacket.java b/src/main/java/com/minelittlepony/client/mixin/MixinPlayerMoveC2SPacket.java index 630cf92d..9f31421a 100644 --- a/src/main/java/com/minelittlepony/client/mixin/MixinPlayerMoveC2SPacket.java +++ b/src/main/java/com/minelittlepony/client/mixin/MixinPlayerMoveC2SPacket.java @@ -1,6 +1,6 @@ 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.packet.c2s.play.PlayerMoveC2SPacket; diff --git a/src/main/java/com/minelittlepony/client/mixin/MixinPlayerPositionLookS2CPacket.java b/src/main/java/com/minelittlepony/client/mixin/MixinPlayerPositionLookS2CPacket.java index 1e7a4949..34f00772 100644 --- a/src/main/java/com/minelittlepony/client/mixin/MixinPlayerPositionLookS2CPacket.java +++ b/src/main/java/com/minelittlepony/client/mixin/MixinPlayerPositionLookS2CPacket.java @@ -5,9 +5,8 @@ import com.minelittlepony.client.HorseCam; import java.util.Set; 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.PositionFlag; +import net.minecraft.network.Packet; import org.spongepowered.asm.mixin.*; import org.spongepowered.asm.mixin.injection.At; @@ -19,12 +18,12 @@ abstract class MixinPlayerPositionLookS2CPacket implements Packet flags; + private @Final Set flags; @Inject(method = "apply(Lnet/minecraft/network/listener/ClientPlayPacketListener;)V", at = @At("HEAD")) private void onApply(ClientPlayPacketListener clientPlayPacketListener, CallbackInfo info) { - if (!flags.contains(PositionFlag.Y_ROT)) { + if (!flags.contains(PlayerPositionLookS2CPacket.Flag.Y_ROT)) { pitch = HorseCam.transformIncomingServerCameraAngle(pitch); } } diff --git a/src/main/java/com/minelittlepony/client/render/LevitatingItemRenderer.java b/src/main/java/com/minelittlepony/client/render/LevitatingItemRenderer.java index cb774677..01e7625f 100644 --- a/src/main/java/com/minelittlepony/client/render/LevitatingItemRenderer.java +++ b/src/main/java/com/minelittlepony/client/render/LevitatingItemRenderer.java @@ -8,7 +8,7 @@ import org.jetbrains.annotations.Nullable; import net.minecraft.client.render.*; 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.entity.LivingEntity; import net.minecraft.entity.player.PlayerEntity; @@ -25,7 +25,7 @@ public class LevitatingItemRenderer { final int color = pony.metadata().getGlowColor(); return layer -> { Identifier texture = RenderLayerUtil.getTexture(layer).orElse(PlayerScreenHandler.BLOCK_ATLAS_TEXTURE); - if (texture == ItemRenderer.ENTITY_ENCHANTMENT_GLINT || texture == ItemRenderer.ITEM_ENCHANTMENT_GLINT) { + if (texture == ItemRenderer.ENCHANTED_ITEM_GLINT) { return renderContext.getBuffer(layer); } return renderContext.getBuffer(MagicGlow.getColoured(texture, color)); @@ -35,9 +35,9 @@ public class LevitatingItemRenderer { /** * Renders an item with a magical overlay. */ - public void renderItem(ItemRenderer itemRenderer, @Nullable LivingEntity entity, ItemStack stack, ModelTransformationMode mode, boolean left, MatrixStack matrix, VertexConsumerProvider renderContext, @Nullable World world, int lightUv, int posLong) { + public void renderItem(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); diff --git a/src/main/java/com/minelittlepony/client/render/entity/AbstractPonyRenderer.java b/src/main/java/com/minelittlepony/client/render/entity/AbstractPonyRenderer.java index bae490c9..16b870d6 100644 --- a/src/main/java/com/minelittlepony/client/render/entity/AbstractPonyRenderer.java +++ b/src/main/java/com/minelittlepony/client/render/entity/AbstractPonyRenderer.java @@ -45,7 +45,7 @@ public abstract class AbstractPonyRenderer(this, context.getModelManager())); + addFeature(new ArmourFeature<>(this)); addFeature(createHeldItemFeature(context)); addFeature(new SkullFeature<>(this, context.getModelLoader())); addFeature(new ElytraFeature<>(this)); diff --git a/src/main/java/com/minelittlepony/client/render/entity/PlayerPonyRenderer.java b/src/main/java/com/minelittlepony/client/render/entity/PlayerPonyRenderer.java index f5a058de..c3824155 100644 --- a/src/main/java/com/minelittlepony/client/render/entity/PlayerPonyRenderer.java +++ b/src/main/java/com/minelittlepony/client/render/entity/PlayerPonyRenderer.java @@ -51,7 +51,7 @@ public class PlayerPonyRenderer extends PlayerEntityRenderer implements IPonyRen || feature instanceof ElytraFeatureRenderer || feature instanceof ShoulderParrotFeatureRenderer; }); - addLayer(new ArmourFeature<>(this, context.getModelManager())); + addLayer(new ArmourFeature<>(this)); addLayer(new HeldItemFeature(this, context.getHeldItemRenderer())); addLayer(new DJPon3Feature<>(this)); addLayer(new CapeFeature<>(this)); diff --git a/src/main/java/com/minelittlepony/client/render/entity/PonyStandRenderer.java b/src/main/java/com/minelittlepony/client/render/entity/PonyStandRenderer.java index d2111baf..362e4039 100644 --- a/src/main/java/com/minelittlepony/client/render/entity/PonyStandRenderer.java +++ b/src/main/java/com/minelittlepony/client/render/entity/PonyStandRenderer.java @@ -65,8 +65,7 @@ public class PonyStandRenderer extends ArmorStandEntityRenderer { public Armour(FeatureRendererContext renderer, EntityRendererFactory.Context context) { super(renderer, new ArmorStandArmorEntityModel(context.getPart(EntityModelLayers.ARMOR_STAND_INNER_ARMOR)), - new ArmorStandArmorEntityModel(context.getPart(EntityModelLayers.ARMOR_STAND_OUTER_ARMOR)), - context.getModelManager() + new ArmorStandArmorEntityModel(context.getPart(EntityModelLayers.ARMOR_STAND_OUTER_ARMOR)) ); pony.applyMetadata(new PonyData(Race.EARTH)); diff --git a/src/main/java/com/minelittlepony/client/render/entity/feature/ArmourFeature.java b/src/main/java/com/minelittlepony/client/render/entity/feature/ArmourFeature.java index 212e9cf0..afde5d66 100644 --- a/src/main/java/com/minelittlepony/client/render/entity/feature/ArmourFeature.java +++ b/src/main/java/com/minelittlepony/client/render/entity/feature/ArmourFeature.java @@ -7,23 +7,18 @@ import com.minelittlepony.client.model.armour.DefaultArmourTextureResolver; import com.minelittlepony.client.render.IPonyRenderContext; import com.minelittlepony.common.util.Color; -import net.minecraft.client.MinecraftClient; import net.minecraft.client.render.*; import net.minecraft.client.render.entity.model.*; 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.entity.EquipmentSlot; import net.minecraft.entity.LivingEntity; import net.minecraft.item.*; -import net.minecraft.item.trim.ArmorTrim; import net.minecraft.util.Identifier; public class ArmourFeature & IPonyModel> extends AbstractPonyFeature { - public ArmourFeature(IPonyRenderContext context, BakedModelManager bakery) { + public ArmourFeature(IPonyRenderContext context) { super(context); } @@ -83,16 +78,6 @@ public class ArmourFeature & IP m.render(matrices, getArmorConsumer(renderContext, tex, false), light, OverlayTexture.DEFAULT_UV, 1, 1, 1, 1); }); } - - if (stack.getItem() instanceof ArmorItem armor) { - ArmorTrim.getTrim(entity.getWorld().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); - }); - }); - } }); } @@ -100,14 +85,4 @@ public class ArmourFeature & IP 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) - ); - } } diff --git a/src/main/java/com/minelittlepony/client/render/entity/feature/HeldItemFeature.java b/src/main/java/com/minelittlepony/client/render/entity/feature/HeldItemFeature.java index d4335033..a241e8a4 100644 --- a/src/main/java/com/minelittlepony/client/render/entity/feature/HeldItemFeature.java +++ b/src/main/java/com/minelittlepony/client/render/entity/feature/HeldItemFeature.java @@ -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.ModelWithArms; 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.entity.LivingEntity; import net.minecraft.item.ItemStack; @@ -46,9 +46,9 @@ public class HeldItemFeature & model.transform(BodyPart.LEGS, stack); 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; - 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; stack.pop(); } diff --git a/src/main/java/com/minelittlepony/client/render/entity/feature/SkullFeature.java b/src/main/java/com/minelittlepony/client/render/entity/feature/SkullFeature.java index e9098b7c..6c8f81ef 100644 --- a/src/main/java/com/minelittlepony/client/render/entity/feature/SkullFeature.java +++ b/src/main/java/com/minelittlepony/client/render/entity/feature/SkullFeature.java @@ -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.entity.model.EntityModel; 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.util.math.RotationAxis; import net.minecraft.entity.EquipmentSlot; @@ -76,7 +76,7 @@ public class SkullFeature & IPo stack.translate(0, 0.6F, -0.21F); MinecraftClient.getInstance().getItemRenderer() - .renderItem(entity, itemstack, ModelTransformationMode.HEAD, false, stack, renderContext, entity.getWorld(), lightUv, OverlayTexture.DEFAULT_UV, entity.getId() + ModelTransformationMode.HEAD.ordinal()); + .renderItem(entity, itemstack, ModelTransformation.Mode.HEAD, false, stack, renderContext, entity.getWorld(), 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) { diff --git a/src/main/java/com/minelittlepony/client/render/entity/npc/IllagerPonyRenderer.java b/src/main/java/com/minelittlepony/client/render/entity/npc/IllagerPonyRenderer.java index 4b1ea1ad..3e9c6914 100644 --- a/src/main/java/com/minelittlepony/client/render/entity/npc/IllagerPonyRenderer.java +++ b/src/main/java/com/minelittlepony/client/render/entity/npc/IllagerPonyRenderer.java @@ -49,7 +49,7 @@ public class IllagerPonyRenderer extends PonyRenderer 0.0 && e > 0.0) {