use of com.minecolonies.api.colony.buildings.workerbuildings.ITownHallView in project minecolonies by Minecolonies.
the class ColonyView method handleColonyBuildingViewMessage.
/**
* Update a ColonyView's buildings given a network data ColonyView update packet. This uses a full-replacement - buildings do not get updated and are instead overwritten.
*
* @param buildingId location of the building.
* @param buf buffer containing ColonyBuilding information.
* @return null == no response.
*/
@Override
@Nullable
public IMessage handleColonyBuildingViewMessage(final BlockPos buildingId, @NotNull final PacketBuffer buf) {
if (buildings.containsKey(buildingId)) {
// Read the string first to set up the buffer.
buf.readUtf(32767);
buildings.get(buildingId).deserialize(buf);
} else {
@Nullable final IBuildingView building = IBuildingDataManager.getInstance().createViewFrom(this, buildingId, buf);
if (building != null) {
buildings.put(building.getID(), building);
if (building instanceof BuildingTownHall.View) {
townHall = (ITownHallView) building;
}
}
}
return null;
}
use of com.minecolonies.api.colony.buildings.workerbuildings.ITownHallView in project minecolonies by ldtteam.
the class ColonyView method handleColonyBuildingViewMessage.
/**
* Update a ColonyView's buildings given a network data ColonyView update packet. This uses a full-replacement - buildings do not get updated and are instead overwritten.
*
* @param buildingId location of the building.
* @param buf buffer containing ColonyBuilding information.
* @return null == no response.
*/
@Override
@Nullable
public IMessage handleColonyBuildingViewMessage(final BlockPos buildingId, @NotNull final PacketBuffer buf) {
if (buildings.containsKey(buildingId)) {
// Read the string first to set up the buffer.
buf.readUtf(32767);
buildings.get(buildingId).deserialize(buf);
} else {
@Nullable final IBuildingView building = IBuildingDataManager.getInstance().createViewFrom(this, buildingId, buf);
if (building != null) {
buildings.put(building.getID(), building);
if (building instanceof BuildingTownHall.View) {
townHall = (ITownHallView) building;
}
}
}
return null;
}
Aggregations