Fix sleeping

This commit is contained in:
Owen1212055 2024-12-15 20:52:03 -05:00
parent 2e14d98ebe
commit 59a1f78750
No known key found for this signature in database
GPG key ID: 2133292072886A30

View file

@ -825,15 +825,15 @@
this.enteredNetherPosition = null;
}
}
@@ -1110,16 +_,21 @@
@Override
public Either<Player.BedSleepingProblem, Unit> startSleepInBed(BlockPos at) {
Direction direction = this.level().getBlockState(at).getValue(HorizontalDirectionalBlock.FACING);
@@ -1107,19 +_,18 @@
this.containerMenu.broadcastChanges();
}
- @Override
- public Either<Player.BedSleepingProblem, Unit> startSleepInBed(BlockPos at) {
- Direction direction = this.level().getBlockState(at).getValue(HorizontalDirectionalBlock.FACING);
+ // CraftBukkit start - moved bed result checks from below into separate method
+ return getBedResult(at, direction);
+ }
+ private Either<Player.BedSleepingProblem, Unit> getBedResult(BlockPos at, Direction direction) {
+ // CraftBukkit end - moved bed result checks from below into separate method
if (this.isSleeping() || !this.isAlive()) {
return Either.left(Player.BedSleepingProblem.OTHER_PROBLEM);
- } else if (!this.level().dimensionType().natural()) {