Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/17/17 in all areas

  1. All you've done is expose your own item's energy storage through the Forge Energy API, with an IEnergyStorage that calls the IEnergyContainerItem methods. This doesn't affect the energy stored in other items. When you charge another item, you'll need to get its IEnergyStorage through the ItemStack's ICapabilityProvider methods and use IEnergyStorage#receiveEnergy to add energy to it. If it doesn't have one, check if it's an instance of IEnergyContainerItem and use the corresponding method to add energy to it. If it doesn't implement IEnergyContainerItem, To simplify your code, you may want to create a method to get an IEnergyStorage from an ItemStack that does what I said above but returns an instance of EnergyConversionStorage if the item doesn't have an IEnergyStorage and implements IEnergyContainerItem. This way you can use IEnergyStorage#receiveEnergy regardless of which API the item supports. You can use either API to extract energy from the Flux Pack (since you know they both use the same value).
    1 point
  2. Your problem could still reappear later with your mod. If you register or substitue new items, for example. If it happens try changing the order of registration or try to register placeholder entries. I reported this bug with substitution here : https://github.com/MinecraftForge/MinecraftForge/issues/3837 Note I said 19 in the report, but I think there are other value threshold than can trigger the bug. I have been trying for the last few days to precisely figure out the pattern without much success, but there's definitely one. Your classes&JSON are good and unrelated with this.
    1 point
  3. The IStorage for the energy capability (used by Capability#readNBT) can only desrialise from NBT into an instance of EnergyStorage. This is a general rule for most capabilities: The IStorage is only guaranteed to work with the capability's default implementation. If you're using a custom implementation, you'll need to read from/write to NBT yourself (or use that implementation's methods if it implements INBTSerializable). Since your IEnergyStorage implementation isn't actually storing the energy value itself, the ICapabilityProvider doesn't need to implement INBTSerializable (or ICapabilitySerializable, which is simply a combination of the two interfaces).
    1 point
  4. Blocks are now stored as IBlockStates. You can get the state at a position using World#getBlockState, and get the block from the state using IBlockState#getBlock.
    1 point
  5. Geometrically, I posted an answer in what appears to be an accidental duplicate of this thread. Here To add more information to it, the handler variable in your method has the information you want and you get in the form of a List<EntityPlayer> through the world. From what I understand, you want to broadcast the message to all players, so you would iterate through the list like this World worldIn = handler.world; List<EntityPlayer> playerList = worldIn.playerEntities; for (EntityPlayer player : playerList) { printMessages(player); } I find it odd that the code I posted in the other thread has EntityPlayers. With an 's' at the end. It is supposed to be EntityPlayer. Just to clarify. I hope it helps.
    1 point
  6. Oh good thing that I haven't written too much networkcode yet. I heard there were pretty heavy changes to this. Anything confirmed/have I to fear the compability of my mod?
    1 point
  7. There are no plans to ever add in any update checking, or any other call-home style functionality to Forge. Its just not something that I personally agree with, and considering that TONS of mod packs use older versions of Forge, i'd have to write in a disabling mech and then people will want to use the same code for there mods/server.. it;'s a pain Just check the page once a day, or less. We typically announce any major releases {Recommended builds}. Once we hit the stable releases it's usually non-critical updates. Anyways, there has been some work twards 1.7 on the MCP end, and we're progressing pretty good on the gradle stuff. Nothing actually useful to the end users/modders yet, but as I said in the original post, most of us are busy getting ready for Minecon WHoo!
    1 point
  8. Let this be known now: Webchat IS banned from #minecraftforge, get a proper irc client. And: http://www.minecraftforge.net/wiki/IRC_Channel_Rules is a must read. And Lex does ban people for violating the above rules. Thread locked, and stickied, so others notice.
    1 point
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.