Search in sources :

Example 1 with TileQuantumMirror

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

the class BlockQuantumMirror method getItem.

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

Aggregations

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