diff --git a/build.gradle b/build.gradle index 53e3cb5b..0cf90a88 100644 --- a/build.gradle +++ b/build.gradle @@ -69,6 +69,7 @@ dependencies { include "com.minelittlepony:mson:${project.mson_version}" modImplementation "com.minelittlepony:hdskins:${project.hd_skins_version}" + modImplementation "com.minelittlepony:bigpony:${project.bigpony_version}" modCompileOnly("com.terraformersmc:modmenu:${project.modmenu_version}") } diff --git a/gradle.properties b/gradle.properties index ea565ba2..0aa41168 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 @@ -15,12 +15,13 @@ org.gradle.daemon=false description=Mine Little Pony turns players and mobs into ponies. Press F9 ingame to access settings. # 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.14.0 - hd_skins_version=6.8.0 - mson_version=1.8.0 + modmenu_version=5.0.0-alpha.3 + kirin_version=1.13.2 + hd_skins_version=6.7.6 + 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 fff85125..36403be7 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 c1c76a60..567bb6b8 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 4459f36d..0fc2675e 100644 --- a/src/main/java/com/minelittlepony/client/render/LevitatingItemRenderer.java +++ b/src/main/java/com/minelittlepony/client/render/LevitatingItemRenderer.java @@ -9,7 +9,7 @@ import org.jetbrains.annotations.Nullable; import net.minecraft.client.render.OverlayTexture; import net.minecraft.client.render.VertexConsumerProvider; 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; @@ -31,9 +31,9 @@ public class LevitatingItemRenderer { /** * 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); 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 5811aa84..802093f0 100644 --- a/src/main/java/com/minelittlepony/client/render/entity/PlayerPonyRenderer.java +++ b/src/main/java/com/minelittlepony/client/render/entity/PlayerPonyRenderer.java @@ -49,7 +49,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 b5cceace..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,24 +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.resource.featuretoggle.FeatureFlags; import net.minecraft.util.Identifier; public class ArmourFeature & IPonyModel> extends AbstractPonyFeature { - public ArmourFeature(IPonyRenderContext context, BakedModelManager bakery) { + public ArmourFeature(IPonyRenderContext context) { super(context); } @@ -84,18 +78,6 @@ public class ArmourFeature & IP 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 & 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 4c1fed3b..14907b77 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.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) { 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) {