Global ID -> Id rename

By: Erik Broes <erikbroes@grum.nl>
This commit is contained in:
Bukkit/Spigot 2011-01-15 20:53:43 +01:00
parent 4d7b10c59d
commit 550e518848
8 changed files with 35 additions and 36 deletions

View File

@ -62,11 +62,11 @@ public interface Block {
Material getType(); Material getType();
/** /**
* Gets the type-ID of this block * Gets the type-id of this block
* *
* @return block type-ID * @return block type-id
*/ */
int getTypeID(); int getTypeId();
/** /**
* Gets the light level between 0-15 * Gets the light level between 0-15
@ -125,12 +125,12 @@ public interface Block {
void setType(Material type); void setType(Material type);
/** /**
* Sets the type-ID of this block * Sets the type-id of this block
* *
* @param type Type-ID to change this block to * @param type Type-Id to change this block to
* @return whether the block was changed * @return whether the block was changed
*/ */
boolean setTypeID(int type); boolean setTypeId(int type);
/** /**
* Gets the face relation of this block compared to the given block<br /> * Gets the face relation of this block compared to the given block<br />

View File

@ -34,9 +34,9 @@ public interface Entity {
public void teleportTo(Entity destination); public void teleportTo(Entity destination);
/** /**
* Returns a unique ID for this entity * Returns a unique id for this entity
* *
* @return Entity ID * @return Entity id
*/ */
public int getEntityID(); public int getEntityId();
} }

View File

@ -25,7 +25,7 @@ public class ItemStack {
} }
public ItemStack(final Material type, final int amount) { public ItemStack(final Material type, final int amount) {
this(type.getID(), amount); this(type.getId(), amount);
} }
public ItemStack(final int type, final int amount, final byte damage) { public ItemStack(final int type, final int amount, final byte damage) {
@ -33,7 +33,7 @@ public class ItemStack {
} }
public ItemStack(final Material type, final int amount, final byte damage) { public ItemStack(final Material type, final int amount, final byte damage) {
this(type.getID(), amount, damage); this(type.getId(), amount, damage);
} }
public ItemStack(final int type, final int amount, final byte damage, final byte data) { public ItemStack(final int type, final int amount, final byte damage, final byte data) {
@ -44,7 +44,7 @@ public class ItemStack {
} }
public ItemStack(final Material type, final int amount, final byte damage, final byte data) { public ItemStack(final Material type, final int amount, final byte damage, final byte data) {
this(type.getID(), amount, damage, data); this(type.getId(), amount, damage, data);
} }
/** /**
@ -64,26 +64,26 @@ public class ItemStack {
* @param type New type to set the items in this stack to * @param type New type to set the items in this stack to
*/ */
public void setType(Material type) { public void setType(Material type) {
setTypeID(type.getID()); setTypeId(type.getId());
} }
/** /**
* Gets the type ID of this item * Gets the type id of this item
* *
* @return Type ID of the items in this stack * @return Type Id of the items in this stack
*/ */
public int getTypeID() { public int getTypeId() {
return type; return type;
} }
/** /**
* Sets the type ID of this item<br /> * Sets the type id of this item<br />
* <br /> * <br />
* Note that in doing so you will reset the MaterialData for this stack * 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 * @param type New type id to set the items in this stack to
*/ */
public void setTypeID(int type) { public void setTypeId(int type) {
this.type = type; this.type = type;
createData((byte)0); createData((byte)0);
} }
@ -191,6 +191,6 @@ public class ItemStack {
} }
public boolean equals(ItemStack item) { public boolean equals(ItemStack item) {
return item.getAmount() == getAmount() && item.getTypeID() == getTypeID(); return item.getAmount() == getAmount() && item.getTypeId() == getTypeId();
} }
} }

View File

@ -11,7 +11,7 @@ import org.bukkit.material.MaterialData;
import org.bukkit.material.Wool; import org.bukkit.material.Wool;
/** /**
* An enum of all material IDs accepted by the official server + client * An enum of all material ids accepted by the official server + client
*/ */
public enum Material { public enum Material {
AIR(0), AIR(0),
@ -213,7 +213,7 @@ public enum Material {
this.data = data; this.data = data;
} }
public int getID() { public int getId() {
return id; return id;
} }
@ -260,9 +260,8 @@ public enum Material {
static { static {
for (Material material : values()) { for (Material material : values()) {
lookupId.put(material.getID(), material); lookupId.put(material.getId(), material);
lookupName.put(material.name(), material); lookupName.put(material.name(), material);
} }
} }
} }

View File

@ -38,11 +38,11 @@ public interface BlockState {
Material getType(); Material getType();
/** /**
* Gets the type-ID of this block * Gets the type-id of this block
* *
* @return block type-ID * @return block type-id
*/ */
int getTypeID(); int getTypeId();
/** /**
* Gets the light level between 0-15 * Gets the light level between 0-15
@ -101,11 +101,11 @@ public interface BlockState {
void setType(Material type); void setType(Material type);
/** /**
* Sets the type-ID of this block * Sets the type-id of this block
* *
* @param type Type-ID to change this block to * @param type Type-Id to change this block to
*/ */
void setTypeID(int type); void setTypeId(int type);
/** /**
* Attempts to update the block represented by this state, setting it to the * Attempts to update the block represented by this state, setting it to the

View File

@ -40,7 +40,7 @@ public class BlockCanBuildEvent extends BlockEvent {
return Material.getMaterial(material); return Material.getMaterial(material);
} }
public int getMaterialID() { public int getMaterialId() {
return material; return material;
} }
} }

View File

@ -21,9 +21,9 @@ public class BlockPhysicsEvent extends BlockEvent {
/** /**
* Gets the type of block that changed, causing this event * Gets the type of block that changed, causing this event
* *
* @return Changed block's type ID * @return Changed block's type id
*/ */
public int getChangedTypeID() { public int getChangedTypeId() {
return changed; return changed;
} }

View File

@ -25,7 +25,7 @@ public class MaterialData {
} }
public MaterialData(final Material type, final byte data) { public MaterialData(final Material type, final byte data) {
this(type.getID(), data); this(type.getId(), data);
} }
/** /**
@ -56,9 +56,9 @@ public class MaterialData {
} }
/** /**
* Gets the Material ID that this MaterialData represents * Gets the Material Id that this MaterialData represents
* *
* @return Material ID represented by this MaterialData * @return Material Id represented by this MaterialData
*/ */
public int getItemTypeId() { public int getItemTypeId() {
return type; return type;