Files
DeltaZern/paper-api/src/main/java/org/bukkit/material/ExtendedRails.java
T
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

63 lines
1.6 KiB
Java

package org.bukkit.material;
import org.bukkit.Material;
import org.bukkit.block.BlockFace;
/**
* This is the superclass for the {@link DetectorRail} and {@link PoweredRail}
* classes
*
* @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 ExtendedRails extends Rails {
public ExtendedRails(final Material type) {
super(type);
}
/**
* @param type the type
* @param data the raw data value
* @deprecated Magic value
*/
@Deprecated(since = "1.6.2")
public ExtendedRails(final Material type, final byte data) {
super(type, data);
}
@Override
public boolean isCurve() {
return false;
}
/**
* {@inheritDoc}
*
* @deprecated Magic value
*/
@Deprecated(since = "1.6.2")
@Override
protected byte getConvertedData() {
return (byte) (getData() & 0x7);
}
@Override
public void setDirection(BlockFace face, boolean isOnSlope) {
boolean extraBitSet = (getData() & 0x8) == 0x8;
if (face != BlockFace.WEST && face != BlockFace.EAST && face != BlockFace.NORTH && face != BlockFace.SOUTH) {
throw new IllegalArgumentException("Detector rails and powered rails cannot be set on a curve!");
}
super.setDirection(face, isOnSlope);
setData((byte) (extraBitSet ? (getData() | 0x8) : (getData() & ~0x8)));
}
@Override
public ExtendedRails clone() {
return (ExtendedRails) super.clone();
}
}