Search in sources :

Example 6 with MarkBuildingDirtyMessage

use of com.minecolonies.coremod.network.messages.server.colony.building.MarkBuildingDirtyMessage in project minecolonies by ldtteam.

the class WindowBuilderResModule 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
    Network.getNetwork().sendToServer(new MarkBuildingDirtyMessage(this.buildingView));
    findPaneOfTypeByID(LABEL_CONSTRUCTION_NAME, Text.class).setText(moduleView.getConstructionName());
    findPaneOfTypeByID(STEP_PROGRESS, Text.class).setText(new TranslationTextComponent("com.minecolonies.coremod.gui.progress.step", moduleView.getCurrentStage(), moduleView.getTotalStages()));
}
Also used : TranslationTextComponent(net.minecraft.util.text.TranslationTextComponent) Text(com.ldtteam.blockout.controls.Text) ScrollingList(com.ldtteam.blockout.views.ScrollingList) Pane(com.ldtteam.blockout.Pane) MarkBuildingDirtyMessage(com.minecolonies.coremod.network.messages.server.colony.building.MarkBuildingDirtyMessage)

Aggregations

MarkBuildingDirtyMessage (com.minecolonies.coremod.network.messages.server.colony.building.MarkBuildingDirtyMessage)6 TranslationTextComponent (net.minecraft.util.text.TranslationTextComponent)5 Pane (com.ldtteam.blockout.Pane)4 Text (com.ldtteam.blockout.controls.Text)4 ScrollingList (com.ldtteam.blockout.views.ScrollingList)4 ButtonImage (com.ldtteam.blockout.controls.ButtonImage)2 BuildingResourcesModuleView (com.minecolonies.coremod.colony.buildings.moduleviews.BuildingResourcesModuleView)2 ClientPlayerEntity (net.minecraft.client.entity.player.ClientPlayerEntity)2