Search in sources :

Example 1 with PacketErrorUpdateEntity

use of forestry.core.network.packets.PacketErrorUpdateEntity in project ForestryMC by ForestryMC.

the class ContainerEntity method detectAndSendChanges.

@Override
public void detectAndSendChanges() {
    super.detectAndSendChanges();
    if (entity instanceof IErrorLogicSource) {
        IErrorLogicSource errorLogicSource = (IErrorLogicSource) entity;
        ImmutableSet<IErrorState> errorStates = errorLogicSource.getErrorLogic().getErrorStates();
        if (previousErrorStates == null || !errorStates.equals(previousErrorStates)) {
            PacketErrorUpdateEntity packet = new PacketErrorUpdateEntity(entity, errorLogicSource);
            sendPacketToListeners(packet);
        }
        previousErrorStates = errorStates;
    }
}
Also used : PacketErrorUpdateEntity(forestry.core.network.packets.PacketErrorUpdateEntity) IErrorState(forestry.api.core.IErrorState) IErrorLogicSource(forestry.api.core.IErrorLogicSource)

Aggregations

IErrorLogicSource (forestry.api.core.IErrorLogicSource)1 IErrorState (forestry.api.core.IErrorState)1 PacketErrorUpdateEntity (forestry.core.network.packets.PacketErrorUpdateEntity)1