当前位置: 首页>>代码示例>>Java>>正文


Java CapabilityManager类代码示例

本文整理汇总了Java中net.minecraftforge.common.capabilities.CapabilityManager的典型用法代码示例。如果您正苦于以下问题:Java CapabilityManager类的具体用法?Java CapabilityManager怎么用?Java CapabilityManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CapabilityManager类属于net.minecraftforge.common.capabilities包,在下文中一共展示了CapabilityManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: preinitializeMods

import net.minecraftforge.common.capabilities.CapabilityManager; //导入依赖的package包/类
public void preinitializeMods()
{
    if (!modController.isInState(LoaderState.PREINITIALIZATION))
    {
        FMLLog.warning("There were errors previously. Not beginning mod initialization phase");
        return;
    }
    PersistentRegistryManager.fireCreateRegistryEvents();
    ObjectHolderRegistry.INSTANCE.findObjectHolders(discoverer.getASMTable());
    ItemStackHolderInjector.INSTANCE.findHolders(discoverer.getASMTable());
    CapabilityManager.INSTANCE.injectCapabilities(discoverer.getASMTable());
    PersistentRegistryManager.fireRegistryEvents();
    FMLCommonHandler.instance().fireSidedRegistryEvents();
    modController.distributeStateMessage(LoaderState.PREINITIALIZATION, discoverer.getASMTable(), canonicalConfigDir);
    ObjectHolderRegistry.INSTANCE.applyObjectHolders();
    ItemStackHolderInjector.INSTANCE.inject();
    modController.transition(LoaderState.INITIALIZATION, false);
    progressBar.step("Initializing Minecraft Engine");
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:20,代码来源:Loader.java

示例2: preInit

import net.minecraftforge.common.capabilities.CapabilityManager; //导入依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
    ConfigurationHandler.init(event.getSuggestedConfigurationFile());

    //Networking
    CHANNEL.registerMessage(CheckSheepChiseledRequestMessageHandler.class, CheckSheepChiseledRequestMessage.class, 0, Side.SERVER);
    CHANNEL.registerMessage(SheepChiseledMessageHandler.class, SheepChiseledMessage.class, 1, Side.CLIENT);
    CHANNEL.registerMessage(SpawnCustomParticleMessageHandler.class, SpawnCustomParticleMessage.class, 2, Side.CLIENT);
    CHANNEL.registerMessage(PlayCustomSoundMessageHandler.class, PlayCustomSoundMessage.class, 3, Side.CLIENT);

    //Capabilities
    CapabilityManager.INSTANCE.register(IChiseledSheepCapability.class, ChiseledSheepCapabilityStorage.instance, ChiseledSheepCapability::new);

    //Eventing
    MinecraftForge.EVENT_BUS.register(Proxies.forgeEventProxy);
    MinecraftForge.EVENT_BUS.register(Proxies.renderProxy);

    MinecraftForge.EVENT_BUS.post(new RegisterAdditionalCapabilitiesEvent());

    Proxies.blockProxy.registerBlocks();
    Proxies.audioProxy.registerSounds();
}
 
开发者ID:AtomicBlom,项目名称:ShearMadness,代码行数:24,代码来源:ShearMadnessMod.java

示例3: enable

import net.minecraftforge.common.capabilities.CapabilityManager; //导入依赖的package包/类
/**
 * Call this from pre-init if you want to use this capability.
 */
public static void enable()
{
    if (!enabled)
    {
        enabled = true;
        CapabilityManager.INSTANCE.register(ITweakable.class, new Storage(), new Callable<ITweakable>()
        {
            @Override
            public ITweakable call() throws Exception
            {
                return new Implementation();
            }
        });
    }
}
 
开发者ID:gigaherz,项目名称:CapabilityCore,代码行数:19,代码来源:CapabilityTweakable.java

示例4: enable

import net.minecraftforge.common.capabilities.CapabilityManager; //导入依赖的package包/类
/**
 * Call this from pre-init if you want to use this capability.
 */
public static void enable()
{
    if (!enabled)
    {
        enabled = true;
        CapabilityManager.INSTANCE.register(IEnergyHandler.class, new Storage(), new Callable<IEnergyHandler>()
        {
            @Override
            public IEnergyHandler call() throws Exception
            {
                return new EnergyBuffer();
            }
        });
    }
}
 
开发者ID:gigaherz,项目名称:CapabilityCore,代码行数:19,代码来源:CapabilityEnergy.java

示例5: preInit

import net.minecraftforge.common.capabilities.CapabilityManager; //导入依赖的package包/类
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent e) {
	MCFluxReport.handleErrors();
	L = e.getModLog();
	MC_DIR = e.getModConfigurationDirectory().getParentFile();
	MCFluxConfig.makeConfig(e.getSuggestedConfigurationFile());
	if (R.MF_VERSION.charAt(0) == '$')
		L.warn("You are running Minecraft-Flux with an unknown version (development maybe?)");
	CloudUtils.init();
	if (MCFluxConfig.UPDATE_CHECK)
		CloudUtils.executeTask(MCFlux::updateCheck);
	SpecialEventHandler.getEvents();
	MCFluxNetwork.registerAll();
	NetworkRegistry.INSTANCE.registerGuiHandler(this, new MCFluxGuiHandler());
	CapabilityManager cm = CapabilityManager.INSTANCE;
	cm.register(WorldChunkEnergy.class, CapStorage.getNBTStorage(), WorldChunkEnergy::new);
	cm.register(PlayerEnergy.class, CapStorage.getNBTStorage(), PlayerEnergy::new);
	cm.register(SpecialEventReceiver.class, CapStorage.getNBTStorage(), SpecialEventReceiver::new);
	MCFluxResources.preInit();
	PROXY.preInit();
	JavaUtils.eachAnnotatedClasses(e.getAsmData(), FluxCompat.Addon.class, FluxCompat::addAddon);
	FluxCompat.init();
	FMLInterModComms.sendFunctionMessage("theoneprobe", "getTheOneProbe", TOPInit.class.getName());
}
 
开发者ID:Szewek,项目名称:Minecraft-Flux,代码行数:25,代码来源:MCFlux.java

示例6: init

import net.minecraftforge.common.capabilities.CapabilityManager; //导入依赖的package包/类
public void init() {
    StartUpCommon.InitCommon();

    NetworkRegistry.INSTANCE.registerGuiHandler(main.instance, new GuiHandler());
    System.out.println("STARTING BOOTING CAPABILITY SYSTEM");
    CapabilityManager.INSTANCE.register(IRadiationCapability.class, new RadsFactoryStorage(), RadsFactoryProvider::new);
    System.out.println("RADS--------------CHECK!");
    CapabilityManager.INSTANCE.register(ISpechialCapability.class, new SpechialFactoryStorage(), () -> new SpechialFactoryProvider());
    System.out.println("S.P.E.C.H.I.A.L--------------CHECK!");
    CapabilityManager.INSTANCE.register(ISkillsCapability.class, new SkillsFactoryStorage(), SkillsFactoryProvider::new);
    System.out.println("SKILLS--------------CHECK!");
    CapabilityManager.INSTANCE.register(ILevelCapability.class, new LevelFactoryStorage(), LevelFactoryProvider::new);
    System.out.println("LEVELS--------------CHECK!");
    CapabilityManager.INSTANCE.register(IFTJCapability.class, new FTJFactoryStorage(), FTJFactoryProvider::new);
    System.out.println("FTJ--------------CHECK!");
    CapabilityManager.INSTANCE.register(IWaterCapability.class, new WaterFactoryStorage(), WaterFactoryProvider::new);
    CapabilityManager.INSTANCE.register(IAdvInventory.class, new IAdvStorage(), IAdvProvider::new);
    CapabilityManager.INSTANCE.register(IAmmoInterface.class, new IAmmoStorage(),  AmmoFactoryProvider::new);
    CapabilityManager.INSTANCE.register(IGunInterface.class,new IGunStorage(), GunFactoryProvider::new);
    CapabilityManager.INSTANCE.register(ITrigger_item.class, new ITrigger_Item_Storage(), ITrigger_item_Provider::new);
    System.out.println("FINISHED BOOTING CAPABILITY SYSTEM");
    MinecraftForge.EVENT_BUS.register(new EventHandlerInit());
}
 
开发者ID:Hoijima,项目名称:Fallout_Equestria,代码行数:24,代码来源:CommonProxy.java

示例7: preInit

import net.minecraftforge.common.capabilities.CapabilityManager; //导入依赖的package包/类
@EventHandler
public void preInit (FMLPreInitializationEvent event) {
    
    CapabilityManager.INSTANCE.register(ITeslaConsumer.class, new CapabilityTeslaConsumer<ITeslaConsumer>(), BaseTeslaContainer.class);
    CapabilityManager.INSTANCE.register(ITeslaProducer.class, new CapabilityTeslaProducer<ITeslaProducer>(), BaseTeslaContainer.class);
    CapabilityManager.INSTANCE.register(ITeslaHolder.class, new CapabilityTeslaHolder<ITeslaHolder>(), BaseTeslaContainer.class);
}
 
开发者ID:Herobone,项目名称:HeroUtils,代码行数:8,代码来源:Tesla.java

示例8: preInit

import net.minecraftforge.common.capabilities.CapabilityManager; //导入依赖的package包/类
public void preInit(FMLPreInitializationEvent e) {
    RegistryBuilder ritualRegistryBuilder = new RegistryBuilder();
    ritualRegistryBuilder.setMaxID(512)
            .setType(RitualRecipe.class)
            .setName(new ResourceLocation(Constants.MODID, "ritual_registry"));
    ritualRegistryBuilder.create();

    CapabilityManager.INSTANCE.register(IFaerieInformation.class, new FaerieInformationStorage(), FaerieInformation.class);
    GeneraEntities.init();
    GeneraTileEntities.init();
    MinecraftForge.EVENT_BUS.register(new EventHandler());
}
 
开发者ID:BenjaminSutter,项目名称:genera,代码行数:13,代码来源:CommonProxy.java

示例9: preInit

import net.minecraftforge.common.capabilities.CapabilityManager; //导入依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
	PacketHandler.registerMessages();
	
	File directory = event.getModConfigurationDirectory();
       config = new Configuration(new File(directory.getPath(), "etheric.cfg"));
       Config.readConfig();
	
       CapabilityManager.INSTANCE.register(IQuintessenceCapability.class, new QuintessenceCapabilityStorage(), DefaultQuintessenceCapability.class);
       
	proxy.preInit(event);
	
	GameRegistry.registerWorldGenerator(new EthericWorldGenerator(), 0);
}
 
开发者ID:the-realest-stu,项目名称:Etheric,代码行数:15,代码来源:Etheric.java

示例10: preInit

import net.minecraftforge.common.capabilities.CapabilityManager; //导入依赖的package包/类
@EventHandler
public void preInit (FMLPreInitializationEvent event) {

    // Packets
    NETWORK.register(PacketStage.class, Side.CLIENT);
    NETWORK.register(PacketStageAll.class, Side.CLIENT);
    NETWORK.register(PacketRequestClientSync.class, Side.SERVER);

    CapabilityManager.INSTANCE.register(IStageData.class, new Storage(), DefaultStageData.class);
    MinecraftForge.EVENT_BUS.register(new PlayerDataHandler());
    BookshelfRegistry.addCommand(COMMAND);
    BookshelfRegistry.addGameRule(GAME_RULE_SHARE_STAGES);
}
 
开发者ID:Darkhax-Minecraft,项目名称:Game-Stages,代码行数:14,代码来源:GameStages.java

示例11: onPreInit

import net.minecraftforge.common.capabilities.CapabilityManager; //导入依赖的package包/类
public void onPreInit() {
    MinecraftForge.EVENT_BUS.register(new ServerEventHandler());
    PossessHandler.onPreInit();
    ItemRegistry.onPreInit();
    BlockRegistry.onPreInit();

    NetworkRegistry.INSTANCE.registerGuiHandler(Possessed.getInstance(), this);

    GameRegistry.registerWorldGenerator(new PossessedWorldGenerator(), 0);

    CapabilityManager.INSTANCE.register(PossessCapability.class, new PossessCapability.Storage(), new PossessCapability.Factory());
}
 
开发者ID:Fararise,项目名称:Possessed,代码行数:13,代码来源:ServerProxy.java

示例12: init

import net.minecraftforge.common.capabilities.CapabilityManager; //导入依赖的package包/类
public void init(FMLPreInitializationEvent e) {
  CapabilityManager.INSTANCE.register(IEnergyHandler.class, new MvesStorage<IEnergyHandler>(), MvesDefaultImpl.class);
  CapabilityManager.INSTANCE.register(IEnergySupplier.class, new MvesStorage<IEnergySupplier>(), MvesDefaultImpl.class);
  CapabilityManager.INSTANCE.register(IEnergyTransporter.class, new MvesStorage<IEnergyTransporter>(), MvesDefaultImpl.class);
  CapabilityManager.INSTANCE.register(IEnergyAcceptor.class, new MvesStorage<IEnergyAcceptor>(), MvesDefaultImpl.class);

  if (Config.enableFurnaceHooking.getBoolean()) {
    MinecraftForge.EVENT_BUS.register(new FurnaceCapabilityAttacher());
  }
  if (Config.enableRainbowWire.getBoolean()) {
    BlockMvesWire.create();
  }
}
 
开发者ID:HenryLoenwind,项目名称:mves,代码行数:14,代码来源:CommonProxy.java

示例13: load

import net.minecraftforge.common.capabilities.CapabilityManager; //导入依赖的package包/类
/**
 * Load stuff
 * 
 * Add event listeners, register morphing capability and also load user 
 * configuration. I don't know how it's going to work in multiplayer, 
 * probably won't lol
 */
public void load()
{
    /* Event listeners */
    MinecraftForge.EVENT_BUS.register(this.config);
    MinecraftForge.EVENT_BUS.register(new MorphHandler());
    MinecraftForge.EVENT_BUS.register(new CapabilityHandler());
    MinecraftForge.EVENT_BUS.register(new RegisterHandler());

    /* Morphing manager and capabilities */
    CapabilityManager.INSTANCE.register(IMorphing.class, new MorphingStorage(), Morphing.class);

    /* Register morph factories */
    RegisterHandler.registerAbilities(MorphManager.INSTANCE);
    MorphManager.INSTANCE.register();

    /* User configuration */
    if (!morphs.exists())
    {
        MorphUtils.generateFile(morphs, "{}");
    }

    if (!blacklist.exists())
    {
        MorphUtils.generateFile(blacklist, "[]");
    }
}
 
开发者ID:mchorse,项目名称:metamorph,代码行数:34,代码来源:CommonProxy.java

示例14: register

import net.minecraftforge.common.capabilities.CapabilityManager; //导入依赖的package包/类
public static void register() {
	CapabilityManager.INSTANCE.register(PlayerCivilizationCapability.class, new PlayerCivilizationStorage(), new Callable<PlayerCivilizationCapability>() {
		@Override
		public PlayerCivilizationCapability call() throws Exception {
			return null;
		}
	});
}
 
开发者ID:ToroCraft,项目名称:ToroQuest,代码行数:9,代码来源:PlayerCivilizationCapabilityImpl.java

示例15: initialization

import net.minecraftforge.common.capabilities.CapabilityManager; //导入依赖的package包/类
public static void initialization()
{
	CapabilityManager.INSTANCE.register(PlayerAether.class, new PlayerAetherStorage(), PlayerAether.class);

	AetherRankings.initialization();

	CommonProxy.registerEvent(new PlayerAetherEvents());
}
 
开发者ID:Modding-Legacy,项目名称:Aether-Legacy,代码行数:9,代码来源:PlayerAetherManager.java


注:本文中的net.minecraftforge.common.capabilities.CapabilityManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。