Search in sources :

Example 1 with RiftStorage

use of am2.playerextensions.RiftStorage in project ArsMagica2 by Mithion.

the class AMEventHandler method onEntityConstructing.

@SubscribeEvent
public void onEntityConstructing(EntityConstructing event) {
    if (event.entity instanceof EntityLivingBase) {
        event.entity.registerExtendedProperties(ExtendedProperties.identifier, new ExtendedProperties());
        ((EntityLivingBase) event.entity).getAttributeMap().registerAttribute(ArsMagicaApi.maxManaBonus);
        ((EntityLivingBase) event.entity).getAttributeMap().registerAttribute(ArsMagicaApi.maxBurnoutBonus);
        ((EntityLivingBase) event.entity).getAttributeMap().registerAttribute(ArsMagicaApi.xpGainModifier);
        ((EntityLivingBase) event.entity).getAttributeMap().registerAttribute(ArsMagicaApi.burnoutReductionRate);
        ((EntityLivingBase) event.entity).getAttributeMap().registerAttribute(ArsMagicaApi.manaRegenTimeModifier);
        if (event.entity instanceof EntityPlayer) {
            event.entity.registerExtendedProperties(RiftStorage.identifier, new RiftStorage());
            event.entity.registerExtendedProperties(AffinityData.identifier, new AffinityData());
            event.entity.registerExtendedProperties(SkillData.identifier, new SkillData((EntityPlayer) event.entity));
        }
    } else if (event.entity instanceof EntityItemFrame) {
        AMCore.proxy.itemFrameWatcher.startWatchingFrame((EntityItemFrame) event.entity);
    }
}
Also used : RiftStorage(am2.playerextensions.RiftStorage) SkillData(am2.playerextensions.SkillData) EntityItemFrame(net.minecraft.entity.item.EntityItemFrame) AffinityData(am2.playerextensions.AffinityData) EntityPlayer(net.minecraft.entity.player.EntityPlayer) ExtendedProperties(am2.playerextensions.ExtendedProperties) SubscribeEvent(cpw.mods.fml.common.eventhandler.SubscribeEvent)

Aggregations

AffinityData (am2.playerextensions.AffinityData)1 ExtendedProperties (am2.playerextensions.ExtendedProperties)1 RiftStorage (am2.playerextensions.RiftStorage)1 SkillData (am2.playerextensions.SkillData)1 SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)1 EntityItemFrame (net.minecraft.entity.item.EntityItemFrame)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1