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