-
Notifications
You must be signed in to change notification settings - Fork 143
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
implement beds , respawn anchors #938
base: master
Are you sure you want to change the base?
Conversation
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.
Noticed a few problems after a quick look
server/world/tick.go
Outdated
t.w.set.RequiredSleepTicks-- | ||
if t.w.set.RequiredSleepTicks-1 <= 0 { |
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 this logic correct? You're decrementing the ticks and then checking if the tick below is <= 0?
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.
Still a few of my previous comments that have not been addressed, found some more issues after another look through
server/block/bed.go
Outdated
// SpawnBlock represents a block using which player can set his spawn point. | ||
type SpawnBlock interface { | ||
SpawnBlock() bool | ||
Update(pos cube.Pos, u item.User, w *world.World) | ||
} |
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.
Please use proper grammer in the docs and also document the methods of the interface. Update is a very ambiguous name and doesn't hint towards being related to spawn points
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.
You have changed the method name but the documentation is still needing to be updated
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.
I have had another look, there are still unresolved comments that I have previously provided. I am not going to review this PR anymore until every single comment has been acted on or you've replied with a valid counter argument. I have gone through and resolved all the comments you have addressed but there are still many that remain
for _, d := range cube.Directions() { | ||
beds = append(beds, Bed{Facing: d}) | ||
beds = append(beds, Bed{Facing: d, Head: true}) | ||
} |
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.
Not having the occupied block states registered might be problematic?
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.
I think the problem is that colored versions were not taken into account?
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.
Bed color is set through the tile, not a block state. Please undo your change.
If all beds are white in the creative inventory, it is probably the same issue with the creative item entries missing NBT that banners have. See a1c98da
Please fix merge conflicts |
bro , I'm dead ☠️ |
# Conflicts: # server/player/handler.go # server/player/player.go # server/session/session.go # server/world/tick.go # server/world/world.go
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.
most of the pr looks good just from a quick glance saw this issue
server/block/bed.go
Outdated
if !ok { | ||
return | ||
} | ||
headSide.Sleeper.Wake() |
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.
Need to check if Sleeper is nil before calling Wake() to avoid a nil pointer.
headSide.Sleeper.Wake() | |
sleeper := headSide.Sleeper | |
if sleeper != nil { | |
sleeper.Wake() | |
} |
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.
Thanks for the PR! I've left some more comments.
No description provided.