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

feat: add nms support for camera packet

This commit is contained in:
LoJoSho
2024-12-29 16:49:38 -06:00
parent 3c4b021706
commit 556729bada
9 changed files with 87 additions and 4 deletions

View File

@@ -211,4 +211,16 @@ public class NMSPackets extends NMSCommon implements me.lojosho.hibiscuscommons.
e.printStackTrace();
}
}
@Override
public void sendCameraPacket(int entityId, List<Player> sendTo) {
FriendlyByteBuf byteBuf = new FriendlyByteBuf(Unpooled.buffer());
byteBuf.writeVarInt(entityId);
try {
ClientboundSetCameraPacket packet = cameraConstructor.newInstance(byteBuf);
for (Player p : sendTo) sendPacket(p, packet);
} catch (Exception e) {
e.printStackTrace();
}
}
}