Giter Site home page Giter Site logo

Comments (5)

TheIllusiveC4 avatar TheIllusiveC4 commented on August 19, 2024

If this is intended, then I am unaware of how to collect all registered slot types from the client safely.
edit: does not happen in 1.20.1, so I assume it is not supposed to be null

It's intended, as slot types do not exist on the client as they do on the server. I'm not entirely sure why it doesn't happen on 1.20.1 since the code is the same, in that setSlotHelper is only called on server start-up.

The question of how to get registered slot types safely on the client depends on what you need it for, and there are many potential solutions. Can you explain more about what your use-case is for these slot types?

from curios.

iron431 avatar iron431 commented on August 19, 2024

The question of how to get registered slot types safely on the client depends on what you need it for, and there are many potential solutions. Can you explain more about what your use-case is for these slot types?

I have an upgrade system where you can add attributes bonuses to equipment pieces, including curios. If a curio item is being upgraded, I need to know what slots the curio can be equipped in, to be handled in the CurioAttributeModifierEvent later. Currently, I do that by iterating over SlotHelper#getSlotTypes, checking if that slot is valid, then storing it in NBT if so.

from curios.

TheIllusiveC4 avatar TheIllusiveC4 commented on August 19, 2024

Would you be able to use ICuriosHelper#getCurioTags(Item) for this? It returns a list of curio tags for the item that is passed in, which is effectively the same as the list of slot identifiers.

from curios.

iron431 avatar iron431 commented on August 19, 2024

That sounds like a good enough solution for now, hopefully there aren't many psychos with mismatching names

from curios.

TheIllusiveC4 avatar TheIllusiveC4 commented on August 19, 2024

You don't have to worry in that regard, as mismatched names wouldn't work to begin with: the tag has to match the identifier, otherwise it can't be equipped anywhere. It's actually what's used for the main validity checks.

from curios.

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.