Search in sources :

Example 1 with BuildingSetStyleMessage

use of com.minecolonies.coremod.network.messages.server.colony.building.BuildingSetStyleMessage in project minecolonies by Minecolonies.

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();
}
Also used : BuildRequestMessage(com.minecolonies.coremod.network.messages.server.colony.building.BuildRequestMessage) BlockPos(net.minecraft.util.math.BlockPos) BuildingSetStyleMessage(com.minecolonies.coremod.network.messages.server.colony.building.BuildingSetStyleMessage)

Example 2 with BuildingSetStyleMessage

use of com.minecolonies.coremod.network.messages.server.colony.building.BuildingSetStyleMessage 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();
}
Also used : BuildRequestMessage(com.minecolonies.coremod.network.messages.server.colony.building.BuildRequestMessage) BlockPos(net.minecraft.util.math.BlockPos) BuildingSetStyleMessage(com.minecolonies.coremod.network.messages.server.colony.building.BuildingSetStyleMessage)

Aggregations

BuildRequestMessage (com.minecolonies.coremod.network.messages.server.colony.building.BuildRequestMessage)2 BuildingSetStyleMessage (com.minecolonies.coremod.network.messages.server.colony.building.BuildingSetStyleMessage)2 BlockPos (net.minecraft.util.math.BlockPos)2