Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public boolean onBlockActivated (World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
- if (worldIn.isRemote) {
- final TileEntity tile = worldIn.getTileEntity(pos);
- final TileEntitySolarPanel panel = (TileEntitySolarPanel) tile;
- final ContainerSolarPanel container = (ContainerSolarPanel) panel.getCapability(TeslaCapabilities.CAPABILITY_HOLDER, EnumFacing.DOWN);
- if (heldItem != null)
- {
- final Item item = heldItem.getItem();
- if (item == ModItems.simpleTexturedItem)
- {
- container.increaseCapacity(10000);
- --heldItem.stackSize;
- }
- }
- if (tile instanceof TileEntitySolarPanel && !tile.isInvalid()) {
- sendSpamlessMessage(CHAT_ID, new TextComponentString(I18n.format("message.teslamodularsolars.blocksolarpanel.status", container.getStoredPower(), container.getCapacity(), TeslaModularSolarsConfig.panelPowerGen)));
- LogHelper.logInfo("TeslaModularSolars --------------Capacity is now: " + container.getCapacity());
- }
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement