use of forestry.api.mail.IPostOffice in project ForestryMC by ForestryMC.
the class ContainerCatalogue method rebuildStationsList.
private void rebuildStationsList() {
stations.clear();
IPostOffice postOffice = PostManager.postRegistry.getPostOffice(player.world);
Map<IMailAddress, ITradeStation> tradeStations = postOffice.getActiveTradeStations(player.world);
for (ITradeStation station : tradeStations.values()) {
ITradeStationInfo info = station.getTradeInfo();
// Filter out any trade stations which do not actually offer anything.
if (FILTERS.get(currentFilter).contains(info.getState())) {
stations.add(station);
}
}
stationIndex = 0;
updateTradeInfo();
}
use of forestry.api.mail.IPostOffice in project ForestryMC by ForestryMC.
the class PostRegistry method getPostOffice.
@Override
public IPostOffice getPostOffice(World world) {
if (cachedPostOffice != null) {
return cachedPostOffice;
}
PostOffice office = (PostOffice) world.loadData(PostOffice.class, PostOffice.SAVE_NAME);
// Create office if there is none yet
if (office == null) {
office = new PostOffice();
world.setData(PostOffice.SAVE_NAME, office);
}
office.setWorld(world);
cachedPostOffice = office;
return office;
}
Aggregations