From 254a07415d30e04f2c86de31db852ec4bb0893c7 Mon Sep 17 00:00:00 2001 From: SoSeDiK Date: Fri, 14 Oct 2022 11:37:01 +0300 Subject: [PATCH] Allow changing bed's 'occupied' property (#8458) --- ...low-changing-bed-s-occupied-property.patch | 26 +++++++++++++ ...low-changing-bed-s-occupied-property.patch | 38 +++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 patches/api/Allow-changing-bed-s-occupied-property.patch create mode 100644 patches/server/Allow-changing-bed-s-occupied-property.patch diff --git a/patches/api/Allow-changing-bed-s-occupied-property.patch b/patches/api/Allow-changing-bed-s-occupied-property.patch new file mode 100644 index 0000000000..0c6c0a5674 --- /dev/null +++ b/patches/api/Allow-changing-bed-s-occupied-property.patch @@ -0,0 +1,26 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: SoSeDiK +Date: Wed, 12 Oct 2022 00:36:55 +0300 +Subject: [PATCH] Allow changing bed's 'occupied' property + + +diff --git a/src/main/java/org/bukkit/block/data/type/Bed.java b/src/main/java/org/bukkit/block/data/type/Bed.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/block/data/type/Bed.java ++++ b/src/main/java/org/bukkit/block/data/type/Bed.java +@@ -0,0 +0,0 @@ public interface Bed extends Directional { + */ + boolean isOccupied(); + ++ // Paper start ++ /** ++ * Sets the value of the 'occupied' property. ++ * ++ * @param occupied the new 'occupied' value ++ */ ++ void setOccupied(boolean occupied); ++ // Paper end ++ + /** + * Horizontal half of a bed. + */ diff --git a/patches/server/Allow-changing-bed-s-occupied-property.patch b/patches/server/Allow-changing-bed-s-occupied-property.patch new file mode 100644 index 0000000000..a855243dbf --- /dev/null +++ b/patches/server/Allow-changing-bed-s-occupied-property.patch @@ -0,0 +1,38 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: SoSeDiK +Date: Wed, 12 Oct 2022 00:36:55 +0300 +Subject: [PATCH] Allow changing bed's 'occupied' property + + +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftBed.java b/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftBed.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftBed.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftBed.java +@@ -0,0 +0,0 @@ public abstract class CraftBed extends CraftBlockData implements Bed { + public boolean isOccupied() { + return get(CraftBed.OCCUPIED); + } ++ ++ // Paper start ++ @Override ++ public void setOccupied(boolean occupied) { ++ set(CraftBed.OCCUPIED, occupied); ++ } ++ // Paper end + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftBed.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftBed.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftBed.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftBed.java +@@ -0,0 +0,0 @@ public final class CraftBed extends org.bukkit.craftbukkit.block.data.CraftBlock + public java.util.Set getFaces() { + return getValues(CraftBed.FACING, org.bukkit.block.BlockFace.class); + } ++ ++ // Paper start ++ @Override ++ public void setOccupied(boolean occupied) { ++ set(CraftBed.OCCUPIED, occupied); ++ } ++ // Paper end + }