use of com.agricraft.agricore.plant.AgriPlant in project AgriCraft by AgriCraft.
the class CoreHandler method initPlants.
public static void initPlants() {
// Announce Progress
AgriCore.getLogger("agricraft").info("Registering Plants!");
// See if plants are valid...
final int raw = AgriCore.getPlants().getAll().size();
AgriCore.getPlants().validate();
final int count = AgriCore.getPlants().getAll().size();
// Transfer
AgriCore.getPlants().validate();
AgriCore.getPlants().getAll().stream().filter(AgriPlant::isEnabled).map(JsonPlant::new).forEach(AgriApi.getPlantRegistry()::add);
// Display Plants
AgriCore.getLogger("agricraft").info("Registered Plants ({0}/{1}):", count, raw);
for (IAgriPlant plant : AgriApi.getPlantRegistry().all()) {
AgriCore.getLogger("agricraft").info(" - {0}", plant.getPlantName());
}
}
use of com.agricraft.agricore.plant.AgriPlant 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());
}
Aggregations