Search in sources :

Example 1 with FMLModDisabledEvent

use of net.minecraftforge.fml.common.event.FMLModDisabledEvent in project MinecraftForge by MinecraftForge.

the class LoadController method disableMod.

void disableMod(ModContainer mod) {
    HashMap<String, EventBus> temporary = Maps.newHashMap(eventChannels);
    String modId = mod.getModId();
    EventBus bus = temporary.remove(modId);
    bus.post(new FMLModDisabledEvent());
    if (errors.get(modId).isEmpty()) {
        eventChannels = ImmutableMap.copyOf(temporary);
        modStates.put(modId, ModState.DISABLED);
        modObjectList.remove(mod);
        activeModList.remove(mod);
    }
}
Also used : FMLModDisabledEvent(net.minecraftforge.fml.common.event.FMLModDisabledEvent) EventBus(com.google.common.eventbus.EventBus)

Aggregations

EventBus (com.google.common.eventbus.EventBus)1 FMLModDisabledEvent (net.minecraftforge.fml.common.event.FMLModDisabledEvent)1