Update Bukkit for Minecraft 1.4(.2) changes.

By: Travis Watkins <amaranth@ubuntu.com>
This commit is contained in:
Bukkit/Spigot
2012-10-22 03:30:04 -05:00
parent 93362adea2
commit c73a3c02f0
23 changed files with 486 additions and 34 deletions

View File

@@ -0,0 +1,59 @@
package org.bukkit.material;
import org.bukkit.block.BlockFace;
import org.bukkit.Material;
/**
* Represents a command block
*/
public class Command extends MaterialData implements Redstone {
public Command() {
super(Material.COMMAND);
}
public Command(final int type) {
super(type);
}
public Command(final Material type) {
super(type);
}
public Command(final int type, final byte data) {
super(type, data);
}
public Command(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() & 1) != 0;
}
/**
* Sets the current state of this Material
*
* @param bool
* whether or not the command block is powered
*/
public void setPowered(boolean bool) {
setData((byte) (bool ? (getData() | 1) : (getData() & -2)));
}
@Override
public String toString() {
return super.toString() + " " + (isPowered() ? "" : "NOT ") + "POWERED";
}
@Override
public Command clone() {
return (Command) super.clone();
}
}