Files
Paper/paper-api/src/main/java/org/bukkit/material/Command.java
Aikar 2825ece820 Fix Spigot annotation mistakes
while some of these may of been true, they are extreme cases and cause
a ton of noise to plugin developers.

Use ApiStatus.Internal instead of Deprecated for actual internal API
that continues to have use (internally).

These do not help plugin developers if they bring moise noise than value.
2019-03-24 18:39:01 -04:00

62 lines
1.4 KiB
Java

package org.bukkit.material;
import org.bukkit.Material;
/**
* Represents a command block
*
* @deprecated all usage of MaterialData is deprecated and subject to removal.
* Use {@link org.bukkit.block.data.BlockData}.
*/
@Deprecated(since = "1.13", forRemoval = true)
public class Command extends MaterialData implements Redstone {
public Command() {
super(Material.LEGACY_COMMAND);
}
public Command(final Material type) {
super(type);
}
/**
* @param type the type
* @param data the raw data value
* @deprecated Magic value
*/
@Deprecated(since = "1.6.2")
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
*/
@Override
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();
}
}