use of com.minecolonies.coremod.colony.buildings.views.BuildingBuilderView in project minecolonies by Minecolonies.
the class WindowHutBuilder method pullResourcesFromHut.
/**
* Retrieve resources from the building to display in GUI.
*/
private void pullResourcesFromHut() {
final AbstractBuilding.View newView = builder.getColony().getBuilding(builder.getID());
if (newView instanceof BuildingBuilderView) {
final BuildingBuilderView updatedView = (BuildingBuilderView) newView;
final InventoryPlayer inventory = this.mc.player.inventory;
resources.clear();
resources.addAll(updatedView.getResources().values());
for (final BuildingBuilderResource resource : resources) {
resource.setPlayerAmount(InventoryUtils.getItemCountInItemHandler(new InvWrapper(inventory), resource.getItem(), resource.getDamageValue()));
}
resources.sort(new BuildingBuilderResource.ResourceComparator());
}
}
Aggregations