Update Bukkit for Minecraft 1.4(.2) changes.
By: Travis Watkins <amaranth@ubuntu.com>
This commit is contained in:
59
paper-api/src/main/java/org/bukkit/material/Command.java
Normal file
59
paper-api/src/main/java/org/bukkit/material/Command.java
Normal 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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user