From d23765893c1a46a191dae925b996d91fc99c6e8c Mon Sep 17 00:00:00 2001 From: Alexis Kaufman Date: Sat, 24 Aug 2024 22:32:40 -0500 Subject: [PATCH] force the dismount from client and server side --- .../drzhark/mocreatures/network/MoCMessageHandler.java | 9 +++++---- .../message/MoCMessageDismountRidingEntityServer.java | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/drzhark/mocreatures/network/MoCMessageHandler.java b/src/main/java/drzhark/mocreatures/network/MoCMessageHandler.java index 1b34b13f..8a3da9b1 100644 --- a/src/main/java/drzhark/mocreatures/network/MoCMessageHandler.java +++ b/src/main/java/drzhark/mocreatures/network/MoCMessageHandler.java @@ -160,11 +160,12 @@ public void run() { MoCProxyClient.mc.displayGuiScreen(new MoCGUIEntityNamer(((IMoCEntity) entity), ((IMoCEntity) entity).getPetName())); } else if (this.message instanceof MoCMessageDismountRidingEntityClient) { MoCMessageDismountRidingEntityClient message = (MoCMessageDismountRidingEntityClient) this.message; - Entity entity = MoCProxyClient.mc.player.world.getEntityByID(message.passengerId); - if (entity instanceof IMoCEntity) { - EntityPlayer player = entity.getRidingEntity() instanceof EntityPlayer ? (EntityPlayer) entity.getRidingEntity() : null; + Entity passenger = MoCProxyClient.mc.player.world.getEntityByID(message.passengerId); + if (passenger instanceof IMoCEntity) { + EntityPlayer player = passenger.getRidingEntity() instanceof EntityPlayer ? (EntityPlayer) passenger.getRidingEntity() : null; if (player != null) { - entity.setPosition(player.posX, player.posY + 1D, player.posZ); + passenger.dismountRidingEntity(); + passenger.setPosition(player.posX, player.posY + 2D, player.posZ); } } } diff --git a/src/main/java/drzhark/mocreatures/network/message/MoCMessageDismountRidingEntityServer.java b/src/main/java/drzhark/mocreatures/network/message/MoCMessageDismountRidingEntityServer.java index d7b597c7..892ef339 100644 --- a/src/main/java/drzhark/mocreatures/network/message/MoCMessageDismountRidingEntityServer.java +++ b/src/main/java/drzhark/mocreatures/network/message/MoCMessageDismountRidingEntityServer.java @@ -36,7 +36,7 @@ public IMessage onMessage(MoCMessageDismountRidingEntityServer message, MessageC Entity entity = player.world.getEntityByID(message.passengerId); if (entity instanceof IMoCEntity) { entity.dismountRidingEntity(); - entity.setPosition(player.posX, player.posY + 1D, player.posZ); + entity.setPosition(player.posX, player.posY + 2D, player.posZ); } return null; }