Java Code Examples for net.minecraftforge.common.ForgeChunkManager#setForcedChunkLoadingCallback()

The following examples show how to use net.minecraftforge.common.ForgeChunkManager#setForcedChunkLoadingCallback() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ChunkLoaderManager.java    From ChickenChunks with MIT License 5 votes vote down vote up
/**
 * By doing this you are delegating all chunks from your mod to be handled by yours truly.
 */
public static void registerMod(Object mod) {
    ModContainer container = Loader.instance().getModObjectList().inverse().get(mod);
    if (container == null)
        throw new NullPointerException("Mod container not found for: " + mod);
    mods.put(mod, container);
    ForgeChunkManager.setForcedChunkLoadingCallback(mod, new DummyLoadingCallback());
}
 
Example 2
Source File: CommonProxy.java    From enderutilities with GNU Lesser General Public License v3.0 5 votes vote down vote up
public void registerEventHandlers()
{
    MinecraftForge.EVENT_BUS.register(new AnvilUpdateEventHandler());
    MinecraftForge.EVENT_BUS.register(new BlockEventHandler());
    MinecraftForge.EVENT_BUS.register(new EntityEventHandler());
    MinecraftForge.EVENT_BUS.register(new ItemPickupEventHandler());
    MinecraftForge.EVENT_BUS.register(new LivingDropsEventHandler());
    MinecraftForge.EVENT_BUS.register(new PlayerEventHandler());
    MinecraftForge.EVENT_BUS.register(new WorldEventHandler());
    MinecraftForge.EVENT_BUS.register(new TickHandler());

    MinecraftForge.EVENT_BUS.register(this);

    ForgeChunkManager.setForcedChunkLoadingCallback(EnderUtilities.instance, new ChunkLoading());
}
 
Example 3
Source File: BlockyEntities.java    From CommunityMod with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public void onInit(FMLInitializationEvent event) {
	StorageDimReg.regStorageDim();
	ForgeChunkManager.setForcedChunkLoadingCallback(CommunityMod.INSTANCE, new ChunkCallback());
}
 
Example 4
Source File: MyTown.java    From MyTown2 with The Unlicense 4 votes vote down vote up
/**
 * Registers all handlers (Event handlers)
 */
private void registerHandlers() {

    FMLCommonHandler.instance().bus().register(new SafemodeHandler());
    Ticker playerTracker = new Ticker();

    FMLCommonHandler.instance().bus().register(playerTracker);
    MinecraftForge.EVENT_BUS.register(playerTracker);

    FMLCommonHandler.instance().bus().register(VisualsHandler.instance);

    FMLCommonHandler.instance().bus().register(ProtectionHandlers.instance);
    MinecraftForge.EVENT_BUS.register(ProtectionHandlers.instance);

    MinecraftForge.EVENT_BUS.register(ExtraEventsHandler.getInstance());

    ForgeChunkManager.setForcedChunkLoadingCallback(this, new MyTownLoadingCallback());
}