Search in sources :

Example 1 with TileBlinker

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

the class BlockBlinker method getItem.

@Override
public ItemStack getItem(World world, BlockPos pos, IBlockState state) {
    Optional<TileBlinker> optional = getTile(TileBlinker.class, world, pos);
    if (optional.isPresent()) {
        TileBlinker blinker = optional.get();
        ItemStack stack = new ItemStack(Item.getItemFromBlock(this));
        blinker.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) TileBlinker(arekkuusu.solar.common.block.tile.TileBlinker) ItemStack(net.minecraft.item.ItemStack)

Aggregations

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