Search in sources :

Example 1 with MessageSyncPlantJson

use of com.infinityraider.agricraft.network.json.MessageSyncPlantJson in project AgriCraft by AgriCraft.

the class PlayerConnectToServerHandler method syncPlants.

private void syncPlants(EntityPlayerMP player) {
    log.debug("Sending plants to player: " + player.getDisplayNameString());
    final int count = AgriCore.getPlants().getAll().size();
    Iterator<AgriPlant> it = AgriCore.getPlants().getAll().iterator();
    for (int i = 0; it.hasNext(); i++) {
        AgriPlant plant = it.next();
        log.debug("Sending plant: {0} ({1} of {2})", plant.getPlantName(), i + 1, count);
        new MessageSyncPlantJson(plant, i, count).sendTo(player);
    }
    log.debug("Finished sending plants to player: " + player.getDisplayNameString());
}
Also used : MessageSyncPlantJson(com.infinityraider.agricraft.network.json.MessageSyncPlantJson) AgriPlant(com.agricraft.agricore.plant.AgriPlant)

Aggregations

AgriPlant (com.agricraft.agricore.plant.AgriPlant)1 MessageSyncPlantJson (com.infinityraider.agricraft.network.json.MessageSyncPlantJson)1