use of arekkuusu.solar.common.block.tile.TileAlternator in project Solar by ArekkuusuJerii.
the class BlockAlternator method getItem.
@Override
public ItemStack getItem(World world, BlockPos pos, IBlockState state) {
Optional<TileAlternator> optional = getTile(TileAlternator.class, world, pos);
if (optional.isPresent()) {
TileAlternator alternator = optional.get();
ItemStack stack = new ItemStack(Item.getItemFromBlock(this));
alternator.getKey().ifPresent(uuid -> {
((IEntangledStack) stack.getItem()).setKey(stack, uuid);
});
return stack;
}
return super.getItem(world, pos, state);
}
Aggregations