Cotton

Cotton

157k Downloads

Processing recipes and LootContextTypes

Juuxel opened this issue ยท 5 comments

commented

Processing recipes can have a bonus loot table. Each loot table has a LootContextType that sets some variables for the functions and conditions. That type must also be used when you get the loot table items. Which type should be used for processing?

  • All of vanilla's types (except empty) require a variable that a machine doesn't have (mostly entities).
  • empty doesn't have any parameters for the functions (shouldn't really be a problem here, though)
  • Should we use a custom one with some parameters that are available or just empty?
commented

Fixed the issue comment now (editing on mobile).

commented

Huh, I'm surprised that LootContextType.CHEST isn't passed a block entity. I think we should make a CottonLootContextType.MACHINE that passes a position and a block entity.

commented

I can make a PR for that.

commented

I forbid, categorically, machine recipe types and loot contexts in cotton. If machine recipetypes happened to sneak back into cotton, they need to get removed again. Mods do not, and probably should not, agree on how many input and product slots exist in any given machine type. Extra items like fluxes or balls, or fluid washing materials like water or sulfuric acid, truly do not make sense in some machines and are required in others. And that's just talking about grinders.

commented

They are currently in Cotton:

https://github.com/CottonMC/cotton/blob/d16caf1fd18d0f741b050e99473d8af8a202fe7d/src/main/java/io/github/cottonmc/cotton/datapack/recipe/CottonRecipes.java#L15-L16

Standardizing recipes is hard, though, so I'm not opposed to removed the processing recipe classes from Cotton altogether.