diff --git a/paper-api/src/main/java/org/bukkit/Material.java b/paper-api/src/main/java/org/bukkit/Material.java index 398e63b12c..f28da6efd0 100644 --- a/paper-api/src/main/java/org/bukkit/Material.java +++ b/paper-api/src/main/java/org/bukkit/Material.java @@ -44,6 +44,7 @@ import org.bukkit.block.data.type.Fire; import org.bukkit.block.data.type.Furnace; import org.bukkit.block.data.type.Gate; import org.bukkit.block.data.type.GlassPane; +import org.bukkit.block.data.type.Grindstone; import org.bukkit.block.data.type.Hopper; import org.bukkit.block.data.type.Jukebox; import org.bukkit.block.data.type.Ladder; @@ -1006,9 +1007,9 @@ public enum Material implements Keyed { GREEN_WALL_BANNER(15046, Directional.class), GREEN_WOOL(25085), /** - * BlockData: {@link Directional} + * BlockData: {@link Grindstone} */ - GRINDSTONE(26260, Directional.class), + GRINDSTONE(26260, Grindstone.class), GUARDIAN_SPAWN_EGG(20113), GUNPOWDER(29974), /** diff --git a/paper-api/src/main/java/org/bukkit/block/data/FaceAttachable.java b/paper-api/src/main/java/org/bukkit/block/data/FaceAttachable.java new file mode 100644 index 0000000000..9599e1237b --- /dev/null +++ b/paper-api/src/main/java/org/bukkit/block/data/FaceAttachable.java @@ -0,0 +1,45 @@ +package org.bukkit.block.data; + +import org.jetbrains.annotations.NotNull; + +/** + * 'face' represents the face to which a lever or button is stuck. + *
+ * This is used in conjunction with {@link Directional} to compute the + * orientation of these blocks. + */ +public interface FaceAttachable extends BlockData { + + /** + * Gets the value of the 'face' property. + * + * @return the 'face' value + */ + @NotNull + AttachedFace getAttachedFace(); + + /** + * Sets the value of the 'face' property. + * + * @param face the new 'face' value + */ + void setAttachedFace(@NotNull AttachedFace face); + + /** + * The face to which a switch type block is stuck. + */ + public enum AttachedFace { + /** + * The switch is mounted to the floor and pointing upwards. + */ + FLOOR, + /** + * The switch is mounted to the wall. + */ + WALL, + /** + * The switch is mounted to the ceiling and pointing dowanrds. + */ + CEILING; + } +} diff --git a/paper-api/src/main/java/org/bukkit/block/data/type/Grindstone.java b/paper-api/src/main/java/org/bukkit/block/data/type/Grindstone.java new file mode 100644 index 0000000000..db48f66d36 --- /dev/null +++ b/paper-api/src/main/java/org/bukkit/block/data/type/Grindstone.java @@ -0,0 +1,7 @@ +package org.bukkit.block.data.type; + +import org.bukkit.block.data.Directional; +import org.bukkit.block.data.FaceAttachable; + +public interface Grindstone extends Directional, FaceAttachable { +} diff --git a/paper-api/src/main/java/org/bukkit/block/data/type/Switch.java b/paper-api/src/main/java/org/bukkit/block/data/type/Switch.java index 1060cb55b6..be06f8db02 100644 --- a/paper-api/src/main/java/org/bukkit/block/data/type/Switch.java +++ b/paper-api/src/main/java/org/bukkit/block/data/type/Switch.java @@ -1,35 +1,37 @@ package org.bukkit.block.data.type; import org.bukkit.block.data.Directional; +import org.bukkit.block.data.FaceAttachable; import org.bukkit.block.data.Powerable; import org.jetbrains.annotations.NotNull; -/** - * 'face' represents the face to which a lever or button is stuck. - *
- * This is used in conjunction with {@link Directional} to compute the - * orientation of these blocks. - */ -public interface Switch extends Directional, Powerable { +public interface Switch extends Directional, FaceAttachable, Powerable { /** * Gets the value of the 'face' property. * * @return the 'face' value + * @deprecated use {@link #getAttachedFace()} */ @NotNull + @Deprecated Face getFace(); /** * Sets the value of the 'face' property. * * @param face the new 'face' value + * @deprecated use {@link #getAttachedFace()} */ + @Deprecated void setFace(@NotNull Face face); /** * The face to which a switch type block is stuck. + * + * @deprecated use {@link AttachedFace} */ + @Deprecated public enum Face { /** * The switch is mounted to the floor and pointing upwards.