Added new Materials

By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
Bukkit/Spigot
2011-05-26 06:28:24 +01:00
parent 6778c953f4
commit 63a68b3e10
2 changed files with 48 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
package org.bukkit.material;
import org.bukkit.Material;
/**
* Represents a trap door
*/
public class TrapDoor extends MaterialData implements Redstone {
public TrapDoor() {
super(Material.TRAP_DOOR);
}
public TrapDoor(final int type) {
super(type);
}
public TrapDoor(final Material type) {
super(type);
}
public TrapDoor(final int type, final byte data) {
super(type, data);
}
public TrapDoor(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 (getData() & 0x8) == 0x8;
}
@Override
public String toString() {
return super.toString() + "[powered=" + isPowered() + "]";
}
}