Jump to content

Recommended Posts

Posted

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

 

Posted

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)

Posted (edited)

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
Posted

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)

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Well, when I log in to the server, sometimes within an hour, sometimes within a minute, the server closes and informs me that there was a Ticking entity error. Below is the crash report
    • Try switching to Windowed or Borderless Window mode in Minecraft. These modes make it easier for the recorder to capture gameplay, as it still has access to the display without the game taking up all of the graphics resources.
    • This forum is for Forge, not NeoForge. Please go to them for support.
    • Forge version: 55.0.0 Minecraft version: 1.21.5 Downloads: As this is the start of a new version, it is recommended that you check the downloads page and use the latest version to receive any bug fixes. Downloads page Intro: Good evening! Today, we have released our initial build of Forge 55.0 for Minecraft 1.21.5. 1.21.5 is the newest member of the 1.21 family of versions, which was released yesterday on March 25, 2025. As a reminder, the first minor (X.0) of a Forge version is a beta. Forge betas are marked as such on the bottom left of the title screen and are candidates for any breaking changes. Additionally, there are a couple of important things to note about this update, which I've made sure to mention in this post as well. Feel free to chat with us about bugs or these implementation changes on GitHub and in our Discord server. As always, we will continue to keep all versions of 1.21 and 1.20 in active support as covered by our tiered support policy. Cheers, happy modding, and good luck porting! Rendering Refactor For those who tuned in to Minecraft Live on March 22, 2025, you may already know that Mojang have announced their intention to bring their new Vibrant Visuals overhaul to Java in the future. They've taken the first steps toward this by refactoring how rendering pipelines and render types are handled internally. This has, in turn, made many of Forge's rendering APIs that have existed for years obsolete, as they (for the most part) can be done directly in vanilla. If there was a rendering API that was provided by Forge which you believe should be re-implemented, we're happy to discuss on GitHub through an issue or a pull request. Deprecation of weapon-like ToolActions In 1.21.5, Minecraft added new data components for defining the characteristics of weapons in data. This includes attack speed, block tags which define efficient blocks, and more. As such, we will begin marking our ToolActions solution for this as deprecated. ToolActions were originally added to address the problem of creating modded tools that needed to perform the same actions as vanilla tools. There are still a few tool actions that will continue to be used, such as the shears tool action for example. There are some existing Forge tool actions that are currently obsolete and have no effect given the way the new data components are implemented. We will continue to work on these deprecations and invite you to chat with us on GitHub or Discord if you have any questions.
    • In summary, a full mod to adjust mining progress in such a specific way does not yet exist in its exact form, but it is possible to find mods that change certain aspects of progression (e.g. "Harder Ores").
  • Topics

  • Who's Online (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

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