use of com.minecolonies.coremod.network.messages.client.colony.ColonyViewCitizenViewMessage in project minecolonies by Minecolonies.
the class CitizenManager method sendPackets.
@Override
public void sendPackets(@NotNull final Set<ServerPlayerEntity> closeSubscribers, @NotNull final Set<ServerPlayerEntity> newSubscribers) {
if (isCitizensDirty || !newSubscribers.isEmpty()) {
final Set<ServerPlayerEntity> players = new HashSet<>();
if (isCitizensDirty) {
players.addAll(closeSubscribers);
}
players.addAll(newSubscribers);
for (@NotNull final ICitizenData citizen : citizens.values()) {
if (citizen.isDirty() || !newSubscribers.isEmpty()) {
players.forEach(player -> Network.getNetwork().sendToPlayer(new ColonyViewCitizenViewMessage(colony, citizen), player));
}
}
}
}
use of com.minecolonies.coremod.network.messages.client.colony.ColonyViewCitizenViewMessage in project minecolonies by ldtteam.
the class CitizenManager method sendPackets.
@Override
public void sendPackets(@NotNull final Set<ServerPlayerEntity> closeSubscribers, @NotNull final Set<ServerPlayerEntity> newSubscribers) {
if (isCitizensDirty || !newSubscribers.isEmpty()) {
final Set<ServerPlayerEntity> players = new HashSet<>();
if (isCitizensDirty) {
players.addAll(closeSubscribers);
}
players.addAll(newSubscribers);
for (@NotNull final ICitizenData citizen : citizens.values()) {
if (citizen.isDirty() || !newSubscribers.isEmpty()) {
players.forEach(player -> Network.getNetwork().sendToPlayer(new ColonyViewCitizenViewMessage(colony, citizen), player));
}
}
}
}
Aggregations