Problems with doors

The official Rising World Soundtrack is available!
You can also get the Soundtrack on Steam
  • Hi Red,


    My plugin protects players doors from being opened and closed via the PlayerObjectInteractionEvent.


    However, this does mean that all doors, be them locked or unlocked are unoperable by players who do not "own" the land.


    I would like to make this so that players can open unlocked doors to explore builds.


    IWith that in mind I've noticed that the event.getObject().getInfo() will return a 0 if the door is unlocked or a 1 if it is locked. (This return type is a Long - not sure why?)


    Anyway, the main stumbling block is that this method (PlayerObjectInteractionEvent) isn't called if the player holds down the action key to access the objects radial menu - so anyone can lock or unlock a door.


    Is there a method that is called when these kinds of radial menus are opened? I can't seem to find one? Maybe one does not exist!


    Maybe we need a new method to check if a door/chest is locked or not? One that is invoked *before* the radial menu pops up.



    (In addition I have noticed a small bug you may want to fix. When a door is flipped to enable "double doors", one of the doors radial menu is the wrong way round ("open" and "close" are the wrong way round.) See below:


  • Sorry for my late response! :/ This part of the API is unfortunately a bit confusing, because the game keeps this very generic. You're basically looking for the PlayerChangeObjectInfoEvent: it's called when the info of the object is changed.


    Basically the info field is a generic field for objects to hold various additional data (which depends on the object type). For example, doors use this value to determine if they're locked or unlocked, gramophones store information about their playback state and volume, lights store information about the light color etc. For some objects (e.g. the gramophone), this information is stored as bitmask.

    That's also the reason why this is stored as long ;)


    For doors, however, this value just holds 0 or 1 atm.


    Is there a method that is called when these kinds of radial menus are opened? I can't seem to find one? Maybe one does not exist!

    There is unfortunately no event for that, but it would be quite useful to have one^^ I will put it on our to-do list :)


    (In addition I have noticed a small bug you may want to fix. When a door is flipped to enable "double doors", one of the doors radial menu is the wrong way round ("open" and "close" are the wrong way round.) See below:

    Hmm... how was the door flipped exactly? Is it an open door that was just rotated by 90°, i.e. the old way how double doors were created in the Java version? Or was the door flipped with the "flip" option?

    Basically the radial menu only takes the actual state (open/closed) of the door into account, so if it shows the "Close" option, it indicates that the door was made the old Java way. I'd recommend to remove the door and place a mirrored door there instead, then this should work as expected ^^

  • You're basically looking for the PlayerChangeObjectInfoEvent


    Thanks! I'll go check it out.


    , it indicates that the door was made the old Java wa

    This was a players build on a local test server. So I don't know how the door was placed.


    I will check again when I get time, but assume for now that it was placed at a 90 degree! :D

    There is unfortunately no event for that, but it would be quite useful to have one^^ I will put it on our to-do list

    Grabbing this radial menu and editing it might be fun too...

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!