Tinkers Construct

Tinkers Construct

160M Downloads

Any shape smelteries

haddad5 opened this issue ยท 4 comments

commented

Minecraft Version

1.18.1

Forge Version

Current

Mantle Version

Current

Tinkers' Construct Version

Current

Problem description

I think that circular smelteries would be awesome, basically just not limiting smelteries to squares or rectangles. I don't know how that is to program based on your codebase, but I feel like it would be an awesome addition to Tinker's Construct

Suggested solution

I think the 7x7 square is still a good max size, but just basically scanning all blocks behind the controller to the left and right, checking for all SmelteryBlocks (I am assuming you have a class that includes all parts of the smeltery body). If it is one, add it to a 2D array of possible blocks to make up the smeltery (probably a 15x7 array to account for the smeltery controller not being placed in the center of one side, and this does mean the controller must be placed on one of the farthest out points on the circle or whatever you are building). Then for each block in the array, if there is a SmelteryBlock on all 4 sides and this block is air, then consider it a possible part of the final smeltery. Once you have a shape for the smeltery, check to see if it is too big (i don't know how I would do that) and continue accordingly with your error messages at the controller, highlighted blocks, etc. Maybe another feature or at least a debugging tool to help you guys code this would be to highlight the area the controller is trying to use for the inside of the smeltery. Just an idea, no worries if you guys cannot do it, programming is hard, and I am sure you guys are just doing this for fun, so no worries!Smeltery

Alternatives considered

I feel like I was pretty specific in my suggested solution

Additional context

No response

Searched for existing enhancement?

Used the search bar

commented

Non-square smelterys would probably exponentially increase the cost of detecting the smeltery structure. Its not as simple as just scanning the area, you need to ensure its a closed shape, and that you did not just have a small part loop in on itself. It changes a simple 3D iteration into a recursive problem.

In addition, it would increase the cost of calculating fluid locations in the render as its no longer just a single rectangular solid per fluid. Similarly, detecting mobs/items in the smeltery becomes a lot more expensive as its now multiple adjacent rectangles instead of one.

It also is just thematically inconsistent with Minecraft, the boxy game; nether portals notably do not support circles so it does not make sense smelteries should.

So tl;dr, it is too expensive to be worth it, along with thematically inconsistent making me not want to try making it work.


As an aside, the debugging tool already exists, just hold a smeltery block and you will see the problematic block highlight.

commented

Would it be possible for me to write my own Tinkers Construct addon (idk how that would work exactly, but kind of like Thermal Expansion Series)? I wouldn't mind working on it all by myself, but I am not sure where to start. Do I just fork the whole project, or is there a particular part I should focus on to try and see if I can code it?

commented

You do not fork to write an addon. The GitHub wiki has information on getting started. After that, I recommend looking up existing addons and see how they do stuff.

That said, if you don't have experience writing mods, you will have a very hard time adding your desired feature here. I recommend starting with something simpler to get a feel for modding first.


Also to be clear because your comment is worded confusingly, if your goal is getting non-square smelteries in Tinkers Construct, an addon is your only option. Even if you code it, I have no interest in the feature as I made clear by my comment. Its not that its too hard to code, its that the feature does not fit and is not worth the loss of performance.

commented

Yeah, I understand completely, it's more for me than the actual project itself. I will look into the wiki and see about trying to write an addon, thanks for your help!