summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/bukkit
diff options
context:
space:
mode:
authorErik Broes <erikbroes@grum.nl>2011-05-14 16:29:42 +0200
committerErik Broes <erikbroes@grum.nl>2011-05-15 13:41:46 +0200
commit309846d732849b68e382c53bf3a0d7a6dfd82579 (patch)
tree020932a024cd2fb20895f5834a2bde7dbdfea583 /src/main/java/org/bukkit
parente54d8c33529b9495b9ca1a610dc2ff9fc5ac84b5 (diff)
downloadcraftbukkit-309846d732849b68e382c53bf3a0d7a6dfd82579.tar
craftbukkit-309846d732849b68e382c53bf3a0d7a6dfd82579.tar.gz
craftbukkit-309846d732849b68e382c53bf3a0d7a6dfd82579.tar.lz
craftbukkit-309846d732849b68e382c53bf3a0d7a6dfd82579.tar.xz
craftbukkit-309846d732849b68e382c53bf3a0d7a6dfd82579.zip
Whitespace + general cleanup
Diffstat (limited to 'src/main/java/org/bukkit')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/CraftChunk.java10
-rw-r--r--src/main/java/org/bukkit/craftbukkit/CraftServer.java6
-rw-r--r--src/main/java/org/bukkit/craftbukkit/CraftWorld.java14
-rw-r--r--src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java15
-rw-r--r--src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java4
-rw-r--r--src/main/java/org/bukkit/craftbukkit/block/CraftChest.java2
-rw-r--r--src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java2
-rw-r--r--src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java66
-rw-r--r--src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java4
-rw-r--r--src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java4
-rw-r--r--src/main/java/org/bukkit/craftbukkit/entity/CraftStorageMinecart.java2
-rw-r--r--src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java6
-rw-r--r--src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java2
-rw-r--r--src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java30
-rw-r--r--src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java22
-rw-r--r--src/main/java/org/bukkit/craftbukkit/inventory/CraftSlot.java4
-rw-r--r--src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java2
-rw-r--r--src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java2
-rw-r--r--src/main/java/org/bukkit/craftbukkit/scheduler/CraftWorker.java2
-rw-r--r--src/main/java/org/bukkit/craftbukkit/util/Java15Compat.java2
-rw-r--r--src/main/java/org/bukkit/craftbukkit/util/ShortConsoleLogFormatter.java2
21 files changed, 101 insertions, 102 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
index 06df2b14..ca4be8ce 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
@@ -43,7 +43,7 @@ public class CraftChunk implements Chunk {
void breakLink() {
weakChunk.clear();
- }
+ }
public int getX() {
return x;
@@ -60,15 +60,15 @@ public class CraftChunk implements Chunk {
public Block getBlock(int x, int y, int z) {
int pos = (x & 0xF) << 11 | (z & 0xF) << 7 | (y & 0x7F);
- Block block = this.cache.get( pos );
+ Block block = this.cache.get(pos);
if (block == null) {
- Block newBlock = new CraftBlock( this, (getX() << 4) | (x & 0xF), y & 0x7F, (getZ() << 4) | (z & 0xF) );
- Block oldBlock = this.cache.put( pos, newBlock );
+ Block newBlock = new CraftBlock(this, (getX() << 4) | (x & 0xF), y & 0x7F, (getZ() << 4) | (z & 0xF));
+ Block oldBlock = this.cache.put(pos, newBlock);
if(oldBlock == null) {
block = newBlock;
} else {
block = oldBlock;
- }
+ }
}
return block;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 9ac65d54..04246e2f 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -267,7 +267,7 @@ public final class CraftServer implements Server {
// NOTE: Should only be called from MinecraftServer.b()
public boolean dispatchCommand(CommandSender sender, ServerCommand serverCommand) {
- if ( commandMap.dispatch(sender, serverCommand.command) ) {
+ if (commandMap.dispatch(sender, serverCommand.command)) {
return true;
}
return console.consoleCommandHandler.handle(serverCommand);
@@ -279,7 +279,7 @@ public final class CraftServer implements Server {
return true;
}
- if ( ! sender.isOp() ) {
+ if (!sender.isOp()) {
return false;
}
@@ -457,7 +457,7 @@ public final class CraftServer implements Server {
private final String prefix;
CommandListener(CommandSender commandSender) {
this.commandSender = commandSender;
- String[] parts = commandSender.getClass().getName().split( "\\." );
+ String[] parts = commandSender.getClass().getName().split("\\.");
this.prefix = parts[parts.length-1];
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index c31d62ed..2b38b2bb 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -47,13 +47,13 @@ public class CraftWorld implements World {
server.addWorld(this);
}
- public void preserveChunk( CraftChunk chunk ) {
+ public void preserveChunk(CraftChunk chunk) {
chunk.breakLink();
- unloadedChunks.put( (chunk.getX() << 16) + chunk.getZ(), chunk );
+ unloadedChunks.put((chunk.getX() << 16) + chunk.getZ(), chunk);
}
- public Chunk popPreservedChunk( int x, int z ) {
- return unloadedChunks.remove( (x << 16) + z );
+ public Chunk popPreservedChunk(int x, int z) {
+ return unloadedChunks.remove((x << 16) + z);
}
public Block getBlockAt(int x, int y, int z) {
@@ -97,7 +97,7 @@ public class CraftWorld implements World {
}
public boolean isChunkLoaded(int x, int z) {
- return provider.isChunkLoaded( x, z );
+ return provider.isChunkLoaded(x, z);
}
public Chunk[] getLoadedChunks() {
@@ -285,7 +285,7 @@ public class CraftWorld implements World {
EntityItem entity = new EntityItem(world, loc.getX(), loc.getY(), loc.getZ(), stack);
entity.pickupDelay = 10;
world.addEntity(entity);
- //TODO this is inconsistent with how Entity.getBukkitEntity() works.
+ // TODO this is inconsistent with how Entity.getBukkitEntity() works.
// However, this entity is not at the moment backed by a server entity class so it may be left.
return new CraftItem(world.getServer(), entity);
}
@@ -433,7 +433,7 @@ public class CraftWorld implements World {
public void setFullTime(long time) {
world.setTime(time);
- //Forces the client to update to the new time immediately
+ // Forces the client to update to the new time immediately
for (Player p: getPlayers()) {
CraftPlayer cp = (CraftPlayer) p;
cp.getHandle().netServerHandler.sendPacket(new Packet4UpdateTime(time));
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
index 68249b59..ce1c7974 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
@@ -245,11 +245,10 @@ public class CraftBlock implements Block {
BlockFace[] values = BlockFace.values();
for (BlockFace face : values) {
- if (
- (this.getX() + face.getModX() == block.getX()) &&
- (this.getY() + face.getModY() == block.getY()) &&
- (this.getZ() + face.getModZ() == block.getZ())
- ) {
+ if ((this.getX() + face.getModX() == block.getX()) &&
+ (this.getY() + face.getModY() == block.getY()) &&
+ (this.getZ() + face.getModZ() == block.getZ())
+ ) {
return face;
}
}
@@ -286,7 +285,7 @@ public class CraftBlock implements Block {
return BlockFace.SELF;
}
}
-
+
public static int blockFaceToNotch(BlockFace face) {
switch(face) {
case DOWN:
@@ -302,7 +301,7 @@ public class CraftBlock implements Block {
case SOUTH:
return 5;
default:
- return 7; //Good as anything here, but technically invalid
+ return 7; // Good as anything here, but technically invalid
}
}
@@ -371,7 +370,7 @@ public class CraftBlock implements Block {
}
@Override
- public boolean equals( Object o ) {
+ public boolean equals(Object o) {
return this == o;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java
index ad5bc042..1678bbf8 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java
@@ -34,8 +34,8 @@ public class CraftBlockState implements BlockState {
createData(block.getData());
}
- public static BlockState getBlockState( net.minecraft.server.World world, int x, int y, int z) {
- return new CraftBlockState( ((WorldServer) world).getWorld().getBlockAt(x, y, z) );
+ public static BlockState getBlockState(net.minecraft.server.World world, int x, int y, int z) {
+ return new CraftBlockState(((WorldServer) world).getWorld().getBlockAt(x, y, z));
}
/**
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java
index 5d1c963e..42c2d6e1 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java
@@ -9,7 +9,7 @@ import org.bukkit.inventory.Inventory;
/**
* Represents a chest.
- *
+ *
* @author sk89q
*/
public class CraftChest extends CraftBlockState implements Chest {
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java b/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java
index f266ece4..5b1fe8aa 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java
@@ -9,7 +9,7 @@ import org.bukkit.inventory.Inventory;
/**
* Represents a furnace.
- *
+ *
* @author sk89q
*/
public class CraftFurnace extends CraftBlockState implements Furnace {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 841e4c19..34ec97b7 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -20,62 +20,62 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
this.entity = entity;
}
- public static CraftEntity getEntity( CraftServer server, Entity entity) {
+ public static CraftEntity getEntity(CraftServer server, Entity entity) {
/**
* Order is *EXTREMELY* important -- keep it right! =D
*/
if (entity instanceof EntityLiving) {
// Players
if (entity instanceof EntityHuman) {
- if (entity instanceof EntityPlayer) { return new CraftPlayer( server, (EntityPlayer) entity); }
- else { return new CraftHumanEntity( server, (EntityHuman) entity); }
+ if (entity instanceof EntityPlayer) { return new CraftPlayer(server, (EntityPlayer) entity); }
+ else { return new CraftHumanEntity(server, (EntityHuman) entity); }
}
else if (entity instanceof EntityCreature) {
// Animals
if (entity instanceof EntityAnimal) {
- if (entity instanceof EntityChicken) { return new CraftChicken( server, (EntityChicken) entity); }
- else if (entity instanceof EntityCow) { return new CraftCow( server, (EntityCow) entity); }
- else if (entity instanceof EntityPig) { return new CraftPig( server, (EntityPig) entity); }
- else if (entity instanceof EntityWolf) { return new CraftWolf( server, (EntityWolf) entity); }
- else if (entity instanceof EntitySheep) { return new CraftSheep( server, (EntitySheep) entity); }
- else { return new CraftAnimals( server, (EntityAnimal) entity); }
+ if (entity instanceof EntityChicken) { return new CraftChicken(server, (EntityChicken) entity); }
+ else if (entity instanceof EntityCow) { return new CraftCow(server, (EntityCow) entity); }
+ else if (entity instanceof EntityPig) { return new CraftPig(server, (EntityPig) entity); }
+ else if (entity instanceof EntityWolf) { return new CraftWolf(server, (EntityWolf) entity); }
+ else if (entity instanceof EntitySheep) { return new CraftSheep(server, (EntitySheep) entity); }
+ else { return new CraftAnimals(server, (EntityAnimal) entity); }
}
// Monsters
else if (entity instanceof EntityMonster) {
if (entity instanceof EntityZombie) {
- if (entity instanceof EntityPigZombie) { return new CraftPigZombie( server, (EntityPigZombie) entity); }
- else { return new CraftZombie( server, (EntityZombie) entity); }
+ if (entity instanceof EntityPigZombie) { return new CraftPigZombie(server, (EntityPigZombie) entity); }
+ else { return new CraftZombie(server, (EntityZombie) entity); }
}
- else if (entity instanceof EntityCreeper) { return new CraftCreeper( server, (EntityCreeper) entity); }
- else if (entity instanceof EntityGiantZombie) { return new CraftGiant( server, (EntityGiantZombie) entity); }
- else if (entity instanceof EntitySkeleton) { return new CraftSkeleton( server, (EntitySkeleton) entity); }
- else if (entity instanceof EntitySpider) { return new CraftSpider( server, (EntitySpider) entity); }
+ else if (entity instanceof EntityCreeper) { return new CraftCreeper(server, (EntityCreeper) entity); }
+ else if (entity instanceof EntityGiantZombie) { return new CraftGiant(server, (EntityGiantZombie) entity); }
+ else if (entity instanceof EntitySkeleton) { return new CraftSkeleton(server, (EntitySkeleton) entity); }
+ else if (entity instanceof EntitySpider) { return new CraftSpider(server, (EntitySpider) entity); }
- else { return new CraftMonster( server, (EntityMonster) entity); }
+ else { return new CraftMonster(server, (EntityMonster) entity); }
}
// Water Animals
else if (entity instanceof EntityWaterAnimal) {
- if (entity instanceof EntitySquid) { return new CraftSquid( server, (EntitySquid) entity); }
- else { return new CraftWaterMob( server, (EntityWaterAnimal) entity); }
+ if (entity instanceof EntitySquid) { return new CraftSquid(server, (EntitySquid) entity); }
+ else { return new CraftWaterMob(server, (EntityWaterAnimal) entity); }
}
- else { return new CraftCreature( server, (EntityCreature) entity); }
+ else { return new CraftCreature(server, (EntityCreature) entity); }
}
// Slimes are a special (and broken) case
- else if (entity instanceof EntitySlime) { return new CraftSlime( server, (EntitySlime) entity); }
+ else if (entity instanceof EntitySlime) { return new CraftSlime(server, (EntitySlime) entity); }
// Flying
else if (entity instanceof EntityFlying) {
- if (entity instanceof EntityGhast) { return new CraftGhast( server, (EntityGhast) entity); }
- else { return new CraftFlying( server, (EntityFlying) entity); }
+ if (entity instanceof EntityGhast) { return new CraftGhast(server, (EntityGhast) entity); }
+ else { return new CraftFlying(server, (EntityFlying) entity); }
}
else { return new CraftLivingEntity(server, (EntityLiving) entity); }
}
- else if (entity instanceof EntityArrow) { return new CraftArrow( server, (EntityArrow) entity); }
- else if (entity instanceof EntityBoat) { return new CraftBoat( server, (EntityBoat) entity); }
- else if (entity instanceof EntityEgg) { return new CraftEgg( server, (EntityEgg) entity); }
- else if (entity instanceof EntityFallingSand) { return new CraftFallingSand( server, (EntityFallingSand) entity); }
- else if (entity instanceof EntityFireball) { return new CraftFireball( server, (EntityFireball) entity); }
- else if (entity instanceof EntityFish) { return new CraftFish( server, (EntityFish) entity); }
- else if (entity instanceof EntityItem) { return new CraftItem( server, (EntityItem) entity); }
+ else if (entity instanceof EntityArrow) { return new CraftArrow(server, (EntityArrow) entity); }
+ else if (entity instanceof EntityBoat) { return new CraftBoat(server, (EntityBoat) entity); }
+ else if (entity instanceof EntityEgg) { return new CraftEgg(server, (EntityEgg) entity); }
+ else if (entity instanceof EntityFallingSand) { return new CraftFallingSand(server, (EntityFallingSand) entity); }
+ else if (entity instanceof EntityFireball) { return new CraftFireball(server, (EntityFireball) entity); }
+ else if (entity instanceof EntityFish) { return new CraftFish(server, (EntityFish) entity); }
+ else if (entity instanceof EntityItem) { return new CraftItem(server, (EntityItem) entity); }
else if (entity instanceof EntityWeather) {
if (entity instanceof EntityWeatherStorm) {
return new CraftLightningStrike(server, (EntityWeatherStorm)entity);
@@ -93,10 +93,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
return new CraftMinecart(server, mc);
}
}
- else if (entity instanceof EntityPainting) { return new CraftPainting( server, (EntityPainting) entity); }
- else if (entity instanceof EntitySnowball) { return new CraftSnowball( server, (EntitySnowball) entity); }
- else if (entity instanceof EntityTNTPrimed) { return new CraftTNTPrimed( server, (EntityTNTPrimed) entity); }
- else throw new IllegalArgumentException( "Unknown entity" );
+ else if (entity instanceof EntityPainting) { return new CraftPainting(server, (EntityPainting) entity); }
+ else if (entity instanceof EntitySnowball) { return new CraftSnowball(server, (EntitySnowball) entity); }
+ else if (entity instanceof EntityTNTPrimed) { return new CraftTNTPrimed(server, (EntityTNTPrimed) entity); }
+ else throw new IllegalArgumentException("Unknown entity");
}
public Location getLocation() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
index b7b2d63e..27b7aee3 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -13,7 +13,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
public CraftHumanEntity(final CraftServer server, final EntityHuman entity) {
super(server, entity);
- this.inventory = new CraftInventoryPlayer( entity.inventory );
+ this.inventory = new CraftInventoryPlayer(entity.inventory);
}
public String getName() {
@@ -28,7 +28,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
public void setHandle(final EntityHuman entity) {
super.setHandle((EntityHuman)entity);
this.entity = entity;
- this.inventory = new CraftInventoryPlayer( entity.inventory );
+ this.inventory = new CraftInventoryPlayer(entity.inventory);
}
public PlayerInventory getInventory() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 55d80dde..0ae97517 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -197,8 +197,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
manager.server.tracker.untrackEntity(entity);
int cx = (int) location.getBlockX() >> 4;
int cz = (int) location.getBlockZ() >> 4;
- for (int x = -10 ; x <= 10 ; x++ ) {
- for (int z = -10 ; z <= 10 ; z++ ) {
+ for (int x = -10 ; x <= 10 ; x++) {
+ for (int z = -10 ; z <= 10 ; z++) {
ChunkCoordIntPair chunkPosition = new ChunkCoordIntPair(cx + x, cz + z);
if (entity.g.remove(chunkPosition)) {
newEntity.g.add(chunkPosition);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftStorageMinecart.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftStorageMinecart.java
index 4f32bbdf..86d7f050 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftStorageMinecart.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftStorageMinecart.java
@@ -17,7 +17,7 @@ public class CraftStorageMinecart extends CraftMinecart implements StorageMineca
public CraftStorageMinecart(CraftServer server, EntityMinecart entity) {
super(server, entity);
- inventory = new CraftInventory( entity );
+ inventory = new CraftInventory(entity);
}
public Inventory getInventory() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java
index ffd46dc6..9e69da70 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java
@@ -30,7 +30,7 @@ public class CraftWolf extends CraftAnimals implements Wolf {
public void setSitting(boolean sitting) {
getHandle().setSitting(sitting);
// TODO determine what the following would do - it is affected every time a player makes their wolf sit or stand
- //getHandle().ay = false;
+ // getHandle().ay = false;
setPath((PathEntity) null);
}
@@ -59,9 +59,9 @@ public class CraftWolf extends CraftAnimals implements Wolf {
/* Set owner */
// TODO persist owner to the persistence store
if (owner instanceof Player) {
- setOwnerName(((Player) owner).getName());
+ setOwnerName(((Player) owner).getName());
} else {
- setOwnerName("");
+ setOwnerName("");
}
} else {
setTamed(false); /* Make him not tame */
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 736896f6..4f879b98 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -125,7 +125,7 @@ public class CraftEventFactory {
/**
* Player Interact event
*/
-
+
public static PlayerInteractEvent callPlayerInteractEvent(EntityHuman who, Action action, ItemStack itemstack) {
if (action != Action.LEFT_CLICK_AIR && action != Action.RIGHT_CLICK_AIR) {
throw new IllegalArgumentException();
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
index bba47de7..9cc8d436 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
@@ -34,7 +34,7 @@ public class CraftInventory implements org.bukkit.inventory.Inventory {
ItemStack[] items = new ItemStack[getSize()];
net.minecraft.server.ItemStack[] mcItems = getInventory().getContents();
- for (int i = 0; i < mcItems.length; i++ ) {
+ for (int i = 0; i < mcItems.length; i++) {
items[i] = mcItems[i] == null ? null : new CraftItemStack(mcItems[i]);
}
@@ -48,18 +48,18 @@ public class CraftInventory implements org.bukkit.inventory.Inventory {
net.minecraft.server.ItemStack[] mcItems = getInventory().getContents();
- for (int i = 0; i < items.length; i++ ) {
+ for (int i = 0; i < items.length; i++) {
ItemStack item = items[i];
if (item == null || item.getTypeId() <= 0) {
mcItems[i] = null;
} else {
- mcItems[i] = new net.minecraft.server.ItemStack( item.getTypeId(), item.getAmount(), item.getDurability());
+ mcItems[i] = new net.minecraft.server.ItemStack(item.getTypeId(), item.getAmount(), item.getDurability());
}
}
}
public void setItem(int index, ItemStack item) {
- getInventory().setItem(index, (item == null ? null : new net.minecraft.server.ItemStack( item.getTypeId(), item.getAmount(), item.getDurability())));
+ getInventory().setItem(index, (item == null ? null : new net.minecraft.server.ItemStack(item.getTypeId(), item.getAmount(), item.getDurability())));
}
public boolean contains(int materialId) {
@@ -121,7 +121,7 @@ public class CraftInventory implements org.bukkit.inventory.Inventory {
for (int i = 0; i < inventory.length; i++) {
ItemStack item = inventory[i];
if (item != null && item.getTypeId() == materialId) {
- slots.put( i, item );
+ slots.put(i, item);
}
}
return slots;
@@ -137,7 +137,7 @@ public class CraftInventory implements org.bukkit.inventory.Inventory {
ItemStack[] inventory = getContents();
for (int i = 0; i < inventory.length; i++) {
if (item.equals(inventory[i])) {
- slots.put( i, inventory[i] );
+ slots.put(i, inventory[i]);
}
}
}
@@ -238,11 +238,11 @@ public class CraftInventory implements org.bukkit.inventory.Inventory {
} else {
// More than a single stack!
if (item.getAmount() > getMaxItemStack()) {
- setItem( firstFree, new CraftItemStack(item.getTypeId(), getMaxItemStack(), item.getDurability()));
+ setItem(firstFree, new CraftItemStack(item.getTypeId(), getMaxItemStack(), item.getDurability()));
item.setAmount(item.getAmount() - getMaxItemStack());
} else {
// Just store it
- setItem( firstFree, item );
+ setItem(firstFree, item);
break;
}
}
@@ -256,13 +256,13 @@ public class CraftInventory implements org.bukkit.inventory.Inventory {
// Check if it fully fits
if (amount + partialAmount <= maxAmount) {
- partialItem.setAmount( amount + partialAmount );
+ partialItem.setAmount(amount + partialAmount);
break;
}
// It fits partially
- partialItem.setAmount( maxAmount );
- item.setAmount( amount + partialAmount - maxAmount );
+ partialItem.setAmount(maxAmount);
+ item.setAmount(amount + partialAmount - maxAmount);
}
}
}
@@ -283,7 +283,7 @@ public class CraftInventory implements org.bukkit.inventory.Inventory {
// Drat! we don't have this type in the inventory
if (first == -1) {
- item.setAmount( toDelete );
+ item.setAmount(toDelete);
leftover.put(i, item);
break;
} else {
@@ -293,11 +293,11 @@ public class CraftInventory implements org.bukkit.inventory.Inventory {
if (amount <= toDelete) {
toDelete -= amount;
// clear the slot, all used up
- clear( first );
+ clear(first);
} else {
// split the stack and store
- itemStack.setAmount( amount - toDelete );
- setItem( first, itemStack );
+ itemStack.setAmount(amount - toDelete);
+ setItem(first, itemStack);
toDelete = 0;
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java
index 72c6a478..ee51f9d2 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java
@@ -19,11 +19,11 @@ public class CraftInventoryPlayer extends CraftInventory implements PlayerInvent
}
public ItemStack getItemInHand() {
- return new CraftItemStack( getInventory().getItemInHand() );
+ return new CraftItemStack(getInventory().getItemInHand());
}
public void setItemInHand(ItemStack stack) {
- setItem( getHeldItemSlot(), stack );
+ setItem(getHeldItemSlot(), stack);
}
public int getHeldItemSlot() {
@@ -31,42 +31,42 @@ public class CraftInventoryPlayer extends CraftInventory implements PlayerInvent
}
public ItemStack getHelmet() {
- return getItem( getSize() + 3 );
+ return getItem(getSize() + 3);
}
public ItemStack getChestplate() {
- return getItem( getSize() + 2 );
+ return getItem(getSize() + 2);
}
public ItemStack getLeggings() {
- return getItem( getSize() + 1 );
+ return getItem(getSize() + 1);
}
public ItemStack getBoots() {
- return getItem( getSize() + 0 );
+ return getItem(getSize() + 0);
}
public void setHelmet(ItemStack helmet) {
- setItem( getSize() + 3, helmet );
+ setItem(getSize() + 3, helmet);
}
public void setChestplate(ItemStack chestplate) {
- setItem( getSize() + 2, chestplate );
+ setItem(getSize() + 2, chestplate);
}
public void setLeggings(ItemStack leggings) {
- setItem( getSize() + 1, leggings );
+ setItem(getSize() + 1, leggings);
}
public void setBoots(ItemStack boots) {
- setItem( getSize() + 0, boots );
+ setItem(getSize() + 0, boots);
}
public CraftItemStack[] getArmorContents() {
net.minecraft.server.ItemStack[] mcItems = getInventory().getArmorContents();
CraftItemStack[] ret = new CraftItemStack[mcItems.length];
- for (int i = 0; i < mcItems.length; i++ ) {
+ for (int i = 0; i < mcItems.length; i++) {
ret[i] = new CraftItemStack(mcItems[i]);
}
return ret;
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftSlot.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftSlot.java
index a44c1b90..3899eb75 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftSlot.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftSlot.java
@@ -12,7 +12,7 @@ public class CraftSlot implements org.bukkit.inventory.Slot {
}
public Inventory getInventory() {
- return new CraftInventory( slot.inventory );
+ return new CraftInventory(slot.inventory);
}
public int getIndex() {
@@ -20,6 +20,6 @@ public class CraftSlot implements org.bukkit.inventory.Slot {
}
public ItemStack getItem() {
- return new CraftItemStack( slot.getItem() );
+ return new CraftItemStack(slot.getItem());
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
index 222a3158..707de087 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
@@ -59,7 +59,7 @@ public class CraftScheduler implements BukkitScheduler, Runnable {
firstTick = first.getExecutionTick();
- if (currentTick >= firstTick ) {
+ if (currentTick >= firstTick) {
schedulerQueue.remove(first);
processTask(first);
if (first.getPeriod()>=0) {
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java
index d5cc4f4e..4227dbc9 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java
@@ -91,7 +91,7 @@ public class CraftTask implements Comparable<Object>, BukkitTask {
}
@Override
- public boolean equals( Object other ) {
+ public boolean equals(Object other) {
if (other == null) {
return false;
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftWorker.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftWorker.java
index 42f9bb9b..94aa411c 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftWorker.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftWorker.java
@@ -74,7 +74,7 @@ public class CraftWorker implements Runnable, BukkitWorker {
}
@Override
- public boolean equals( Object other ) {
+ public boolean equals(Object other) {
if (other == null) {
return false;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Java15Compat.java b/src/main/java/org/bukkit/craftbukkit/util/Java15Compat.java
index a9ccc70b..c9c5f284 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/Java15Compat.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/Java15Compat.java
@@ -21,7 +21,7 @@ public class Java15Compat {
if (original.length >= start && 0 <= start) {
if (start <= end) {
int length = end - start;
- int copyLength = Math.min( length, original.length - start);
+ int copyLength = Math.min(length, original.length - start);
long[] copy = (long[]) Array.newInstance(original.getClass().getComponentType(), length);
System.arraycopy(original, start, copy, 0, copyLength);
return copy;
diff --git a/src/main/java/org/bukkit/craftbukkit/util/ShortConsoleLogFormatter.java b/src/main/java/org/bukkit/craftbukkit/util/ShortConsoleLogFormatter.java
index d8282580..8d8b4e73 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/ShortConsoleLogFormatter.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/ShortConsoleLogFormatter.java
@@ -55,5 +55,5 @@ public class ShortConsoleLogFormatter extends Formatter {
return builder.toString();
}
-
+
}