Jump to content

[1.13.2] Tile Entity not loading contents on world reload and TER struggles


ModernPatriot

Recommended Posts

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

2019-06-06_12_53_47.png.dcc43a5afbcc08274fa31aabd5bb7054.png

This is how it looks (and how its supposed to look) in the case of 1/2 items:

Spoiler

2019-06-06_12_54_41.png.e55cc422e39c0b62aa39ca9a7b2daadb.png2019-06-06_12_53_55.png.cdb63d25ad5d927533c852f925941e01.png

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

 

Link to comment
Share on other sites

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 WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.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)

Link to comment
Share on other sites

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

2019-06-06_15_14_25.png.b778241f1644c00f3277a77f81ea2a9f.png2019-06-06_15_14_26.png.14ac4955df077829a9687bb5722a54b2.png

(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 by ModernPatriot
Link to comment
Share on other sites

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 WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.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)

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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