2018-11-02 08:31:00 +01:00
|
|
|
--- a/net/minecraft/server/BlockBed.java
|
|
|
|
+++ b/net/minecraft/server/BlockBed.java
|
2019-05-09 00:56:32 +02:00
|
|
|
@@ -42,12 +42,22 @@
|
2018-11-02 08:31:00 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- if (world.worldProvider.canRespawn() && world.getBiome(blockposition) != Biomes.NETHER) {
|
|
|
|
+ // CraftBukkit - moved world and biome check into EntityHuman
|
|
|
|
+ if (true || world.worldProvider.canRespawn() && world.getBiome(blockposition) != Biomes.NETHER) {
|
2018-12-06 00:00:00 +01:00
|
|
|
if ((Boolean) iblockdata.get(BlockBed.OCCUPIED)) {
|
2019-04-23 04:00:00 +02:00
|
|
|
entityhuman.a((IChatBaseComponent) (new ChatMessage("block.minecraft.bed.occupied", new Object[0])), true);
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
+ // CraftBukkit start
|
|
|
|
+ IBlockData finaliblockdata = iblockdata;
|
|
|
|
+ BlockPosition finalblockposition = blockposition;
|
2018-11-02 08:31:00 +01:00
|
|
|
+ // CraftBukkit end
|
2019-04-23 04:00:00 +02:00
|
|
|
entityhuman.sleep(blockposition).ifLeft((entityhuman_enumbedresult) -> {
|
|
|
|
+ // CraftBukkit start - handling bed explosion from below here
|
2019-05-09 00:56:32 +02:00
|
|
|
+ if (entityhuman_enumbedresult == EntityHuman.EnumBedResult.NOT_POSSIBLE_HERE) {
|
2019-04-23 04:00:00 +02:00
|
|
|
+ this.explodeBed(finaliblockdata, world, finalblockposition);
|
2019-05-09 00:56:32 +02:00
|
|
|
+ } else
|
2019-04-23 04:00:00 +02:00
|
|
|
+ // CraftBukkit end
|
2019-05-09 00:56:32 +02:00
|
|
|
if (entityhuman_enumbedresult != null) {
|
|
|
|
entityhuman.a(entityhuman_enumbedresult.a(), true);
|
|
|
|
}
|
|
|
|
@@ -55,7 +65,14 @@
|
2019-04-23 04:00:00 +02:00
|
|
|
});
|
2018-11-02 08:31:00 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
+ // CraftBukkit start - moved bed explosion into separate method
|
|
|
|
} else {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private boolean explodeBed(IBlockData iblockdata, World world, BlockPosition blockposition) {
|
2019-04-23 04:00:00 +02:00
|
|
|
world.a(blockposition, false);
|
2018-11-02 08:31:00 +01:00
|
|
|
BlockPosition blockposition1 = blockposition.shift(((EnumDirection) iblockdata.get(BlockBed.FACING)).opposite());
|
|
|
|
|
2019-04-25 04:00:00 +02:00
|
|
|
@@ -65,8 +82,7 @@
|
2018-11-02 08:31:00 +01:00
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
world.createExplosion((Entity) null, DamageSource.a(), (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, 5.0F, true, Explosion.Effect.DESTROY);
|
2018-11-02 08:31:00 +01:00
|
|
|
return true;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
}
|
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
@Override
|