Jump to content

JKK

Members
  • Posts

    5
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

JKK's Achievements

Tree Puncher

Tree Puncher (2/8)

3

Reputation

  1. Thank you for the respons Lex. Tbh I was trying out the solution that you first stated (++) but at that time I didn't know I need 2 stacks so I thought it somehow isn't working. For the second one... makes sence to use it that way.
  2. Not to be a smart ass but how are you going to get an Item out of Null? Tbh it is not needed as I checked if the Inventory slot was occupied but rather one too many then one too short
  3. Success!!! After mining (get it through the source code for half a day (not to be provd of I at last came up with a method which does what you want (and so do I). !WARNING! This is a code which was a result of a half a day of reading through the internet so it's not writen well. Also... if you can rewrite in a better state then do that and post it here please. So here goes: I think I also have some explaining to do 1. This goes in the mod_xxx.java 2. For loop loops through the slots in the current inventory (crafting table/inventory crafting space) looking for the item stated in the if statement 3. Now this is the stupid part but I couldn't find a better way... The truth is that takenFromCrafting is called before the ingredients are destroied or at least that is what I've found (Lex?) that is why you have to make an ItemStack of two Items so that one is destroied and the other stays in the grid 4. this in the if statement is the BaseMod class or the class having your item defined in 5. Then is just the damage calculation depending on the ingredient (Item) This is it If you have some more questions be sure to ask and I'll respond asap. Have fun, JKK. EDIT: Eloraam if you see this, would you mind not die because of laughing Maybe even supply us with your code? (not begging ofc)
  4. Note that setting hardness level to -1 renders the block indestructible. OR Use function provided by Forge Block.setBlockUnbreakable() (which does exactly the same as the first option but looks and reads nicer.
×
×
  • Create New...

Important Information

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