Search in sources :

Example 1 with TileMechanicalTranslocator

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

the class BlockMechanicalTranslocator method getItem.

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

Aggregations

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