Search in sources :

Example 1 with IPacketRegistry

use of forestry.core.network.IPacketRegistry in project ForestryMC by ForestryMC.

the class InternalModuleHandler method registerHandlers.

private void registerHandlers(BlankForestryModule module, Side side) {
    Log.debug("Registering Handlers for Module: {}", module);
    IPacketRegistry packetRegistry = module.getPacketRegistry();
    if (packetRegistry != null) {
        packetRegistry.registerPacketsServer();
        if (side == Side.CLIENT) {
            packetRegistry.registerPacketsClient();
        }
    }
    IPickupHandler pickupHandler = module.getPickupHandler();
    if (pickupHandler != null) {
        ModuleManager.pickupHandlers.add(pickupHandler);
    }
    ISaveEventHandler saveHandler = module.getSaveEventHandler();
    if (saveHandler != null) {
        ModuleManager.saveEventHandlers.add(saveHandler);
    }
    IResupplyHandler resupplyHandler = module.getResupplyHandler();
    if (resupplyHandler != null) {
        ModuleManager.resupplyHandlers.add(resupplyHandler);
    }
}
Also used : IResupplyHandler(forestry.core.IResupplyHandler) ISaveEventHandler(forestry.core.ISaveEventHandler) IPickupHandler(forestry.core.IPickupHandler) IPacketRegistry(forestry.core.network.IPacketRegistry)

Aggregations

IPickupHandler (forestry.core.IPickupHandler)1 IResupplyHandler (forestry.core.IResupplyHandler)1 ISaveEventHandler (forestry.core.ISaveEventHandler)1 IPacketRegistry (forestry.core.network.IPacketRegistry)1