Posted February 20, 20178 yr Ok, so I'm creating a boolean capability and I'm not so sure if I have setup the boolean capability correctly. Now, what I'm trying to do here is to store the toggle state of the player's increased running speed in a capability as suggested here. So now that intro is done, the questions! How do I retrieve the boolean from the capability? What changes do I need to make to my KeyBindingEvent (that's where the toggle state is occurring. P.S. it's located in client/handler)? Do I attach the capability to the player? Annd my code! Here's the link. Directions to the classes: IBooleanData (that's the name of the capability) is located in common/capabilities. UpdateBooleanData (name of the packet that is sent to the client to update the data) is located in common/network/client Well, I think that's all you guys need. If you need more info, tell me in your reply and I will add them to the directions list here. http://www.startrek.com/uploads/assets/articles/61c89a9d73c284bda486afaeaf01cdb27180359b.jpg[/img] Till next time. Thank you for delivering funny scenes to Star Trek as Chekov . Will always remember you
February 20, 20178 yr Author Did you read the first line of the first paragraph? Or the questions paragraph? http://www.startrek.com/uploads/assets/articles/61c89a9d73c284bda486afaeaf01cdb27180359b.jpg[/img] Till next time. Thank you for delivering funny scenes to Star Trek as Chekov . Will always remember you
February 20, 20178 yr Yes, but you haven't said anything about whether it is *actually* working, or what happens when you try to use it. Why are you not sure if you've set it up correctly?
February 20, 20178 yr Author Wait what? I set up the methods correctly? getter and setter for the boolean? Anyway, I needed another pair of eyes to see if I setup the capability for booleans correctly. Do I attach the capability to the player in this case with the toggle state? http://www.startrek.com/uploads/assets/articles/61c89a9d73c284bda486afaeaf01cdb27180359b.jpg[/img] Till next time. Thank you for delivering funny scenes to Star Trek as Chekov . Will always remember you
February 20, 20178 yr http://jabelarminecraft.blogspot.com/p/minecraft-17x.html http://mcforge.readthedocs.io/en/latest/datastorage/capabilities/ https://github.com/mchorse/capabilities/tree/master/src/main/java/mchorse/capabilities
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.