Search in sources :

Example 1 with IDimensionManager

use of mcjty.rftoolsdim.api.dimension.IDimensionManager 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(java.util.function.Function) Optional(java.util.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

Optional (java.util.Optional)1 Function (java.util.function.Function)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