use of com.minecolonies.coremod.network.messages.server.colony.building.BuildRequestMessage in project minecolonies by ldtteam.
the class WindowBuildBuilding method confirmClicked.
/**
* On confirm button.
*/
private void confirmClicked() {
final BlockPos builder = buildersDropDownList.getSelectedIndex() == 0 ? BlockPos.ZERO : builders.get(buildersDropDownList.getSelectedIndex()).getB();
Network.getNetwork().sendToServer(new BuildingSetStyleMessage(building, styles.get(stylesDropDownList.getSelectedIndex())));
if (building.getBuildingLevel() == building.getBuildingMaxLevel()) {
Network.getNetwork().sendToServer(new BuildRequestMessage(building, BuildRequestMessage.Mode.REPAIR, builder));
} else {
Network.getNetwork().sendToServer(new BuildRequestMessage(building, BuildRequestMessage.Mode.BUILD, builder));
}
cancelClicked();
}
use of com.minecolonies.coremod.network.messages.server.colony.building.BuildRequestMessage in project minecolonies by ldtteam.
the class WindowBuildBuilding method repairClicked.
/**
* Action when repair button is clicked.
*/
private void repairClicked() {
final BlockPos builder = buildersDropDownList.getSelectedIndex() == 0 ? BlockPos.ZERO : builders.get(buildersDropDownList.getSelectedIndex()).getB();
Network.getNetwork().sendToServer(new BuildRequestMessage(building, BuildRequestMessage.Mode.REPAIR, builder));
cancelClicked();
}
use of com.minecolonies.coremod.network.messages.server.colony.building.BuildRequestMessage in project minecolonies by ldtteam.
the class AbstractWindowModuleBuilding method buildClicked.
/**
* Action when build button is clicked.
*/
private void buildClicked() {
final String buttonLabel = buttonBuild.getTextAsString();
if (buttonLabel.equalsIgnoreCase(LanguageHandler.format("com.minecolonies.coremod.gui.workerhuts.cancelbuild")) || buttonLabel.equalsIgnoreCase(LanguageHandler.format("com.minecolonies.coremod.gui.workerhuts.cancelupgrade"))) {
Network.getNetwork().sendToServer(new BuildRequestMessage(building, BuildRequestMessage.Mode.BUILD, BlockPos.ZERO));
} else if (buttonLabel.equalsIgnoreCase(LanguageHandler.format("com.minecolonies.coremod.gui.workerhuts.cancelrepair"))) {
Network.getNetwork().sendToServer(new BuildRequestMessage(building, BuildRequestMessage.Mode.REPAIR, BlockPos.ZERO));
} else if (buttonLabel.equalsIgnoreCase(LanguageHandler.format("com.minecolonies.coremod.gui.workerhuts.canceldeconstruction"))) {
Network.getNetwork().sendToServer(new BuildRequestMessage(building, BuildRequestMessage.Mode.REMOVE, BlockPos.ZERO));
} else {
@NotNull final WindowBuildBuilding window = new WindowBuildBuilding(building.getColony(), building);
window.open();
}
}
Aggregations