
A utility for creating set camera packets by entity ID should be added
haykam821 opened this issue ยท 0 comments
A packet for constructing SetCameraEntityS2CPacket
from an entity ID rather than an entity instance would be useful. Polymer already has methods to create packets using entity IDs (such as VirtualEntityUtils.createRidePacket
), so this method would expand on the packets available to construct in this alternate way.
Currently, users must define a method and an accessor themselves:
private static SetCameraEntityS2CPacket createCameraPacket(int id) {
SetCameraEntityS2CPacket packet = VirtualEntityImplUtils.createUnsafe(SetCameraEntityS2CPacket.class);
((SetCameraEntityS2CPacketAccessor) packet).setEntityId(id);
return packet;
}
@Mixin(SetCameraEntityS2CPacket.class)
public interface SetCameraEntityS2CPacketAccessor {
@Mutable
@Accessor("entityId")
public void setEntityId(int entityId);
}