Code Monkey home page Code Monkey logo

Comments (5)

juliand665 avatar juliand665 commented on July 29, 2024

I believe this is not something we currently support, sorry! Since the ID Flattening in 1.13 resolved almost all edge cases where items the user would consider distinct had the same ID. What's your specific use case and what prevents you from splitting it into multiple IDs?

from spice-of-life-carrot-edition.

Dowar avatar Dowar commented on July 29, 2024

I'm creating a mod that dynamically adds rarity to vanilla and modded food (which changes the stats when you eat) and I don't want to duplicate each item 4 times so I simply use the CustomModelData to manage the logic (and allow customization of the textures of course)

from spice-of-life-carrot-edition.

juliand665 avatar juliand665 commented on July 29, 2024

Interesting! When designing the mod, I envisioned that variants would either be distinct enough to warrant separate IDs/food list entries/etc. or similar enough to have the same ID and count as the same thing.

I suppose there may be a niche here where the rarer variants are sufficiently harder to get that they should count as separate entries while the items are sufficiently similar to be confusing as separate entries, but it sounds to me like maybe separate IDs really would make sense here. The items look the same, but they have different effects and aren't really interchangeable. Further, using CustomModelData to achieve different behavior really feels like a hack to me that is likely to break other things too (e.g. what happens if you put them in a Storage Drawer?).

Then again, sharing an ID means they can all be used in recipes just like the original, which may be worth all the downsides if that's really important to you. Either way, we don't currently support this functionality and I don't really have the time to add it right now, so you might want to reconsider splitting into separate IDs.

from spice-of-life-carrot-edition.

Dowar avatar Dowar commented on July 29, 2024

The use of NBT instead of ID is really the heart of the concept, the rarity system is inspired by Stardew Valley but what made me want to make my mod is in fact another mod (Quality Crops) which adds rarity with separate IDs (and work very well with this SoL), although I really like this mod I faced some problems when making a modpack with many food : a lot of food had no rarity because the compat had to be done manually (which makes everything confusing and inconsistent, especially when vanilla food is used in modded recipes that have no compat), my implementation aims to correct this among other things ^^

For the visual I currently use the CustomModelData but indeed given that the rarities are dynamic but that the alternative textures must be provided manually the items rarity tend to have the same icon, I planned to add an indicator a bit like Quality Crops in these cases (like a small colored star in a corner of the object). For now I have customized the tooltip render to add a rarity line, a colored name and prefixes/suffixes (all translatable)

About the recipe, I use the "forge:partial_nbt" type to create recipes that produces food of the same quality.

I am careful to make everything compatible with the other mods, the mod is still in development but so far I have not found any insurmountable problem linked to the use of NBT ^^

from spice-of-life-carrot-edition.

juliand665 avatar juliand665 commented on July 29, 2024

I see! That is quite the unfortunate situation then. We'd have to add a whole API for registering subtypes of items, figure out a way to represent it in our stored food list, and probably some other things I'm not thinking of. To be frank, I don't really see this happening any time soon—maybe it's not that important for foods of different rarity to count separately? The effects that come with them should be reward enough right :p

from spice-of-life-carrot-edition.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.