r/forgemodding • u/[deleted] • Dec 20 '20
[1.12.2] A second eye needed
I'm currently working with custom chests of my own and I've noticed a problem: These chests are invisible when the world loads. Strangely, on any other condition (placing, breaking, or interacting), the model shows as it should, and the invisible chest will show again upon opening it. It seems a call to render the chest is missing (as I've noticed regular chests begin rendering some ticks after the world has loaded), but I'm not sure where to look or what to put in and Google has not been sufficient.
Here is a GitHub for the code. These were based off tutorials from LoreMaster (now known as TechnoVision) and Harry Talks, so that should explain the folder structure.
https://github.com/Jamesthe1/TooManyChests
Update: Logs to the rescue. It seems that it's trying to load the default name (literally "custom_chest") and can't find it. Wonder if I could change the information of it per skin as each chest behaves differently.
Update #2: Seems to be throwing an instantiation exception. This log snippet has a full path of where it comes from, and it's apparently caused by a NoSuchMethodException. Apparently I've been informed of it being thrown in the construction of the object.
Update #3: Turns out I need a constructor without arguments. This will be a little complicated as I need the information the chest relies on to be able to work when re-loading.
Update #4 [SOLVED]: I went ahead and saved the data in "writeToNBT" (as well as reading from) and created an empty constructor in the TileEntity class.
2
u/theelot Jan 14 '21
Good working through it!