c-ab-o-o-s-e Posted October 28, 2014 Share Posted October 28, 2014 Whats the appropriate to check for if a certain block is placed in a slot. I know how to do items, but not blocks. I tried looking at some vanilla code but didn't find a good example. Guess the overall question is how do I pass the block into the itemstack parameter. If I had a good example to look at I would read it myself but haven't found one. Quote Link to comment Share on other sites More sharing options...
Eternaldoom Posted October 28, 2014 Share Posted October 28, 2014 Blocks don't exist in inventories, they exist as ItemBlocks, a subclass of Item. Get an ItemBlock for the Block with Item.getItemFromBlock(block). Quote Check out my mod, Realms of Chaos, here. If I helped you, be sure to press the "Thank You" button! Link to comment Share on other sites More sharing options...
c-ab-o-o-s-e Posted October 28, 2014 Author Share Posted October 28, 2014 Ahh ok, I thought there was a getItemFromBlock(), but I was trying to do itemstack.getItemFromBlock() and not just Item.getItemFromBLock(). Quote Link to comment Share on other sites More sharing options...
Dragonisser Posted October 29, 2014 Share Posted October 29, 2014 You could also made it into the slot directly https://bitbucket.org/Dragonisser/cobaltmod/src/178c28c1f444b11466696e40bcbfb0f8978acf76/cobaltmod/gui/SlotBackpack.java?at=master Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.