summaryrefslogtreecommitdiffstats
path: root/src/main/java/org
diff options
context:
space:
mode:
authorErik Broes <erikbroes@grum.nl>2011-01-15 20:53:20 +0100
committerErik Broes <erikbroes@grum.nl>2011-01-15 20:55:59 +0100
commitdea72d662387204357a3f0a8791e7bd7484472f4 (patch)
tree4020df7b7673d52352445bc60a074d59ec9cff5d /src/main/java/org
parente4a31ce2069aeaa0c920bbb13bcf51e7ddaeccf5 (diff)
downloadcraftbukkit-dea72d662387204357a3f0a8791e7bd7484472f4.tar
craftbukkit-dea72d662387204357a3f0a8791e7bd7484472f4.tar.gz
craftbukkit-dea72d662387204357a3f0a8791e7bd7484472f4.tar.lz
craftbukkit-dea72d662387204357a3f0a8791e7bd7484472f4.tar.xz
craftbukkit-dea72d662387204357a3f0a8791e7bd7484472f4.zip
Global ID -> Id rename
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/CraftBlock.java16
-rw-r--r--src/main/java/org/bukkit/craftbukkit/CraftEntity.java4
-rw-r--r--src/main/java/org/bukkit/craftbukkit/CraftHumanEntity.java2
-rw-r--r--src/main/java/org/bukkit/craftbukkit/CraftInventory.java24
-rw-r--r--src/main/java/org/bukkit/craftbukkit/CraftItemStack.java14
-rw-r--r--src/main/java/org/bukkit/craftbukkit/CraftLivingEntity.java2
-rw-r--r--src/main/java/org/bukkit/craftbukkit/CraftMinecart.java8
-rw-r--r--src/main/java/org/bukkit/craftbukkit/CraftWorld.java50
-rw-r--r--src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java20
9 files changed, 73 insertions, 67 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/CraftBlock.java
index 18ea916a..9e47c9f5 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftBlock.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftBlock.java
@@ -110,16 +110,16 @@ public class CraftBlock implements Block {
* @param type Material to change this block to
*/
public void setType(final Material type) {
- setTypeID(type.getID());
+ setTypeId(type.getId());
}
/**
- * 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
*/
- public boolean setTypeID(final int type) {
+ public boolean setTypeId(final int type) {
this.type = type;
return world.getHandle().e(x, y, z, type);
}
@@ -130,15 +130,15 @@ public class CraftBlock implements Block {
* @return block type
*/
public Material getType() {
- return Material.getMaterial(getTypeID());
+ return Material.getMaterial(getTypeId());
}
/**
- * Gets the type-ID of this block
+ * Gets the type-id of this block
*
- * @return block type-ID
+ * @return block type-id
*/
- public int getTypeID() {
+ public int getTypeId() {
return type;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/CraftEntity.java
index 4e62fc0a..1902c1d2 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftEntity.java
@@ -41,7 +41,7 @@ public abstract class CraftEntity implements org.bukkit.Entity {
teleportTo(destination.getLocation());
}
- public int getEntityID() {
+ public int getEntityId() {
return entity.g;
}
@@ -81,6 +81,6 @@ public abstract class CraftEntity implements org.bukkit.Entity {
@Override
public String toString() {
- return "CraftEntity{" + "id=" + getEntityID() + '}';
+ return "CraftEntity{" + "id=" + getEntityId() + '}';
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/CraftHumanEntity.java
index 91437f4f..5ffd1688 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftHumanEntity.java
@@ -40,6 +40,6 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
@Override
public String toString() {
- return "CraftHumanEntity{" + "id=" + getEntityID() + "name=" + getName() + '}';
+ return "CraftHumanEntity{" + "id=" + getEntityId() + "name=" + getName() + '}';
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/CraftInventory.java
index 7f70f770..f8a95ee9 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftInventory.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftInventory.java
@@ -42,12 +42,12 @@ public class CraftInventory implements org.bukkit.Inventory {
}
public void setItem(int index, ItemStack item) {
- getInventory().a( index, new net.minecraft.server.ItemStack( item.getTypeID(), item.getAmount(), 0));
+ getInventory().a( index, new net.minecraft.server.ItemStack( item.getTypeId(), item.getAmount(), 0));
}
public boolean contains(int materialId) {
for (ItemStack item: getContents()) {
- if (item.getTypeID() == materialId) {
+ if (item.getTypeId() == materialId) {
return true;
}
}
@@ -55,7 +55,7 @@ public class CraftInventory implements org.bukkit.Inventory {
}
public boolean contains(Material material) {
- return contains(material.getID());
+ return contains(material.getId());
}
public boolean contains(ItemStack item) {
@@ -73,7 +73,7 @@ public class CraftInventory implements org.bukkit.Inventory {
ItemStack[] inventory = getContents();
for (int i = 0; i < inventory.length; i++) {
ItemStack item = inventory[i];
- if (item.getTypeID() == materialId) {
+ if (item.getTypeId() == materialId) {
slots.put( i, item );
}
}
@@ -81,7 +81,7 @@ public class CraftInventory implements org.bukkit.Inventory {
}
public HashMap<Integer, ItemStack> all(Material material) {
- return all(material.getID());
+ return all(material.getId());
}
public HashMap<Integer, ItemStack> all(ItemStack item) {
@@ -99,7 +99,7 @@ public class CraftInventory implements org.bukkit.Inventory {
public int first(int materialId) {
ItemStack[] inventory = getContents();
for (int i = 0; i < inventory.length; i++) {
- if (inventory[i].getTypeID() == materialId) {
+ if (inventory[i].getTypeId() == materialId) {
return i;
}
}
@@ -107,7 +107,7 @@ public class CraftInventory implements org.bukkit.Inventory {
}
public int first(Material material) {
- return first(material.getID());
+ return first(material.getId());
}
public int first(ItemStack item) {
@@ -128,7 +128,7 @@ public class CraftInventory implements org.bukkit.Inventory {
ItemStack[] inventory = getContents();
for (int i = 0; i < inventory.length; i++) {
ItemStack item = inventory[i];
- if (item != null && item.getTypeID() == materialId && item.getAmount() < item.getMaxStackSize()) {
+ if (item != null && item.getTypeId() == materialId && item.getAmount() < item.getMaxStackSize()) {
return i;
}
}
@@ -136,11 +136,11 @@ public class CraftInventory implements org.bukkit.Inventory {
}
public int firstPartial(Material material) {
- return firstPartial(material.getID());
+ return firstPartial(material.getId());
}
public int firstPartial(ItemStack item) {
- return firstPartial(item.getTypeID());
+ return firstPartial(item.getTypeId());
}
public HashMap<Integer, ItemStack> addItem(ItemStack... items) {
@@ -156,7 +156,7 @@ public class CraftInventory implements org.bukkit.Inventory {
ItemStack item = items[i];
while (true) {
// Do we already have a stack of it?
- int firstPartial = firstPartial( item.getTypeID() );
+ int firstPartial = firstPartial( item.getTypeId() );
// Drat! no partial stack
if (firstPartial == -1) {
@@ -170,7 +170,7 @@ public class CraftInventory implements org.bukkit.Inventory {
} else {
// More than a single stack!
if (item.getAmount() > getMaxItemStack()) {
- setItem( firstFree, new ItemStack(item.getTypeID(), getMaxItemStack()));
+ setItem( firstFree, new ItemStack(item.getTypeId(), getMaxItemStack()));
item.setAmount(item.getAmount() - getMaxItemStack());
} else {
// Just store it
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/CraftItemStack.java
index 495d46bd..c1c4ebc2 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftItemStack.java
@@ -18,20 +18,20 @@ public class CraftItemStack extends ItemStack {
@Override
public Material getType() {
- super.setTypeID(item != null ? item.c : 0); // sync, needed?
+ super.setTypeId(item != null ? item.c : 0); // sync, needed?
return super.getType();
}
@Override
- public int getTypeID() {
- super.setTypeID(item != null ? item.c : 0); // sync, needed?
+ public int getTypeId() {
+ super.setTypeId(item != null ? item.c : 0); // sync, needed?
return item != null ? item.c : 0;
}
@Override
- public void setTypeID(int type) {
+ public void setTypeId(int type) {
if (type == 0) {
- super.setTypeID(0);
+ super.setTypeId(0);
super.setAmount(0);
item = null;
} else {
@@ -40,7 +40,7 @@ public class CraftItemStack extends ItemStack {
super.setAmount(1);
} else {
item.c = type;
- super.setTypeID(item.c);
+ super.setTypeId(item.c);
}
}
}
@@ -54,7 +54,7 @@ public class CraftItemStack extends ItemStack {
@Override
public void setAmount(int amount) {
if (amount == 0) {
- super.setTypeID(0);
+ super.setTypeId(0);
super.setAmount(0);
item = null;
} else {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/CraftLivingEntity.java
index 449ea62f..9964bf9e 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftLivingEntity.java
@@ -45,7 +45,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
@Override
public String toString() {
- return "CraftLivingEntity{" + "id=" + getEntityID() + '}';
+ return "CraftLivingEntity{" + "id=" + getEntityId() + '}';
}
public Egg throwEgg() {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftMinecart.java b/src/main/java/org/bukkit/craftbukkit/CraftMinecart.java
index 0d55ad82..d293e079 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftMinecart.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftMinecart.java
@@ -10,7 +10,7 @@ import org.bukkit.Minecart;
*/
public class CraftMinecart extends CraftVehicle implements Minecart {
/**
- * Stores the minecart type ID, which is used by Minecraft to differentiate
+ * Stores the minecart type id, which is used by Minecraft to differentiate
* minecart types. Here we use subclasses.
*/
public enum Type {
@@ -24,7 +24,7 @@ public class CraftMinecart extends CraftVehicle implements Minecart {
this.id = id;
}
- public int getID() {
+ public int getId() {
return id;
}
}
@@ -54,9 +54,9 @@ public class CraftMinecart extends CraftVehicle implements Minecart {
*/
public static CraftMinecart getCraftMinecart(CraftServer server,
EntityMinecart minecart) {
- if (minecart.d == Type.StorageMinecart.getID()) {
+ if (minecart.d == Type.StorageMinecart.getId()) {
return new CraftStorageMinecart(server, minecart);
- } else if (minecart.d == Type.PoweredMinecart.getID()) {
+ } else if (minecart.d == Type.PoweredMinecart.getId()) {
return new CraftPoweredMinecart(server, minecart);
} else {
return new CraftMinecart(server, minecart);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 993ab7a9..b7b9ab2a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -114,11 +114,12 @@ public class CraftWorld implements World {
}
public ItemDrop dropItem(Location loc, ItemStack item) {
- net.minecraft.server.ItemStack stack =
- new net.minecraft.server.ItemStack(
- item.getTypeID(), item.getAmount(), item.getDamage());
- EntityItem entity = new EntityItem(world, loc.getX(), loc.getY(),
- loc.getZ(), stack);
+ net.minecraft.server.ItemStack stack = new net.minecraft.server.ItemStack(
+ item.getTypeId(),
+ item.getAmount(),
+ item.getDamage()
+ );
+ EntityItem entity = new EntityItem(world, loc.getX(), loc.getY(), loc.getZ(), stack);
entity.c = 10;
world.a(entity);
return new CraftItemDrop(world.getServer(), entity);
@@ -135,8 +136,7 @@ public class CraftWorld implements World {
return dropItem(loc, item);
}
- public Arrow spawnArrow(Location loc, Vector velocity, float speed,
- float spread) {
+ public Arrow spawnArrow(Location loc, Vector velocity, float speed, float spread) {
EntityArrow arrow = new EntityArrow(world);
arrow.c(loc.getX(), loc.getY(), loc.getZ(), 0, 0);
world.a(arrow);
@@ -146,48 +146,54 @@ public class CraftWorld implements World {
public Minecart spawnMinecart(Location loc) {
EntityMinecart minecart = new EntityMinecart(
- world,
- loc.getX(), loc.getY(), loc.getZ(),
- CraftMinecart.Type.Minecart.getID());
+ world,
+ loc.getX(),
+ loc.getY(),
+ loc.getZ(),
+ CraftMinecart.Type.Minecart.getId()
+ );
world.a(minecart);
return new CraftMinecart(world.getServer(), minecart);
}
public StorageMinecart spawnStorageMinecart(Location loc) {
EntityMinecart minecart = new EntityMinecart(
- world,
- loc.getX(), loc.getY(), loc.getZ(),
- CraftMinecart.Type.StorageMinecart.getID());
+ world,
+ loc.getX(),
+ loc.getY(),
+ loc.getZ(),
+ CraftMinecart.Type.StorageMinecart.getId()
+ );
world.a(minecart);
return new CraftStorageMinecart(world.getServer(), minecart);
}
public PoweredMinecart spawnPoweredMinecart(Location loc) {
EntityMinecart minecart = new EntityMinecart(
- world,
- loc.getX(), loc.getY(), loc.getZ(),
- CraftMinecart.Type.PoweredMinecart.getID());
+ world,
+ loc.getX(),
+ loc.getY(),
+ loc.getZ(),
+ CraftMinecart.Type.PoweredMinecart.getId()
+ );
world.a(minecart);
return new CraftPoweredMinecart(world.getServer(), minecart);
}
public Boat spawnBoat(Location loc) {
- EntityBoat boat =
- new EntityBoat(world, loc.getX(), loc.getY(), loc.getZ());
+ EntityBoat boat = new EntityBoat(world, loc.getX(), loc.getY(), loc.getZ());
world.a(boat);
return new CraftBoat(world.getServer(), boat);
}
public boolean generateTree(Location loc) {
WorldGenTrees treeGen = new WorldGenTrees();
- return treeGen.a(world, rand,
- loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
+ return treeGen.a(world, rand, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
}
public boolean generateBigTree(Location loc) {
WorldGenBigTree treeGen = new WorldGenBigTree();
- return treeGen.a(world, rand,
- loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
+ return treeGen.a(world, rand, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
}
public CraftEntity toCraftEntity(net.minecraft.server.Entity entity) {
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java
index cf75291a..f7743c52 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java
@@ -25,7 +25,7 @@ public class CraftBlockState implements BlockState {
this.x = block.getX();
this.y = block.getY();
this.z = block.getZ();
- this.type = block.getTypeID();
+ this.type = block.getTypeId();
this.light = block.getLightLevel();
this.chunk = (CraftChunk)block.getChunk();
@@ -114,15 +114,15 @@ public class CraftBlockState implements BlockState {
* @param type Material to change this block to
*/
public void setType(final Material type) {
- setTypeID(type.getID());
+ setTypeId(type.getId());
}
/**
- * 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
*/
- public void setTypeID(final int type) {
+ public void setTypeId(final int type) {
this.type = type;
world.getHandle().e(x, y, z, type);
@@ -135,15 +135,15 @@ public class CraftBlockState implements BlockState {
* @return block type
*/
public Material getType() {
- return Material.getMaterial(getTypeID());
+ return Material.getMaterial(getTypeId());
}
/**
- * Gets the type-ID of this block
+ * Gets the type-id of this block
*
- * @return block type-ID
+ * @return block type-id
*/
- public int getTypeID() {
+ public int getTypeId() {
return type;
}
@@ -170,7 +170,7 @@ public class CraftBlockState implements BlockState {
synchronized (block) {
if (block.getType() != this.getType()) {
if (force) {
- block.setTypeID(this.getTypeID());
+ block.setTypeId(this.getTypeId());
} else {
return false;
}