use of forestry.core.network.packets.PacketUpdateClimate in project ForestryMC by ForestryMC.
the class ClimateContainer method updateClimate.
@Override
public void updateClimate(int ticks) {
if (ticks % getTickDelay() == 0) {
IClimateState oldState = state.copy(ClimateStateType.DEFAULT);
state = parent.getDefaultClimate().copy(ClimateStateType.EXTENDED);
for (IClimateModifier modifier : GreenhouseClimateManager.getInstance().getModifiers()) {
state = modifier.modifyTarget(this, state, oldState, modifierData).copy(ClimateStateType.EXTENDED);
}
if (!state.equals(oldState)) {
BlockPos coordinates = parent.getCoordinates();
NetworkUtil.sendNetworkPacket(new PacketUpdateClimate(coordinates, this), coordinates, parent.getWorldObj());
}
}
}
Aggregations