HalestormXV

Untitled

May 27th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.12 KB | None | 0 0
  1. public class CapabilityHandler
  2. {
  3.     private static final ResourceLocation RUNECRAFT_LEVEL = new ResourceLocation(Reference.MODID, "runeCraftLevel");
  4.     private static final ResourceLocation RUNEBAG_CAP = new ResourceLocation(Reference.MODID, "runeBagCapability");
  5.     private static final ResourceLocation SPELL_CAST_LEVEL_CAP = new ResourceLocation(Reference.MODID, "spellCastLevel");
  6.     private static final ResourceLocation LEARNED_SPELLS_CAPABILITY = new ResourceLocation(Reference.MODID, "learnedSpellList");
  7.     private static final ResourceLocation RUNE_BLADE_CAPABILITY = new ResourceLocation(Reference.MODID, "runeBladeCapability");
  8.  
  9.     @SubscribeEvent
  10.     public void attachCapability(AttachCapabilitiesEvent<Entity> event)
  11.     {
  12.         if (!(event.getObject() instanceof EntityPlayer)) return;
  13.         event.addCapability(RUNECRAFT_LEVEL, new rcLvl_Provider());
  14.         event.addCapability(RUNEBAG_CAP, new RuneBagProvider());
  15.         event.addCapability(SPELL_CAST_LEVEL_CAP, new SpellCastLvLProvider());
  16.         event.addCapability(LEARNED_SPELLS_CAPABILITY, new LearnedSpellsMain.LearnedSpellsProvider());
  17.     }
  18. }
Add Comment
Please, Sign In to add comment