diff options
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/bukkit/block/Beacon.java | 2 | ||||
-rw-r--r-- | src/main/java/org/bukkit/block/BrewingStand.java | 2 | ||||
-rw-r--r-- | src/main/java/org/bukkit/block/Chest.java | 2 | ||||
-rw-r--r-- | src/main/java/org/bukkit/block/Dispenser.java | 2 | ||||
-rw-r--r-- | src/main/java/org/bukkit/block/Dropper.java | 2 | ||||
-rw-r--r-- | src/main/java/org/bukkit/block/Furnace.java | 2 | ||||
-rw-r--r-- | src/main/java/org/bukkit/block/Hopper.java | 2 | ||||
-rw-r--r-- | src/main/java/org/bukkit/block/Lockable.java | 31 |
8 files changed, 38 insertions, 7 deletions
diff --git a/src/main/java/org/bukkit/block/Beacon.java b/src/main/java/org/bukkit/block/Beacon.java index 66410ada..a3af3510 100644 --- a/src/main/java/org/bukkit/block/Beacon.java +++ b/src/main/java/org/bukkit/block/Beacon.java @@ -9,7 +9,7 @@ import org.bukkit.potion.PotionEffectType; /** * Represents a beacon. */ -public interface Beacon extends BlockState, InventoryHolder { +public interface Beacon extends BlockState, InventoryHolder, Lockable { /** * Returns the list of players within the beacon's range of effect. diff --git a/src/main/java/org/bukkit/block/BrewingStand.java b/src/main/java/org/bukkit/block/BrewingStand.java index f642e681..7bc809de 100644 --- a/src/main/java/org/bukkit/block/BrewingStand.java +++ b/src/main/java/org/bukkit/block/BrewingStand.java @@ -6,7 +6,7 @@ import org.bukkit.inventory.InventoryHolder; /** * Represents a brewing stand. */ -public interface BrewingStand extends BlockState, InventoryHolder { +public interface BrewingStand extends BlockState, InventoryHolder, Lockable { /** * How much time is left in the brewing cycle diff --git a/src/main/java/org/bukkit/block/Chest.java b/src/main/java/org/bukkit/block/Chest.java index ee95841d..e941d8bd 100644 --- a/src/main/java/org/bukkit/block/Chest.java +++ b/src/main/java/org/bukkit/block/Chest.java @@ -6,7 +6,7 @@ import org.bukkit.inventory.InventoryHolder; /** * Represents a chest. */ -public interface Chest extends BlockState, InventoryHolder { +public interface Chest extends BlockState, InventoryHolder, Lockable { /** * Returns the chest's inventory. If this is a double chest, it returns diff --git a/src/main/java/org/bukkit/block/Dispenser.java b/src/main/java/org/bukkit/block/Dispenser.java index 4e6b349d..94d360b3 100644 --- a/src/main/java/org/bukkit/block/Dispenser.java +++ b/src/main/java/org/bukkit/block/Dispenser.java @@ -6,7 +6,7 @@ import org.bukkit.projectiles.BlockProjectileSource; /** * Represents a dispenser. */ -public interface Dispenser extends BlockState, InventoryHolder { +public interface Dispenser extends BlockState, InventoryHolder, Lockable { /** * Gets the BlockProjectileSource object for this dispenser. diff --git a/src/main/java/org/bukkit/block/Dropper.java b/src/main/java/org/bukkit/block/Dropper.java index a04fa96a..4d3a5036 100644 --- a/src/main/java/org/bukkit/block/Dropper.java +++ b/src/main/java/org/bukkit/block/Dropper.java @@ -5,7 +5,7 @@ import org.bukkit.inventory.InventoryHolder; /** * Represents a dropper. */ -public interface Dropper extends BlockState, InventoryHolder { +public interface Dropper extends BlockState, InventoryHolder, Lockable { /** * Tries to drop a randomly selected item from the Dropper's inventory, * following the normal behavior of a Dropper. diff --git a/src/main/java/org/bukkit/block/Furnace.java b/src/main/java/org/bukkit/block/Furnace.java index 9c8cd334..d943e34f 100644 --- a/src/main/java/org/bukkit/block/Furnace.java +++ b/src/main/java/org/bukkit/block/Furnace.java @@ -6,7 +6,7 @@ import org.bukkit.inventory.InventoryHolder; /** * Represents a furnace. */ -public interface Furnace extends BlockState, InventoryHolder { +public interface Furnace extends BlockState, InventoryHolder, Lockable { /** * Get burn time. diff --git a/src/main/java/org/bukkit/block/Hopper.java b/src/main/java/org/bukkit/block/Hopper.java index e0971574..978cf2a7 100644 --- a/src/main/java/org/bukkit/block/Hopper.java +++ b/src/main/java/org/bukkit/block/Hopper.java @@ -5,6 +5,6 @@ import org.bukkit.inventory.InventoryHolder; /** * Represents a hopper. */ -public interface Hopper extends BlockState, InventoryHolder { +public interface Hopper extends BlockState, InventoryHolder, Lockable { } diff --git a/src/main/java/org/bukkit/block/Lockable.java b/src/main/java/org/bukkit/block/Lockable.java new file mode 100644 index 00000000..5e9f7614 --- /dev/null +++ b/src/main/java/org/bukkit/block/Lockable.java @@ -0,0 +1,31 @@ +package org.bukkit.block; + +/** + * Represents a block (usually a container) that may be locked. When a lock is + * active an item with a name corresponding to the key will be required to open + * this block. + */ +public interface Lockable { + + /** + * Checks if the container has a valid (non empty) key. + * + * @return true if the key is valid. + */ + boolean isLocked(); + + /** + * Gets the key needed to access the container. + * + * @return the key needed. + */ + String getLock(); + + /** + * Sets the key required to access this container. Set to null (or empty + * string) to remove key. + * + * @param key the key required to access the container. + */ + void setLock(String key); +} |