use of com.agricraft.agricore.plant.AgriSoil in project AgriCraft by AgriCraft.
the class PlayerConnectToServerHandler method syncSoils.
private void syncSoils(EntityPlayerMP player) {
LOG.debug("Sending soils to player: " + player.getDisplayNameString());
final int count = AgriCore.getSoils().getAll().size();
Iterator<AgriSoil> it = AgriCore.getSoils().getAll().iterator();
for (int i = 0; it.hasNext(); i++) {
AgriSoil soil = it.next();
LOG.debug("Sending Soil: {0} ({1} of {2})", soil, i + 1, count);
new MessageSyncSoilJson(soil, i, count).sendTo(player);
}
LOG.debug("Finished sending soils to player: " + player.getDisplayNameString());
}
use of com.agricraft.agricore.plant.AgriSoil in project AgriCraft by AgriCraft.
the class CoreHandler method initSoils.
public static void initSoils() {
// Announce Progress
AgriCore.getLogger("agricraft").info("Registering Soils!");
// See if soils are valid...
final int raw = AgriCore.getSoils().getAll().size();
AgriCore.getSoils().validate();
final int count = AgriCore.getSoils().getAll().size();
// Transfer
AgriCore.getSoils().getAll().stream().filter(AgriSoil::isEnabled).map(JsonSoil::new).forEach(AgriApi.getSoilRegistry()::add);
// Display Soils
AgriCore.getLogger("agricraft").info("Registered Soils ({0}/{1}):", count, raw);
for (IAgriSoil soil : AgriApi.getSoilRegistry().all()) {
AgriCore.getLogger("agricraft").info(" - {0}", soil.getName());
}
}
use of com.agricraft.agricore.plant.AgriSoil in project AgriCraft by AgriCraft.
the class JsonSyncHandler method syncSoils.
protected void syncSoils(ServerPlayerEntity player) {
LOG.debug("Sending soils to player: " + player.getDisplayName().getString());
final int count = AgriCore.getSoils().getAll().size();
Iterator<AgriSoil> it = AgriCore.getSoils().getAll().iterator();
for (int i = 0; it.hasNext(); i++) {
AgriSoil soil = it.next();
LOG.debug("Sending Soil: {0} ({1} of {2})", soil, i + 1, count);
new MessageSyncSoilJson(soil, i, count).sendTo(player);
}
LOG.debug("Finished sending soils to player: " + player.getDisplayName().getString());
}
use of com.agricraft.agricore.plant.AgriSoil in project AgriCore by AgriCraft.
the class AgriSoils method toString.
@Override
public String toString() {
final StringBuilder sb = new StringBuilder();
sb.append("\nSoils:");
for (AgriSoil plant : soils.values()) {
sb.append("\n\t- Soil: ");
sb.append(plant.toString().replaceAll("\n", "\n\t").trim());
}
return sb.append("\n").toString();
}
Aggregations