Search in sources :

Example 1 with MarkBuildingDirtyMessage

use of com.minecolonies.coremod.network.messages.MarkBuildingDirtyMessage in project minecolonies by Minecolonies.

the class WindowHutBuilder method onOpened.

@Override
public void onOpened() {
    super.onOpened();
    pullResourcesFromHut();
    final ScrollingList resourceList = findPaneOfTypeByID(LIST_RESOURCES, ScrollingList.class);
    resourceList.setDataProvider(new ScrollingList.DataProvider() {

        @Override
        public int getElementCount() {
            return resources.size();
        }

        @Override
        public void updateElement(final int index, @NotNull final Pane rowPane) {
            updateResourcePane(index, rowPane);
        }
    });
    //Make sure we have a fresh view
    MineColonies.getNetwork().sendToServer(new MarkBuildingDirtyMessage(this.building));
}
Also used : ScrollingList(com.minecolonies.blockout.views.ScrollingList) Pane(com.minecolonies.blockout.Pane) MarkBuildingDirtyMessage(com.minecolonies.coremod.network.messages.MarkBuildingDirtyMessage)

Aggregations

Pane (com.minecolonies.blockout.Pane)1 ScrollingList (com.minecolonies.blockout.views.ScrollingList)1 MarkBuildingDirtyMessage (com.minecolonies.coremod.network.messages.MarkBuildingDirtyMessage)1