- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 2.8k
[dev/snapshot] Fixes and updates to bed events #13203
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
base: dev/snapshot
Are you sure you want to change the base?
Conversation
…PI' to todo-snapshot
…gacy constructor convertion
        
          
                paper-api/src/main/java/io/papermc/paper/event/player/PlayerBedFailEnterEvent.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                paper-api/src/main/java/io/papermc/paper/block/bed/BedRuleResultImpl.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                paper-api/src/main/java/io/papermc/paper/event/player/PlayerBedFailEnterEvent.java
          
            Show resolved
            Hide resolved
        
      | /** | ||
| * Entering the bed is prevented and the bed explodes. | ||
| */ | ||
| EXPLOSION | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it still worth to add new values to deprecated things anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think so but since It was added before the API rework I left it there. I'm conflicted between "it's done so we may let it be" and "there's a rework so no need to modify deprecated things". I'm fine with both on this one honestly, whatever fits the needs best for the team
… instead of creating a new one
…tead of creating a new one
Alright, been looking at that stuff for some hours now and here's what I came up with.
Observations
With the arrival of environment attributes, beds mechanism has received quite some changes.
The two settings
naturalandbed_workshave been split in three settings:can_sleep,can_spawn_atandexplodeswhich means that beds can now:Note that whenever the
explodesfield is set, the bed can no longer be slept in and can no longer set the spawn point.Proposed changes
NOT_POSSIBLE_NOWandNOT_POSSIBLE_HEREas a way for developers to know which one exactly triggered the events, and it's not something hard to keep track of using the new attributes.EXPLOSIONthat is triggered everytime a bed is about to explode. This was previously associated withNOT_POSSIBLE_HEREbut due to the settings changes,NOT_POSSIBLE_HEREcan now be triggered without a bed explosion.Updated javadocs according to these changes, if you find anything strange or any spelling issues let me know!
As for
World#isBedWorks, I left a TODO with a question for its deprecation. Is it a method that we're good in deprecating due to underlying changes and a possible environment attribute API coming in at some point?As discussed in paper-contrib:
World#isBedWorkshas been deprecated since it no longer represents what the implementation does