From 42291938171c015ad89da421cacec07ffcde61d1 Mon Sep 17 00:00:00 2001 From: Sollace Date: Thu, 19 Mar 2020 15:25:59 +0200 Subject: [PATCH] 1.15.2 -> 20w10a --- build.gradle | 4 +++- gradle.properties | 8 ++++---- .../client/mixin/MixinClientPlayerEntity.java | 4 ++-- ...nly.java => MixinPlayerMoveC2SPacket.java} | 10 +++++++++- .../mixin/MixinPlayerMoveC2SPacket_Both.java | 19 ------------------- .../model/entity/race/SeaponyModel.java | 2 +- .../com/minelittlepony/client/pony/Pony.java | 6 +++--- .../client/render/MobRenderers.java | 2 +- .../client/render/entity/ZomponyRenderer.java | 8 ++++---- .../render/entity/feature/CapeFeature.java | 15 ++++----------- .../entity/npc/IllagerPonyRenderer.java | 4 ++-- .../client/transform/PonyPosture.java | 2 +- 12 files changed, 34 insertions(+), 50 deletions(-) rename src/main/java/com/minelittlepony/client/mixin/{MixinPlayerMoveC2SPacket_LookOnly.java => MixinPlayerMoveC2SPacket.java} (62%) delete mode 100644 src/main/java/com/minelittlepony/client/mixin/MixinPlayerMoveC2SPacket_Both.java diff --git a/build.gradle b/build.gradle index 804061d6..8d20ae90 100644 --- a/build.gradle +++ b/build.gradle @@ -67,7 +67,9 @@ dependencies { include "com.minelittlepony:Mson:${project.mson_version}" modImplementation "com.minelittlepony:HDSkins:${project.hd_skins_version}" - modCompileOnly "io.github.prospector:modmenu:${project.modmenu_version}" + modImplementation("io.github.prospector:modmenu:${project.modmenu_version}") { + exclude group: "net.fabricmc.fabric-api" + } } // diff --git a/gradle.properties b/gradle.properties index 91f2863e..2d2e04b5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,9 +3,9 @@ org.gradle.daemon=false # Fabric Properties # check these on https://fabricmc.net/use - minecraft_version=1.15.2 - yarn_mappings=1.15.2+build.7:v2 - loader_version=0.7.6+build.180 + minecraft_version=20w10a + yarn_mappings=20w10a+build.16:v2 + loader_version=0.7.8+build.187 # Mod Properties group=com.minelittlepony @@ -16,7 +16,7 @@ org.gradle.daemon=false release=RELEASE # Dependencies - modmenu_version=1.8.+ + modmenu_version=1.10.+ kirin_version=1.5.2-1.15.2 hd_skins_version=6.1.3-1.15.2 mson_version=1.1.11-1.15.2 diff --git a/src/main/java/com/minelittlepony/client/mixin/MixinClientPlayerEntity.java b/src/main/java/com/minelittlepony/client/mixin/MixinClientPlayerEntity.java index 8e624037..8b6539cc 100644 --- a/src/main/java/com/minelittlepony/client/mixin/MixinClientPlayerEntity.java +++ b/src/main/java/com/minelittlepony/client/mixin/MixinClientPlayerEntity.java @@ -13,8 +13,8 @@ abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity { public MixinClientPlayerEntity() { super(null, null); } @Override - public float getActiveEyeHeight(EntityPose entityPose_1, EntityDimensions entitySize_1) { - float value = super.getActiveEyeHeight(entityPose_1, entitySize_1); + public float getActiveEyeHeight(EntityPose pose, EntityDimensions dimensions) { + float value = super.getActiveEyeHeight(pose, dimensions); IPony pony = MineLittlePony.getInstance().getManager().getPony(this); diff --git a/src/main/java/com/minelittlepony/client/mixin/MixinPlayerMoveC2SPacket_LookOnly.java b/src/main/java/com/minelittlepony/client/mixin/MixinPlayerMoveC2SPacket.java similarity index 62% rename from src/main/java/com/minelittlepony/client/mixin/MixinPlayerMoveC2SPacket_LookOnly.java rename to src/main/java/com/minelittlepony/client/mixin/MixinPlayerMoveC2SPacket.java index 52437179..355a8ba5 100644 --- a/src/main/java/com/minelittlepony/client/mixin/MixinPlayerMoveC2SPacket_LookOnly.java +++ b/src/main/java/com/minelittlepony/client/mixin/MixinPlayerMoveC2SPacket.java @@ -1,6 +1,6 @@ package com.minelittlepony.client.mixin; -import net.minecraft.server.network.packet.PlayerMoveC2SPacket; +import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; @@ -9,6 +9,14 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import com.minelittlepony.client.HorseCam; +@Mixin(PlayerMoveC2SPacket.Both.class) +abstract class MixinPlayerMoveC2SPacket extends PlayerMoveC2SPacket { + @Inject(method = "(DDDFFZ)V", + at = @At("RETURN")) + private void onInit(CallbackInfo info) { + this.pitch = HorseCam.transformCameraAngle(this.pitch); + } +} @Mixin(PlayerMoveC2SPacket.LookOnly.class) abstract class MixinPlayerMoveC2SPacket_LookOnly extends PlayerMoveC2SPacket { @Inject(method = "(FFZ)V", diff --git a/src/main/java/com/minelittlepony/client/mixin/MixinPlayerMoveC2SPacket_Both.java b/src/main/java/com/minelittlepony/client/mixin/MixinPlayerMoveC2SPacket_Both.java deleted file mode 100644 index 9c5c57ee..00000000 --- a/src/main/java/com/minelittlepony/client/mixin/MixinPlayerMoveC2SPacket_Both.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.minelittlepony.client.mixin; - -import net.minecraft.server.network.packet.PlayerMoveC2SPacket; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import com.minelittlepony.client.HorseCam; - -@Mixin(PlayerMoveC2SPacket.Both.class) -abstract class MixinPlayerMoveC2SPacket_Both extends PlayerMoveC2SPacket { - @Inject(method = "(DDDFFZ)V", - at = @At("RETURN")) - private void onInit(CallbackInfo info) { - this.pitch = HorseCam.transformCameraAngle(this.pitch); - } -} diff --git a/src/main/java/com/minelittlepony/client/model/entity/race/SeaponyModel.java b/src/main/java/com/minelittlepony/client/model/entity/race/SeaponyModel.java index 0f126a49..1ad11ec7 100644 --- a/src/main/java/com/minelittlepony/client/model/entity/race/SeaponyModel.java +++ b/src/main/java/com/minelittlepony/client/model/entity/race/SeaponyModel.java @@ -84,7 +84,7 @@ public class SeaponyModel extends UnicornModel { rightArm.pitch -= 0.5F; } - if (!entity.isSubmergedInWater() || entity.onGround) { + if (!entity.isSubmergedInWater() || entity.method_24828()) { leftArm.yaw -= 0.5F; rightArm.yaw += 0.5F; } diff --git a/src/main/java/com/minelittlepony/client/pony/Pony.java b/src/main/java/com/minelittlepony/client/pony/Pony.java index e6566c13..f9182abb 100644 --- a/src/main/java/com/minelittlepony/client/pony/Pony.java +++ b/src/main/java/com/minelittlepony/client/pony/Pony.java @@ -81,12 +81,12 @@ public class Pony implements IPony { * this is to keep Pegasus wings from flapping in odd situations (Hypixel). */ private boolean isOnGround(LivingEntity entity) { - if (entity.onGround) { + if (entity.method_24828()) { return true; } BlockState below = entity.getEntityWorld() - .getBlockState(entity.getBlockPos().down(1)); + .getBlockState(entity.getSenseCenterPos().down(1)); // Check for stairs so we can keep Pegasi from flailing their wings as they descend double offsetAmount = below.getBlock() instanceof StairsBlock ? 1 : 0.05; @@ -108,7 +108,7 @@ public class Pony implements IPony { @Override public boolean isPartiallySubmerged(LivingEntity entity) { return entity.isSubmergedInWater() - || entity.getEntityWorld().getBlockState(entity.getBlockPos()).getMaterial() == Material.WATER; + || entity.getEntityWorld().getBlockState(entity.getSenseCenterPos()).getMaterial() == Material.WATER; } @Override diff --git a/src/main/java/com/minelittlepony/client/render/MobRenderers.java b/src/main/java/com/minelittlepony/client/render/MobRenderers.java index 19f686e0..c9d3411c 100644 --- a/src/main/java/com/minelittlepony/client/render/MobRenderers.java +++ b/src/main/java/com/minelittlepony/client/render/MobRenderers.java @@ -37,7 +37,7 @@ public final class MobRenderers { pony.switchRenderer(state, EntityType.DROWNED, ZomponyRenderer.Drowned::new); }); public static final MobRenderers ZOMBIE_PIGMAN = register("pigzombies", (state, pony) -> { - pony.switchRenderer(state, EntityType.ZOMBIE_PIGMAN, ZomponyRenderer.Pigman::new); + pony.switchRenderer(state, EntityType.ZOMBIFIED_PIGLIN, ZomponyRenderer.Piglin::new); }); public static final MobRenderers SKELETON = register("skeletons", (state, pony) -> { pony.switchRenderer(state, EntityType.SKELETON, SkeleponyRenderer::new); diff --git a/src/main/java/com/minelittlepony/client/render/entity/ZomponyRenderer.java b/src/main/java/com/minelittlepony/client/render/entity/ZomponyRenderer.java index ccc62724..8156803a 100644 --- a/src/main/java/com/minelittlepony/client/render/entity/ZomponyRenderer.java +++ b/src/main/java/com/minelittlepony/client/render/entity/ZomponyRenderer.java @@ -6,7 +6,7 @@ import net.minecraft.entity.mob.DrownedEntity; import net.minecraft.entity.mob.GiantEntity; import net.minecraft.entity.mob.HuskEntity; import net.minecraft.entity.mob.ZombieEntity; -import net.minecraft.entity.mob.ZombiePigmanEntity; +import net.minecraft.entity.mob.ZombifiedPiglinEntity; import net.minecraft.util.Identifier; import com.minelittlepony.client.model.ModelType; @@ -40,14 +40,14 @@ public class ZomponyRenderer extends PonyRenderer.C } } - public static class Pigman extends ZomponyRenderer { + public static class Piglin extends ZomponyRenderer { - public Pigman(EntityRenderDispatcher manager) { + public Piglin(EntityRenderDispatcher manager) { super(manager); } @Override - public Identifier findTexture(ZombiePigmanEntity entity) { + public Identifier findTexture(ZombifiedPiglinEntity entity) { return PIGMAN; } } 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 e283ca32..90394ebc 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 @@ -38,18 +38,12 @@ public class CapeFeature> stack.translate(0, 0.24F, 0); model.getBodyPart(BodyPart.BODY).rotate(stack); - double capeX = MathHelper.lerp(tickDelta, player.field_7524, player.field_7500) - MathHelper.lerp(tickDelta, player.prevX, player.getX()); - double capeY = MathHelper.lerp(tickDelta, player.field_7502, player.field_7521) - MathHelper.lerp(tickDelta, player.prevY, player.getY()); - double capeZ = MathHelper.lerp(tickDelta, player.field_7522, player.field_7499) - MathHelper.lerp(tickDelta, player.prevZ, player.getZ()); + double capeX = MathHelper.lerp(tickDelta, player.capeX, player.prevCapeX) - MathHelper.lerp(tickDelta, player.prevX, player.getX()); + double capeY = MathHelper.lerp(tickDelta, player.capeY, player.prevCapeY) - MathHelper.lerp(tickDelta, player.prevY, player.getY()); + double capeZ = MathHelper.lerp(tickDelta, player.capeZ, player.prevCapeZ) - MathHelper.lerp(tickDelta, player.prevZ, player.getZ()); float motionYaw = player.prevBodyYaw + (player.bodyYaw - player.prevBodyYaw); - //double capeX = player.prevRenderX + (player.x - player.prevRenderX) * scale - (player.prevX + (player.x - player.prevX) * scale); - //double capeY = player.prevRenderY + (player.y - player.prevRenderY) * scale - (player.prevY + (player.y - player.prevY) * scale); - //double capeZ = player.prevRenderZ + (player.z - player.prevRenderZ) * scale - (player.prevZ + (player.z - player.prevZ) * scale); - - //float motionYaw = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * scale; - double sin = MathHelper.sin(motionYaw * PI / 180); double cos = (-MathHelper.cos(motionYaw * PI / 180)); @@ -64,8 +58,7 @@ public class CapeFeature> if (capeMotionX < 0) capeMotionX = 0; - float camera = MathHelper.lerp(tickDelta, player.field_7505, player.field_7483); - //float camera = player.prevCameraYaw + (player.cameraYaw - player.prevCameraYaw) * scale; + 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)); 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 8268e81e..b2a26ea8 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 @@ -78,7 +78,7 @@ public abstract class IllagerPonyRenderer extends PonyR public void render(IllusionerEntity entity, float entityYaw, float tickDelta, MatrixStack stack, VertexConsumerProvider renderContext, int lightUv) { if (entity.isInvisible()) { Vec3d[] clones = entity.method_7065(tickDelta); - float rotation = getCustomAngle(entity, tickDelta); + float rotation = getAnimationProgress(entity, tickDelta); for (int i = 0; i < clones.length; ++i) { stack.push(); @@ -96,7 +96,7 @@ public abstract class IllagerPonyRenderer extends PonyR } @Override - protected boolean method_4056(IllusionerEntity entity) { + protected boolean isFullyVisible(IllusionerEntity entity) { return true; } } diff --git a/src/main/java/com/minelittlepony/client/transform/PonyPosture.java b/src/main/java/com/minelittlepony/client/transform/PonyPosture.java index a4499a5c..b0ee8681 100644 --- a/src/main/java/com/minelittlepony/client/transform/PonyPosture.java +++ b/src/main/java/com/minelittlepony/client/transform/PonyPosture.java @@ -21,7 +21,7 @@ public interface PonyPosture { default void apply(T player, IModel model, MatrixStack stack, float yaw, float ticks, int invert) { if (applies(player)) { double motionX = player.getX() - player.prevX; - double motionY = player.onGround ? 0 : player.getY() - player.prevY; + double motionY = player.method_24828() ? 0 : player.getY() - player.prevY; double motionZ = player.getZ() - player.prevZ; transform(model, player, stack, motionX, invert * motionY, motionZ, yaw, ticks);