Search in sources :

Example 1 with TileQimranut

use of arekkuusu.solar.common.block.tile.TileQimranut in project Solar by ArekkuusuJerii.

the class BlockQimranut method getItem.

@Override
public ItemStack getItem(World world, BlockPos pos, IBlockState state) {
    Optional<TileQimranut> optional = getTile(TileQimranut.class, world, pos);
    if (optional.isPresent()) {
        TileQimranut qimranut = optional.get();
        ItemStack stack = new ItemStack(Item.getItemFromBlock(this));
        qimranut.getKey().ifPresent(uuid -> {
            ((IEntangledStack) stack.getItem()).setKey(stack, uuid);
        });
        return stack;
    }
    return super.getItem(world, pos, state);
}
Also used : IEntangledStack(arekkuusu.solar.api.entanglement.IEntangledStack) TileQimranut(arekkuusu.solar.common.block.tile.TileQimranut) ItemStack(net.minecraft.item.ItemStack)

Aggregations

IEntangledStack (arekkuusu.solar.api.entanglement.IEntangledStack)1 TileQimranut (arekkuusu.solar.common.block.tile.TileQimranut)1 ItemStack (net.minecraft.item.ItemStack)1