Jump to content

GooberGunter

Members
  • Posts

    169
  • Joined

  • Last visited

Everything posted by GooberGunter

  1. So I found out that I'm supposed to use ItemHandler through the capability system, not through direct implementation. Is that right?
  2. Update: So I've fiddled around with things. And I have a couple of problems: 1. Hoppers don't send items into the object, I think this is a problem with the TIle Entity class 2. Whenever the player puts an object into the container's slot, the item isn't deleted from the player's inventory causing duplicating glitches 3. Whenever the object is shift clicked from the Tile Entity's inventory, the game crashes with the following error. I'm not sure why I'm having all of these problems, the entity was working fine when it was implementing IInventory. Error: Container: Tile entity class:
  3. So I got the slot to work but now I have the following problem, I'm trying to figure it out but it's pretty tough Stacktrace: Container: Tile Entity:
  4. Funny. Now I'm back at square 1, same error as the original post
  5. So on the other hand, when creating a slot in the GUI container on the server side, it needs a slot with an IInventory, which I don't have access to since the tile entity implements the new IItemHandler
  6. So when I switched to the capability a couple of things changed. The display name, which I've put off to the side since its not a big concern right now. And more importantly, the dropInventoryItems function which requires IInventory as a parameter, which i originally had as the tile entity. Is there a method I can use to drop the items in the tile entity when it's broken? Also how would I then create a new slot in the Container without an IInventory?
  7. *sigh* the one thing I didn't check. Thanks, I'll keep a copy present
  8. Update: so i added the tileentity#clear method and that fixes it, but all it does is set the tile entities slots to EMPTY which the addSlotToContainer method already does. //Tile Entity, slot 0, Slot ID: 0 for(int y = 0; y < 1; y++) { for(int x = 0; x < 1; x++) { this.addSlotToContainer(new Slot(te, x + y, 78 + x * 18, 34 + y * 18)); this.te.clear(); } }
  9. I'm making a tile entity with a single slot and I'm getting this crash report whenever I open the inventory after placing the block down. If I place the block down and close the game then open it again and access the inventory, it is fine. I've looked but I can't find anything that would return null after I went through all my code and replaced all the itemstack = null with itemstack = ItemStack.Empty. Log: Tile Entity: GUI Container: I've gotten pretty good at reading stack traces but I'm stumped here So from what I understand, the block is placed into the work, in which the constructor is run, which creates the slots and sets them to ItemStack.EMPTY based on the the source code. Then the player rightclicks the block which opens the gui (all of this working) and then the game freezes and the game complains about something being null even though nothing was ever set to null in my code. This means that between 1.8 and 1.12.2 a change was made meaning that a stack must be initialized by the modder. Or maybe not considering that if the player placed down a block then closed and reloaded the save to then access the inventory, everything would work just as it is supposed to. This is an error that freezes the game then fixes itself on next boot. I have never in my life seen something like this
  10. import net.minecraft.client.renderer.texture.ITickable; Well, what do you know. Thanks, I'll make sure to double check my imports from now on.
  11. Tile Entity: Block: ModBlocks and Block Registry:
  12. I created a tile entity and implemented the ITickable interface, overriding the tick method and used a logger to print out a statement to test if it's working and it isn't. I read on another post that the instance (can't remember the correct terminology) of ITickable has to be registered, unless it is for a tile entity which already registers it, so I'm not sure where to go next in fixing the problem. I know that the te is registered because I have no errors when overriding createTileEntity from the block class and the logger is printing that a new TE object was created whenever the block is placed. Am I missing something?
  13. Is there some sort of way to link the EntityPlayer from the method to EntityPlayerMP?
  14. So I have a capability of an int array that assigns 5 values to each chunk. I also have an Item that is supposed to read the array in the chunk that the player is currently in. How do I use these packets? I already made them and I get the general idea of how they work, but I just don't know how to send them. My major problem is that i need an EntityPlayerMP, which is the same player as the one who activated the item "playerIn" but I don't know how to pass that on from EntityPlayer to EntityPlayerMP, since casting is out of the question
  15. I made my own capability and assigned values to each chunk whenever it's loaded, and everything is working fine. Based on the logger, the capability writes to NBT just fine, but what I don't know is if it is reading from NBT. Is there a specific method I have to call for it to read nbt whenever a chunk with the capability is loaded again? Apparently I wasn't paying enough attention to my log, that also works.
  16. Thanks a lot for the tips. Man, it seems like everything was replaced with annotations So to be clear, the render register no longer goes in the init? What are the initialization methods for? Now I'm getting a file not found exception, I've been waiting for one. I have a lead. Edit: classic blockstate, I fixed the chain and now I have the item model json, the blockstate json, and the texture. Everything works fine now Do recipes, world generators, and entities still initialize the same or are they events too?
  17. That was suggested in the documentation but i didn't see it in the source code, but I fixed it now. I also added the first parameter, but it's still not showing up ModelLoader.setCustomModelResourceLocation(ModItems.oldTome, 0, new ModelResourceLocation(ModItems.oldTome.getRegistryName(), "ds:old_tome")); Am i supposed to register the render or is the model loader enough? Here is all the code involving the item: ModItems: ItemRegisterRender:
  18. ModelLoader.setCustomModelResourceLocation(ModItems.oldTome, 0, new ModelResourceLocation("ds:models//item//old_tome.json", "inventory")); still not working And I'm not any errors in the log about the texture location so I know that's right. It's just this part. And I also had a problem where I made two instances of the item, registering one and registering the render of the other, which I have fixed.
  19. Quick Question, what should the model path look like modid:filename or modid:item//filename. Or modid:models\\item\\filename.
  20. Fantastic. classic me not looking in the right places . Thanks
  21. One reason for it could be that sometimes the forge guys like to “mix things up a bit” and change the way things load, making updating a Royal pain, so by setting up your own implementation you sidestep that so you don’t have to worry about depreciated methods and completely revamped elements. I’d be willing to tempt it if I had the java experience and the time
  22. There is a Json and it’s in the right directory, ill double check when I get back, but I’m to too sure about it’s validity, maybe they changed the json files in 1.12.2 again.
  23. So I have an item registered in the game, and have a class ItemRenderRegister to register the item to a modelresource location via the following code: but I can't wrap my head around how to use the ModelResourceLocation. I'm getting no errors about a missing json file, the item just simply has not model or texture, which makes it very hard to debug.
  24. I've been looking at various source code on github to self-teach myself the various approaches to the custom special effects that mods such as Betweenlands, Astral Sorcery, etc. have that allow fading in and out particles, and one thing I noticed was that sometimes the modder makes their own class to bind the textures using a GL11 method: My question is what benefit does creating your own Resource-Binding class in terms of sprites and sprite sheets compared to using what is already built in to the game? Sorry if there isn't enough information or if this is in the wrong place, this is my first time attempting something more involved than the basic mob, block, etc. If this sorta thing requires understanding GL, is there anywhere I can learn about it?
×
×
  • Create New...

Important Information

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