Example usage for net.minecraftforge.fml.javafmlmod FMLJavaModLoadingContext get

List of usage examples for net.minecraftforge.fml.javafmlmod FMLJavaModLoadingContext get

Introduction

In this page you can find the example usage for net.minecraftforge.fml.javafmlmod FMLJavaModLoadingContext get.

Prototype

public static FMLJavaModLoadingContext get() 

Source Link

Document

Helper to get the right instance from the ModLoadingContext correctly.

Usage

From source file:com.teambrmodding.assistedprogression.AssistedProgression.java

License:Creative Commons License

/**
 * Attach events to the buses before loading
 *///from w w w .ja  v  a2s  . c  om
private void attachEvents() {
    // Loading steps
    FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup);
    MinecraftForge.EVENT_BUS.addListener(this::serverStarting);
    MinecraftForge.EVENT_BUS.addListener(this::serverStarted);

    // Event attaches
    FMLJavaModLoadingContext.get().getModEventBus().addGenericListener(IRecipeSerializer.class,
            RecipeHelper::registerRecipeSerializers);
    MinecraftForge.EVENT_BUS.addListener(TrashBagItem::onItemPickup);
}