Posted June 6, 20196 yr Hey! So I'm struggling with one of my tile entities, which does save and write NBT-data, but on world reload or when exiting an then joining again the NBT-tags are overridden by the te and only then read. I know my code is super-messy right now and I am going to compact it when all kinks are worked out, but for the sake of my sanity while debugging I tried to write it in a way I understand it better in case of any problems. There isnt anything helpful in the log as far as I know. The te is registered correctly and does practically write/save; just not in the right order. Second problem is with the same te's tile entity renderer in which I try to render the items in the te, depending on how many slots are used. I wanted to render the te's items rotating around the block using sine and cosine functions and it does work for 2 items, however once a third one comes into play instead of the sine translating by a third of a revolution or two-thirds of a revolution this happens: Spoiler This is how it looks (and how its supposed to look) in the case of 1/2 items: Spoiler Extremely messy main class: https://github.com/ModernPatriotCode/Modern-Industry/blob/master/src/main/java/modepat/modernindustry/ModernIndustryMain.java Block class: https://github.com/ModernPatriotCode/Modern-Industry/blob/master/src/main/java/modepat/modernindustry/blocks/BlockGearBox.java Tile Entity class: https://github.com/ModernPatriotCode/Modern-Industry/blob/master/src/main/java/modepat/modernindustry/tileentities/TileEntityGearBox.java TER class (yes, its compactable by a lot, because of current debugging i expanded it as much as possible): https://github.com/ModernPatriotCode/Modern-Industry/blob/master/src/main/java/modepat/modernindustry/tileentities/ter/RendererGearBox.java Container class (currently fairly unused): https://github.com/ModernPatriotCode/Modern-Industry/blob/master/src/main/java/modepat/modernindustry/container/ContainerGearBox.java http://s27.postimg.org/p15i3wjcz/RI_Top.png[/img]
June 6, 20196 yr Don't use GL11. Use the GLStateManager. Also consider de-duplicating all that code, you've got the same code 17 times. When your debugging, the first thing that you should do is isolate the issue. If you're repeating the same code many times and have a mistake in one of them, it becomes very hard to track down the issue. Don't use TileEntityLockable or ISidedInventory. Do not use IInventory at all, Forge's ItemStackHandlers replace it entirely. About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)
June 6, 20196 yr Author Tamed the TER code: https://github.com/ModernPatriotCode/Modern-Industry/blob/master/src/main/java/modepat/modernindustry/tileentities/ter/RendererGearBox.java Problem persists but a bit differently. It doesnt render the third item anymore, it just renders the first, one rotating clockwise and the other counterclockwise. Heres a picture: Spoiler (Edit:) Did not have enough time to change the te's code, will do. (Edit^2:) Changed the te's code, issues still the same: https://github.com/ModernPatriotCode/Modern-Industry/blob/master/src/main/java/modepat/modernindustry/tileentities/TileEntityGearBox.java Edited June 6, 20196 yr by ModernPatriot http://s27.postimg.org/p15i3wjcz/RI_Top.png[/img]
June 6, 20196 yr I’m not sure if this is exactly what you want, but this code renders items rotated around a point (clean up the code before using it if you decide to use it) https://github.com/Cadiboo/WIPTech/blob/2d7e3f1073ed5602944e35daccf18ced8ff4f40a/src/main/java/cadiboo/wiptech/client/render/tileentity/TESRAssemblyTable.java#L44-L55 About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)
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.