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

fix: multimap stuff for 1.21.10

This commit is contained in:
Logan
2025-11-10 16:45:20 -06:00
parent 3b72f34747
commit d9fbae1dd4
3 changed files with 32 additions and 4 deletions

View File

@@ -17,5 +17,5 @@ tasks {
}
dependencies {
compileOnly("io.papermc.paper:paper-api:1.21.6-R0.1-SNAPSHOT")
compileOnly("io.papermc.paper:paper-api:1.21.10-R0.1-SNAPSHOT")
}

View File

@@ -2,6 +2,7 @@ package me.lojosho.hibiscuscommons.util.packets;
import it.unimi.dsi.fastutil.ints.IntArrayList;
import it.unimi.dsi.fastutil.ints.IntList;
import me.lojosho.hibiscuscommons.nms.MinecraftVersion;
import me.lojosho.hibiscuscommons.nms.NMSHandlers;
import me.lojosho.hibiscuscommons.util.MessagesUtil;
import org.bukkit.GameMode;
@@ -171,6 +172,26 @@ public class PacketManager {
NMSHandlers.getHandler().getPacketHandler().sendEquipmentSlotUpdate(entityId, equipment, sendTo);
}
/**
*
* @param location Location of the fake player.
* @param uuid UUID of the fake player. Should be random.
* @param entityId The entityID that the entity will take on.
* @param sendTo Who should it send the packet to?
*/
public static void sendFakePlayerSpawnPacket(
final @NotNull Location location,
final UUID uuid,
final int entityId,
final @NotNull List<Player> sendTo
) {
sendEntitySpawnPacket(location, entityId, EntityType.PLAYER, uuid, sendTo);
/* Data structure is different for Mannequins
if (NMSHandlers.getVersion().isLower(MinecraftVersion.v1_21_9)) sendEntitySpawnPacket(location, entityId, EntityType.PLAYER, uuid, sendTo);
else sendEntitySpawnPacket(location, entityId, EntityType.MANNEQUIN, uuid, sendTo);
*/
}
private static List<Player> getNearbyPlayers(Location location, int distance) {
List<Player> players = new ArrayList<>();
for (Entity entity : location.getWorld().getNearbyEntities(location, distance, distance, distance)) {