diff --git a/README.md b/README.md index db95b99..538ec8d 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ PurpurClient is designed to work together with [Purpur](https://github.com/Purpu -### Current Features in 1.20.1: +### Current Features in 1.20.2: * Customizable mob passenger offsets * Adds bee counts inside beehives to debug screen¹ diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..3bec0c8 --- /dev/null +++ b/TODO.md @@ -0,0 +1,2 @@ +- [ ] fix seat offset +- [ ] verify beehive bee count in debug screen works correctly diff --git a/gradle.properties b/gradle.properties index c711a47..eca9263 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,10 +1,10 @@ org.gradle.jvmargs=-Xmx2G -minecraft_version=1.20.1 -yarn_mappings=1.20.1+build.10 +minecraft_version=1.20.2-rc2 +yarn_mappings=1.20.2-rc2+build.4 loader_version=0.14.22 -fabric_version=0.88.1+1.20.1 -modmenu_version=7.2.2 +fabric_version=0.89.0+1.20.2 +modmenu_version=8.0.0-beta.2 configurate_version=4.1.2 maven_group=org.purpurmc.purpur.client diff --git a/src/main/java/org/purpurmc/purpur/client/entity/Seat.java b/src/main/java/org/purpurmc/purpur/client/entity/Seat.java index d8aaf59..9f80b91 100644 --- a/src/main/java/org/purpurmc/purpur/client/entity/Seat.java +++ b/src/main/java/org/purpurmc/purpur/client/entity/Seat.java @@ -32,7 +32,7 @@ public Vec3d rotate(LivingEntity entity, Entity passenger) { double x = (this.x * cos + this.z * sin) + entity.getX(); double z = (this.z * cos - this.x * sin) + entity.getZ(); - double y = entity.getY() + entity.getMountedHeightOffset() + passenger.getHeightOffset(); + double y = entity.getPassengerRidingPos(passenger).y + (double) passenger.getRidingOffset(entity); return new Vec3d(x, y, z); } diff --git a/src/main/java/org/purpurmc/purpur/client/gui/screen/AbstractScreen.java b/src/main/java/org/purpurmc/purpur/client/gui/screen/AbstractScreen.java index a4f777c..d24783a 100644 --- a/src/main/java/org/purpurmc/purpur/client/gui/screen/AbstractScreen.java +++ b/src/main/java/org/purpurmc/purpur/client/gui/screen/AbstractScreen.java @@ -32,13 +32,12 @@ public void init() { @Override public void render(DrawContext context, int mouseX, int mouseY, float delta) { - renderBackground(context); context.drawCenteredTextWithShadow(this.textRenderer, this.title, this.centerX, 15, 0xFFFFFFFF); super.render(context, mouseX, mouseY, delta); } @Override - public void renderBackground(DrawContext context) { + public void renderBackground(DrawContext context, int mouseX, int mouseY, float delta) { if (this.client != null && this.client.world != null) { context.fillGradient(0, 0, this.width, this.height, 0xF00F4863, 0xF0370038); } else { diff --git a/src/main/java/org/purpurmc/purpur/client/gui/screen/MobScreen.java b/src/main/java/org/purpurmc/purpur/client/gui/screen/MobScreen.java index 9f789a0..3a17f34 100644 --- a/src/main/java/org/purpurmc/purpur/client/gui/screen/MobScreen.java +++ b/src/main/java/org/purpurmc/purpur/client/gui/screen/MobScreen.java @@ -141,7 +141,7 @@ public void init() { @Override public void render(DrawContext context, int mouseX, int mouseY, float delta) { - renderBackground(context); + renderBackground(context, mouseX, mouseY, delta); RenderSystem.setShader(GameRenderer::getPositionTexProgram); RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); @@ -261,8 +261,8 @@ public boolean mouseDragged(double mouseX, double mouseY, int button, double del } @Override - public boolean mouseScrolled(double mouseX, double mouseY, double amount) { - this.previewZoom += (float) amount; + public boolean mouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount) { + this.previewZoom += (float) verticalAmount; clampZoom(); return true; } diff --git a/src/main/java/org/purpurmc/purpur/client/gui/screen/widget/DoubleButton.java b/src/main/java/org/purpurmc/purpur/client/gui/screen/widget/DoubleButton.java index b7dd97f..1cb6801 100644 --- a/src/main/java/org/purpurmc/purpur/client/gui/screen/widget/DoubleButton.java +++ b/src/main/java/org/purpurmc/purpur/client/gui/screen/widget/DoubleButton.java @@ -3,18 +3,22 @@ import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.gui.screen.ButtonTextures; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.narration.NarrationMessageBuilder; import net.minecraft.client.gui.widget.ClickableWidget; +import net.minecraft.client.gui.widget.PressableWidget; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.Text; +import net.minecraft.util.Identifier; import net.minecraft.util.math.MathHelper; import org.purpurmc.purpur.client.config.options.DoubleOption; public class DoubleButton extends ClickableWidget implements Tickable { private final static Text PLUS = Text.of("+"); private final static Text MINUS = Text.of("-"); + private static final ButtonTextures TEXTURES = new ButtonTextures(new Identifier("widget/button"), new Identifier("widget/button_disabled"), new Identifier("widget/button_highlighted")); private final DoubleOption option; private int tooltipDelay; @@ -45,8 +49,8 @@ public void renderButton(DrawContext context, int mouseX, int mouseY, float delt onRelease(0, 0); } - drawButton(context, MINUS, this.getX(), this.getYImage(this.btn == Btn.MINUS || this.selected == Btn.MINUS)); - drawButton(context, PLUS, this.getX() + this.width - this.height, this.getYImage(this.btn == Btn.PLUS || this.selected == Btn.PLUS)); + drawButton(context, MINUS, this.getX(), this.btn == Btn.MINUS || this.selected == Btn.MINUS); + drawButton(context, PLUS, this.getX() + this.width - this.height, this.btn == Btn.PLUS || this.selected == Btn.PLUS); context.drawCenteredTextWithShadow(MinecraftClient.getInstance().textRenderer, this.getMessage(), this.getX() + this.width / 2, this.getY() + (this.height - 8) / 2, (this.active ? 0xFFFFFF : 0xA0A0A0) | MathHelper.ceil(this.alpha * 255.0f) << 24); @@ -55,12 +59,11 @@ public void renderButton(DrawContext context, int mouseX, int mouseY, float delt } } - private void drawButton(DrawContext context, Text text, int x, int i) { + private void drawButton(DrawContext context, Text text, int x, boolean i) { RenderSystem.enableDepthTest(); context.setShaderColor(1.0F, 1.0F, 1.0F, this.alpha); RenderSystem.enableBlend(); - this.drawTexture(context, WIDGETS_TEXTURE, x, this.getY(), 0, 46 + i * 20, 0, this.height / 2, this.height, 256, 256); - this.drawTexture(context, WIDGETS_TEXTURE, x + this.height / 2, this.getY(), 200 - this.height / 2, 46 + i * 20, 0, this.height / 2, this.height, 256, 256); + context.drawGuiTexture(TEXTURES.get(this.active, i), x, this.getY(), this.height, this.height); context.drawCenteredTextWithShadow(MinecraftClient.getInstance().textRenderer, text, x + this.height / 2, this.getY() + (this.height - 8) / 2, (this.active ? 0xFFFFFF : 0xA0A0A0) | MathHelper.ceil(this.alpha * 255.0f) << 24); } @@ -150,15 +153,4 @@ private void addValue(double value) { this.playDownSound(MinecraftClient.getInstance().getSoundManager()); this.option.set(this.option.get() + value); } - - private int getYImage(boolean hovered) { - int i = 1; - if (!this.active) { - i = 0; - } else if (hovered) { - i = 2; - } - - return i; - } } diff --git a/src/main/java/org/purpurmc/purpur/client/gui/screen/widget/MobButton.java b/src/main/java/org/purpurmc/purpur/client/gui/screen/widget/MobButton.java index 79c693c..70476bc 100644 --- a/src/main/java/org/purpurmc/purpur/client/gui/screen/widget/MobButton.java +++ b/src/main/java/org/purpurmc/purpur/client/gui/screen/widget/MobButton.java @@ -29,27 +29,23 @@ public void renderButton(DrawContext context, int mouseX, int mouseY, float delt RenderSystem.setShader(GameRenderer::getPositionTexProgram); RenderSystem.setShaderTexture(0, MOBS_TEXTURE); RenderSystem.enableDepthTest(); - drawTexture( - context, + context.drawTexture( MOBS_TEXTURE, this.getX(), this.getY(), this.width * 15, this.height * 14 + (this.isSelected() ? this.height : 0), - 0, this.width, this.height, this.width * 16, this.height * 16 ); - drawTexture( - context, + context.drawTexture( MOBS_TEXTURE, this.getX(), this.getY(), this.mob.getU() * this.width, this.mob.getV() * this.height, - 0, this.width, this.height, this.width * 16, diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/MixinMinecraftClient.java b/src/main/java/org/purpurmc/purpur/client/mixin/MixinMinecraftClient.java index 4c3ad04..a9c1216 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/MixinMinecraftClient.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/MixinMinecraftClient.java @@ -34,18 +34,19 @@ private void getWindowTitle(CallbackInfoReturnable cir) { if (network != null && network.getConnection().isOpen()) { sb.append(" - "); String username = client.getSession().getUsername(); + ServerInfo serverInfo = this.getCurrentServerEntry(); if (this.server != null && !this.server.isRemote()) { sb.append(I18n.translate("purpurclient.title.singleplayer", username)); - } else if (client.isConnectedToRealms()) { + } else if (serverInfo != null && serverInfo.isRealm()) { sb.append(I18n.translate("purpurclient.title.multiplayer.realms", username)); - } else if (this.server != null || this.getCurrentServerEntry() != null && this.getCurrentServerEntry().isLocal()) { - sb.append(I18n.translate("purpurclient.title.multiplayer.lan", username)); - } else { - if (this.getCurrentServerEntry() == null) { + } else if (this.server == null && (serverInfo == null || !serverInfo.isLocal())) { + if (serverInfo == null) { sb.append(I18n.translate("purpurclient.title.multiplayer.unknown", username)); } else { - sb.append(I18n.translate("purpurclient.title.multiplayer.server", username, this.getCurrentServerEntry().name)); + sb.append(I18n.translate("purpurclient.title.multiplayer.server", username, serverInfo.name)); } + } else { + sb.append(I18n.translate("purpurclient.title.multiplayer.lan", username)); } } cir.setReturnValue(sb.toString()); diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinAllay.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinAllay.java index ad30835..0d5aba0 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinAllay.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinAllay.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.AllayEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinAllay(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().allay.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().allay.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinAxolotl.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinAxolotl.java index 34d1311..d5ab6b7 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinAxolotl.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinAxolotl.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.AxolotlEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinAxolotl(EntityType entityType, World world) } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().axolotl.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().axolotl.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinBat.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinBat.java index 8546463..ff23171 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinBat.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinBat.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.BatEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinBat(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().bat.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().bat.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinBee.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinBee.java index 1d1cf56..28ac19d 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinBee.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinBee.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.BeeEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinBee(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().bee.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().bee.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinBlaze.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinBlaze.java index 5c6925b..b9d17b9 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinBlaze.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinBlaze.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.BlazeEntity; import net.minecraft.entity.mob.MobEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinBlaze(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().blaze.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().blaze.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinCat.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinCat.java index f8d0268..d016d3e 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinCat.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinCat.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.CatEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinCat(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().cat.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().cat.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinCaveSpider.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinCaveSpider.java index f95dedc..df08158 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinCaveSpider.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinCaveSpider.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.CaveSpiderEntity; import net.minecraft.entity.mob.MobEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinCaveSpider(EntityType entityType, World } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().caveSpider.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().caveSpider.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinChicken.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinChicken.java index 348457d..8c2df0b 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinChicken.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinChicken.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.ChickenEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinChicken(EntityType entityType, World world) } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().chicken.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().chicken.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinCod.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinCod.java index 3b3b384..42e2365 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinCod.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinCod.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.CodEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinCod(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().cod.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().cod.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinCow.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinCow.java index 3bba85e..df0bb92 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinCow.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinCow.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.CowEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinCow(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().cow.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().cow.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinCreeper.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinCreeper.java index 901044e..5109dc9 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinCreeper.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinCreeper.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.CreeperEntity; import net.minecraft.entity.mob.MobEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinCreeper(EntityType entityType, World world) } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().creeper.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().creeper.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinDolphin.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinDolphin.java index f2491e7..d694ca8 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinDolphin.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinDolphin.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.DolphinEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinDolphin(EntityType entityType, World world) } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().dolphin.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().dolphin.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinDonkey.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinDonkey.java index 93815a3..abdacad 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinDonkey.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinDonkey.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.DonkeyEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinDonkey(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().donkey.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().donkey.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinDrowned.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinDrowned.java index bda699e..265511d 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinDrowned.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinDrowned.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.DrownedEntity; import net.minecraft.entity.mob.MobEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinDrowned(EntityType entityType, World world) } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().drowned.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().drowned.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinElderGuardian.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinElderGuardian.java index f921333..e3d33dc 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinElderGuardian.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinElderGuardian.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.ElderGuardianEntity; import net.minecraft.entity.mob.MobEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinElderGuardian(EntityType entityType, } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().elderGuardian.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().elderGuardian.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinEnderDragon.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinEnderDragon.java index d379471..a89881c 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinEnderDragon.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinEnderDragon.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.boss.dragon.EnderDragonEntity; import net.minecraft.entity.mob.MobEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinEnderDragon(EntityType entityType, Worl } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().enderDragon.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().enderDragon.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinEnderman.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinEnderman.java index 6648f69..fda159b 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinEnderman.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinEnderman.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.EndermanEntity; import net.minecraft.entity.mob.MobEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinEnderman(EntityType entityType, World worl } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().enderman.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().enderman.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinEndermite.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinEndermite.java index 02c9fc6..c6aa643 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinEndermite.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinEndermite.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.EndermiteEntity; import net.minecraft.entity.mob.MobEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinEndermite(EntityType entityType, World wo } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().endermite.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().endermite.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinEvoker.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinEvoker.java index 43c5095..c4de843 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinEvoker.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinEvoker.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.EvokerEntity; import net.minecraft.entity.mob.MobEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinEvoker(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().evoker.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().evoker.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinFox.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinFox.java index 2df35c9..5c96752 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinFox.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinFox.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.FoxEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinFox(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().fox.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().fox.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinFrog.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinFrog.java index c867f8e..0a758d1 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinFrog.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinFrog.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.FrogEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinFrog(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().frog.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().frog.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinGhast.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinGhast.java index eefafde..cb8f829 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinGhast.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinGhast.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.GhastEntity; import net.minecraft.entity.mob.MobEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinGhast(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().ghast.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().ghast.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinGiant.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinGiant.java index 7aac259..af55acf 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinGiant.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinGiant.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.GiantEntity; import net.minecraft.entity.mob.MobEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinGiant(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().giant.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().giant.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinGlowSquid.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinGlowSquid.java index 87cb140..643123d 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinGlowSquid.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinGlowSquid.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.GlowSquidEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinGlowSquid(EntityType entityType, World wo } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().glowSquid.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().glowSquid.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinGoat.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinGoat.java index 4e4e249..d1dd1d2 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinGoat.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinGoat.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.GoatEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinGoat(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().goat.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().goat.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinGuardian.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinGuardian.java index 198d317..b9a8aa0 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinGuardian.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinGuardian.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.GuardianEntity; import net.minecraft.entity.mob.MobEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinGuardian(EntityType entityType, World worl } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().guardian.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().guardian.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinHoglin.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinHoglin.java index 83e4164..9af0937 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinHoglin.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinHoglin.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.HoglinEntity; import net.minecraft.entity.mob.MobEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.purpurmc.purpur.client.mixin.accessor.AccessHoglin; import org.spongepowered.asm.mixin.Mixin; @@ -16,8 +18,8 @@ public MixinHoglin(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().hoglin.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().hoglin.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinHorse.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinHorse.java index b8cfdfc..16f00b9 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinHorse.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinHorse.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.HorseEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinHorse(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().horse.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().horse.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinHusk.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinHusk.java index aa10b65..1a45763 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinHusk.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinHusk.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.HuskEntity; import net.minecraft.entity.mob.MobEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinHusk(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().husk.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().husk.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinIllusioner.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinIllusioner.java index 300471f..72fd8ce 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinIllusioner.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinIllusioner.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.IllusionerEntity; import net.minecraft.entity.mob.MobEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinIllusioner(EntityType entityType, World } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().illusioner.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().illusioner.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinIronGolem.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinIronGolem.java index f90cdde..b25640b 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinIronGolem.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinIronGolem.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.IronGolemEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinIronGolem(EntityType entityType, World wo } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().ironGolem.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().ironGolem.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinLlama.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinLlama.java index 98982a0..b8560bf 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinLlama.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinLlama.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.LlamaEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; @@ -18,8 +20,8 @@ public MixinLlama(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().llama.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().llama.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinMagmaCube.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinMagmaCube.java index 0a32e96..e834a1b 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinMagmaCube.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinMagmaCube.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MagmaCubeEntity; import net.minecraft.entity.mob.MobEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinMagmaCube(EntityType entityType, World wo } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().magmaCube.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().magmaCube.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinMooshroom.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinMooshroom.java index 12f9621..71c6701 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinMooshroom.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinMooshroom.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.MooshroomEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinMooshroom(EntityType entityType, World wo } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().mooshroom.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().mooshroom.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinMule.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinMule.java index 859c419..f710cbf 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinMule.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinMule.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.MuleEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinMule(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().mule.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().mule.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinOcelot.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinOcelot.java index 09e942b..c7433de 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinOcelot.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinOcelot.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.OcelotEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinOcelot(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().ocelot.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().ocelot.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinPanda.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinPanda.java index 8f9a431..378fd5c 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinPanda.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinPanda.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.PandaEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinPanda(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().panda.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().panda.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinParrot.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinParrot.java index 5981654..0f8b604 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinParrot.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinParrot.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.ParrotEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinParrot(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().parrot.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().parrot.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinPhantom.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinPhantom.java index 909f8af..9baedf1 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinPhantom.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinPhantom.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.mob.PhantomEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinPhantom(EntityType entityType, World world) } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().phantom.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().phantom.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinPig.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinPig.java index b74b817..dc10e87 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinPig.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinPig.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.PigEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinPig(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().pig.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().pig.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinPiglin.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinPiglin.java index d50a150..cf64309 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinPiglin.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinPiglin.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.mob.PiglinEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.purpurmc.purpur.client.mixin.accessor.AccessAbstractPiglin; import org.spongepowered.asm.mixin.Mixin; @@ -16,8 +18,8 @@ public MixinPiglin(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().piglin.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().piglin.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinPiglinBrute.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinPiglinBrute.java index 010f5cc..070b53a 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinPiglinBrute.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinPiglinBrute.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.mob.PiglinBruteEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.purpurmc.purpur.client.mixin.accessor.AccessAbstractPiglin; import org.spongepowered.asm.mixin.Mixin; @@ -16,8 +18,8 @@ public MixinPiglinBrute(EntityType entityType, Worl } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().piglinBrute.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().piglinBrute.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinPillager.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinPillager.java index c2da30c..9b22922 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinPillager.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinPillager.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.mob.PillagerEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinPillager(EntityType entityType, World worl } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().pillager.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().pillager.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinPolarBear.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinPolarBear.java index 7cafc09..1940635 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinPolarBear.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinPolarBear.java @@ -1,17 +1,21 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.PolarBearEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.purpurmc.purpur.client.entity.Seat; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Unique; @Mixin(PolarBearEntity.class) public abstract class MixinPolarBear extends MobEntity implements RidableEntity { + @Unique private final Seat seat = new Seat(0.0D, 0.0D, 0.0D); @Shadow @@ -22,12 +26,8 @@ public MixinPolarBear(EntityType entityType, World wo } @Override - public double getMountedHeightOffset() { - double height = getHeight() * getSeats().polarBear.y; - if (this.warningAnimationProgress > 0.0F) { - height -= (getSeats().polarBear.y + 0.5D) * (this.warningAnimationProgress / 6.0F); - } - return height; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().polarBear.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinPufferfish.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinPufferfish.java index ad5cf97..f5a8d50 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinPufferfish.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinPufferfish.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.PufferfishEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinPufferfish(EntityType entityType, World } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().pufferfish.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().pufferfish.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinRabbit.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinRabbit.java index 465020f..0b0448b 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinRabbit.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinRabbit.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.RabbitEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinRabbit(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().rabbit.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().rabbit.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinRavager.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinRavager.java index d2306b4..8b990c2 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinRavager.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinRavager.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.mob.RavagerEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinRavager(EntityType entityType, World world) } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().ravager.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().ravager.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSalmon.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSalmon.java index 099b063..1158194 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSalmon.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSalmon.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.SalmonEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinSalmon(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().salmon.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().salmon.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSheep.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSheep.java index 06c2e82..058a889 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSheep.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSheep.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.SheepEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinSheep(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().sheep.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().sheep.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinShulker.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinShulker.java index 2078567..fc1f15c 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinShulker.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinShulker.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.mob.ShulkerEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinShulker(EntityType entityType, World world) } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().shulker.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().shulker.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSilverfish.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSilverfish.java index 12900f6..aafa089 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSilverfish.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSilverfish.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.mob.SilverfishEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinSilverfish(EntityType entityType, World } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().silverfish.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().silverfish.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSkeleton.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSkeleton.java index e13a257..ee5beae 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSkeleton.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSkeleton.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.mob.SkeletonEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinSkeleton(EntityType entityType, World worl } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().skeleton.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().skeleton.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSkeletonHorse.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSkeletonHorse.java index 74c2975..b1e0b38 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSkeletonHorse.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSkeletonHorse.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.mob.SkeletonHorseEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinSkeletonHorse(EntityType entityType, } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().skeletonHorse.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().skeletonHorse.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSlime.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSlime.java index bce1705..8441377 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSlime.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSlime.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.mob.SlimeEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinSlime(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().slime.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().slime.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSnowGolem.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSnowGolem.java index 05a6e8d..7de6e25 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSnowGolem.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSnowGolem.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.SnowGolemEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinSnowGolem(EntityType entityType, World wo } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().snowGolem.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().snowGolem.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSpider.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSpider.java index 43c0d13..b983a5e 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSpider.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSpider.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.mob.SpiderEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinSpider(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().spider.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().spider.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSquid.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSquid.java index 0183ebe..cf23cb1 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSquid.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinSquid.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.SquidEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinSquid(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().squid.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().squid.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinStray.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinStray.java index f8de7ec..616c33a 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinStray.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinStray.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.mob.StrayEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinStray(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().stray.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().stray.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinStrider.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinStrider.java index 4919ce5..407c311 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinStrider.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinStrider.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.StriderEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinStrider(EntityType entityType, World world) } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().strider.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().strider.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinTadpole.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinTadpole.java index ca80910..4dc7f9e 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinTadpole.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinTadpole.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.TadpoleEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinTadpole(EntityType entityType, World world) } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().tadpole.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().tadpole.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinTraderLlama.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinTraderLlama.java index 0355a9a..16be20a 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinTraderLlama.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinTraderLlama.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.TraderLlamaEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinTraderLlama(EntityType entityType, Worl } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().traderLlama.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().traderLlama.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinTropicalFish.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinTropicalFish.java index 68ce5ce..affaa8f 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinTropicalFish.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinTropicalFish.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.TropicalFishEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinTropicalFish(EntityType entityType, Wo } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().tropicalFish.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().tropicalFish.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinTurtle.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinTurtle.java index f323a18..9042614 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinTurtle.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinTurtle.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.TurtleEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinTurtle(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().turtle.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().turtle.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinVex.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinVex.java index caaa742..a4f6778 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinVex.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinVex.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.mob.VexEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinVex(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().vex.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().vex.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinVillager.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinVillager.java index 7cf1819..2272838 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinVillager.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinVillager.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.VillagerEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinVillager(EntityType entityType, World worl } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().villager.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().villager.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinVindicator.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinVindicator.java index 74e177c..38baa7f 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinVindicator.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinVindicator.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.mob.VindicatorEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinVindicator(EntityType entityType, World } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().vindicator.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().vindicator.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinWanderingTrader.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinWanderingTrader.java index bbba925..60ee467 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinWanderingTrader.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinWanderingTrader.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.WanderingTraderEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinWanderingTrader(EntityType entityTy } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().wanderingTrader.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().wanderingTrader.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinWarden.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinWarden.java index de35b29..f07623a 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinWarden.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinWarden.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.mob.WardenEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinWarden(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().warden.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().warden.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinWitch.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinWitch.java index 9112e6f..0591b18 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinWitch.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinWitch.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.mob.WitchEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinWitch(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().witch.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().witch.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinWither.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinWither.java index 07e79d0..ec8d7cf 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinWither.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinWither.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.boss.WitherEntity; import net.minecraft.entity.mob.MobEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinWither(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().wither.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().wither.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinWitherSkeleton.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinWitherSkeleton.java index f433e70..0d65441 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinWitherSkeleton.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinWitherSkeleton.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.mob.WitherSkeletonEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinWitherSkeleton(EntityType entityType } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().witherSkeleton.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().witherSkeleton.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinWolf.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinWolf.java index 9f4e5a7..c51a4de 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinWolf.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinWolf.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.WolfEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinWolf(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().wolf.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().wolf.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinZoglin.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinZoglin.java index 3f7fd77..ae6547f 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinZoglin.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinZoglin.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.mob.ZoglinEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinZoglin(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().zoglin.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().zoglin.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinZombie.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinZombie.java index 4446aee..b778934 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinZombie.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinZombie.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.mob.ZombieEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinZombie(EntityType entityType, World world) { } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().zombie.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().zombie.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinZombieHorse.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinZombieHorse.java index f503c05..13798a3 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinZombieHorse.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinZombieHorse.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.mob.ZombieHorseEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinZombieHorse(EntityType entityType, Worl } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().zombieHorse.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().zombieHorse.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinZombieVillager.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinZombieVillager.java index 1fa688b..31faaea 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinZombieVillager.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinZombieVillager.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.mob.ZombieVillagerEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinZombieVillager(EntityType entityType } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().zombieVillager.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().zombieVillager.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinZombifiedPiglin.java b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinZombifiedPiglin.java index 150a795..e931f8a 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinZombifiedPiglin.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/mob/MixinZombifiedPiglin.java @@ -1,10 +1,12 @@ package org.purpurmc.purpur.client.mixin.mob; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityType; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.mob.ZombifiedPiglinEntity; import net.minecraft.world.World; +import org.joml.Vector3f; import org.purpurmc.purpur.client.entity.RidableEntity; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +17,8 @@ public MixinZombifiedPiglin(EntityType entityTy } @Override - public double getMountedHeightOffset() { - return (double) getHeight() * getSeats().zombifiedPiglin.y; + public Vector3f getPassengerAttachmentPos(Entity passenger, EntityDimensions dimensions, float scaleFactor) { + return super.getPassengerAttachmentPos(passenger, dimensions, scaleFactor).add(0, dimensions.height + (float) getSeats().zombifiedPiglin.y, 0); } @Override diff --git a/src/main/java/org/purpurmc/purpur/client/network/BeehivePacket.java b/src/main/java/org/purpurmc/purpur/client/network/BeehivePacket.java index 81b27b9..82cc248 100644 --- a/src/main/java/org/purpurmc/purpur/client/network/BeehivePacket.java +++ b/src/main/java/org/purpurmc/purpur/client/network/BeehivePacket.java @@ -26,7 +26,7 @@ public static void receiveBeehiveData(MinecraftClient client, ClientPlayNetworkH return; } - ByteArrayDataInput in = Packet.in(buf.getWrittenBytes()); + ByteArrayDataInput in = Packet.in(buf.readByteArray()); int count = in.readInt(); long packedPos = in.readLong(); BlockPos pos = BlockPos.fromLong(packedPos); diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 1a27df3..dc09ccd 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -19,6 +19,9 @@ "client": [ "org.purpurmc.purpur.client.PurpurClient" ], + "server": [ + "org.purpurmc.purpur.server.PurpurServer" + ], "modmenu": [ "org.purpurmc.purpur.client.gui.ModMenu" ] @@ -30,7 +33,7 @@ "depends": { "fabricloader": ">=0.14.11", "fabric": "*", - "minecraft": "1.20.1" + "minecraft": "1.20.2-rc.2" }, "custom": { "modmenu": { diff --git a/src/main/resources/purpurclient.accesswidener b/src/main/resources/purpurclient.accesswidener index cd58ebc..b525bd6 100644 --- a/src/main/resources/purpurclient.accesswidener +++ b/src/main/resources/purpurclient.accesswidener @@ -2,3 +2,4 @@ accessWidener v2 named extendable method net/minecraft/entity/Entity updatePassengerPosition (Lnet/minecraft/entity/Entity;)V extendable class net/minecraft/client/util/Window +extendable method net/minecraft/entity/Entity getPassengerAttachmentPos (Lnet/minecraft/entity/Entity;Lnet/minecraft/entity/EntityDimensions;F)Lorg/joml/Vector3f;