Search in sources :

Example 1 with PauseCitizenMessage

use of com.minecolonies.coremod.network.messages.server.colony.citizen.PauseCitizenMessage in project minecolonies by ldtteam.

the class WindowHireWorker method pauseClicked.

/**
 * Pause citizen clicked to pause the citizen.
 *
 * @param button the clicked button.
 */
private void pauseClicked(@NotNull final Button button) {
    final int row = citizenList.getListElementIndexByPane(button);
    final int id = citizens.toArray(new CitizenDataView[0])[row].getId();
    @NotNull final ICitizenDataView citizen = citizens.get(row);
    Network.getNetwork().sendToServer(new PauseCitizenMessage(this.building, id));
    citizen.setPaused(!citizen.isPaused());
}
Also used : ICitizenDataView(com.minecolonies.api.colony.ICitizenDataView) PauseCitizenMessage(com.minecolonies.coremod.network.messages.server.colony.citizen.PauseCitizenMessage) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with PauseCitizenMessage

use of com.minecolonies.coremod.network.messages.server.colony.citizen.PauseCitizenMessage in project minecolonies by Minecolonies.

the class WindowHireWorker method pauseClicked.

/**
 * Pause citizen clicked to pause the citizen.
 *
 * @param button the clicked button.
 */
private void pauseClicked(@NotNull final Button button) {
    final int row = citizenList.getListElementIndexByPane(button);
    final int id = citizens.toArray(new CitizenDataView[0])[row].getId();
    @NotNull final ICitizenDataView citizen = citizens.get(row);
    Network.getNetwork().sendToServer(new PauseCitizenMessage(this.building, id));
    citizen.setPaused(!citizen.isPaused());
}
Also used : ICitizenDataView(com.minecolonies.api.colony.ICitizenDataView) PauseCitizenMessage(com.minecolonies.coremod.network.messages.server.colony.citizen.PauseCitizenMessage) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

ICitizenDataView (com.minecolonies.api.colony.ICitizenDataView)2 PauseCitizenMessage (com.minecolonies.coremod.network.messages.server.colony.citizen.PauseCitizenMessage)2 NotNull (org.jetbrains.annotations.NotNull)2