Search in sources :

Example 1 with DefaultManaCapability

use of com.teamwizardry.wizardry.api.capability.player.mana.DefaultManaCapability in project Wizardry by TeamWizardry.

the class ModCapabilities method attachEntity.

@SubscribeEvent
public static void attachEntity(AttachCapabilitiesEvent<Entity> e) {
    if (e.getObject() instanceof EntityPlayer) {
        ManaCapabilityProvider manaCap = new ManaCapabilityProvider(new DefaultManaCapability());
        e.addCapability(new ResourceLocation(Wizardry.MODID, "capability_mana"), manaCap);
        MiscCapabilityProvider miscCap = new MiscCapabilityProvider(new DefaultMiscCapability());
        e.addCapability(new ResourceLocation(Wizardry.MODID, "capability_misc"), miscCap);
    }
}
Also used : DefaultManaCapability(com.teamwizardry.wizardry.api.capability.player.mana.DefaultManaCapability) ResourceLocation(net.minecraft.util.ResourceLocation) EntityPlayer(net.minecraft.entity.player.EntityPlayer) ManaCapabilityProvider(com.teamwizardry.wizardry.api.capability.player.mana.ManaCapabilityProvider) MiscCapabilityProvider(com.teamwizardry.wizardry.api.capability.player.miscdata.MiscCapabilityProvider) DefaultMiscCapability(com.teamwizardry.wizardry.api.capability.player.miscdata.DefaultMiscCapability) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Example 2 with DefaultManaCapability

use of com.teamwizardry.wizardry.api.capability.player.mana.DefaultManaCapability in project Wizardry by TeamWizardry.

the class ModCapabilities method preInit.

public static void preInit() {
    CapabilityManager.INSTANCE.register(IManaCapability.class, new ManaCapabilityStorage(), DefaultManaCapability::new);
    CapabilityManager.INSTANCE.register(IMiscCapability.class, new MiscCapabilityStorage(), DefaultMiscCapability::new);
}
Also used : ManaCapabilityStorage(com.teamwizardry.wizardry.api.capability.player.mana.ManaCapabilityStorage) DefaultManaCapability(com.teamwizardry.wizardry.api.capability.player.mana.DefaultManaCapability) MiscCapabilityStorage(com.teamwizardry.wizardry.api.capability.player.miscdata.MiscCapabilityStorage) DefaultMiscCapability(com.teamwizardry.wizardry.api.capability.player.miscdata.DefaultMiscCapability)

Aggregations

DefaultManaCapability (com.teamwizardry.wizardry.api.capability.player.mana.DefaultManaCapability)2 DefaultMiscCapability (com.teamwizardry.wizardry.api.capability.player.miscdata.DefaultMiscCapability)2 ManaCapabilityProvider (com.teamwizardry.wizardry.api.capability.player.mana.ManaCapabilityProvider)1 ManaCapabilityStorage (com.teamwizardry.wizardry.api.capability.player.mana.ManaCapabilityStorage)1 MiscCapabilityProvider (com.teamwizardry.wizardry.api.capability.player.miscdata.MiscCapabilityProvider)1 MiscCapabilityStorage (com.teamwizardry.wizardry.api.capability.player.miscdata.MiscCapabilityStorage)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 ResourceLocation (net.minecraft.util.ResourceLocation)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1