示例#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 addMana(ItemStack stack, int mana) {
   IManaPool pool = getManaPool(stack);
   if (pool != null) {
     pool.recieveMana(mana);
     TileEntity tile = (TileEntity) pool;
     tile.getWorldObj()
         .func_147453_f(
             tile.xCoord,
             tile.yCoord,
             tile.zCoord,
             tile.getWorldObj().getBlock(tile.xCoord, tile.yCoord, tile.zCoord));
   }
 }
示例#3
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());
      }
    }
  }
示例#4
0
 @Override
 public int getMana(ItemStack stack) {
   IManaPool pool = getManaPool(stack);
   return pool == null ? 0 : pool.getCurrentMana();
 }