Search in sources :

Example 1 with DimensionManager

use of mcjty.rftoolsdim.apiimpl.DimensionManager in project RFToolsDimensions by McJty.

the class RFToolsDim method imcCallback.

@Mod.EventHandler
public void imcCallback(FMLInterModComms.IMCEvent event) {
    for (FMLInterModComms.IMCMessage message : event.getMessages()) {
        if ("getDimletConfigurationManager".equalsIgnoreCase(message.key)) {
            Optional<Function<IDimletConfigurationManager, Void>> value = message.getFunctionValue(IDimletConfigurationManager.class, Void.class);
            String mod = message.getSender();
            Logging.log("Received RFTools Dimensions dimlet reconfiguration request from mod '" + mod + "'");
            value.get().apply(new DimletConfigurationManager(mod));
        } else if ("getDimensionManager".equalsIgnoreCase(message.key)) {
            Optional<Function<IDimensionManager, Void>> value = message.getFunctionValue(IDimensionManager.class, Void.class);
            String mod = message.getSender();
            Logging.log("Received RFTools dimension manager request from mod '" + mod + "'");
            value.get().apply(new DimensionManager());
        }
    }
}
Also used : Function(com.google.common.base.Function) Optional(com.google.common.base.Optional) IDimletConfigurationManager(mcjty.rftoolsdim.api.dimlet.IDimletConfigurationManager) DimletConfigurationManager(mcjty.rftoolsdim.apiimpl.DimletConfigurationManager) RfToolsDimensionManager(mcjty.rftoolsdim.dimensions.RfToolsDimensionManager) IDimensionManager(mcjty.rftoolsdim.api.dimension.IDimensionManager) DimensionManager(mcjty.rftoolsdim.apiimpl.DimensionManager) IDimensionManager(mcjty.rftoolsdim.api.dimension.IDimensionManager)

Aggregations

Function (com.google.common.base.Function)1 Optional (com.google.common.base.Optional)1 IDimensionManager (mcjty.rftoolsdim.api.dimension.IDimensionManager)1 IDimletConfigurationManager (mcjty.rftoolsdim.api.dimlet.IDimletConfigurationManager)1 DimensionManager (mcjty.rftoolsdim.apiimpl.DimensionManager)1 DimletConfigurationManager (mcjty.rftoolsdim.apiimpl.DimletConfigurationManager)1 RfToolsDimensionManager (mcjty.rftoolsdim.dimensions.RfToolsDimensionManager)1