Upstream Paper

This commit is contained in:
Sotr
2019-03-21 02:58:59 +08:00
parent cc8cb0bb4c
commit 6498e68a50
28 changed files with 263 additions and 282 deletions

View File

@@ -1319,12 +1319,16 @@ public abstract class EntityHuman extends EntityLiving {
public EntityHuman.EnumBedResult a(BlockPosition blockposition, boolean force) {
EnumDirection enumdirection = (EnumDirection) this.world.getType(blockposition).get(BlockFacingHorizontal.FACING);
EntityHuman.EnumBedResult bedResult = force ? EnumBedResult.OK : this.getBedResult(blockposition, enumdirection);
EntityHuman.EnumBedResult bedResult = this.getBedResult(blockposition, enumdirection);
if (bedResult == EntityHuman.EnumBedResult.OTHER_PROBLEM) {
return bedResult; // return immediately if the result is not bypassable by plugins
}
if (force) {
bedResult = EnumBedResult.OK;
}
if (this.getBukkitEntity() instanceof Player) {
bedResult = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerBedEnterEvent(this, blockposition, bedResult);