Search in sources :

Example 1 with CasterData

use of jackiecrazy.wardance.capability.skill.CasterData in project WarDance by Jackiecrazy.

the class EntityHandler method caps.

@SubscribeEvent
public static void caps(AttachCapabilitiesEvent<Entity> e) {
    if (e.getObject() instanceof LivingEntity) {
        e.addCapability(new ResourceLocation("wardance:combatinfo"), new CombatData((LivingEntity) e.getObject()));
        e.addCapability(new ResourceLocation("wardance:statuseffects"), new Marks((LivingEntity) e.getObject()));
        if (e.getObject() instanceof PlayerEntity)
            e.addCapability(new ResourceLocation("wardance:casterinfo"), new CasterData((LivingEntity) e.getObject()));
    }
}
Also used : LivingEntity(net.minecraft.entity.LivingEntity) CasterData(jackiecrazy.wardance.capability.skill.CasterData) ResourceLocation(net.minecraft.util.ResourceLocation) Marks(jackiecrazy.wardance.capability.status.Marks) CombatData(jackiecrazy.wardance.capability.resources.CombatData) PlayerEntity(net.minecraft.entity.player.PlayerEntity) ServerPlayerEntity(net.minecraft.entity.player.ServerPlayerEntity) SubscribeEvent(net.minecraftforge.eventbus.api.SubscribeEvent)

Aggregations

CombatData (jackiecrazy.wardance.capability.resources.CombatData)1 CasterData (jackiecrazy.wardance.capability.skill.CasterData)1 Marks (jackiecrazy.wardance.capability.status.Marks)1 LivingEntity (net.minecraft.entity.LivingEntity)1 PlayerEntity (net.minecraft.entity.player.PlayerEntity)1 ServerPlayerEntity (net.minecraft.entity.player.ServerPlayerEntity)1 ResourceLocation (net.minecraft.util.ResourceLocation)1 SubscribeEvent (net.minecraftforge.eventbus.api.SubscribeEvent)1