RedstoneTorch MaterialData + Redstone interface
This commit is contained in:
parent
3f5d5276e2
commit
2e7c22c42b
15
src/main/java/org/bukkit/material/Redstone.java
Normal file
15
src/main/java/org/bukkit/material/Redstone.java
Normal file
@ -0,0 +1,15 @@
|
||||
|
||||
package org.bukkit.material;
|
||||
|
||||
/**
|
||||
* Indicated a Material that may carry or create a Redstone current
|
||||
*/
|
||||
public interface Redstone {
|
||||
/**
|
||||
* Gets the current state of this Material, indicating if it's powered or
|
||||
* unpowered
|
||||
*
|
||||
* @return true if powered, otherwise false
|
||||
*/
|
||||
public boolean isPowered();
|
||||
}
|
35
src/main/java/org/bukkit/material/RedstoneTorch.java
Normal file
35
src/main/java/org/bukkit/material/RedstoneTorch.java
Normal file
@ -0,0 +1,35 @@
|
||||
|
||||
package org.bukkit.material;
|
||||
|
||||
import org.bukkit.Material;
|
||||
|
||||
/**
|
||||
* Represents a redstone torch
|
||||
*/
|
||||
public class RedstoneTorch extends Torch implements Redstone {
|
||||
public RedstoneTorch(final int type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
public RedstoneTorch(final Material type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
public RedstoneTorch(final int type, final byte data) {
|
||||
super(type, data);
|
||||
}
|
||||
|
||||
public RedstoneTorch(final Material type, final byte data) {
|
||||
super(type, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current state of this Material, indicating if it's powered or
|
||||
* unpowered
|
||||
*
|
||||
* @return true if powered, otherwise false
|
||||
*/
|
||||
public boolean isPowered() {
|
||||
return getItemType() == Material.REDSTONE_TORCH_ON;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user