TeamMotherlode / MotherlodeCore

Motherlode Minecraft mod
GNU Lesser General Public License v2.1
6 stars 2 forks source link

Sawmill #38

Closed BeetMacol closed 3 years ago

BeetMacol commented 3 years ago

image

Adds sawmill and sawmilling recipes.
Sawmillings gives player slight advantage in crafting wood products. It may let you craft them in smaller portions and be cheaper at the same time.
In code, output is represented as buttons instead of slots.

The problem with sawmilling

A lot of recipes are hard to create logically; wood products usually consist of more than a single oak plank. I didn't create any recipes that would take more than 1 item as input because there are no recipes that use more than 1 item per slot and sawmill only has one input slot.
I can only see two solutions for that problem:

  1. (currently used) Make some of the recipes really cheap in comparison to crafting recipes. That solution won't fully resolve the problem, and I managed to only create 5 recipes with planks as an input with it. It works for most of the log based recipes with a slight advantage over workbench crafting.
  2. Use more than 1 items as an input. This will allow regulating the recipes correctly, but will probably decrease the advantage over workbench crafting. In my opinion this solution is too much outstanding from vanilla.

Recipes list and comparison with workbench crafting

OUT - output
SW4 - Sawmilling 1 log SW1 - Sawmilling 1 planks WB4 - Converted Workbench/Vanilla output per 1 log (WB1×4) WB1 - Converted Workbench/Vanilla output per 1 planks WBp - Workbench/Vanilla proper recipe

OUT SW4 SW1 WB4 WB1 WBp
Sticks 8 2 8 2 4 = 2 Planks
Planks 4 - 4 1 4 = 1 Log
Stripped Log 1 - 1 4 1 = 1 Log
Wood 1 - 1.(3) 0.(3) 3 = 4 Logs
Stripped Wood 1 - 1.(3) 0.(3) 1 = 1 Wood
Slabs 8 2 8 2 6 = 3 Planks
Pressure Plates 2 - 2 0.5 1 = 2 Planks
Fences 3 - 2.(6) 0.(6) 3 = 4 Planks + 2 Sticks
Trapdoors 2 - 1.(3) 0.(3) 2 = 6 Planks
Fence Gates 1 - 1 0.25 1 = 2 Planks + 4 Sticks
Stairs 4 1 2.(6) 0.(6) 4 = 6 Planks
Buttons 4 1 4 1 1 = 1 Planks
Doors 2 - 2 0.5 3 = 6 Planks
Signs 2 - ~1.84 ~0.46 3 = 6 Planks + 1 Stick
Boats 1 - 0.8 0.2 1 = 5 Planks
Barrels - - ~0.57 ~0.14 1 = 6 Planks + 2 Slabs
Bowls 4 1 3 0.75 4 = 3 Planks
Chests - - 0.5 0.125 1 = 8 Planks
Crafting Tables 1 - 1 4 1 = 4 Planks

Sawmill also lets you craft 1 log out of 1 wood (wood is the log with bark on every side), and allows you to use wood for all of the log recipes (except wood itself obviously). I can do the same thing with stripped logs and wood, but vanilla does not let you change stripped ones to non-stripped ones, so it should be discussed. It would be really useful for builders but also it doesn't make a lot of sense.

Adding tool recipes to sawmill is also possible and should be considered.

TODO List

I know it looks like a lot of stuff to do but the unchecked ones are minor issues (in most cases)

mounderfod commented 3 years ago

I think that 1 plank should equal 1 stair, as you are theoretically cutting a corner out.

mschae23 commented 3 years ago

Looks good (I haven't tested it in-game yet). The recipe type shouldn't be in MotherlodeBuidingBlocks, though. Maybe a separate class, or just in MotherlodeModule.

Also, to generate the block item model, you shouldn't make the Block an AssetProcessor. Instead, just use the register method with CommonAssets.BLOCK_ITEM as an argument in MotherlodeBuildingBlocks.

Thanks for changing the Motherlode.id(MotherlodeModule.MODID, ...). Seems like I missed a lot of those.

BeetMacol commented 3 years ago

I think that 1 plank should equal 1 stair, as you are theoretically cutting a corner out.

It already does.

Looks good (I haven't tested it in-game yet). The recipe type shouldn't be in MotherlodeBuidingBlocks, though. Maybe a separate class, or just in MotherlodeModule.

Yeah I was thinking about that. I didn't want to make a lot of classes for each type of thing, because i have a screen, screen handler, recipe type and recipe. I think I will move it to MotherlodeModule.

Also, to generate the block item model, you shouldn't make the Block an AssetProcessor. Instead, just use the register method with CommonAssets.BLOCK_ITEM as an argument in MotherlodeBuildingBlocks.

Ok, I'll do that.

Thanks for changing the Motherlode.id(MotherlodeModule.MODID, ...). Seems like I missed a lot of those.

A few days ago when I was working on that actively (i had a break and finished it today), I was using Motherlode.id(MotherlodeModule.MODID, ...) I noticed the MotherlodeModule#id method today's morning and used the replace tool to change it.

FoundationGames commented 3 years ago

image UI Could be taller, the Inventory title's looking a bit crushed, and so is the Sawmill title

BeetMacol commented 3 years ago

image UI Could be taller, the Inventory title's looking a bit crushed, and so is the Sawmill title

Yes I noticed it the moment I tested the GUI for the very first time. I was thinking about changing it but I couldn't find any vanilla GUI with any other size, so I thought it will be better to leave it the way it is.

BeetMacol commented 3 years ago

It is pretty much finished. Recipes per each wood type and mod support can be added after all the wood types are added and platform recipes can be added later because there are a lot of things in Motherldoe that don't have any recipe anyway. I am not sure how to do the shift clicking thought. Can't find a way to check if player is shift clicking without an additional packet or replacing the output buttons with slots (it would also require a special packet if I remember correctly).

mschae23 commented 3 years ago

It is pretty much finished. Recipes per each wood type and mod support can be added after all the wood types are added and platform recipes can be added later because there are a lot of things in Motherldoe that don't have any recipe anyway.

I could add the recipes for WoodType, when this PR is merged.