use of com.minecolonies.api.colony.jobs.IJobView in project minecolonies by ldtteam.
the class JobDataManager method createViewFrom.
@Override
public IJobView createViewFrom(final IColonyView colony, final ICitizenDataView citizenDataView, final PacketBuffer networkBuffer) {
final ResourceLocation jobName = new ResourceLocation(networkBuffer.readUtf(32767));
final JobEntry entry = IJobRegistry.getInstance().getValue(jobName);
if (entry == null) {
Log.getLogger().error(String.format("Unknown job type '%s'.", jobName), new Exception());
return null;
}
final IJobView view = entry.getJobViewProducer().get().apply(colony, citizenDataView);
if (view != null) {
view.deserialize(networkBuffer);
}
return view;
}
use of com.minecolonies.api.colony.jobs.IJobView in project minecolonies by Minecolonies.
the class JobDataManager method createViewFrom.
@Override
public IJobView createViewFrom(final IColonyView colony, final ICitizenDataView citizenDataView, final PacketBuffer networkBuffer) {
final ResourceLocation jobName = new ResourceLocation(networkBuffer.readUtf(32767));
final JobEntry entry = IJobRegistry.getInstance().getValue(jobName);
if (entry == null) {
Log.getLogger().error(String.format("Unknown job type '%s'.", jobName), new Exception());
return null;
}
final IJobView view = entry.getJobViewProducer().get().apply(colony, citizenDataView);
if (view != null) {
view.deserialize(networkBuffer);
}
return view;
}
Aggregations