SPIGOT-6720: Fix bed explosion checks

This commit is contained in:
Doc 2021-08-27 19:17:43 +10:00 committed by md_5
parent 09b99daf30
commit 5be41fb80f
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11
2 changed files with 3 additions and 2 deletions

View File

@ -568,7 +568,8 @@
+ // CraftBukkit start - moved bed result checks from below into separate method
+ private Either<EntityHuman.EnumBedResult, Unit> getBedResult(BlockPosition blockposition, EnumDirection enumdirection) {
if (!this.isSleeping() && this.isAlive()) {
if (!this.level.getDimensionManager().isNatural()) {
- if (!this.level.getDimensionManager().isNatural()) {
+ if (!this.level.getDimensionManager().isNatural() || !this.level.getDimensionManager().isBedWorks()) {
return Either.left(EntityHuman.EnumBedResult.NOT_POSSIBLE_HERE);
@@ -877,7 +1148,36 @@
}

View File

@ -20,7 +20,7 @@
+ // CraftBukkit end
entityhuman.sleep(blockposition).ifLeft((entityhuman_enumbedresult) -> {
+ // CraftBukkit start - handling bed explosion from below here
+ if (entityhuman_enumbedresult == EntityHuman.EnumBedResult.NOT_POSSIBLE_HERE) {
+ if (!world.getDimensionManager().isBedWorks()) {
+ this.explodeBed(finaliblockdata, world, finalblockposition);
+ } else
+ // CraftBukkit end