From 17931d7fa89259c27305caef5ba2fe6effa0184e Mon Sep 17 00:00:00 2001 From: Sollace Date: Tue, 11 Apr 2023 13:50:05 +0200 Subject: [PATCH] 1.19.3 -> 1.19.2 --- gradle.properties | 18 +++++++++--------- .../api/model/armour/ArmorModelRegistry.java | 6 +++--- .../minelittlepony/client/MineLittlePony.java | 2 +- .../client/mixin/MixinClientPlayerEntity.java | 2 +- .../client/mixin/MixinGameRenderer.java | 2 +- .../client/model/AbstractPonyModel.java | 6 +++--- .../client/model/ModelKeyImpl.java | 2 +- .../armour/DefaultArmourTextureResolver.java | 4 ++-- .../client/model/entity/WitchPonyModel.java | 5 ++--- .../client/render/FrustrumCheck.java | 3 +-- .../client/render/LevitatingItemRenderer.java | 6 +++--- .../client/render/MagicGlow.java | 4 ++-- .../render/blockentity/skull/MobSkull.java | 13 ++++++------- .../blockentity/skull/PlayerPonySkull.java | 17 ++++++++--------- .../render/entity/PlayerPonyRenderer.java | 4 ++-- .../render/entity/feature/CapeFeature.java | 10 +++++----- .../entity/feature/PassengerFeature.java | 7 +++---- .../render/entity/feature/SkullFeature.java | 4 ++-- .../render/entity/npc/NpcClothingFeature.java | 12 ++++++------ .../client/transform/PonyPosture.java | 6 +++--- .../client/transform/PostureFlight.java | 6 +++--- 21 files changed, 67 insertions(+), 72 deletions(-) diff --git a/gradle.properties b/gradle.properties index 0aa41168..a0a6114f 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.3 - yarn_mappings=1.19.3+build.5 + minecraft_version=1.19.2 + yarn_mappings=1.19.2+build.8 loader_version=0.14.19 - fabric_version=0.76.0+1.19.3 + fabric_version=0.76.0+1.19.2 # Mod Properties group=com.minelittlepony @@ -15,13 +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.3 + minecraft_version_range=1.19.2 modrinth_loader_type=fabric modrinth_project_id=JBjInUXM # Dependencies - 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 + modmenu_version=4.0.6 + kirin_version=1.13.2+lts + hd_skins_version=6.7.6+lts + bigpony_version=1.7.3 + mson_version=1.8.0+lts.1.19.2 diff --git a/src/main/java/com/minelittlepony/api/model/armour/ArmorModelRegistry.java b/src/main/java/com/minelittlepony/api/model/armour/ArmorModelRegistry.java index 851742f6..918ddc31 100644 --- a/src/main/java/com/minelittlepony/api/model/armour/ArmorModelRegistry.java +++ b/src/main/java/com/minelittlepony/api/model/armour/ArmorModelRegistry.java @@ -1,8 +1,8 @@ package com.minelittlepony.api.model.armour; import net.minecraft.item.Item; -import net.minecraft.registry.Registries; import net.minecraft.util.Identifier; +import net.minecraft.util.registry.Registry; import com.minelittlepony.client.model.armour.PonyArmourModel; import com.minelittlepony.mson.api.ModelKey; @@ -14,11 +14,11 @@ public interface ArmorModelRegistry { static final Map>>> REGISTRY = new HashMap<>(); public static Optional>> getModelKey(Item item, ArmourLayer layer) { - Identifier id = Registries.ITEM.getId(item); + Identifier id = Registry.ITEM.getId(item); if (id.getNamespace().equals("minecraft")) { return Optional.empty(); } - return REGISTRY.computeIfAbsent(id.withPath(p -> "models/armor/" + layer.name().toLowerCase(Locale.ROOT) + "_" + p + ".json"), i -> { + return REGISTRY.computeIfAbsent(new Identifier(id.getNamespace(), "models/armor/" + layer.name().toLowerCase(Locale.ROOT) + "_" + id.getPath() + ".json"), i -> { return Optional.of(Mson.getInstance().registerModel(i, PonyArmourModel::new)); }).filter(key -> key.getModelData().isPresent()); } diff --git a/src/main/java/com/minelittlepony/client/MineLittlePony.java b/src/main/java/com/minelittlepony/client/MineLittlePony.java index 5c245808..bf7652f6 100644 --- a/src/main/java/com/minelittlepony/client/MineLittlePony.java +++ b/src/main/java/com/minelittlepony/client/MineLittlePony.java @@ -129,7 +129,7 @@ public class MineLittlePony implements ClientModInitializer { .setTextureSize(16, 16) .setSize(16, 16)) .setTooltip("minelp.options.title", 0, 10); - button.setY(screen.height - y); // ModMenu + button.y = screen.height - y; // ModMenu } } } diff --git a/src/main/java/com/minelittlepony/client/mixin/MixinClientPlayerEntity.java b/src/main/java/com/minelittlepony/client/mixin/MixinClientPlayerEntity.java index c76f05be..db7cb7b7 100644 --- a/src/main/java/com/minelittlepony/client/mixin/MixinClientPlayerEntity.java +++ b/src/main/java/com/minelittlepony/client/mixin/MixinClientPlayerEntity.java @@ -19,7 +19,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(ClientPlayerEntity.class) abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity implements EquineRenderManager.RegistrationHandler { - public MixinClientPlayerEntity() { super(null, null); } + public MixinClientPlayerEntity() { super(null, null, null); } @Nullable private IPony pony; diff --git a/src/main/java/com/minelittlepony/client/mixin/MixinGameRenderer.java b/src/main/java/com/minelittlepony/client/mixin/MixinGameRenderer.java index e8b09518..4db77ab7 100644 --- a/src/main/java/com/minelittlepony/client/mixin/MixinGameRenderer.java +++ b/src/main/java/com/minelittlepony/client/mixin/MixinGameRenderer.java @@ -2,8 +2,8 @@ package com.minelittlepony.client.mixin; import net.minecraft.client.render.*; import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.util.math.Matrix4f; -import org.joml.Matrix4f; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; diff --git a/src/main/java/com/minelittlepony/client/model/AbstractPonyModel.java b/src/main/java/com/minelittlepony/client/model/AbstractPonyModel.java index 9e4721f3..f5fe526a 100644 --- a/src/main/java/com/minelittlepony/client/model/AbstractPonyModel.java +++ b/src/main/java/com/minelittlepony/client/model/AbstractPonyModel.java @@ -579,7 +579,7 @@ public abstract class AbstractPonyModel extends ClientPo } if (main == arm) { matrices.translate(left * -0.05F, 0.5F, 0.2F); - matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(-60)); + matrices.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(-60)); return; } @@ -600,8 +600,8 @@ public abstract class AbstractPonyModel extends ClientPo } if (attributes.isSleeping || attributes.isRiptide) { - stack.multiply(RotationAxis.POSITIVE_X.rotationDegrees(90)); - stack.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(180)); + stack.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(90)); + stack.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(180)); } if (attributes.isHorsey) { diff --git a/src/main/java/com/minelittlepony/client/model/ModelKeyImpl.java b/src/main/java/com/minelittlepony/client/model/ModelKeyImpl.java index ece1b60c..2c077687 100644 --- a/src/main/java/com/minelittlepony/client/model/ModelKeyImpl.java +++ b/src/main/java/com/minelittlepony/client/model/ModelKeyImpl.java @@ -66,7 +66,7 @@ final class ModelKeyImpl implements ModelKey, LocalBlock { if (ctx instanceof RootContext) { ((RootContext)ctx).setModel(t); } - ((MsonModel)t).init(ctx); + ((MsonModel)t).init((ModelView)ctx); } return t; }) diff --git a/src/main/java/com/minelittlepony/client/model/armour/DefaultArmourTextureResolver.java b/src/main/java/com/minelittlepony/client/model/armour/DefaultArmourTextureResolver.java index 27cf4277..f89e9540 100644 --- a/src/main/java/com/minelittlepony/client/model/armour/DefaultArmourTextureResolver.java +++ b/src/main/java/com/minelittlepony/client/model/armour/DefaultArmourTextureResolver.java @@ -7,7 +7,7 @@ import net.minecraft.entity.EquipmentSlot; import net.minecraft.item.ArmorItem; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NbtElement; -import net.minecraft.registry.Registries; +import net.minecraft.util.registry.Registry; import net.minecraft.util.Identifier; import com.google.common.base.Strings; import com.google.common.cache.Cache; @@ -53,7 +53,7 @@ public class DefaultArmourTextureResolver implements IArmourTextureResolver { public Identifier getTexture(LivingEntity entity, ItemStack stack, EquipmentSlot slot, ArmourLayer layer, @Nullable String type) { Identifier material = stack.getItem() instanceof ArmorItem armor ? new Identifier(armor.getMaterial().getName()) - : Registries.ITEM.getId(stack.getItem()); + : Registry.ITEM.getId(stack.getItem()); String custom = getCustom(stack); try { diff --git a/src/main/java/com/minelittlepony/client/model/entity/WitchPonyModel.java b/src/main/java/com/minelittlepony/client/model/entity/WitchPonyModel.java index 4f6aea7a..ecde3cc1 100644 --- a/src/main/java/com/minelittlepony/client/model/entity/WitchPonyModel.java +++ b/src/main/java/com/minelittlepony/client/model/entity/WitchPonyModel.java @@ -4,8 +4,7 @@ import net.minecraft.client.model.ModelPart; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.mob.WitchEntity; import net.minecraft.util.*; -import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.RotationAxis; +import net.minecraft.util.math.*; import com.minelittlepony.api.model.ModelAttributes; import com.minelittlepony.api.pony.IPony; @@ -66,7 +65,7 @@ public class WitchPonyModel extends EarthPonyModel { @Override protected void positionheldItem(Arm arm, MatrixStack matrices) { super.positionheldItem(arm, matrices); - matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(10)); + matrices.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(10)); } @Override diff --git a/src/main/java/com/minelittlepony/client/render/FrustrumCheck.java b/src/main/java/com/minelittlepony/client/render/FrustrumCheck.java index 9ac8d095..c21133d8 100644 --- a/src/main/java/com/minelittlepony/client/render/FrustrumCheck.java +++ b/src/main/java/com/minelittlepony/client/render/FrustrumCheck.java @@ -3,8 +3,7 @@ package com.minelittlepony.client.render; import net.minecraft.client.render.Frustum; import net.minecraft.entity.LivingEntity; import net.minecraft.util.math.Box; - -import org.joml.Matrix4f; +import net.minecraft.util.math.Matrix4f; import com.minelittlepony.client.PonyBounds; diff --git a/src/main/java/com/minelittlepony/client/render/LevitatingItemRenderer.java b/src/main/java/com/minelittlepony/client/render/LevitatingItemRenderer.java index 0fc2675e..4ba7199b 100644 --- a/src/main/java/com/minelittlepony/client/render/LevitatingItemRenderer.java +++ b/src/main/java/com/minelittlepony/client/render/LevitatingItemRenderer.java @@ -17,7 +17,7 @@ import net.minecraft.item.CrossbowItem; import net.minecraft.item.ItemStack; import net.minecraft.screen.PlayerScreenHandler; import net.minecraft.util.UseAction; -import net.minecraft.util.math.RotationAxis; +import net.minecraft.util.math.Vec3f; import net.minecraft.world.World; public class LevitatingItemRenderer { @@ -92,8 +92,8 @@ public class LevitatingItemRenderer { distanceChange); if (!handHeldTool) { // bows have to point forwards - stack.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(sign * -60 + floatAmount)); - stack.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(sign * 30 + driftAmount)); + stack.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(sign * -60 + floatAmount)); + stack.multiply(Vec3f.POSITIVE_Z.getDegreesQuaternion(sign * 30 + driftAmount)); } } } diff --git a/src/main/java/com/minelittlepony/client/render/MagicGlow.java b/src/main/java/com/minelittlepony/client/render/MagicGlow.java index 11009f55..5cdbc4c8 100644 --- a/src/main/java/com/minelittlepony/client/render/MagicGlow.java +++ b/src/main/java/com/minelittlepony/client/render/MagicGlow.java @@ -18,7 +18,7 @@ public abstract class MagicGlow extends RenderPhase { } private static final RenderLayer MAGIC = RenderLayer.of("mlp_magic_glow", VertexFormats.POSITION_COLOR_LIGHT, VertexFormat.DrawMode.QUADS, 256, RenderLayer.MultiPhaseParameters.builder() - .program(EYES_PROGRAM) + .shader(EYES_SHADER) .writeMaskState(COLOR_MASK) .depthTest(LEQUAL_DEPTH_TEST) .transparency(LIGHTNING_TRANSPARENCY) @@ -29,7 +29,7 @@ public abstract class MagicGlow extends RenderPhase { private static final BiFunction TINTED_LAYER = Util.memoize((texture, color) -> { return RenderLayer.of("mlp_tint_layer", VertexFormats.POSITION_COLOR_TEXTURE_OVERLAY_LIGHT_NORMAL, VertexFormat.DrawMode.QUADS, 256, true, true, RenderLayer.MultiPhaseParameters.builder() .texture(new Colored(texture, color)) - .program(EYES_PROGRAM) + .shader(EYES_SHADER) .writeMaskState(COLOR_MASK) .depthTest(LEQUAL_DEPTH_TEST) .transparency(LIGHTNING_TRANSPARENCY) diff --git a/src/main/java/com/minelittlepony/client/render/blockentity/skull/MobSkull.java b/src/main/java/com/minelittlepony/client/render/blockentity/skull/MobSkull.java index 98225db0..dd21b0aa 100644 --- a/src/main/java/com/minelittlepony/client/render/blockentity/skull/MobSkull.java +++ b/src/main/java/com/minelittlepony/client/render/blockentity/skull/MobSkull.java @@ -15,10 +15,9 @@ import net.minecraft.client.model.ModelPart; import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.Identifier; -import net.minecraft.util.math.RotationAxis; +import net.minecraft.util.math.Vec3f; import org.jetbrains.annotations.Nullable; -import org.joml.Vector3f; public class MobSkull implements ISkull { private final Identifier texture; @@ -50,12 +49,12 @@ public class MobSkull implements ISkull { @Override public void setAngles(float yaw, float animationProgress) { - Vector3f v = new Vector3f(0, -2, 1.99F); - v.rotate(RotationAxis.POSITIVE_Y.rotationDegrees(yaw)); + Vec3f v = new Vec3f(0, -2, 1.99F); + v.rotate(Vec3f.POSITIVE_Y.getDegreesQuaternion(yaw)); ModelPart head = ponyHead.get().getHead(); - head.pivotX = v.x; - head.pivotY = v.y; - head.pivotZ = v.z; + head.pivotX = v.getX(); + head.pivotY = v.getY(); + head.pivotZ = v.getZ(); ponyHead.get().setVisible(true); ponyHead.get().setHeadRotation(animationProgress, yaw, 0); } diff --git a/src/main/java/com/minelittlepony/client/render/blockentity/skull/PlayerPonySkull.java b/src/main/java/com/minelittlepony/client/render/blockentity/skull/PlayerPonySkull.java index bbed84e8..693b4315 100644 --- a/src/main/java/com/minelittlepony/client/render/blockentity/skull/PlayerPonySkull.java +++ b/src/main/java/com/minelittlepony/client/render/blockentity/skull/PlayerPonySkull.java @@ -16,11 +16,10 @@ import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.util.DefaultSkinHelper; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.Identifier; -import net.minecraft.util.Uuids; -import net.minecraft.util.math.RotationAxis; +import net.minecraft.util.dynamic.DynamicSerializableUuid; +import net.minecraft.util.math.Vec3f; import org.jetbrains.annotations.Nullable; -import org.joml.Vector3f; public class PlayerPonySkull implements ISkull { private AbstractPonyModel ponyHead; @@ -46,7 +45,7 @@ public class PlayerPonySkull implements ISkull { return skin; } - return DefaultSkinHelper.getTexture(Uuids.getUuidFromProfile(profile)); + return DefaultSkinHelper.getTexture(DynamicSerializableUuid.getUuidFromProfile(profile)); } return DefaultSkinHelper.getTexture(); @@ -68,11 +67,11 @@ public class PlayerPonySkull implements ISkull { @Override public void setAngles(float yaw, float animationProgress) { - Vector3f v = new Vector3f(0, -2, 2); - v.rotate(RotationAxis.POSITIVE_Y.rotationDegrees(yaw)); - ponyHead.getHead().pivotX = v.x; - ponyHead.getHead().pivotY = v.y; - ponyHead.getHead().pivotZ = v.z; + Vec3f v = new Vec3f(0, -2, 2); + v.rotate(Vec3f.POSITIVE_Y.getDegreesQuaternion(yaw)); + ponyHead.getHead().pivotX = v.getX(); + ponyHead.getHead().pivotY = v.getY(); + ponyHead.getHead().pivotZ = v.getZ(); ponyHead.setVisible(true); ponyHead.setHeadRotation(animationProgress, yaw, 0); if (renderingEars) { 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 802093f0..5c695227 100644 --- a/src/main/java/com/minelittlepony/client/render/entity/PlayerPonyRenderer.java +++ b/src/main/java/com/minelittlepony/client/render/entity/PlayerPonyRenderer.java @@ -83,9 +83,9 @@ public class PlayerPonyRenderer extends PlayerEntityRenderer implements IPonyRen float yaw = MathHelper.lerpAngleDegrees(tickDelta, entity.prevBodyYaw, entity.bodyYaw); float l = entity.getWidth() / 2 * manager.getPony(entity).metadata().getSize().getScaleFactor(); - stack.multiply(RotationAxis.NEGATIVE_Y.rotationDegrees(yaw)); + stack.multiply(Vec3f.NEGATIVE_Y.getDegreesQuaternion(yaw)); stack.translate(0, 0, -l); - stack.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(yaw)); + stack.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(yaw)); } } diff --git a/src/main/java/com/minelittlepony/client/render/entity/feature/CapeFeature.java b/src/main/java/com/minelittlepony/client/render/entity/feature/CapeFeature.java index 4eb168e8..94628962 100644 --- a/src/main/java/com/minelittlepony/client/render/entity/feature/CapeFeature.java +++ b/src/main/java/com/minelittlepony/client/render/entity/feature/CapeFeature.java @@ -58,11 +58,11 @@ public class CapeFeature> float camera = MathHelper.lerp(tickDelta, player.prevStrideDistance, player.strideDistance); capeMotionY += MathHelper.sin(MathHelper.lerp(tickDelta, player.prevHorizontalSpeed, player.horizontalSpeed) * 6) * 32 * camera; - stack.multiply(RotationAxis.POSITIVE_X.rotationDegrees(2 + capeMotionX / 12 + capeMotionY)); - stack.multiply(RotationAxis.POSITIVE_Z.rotationDegrees( diagMotion / 2)); - stack.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(-diagMotion / 2)); - stack.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(180)); - stack.multiply(RotationAxis.POSITIVE_X.rotationDegrees(90)); + stack.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(2 + capeMotionX / 12 + capeMotionY)); + stack.multiply(Vec3f.POSITIVE_Z.getDegreesQuaternion( diagMotion / 2)); + stack.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(-diagMotion / 2)); + stack.multiply(Vec3f.POSITIVE_Z.getDegreesQuaternion(180)); + stack.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(90)); VertexConsumer vertices = renderContext.getBuffer(RenderLayer.getEntitySolid(player.getCapeTexture())); model.renderCape(stack, vertices, lightUv, OverlayTexture.DEFAULT_UV); diff --git a/src/main/java/com/minelittlepony/client/render/entity/feature/PassengerFeature.java b/src/main/java/com/minelittlepony/client/render/entity/feature/PassengerFeature.java index 4d15a550..9323983d 100644 --- a/src/main/java/com/minelittlepony/client/render/entity/feature/PassengerFeature.java +++ b/src/main/java/com/minelittlepony/client/render/entity/feature/PassengerFeature.java @@ -8,9 +8,8 @@ import net.minecraft.client.render.entity.ParrotEntityRenderer; import net.minecraft.client.render.entity.model.EntityModelLayers; import net.minecraft.client.render.entity.model.ParrotEntityModel; import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.util.math.RotationAxis; +import net.minecraft.util.math.Vec3f; import net.minecraft.entity.EntityType; -import net.minecraft.entity.passive.ParrotEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.nbt.NbtCompound; import net.minecraft.util.Identifier; @@ -43,7 +42,7 @@ public class PassengerFeature getShoulderParrot(NbtCompound tag) { return EntityType.get(tag.getString("id")) .filter(p -> p == EntityType.PARROT) - .map(type -> ParrotEntityRenderer.getTexture(ParrotEntity.Variant.byIndex(tag.getInt("Variant")))); + .map(type -> ParrotEntityRenderer.TEXTURES[tag.getInt("Variant")]); } private void renderShoulderParrot(MatrixStack stack, VertexConsumerProvider renderContext, int light, T entity, float limbDistance, float limbAngle, float headYaw, float headPitch, Identifier texture, int sigma) { @@ -55,7 +54,7 @@ public class PassengerFeature & IPo } private void renderBlock(MatrixStack stack, VertexConsumerProvider renderContext, T entity, ItemStack itemstack, int lightUv) { - stack.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(180)); + stack.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(180)); stack.scale(0.625F, -0.625F, -0.625F); stack.translate(0, 0.6F, -0.21F); diff --git a/src/main/java/com/minelittlepony/client/render/entity/npc/NpcClothingFeature.java b/src/main/java/com/minelittlepony/client/render/entity/npc/NpcClothingFeature.java index 79462f86..1e378834 100644 --- a/src/main/java/com/minelittlepony/client/render/entity/npc/NpcClothingFeature.java +++ b/src/main/java/com/minelittlepony/client/render/entity/npc/NpcClothingFeature.java @@ -8,7 +8,7 @@ import net.minecraft.client.render.entity.model.EntityModel; import net.minecraft.client.render.entity.model.ModelWithHat; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.LivingEntity; -import net.minecraft.registry.Registries; +import net.minecraft.util.registry.Registry; import net.minecraft.util.Identifier; import net.minecraft.util.Util; import net.minecraft.util.math.MathHelper; @@ -56,9 +56,9 @@ class NpcClothingFeature< M entityModel = getContextModel(); if (entity.isBaby() || data.getProfession() == VillagerProfession.NONE) { - Identifier typeSkin = createTexture("type", Registries.VILLAGER_TYPE.getId(data.getType())); + Identifier typeSkin = createTexture("type", Registry.VILLAGER_TYPE.getId(data.getType())); if (!ResourceUtil.textureExists(typeSkin)) { - typeSkin = createTexture("type", Registries.VILLAGER_TYPE.getId(VillagerType.PLAINS)); + typeSkin = createTexture("type", Registry.VILLAGER_TYPE.getId(VillagerType.PLAINS)); } renderModel(entityModel, typeSkin, matrixStack, provider, i, entity, 1, 1, 1); } else { @@ -71,8 +71,8 @@ class NpcClothingFeature< VillagerProfession profession = data.getProfession(); int level = MathHelper.clamp(data.getLevel(), 1, LEVEL_TO_ID.size()); - Identifier typeId = Registries.VILLAGER_TYPE.getId(type); - Identifier profId = Registries.VILLAGER_PROFESSION.getId(profession); + Identifier typeId = Registry.VILLAGER_TYPE.getId(type); + Identifier profId = Registry.VILLAGER_PROFESSION.getId(profession); Identifier key = new Identifier("minelittlepony", (typeId + "/" + profId + "/" + level).replace(':', '_')); @@ -102,7 +102,7 @@ class NpcClothingFeature< } public Identifier createTexture(VillagerDataContainer entity, String category) { - return createTexture(category, Registries.VILLAGER_PROFESSION.getId(entity.getVillagerData().getProfession())); + return createTexture(category, Registry.VILLAGER_PROFESSION.getId(entity.getVillagerData().getProfession())); } private Identifier createTexture(String category, Identifier identifier) { diff --git a/src/main/java/com/minelittlepony/client/transform/PonyPosture.java b/src/main/java/com/minelittlepony/client/transform/PonyPosture.java index 53b4adcd..0e662383 100644 --- a/src/main/java/com/minelittlepony/client/transform/PonyPosture.java +++ b/src/main/java/com/minelittlepony/client/transform/PonyPosture.java @@ -60,14 +60,14 @@ public interface PonyPosture { if (d > 0.0 && e > 0.0) { double l = (vec3d2.x * vec3d.x + vec3d2.z * vec3d.z) / Math.sqrt(d * e); double m = vec3d2.x * vec3d.z - vec3d2.z * vec3d.x; - stack.multiply(RotationAxis.NEGATIVE_Y.rotation((float)(Math.signum(m) * Math.acos(l)))); + stack.multiply(Vec3f.NEGATIVE_Y.getDegreesQuaternion((float)(Math.signum(m) * Math.acos(l)))); } } float roll = (float)player.getRoll() + tickDelta; float targetRoll = MathHelper.clamp(roll * roll / 100F, 0, 1); if (!player.isUsingRiptide()) { - stack.multiply(RotationAxis.NEGATIVE_X.rotationDegrees(targetRoll * (-90 - player.getPitch()))); + stack.multiply(Vec3f.NEGATIVE_X.getDegreesQuaternion(targetRoll * (-90 - player.getPitch()))); } } else if (leaningPitch > 0) { @@ -75,7 +75,7 @@ public interface PonyPosture { stack.translate(0.0f, 1.0f, -0.3f); } float pitch = MathHelper.lerp(leaningPitch, 0, player.isTouchingWater() ? -90 - player.getPitch() : -90); - stack.multiply(RotationAxis.NEGATIVE_X.rotationDegrees(pitch)); + stack.multiply(Vec3f.NEGATIVE_X.getDegreesQuaternion(pitch)); } } } diff --git a/src/main/java/com/minelittlepony/client/transform/PostureFlight.java b/src/main/java/com/minelittlepony/client/transform/PostureFlight.java index ee1252f7..f7cc3211 100644 --- a/src/main/java/com/minelittlepony/client/transform/PostureFlight.java +++ b/src/main/java/com/minelittlepony/client/transform/PostureFlight.java @@ -4,7 +4,7 @@ import com.minelittlepony.api.model.IModel; import com.minelittlepony.common.util.animation.MotionCompositor; import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.util.math.RotationAxis; +import net.minecraft.util.math.Vec3f; import net.minecraft.entity.LivingEntity; public class PostureFlight extends MotionCompositor implements PonyPosture { @@ -24,8 +24,8 @@ public class PostureFlight extends MotionCompositor implements PonyPosture { model.getAttributes().motionRoll = model.getAttributes().getMainInterpolator().interpolate("pegasusRoll", model.getAttributes().motionRoll, 10); - stack.multiply(RotationAxis.POSITIVE_X.rotationDegrees(model.getAttributes().motionPitch)); - stack.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(model.getAttributes().motionRoll)); + stack.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(model.getAttributes().motionPitch)); + stack.multiply(Vec3f.POSITIVE_Z.getDegreesQuaternion(model.getAttributes().motionRoll)); stack.translate(0, yOffset, 0); } }