@SubscribeEvent
public void onStartTracking(PlayerEvent.StartTracking event) {
Entity target = event.getTarget();
if (target instanceof EntityPlayerMP) {
for(byte i = 0; i <= 10; i++) {
NetworkHandler.network.sendToAllTracking(new SyncMessage((EntityPlayer) target, i, target.getCapability(CAPProvider.INVENTORY_CAP, null).getStackInSlot(i)), target);
}
}
}
@SubscribeEvent
public void playerJoin(EntityJoinWorldEvent event) {
Entity entity = event.getEntity();
if (entity instanceof EntityPlayerMP) {
EntityPlayerMP player = (EntityPlayerMP) entity;
for(byte i = 0; i <= 10; i++) {
NetworkHandler.network.sendToAllTracking(new SyncMessage(player, i, player.getCapability(CAPProvider.INVENTORY_CAP, null).getStackInSlot(i)), player);
}
}
}