當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。