Closed tommyTT closed 5 years ago
Can you please remove the formatting changes in the project? It is difficult to tell what you actually changed with all the indentation changes showing up among the normal changes, and I would rather not reformat this after pulling if accepted. I normally use tabs for indentations, and your commits change them to spaces. It should be pretty easy to tell your IDE to use tabs for this specific project
I'll look into the rest of it when I have a chance to review it, it looks like a pretty big PR. It might be a tad complicated as I was just thinking a simple blockstate to ItemStack map, though it seems this is a function of an anvil landing on an itemstack itself. Ill look into it more when the formatting is fixed and I have more freetime
Anyways, if you want to hop on the SlimeKnights discord we can discuss a few of the feature with less latency, feel free to ping me there. Might be a bit easier than github comments.
Yeah, sorry for that, somehow the formatting became even worse with my latest changes and I didn't check it again before pushing. It should be fixed now. As I said, it started as an exercise and became way more complicated than it needs to be. Unfortunately I'm not available until Sunday, but I will try the discord then.
Closing in favor of #73
I really like this mod, especially the anvil mechanic, so I implemented an advanced version on top of the existing one that allows to smash item stacks. This started as kind of an exercise to learn more about Minecraft modding and became fairly advanced, and maybe a bit over-engineered. Feel free to use anything you deem worthy in the mod or discard it.
So, what does it do exactly? When the anvil lands in a spot where an item stack entity can be found (only first entity is checked), that item stack will be transformed into another item stack according to a recipe. There are also conditions that must be met:
The recipe also allows to transform the block state like in the normal anvil smashing recipes, although it really only makes sense with a specific block state as input. JEI support is also available, although it certainly isn't perfect.
I tried to keep everything fairly isolated from the rest of the code and also added a lot of comments, but I think I messed up some formatting, since I'm using spaces instead of tabs in my IDE settings, sorry for that. I hope you find the code useable, there is certainly room to optimize and expand on.