1. Forum
  2. Wiki
  3. Bugtracker
  4. Blog
  5. Members
    1. Recent Activities
    2. Users Online
    3. Team
    4. Search Members
  • Login
  • Register
  • Search
This Thread
  • Everywhere
  • This Thread
  • This Forum
  • Forum
  • Pages
  • More Options
  1. IC² Forum
  2. Forum
  3. Archive
  4. IndustrialCraft²
IC2 Experimental builds (jenkins):
v2.0/2.1/2.2 / 2.3 / 2.5 / 2.6 / 2.7 / 2.8 (For Minecraft 1.6.4/1.7.2/1.7.10 / 1.8.9 / 1.9.4 / 1.10 / 1.11 / 1.12)
IndustrialCraft² recent version: v1.117!

Modders question

  • thebest108
  • February 19, 2013 at 7:13 AM
  • thebest108
    Tree Cutter
    Reactions Received
    1
    Posts
    71
    Location
    Derping around in the Direwolf20 pack
    • February 19, 2013 at 7:13 AM
    • #1

    Using an ItemStack, how would I detect if that ItemStacks energy was full?

    • Quote
  • narc
    UUM Liquefier
    Reactions Received
    2
    Posts
    557
    Location
    The Internet
    • February 20, 2013 at 9:46 PM
    • #2

    Well, I was going to say you could get the Item singleton out using Items[ItemStack.itemID] and ask it if it's instanceof ElectricItem -- if so, as the API says, call charge with ignoreTransferLimit and simulate both set to true... but ElectricItem is final and the things IElectricItem has don't seem to help.

    If you're just interested in fullness, you can try to get the damage value -- I believe it's 1 for full items and something like 31 for empties (don't quote me on that, though, I haven't checked recently).

    Am I helping you go in the right direction, at least?

    • Quote
  • thebest108
    Tree Cutter
    Reactions Received
    1
    Posts
    71
    Location
    Derping around in the Direwolf20 pack
    • February 20, 2013 at 10:39 PM
    • #3

    Hm, that just might work, thx :D

    • Quote

Users Viewing This Thread

  • 1 Guest
  1. Privacy Policy
Powered by WoltLab Suite™