2014-01-01 10:01:38 +01:00
|
|
|
package appeng.core.features;
|
|
|
|
|
|
|
|
import net.minecraft.block.Block;
|
|
|
|
import net.minecraft.item.Item;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraft.tileentity.TileEntity;
|
2014-05-10 07:00:02 +02:00
|
|
|
import net.minecraft.world.IBlockAccess;
|
2014-01-01 10:01:38 +01:00
|
|
|
import appeng.api.util.AEItemDefinition;
|
|
|
|
|
|
|
|
public class DamagedItemDefinition implements AEItemDefinition
|
|
|
|
{
|
|
|
|
|
2014-08-03 01:09:41 +02:00
|
|
|
final IStackSrc src;
|
2014-01-01 10:01:38 +01:00
|
|
|
|
2014-08-03 01:09:41 +02:00
|
|
|
public DamagedItemDefinition(IStackSrc is) {
|
|
|
|
src = is;
|
2014-01-01 10:01:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Block block()
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Item item()
|
|
|
|
{
|
2014-08-03 01:09:41 +02:00
|
|
|
return src.getItem();
|
2014-01-01 10:01:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Class<? extends TileEntity> entity()
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public ItemStack stack(int stackSize)
|
|
|
|
{
|
2014-08-03 01:09:41 +02:00
|
|
|
return src.stack( stackSize );
|
2014-01-01 10:01:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-05-10 07:00:02 +02:00
|
|
|
public boolean sameAsStack(ItemStack comparableItem)
|
2014-01-01 10:01:38 +01:00
|
|
|
{
|
|
|
|
if ( comparableItem == null )
|
|
|
|
return false;
|
|
|
|
|
2014-08-03 01:09:41 +02:00
|
|
|
return comparableItem.getItem() == src.getItem() && comparableItem.getItemDamage() == src.getDamage();
|
2014-01-01 10:01:38 +01:00
|
|
|
}
|
|
|
|
|
2014-05-10 07:00:02 +02:00
|
|
|
@Override
|
|
|
|
public boolean sameAsBlock(IBlockAccess world, int x, int y, int z)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2014-01-01 10:01:38 +01:00
|
|
|
}
|