Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arguments #2

Open
anna-s-h opened this issue Sep 20, 2022 · 2 comments
Open

Arguments #2

anna-s-h opened this issue Sep 20, 2022 · 2 comments

Comments

@anna-s-h
Copy link

When passing arguments, the value seems to be nil

event.registerPeripheral("rotation_speed_controller", "create:rotation_speed_controller")
    .mainThreadMethod("get", (container, direction, arguments) => {
        return container.entityData.getFloat("ScrollValue")
    })
    .mainThreadMethod("set", (container, direction, arguments) => {
        //return container.entityData.putFloat("ScrollValue",arguments[0])
        return arguments
    })

this "set" method is what I used to test this. the commented line produces an error and the return value is reported as nil in the computer.

@Prunoideae
Copy link
Owner

Are you on Forge or Fabric? The CC on different versions has different implementation of arguments (And the arguments should only work on Fabric one but I can't understand why it worked on Forge one now). I can't really get it done right now as I'm working on my research projects. Maybe it can be solved a few months later once I get my project done and have some time to spare.

@anna-s-h
Copy link
Author

anna-s-h commented Sep 20, 2022

I am using the Fabric version, through Quilt. How did you get it to work there? (Could I get an example peripheral script?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants