diff --git a/gradle.properties b/gradle.properties index 5f999b23..e411c518 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,10 +3,10 @@ org.gradle.daemon=false # Fabric Properties # check these on https://modmuss50.me/fabric.html - minecraft_version=20w46a - yarn_mappings=20w46a+build.15 + minecraft_version=20w49a + yarn_mappings=20w49a+build.1 loader_version=0.10.8 - fabric_version=0.26.0+1.17 + fabric_version=0.27.2+1.17 # Mod Properties group=com.minelittlepony @@ -18,6 +18,6 @@ org.gradle.daemon=false # Dependencies modmenu_version=1.12.+ - kirin_version=1.8-20w46a-SNAPSHOT - hd_skins_version=6.4-20w46a-SNAPSHOT - mson_version=1.3.1-20w46a-SNAPSHOT + kirin_version=1.8-20w49a-SNAPSHOT + hd_skins_version=6.4-20w49a-SNAPSHOT + mson_version=1.3.1-20w49a-SNAPSHOT diff --git a/src/main/java/com/minelittlepony/client/mixin/MixinFirstPersonRenderer.java b/src/main/java/com/minelittlepony/client/mixin/MixinFirstPersonRenderer.java index 1c1a755d..d7a2374c 100644 --- a/src/main/java/com/minelittlepony/client/mixin/MixinFirstPersonRenderer.java +++ b/src/main/java/com/minelittlepony/client/mixin/MixinFirstPersonRenderer.java @@ -32,7 +32,7 @@ abstract class MixinFirstPersonRenderer { @Redirect(method = "renderItem(" + LivingEntity + ItemStack + Mode + Boolean + MatrixStack + VertexConsumerProvider + Int + ")V", at = @At(value = "INVOKE", - target = ItemRenderer + "renderItem(" + LivingEntity + ItemStack + Mode + Boolean + MatrixStack + VertexConsumerProvider + World + Int + Int + ")V")) + target = ItemRenderer + "renderItem(" + LivingEntity + ItemStack + Mode + Boolean + MatrixStack + VertexConsumerProvider + World + Int + Int + Int + ")V")) private void redirectRenderItem(ItemRenderer target, @Nullable LivingEntity entity, ItemStack item, @@ -41,7 +41,7 @@ abstract class MixinFirstPersonRenderer { MatrixStack stack, VertexConsumerProvider renderContext, @Nullable World world, - int lightUv, int overlayUv) { - PonyRenderDispatcher.getInstance().getMagicRenderer().renderItemInFirstPerson(target, entity, item, transform, left, stack, renderContext, world, lightUv); + int lightUv, int overlayUv, int posLong) { + PonyRenderDispatcher.getInstance().getMagicRenderer().renderItemInFirstPerson(target, entity, item, transform, left, stack, renderContext, world, lightUv, posLong); } } diff --git a/src/main/java/com/minelittlepony/client/model/AbstractPonyModel.java b/src/main/java/com/minelittlepony/client/model/AbstractPonyModel.java index 81e8fcdc..7f427502 100644 --- a/src/main/java/com/minelittlepony/client/model/AbstractPonyModel.java +++ b/src/main/java/com/minelittlepony/client/model/AbstractPonyModel.java @@ -12,9 +12,8 @@ import com.minelittlepony.mson.api.model.MsonPart; import net.minecraft.client.model.ModelPart; import net.minecraft.client.render.VertexConsumer; -import net.minecraft.client.render.entity.model.CrossbowPosing; import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.client.util.math.Vector3f; +import net.minecraft.util.math.Vec3f; import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; import net.minecraft.util.Arm; @@ -449,7 +448,7 @@ public abstract class AbstractPonyModel extends ClientPo arm.pitch = ROTATE_90 * 2; break; case SPYGLASS: - arm.pitch = MathHelper.clamp(head.pitch + CrossbowPosing.method_31978(arm), -2.4F, 3.3F); + arm.pitch = MathHelper.clamp(head.pitch - 1.9198622F - (attributes.isCrouching ? 0.2617994F : 0), -2.4F, 3.3F); arm.yaw = MathHelper.clamp(head.yaw + (0.7853982F * reflect), -1.1F, 0.0F); break; default: @@ -633,12 +632,12 @@ public abstract class AbstractPonyModel extends ClientPo @Override public void transform(BodyPart part, MatrixStack stack) { if (attributes.isSleeping) { - stack.multiply(Vector3f.POSITIVE_X.getDegreesQuaternion(90)); - stack.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(180)); + stack.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(90)); + stack.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(180)); } if (part == BodyPart.HEAD) { - stack.multiply(Vector3f.POSITIVE_X.getDegreesQuaternion(attributes.motionPitch)); + stack.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(attributes.motionPitch)); } PonyTransformation.forSize(getSize()).transform(this, part, stack); diff --git a/src/main/java/com/minelittlepony/client/render/LevitatingItemRenderer.java b/src/main/java/com/minelittlepony/client/render/LevitatingItemRenderer.java index bb71eb33..1c66c4a1 100644 --- a/src/main/java/com/minelittlepony/client/render/LevitatingItemRenderer.java +++ b/src/main/java/com/minelittlepony/client/render/LevitatingItemRenderer.java @@ -14,7 +14,7 @@ import net.minecraft.client.render.item.ItemRenderer; import net.minecraft.client.render.model.json.ModelTransformation; import net.minecraft.client.texture.SpriteAtlasTexture; import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.client.util.math.Vector3f; +import net.minecraft.util.math.Vec3f; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; @@ -55,9 +55,9 @@ public class LevitatingItemRenderer { stack.scale(1.1F, 1.1F, 1.1F); stack.translate(0.01F, 0.01F, 0.01F); - renderItem.renderItem(entity, drop, transform, hand == Arm.LEFT, stack, renderContext, entity.world, 0x0F00F0, OverlayTexture.DEFAULT_UV); + renderItem.renderItem(entity, drop, transform, hand == Arm.LEFT, stack, renderContext, entity.world, 0x0F00F0, OverlayTexture.DEFAULT_UV, 0); stack.translate(-0.02F, -0.02F, -0.02F); - renderItem.renderItem(entity, drop, transform, hand == Arm.LEFT, stack, renderContext, entity.world, 0x0F00F0, OverlayTexture.DEFAULT_UV); + renderItem.renderItem(entity, drop, transform, hand == Arm.LEFT, stack, renderContext, entity.world, 0x0F00F0, OverlayTexture.DEFAULT_UV, 0); stack.pop(); unsetColor(); @@ -76,7 +76,7 @@ public class LevitatingItemRenderer { /** * Renders an item in first person optionally with a magical overlay. */ - public void renderItemInFirstPerson(ItemRenderer itemRenderer, @Nullable LivingEntity entity, ItemStack stack, ModelTransformation.Mode transform, boolean left, MatrixStack matrix, VertexConsumerProvider renderContext, @Nullable World world, int lightUv) { + public void renderItemInFirstPerson(ItemRenderer itemRenderer, @Nullable LivingEntity entity, ItemStack stack, ModelTransformation.Mode transform, boolean left, MatrixStack matrix, VertexConsumerProvider renderContext, @Nullable World world, int lightUv, int posLong) { if (entity instanceof PlayerEntity) { @@ -90,7 +90,7 @@ public class LevitatingItemRenderer { setupPerspective(itemRenderer, entity, stack, left, matrix); } - itemRenderer.renderItem(entity, stack, transform, left, matrix, renderContext, world, lightUv, OverlayTexture.DEFAULT_UV); + itemRenderer.renderItem(entity, stack, transform, left, matrix, renderContext, world, lightUv, OverlayTexture.DEFAULT_UV, posLong); if (doMagic) { setColor(pony.getMetadata().getGlowColor()); @@ -98,16 +98,16 @@ public class LevitatingItemRenderer { matrix.scale(1.1F, 1.1F, 1.1F); matrix.translate(0.015F, 0.01F, 0.01F); - itemRenderer.renderItem(entity, stack, transform, left, matrix, renderContext, world, lightUv, OverlayTexture.DEFAULT_UV); + itemRenderer.renderItem(entity, stack, transform, left, matrix, renderContext, world, lightUv, OverlayTexture.DEFAULT_UV, posLong); matrix.translate(-0.03F, -0.02F, -0.02F); - itemRenderer.renderItem(entity, stack, transform, left, matrix, renderContext, world, lightUv, OverlayTexture.DEFAULT_UV); + itemRenderer.renderItem(entity, stack, transform, left, matrix, renderContext, world, lightUv, OverlayTexture.DEFAULT_UV, posLong); unsetColor(); } matrix.pop(); } else { - itemRenderer.renderItem(entity, stack, transform, left, matrix, renderContext, world, lightUv, OverlayTexture.DEFAULT_UV); + itemRenderer.renderItem(entity, stack, transform, left, matrix, renderContext, world, lightUv, OverlayTexture.DEFAULT_UV, posLong); } } @@ -139,8 +139,8 @@ public class LevitatingItemRenderer { distanceChange); if (!handHeldTool) { // bows have to point forwards - stack.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(sign * -60 + floatAmount)); - stack.multiply(Vector3f.POSITIVE_Z.getDegreesQuaternion(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/entity/PlayerPonyRenderer.java b/src/main/java/com/minelittlepony/client/render/entity/PlayerPonyRenderer.java index 8b0ce0be..f30f7669 100644 --- a/src/main/java/com/minelittlepony/client/render/entity/PlayerPonyRenderer.java +++ b/src/main/java/com/minelittlepony/client/render/entity/PlayerPonyRenderer.java @@ -34,7 +34,7 @@ import net.minecraft.client.render.entity.feature.FeatureRenderer; import net.minecraft.client.render.entity.feature.StuckArrowsFeatureRenderer; import net.minecraft.client.render.entity.model.PlayerEntityModel; import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.client.util.math.Vector3f; +import net.minecraft.util.math.Vec3f; import net.minecraft.text.Text; import net.minecraft.util.Arm; import net.minecraft.util.Identifier; @@ -94,7 +94,7 @@ public class PlayerPonyRenderer extends PlayerEntityRenderer implements IPonyRen float yaw = MathHelper.lerpAngleDegrees(tickDelta, entity.prevBodyYaw, entity.bodyYaw); float l = entity.getWidth() / 2 * manager.getPony(entity).getMetadata().getSize().getScaleFactor(); - stack.multiply(Vector3f.NEGATIVE_Y.getDegreesQuaternion(yaw)); + stack.multiply(Vec3f.NEGATIVE_Y.getDegreesQuaternion(yaw)); stack.translate(0, 0, -l); } } diff --git a/src/main/java/com/minelittlepony/client/render/entity/WitchRenderer.java b/src/main/java/com/minelittlepony/client/render/entity/WitchRenderer.java index 5dffceed..b0acd135 100644 --- a/src/main/java/com/minelittlepony/client/render/entity/WitchRenderer.java +++ b/src/main/java/com/minelittlepony/client/render/entity/WitchRenderer.java @@ -7,7 +7,7 @@ import com.minelittlepony.client.render.entity.feature.HeldItemFeature; import net.minecraft.client.render.entity.EntityRendererFactory; import net.minecraft.client.render.model.json.ModelTransformation; import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.client.util.math.Vector3f; +import net.minecraft.util.math.Vec3f; import net.minecraft.entity.mob.WitchEntity; import net.minecraft.item.ItemStack; import net.minecraft.util.Arm; @@ -27,7 +27,7 @@ public class WitchRenderer extends PonyRenderer { @Override protected void preItemRender(WitchEntity entity, ItemStack drop, ModelTransformation.Mode transform, Arm hand, MatrixStack stack) { stack.translate(0, -0.3F, -0.8F); - stack.multiply(Vector3f.POSITIVE_X.getDegreesQuaternion(10)); + stack.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(10)); } }; } 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 90394ebc..193d780f 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 @@ -11,7 +11,7 @@ import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.render.VertexConsumerProvider; import net.minecraft.client.render.entity.PlayerModelPart; import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.client.util.math.Vector3f; +import net.minecraft.util.math.Vec3f; import net.minecraft.item.Items; import net.minecraft.entity.EquipmentSlot; import net.minecraft.util.math.MathHelper; @@ -61,11 +61,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(Vector3f.POSITIVE_X.getDegreesQuaternion(2 + capeMotionX / 12 + capeMotionY)); - stack.multiply(Vector3f.POSITIVE_Z.getDegreesQuaternion( diagMotion / 2)); - stack.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(-diagMotion / 2)); - stack.multiply(Vector3f.POSITIVE_Z.getDegreesQuaternion(180)); - stack.multiply(Vector3f.POSITIVE_X.getDegreesQuaternion(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/HeldItemFeature.java b/src/main/java/com/minelittlepony/client/render/entity/feature/HeldItemFeature.java index da023ccb..6be54dea 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 @@ -10,7 +10,7 @@ import net.minecraft.client.render.VertexConsumerProvider; import net.minecraft.client.render.entity.model.EntityModel; import net.minecraft.client.render.model.json.ModelTransformation; import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.client.util.math.Vector3f; +import net.minecraft.util.math.Vec3f; import net.minecraft.entity.LivingEntity; import net.minecraft.item.ItemStack; import net.minecraft.util.Arm; @@ -63,7 +63,7 @@ public class HeldItemFeature & } preItemRender(entity, drop, transform, arm, stack); - MinecraftClient.getInstance().getItemRenderer().renderItem(entity, drop, transform, arm == Arm.LEFT, stack, renderContext, entity.world, lightUv, OverlayTexture.DEFAULT_UV); + MinecraftClient.getInstance().getItemRenderer().renderItem(entity, drop, transform, arm == Arm.LEFT, stack, renderContext, entity.world, lightUv, 0, OverlayTexture.DEFAULT_UV); postItemRender(entity, drop, transform, arm, stack, renderContext); stack.pop(); @@ -77,8 +77,8 @@ public class HeldItemFeature & stack.translate(left / 10, -0.2F, -0.5F); } - stack.multiply(Vector3f.POSITIVE_X.getDegreesQuaternion(-90)); - stack.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(left * 180)); + stack.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(-90)); + stack.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(left * 180)); stack.translate(left * -0.2F, 0.125F, -1); } 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 7d46c7b5..a1fb713d 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,7 +8,7 @@ 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.client.util.math.Vector3f; +import net.minecraft.util.math.Vec3f; import net.minecraft.entity.EntityType; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.nbt.CompoundTag; @@ -54,7 +54,7 @@ public class PassengerFeature & IPo } private void renderBlock(MatrixStack stack, VertexConsumerProvider renderContext, T entity, ItemStack itemstack, int lightUv) { - stack.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(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/transform/PostureElytra.java b/src/main/java/com/minelittlepony/client/transform/PostureElytra.java index cdbdfccd..c9886f85 100644 --- a/src/main/java/com/minelittlepony/client/transform/PostureElytra.java +++ b/src/main/java/com/minelittlepony/client/transform/PostureElytra.java @@ -1,7 +1,7 @@ package com.minelittlepony.client.transform; import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.client.util.math.Vector3f; +import net.minecraft.util.math.Vec3f; import net.minecraft.entity.LivingEntity; import com.minelittlepony.model.IModel; @@ -9,7 +9,7 @@ import com.minelittlepony.model.IModel; public class PostureElytra implements PonyPosture { @Override public void transform(IModel model, LivingEntity entity, MatrixStack stack, double motionX, double motionY, double motionZ, float yaw, float ticks) { - stack.multiply(Vector3f.POSITIVE_X.getDegreesQuaternion(90)); + stack.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(90)); stack.translate(0, model.getAttributes().isCrouching ? 0.2F : -1, 0); } } diff --git a/src/main/java/com/minelittlepony/client/transform/PostureFlight.java b/src/main/java/com/minelittlepony/client/transform/PostureFlight.java index 50a9e719..4395efee 100644 --- a/src/main/java/com/minelittlepony/client/transform/PostureFlight.java +++ b/src/main/java/com/minelittlepony/client/transform/PostureFlight.java @@ -5,7 +5,7 @@ import com.minelittlepony.model.IModel; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.client.util.math.Vector3f; +import net.minecraft.util.math.Vec3f; import net.minecraft.entity.LivingEntity; public class PostureFlight extends MotionCompositor implements PonyPosture { @@ -22,7 +22,7 @@ public class PostureFlight extends MotionCompositor implements PonyPosture