mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-14 19:55:52 -07:00
Pulling all pending Bukkit-JavaDoc changes
A special thanks goes to @aerouk for almost all of the changes found here. By: Wesley Wolfe <weswolf@aol.com>
This commit is contained in:
@@ -69,7 +69,7 @@ public class Door extends MaterialData implements Directional, Openable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure this part of the door to be either the top or the bottom half;
|
||||
* Configure this part of the door to be either the top or the bottom half
|
||||
*
|
||||
* @param isTopHalf True to make it the top half.
|
||||
* @deprecated Shouldn't be used anymore
|
||||
|
@@ -4,7 +4,8 @@ import org.bukkit.Material;
|
||||
import org.bukkit.block.BlockFace;
|
||||
|
||||
/**
|
||||
* This is the superclass for the {@link DetectorRail} and {@link PoweredRail} classes
|
||||
* This is the superclass for the {@link DetectorRail} and {@link PoweredRail}
|
||||
* classes
|
||||
*/
|
||||
public class ExtendedRails extends Rails {
|
||||
/**
|
||||
|
@@ -50,7 +50,8 @@ public class FlowerPot extends MaterialData {
|
||||
/**
|
||||
* Get the material in the flower pot
|
||||
*
|
||||
* @return material MaterialData for the block currently in the flower pot or null if empty
|
||||
* @return material MaterialData for the block currently in the flower pot
|
||||
* or null if empty
|
||||
*/
|
||||
public MaterialData getContents() {
|
||||
switch (getData()) {
|
||||
|
@@ -6,6 +6,7 @@ import org.bukkit.Material;
|
||||
* Represents a furnace or dispenser, two types of directional containers
|
||||
*/
|
||||
public class FurnaceAndDispenser extends DirectionalContainer {
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated Magic value
|
||||
|
@@ -90,11 +90,13 @@ public class Mushroom extends MaterialData {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a face of the block to be painted or not. Note that due to the nature of how the data is stored,
|
||||
* setting a face painted or not is not guaranteed to leave the other faces unchanged.
|
||||
* Set a face of the block to be painted or not. Note that due to the
|
||||
* nature of how the data is stored, setting a face painted or not is not
|
||||
* guaranteed to leave the other faces unchanged.
|
||||
*
|
||||
* @param face The face to paint or unpaint.
|
||||
* @param painted True if you want to paint it, false if you want the pores to show.
|
||||
* @param painted True if you want to paint it, false if you want the
|
||||
* pores to show.
|
||||
*/
|
||||
public void setFacePainted(BlockFace face, boolean painted) {
|
||||
if (painted == isFacePainted(face)) {
|
||||
@@ -154,7 +156,8 @@ public class Mushroom extends MaterialData {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return A set of all faces that are currently painted (an empty set if it is a stem)
|
||||
* @return A set of all faces that are currently painted (an empty set if
|
||||
* it is a stem)
|
||||
*/
|
||||
public Set<BlockFace> getPaintedFaces() {
|
||||
EnumSet<BlockFace> faces = EnumSet.noneOf(BlockFace.class);
|
||||
|
@@ -1,99 +1,99 @@
|
||||
package org.bukkit.material;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.NetherWartsState;
|
||||
|
||||
/**
|
||||
* Represents nether wart
|
||||
*/
|
||||
public class NetherWarts extends MaterialData {
|
||||
public NetherWarts() {
|
||||
super(Material.NETHER_WARTS);
|
||||
}
|
||||
|
||||
public NetherWarts(NetherWartsState state) {
|
||||
this();
|
||||
setState(state);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated Magic value
|
||||
*/
|
||||
@Deprecated
|
||||
public NetherWarts(final int type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
public NetherWarts(final Material type) {
|
||||
super (type);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated Magic value
|
||||
*/
|
||||
@Deprecated
|
||||
public NetherWarts(final int type, final byte data) {
|
||||
super(type, data);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated Magic value
|
||||
*/
|
||||
@Deprecated
|
||||
public NetherWarts(final Material type, final byte data) {
|
||||
super(type, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current growth state of this nether wart
|
||||
*
|
||||
* @return NetherWartsState of this nether wart
|
||||
*/
|
||||
public NetherWartsState getState() {
|
||||
switch (getData()) {
|
||||
case 0:
|
||||
return NetherWartsState.SEEDED;
|
||||
case 1:
|
||||
return NetherWartsState.STAGE_ONE;
|
||||
case 2:
|
||||
return NetherWartsState.STAGE_TWO;
|
||||
default:
|
||||
return NetherWartsState.RIPE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the growth state of this nether wart
|
||||
*
|
||||
* @param state New growth state of this nether wart
|
||||
*/
|
||||
public void setState(NetherWartsState state) {
|
||||
switch (state) {
|
||||
case SEEDED:
|
||||
setData((byte) 0x0);
|
||||
return;
|
||||
case STAGE_ONE:
|
||||
setData((byte) 0x1);
|
||||
return;
|
||||
case STAGE_TWO:
|
||||
setData((byte) 0x2);
|
||||
return;
|
||||
case RIPE:
|
||||
setData((byte) 0x3);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getState() + " " + super.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public NetherWarts clone() {
|
||||
return (NetherWarts) super.clone();
|
||||
}
|
||||
}
|
||||
package org.bukkit.material;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.NetherWartsState;
|
||||
|
||||
/**
|
||||
* Represents nether wart
|
||||
*/
|
||||
public class NetherWarts extends MaterialData {
|
||||
public NetherWarts() {
|
||||
super(Material.NETHER_WARTS);
|
||||
}
|
||||
|
||||
public NetherWarts(NetherWartsState state) {
|
||||
this();
|
||||
setState(state);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated Magic value
|
||||
*/
|
||||
@Deprecated
|
||||
public NetherWarts(final int type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
public NetherWarts(final Material type) {
|
||||
super (type);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated Magic value
|
||||
*/
|
||||
@Deprecated
|
||||
public NetherWarts(final int type, final byte data) {
|
||||
super(type, data);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated Magic value
|
||||
*/
|
||||
@Deprecated
|
||||
public NetherWarts(final Material type, final byte data) {
|
||||
super(type, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current growth state of this nether wart
|
||||
*
|
||||
* @return NetherWartsState of this nether wart
|
||||
*/
|
||||
public NetherWartsState getState() {
|
||||
switch (getData()) {
|
||||
case 0:
|
||||
return NetherWartsState.SEEDED;
|
||||
case 1:
|
||||
return NetherWartsState.STAGE_ONE;
|
||||
case 2:
|
||||
return NetherWartsState.STAGE_TWO;
|
||||
default:
|
||||
return NetherWartsState.RIPE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the growth state of this nether wart
|
||||
*
|
||||
* @param state New growth state of this nether wart
|
||||
*/
|
||||
public void setState(NetherWartsState state) {
|
||||
switch (state) {
|
||||
case SEEDED:
|
||||
setData((byte) 0x0);
|
||||
return;
|
||||
case STAGE_ONE:
|
||||
setData((byte) 0x1);
|
||||
return;
|
||||
case STAGE_TWO:
|
||||
setData((byte) 0x2);
|
||||
return;
|
||||
case RIPE:
|
||||
setData((byte) 0x3);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getState() + " " + super.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public NetherWarts clone() {
|
||||
return (NetherWarts) super.clone();
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package org.bukkit.material;
|
||||
|
||||
public interface Openable {
|
||||
|
||||
/**
|
||||
* Check to see if the door is open.
|
||||
*
|
||||
|
@@ -62,11 +62,11 @@ public class Rails extends MaterialData {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the direction these tracks are set <br>
|
||||
* 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.
|
||||
* @return the direction these tracks are set
|
||||
* <p>
|
||||
* 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.
|
||||
*/
|
||||
public BlockFace getDirection() {
|
||||
byte d = getConvertedData();
|
||||
@@ -111,7 +111,9 @@ public class Rails extends MaterialData {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the data without the extended properties used by {@link PoweredRail} and {@link DetectorRail}. Overridden in {@link ExtendedRails}
|
||||
* Return the data without the extended properties used by {@link
|
||||
* PoweredRail} and {@link DetectorRail}. Overridden in {@link
|
||||
* ExtendedRails}
|
||||
*
|
||||
* @return the data without the extended part
|
||||
* @deprecated Magic value
|
||||
@@ -122,11 +124,11 @@ public class Rails extends MaterialData {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the direction of these tracks<br>
|
||||
* 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 should
|
||||
* be supplied.
|
||||
* Set the direction of these tracks
|
||||
* <p>
|
||||
* 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 should be supplied.
|
||||
*
|
||||
* @param face the direction the track should be facing
|
||||
* @param isOnSlope whether or not the track should be on a slope
|
||||
|
@@ -45,8 +45,8 @@ public class Sign extends MaterialData implements Attachable {
|
||||
/**
|
||||
* Check if this sign is attached to a wall
|
||||
*
|
||||
* @return true if this sign is attached to a wall, false if set on top of a
|
||||
* block
|
||||
* @return true if this sign is attached to a wall, false if set on top of
|
||||
* a block
|
||||
*/
|
||||
public boolean isWallSign() {
|
||||
return getItemType() == Material.WALL_SIGN;
|
||||
|
@@ -115,7 +115,8 @@ public class Stairs extends MaterialData implements Directional {
|
||||
/**
|
||||
* Set step inverted state
|
||||
*
|
||||
* @param inv - true if step is inverted (top half), false if step is normal (bottom half)
|
||||
* @param inv - true if step is inverted (top half), false if step is
|
||||
* normal (bottom half)
|
||||
*/
|
||||
public void setInverted(boolean inv) {
|
||||
int dat = getData() & 0x3;
|
||||
|
@@ -76,7 +76,8 @@ public class Step extends TexturedMaterial {
|
||||
/**
|
||||
* Set step inverted state
|
||||
*
|
||||
* @param inv - true if step is inverted (top half), false if step is normal (bottom half)
|
||||
* @param inv - true if step is inverted (top half), false if step is
|
||||
* normal (bottom half)
|
||||
*/
|
||||
public void setInverted(boolean inv) {
|
||||
int dat = getData() & 0x7;
|
||||
|
@@ -41,7 +41,8 @@ public abstract class TexturedMaterial extends MaterialData {
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a list of possible textures. The first element of the list will be used as a default.
|
||||
* Retrieve a list of possible textures. The first element of the list
|
||||
* will be used as a default.
|
||||
*
|
||||
* @return a list of possible textures for this block
|
||||
*/
|
||||
|
@@ -75,7 +75,13 @@ public class Tree extends MaterialData {
|
||||
/**
|
||||
* Get direction of the log
|
||||
*
|
||||
* @return BlockFace.TOP for upright (default), BlockFace.NORTH (east-west), BlockFace.WEST (north-sout), BlockFace.SELF (directionless)
|
||||
* @return one of:
|
||||
* <ul>
|
||||
* <li>BlockFace.TOP for upright (default)
|
||||
* <li>BlockFace.NORTH (east-west)
|
||||
* <li>BlockFace.WEST (north-south)
|
||||
* <li>BlockFace.SELF (directionless)
|
||||
* </ul>
|
||||
*/
|
||||
public BlockFace getDirection() {
|
||||
switch ((getData() >> 2) & 0x3) {
|
||||
|
@@ -68,8 +68,9 @@ public class Vine extends MaterialData {
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the vine is attached to the specified face of an adjacent block. You can
|
||||
* check two faces at once by passing eg {@link BlockFace#NORTH_EAST}.
|
||||
* Check if the vine is attached to the specified face of an adjacent
|
||||
* block. You can check two faces at once by passing e.g. {@link
|
||||
* BlockFace#NORTH_EAST}.
|
||||
*
|
||||
* @param face The face to check.
|
||||
* @return Whether it is attached to that face.
|
||||
|
@@ -80,7 +80,8 @@ public class WoodenStep extends MaterialData {
|
||||
/**
|
||||
* Set step inverted state
|
||||
*
|
||||
* @param inv - true if step is inverted (top half), false if step is normal (bottom half)
|
||||
* @param inv - true if step is inverted (top half), false if step is
|
||||
* normal (bottom half)
|
||||
*/
|
||||
public void setInverted(boolean inv) {
|
||||
int dat = getData() & 0x7;
|
||||
|
Reference in New Issue
Block a user