31 lines
897 B
Java
31 lines
897 B
Java
/*
|
|
* Copyright (C) filoghost and contributors
|
|
*
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
*/
|
|
package me.filoghost.holographicdisplays.nms.v1_18_R1;
|
|
|
|
import me.filoghost.holographicdisplays.nms.common.EntityID;
|
|
import net.minecraft.network.protocol.Packet;
|
|
import net.minecraft.network.protocol.game.PacketPlayOutMount;
|
|
|
|
class EntityMountNMSPacket extends VersionNMSPacket {
|
|
|
|
private final Packet<?> rawPacket;
|
|
|
|
EntityMountNMSPacket(EntityID vehicleEntityID, EntityID passengerEntityID) {
|
|
PacketByteBuffer packetByteBuffer = PacketByteBuffer.get();
|
|
|
|
packetByteBuffer.writeVarInt(vehicleEntityID.getNumericID());
|
|
packetByteBuffer.writeVarIntArray(passengerEntityID.getNumericID());
|
|
|
|
this.rawPacket = new PacketPlayOutMount(packetByteBuffer.getInternalSerializer());
|
|
}
|
|
|
|
@Override
|
|
Packet<?> getRawPacket() {
|
|
return rawPacket;
|
|
}
|
|
|
|
}
|