Search in sources :

Example 1 with PacketPlayOutEntityDestroy

use of net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy in project InteractionVisualizer by LOOHP.

the class V1_17 method createEntityDestroyPacket.

@Override
public PacketContainer[] createEntityDestroyPacket(int... entityIds) {
    if (entityDestoryIsInt) {
        PacketContainer[] packets = new PacketContainer[entityIds.length];
        for (int i = 0; i < entityIds.length; i++) {
            PacketContainer packet = InteractionVisualizer.protocolManager.createPacket(PacketType.Play.Server.ENTITY_DESTROY);
            packet.getIntegers().write(0, entityIds[i]);
            packets[i] = packet;
        }
        return packets;
    } else {
        return new PacketContainer[] { PacketContainer.fromPacket(new PacketPlayOutEntityDestroy(entityIds)) };
    }
}
Also used : PacketContainer(com.comphenix.protocol.events.PacketContainer) PacketPlayOutEntityDestroy(net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy)

Example 2 with PacketPlayOutEntityDestroy

use of net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy in project InteractionVisualizer by LOOHP.

the class V1_18 method createEntityDestroyPacket.

@Override
public PacketContainer[] createEntityDestroyPacket(int... entityIds) {
    if (entityDestroyIsInt) {
        PacketContainer[] packets = new PacketContainer[entityIds.length];
        for (int i = 0; i < entityIds.length; i++) {
            PacketContainer packet = InteractionVisualizer.protocolManager.createPacket(PacketType.Play.Server.ENTITY_DESTROY);
            packet.getIntegers().write(0, entityIds[i]);
            packets[i] = packet;
        }
        return packets;
    } else {
        return new PacketContainer[] { PacketContainer.fromPacket(new PacketPlayOutEntityDestroy(entityIds)) };
    }
}
Also used : PacketContainer(com.comphenix.protocol.events.PacketContainer) PacketPlayOutEntityDestroy(net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy)

Example 3 with PacketPlayOutEntityDestroy

use of net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy in project InteractionVisualizer by LOOHP.

the class V1_18_2 method createEntityDestroyPacket.

@Override
public PacketContainer[] createEntityDestroyPacket(int... entityIds) {
    if (entityDestroyIsInt) {
        PacketContainer[] packets = new PacketContainer[entityIds.length];
        for (int i = 0; i < entityIds.length; i++) {
            PacketContainer packet = InteractionVisualizer.protocolManager.createPacket(PacketType.Play.Server.ENTITY_DESTROY);
            packet.getIntegers().write(0, entityIds[i]);
            packets[i] = packet;
        }
        return packets;
    } else {
        return new PacketContainer[] { PacketContainer.fromPacket(new PacketPlayOutEntityDestroy(entityIds)) };
    }
}
Also used : PacketContainer(com.comphenix.protocol.events.PacketContainer) PacketPlayOutEntityDestroy(net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy)

Aggregations

PacketContainer (com.comphenix.protocol.events.PacketContainer)3 PacketPlayOutEntityDestroy (net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy)3