An api method to assign a unique id to a peripheral #1404
Unanswered
Classified3939
asked this question in
Q&A
Replies: 1 comment
-
You're probably looking for That said, what sort of data are you looking to store here? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Within CC, any new computer, turtle, or pocket computer is given a unique id via a class called IdAssigner. However, this class resides within dan200.computercraft.shared.util, not the dan200.computercraft.api package that is typically exposed to mod makers.
If a modded peripheral needs a unique id to store data, and could have multiples placed connected to a single computer (and therefore not able to just use the computer's id), this requires some recreation of code that already exists within computercraft.
Therefore, I would ask that the IdAssigner function getNextId() be exposed to the api in some fashion, probably under the peripheral subheading.
(note: the main page said to ask for functionality in the api package if this exact scenario happens, so this is me doing that)
Beta Was this translation helpful? Give feedback.
All reactions