2014-02-09 08:55:44 +01:00
|
|
|
package appeng.core.features;
|
|
|
|
|
|
|
|
import net.minecraft.block.Block;
|
|
|
|
import net.minecraft.item.Item;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
|
2014-08-03 01:09:41 +02:00
|
|
|
public class ItemStackSrc implements IStackSrc
|
2014-02-09 08:55:44 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
public final Item item;
|
|
|
|
public final Block block;
|
|
|
|
public final int damage;
|
|
|
|
|
|
|
|
public ItemStackSrc(Item i, int dmg) {
|
|
|
|
block = null;
|
|
|
|
item = i;
|
|
|
|
damage = dmg;
|
|
|
|
}
|
|
|
|
|
|
|
|
public ItemStackSrc(Block b, int dmg) {
|
|
|
|
item = null;
|
|
|
|
block = b;
|
|
|
|
damage = dmg;
|
|
|
|
}
|
|
|
|
|
2014-08-03 01:09:41 +02:00
|
|
|
@Override
|
2014-02-09 08:55:44 +01:00
|
|
|
public ItemStack stack(int i)
|
|
|
|
{
|
|
|
|
if ( block != null )
|
|
|
|
return new ItemStack( block, i, damage );
|
2014-08-03 01:09:41 +02:00
|
|
|
|
|
|
|
if ( item != null )
|
|
|
|
return new ItemStack( item, i, damage );
|
|
|
|
|
|
|
|
return null;
|
2014-02-09 08:55:44 +01:00
|
|
|
}
|
|
|
|
|
2014-08-03 01:09:41 +02:00
|
|
|
@Override
|
|
|
|
public Item getItem()
|
|
|
|
{
|
|
|
|
return item;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getDamage()
|
|
|
|
{
|
|
|
|
return damage;
|
|
|
|
}
|
2014-02-09 08:55:44 +01:00
|
|
|
}
|