Search in sources :

Example 1 with IntArrayList

use of org.bukkit.craftbukkit.libs.it.unimi.dsi.fastutil.ints.IntArrayList in project MessageOverHead by TheDiVaZo.

the class Bubble method remove.

public void remove() {
    if (isRemovedBubble)
        return;
    PacketContainer removeStandPacket = new PacketContainer(PacketType.Play.Server.ENTITY_DESTROY);
    if (Main.getVersion() >= 1.18f) {
        List<Integer> Entity = new ArrayList<>();
        Entity.add(id);
        removeStandPacket.getIntLists().write(0, Entity);
    } else if (Main.getVersion() == 1.17f) {
        removeStandPacket.getModifier().write(0, new IntArrayList(new int[] { id }));
    } else {
        removeStandPacket.getModifier().write(0, new int[] { id });
    }
    pm.broadcastServerPacket(removeStandPacket);
}
Also used : PacketContainer(com.comphenix.protocol.events.PacketContainer) IntArrayList(org.bukkit.craftbukkit.libs.it.unimi.dsi.fastutil.ints.IntArrayList) IntArrayList(org.bukkit.craftbukkit.libs.it.unimi.dsi.fastutil.ints.IntArrayList)

Example 2 with IntArrayList

use of org.bukkit.craftbukkit.libs.it.unimi.dsi.fastutil.ints.IntArrayList in project HMCCosmetics by HibiscusMC.

the class PacketHelper_1_17_R1 method getDestroyPacket.

@Override
public PacketContainer getDestroyPacket(final int entityId) {
    final PacketContainer destroyPacket = new PacketContainer(PacketType.Play.Server.ENTITY_DESTROY);
    destroyPacket.getModifier().write(0, new IntArrayList(new int[] { entityId }));
    return destroyPacket;
}
Also used : PacketContainer(com.comphenix.protocol.events.PacketContainer) IntArrayList(org.bukkit.craftbukkit.libs.it.unimi.dsi.fastutil.ints.IntArrayList)

Aggregations

PacketContainer (com.comphenix.protocol.events.PacketContainer)2 IntArrayList (org.bukkit.craftbukkit.libs.it.unimi.dsi.fastutil.ints.IntArrayList)2