Package org.bukkit.material
Class Rails
java.lang.Object
org.bukkit.material.MaterialData
org.bukkit.material.Rails
- All Implemented Interfaces:
java.lang.Cloneable
- Direct Known Subclasses:
ExtendedRails
public class Rails extends MaterialData
Represents minecart rails.
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description Rails
clone()
protected byte
getConvertedData()
Deprecated.Magic valueBlockFace
getDirection()
boolean
isCurve()
boolean
isOnSlope()
void
setDirection(BlockFace face, boolean isOnSlope)
Set the direction of these tracksjava.lang.String
toString()
Methods inherited from class org.bukkit.material.MaterialData
equals, getData, getItemType, getItemTypeId, hashCode, setData, toItemStack, toItemStack
-
Constructor Details
-
Rails
public Rails() -
Rails
@Deprecated public Rails(int type)Deprecated.Magic value- Parameters:
type
- the raw type id
-
Rails
-
Rails
@Deprecated public Rails(int type, byte data)Deprecated.Magic value- Parameters:
type
- the raw type iddata
- the raw data value
-
Rails
Deprecated.Magic value- Parameters:
type
- the typedata
- the raw data value
-
-
Method Details
-
isOnSlope
public boolean isOnSlope()- Returns:
- the whether this track is set on a slope
-
isCurve
public boolean isCurve()- Returns:
- the whether this track is set as a curve
-
getDirection
- Returns:
- the direction these tracks are set
Note that tracks are bidirectional and that the direction returned is the ascending direction if the track is set on a slope. If it is set as a curve, the corner of the track is returned.
-
toString
public java.lang.String toString()- Overrides:
toString
in classMaterialData
-
getConvertedData
@Deprecated protected byte getConvertedData()Deprecated.Magic valueReturn the data without the extended properties used byPoweredRail
andDetectorRail
. Overridden inExtendedRails
- Returns:
- the data without the extended part
-
setDirection
Set the direction of these tracksNote that tracks are bidirectional and that the direction returned is the ascending direction if the track is set on a slope. If it is set as a curve, the corner of the track should be supplied.
- Parameters:
face
- the direction the track should be facingisOnSlope
- whether or not the track should be on a slope
-
clone
- Overrides:
clone
in classMaterialData
-