本文整理汇总了Java中net.minecraftforge.common.ForgeChunkManager.setForcedChunkLoadingCallback方法的典型用法代码示例。如果您正苦于以下问题:Java ForgeChunkManager.setForcedChunkLoadingCallback方法的具体用法?Java ForgeChunkManager.setForcedChunkLoadingCallback怎么用?Java ForgeChunkManager.setForcedChunkLoadingCallback使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.common.ForgeChunkManager
的用法示例。
在下文中一共展示了ForgeChunkManager.setForcedChunkLoadingCallback方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: preInit
import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event)
{
// Config
ConfigurationHandler.Init(event.getSuggestedConfigurationFile());
MinecraftForge.EVENT_BUS.register(new ConfigurationHandler());
// Login/Logout Tracking
MinecraftForge.EVENT_BUS.register(new PlayerActivity());
MinecraftForge.EVENT_BUS.register(new PlayerTimeout());
// Chunk Loading
ForgeChunkManager.setForcedChunkLoadingCallback(instance, new ChunkLoadingCallback());
// Blocks and Items
ModBlocks.init();
ModBlocks.registerBlocks();
ModBlocks.registerRecipes();
// Keybinds
proxy.registerKeys();
}
示例2: preLoad
import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
@Mod.EventHandler
public void preLoad(FMLPreInitializationEvent event)
{
config = ConfigHandler.createConfig(event.getSuggestedConfigurationFile(), "itfellfromthesky", "It Fell From The Sky", logger, instance);
config.setCurrentCategory("gameplay", "itfellfromthesky.config.cat.gameplay.name", "itfellfromthesky.config.cat.gameplay.comment");
config.createIntBoolProperty("summonPigzillaNeedsOp", "itfellfromthesky.config.prop.summonPigzillaNeedsOp.name", "itfellfromthesky.config.prop.summonPigzillaNeedsOp.comment", true, false, false);
proxy.initMod();
EventHandler handler = new EventHandler();
MinecraftForge.EVENT_BUS.register(handler);
ForgeChunkManager.setForcedChunkLoadingCallback(this, new ChunkLoadHandler());
ModVersionChecker.register_iChunMod(new ModVersionInfo("ItFellFromTheSky", iChunUtil.versionOfMC, version, false));
}
示例3: registerEventHandlers
import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
@Override
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());
}
示例4: init
import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
@EventHandler
public void init(FMLInitializationEvent event) {
proxy.initServerSide();
proxy.initClientSide();
MinecraftForge.EVENT_BUS.register(proxy);
NetworkRegistry.INSTANCE.registerGuiHandler(this, proxy);
DimensionManager.registerProviderType(Reference.DIMENSION_ID, WorldProviderPocket.class, true);
DimensionManager.registerDimension(Reference.DIMENSION_ID, Reference.DIMENSION_ID);
BiomeHelper.init();
if (Reference.KEEP_POCKET_ROOMS_CHUNK_LOADED) {
ForgeChunkManager.setForcedChunkLoadingCallback(this, new ChunkLoaderHandler());
}
}
示例5: init
import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
@EventHandler
public void init(FMLInitializationEvent event) {
PacketHandler.init();
if (ConfigData.shouldChunkLoad()) {
LogUtil.debug("Registering chunk loading callback");
ForgeChunkManager.setForcedChunkLoadingCallback(INSTANCE, new ChunkLoadingCallback());
}
if (ConfigData.enableAntenna) {
LogUtil.debug("Registering BitNet tick handler");
FMLCommonHandler.instance().bus().register(BitNetUniverse.UNIVERSE);
}
if (TickHandler.shouldRegister()) {
LogUtil.debug("Registering server tick handler");
FMLCommonHandler.instance().bus().register(TickHandler.INSTANCE);
}
proxy.init();
proxy.registerRenderInfo();
for (IModule module : MODULES)
if (module.shouldLoad())
module.init();
}
示例6: preInit
import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event) {
ConfigHandler.init(event);
Mods.init();
VersionChecker.execute();
ModBlocks.init();
ModItems.init();
ModMultiBlocks.init();
NetworkHandler.init();
RelocatorModuleRegistry.registerModules();
MultiFilterRegistry.registerFilters();
proxy.registerEventHandlers();
ForgeChunkManager.setForcedChunkLoadingCallback(this, new LoadingCallbackHelper());
}
示例7: preInit
import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
public void preInit(FMLPreInitializationEvent event)
{
// Handle configuration
File configDir = event.getModConfigurationDirectory();
config = new Configuration(new File(configDir.getPath(), "simplechunks.cfg"));
try
{
config.load();
GeneralConfig.readConfig(config);
}
catch (Exception e)
{
SimpleChunks.logger.error("Error loading config file!", e);
}
finally
{
if (config.hasChanged())
{
config.save();
}
}
// Integrate with other mods
if (Loader.isModLoaded("theoneprobe"))
{
TOPCompat.register();
}
// Register chunkloading callback
ForgeChunkManager.setForcedChunkLoadingCallback(SimpleChunks.instance, new ChunkLoadingHandler());
}
示例8: postInit
import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
proxy.postInit(event);
ticketList = new HashMap<ChunkPos, Integer>();
ForgeChunkManager.setForcedChunkLoadingCallback(this, new LoadingCallback() {
@Override
public void ticketsLoaded(List<Ticket> tickets, World world) {
}
});
}
示例9: postInit
import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
public void postInit(final FMLPostInitializationEvent evt) {
ForgeChunkManager.setForcedChunkLoadingCallback((Object)ExtraUtilsMod.instance, (ForgeChunkManager.LoadingCallback)new ChunkloadCallback());
CommandTPSTimer.init();
if (ExtraUtils.underdarkDimID != 0 && ExtraUtils.portalEnabled) {
FMLCommonHandler.instance().bus().register((Object)new DarknessTickHandler());
}
if (ExtraUtils.divisionSigilEnabled && !ExtraUtils.disableDivisionSigilInChests) {
this.addSigil("dungeonChest", 0.01);
this.addSigil("mineshaftCorridor", 0.001);
this.addSigil("pyramidDesertyChest", 0.02);
this.addSigil("pyramidJungleChest", 0.05);
this.addSigil("strongholdCrossing", 0.01);
this.addSigil("strongholdCorridor", 0.01);
}
if (!ExtraUtils.disableEnderLiliesInDungeons && ExtraUtils.enderLily != null) {
addDungeonItem(new ItemStack((Block)ExtraUtils.enderLily), 1, 5, "dungeonChest", 0.03);
}
ExtraUtilsMod.proxy.postInit();
if (ExtraUtils.enderQuarryEnabled) {
BlockBreakingRegistry.instance.setupBreaking();
}
DispenserStuff.registerItems();
if (ExtraUtils.generatorEnabled) {
TileEntityGeneratorPotion.genPotionLevels();
}
if (ExtraUtils.transferPipeEnabled) {
TNHelper.initBlocks();
}
if (Loader.isModLoaded("Thaumcraft")) {
ThaumcraftHelper.registerItems();
}
for (final ILoading loader : this.loaders) {
loader.postInit();
}
}
示例10: enableTicketSupport
import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
public static void enableTicketSupport(Object mod) {
ForgeChunkManager.setForcedChunkLoadingCallback(mod,
new net.minecraftforge.common.ForgeChunkManager.LoadingCallback() {
@Override
public void ticketsLoaded(List<Ticket> tickets, World world) {
// This is called when the server is restarted and if there are tickets that we
// have registered before.
// Since we do not support to restore interrupted Lua programs, we do not need
// to do here anything.
}
});
}
示例11: preinit
import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
@Mod.EventHandler
public void preinit(FMLPreInitializationEvent event)
{
chunkloader = new BlockChunkLoader(Material.iron);
GameRegistry.registerBlock(chunkloader, chunkloader.getUnlocalizedName());
GameRegistry.registerTileEntity(TileChunkLoader.class, "simplechunkloader");
ForgeChunkManager.setForcedChunkLoadingCallback(INSTANCE, new ChunkLoadingHandler());
GameRegistry.addRecipe(new ItemStack(chunkloader),
"III",
"ILI",
"III",
'I', new ItemStack(Items.iron_ingot),
'L', new ItemStack(Items.dye, 1, 4));
}
示例12: postInit
import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
@Mod.EventHandler
public void postInit(FMLPostInitializationEvent event) {
GenericUtil.init();
ForgeChunkManager.setForcedChunkLoadingCallback(INSTANCE, (tickets, world) -> {
if(tickets != null && tickets.size() > 0)
GenericUtil.initChunkLoadTicket(world, tickets.get(0));
});
}
示例13: registerMod
import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
/**
* 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());
}
示例14: setup
import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
@EventHandler
public void setup(FMLPreInitializationEvent event) {
FzUtil.setCoreParent(event);
if (!DeltaChunk.enabled()) return;
final File configFile = event.getSuggestedConfigurationFile();
File base = configFile.getParentFile();
hammerInfo.setConfigFile(new File(base, "hammerChannels.cfg"));
int client_despawn_distance = 16*10; //NORELEASE: This wants for a config setting. "How far away the a client must be from a DSE before the server will tell the client to forget about it (eg, client side despawn)."
EntityRegistry.registerModEntity(DimensionSliceEntity.class, "fzds", 1, this, client_despawn_distance, 1, true);
// Sigh. Would be nice to kill the velocity update packet noise. :/
// EntityRegistry.registerModEntity(PacketProxyingPlayer.class, "fzds", 2, this, 1, Integer.MAX_VALUE, false);
//Create the hammer dimension
DimensionManager.registerProviderType(DeltaChunk.getDimensionId(), HammerWorldProvider.class, true);
DimensionManager.registerDimension(DeltaChunk.getDimensionId(), DeltaChunk.getDimensionId());
fzds_command_channel = hammerInfo.makeChannelFor(Core.modId, "fzdscmd", fzds_command_channel, -1, "This channel is used for Slices created using the /fzds command");
FzdsPacketRegistry.init();
NORELEASE.fixme("That isn't used is it?");
proxy.clientInit();
//This sets up saving how many IDs we've used
Core.loadBus(hammerInfo);
Core.loadBus(proxy);
if (FMLCommonHandler.instance().getSide() == Side.CLIENT) {
Core.loadBus(new ClickHandler());
}
ForgeChunkManager.setForcedChunkLoadingCallback(this, new PPPChunkLoader());
if (log_client_chunking && FMLCommonHandler.instance().getSide() == Side.CLIENT) {
Core.loadBus(new ChunkLogger());
}
}
示例15: postInit
import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
@EventHandler
@Override
public void postInit(FMLPostInitializationEvent event) {
super.postInit(event);
ComputerCraft.registerPeripheralProvider(EPBlocks.frame);
creativeTab.setItem(new ItemStack(EPBlocks.portal, 1));
ForgeChunkManager.setForcedChunkLoadingCallback(instance, this);
}