use of com.minecolonies.coremod.network.messages.server.colony.building.MarkBuildingDirtyMessage in project minecolonies by Minecolonies.
the class WarehouseOptionsModuleWindow method onOpened.
@Override
public void onOpened() {
if (buildingView.getBuildingLevel() < BUILDING_LEVEL_FOR_SORTING) {
final ButtonImage sortButton = findPaneOfTypeByID(SORT_WAREHOUSE_BUTTON, ButtonImage.class);
PaneBuilders.tooltipBuilder().append(new TranslationTextComponent("com.minecolonies.coremod.gui.warehouse.sort.disabled.1", BUILDING_LEVEL_FOR_SORTING)).appendNL(new TranslationTextComponent("com.minecolonies.coremod.gui.warehouse.sort.disabled.2", BUILDING_LEVEL_FOR_SORTING)).hoverPane(sortButton).build();
sortButton.disable();
}
super.onOpened();
updateResourcePane();
// Make sure we have a fresh view
Network.getNetwork().sendToServer(new MarkBuildingDirtyMessage(this.buildingView));
}
use of com.minecolonies.coremod.network.messages.server.colony.building.MarkBuildingDirtyMessage in project minecolonies by Minecolonies.
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()));
}
use of com.minecolonies.coremod.network.messages.server.colony.building.MarkBuildingDirtyMessage in project minecolonies by ldtteam.
the class WindowResourceList method onOpened.
@Override
public void onOpened() {
final ClientPlayerEntity player = Minecraft.getInstance().player;
if (this.builder == null) {
player.sendMessage(new TranslationTextComponent("com.minecolonies.coremod.resourcescroll.nobuilder"), player.getUUID());
close();
return;
}
super.onOpened();
pullResourcesFromHut();
final ScrollingList resourceList = findPaneOfTypeByID(LIST_RESOURCES, ScrollingList.class);
if (resourceList == null) {
player.sendMessage(new TranslationTextComponent("com.minecolonies.coremod.resourcescroll.null"), player.getUUID());
close();
return;
}
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);
}
});
final BuildingResourcesModuleView moduleView = builder.getModuleView(BuildingResourcesModuleView.class);
// Make sure we have a fresh view
Network.getNetwork().sendToServer(new MarkBuildingDirtyMessage(builder));
findPaneOfTypeByID(LABEL_WORKERNAME, Text.class).setText(builder.getWorkerName());
findPaneOfTypeByID(LABEL_CONSTRUCTION_NAME, Text.class).setText(moduleView.getConstructionName());
}
use of com.minecolonies.coremod.network.messages.server.colony.building.MarkBuildingDirtyMessage in project minecolonies by ldtteam.
the class WarehouseOptionsModuleWindow method onOpened.
@Override
public void onOpened() {
if (buildingView.getBuildingLevel() < BUILDING_LEVEL_FOR_SORTING) {
final ButtonImage sortButton = findPaneOfTypeByID(SORT_WAREHOUSE_BUTTON, ButtonImage.class);
PaneBuilders.tooltipBuilder().append(new TranslationTextComponent("com.minecolonies.coremod.gui.warehouse.sort.disabled.1", BUILDING_LEVEL_FOR_SORTING)).appendNL(new TranslationTextComponent("com.minecolonies.coremod.gui.warehouse.sort.disabled.2", BUILDING_LEVEL_FOR_SORTING)).hoverPane(sortButton).build();
sortButton.disable();
}
super.onOpened();
updateResourcePane();
// Make sure we have a fresh view
Network.getNetwork().sendToServer(new MarkBuildingDirtyMessage(this.buildingView));
}
use of com.minecolonies.coremod.network.messages.server.colony.building.MarkBuildingDirtyMessage in project minecolonies by Minecolonies.
the class WindowResourceList method onOpened.
@Override
public void onOpened() {
final ClientPlayerEntity player = Minecraft.getInstance().player;
if (this.builder == null) {
player.sendMessage(new TranslationTextComponent("com.minecolonies.coremod.resourcescroll.nobuilder"), player.getUUID());
close();
return;
}
super.onOpened();
pullResourcesFromHut();
final ScrollingList resourceList = findPaneOfTypeByID(LIST_RESOURCES, ScrollingList.class);
if (resourceList == null) {
player.sendMessage(new TranslationTextComponent("com.minecolonies.coremod.resourcescroll.null"), player.getUUID());
close();
return;
}
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);
}
});
final BuildingResourcesModuleView moduleView = builder.getModuleView(BuildingResourcesModuleView.class);
// Make sure we have a fresh view
Network.getNetwork().sendToServer(new MarkBuildingDirtyMessage(builder));
findPaneOfTypeByID(LABEL_WORKERNAME, Text.class).setText(builder.getWorkerName());
findPaneOfTypeByID(LABEL_CONSTRUCTION_NAME, Text.class).setText(moduleView.getConstructionName());
}
Aggregations