mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-01-10 09:20:28 +00:00
b9eac4e509
This adds a new mechanism for attaching additional objects to a computer, allowing them to be queried by other mods. This is primarily designed for mods which add external APIs, allowing them to add APIs which depend on the computer's position or can interact with the turtle inventory. I will stress that the use-cases for custom APIs are few and far between. Almost all the time a peripheral would be the better option, and I am wary that this PR will encourage misuse of APIs. However, there are some legitimate use-cases, and I think we should enable them. - Add a new "ComputerComponent" class, and several built-in components (for turtle, pocket and command computers). - Add a method to `IComputerSystem` to read a component from the computer. We also add methods to get the level and position of the computer. - Move all our existing APIs (built-in turtle, pocket, command) to use the public API. |
||
---|---|---|
.. | ||
client/java/dan200/computercraft | ||
main/java/dan200/computercraft |