9
0
mirror of https://github.com/HibiscusMC/HibiscusCommons.git synced 2025-12-19 15:09:26 +00:00

fix: make mount packet sending sync to prevent problems with the backpack staying on the player

This commit is contained in:
Logan
2025-09-08 14:34:05 -05:00
parent 90f6a2a3f2
commit 3c107b51ca
14 changed files with 97 additions and 6 deletions

View File

@@ -30,4 +30,10 @@ public class NMSCommon {
}
});
}
public void sendPacketSync(@NotNull Player player, @NotNull Packet packet) {
ServerPlayer serverPlayer = ((CraftPlayer) player).getHandle();
ServerPlayerConnection connection = serverPlayer.connection;
connection.send(packet);
}
}

View File

@@ -283,7 +283,7 @@ public class NMSPackets extends NMSCommon implements me.lojosho.hibiscuscommons.
fakeNmsEntity.passengers = ImmutableList.copyOf(passengers);
ClientboundSetPassengersPacket packet = new ClientboundSetPassengersPacket(fakeNmsEntity);
fakeNmsEntity.passengers = ImmutableList.of();
for (Player p : sendTo) sendPacket(p, packet);
for (Player p : sendTo) sendPacketSync(p, packet);
}
@Override