mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-08 03:22:19 +01:00
Add FaceAttachable interface to handle Grindstone facing in common with Switches
By: md_5 <git@md-5.net>
This commit is contained in:
parent
6546b51b70
commit
1628402608
4 changed files with 64 additions and 9 deletions
|
@ -44,6 +44,7 @@ import org.bukkit.block.data.type.Fire;
|
||||||
import org.bukkit.block.data.type.Furnace;
|
import org.bukkit.block.data.type.Furnace;
|
||||||
import org.bukkit.block.data.type.Gate;
|
import org.bukkit.block.data.type.Gate;
|
||||||
import org.bukkit.block.data.type.GlassPane;
|
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.Hopper;
|
||||||
import org.bukkit.block.data.type.Jukebox;
|
import org.bukkit.block.data.type.Jukebox;
|
||||||
import org.bukkit.block.data.type.Ladder;
|
import org.bukkit.block.data.type.Ladder;
|
||||||
|
@ -1006,9 +1007,9 @@ public enum Material implements Keyed {
|
||||||
GREEN_WALL_BANNER(15046, Directional.class),
|
GREEN_WALL_BANNER(15046, Directional.class),
|
||||||
GREEN_WOOL(25085),
|
GREEN_WOOL(25085),
|
||||||
/**
|
/**
|
||||||
* BlockData: {@link Directional}
|
* BlockData: {@link Grindstone}
|
||||||
*/
|
*/
|
||||||
GRINDSTONE(26260, Directional.class),
|
GRINDSTONE(26260, Grindstone.class),
|
||||||
GUARDIAN_SPAWN_EGG(20113),
|
GUARDIAN_SPAWN_EGG(20113),
|
||||||
GUNPOWDER(29974),
|
GUNPOWDER(29974),
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -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.
|
||||||
|
* <br>
|
||||||
|
* 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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -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 {
|
||||||
|
}
|
|
@ -1,35 +1,37 @@
|
||||||
package org.bukkit.block.data.type;
|
package org.bukkit.block.data.type;
|
||||||
|
|
||||||
import org.bukkit.block.data.Directional;
|
import org.bukkit.block.data.Directional;
|
||||||
|
import org.bukkit.block.data.FaceAttachable;
|
||||||
import org.bukkit.block.data.Powerable;
|
import org.bukkit.block.data.Powerable;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
public interface Switch extends Directional, FaceAttachable, Powerable {
|
||||||
* 'face' represents the face to which a lever or button is stuck.
|
|
||||||
* <br>
|
|
||||||
* This is used in conjunction with {@link Directional} to compute the
|
|
||||||
* orientation of these blocks.
|
|
||||||
*/
|
|
||||||
public interface Switch extends Directional, Powerable {
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the 'face' property.
|
* Gets the value of the 'face' property.
|
||||||
*
|
*
|
||||||
* @return the 'face' value
|
* @return the 'face' value
|
||||||
|
* @deprecated use {@link #getAttachedFace()}
|
||||||
*/
|
*/
|
||||||
@NotNull
|
@NotNull
|
||||||
|
@Deprecated
|
||||||
Face getFace();
|
Face getFace();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of the 'face' property.
|
* Sets the value of the 'face' property.
|
||||||
*
|
*
|
||||||
* @param face the new 'face' value
|
* @param face the new 'face' value
|
||||||
|
* @deprecated use {@link #getAttachedFace()}
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
void setFace(@NotNull Face face);
|
void setFace(@NotNull Face face);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The face to which a switch type block is stuck.
|
* The face to which a switch type block is stuck.
|
||||||
|
*
|
||||||
|
* @deprecated use {@link AttachedFace}
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public enum Face {
|
public enum Face {
|
||||||
/**
|
/**
|
||||||
* The switch is mounted to the floor and pointing upwards.
|
* The switch is mounted to the floor and pointing upwards.
|
||||||
|
|
Loading…
Reference in a new issue