Deprecate magic values

By: Wesley Wolfe <weswolf@aol.com>
This commit is contained in:
Bukkit/Spigot 2013-08-19 13:32:18 -05:00
parent d9f3848e22
commit f9bec6eadd
108 changed files with 1194 additions and 11 deletions

View file

@ -53,7 +53,9 @@ public enum Achievement {
* Note that this is offset using {@link #STATISTIC_OFFSET}
*
* @return ID of this achievement
* @deprecated Magic value
*/
@Deprecated
public int getId() {
return id;
}
@ -65,7 +67,9 @@ public enum Achievement {
*
* @param id ID of the achievement to return
* @return Achievement with the given ID
* @deprecated Magic value
*/
@Deprecated
public static Achievement getById(int id) {
return BY_ID.get(id);
}

View file

@ -69,7 +69,9 @@ public enum Art {
* Get the ID of this painting.
*
* @return The ID of this painting
* @deprecated Magic value
*/
@Deprecated
public int getId() {
return id;
}
@ -79,7 +81,9 @@ public enum Art {
*
* @param id The ID
* @return The painting
* @deprecated Magic value
*/
@Deprecated
public static Art getById(int id) {
return BY_ID.get(id);
}

View file

@ -16,7 +16,9 @@ public interface BlockChangeDelegate {
* @param z Z coordinate
* @param typeId New block ID
* @return true if the block was set successfully
* @deprecated Magic value
*/
@Deprecated
public boolean setRawTypeId(int x, int y, int z, int typeId);
/**
@ -29,7 +31,9 @@ public interface BlockChangeDelegate {
* @param typeId New block ID
* @param data Block data
* @return true if the block was set successfully
* @deprecated Magic value
*/
@Deprecated
public boolean setRawTypeIdAndData(int x, int y, int z, int typeId, int data);
/**
@ -41,7 +45,9 @@ public interface BlockChangeDelegate {
* @param z Z coordinate
* @param typeId New block ID
* @return true if the block was set successfully
* @deprecated Magic value
*/
@Deprecated
public boolean setTypeId(int x, int y, int z, int typeId);
/**
@ -54,7 +60,9 @@ public interface BlockChangeDelegate {
* @param typeId New block ID
* @param data Block data
* @return true if the block was set successfully
* @deprecated Magic value
*/
@Deprecated
public boolean setTypeIdAndData(int x, int y, int z, int typeId, int data);
/**
@ -64,7 +72,9 @@ public interface BlockChangeDelegate {
* @param y Y coordinate
* @param z Z coordinate
* @return The block ID
* @deprecated Magic value
*/
@Deprecated
public int getTypeId(int x, int y, int z);
/**

View file

@ -256,7 +256,9 @@ public final class Bukkit {
/**
* @see Server#getMap(short id)
* @deprecated Magic value
*/
@Deprecated
public static MapView getMap(short id) {
return server.getMap(id);
}

View file

@ -36,7 +36,9 @@ public interface ChunkSnapshot {
* @param y 0-127
* @param z 0-15
* @return 0-255
* @deprecated Magic value
*/
@Deprecated
int getBlockTypeId(int x, int y, int z);
/**
@ -46,7 +48,9 @@ public interface ChunkSnapshot {
* @param y 0-127
* @param z 0-15
* @return 0-15
* @deprecated Magic value
*/
@Deprecated
int getBlockData(int x, int y, int z);
/**

View file

@ -22,7 +22,9 @@ public enum CoalType {
* Gets the associated data value representing this type of coal
*
* @return A byte containing the data value of this coal type
* @deprecated Magic value
*/
@Deprecated
public byte getData() {
return data;
}
@ -34,7 +36,9 @@ public enum CoalType {
* Data value to fetch
* @return The {@link CoalType} representing the given value, or null if
* it doesn't exist
* @deprecated Magic value
*/
@Deprecated
public static CoalType getByData(final byte data) {
return BY_DATA.get(data);
}

View file

@ -53,7 +53,9 @@ public enum CropState {
* Gets the associated data value representing this growth state
*
* @return A byte containing the data value of this growth state
* @deprecated Magic value
*/
@Deprecated
public byte getData() {
return data;
}
@ -65,7 +67,9 @@ public enum CropState {
* Data value to fetch
* @return The {@link CropState} representing the given value, or null if
* it doesn't exist
* @deprecated Magic value
*/
@Deprecated
public static CropState getByData(final byte data) {
return BY_DATA.get(data);
}

View file

@ -39,7 +39,9 @@ public enum Difficulty {
* Gets the difficulty value associated with this Difficulty.
*
* @return An integer value of this difficulty
* @deprecated Magic value
*/
@Deprecated
public int getValue() {
return value;
}
@ -49,7 +51,9 @@ public enum Difficulty {
*
* @param value Value to check
* @return Associative {@link Difficulty} with the given value, or null if it doesn't exist
* @deprecated Magic value
*/
@Deprecated
public static Difficulty getByValue(final int value) {
return BY_ID.get(value);
}

View file

@ -108,7 +108,9 @@ public enum DyeColor {
*
* @return A byte containing the wool data value of this color
* @see #getDyeData()
* @deprecated Magic value
*/
@Deprecated
public byte getWoolData() {
return woolData;
}
@ -118,7 +120,9 @@ public enum DyeColor {
*
* @return A byte containing the dye data value of this color
* @see #getWoolData()
* @deprecated Magic value
*/
@Deprecated
public byte getDyeData() {
return dyeData;
}
@ -161,7 +165,9 @@ public enum DyeColor {
* @param data Wool data value to fetch
* @return The {@link DyeColor} representing the given value, or null if it doesn't exist
* @see #getByDyeData(byte)
* @deprecated Magic value
*/
@Deprecated
public static DyeColor getByWoolData(final byte data) {
int i = 0xff & data;
if (i >= BY_WOOL_DATA.length) {
@ -176,7 +182,9 @@ public enum DyeColor {
* @param data Dye data value to fetch
* @return The {@link DyeColor} representing the given value, or null if it doesn't exist
* @see #getByWoolData(byte)
* @deprecated Magic value
*/
@Deprecated
public static DyeColor getByDyeData(final byte data) {
int i = 0xff & data;
if (i >= BY_DYE_DATA.length) {

View file

@ -99,7 +99,9 @@ public enum Effect {
* Gets the ID for this effect.
*
* @return ID of this effect
* @deprecated Magic value
*/
@Deprecated
public int getId() {
return this.id;
}
@ -123,7 +125,9 @@ public enum Effect {
*
* @param id ID of the Effect to return
* @return Effect with the given ID
* @deprecated Magic value
*/
@Deprecated
public static Effect getById(int id) {
return BY_ID.get(id);
}

View file

@ -58,7 +58,9 @@ public enum EntityEffect {
* Gets the data value of this EntityEffect
*
* @return The data value
* @deprecated Magic value
*/
@Deprecated
public byte getData() {
return data;
}
@ -68,7 +70,9 @@ public enum EntityEffect {
*
* @param data Data value to fetch
* @return The {@link EntityEffect} representing the given value, or null if it doesn't exist
* @deprecated Magic value
*/
@Deprecated
public static EntityEffect getByData(final byte data) {
return BY_DATA.get(data);
}

View file

@ -36,7 +36,9 @@ public enum GameMode {
* Gets the mode value associated with this GameMode
*
* @return An integer value of this gamemode
* @deprecated Magic value
*/
@Deprecated
public int getValue() {
return value;
}
@ -46,7 +48,9 @@ public enum GameMode {
*
* @param value Value to check
* @return Associative {@link GameMode} with the given value, or null if it doesn't exist
* @deprecated Magic value
*/
@Deprecated
public static GameMode getByValue(final int value) {
return BY_ID.get(value);
}

View file

@ -33,7 +33,9 @@ public enum GrassSpecies {
* Gets the associated data value representing this species
*
* @return A byte containing the data value of this grass species
* @deprecated Magic value
*/
@Deprecated
public byte getData() {
return data;
}
@ -45,7 +47,9 @@ public enum GrassSpecies {
* Data value to fetch
* @return The {@link GrassSpecies} representing the given value, or null if
* it doesn't exist
* @deprecated Magic value
*/
@Deprecated
public static GrassSpecies getByData(final byte data) {
return BY_DATA.get(data);
}

View file

@ -36,7 +36,9 @@ public enum Instrument {
/**
* @return The type ID of this instrument.
* @deprecated Magic value
*/
@Deprecated
public byte getType() {
return this.type;
}
@ -46,7 +48,9 @@ public enum Instrument {
*
* @param type The type ID
* @return The instrument
* @deprecated Magic value
*/
@Deprecated
public static Instrument getByType(final byte type) {
return BY_DATA.get(type);
}

View file

@ -16,7 +16,6 @@ import org.bukkit.material.Command;
import org.bukkit.material.Crops;
import org.bukkit.material.DetectorRail;
import org.bukkit.material.Diode;
import org.bukkit.material.DirectionalContainer;
import org.bukkit.material.Dispenser;
import org.bukkit.material.Door;
import org.bukkit.material.Dye;
@ -451,7 +450,9 @@ public enum Material {
* Gets the item ID or block ID of this Material
*
* @return ID of this material
* @deprecated Magic value
*/
@Deprecated
public int getId() {
return id;
}
@ -489,7 +490,9 @@ public enum Material {
*
* @param raw Initial data to construct the MaterialData with
* @return New MaterialData with the given data
* @deprecated Magic value
*/
@Deprecated
public MaterialData getNewData(final byte raw) {
try {
return ctor.newInstance(id, raw);
@ -556,7 +559,9 @@ public enum Material {
*
* @param id ID of the material to get
* @return Material if found, or null
* @deprecated Magic value
*/
@Deprecated
public static Material getMaterial(final int id) {
if (byId.length > id && id >= 0) {
return byId[id];
@ -580,7 +585,9 @@ public enum Material {
/**
* Attempts to match the Material with the given name.
* This is a match lookup; names will be converted to uppercase, then stripped
* of special characters in an attempt to format it like the enum
* of special characters in an attempt to format it like the enum.
* <p>
* Using this for match by ID is deprecated.
*
* @param name Name of the material to get
* @return Material if found, or null

View file

@ -39,7 +39,9 @@ public class Note {
* Returns the not sharped id of this tone.
*
* @return the not sharped id of this tone.
* @deprecated Magic value
*/
@Deprecated
public byte getId() {
return getId(false);
}
@ -51,7 +53,9 @@ public class Note {
*
* @param sharped Set to true to return the sharped id.
* @return the id of this tone.
* @deprecated Magic value
*/
@Deprecated
public byte getId(boolean sharped) {
byte id = (byte) (sharped && sharpable ? this.id + 1 : this.id);
@ -73,7 +77,9 @@ public class Note {
* @param id the id of the tone.
* @return if the tone id is the sharped id of the tone.
* @throws IllegalArgumentException if neither the tone nor the semitone have the id.
* @deprecated Magic value
*/
@Deprecated
public boolean isSharped(byte id) {
if (id == getId(false)) {
return false;
@ -90,7 +96,9 @@ public class Note {
*
* @param id the id of the tone.
* @return the tone to id.
* @deprecated Magic value
*/
@Deprecated
public static Tone getById(byte id) {
return BY_DATA.get(id);
}
@ -197,7 +205,9 @@ public class Note {
* Returns the internal id of this note.
*
* @return the internal id of this note.
* @deprecated Magic value
*/
@Deprecated
public byte getId() {
return note;
}

View file

@ -23,7 +23,9 @@ public enum SandstoneType {
* Gets the associated data value representing this type of sandstone
*
* @return A byte containing the data value of this sandstone type
* @deprecated Magic value
*/
@Deprecated
public byte getData() {
return data;
}
@ -35,7 +37,9 @@ public enum SandstoneType {
* Data value to fetch
* @return The {@link SandstoneType} representing the given value, or null if
* it doesn't exist
* @deprecated Magic value
*/
@Deprecated
public static SandstoneType getByData(final byte data) {
return BY_DATA.get(data);
}

View file

@ -36,6 +36,7 @@ import org.bukkit.inventory.meta.ItemMeta;
* Represents a server implementation
*/
public interface Server extends PluginMessageRecipient {
/**
* Used for all administrative messages, such as an operator using a command.
* <p>
@ -356,7 +357,9 @@ public interface Server extends PluginMessageRecipient {
*
* @param id ID of the map to get.
* @return The MapView if it exists, or null otherwise.
* @deprecated Magic value
*/
@Deprecated
public MapView getMap(short id);
/**

View file

@ -41,7 +41,9 @@ public enum Statistic {
* Gets the ID for this statistic.
*
* @return ID of this statistic
* @deprecated Magic value
*/
@Deprecated
public int getId() {
return id;
}
@ -71,7 +73,9 @@ public enum Statistic {
*
* @param id ID of the statistic to return
* @return statistic with the given ID
* @deprecated Magic value
*/
@Deprecated
public static Statistic getById(int id) {
return BY_ID.get(id);
}

View file

@ -37,7 +37,9 @@ public enum TreeSpecies {
* Gets the associated data value representing this species
*
* @return A byte containing the data value of this tree species
* @deprecated Magic value
*/
@Deprecated
public byte getData() {
return data;
}
@ -48,7 +50,9 @@ public enum TreeSpecies {
* @param data Data value to fetch
* @return The {@link TreeSpecies} representing the given value, or null if
* it doesn't exist
* @deprecated Magic value
*/
@Deprecated
public static TreeSpecies getByData(final byte data) {
return BY_DATA.get(data);
}

View file

@ -15,6 +15,7 @@ import com.google.common.collect.ImmutableMap;
@Target({ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface Warning {
/**
* This represents the states that server verbose for warnings may be.
*/

View file

@ -50,7 +50,9 @@ public interface World extends PluginMessageRecipient, Metadatable {
* @param z Z-coordinate of the block
* @return Type ID of the block at the given coordinates
* @see #getBlockAt(int, int, int) Returns a live Block object at the given location
* @deprecated Magic value
*/
@Deprecated
public int getBlockTypeIdAt(int x, int y, int z);
/**
@ -59,7 +61,9 @@ public interface World extends PluginMessageRecipient, Metadatable {
* @param location Location of the block
* @return Type ID of the block at the given location
* @see #getBlockAt(org.bukkit.Location) Returns a live Block object at the given location
* @deprecated Magic value
*/
@Deprecated
public int getBlockTypeIdAt(Location location);
/**
@ -1094,7 +1098,9 @@ public interface World extends PluginMessageRecipient, Metadatable {
* Gets the dimension ID of this environment
*
* @return dimension ID
* @deprecated Magic value
*/
@Deprecated
public int getId() {
return id;
}
@ -1104,7 +1110,9 @@ public interface World extends PluginMessageRecipient, Metadatable {
*
* @param id The ID of the environment
* @return The environment
* @deprecated Magic value
*/
@Deprecated
public static Environment getEnvironment(int id) {
return lookup.get(id);
}

View file

@ -21,7 +21,9 @@ public interface Block extends Metadatable {
* Gets the metadata for this block
*
* @return block specific metadata
* @deprecated Magic value
*/
@Deprecated
byte getData();
/**
@ -74,7 +76,9 @@ public interface Block extends Metadatable {
* Gets the type-id of this block
*
* @return block type-id
* @deprecated Magic value
*/
@Deprecated
int getTypeId();
/**
@ -156,7 +160,9 @@ public interface Block extends Metadatable {
* Sets the metadata for this block
*
* @param data New block specific metadata
* @deprecated Magic value
*/
@Deprecated
void setData(byte data);
/**
@ -164,7 +170,9 @@ public interface Block extends Metadatable {
*
* @param data New block specific metadata
* @param applyPhysics False to cancel physics from the changed block.
* @deprecated Magic value
*/
@Deprecated
void setData(byte data, boolean applyPhysics);
/**
@ -179,7 +187,9 @@ public interface Block extends Metadatable {
*
* @param type Type-Id to change this block to
* @return whether the block was changed
* @deprecated Magic value
*/
@Deprecated
boolean setTypeId(int type);
/**
@ -188,7 +198,9 @@ public interface Block extends Metadatable {
* @param type Type-Id to change this block to
* @param applyPhysics False to cancel physics on the changed block.
* @return whether the block was changed
* @deprecated Magic value
*/
@Deprecated
boolean setTypeId(int type, boolean applyPhysics);
/**
@ -198,7 +210,9 @@ public interface Block extends Metadatable {
* @param data The data value to change this block to
* @param applyPhysics False to cancel physics on the changed block
* @return whether the block was changed
* @deprecated Magic value
*/
@Deprecated
boolean setTypeIdAndData(int type, byte data, boolean applyPhysics);
/**

View file

@ -42,7 +42,9 @@ public interface BlockState extends Metadatable {
* Gets the type-id of this block
*
* @return block type-id
* @deprecated Magic value
*/
@Deprecated
int getTypeId();
/**
@ -121,7 +123,9 @@ public interface BlockState extends Metadatable {
*
* @param type Type-Id to change this block to
* @return Whether it worked?
* @deprecated Magic value
*/
@Deprecated
boolean setTypeId(int type);
/**
@ -172,11 +176,15 @@ public interface BlockState extends Metadatable {
/**
* @return The data as a raw byte.
* @deprecated Magic value
*/
@Deprecated
public byte getRawData();
/**
* @param data The new data value for the block.
* @deprecated Magic value
*/
@Deprecated
public void setRawData(byte data);
}

View file

@ -6,6 +6,7 @@ import org.bukkit.inventory.Inventory;
* Represents a chest.
*/
public interface Chest extends BlockState, ContainerBlock {
/**
* Returns the chest's inventory. If this is a double chest, it returns just
* the portion of the inventory linked to this half of the chest.

View file

@ -19,7 +19,9 @@ public interface NoteBlock extends BlockState {
* Gets the note.
*
* @return The note ID.
* @deprecated Magic value
*/
@Deprecated
public byte getRawNote();
/**
@ -33,7 +35,9 @@ public interface NoteBlock extends BlockState {
* Set the note.
*
* @param note The note ID.
* @deprecated Magic value
*/
@Deprecated
public void setRawNote(byte note);
/**
@ -51,7 +55,9 @@ public interface NoteBlock extends BlockState {
* @param instrument Instrument ID
* @param note Note ID
* @return true if successful, otherwise false
* @deprecated Magic value
*/
@Deprecated
public boolean play(byte instrument, byte note);
/**

View file

@ -31,7 +31,9 @@ public enum PistonMoveReaction {
/**
* @return The ID of the move reaction
* @deprecated Magic value
*/
@Deprecated
public int getId() {
return this.id;
}
@ -39,7 +41,9 @@ public enum PistonMoveReaction {
/**
* @param id An ID
* @return The move reaction with that ID
* @deprecated Magic value
*/
@Deprecated
public static PistonMoveReaction getById(int id) {
return byId.get(id);
}

View file

@ -133,7 +133,9 @@ public abstract class Enchantment {
* Gets the unique ID of this enchantment
*
* @return Unique ID
* @deprecated Magic value
*/
@Deprecated
public int getId() {
return id;
}
@ -248,7 +250,9 @@ public abstract class Enchantment {
*
* @param id ID to fetch
* @return Resulting Enchantment, or null if not found
* @deprecated Magic value
*/
@Deprecated
public static Enchantment getById(int id) {
return byId.get(id);
}

View file

@ -66,6 +66,11 @@ public enum CreatureType {
return clazz;
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public short getTypeId() {
return typeId;
}
@ -74,6 +79,11 @@ public enum CreatureType {
return NAME_MAP.get(name);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public static CreatureType fromId(int id) {
if (id > Short.MAX_VALUE) {
return null;

View file

@ -197,6 +197,11 @@ public enum EntityType {
}
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public String getName() {
return name;
}
@ -205,10 +210,20 @@ public enum EntityType {
return clazz;
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public short getTypeId() {
return typeId;
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public static EntityType fromName(String name) {
if (name == null) {
return null;
@ -216,6 +231,11 @@ public enum EntityType {
return NAME_MAP.get(name.toLowerCase());
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public static EntityType fromId(int id) {
if (id > Short.MAX_VALUE) {
return null;

View file

@ -6,6 +6,7 @@ import org.bukkit.Material;
* Represents a falling block
*/
public interface FallingBlock extends Entity {
/**
* Get the Material of the falling block
*
@ -17,14 +18,18 @@ public interface FallingBlock extends Entity {
* Get the ID of the falling block
*
* @return ID type of the block
* @deprecated Magic value
*/
@Deprecated
int getBlockId();
/**
* Get the data for the falling block
*
* @return data of the block
* @deprecated Magic value
*/
@Deprecated
byte getBlockData();
/**

View file

@ -51,7 +51,9 @@ public interface LivingEntity extends Entity, Damageable {
* limited by server by at least 100 blocks, no less)
* @return list containing all blocks along the living entity's line
* of sight
* @deprecated Magic value
*/
@Deprecated
public List<Block> getLineOfSight(HashSet<Byte> transparent, int maxDistance);
/**
@ -62,7 +64,9 @@ public interface LivingEntity extends Entity, Damageable {
* @param maxDistance this is the maximum distance to scan
* (may be limited by server by at least 100 blocks, no less)
* @return block that the living entity has targeted
* @deprecated Magic value
*/
@Deprecated
public Block getTargetBlock(HashSet<Byte> transparent, int maxDistance);
/**
@ -76,7 +80,9 @@ public interface LivingEntity extends Entity, Damageable {
* further limited by the server, but never to less than 100 blocks
* @return list containing the last 2 blocks along the living entity's
* line of sight
* @deprecated Magic value
*/
@Deprecated
public List<Block> getLastTwoTargetBlocks(HashSet<Byte> transparent, int maxDistance);
/**

View file

@ -60,7 +60,9 @@ public interface Ocelot extends Animals, Tameable {
* Gets the ID of this cat type.
*
* @return Type ID.
* @deprecated Magic value
*/
@Deprecated
public int getId() {
return id;
}
@ -70,7 +72,9 @@ public interface Ocelot extends Animals, Tameable {
*
* @param id ID of the cat type to get.
* @return Resulting type, or null if not found.
* @deprecated Magic value
*/
@Deprecated
public static Type getType(int id) {
return (id >= types.length) ? null : types[id];
}

View file

@ -187,7 +187,9 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
* @param loc The location of a note block.
* @param instrument The instrument ID.
* @param note The note ID.
* @deprecated Magic value
*/
@Deprecated
public void playNote(Location loc, byte instrument, byte note);
/**
@ -225,7 +227,9 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
* @param sound the internal sound name to play
* @param volume the volume of the sound
* @param pitch the pitch of the sound
* @deprecated Magic value
*/
@Deprecated
public void playSound(Location location, String sound, float volume, float pitch);
/**
@ -234,7 +238,9 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
* @param loc the location to play the effect at
* @param effect the {@link Effect}
* @param data a data bit needed for some effects
* @deprecated Magic value
*/
@Deprecated
public void playEffect(Location loc, Effect effect, int data);
/**
@ -253,7 +259,9 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
* @param loc The location of the changed block
* @param material The new block
* @param data The block data
* @deprecated Magic value
*/
@Deprecated
public void sendBlockChange(Location loc, Material material, byte data);
/**
@ -271,7 +279,9 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
* @param sz The z size of the cuboid
* @param data The data to be sent
* @return true if the chunk change packet was sent
* @deprecated Magic value
*/
@Deprecated
public boolean sendChunkChange(Location loc, int sx, int sy, int sz, byte[] data);
/**
@ -281,7 +291,9 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
* @param loc The location of the changed block
* @param material The new block ID
* @param data The block data
* @deprecated Magic value
*/
@Deprecated
public void sendBlockChange(Location loc, int material, byte data);
/**

View file

@ -42,7 +42,9 @@ public interface Skeleton extends Monster {
* Gets the ID of this skeleton type.
*
* @return Skeleton type ID
* @deprecated Magic value
*/
@Deprecated
public int getId() {
return id;
}
@ -52,7 +54,9 @@ public interface Skeleton extends Monster {
*
* @param id ID of the skeleton type to get.
* @return Resulting skeleton type, or null if not found.
* @deprecated Magic value
*/
@Deprecated
public static SkeletonType getType(int id) {
return (id >= types.length) ? null : types[id];
}

View file

@ -4,16 +4,17 @@ package org.bukkit.entity;
* Represents a villager NPC
*/
public interface Villager extends Ageable, NPC {
/**
* Gets the current profession of this villager.
*
* @return Current profession.
*/
public Profession getProfession();
/**
* Sets the new profession of this villager.
*
*
* @param profession New profession.
*/
public void setProfession(Profession profession);
@ -46,7 +47,9 @@ public interface Villager extends Ageable, NPC {
* Gets the ID of this profession.
*
* @return Profession ID.
* @deprecated Magic value
*/
@Deprecated
public int getId() {
return id;
}
@ -56,7 +59,9 @@ public interface Villager extends Ageable, NPC {
*
* @param id ID of the profession to get.
* @return Resulting profession, or null if not found.
* @deprecated Magic value
*/
@Deprecated
public static Profession getProfession(int id) {
return (id >= professions.length) ? null : professions[id];
}

View file

@ -16,8 +16,18 @@ import org.bukkit.event.HandlerList;
public class BlockCanBuildEvent extends BlockEvent {
private static final HandlerList handlers = new HandlerList();
protected boolean buildable;
/**
*
* @deprecated Magic value
*/
@Deprecated
protected int material;
/**
*
* @deprecated Magic value
*/
@Deprecated
public BlockCanBuildEvent(final Block block, final int id, final boolean canBuild) {
super(block);
buildable = canBuild;
@ -56,7 +66,9 @@ public class BlockCanBuildEvent extends BlockEvent {
* Gets the Material ID for the Material that we are trying to place.
*
* @return The Material ID for the Material that we are trying to place
* @deprecated Magic value
*/
@Deprecated
public int getMaterialId() {
return material;
}

View file

@ -13,6 +13,11 @@ public class BlockPhysicsEvent extends BlockEvent implements Cancellable {
private final int changed;
private boolean cancel = false;
/**
*
* @deprecated Magic value
*/
@Deprecated
public BlockPhysicsEvent(final Block block, final int changed) {
super(block);
this.changed = changed;
@ -22,7 +27,9 @@ public class BlockPhysicsEvent extends BlockEvent implements Cancellable {
* Gets the type of block that changed, causing this event
*
* @return Changed block's type id
* @deprecated Magic value
*/
@Deprecated
public int getChangedTypeId() {
return changed;
}

View file

@ -35,7 +35,9 @@ public class EntityChangeBlockEvent extends EntityEvent implements Cancellable {
* @param block the block (before the change)
* @param to the future material being changed to
* @param data the future block data
* @deprecated Magic value
*/
@Deprecated
public EntityChangeBlockEvent(final Entity what, final Block block, final Material to, final byte data) {
super(what);
this.block = block;
@ -74,7 +76,9 @@ public class EntityChangeBlockEvent extends EntityEvent implements Cancellable {
* Gets the data for the block that would be changed into
*
* @return the data for the block that would be changed into
* @deprecated Magic value
*/
@Deprecated
public byte getData() {
return data;
}

View file

@ -137,7 +137,9 @@ public abstract class ChunkGenerator {
* @param z The Z-coordinate of the chunk
* @param biomes Proposed biome values for chunk - can be updated by generator
* @return short[][] containing the types for each block created by this generator
* @deprecated Magic value
*/
@Deprecated
public short[][] generateExtBlockSections(World world, Random random, int x, int z, BiomeGrid biomes) {
return null; // Default - returns null, which drives call to generateBlockSections()
}
@ -186,7 +188,9 @@ public abstract class ChunkGenerator {
* @param z The Z-coordinate of the chunk
* @param biomes Proposed biome values for chunk - can be updated by generator
* @return short[][] containing the types for each block created by this generator
* @deprecated Magic value
*/
@Deprecated
public byte[][] generateBlockSections(World world, Random random, int x, int z, BiomeGrid biomes) {
return null; // Default - returns null, which drives call to generate()
}

View file

@ -36,7 +36,9 @@ public class FurnaceRecipe implements Recipe {
* @param result The item you want the recipe to create.
* @param source The input material.
* @param data The data value. (Note: This is currently ignored by the CraftBukkit server.)
* @deprecated Magic value
*/
@Deprecated
public FurnaceRecipe(ItemStack result, Material source, int data) {
this.output = new ItemStack(result);
this.ingredient = new ItemStack(source, 1, (short) data);
@ -68,7 +70,9 @@ public class FurnaceRecipe implements Recipe {
* @param input The input material.
* @param data The data value. (Note: This is currently ignored by the CraftBukkit server.)
* @return The changed recipe, so you can chain calls.
* @deprecated Magic value
*/
@Deprecated
public FurnaceRecipe setInput(Material input, int data) {
this.ingredient = new ItemStack(input, 1, (short) data);
return this;

View file

@ -126,7 +126,9 @@ public interface Inventory extends Iterable<ItemStack> {
*
* @param materialId The materialId to check for
* @return true if an ItemStack in this inventory contains the materialId
* @deprecated Magic value
*/
@Deprecated
public boolean contains(int materialId);
/**
@ -153,7 +155,9 @@ public interface Inventory extends Iterable<ItemStack> {
* @param materialId The materialId to check for
* @param amount The minimum amount to look for
* @return true if this contains any matching ItemStack with the given materialId and amount
* @deprecated Magic value
*/
@Deprecated
public boolean contains(int materialId, int amount);
/**
@ -195,7 +199,9 @@ public interface Inventory extends Iterable<ItemStack> {
*
* @param materialId The materialId to look for
* @return A HashMap containing the slot index, ItemStack pairs
* @deprecated Magic value
*/
@Deprecated
public HashMap<Integer, ? extends ItemStack> all(int materialId);
/**
@ -230,7 +236,9 @@ public interface Inventory extends Iterable<ItemStack> {
*
* @param materialId The materialId to look for
* @return The slot index of the given materialId or -1 if not found
* @deprecated Magic value
*/
@Deprecated
public int first(int materialId);
/**
@ -262,7 +270,9 @@ public interface Inventory extends Iterable<ItemStack> {
* Removes all stacks in the inventory matching the given materialId.
*
* @param materialId The material to remove
* @deprecated Magic value
*/
@Deprecated
public void remove(int materialId);
/**
@ -325,6 +335,7 @@ public interface Inventory extends Iterable<ItemStack> {
*/
public InventoryHolder getHolder();
@Override
public ListIterator<ItemStack> iterator();
/**

View file

@ -56,6 +56,11 @@ public abstract class InventoryView {
return style;
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public int getId() {
return id;
}

View file

@ -30,7 +30,9 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
* Defaults stack size to 1, with no extra data
*
* @param type item material id
* @deprecated Magic value
*/
@Deprecated
public ItemStack(final int type) {
this(type, 1);
}
@ -49,7 +51,9 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
*
* @param type item material id
* @param amount stack size
* @deprecated Magic value
*/
@Deprecated
public ItemStack(final int type, final int amount) {
this(type, amount, (short) 0);
}
@ -70,7 +74,9 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
* @param type item material id
* @param amount stack size
* @param damage durability / damage
* @deprecated Magic value
*/
@Deprecated
public ItemStack(final int type, final int amount, final short damage) {
this.type = type;
this.amount = amount;
@ -163,7 +169,9 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
* Gets the type id of this item
*
* @return Type Id of the items in this stack
* @deprecated Magic value
*/
@Deprecated
public int getTypeId() {
return type;
}
@ -174,7 +182,9 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
* Note that in doing so you will reset the MaterialData for this stack
*
* @param type New type id to set the items in this stack to
* @deprecated Magic value
*/
@Deprecated
public void setTypeId(int type) {
this.type = type;
if (this.meta != null) {

View file

@ -119,7 +119,9 @@ public interface PlayerInventory extends Inventory {
* @param id the id of the item you want to clear from the inventory
* @param data the data of the item you want to clear from the inventory
* @return The number of items cleared
* @deprecated Magic value
*/
@Deprecated
public int clear(int id, int data);
public HumanEntity getHolder();

View file

@ -33,7 +33,7 @@ public class ShapedRecipe implements Recipe {
/**
* Set the shape of this recipe to the specified rows. Each character represents a different
* ingredient; exactly what each character represents is set separately. The first row supplied
* corresponds with the upper most part of the recipe on the workbench e.g. if all three
* corresponds with the upper most part of the recipe on the workbench e.g. if all three
* rows are supplies the first string represents the top row on the workbench.
*
* @param shape The rows of the recipe (up to 3 rows).
@ -93,7 +93,9 @@ public class ShapedRecipe implements Recipe {
* @param ingredient The ingredient.
* @param raw The raw material data as an integer.
* @return The changed recipe, so you can chain calls.
* @deprecated Magic value
*/
@Deprecated
public ShapedRecipe setIngredient(char key, Material ingredient, int raw) {
Validate.isTrue(ingredients.containsKey(key), "Symbol does not appear in the shape:", key);

View file

@ -59,7 +59,9 @@ public class ShapelessRecipe implements Recipe {
* @param ingredient The ingredient to add.
* @param rawdata The data value, or -1 to allow any data value.
* @return The changed recipe, so you can chain calls.
* @deprecated Magic value
*/
@Deprecated
public ShapelessRecipe addIngredient(Material ingredient, int rawdata) {
return addIngredient(1, ingredient, rawdata);
}
@ -93,7 +95,9 @@ public class ShapelessRecipe implements Recipe {
* @param ingredient The ingredient to add.
* @param rawdata The data value, or -1 to allow any data value.
* @return The changed recipe, so you can chain calls.
* @deprecated Magic value
*/
@Deprecated
public ShapelessRecipe addIngredient(int count, Material ingredient, int rawdata) {
Validate.isTrue(ingredients.size() + count <= 9, "Shapeless recipes cannot have more than 9 ingredients");
@ -166,7 +170,9 @@ public class ShapelessRecipe implements Recipe {
* @param ingredient The ingredient to remove
* @param rawdata The data value;
* @return The changed recipe.
* @deprecated Magic value
*/
@Deprecated
public ShapelessRecipe removeIngredient(Material ingredient, int rawdata) {
return removeIngredient(1, ingredient, rawdata);
}
@ -180,7 +186,9 @@ public class ShapelessRecipe implements Recipe {
* @param ingredient The ingredient to remove.
* @param rawdata The data value.
* @return The changed recipe.
* @deprecated Magic value
*/
@Deprecated
public ShapelessRecipe removeIngredient(int count, Material ingredient, int rawdata) {
Iterator<ItemStack> iterator = ingredients.iterator();
while (count > 0 && iterator.hasNext()) {

View file

@ -4,7 +4,6 @@ package org.bukkit.map;
* Represents a cursor on a map.
*/
public final class MapCursor {
private byte x, y;
private byte direction, type;
private boolean visible;
@ -17,7 +16,9 @@ public final class MapCursor {
* @param direction The facing of the cursor, from 0 to 15.
* @param type The type (color/style) of the map cursor.
* @param visible Whether the cursor is visible by default.
* @deprecated Magic value
*/
@Deprecated
public MapCursor(byte x, byte y, byte direction, byte type, boolean visible) {
this.x = x;
this.y = y;
@ -66,7 +67,9 @@ public final class MapCursor {
* Get the type of this cursor.
*
* @return The type (color/style) of the map cursor.
* @deprecated Magic value
*/
@Deprecated
public byte getRawType() {
return type;
}
@ -123,7 +126,9 @@ public final class MapCursor {
* Set the type of this cursor.
*
* @param type The type (color/style) of the map cursor.
* @deprecated Magic value
*/
@Deprecated
public void setRawType(byte type) {
if (type < 0 || type > 15) {
throw new IllegalArgumentException("Type must be in the range 0-15");
@ -158,10 +163,20 @@ public final class MapCursor {
this.value = (byte) value;
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public byte getValue() {
return value;
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public static Type byValue(byte value) {
for (Type t : values()) {
if (t.value == value) return t;

View file

@ -8,7 +8,6 @@ import java.util.List;
* MapCursorCollection is linked to a specific {@link MapRenderer}.
*/
public final class MapCursorCollection {
private List<MapCursor> cursors = new ArrayList<MapCursor>();
/**
@ -71,7 +70,9 @@ public final class MapCursorCollection {
* @param direction The facing of the cursor, from 0 to 15.
* @param type The type (color/style) of the map cursor.
* @return The newly added MapCursor.
* @deprecated Magic value
*/
@Deprecated
public MapCursor addCursor(int x, int y, byte direction, byte type) {
return addCursor(x, y, direction, type, true);
}
@ -85,7 +86,9 @@ public final class MapCursorCollection {
* @param type The type (color/style) of the map cursor.
* @param visible Whether the cursor is visible.
* @return The newly added MapCursor.
* @deprecated Magic value
*/
@Deprecated
public MapCursor addCursor(int x, int y, byte direction, byte type, boolean visible) {
return addCursor(new MapCursor((byte) x, (byte) y, direction, type, visible));
}

View file

@ -7,6 +7,9 @@ import java.awt.image.BufferedImage;
/**
* Represents the palette that map items use.
* <p>
* These fields are hee base color ranges. Each entry corresponds to four
* colors of varying shades with values entry to entry + 3.
*/
public final class MapPalette {
@ -48,22 +51,74 @@ public final class MapPalette {
// Interface
/**
* The base color ranges. Each entry corresponds to four colors of varying
* shades with values entry to entry + 3.
* @deprecated Magic value
*/
@Deprecated
public static final byte TRANSPARENT = 0;
/**
* @deprecated Magic value
*/
@Deprecated
public static final byte LIGHT_GREEN = 4;
/**
* @deprecated Magic value
*/
@Deprecated
public static final byte LIGHT_BROWN = 8;
/**
* @deprecated Magic value
*/
@Deprecated
public static final byte GRAY_1 = 12;
/**
* @deprecated Magic value
*/
@Deprecated
public static final byte RED = 16;
/**
* @deprecated Magic value
*/
@Deprecated
public static final byte PALE_BLUE = 20;
/**
* @deprecated Magic value
*/
@Deprecated
public static final byte GRAY_2 = 24;
/**
* @deprecated Magic value
*/
@Deprecated
public static final byte DARK_GREEN = 28;
/**
* @deprecated Magic value
*/
@Deprecated
public static final byte WHITE = 32;
/**
* @deprecated Magic value
*/
@Deprecated
public static final byte LIGHT_GRAY = 36;
/**
* @deprecated Magic value
*/
@Deprecated
public static final byte BROWN = 40;
/**
* @deprecated Magic value
*/
@Deprecated
public static final byte DARK_GRAY = 44;
/**
* @deprecated Magic value
*/
@Deprecated
public static final byte BLUE = 48;
/**
* @deprecated Magic value
*/
@Deprecated
public static final byte DARK_BROWN = 52;
/**
@ -85,7 +140,9 @@ public final class MapPalette {
*
* @param image The image to convert.
* @return A byte[] containing the pixels of the image.
* @deprecated Magic value
*/
@Deprecated
public static byte[] imageToBytes(Image image) {
BufferedImage temp = new BufferedImage(image.getWidth(null), image.getHeight(null), BufferedImage.TYPE_INT_ARGB);
Graphics2D graphics = temp.createGraphics();
@ -109,7 +166,9 @@ public final class MapPalette {
* @param b The blue component of the color.
* @param g The green component of the color.
* @return The index in the palette.
* @deprecated Magic value
*/
@Deprecated
public static byte matchColor(int r, int g, int b) {
return matchColor(new Color(r, g, b));
}
@ -119,7 +178,9 @@ public final class MapPalette {
*
* @param color The Color to match.
* @return The index in the palette.
* @deprecated Magic value
*/
@Deprecated
public static byte matchColor(Color color) {
if (color.getAlpha() < 128) return 0;
@ -142,7 +203,9 @@ public final class MapPalette {
*
* @param index The index in the palette.
* @return The Color of the palette entry.
* @deprecated Magic value
*/
@Deprecated
public static Color getColor(byte index) {
if (index < 0 || index >= colors.length) {
throw new IndexOutOfBoundsException();

View file

@ -29,7 +29,9 @@ public interface MapView {
*
* @param value The raw scale
* @return The enum scale, or null for an invalid input
* @deprecated Magic value
*/
@Deprecated
public static Scale valueOf(byte value) {
switch (value) {
case 0: return CLOSEST;
@ -45,7 +47,9 @@ public interface MapView {
* Get the raw value of this scale level.
*
* @return The scale value
* @deprecated Magic value
*/
@Deprecated
public byte getValue() {
return value;
}
@ -56,7 +60,9 @@ public interface MapView {
* in an inventory.
*
* @return The ID of the map.
* @deprecated Magic value
*/
@Deprecated
public short getId();
/**

View file

@ -25,6 +25,11 @@ public class Bed extends MaterialData implements Directional {
setFacingDirection(direction);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Bed(final int type) {
super(type);
}
@ -33,10 +38,20 @@ public class Bed extends MaterialData implements Directional {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Bed(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Bed(final Material type, final byte data) {
super(type, data);
}

View file

@ -11,6 +11,11 @@ public class Button extends SimpleAttachableMaterialData implements Redstone {
super(Material.STONE_BUTTON);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Button(final int type) {
super(type);
}
@ -19,10 +24,20 @@ public class Button extends SimpleAttachableMaterialData implements Redstone {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Button(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Button(final Material type, final byte data) {
super(type, data);
}

View file

@ -7,6 +7,11 @@ public class Cake extends MaterialData {
super(Material.CAKE_BLOCK);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Cake(int type) {
super(type);
}
@ -15,10 +20,20 @@ public class Cake extends MaterialData {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Cake(int type, byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Cake(Material type, byte data) {
super(type, data);
}

View file

@ -13,10 +13,20 @@ public class Cauldron extends MaterialData {
super(Material.CAULDRON);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Cauldron(int type, byte data){
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Cauldron(byte data) {
super(Material.CAULDRON, data);
}

View file

@ -22,6 +22,11 @@ public class Chest extends DirectionalContainer {
setFacingDirection(direction);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Chest(final int type) {
super(type);
}
@ -30,10 +35,20 @@ public class Chest extends DirectionalContainer {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Chest(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Chest(final Material type, final byte data) {
super(type, data);
}

View file

@ -16,6 +16,11 @@ public class Coal extends MaterialData {
setType(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Coal(final int type) {
super(type);
}
@ -24,10 +29,20 @@ public class Coal extends MaterialData {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Coal(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Coal(final Material type, final byte data) {
super(type, data);
}

View file

@ -18,10 +18,20 @@ public class CocoaPlant extends MaterialData implements Directional, Attachable
super(Material.COCOA);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public CocoaPlant(final int type) {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public CocoaPlant(final int type, final byte data) {
super(type, data);
}

View file

@ -10,6 +10,11 @@ public class Command extends MaterialData implements Redstone {
super(Material.COMMAND);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Command(final int type) {
super(type);
}
@ -18,10 +23,20 @@ public class Command extends MaterialData implements Redstone {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Command(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Command(final Material type, final byte data) {
super(type, data);
}

View file

@ -16,6 +16,11 @@ public class Crops extends MaterialData {
setState(state);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Crops(final int type) {
super(type);
}
@ -24,10 +29,20 @@ public class Crops extends MaterialData {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Crops(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Crops(final Material type, final byte data) {
super(type, data);
}

View file

@ -10,6 +10,11 @@ public class DetectorRail extends ExtendedRails implements PressureSensor {
super(Material.DETECTOR_RAIL);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public DetectorRail(final int type) {
super(type);
}
@ -18,10 +23,20 @@ public class DetectorRail extends ExtendedRails implements PressureSensor {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public DetectorRail(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public DetectorRail(final Material type, final byte data) {
super(type, data);
}

View file

@ -8,6 +8,11 @@ public class Diode extends MaterialData implements Directional {
super(Material.DIODE_BLOCK_ON);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Diode(int type) {
super(type);
}
@ -16,10 +21,20 @@ public class Diode extends MaterialData implements Directional {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Diode(int type, byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Diode(Material type, byte data) {
super(type, data);
}

View file

@ -7,6 +7,11 @@ import org.bukkit.block.BlockFace;
* Represents a furnace or a dispenser.
*/
public class DirectionalContainer extends MaterialData implements Directional {
/**
*
* @deprecated Magic value
*/
@Deprecated
public DirectionalContainer(final int type) {
super(type);
}
@ -15,10 +20,20 @@ public class DirectionalContainer extends MaterialData implements Directional {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public DirectionalContainer(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public DirectionalContainer(final Material type, final byte data) {
super(type, data);
}

View file

@ -17,6 +17,11 @@ public class Dispenser extends FurnaceAndDispenser {
setFacingDirection(direction);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Dispenser(final int type) {
super(type);
}
@ -25,10 +30,20 @@ public class Dispenser extends FurnaceAndDispenser {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Dispenser(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Dispenser(final Material type, final byte data) {
super(type, data);
}

View file

@ -14,6 +14,11 @@ public class Door extends MaterialData implements Directional, Openable {
super(Material.WOODEN_DOOR);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Door(final int type) {
super(type);
}
@ -22,10 +27,20 @@ public class Door extends MaterialData implements Directional, Openable {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Door(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Door(final Material type, final byte data) {
super(type, data);
}

View file

@ -11,6 +11,11 @@ public class Dye extends MaterialData implements Colorable {
super(Material.INK_SACK);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Dye(final int type) {
super(type);
}
@ -19,10 +24,20 @@ public class Dye extends MaterialData implements Colorable {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Dye(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Dye(final Material type, final byte data) {
super(type, data);
}

View file

@ -22,6 +22,11 @@ public class EnderChest extends DirectionalContainer {
setFacingDirection(direction);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public EnderChest(final int type) {
super(type);
}
@ -30,10 +35,20 @@ public class EnderChest extends DirectionalContainer {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public EnderChest(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public EnderChest(final Material type, final byte data) {
super(type, data);
}

View file

@ -7,6 +7,11 @@ import org.bukkit.block.BlockFace;
* This is the superclass for the {@link DetectorRail} and {@link PoweredRail} classes
*/
public class ExtendedRails extends Rails {
/**
*
* @deprecated Magic value
*/
@Deprecated
public ExtendedRails(final int type) {
super(type);
}
@ -15,10 +20,20 @@ public class ExtendedRails extends Rails {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public ExtendedRails(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public ExtendedRails(final Material type, final byte data) {
super(type, data);
}
@ -28,6 +43,11 @@ public class ExtendedRails extends Rails {
return false;
}
/**
*
* @deprecated Magic value
*/
@Deprecated
@Override
protected byte getConvertedData() {
return (byte) (getData() & 0x7);

View file

@ -16,6 +16,11 @@ public class FlowerPot extends MaterialData {
super(Material.FLOWER_POT);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public FlowerPot(final int type) {
super(type);
}
@ -24,10 +29,20 @@ public class FlowerPot extends MaterialData {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public FlowerPot(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public FlowerPot(final Material type, final byte data) {
super(type, data);
}

View file

@ -22,6 +22,11 @@ public class Furnace extends FurnaceAndDispenser {
setFacingDirection(direction);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Furnace(final int type) {
super(type);
}
@ -30,10 +35,20 @@ public class Furnace extends FurnaceAndDispenser {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Furnace(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Furnace(final Material type, final byte data) {
super(type, data);
}

View file

@ -6,6 +6,11 @@ import org.bukkit.Material;
* Represents a furnace or dispenser, two types of directional containers
*/
public class FurnaceAndDispenser extends DirectionalContainer {
/**
*
* @deprecated Magic value
*/
@Deprecated
public FurnaceAndDispenser(final int type) {
super(type);
}
@ -14,10 +19,20 @@ public class FurnaceAndDispenser extends DirectionalContainer {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public FurnaceAndDispenser(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public FurnaceAndDispenser(final Material type, final byte data) {
super(type, data);
}

View file

@ -11,6 +11,11 @@ public class Ladder extends SimpleAttachableMaterialData {
super(Material.LADDER);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Ladder(final int type) {
super(type);
}
@ -19,10 +24,20 @@ public class Ladder extends SimpleAttachableMaterialData {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Ladder(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Ladder(final Material type, final byte data) {
super(type, data);
}

View file

@ -16,6 +16,11 @@ public class Leaves extends MaterialData {
setSpecies(species);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Leaves(final int type) {
super(type);
}
@ -24,10 +29,20 @@ public class Leaves extends MaterialData {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Leaves(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Leaves(final Material type, final byte data) {
super(type, data);
}

View file

@ -11,6 +11,11 @@ public class Lever extends SimpleAttachableMaterialData implements Redstone {
super(Material.LEVER);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Lever(final int type) {
super(type);
}
@ -19,10 +24,20 @@ public class Lever extends SimpleAttachableMaterialData implements Redstone {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Lever(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Lever(final Material type, final byte data) {
super(type, data);
}

View file

@ -16,6 +16,11 @@ public class LongGrass extends MaterialData {
setSpecies(species);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public LongGrass(final int type) {
super(type);
}
@ -24,10 +29,20 @@ public class LongGrass extends MaterialData {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public LongGrass(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public LongGrass(final Material type, final byte data) {
super(type, data);
}

View file

@ -10,6 +10,11 @@ public class MaterialData implements Cloneable {
private final int type;
private byte data = 0;
/**
*
* @deprecated Magic value
*/
@Deprecated
public MaterialData(final int type) {
this(type, (byte) 0);
}
@ -18,11 +23,21 @@ public class MaterialData implements Cloneable {
this(type, (byte) 0);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public MaterialData(final int type, final byte data) {
this.type = type;
this.data = data;
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public MaterialData(final Material type, final byte data) {
this(type.getId(), data);
}
@ -31,7 +46,9 @@ public class MaterialData implements Cloneable {
* Gets the raw data in this material
*
* @return Raw data
* @deprecated Magic value
*/
@Deprecated
public byte getData() {
return data;
}
@ -40,7 +57,9 @@ public class MaterialData implements Cloneable {
* Sets the raw data of this material
*
* @param data New raw data
* @deprecated Magic value
*/
@Deprecated
public void setData(byte data) {
this.data = data;
}
@ -58,7 +77,9 @@ public class MaterialData implements Cloneable {
* Gets the Material Id that this MaterialData represents
*
* @return Material Id represented by this MaterialData
* @deprecated Magic value
*/
@Deprecated
public int getItemTypeId() {
return type;
}

View file

@ -21,6 +21,11 @@ public class MonsterEggs extends TexturedMaterial {
super(Material.MONSTER_EGGS);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public MonsterEggs(final int type) {
super(type);
}
@ -32,10 +37,20 @@ public class MonsterEggs extends TexturedMaterial {
}
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public MonsterEggs(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public MonsterEggs(final Material type, final byte data) {
super(type, data);
}

View file

@ -26,11 +26,21 @@ public class Mushroom extends MaterialData {
Validate.isTrue(shroom == Material.HUGE_MUSHROOM_1 || shroom == Material.HUGE_MUSHROOM_2, "Not a mushroom!");
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Mushroom(Material shroom, byte data) {
super(shroom, data);
Validate.isTrue(shroom == Material.HUGE_MUSHROOM_1 || shroom == Material.HUGE_MUSHROOM_2, "Not a mushroom!");
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Mushroom(int type, byte data){
super(type, data);
Validate.isTrue(type == Material.HUGE_MUSHROOM_1.getId() || type == Material.HUGE_MUSHROOM_2.getId(), "Not a mushroom!");

View file

@ -16,6 +16,11 @@ public class NetherWarts extends MaterialData {
setState(state);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public NetherWarts(final int type) {
super(type);
}
@ -24,10 +29,20 @@ public class NetherWarts extends MaterialData {
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);
}

View file

@ -7,6 +7,11 @@ import org.bukkit.block.BlockFace;
* Material data for the piston base block
*/
public class PistonBaseMaterial extends MaterialData implements Directional, Redstone {
/**
*
* @deprecated Magic value
*/
@Deprecated
public PistonBaseMaterial(final int type) {
super(type);
}
@ -15,10 +20,20 @@ public class PistonBaseMaterial extends MaterialData implements Directional, Red
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public PistonBaseMaterial(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public PistonBaseMaterial(final Material type, final byte data) {
super(type, data);
}

View file

@ -7,6 +7,11 @@ import org.bukkit.block.BlockFace;
* Material data for the piston extension block
*/
public class PistonExtensionMaterial extends MaterialData implements Attachable {
/**
*
* @deprecated Magic value
*/
@Deprecated
public PistonExtensionMaterial(final int type) {
super(type);
}
@ -15,10 +20,20 @@ public class PistonExtensionMaterial extends MaterialData implements Attachable
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public PistonExtensionMaterial(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public PistonExtensionMaterial(final Material type, final byte data) {
super(type, data);
}

View file

@ -10,6 +10,11 @@ public class PoweredRail extends ExtendedRails implements Redstone {
super(Material.POWERED_RAIL);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public PoweredRail(final int type) {
super(type);
}
@ -18,10 +23,20 @@ public class PoweredRail extends ExtendedRails implements Redstone {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public PoweredRail(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public PoweredRail(final Material type, final byte data) {
super(type, data);
}

View file

@ -10,6 +10,11 @@ public class PressurePlate extends MaterialData implements PressureSensor {
super(Material.WOOD_PLATE);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public PressurePlate(int type) {
super(type);
}
@ -18,10 +23,20 @@ public class PressurePlate extends MaterialData implements PressureSensor {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public PressurePlate(int type, byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public PressurePlate(Material type, byte data) {
super(type, data);
}

View file

@ -22,6 +22,11 @@ public class Pumpkin extends MaterialData implements Directional {
setFacingDirection(direction);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Pumpkin(final int type) {
super(type);
}
@ -30,10 +35,20 @@ public class Pumpkin extends MaterialData implements Directional {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Pumpkin(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Pumpkin(final Material type, final byte data) {
super(type, data);
}

View file

@ -12,6 +12,11 @@ public class Rails extends MaterialData {
super(Material.RAILS);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Rails(final int type) {
super(type);
}
@ -20,10 +25,20 @@ public class Rails extends MaterialData {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Rails(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Rails(final Material type, final byte data) {
super(type, data);
}
@ -99,7 +114,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 part
* @deprecated Magic value
*/
@Deprecated
protected byte getConvertedData() {
return getData();
}

View file

@ -10,6 +10,11 @@ public class RedstoneTorch extends Torch implements Redstone {
super(Material.REDSTONE_TORCH_ON);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public RedstoneTorch(final int type) {
super(type);
}
@ -18,10 +23,20 @@ public class RedstoneTorch extends Torch implements Redstone {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public RedstoneTorch(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public RedstoneTorch(final Material type, final byte data) {
super(type, data);
}

View file

@ -10,6 +10,11 @@ public class RedstoneWire extends MaterialData implements Redstone {
super(Material.REDSTONE_WIRE);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public RedstoneWire(final int type) {
super(type);
}
@ -18,10 +23,20 @@ public class RedstoneWire extends MaterialData implements Redstone {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public RedstoneWire(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public RedstoneWire(final Material type, final byte data) {
super(type, data);
}

View file

@ -16,6 +16,11 @@ public class Sandstone extends MaterialData {
setType(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Sandstone(final int type) {
super(type);
}
@ -24,10 +29,20 @@ public class Sandstone extends MaterialData {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Sandstone(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Sandstone(final Material type, final byte data) {
super(type, data);
}

View file

@ -11,6 +11,11 @@ public class Sign extends MaterialData implements Attachable {
super(Material.SIGN_POST);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Sign(final int type) {
super(type);
}
@ -19,10 +24,20 @@ public class Sign extends MaterialData implements Attachable {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Sign(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Sign(final Material type, final byte data) {
super(type, data);
}

View file

@ -8,6 +8,11 @@ import org.bukkit.block.BlockFace;
*/
public abstract class SimpleAttachableMaterialData extends MaterialData implements Attachable {
/**
*
* @deprecated Magic value
*/
@Deprecated
public SimpleAttachableMaterialData(int type) {
super(type);
}
@ -26,10 +31,20 @@ public abstract class SimpleAttachableMaterialData extends MaterialData implemen
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public SimpleAttachableMaterialData(int type, byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public SimpleAttachableMaterialData(Material type, byte data) {
super(type, data);
}

View file

@ -21,6 +21,11 @@ public class Skull extends MaterialData implements Directional {
setFacingDirection(direction);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Skull(final int type) {
super(type);
}
@ -29,10 +34,20 @@ public class Skull extends MaterialData implements Directional {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Skull(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Skull(final Material type, final byte data) {
super(type, data);
}

View file

@ -22,6 +22,11 @@ public class SmoothBrick extends TexturedMaterial {
super(Material.SMOOTH_BRICK);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public SmoothBrick(final int type) {
super(type);
}
@ -33,10 +38,20 @@ public class SmoothBrick extends TexturedMaterial {
}
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public SmoothBrick(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public SmoothBrick(final Material type, final byte data) {
super(type, data);
}

View file

@ -7,14 +7,25 @@ import org.bukkit.entity.EntityType;
* Represents a spawn egg that can be used to spawn mobs
*/
public class SpawnEgg extends MaterialData {
public SpawnEgg() {
super(Material.MONSTER_EGG);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public SpawnEgg(int type, byte data){
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public SpawnEgg(byte data) {
super(Material.MONSTER_EGG, data);
}

View file

@ -8,6 +8,11 @@ import org.bukkit.block.BlockFace;
*/
public class Stairs extends MaterialData implements Directional {
/**
*
* @deprecated Magic value
*/
@Deprecated
public Stairs(final int type) {
super(type);
}
@ -16,10 +21,20 @@ public class Stairs extends MaterialData implements Directional {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Stairs(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Stairs(final Material type, final byte data) {
super(type, data);
}

View file

@ -25,6 +25,11 @@ public class Step extends TexturedMaterial {
super(Material.STEP);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Step(final int type) {
super(type);
}
@ -36,10 +41,20 @@ public class Step extends TexturedMaterial {
}
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Step(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Step(final Material type, final byte data) {
super(type, data);
}
@ -57,7 +72,7 @@ public class Step extends TexturedMaterial {
public boolean isInverted() {
return ((getData() & 0x8) != 0);
}
/**
* Set step inverted state
*
@ -70,12 +85,22 @@ public class Step extends TexturedMaterial {
}
setData((byte) dat);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
@Override
protected int getTextureIndex() {
return getData() & 0x7;
}
/**
*
* @deprecated Magic value
*/
@Deprecated
@Override
protected void setTextureIndex(int idx) {
setData((byte) ((getData() & 0x8) | idx));

View file

@ -13,14 +13,29 @@ public abstract class TexturedMaterial extends MaterialData {
super(m);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public TexturedMaterial(int type) {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public TexturedMaterial(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public TexturedMaterial(final Material type, final byte data) {
super(type, data);
}
@ -64,7 +79,9 @@ public abstract class TexturedMaterial extends MaterialData {
* Get material index from data
*
* @return index of data in textures list
* @deprecated Magic value
*/
@Deprecated
protected int getTextureIndex() {
return getData(); // Default to using all bits - override for other mappings
}
@ -73,7 +90,9 @@ public abstract class TexturedMaterial extends MaterialData {
* Set material index
*
* @param idx - index of data in textures list
* @deprecated Magic value
*/
@Deprecated
protected void setTextureIndex(int idx) {
setData((byte) idx); // Defult to using all bits - override for other mappings
}

View file

@ -11,6 +11,11 @@ public class Torch extends SimpleAttachableMaterialData {
super(Material.TORCH);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Torch(final int type) {
super(type);
}
@ -19,10 +24,20 @@ public class Torch extends SimpleAttachableMaterialData {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Torch(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Torch(final Material type, final byte data) {
super(type, data);
}

View file

@ -11,6 +11,11 @@ public class TrapDoor extends SimpleAttachableMaterialData implements Openable {
super(Material.TRAP_DOOR);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public TrapDoor(final int type) {
super(type);
}
@ -19,10 +24,20 @@ public class TrapDoor extends SimpleAttachableMaterialData implements Openable {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public TrapDoor(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public TrapDoor(final Material type, final byte data) {
super(type, data);
}

View file

@ -23,6 +23,11 @@ public class Tree extends MaterialData {
setDirection(dir);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Tree(final int type) {
super(type);
}
@ -31,10 +36,20 @@ public class Tree extends MaterialData {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Tree(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Tree(final Material type, final byte data) {
super(type, data);
}

View file

@ -11,10 +11,20 @@ public class Tripwire extends MaterialData {
super(Material.TRIPWIRE);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Tripwire(final int type) {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Tripwire(final int type, final byte data) {
super(type, data);
}

Some files were not shown because too many files have changed in this diff Show more