Skip to content

Commit

Permalink
force the dismount from client and server side
Browse files Browse the repository at this point in the history
  • Loading branch information
demonlexe committed Aug 25, 2024
1 parent 2c40070 commit d237658
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit d237658

Please sign in to comment.