本文整理汇总了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");
}
示例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();
}
示例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();
}
});
}
}
示例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();
}
});
}
}
示例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());
}
示例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());
}
示例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);
}
示例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());
}
示例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);
}
示例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);
}
示例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());
}
示例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();
}
}
示例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, "[]");
}
}
示例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;
}
});
}
示例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());
}