Posted April 2, 201411 yr All I know about accessing inventories is right-clicking on a block and it creating a new tile entity. How would I do this with an item? if (user.hasKnowledgeOfJava) { if (user.question.hasCode) { return interpetHelpfulResponse(user.getQuestion()); } else { return "Could you post your code please?"; } } else { return "Learn some freaking Java!"; }
April 2, 201411 yr Author Every inventory is ultimately based on something that implements IInventory. You need to write a class that implements IInventory and stores the contents into an ItemStack. So what would be a good example of that? if (user.hasKnowledgeOfJava) { if (user.question.hasCode) { return interpetHelpfulResponse(user.getQuestion()); } else { return "Could you post your code please?"; } } else { return "Learn some freaking Java!"; }
April 2, 201411 yr Author I have a basic implementation which you can use as a reference: https://github.com/diesieben07/SevenCommons/blob/master/src/main/java/de/take_weiland/mods/commons/inv/ItemInventory.java Thanks! if (user.hasKnowledgeOfJava) { if (user.question.hasCode) { return interpetHelpfulResponse(user.getQuestion()); } else { return "Could you post your code please?"; } } else { return "Learn some freaking Java!"; }
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.