mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
RedstoneTorch MaterialData + Redstone interface
By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
parent
da00145da7
commit
7314f0ade2
2 changed files with 50 additions and 0 deletions
15
paper-api/src/main/java/org/bukkit/material/Redstone.java
Normal file
15
paper-api/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();
|
||||
}
|
|
@ -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…
Reference in a new issue