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

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

This reverts commit 3c107b51ca.
This commit is contained in:
Logan
2025-10-11 22:04:30 -05:00
parent 3c107b51ca
commit 867ce2e939
14 changed files with 6 additions and 97 deletions

View File

@@ -30,10 +30,4 @@ 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

@@ -10,7 +10,6 @@ import com.mojang.serialization.JsonOps;
import io.papermc.paper.adventure.PaperAdventure;
import it.unimi.dsi.fastutil.ints.IntList;
import me.lojosho.hibiscuscommons.HibiscusCommonsPlugin;
import me.lojosho.hibiscuscommons.packets.BundledRidingData;
import me.lojosho.hibiscuscommons.util.AdventureUtils;
import me.lojosho.hibiscuscommons.util.MessagesUtil;
import net.kyori.adventure.text.Component;
@@ -283,7 +282,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) sendPacketSync(p, packet);
for (Player p : sendTo) sendPacket(p, packet);
}
@Override
@@ -563,16 +562,4 @@ public class NMSPackets extends NMSCommon implements me.lojosho.hibiscuscommons.
ClientboundBundlePacket bundlePacket = new ClientboundBundlePacket(List.of(spawnPacket, dataPacket));
sendPacket(sendTo, bundlePacket);
}
@Override
public void sendBundledRidingPacket(BundledRidingData packet, List<Player> sendTo) {
List<ClientboundSetPassengersPacket> packets = new ArrayList<>();
for (Map.Entry<Integer, List<Integer>> entry : packet.getQueued().entrySet()) {
packets.add((ClientboundSetPassengersPacket) createMountPacket(entry.getKey(), entry.getValue().stream()
.mapToInt(Integer::intValue)
.toArray()));
}
ClientboundBundlePacket bundlePacket = new ClientboundBundlePacket(List.copyOf(packets));
sendPacket(sendTo, bundlePacket);
}
}