예제 #1
0
 @Override
 public void onUpdate(
     ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
   IManaPool pool = getManaPool(par1ItemStack);
   if (!(pool instanceof DummyPool)) {
     if (pool == null) {
       bindPool(par1ItemStack, null);
       setManaForDisplay(par1ItemStack, 0);
     } else setManaForDisplay(par1ItemStack, pool.getCurrentMana());
   }
 }
예제 #2
0
  @Override
  public void onUpdate(
      ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
    if (par2World.isRemote) return;

    IManaPool pool = getManaPool(par1ItemStack);
    if (!(pool instanceof DummyPool)) {
      if (pool == null) setMana(par1ItemStack, 0);
      else {
        pool.recieveMana(getManaBacklog(par1ItemStack));
        setManaBacklog(par1ItemStack, 0);
        setMana(par1ItemStack, pool.getCurrentMana());
      }
    }
  }
예제 #3
0
 @Override
 public int getMana(ItemStack stack) {
   IManaPool pool = getManaPool(stack);
   return pool == null ? 0 : pool.getCurrentMana();
 }