Jump to content

Siqhter

Members
  • Posts

    149
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Siqhter

  1. Thank you, I'm taking a look at that. I'm wondering in your example, where do you set a display name for the container? Originally I had something like "container.name" after the createContainer method. But I believe that's from IInventory.
  2. How I do it is something like: and then call the method in your Main.java init method.
  3. 1) Don't use IHasModel, it's just more code you don't need to write. 2) There's no need for an itembase, just use Item. 3) Don't use static initialization in your ModItems class. I might be mistaken, but I think registry names need to be lowercase, yours are not and that could be the problem. This includes your json files. Furthermore, you are directing your models/item file to a path with a different modid of "tm".
  4. Well, in the crash log it looks like you're missing a file. That might be part of the issue.
  5. Edit: I've done some research on IItemHandler and Capabilites, so rather, where am I supposed to implement using capabilities. The tileentity? And what needs to change in my container class so that I'm not implementing IInventory.
  6. I believe that isItemValid is a method in Slot. I have a custom inventory slot that extends the Slot class, and that's where I control which items can be placed in certain slots. Not sure if this is what you're looking for.
  7. I guess I'm just unclear as to what I am supposed to replace with IItemHandler.
  8. Now when you told me to get rid of IInventory and use IItemHandler, is that because I'm using InventoryPlayer? How do switch it?
  9. Thanks for the explanation. I got it working, but I don't quite understand what I did: The "single slot" index is 9. How does the "index" relate to the "actual" slot in which an item can be placed?
  10. I know, that's why it duplicates the item because it's essentially the same slot. I don't know how to give it it's own index after looping through the first row. It's crashes the game with an out of bounds exception.
  11. Sorry. public CustomContainer(InventoryPlayer player, TestTileEntity tileEntity) { this.tileEntity = tileEntity; // single slot this.addSlotToContainer(new Slot(tileEntity, 0, 80, 32)); // row of 9 for (int i = 0; i < 9; i++) { this.addSlotToContainer(new Slot(tileEntity, i, 8 + i * 18, 53)); } /* Player Inventory and Hotbar */ for (int y = 0; y < 3; y++) { for (int x = 0; x < 9; x++) { this.addSlotToContainer(new Slot(player, x + y * 9 + 9, 8 + x * 18, 84 + y * 18)); } } for (int x = 0; x < 9; x++) { this.addSlotToContainer(new Slot(player, x, 8 + x * 18, 142)); } }
  12. So I have a custom GUI with one row of 9 slots, and then a single slot above them all (which is supposed to act just like all the others, it's not an output). I loop through the row of 9 slots and add them to the container, which works fine. Then I add just the top slot and it's coordinates to the container. However, everytime I put an item in the top slot, it duplicates into the corresponding slot in the for loop. I know it's a logical error, but I'm not able to figure out how to fix it.
  13. Thanks, I was pretty sure of that. There's no downfall of using GuiChest if I don't want to customize anything other than the amount of slots, right?
  14. I don't know why I assumed that his modid was "tutorialmod". That would make sense that that would be the issue.
  15. I have created a GUI for a container block that opens on right click. I am using ContainerChest and GuiChest since I don't need a custom GUI at this moment. That being said, is there any way to change the text color of the inventory title for my container block?
  16. Ok, it looks like you're directing it to the correct texture, so you might have registered it with a different name or you're directing the json to the wrong path. Either way we would need to see more code.
  17. Post your json or a github link.
  18. Sorry, I missed that. I'm honestly not sure, but you might be accessing the wrong resources path:
  19. Are you sure the png is named correctly?
  20. Can you post your json files for the block?
  21. Thanks, I think I breezed over that but I'll take a closer look at it now.
  22. Thanks, this is what I was looking for. Is there an example of how I should modify the blockstate in the neighborChanged method?
  23. I have taken a look at BlockStairs.java, but I'm not sure I understand what's going on. Basically I just want to change a neighboring block based on the direction and position of the just-placed block. I don't know what I should use to do this (neighborChanged method?) so a point in the right direction would be appreciated. Thanks.
  24. Also don't use a static initializer to register blocks/items.
×
×
  • Create New...

Important Information

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