More OCD.

This commit is contained in:
gmcferrin 2013-01-09 23:07:32 -05:00
parent e193da2cd7
commit 4a4db675f1
10 changed files with 66 additions and 66 deletions

View File

@ -931,7 +931,7 @@ public class PlayerProfile {
skills.put(skillType, 0);
else //do them all
{
for(SkillType skill : SkillType.values()) //iterate over all items in the enumeration
for (SkillType skill : SkillType.values()) //iterate over all items in the enumeration
{
if (skill != SkillType.ALL) // skip the "all" value
skills.put(skill, 0);

View File

@ -106,11 +106,11 @@ public class BlockStoreConversionZDirectory implements Runnable {
this.zPos = this.cz * 16;
for (this.x = 0; this.x < 16; this.x++) {
for(this.z = 0; this.z < 16; this.z++) {
for (this.z = 0; this.z < 16; this.z++) {
this.cxPos = this.xPos + this.x;
this.czPos = this.zPos + this.z;
for(this.y2 = (64 * this.y); this.y2 < (64 * this.y + 64); this.y2++) {
for (this.y2 = (64 * this.y); this.y2 < (64 * this.y + 64); this.y2++) {
try {
if (!this.manager.isTrue(this.cxPos, this.y2, this.czPos, this.world))
continue;
@ -128,8 +128,8 @@ public class BlockStoreConversionZDirectory implements Runnable {
this.newManager.setFalse(this.cx * 16, 0, this.cz * 16, this.world);
this.currentChunk = (PrimitiveChunkStore) this.newManager.store.get(this.chunkName);
for(this.x = 0; this.x < 16; this.x++) {
for(this.z = 0; this.z < 16; this.z++) {
for (this.x = 0; this.x < 16; this.x++) {
for (this.z = 0; this.z < 16; this.z++) {
if (this.primitiveChunklet != null)
this.oldArray = this.primitiveChunklet.store[x][z];
if (this.primitiveExChunklet != null)
@ -149,7 +149,7 @@ public class BlockStoreConversionZDirectory implements Runnable {
this.manager.unloadChunk(this.cx, this.cz, this.world);
this.newManager.unloadChunk(this.cx, this.cz, this.world);
for(File yFile : dataDir.listFiles()) {
for (File yFile : dataDir.listFiles()) {
if (!yFile.exists())
continue;

View File

@ -249,7 +249,7 @@ public class Misc {
* @param quantity The amount of items to drop
*/
public static void randomDropItems(Location location, ItemStack is, int chance, int quantity) {
for(int i = 0; i < quantity; i++) {
for (int i = 0; i < quantity; i++) {
randomDropItem(location, is, chance);
}
}

View File

@ -50,7 +50,7 @@ public class Page {
public static void clearChat(Player player)
{
for(int x = 0; x < 20; x++)
for (int x = 0; x < 20; x++)
{
player.sendMessage("");
}
@ -70,14 +70,14 @@ public class Page {
if (args.length > 1 && Misc.isInt(args[1]) && Misc.getInt(args[1]) <= Page.getTotalPageNumber(address))
{
Page.clearChat(player);
for(String target : Page.grabPageContents(capitalized+" Guide", address, Misc.getInt(args[1])))
for (String target : Page.grabPageContents(capitalized+" Guide", address, Misc.getInt(args[1])))
{
player.sendMessage(target);
}
} else if (args.length == 1)
{
Page.clearChat(player);
for(String target : Page.grabPageContents(capitalized+" Guide", address, 1))
for (String target : Page.grabPageContents(capitalized+" Guide", address, 1))
{
player.sendMessage(target);
}

View File

@ -61,7 +61,7 @@ public class HashChunkletManager implements ChunkletManager {
File czDir = new File(cxDir, "" + cz);
if (!czDir.exists()) return;
for(int y = 0; y < 4; y++) {
for (int y = 0; y < 4; y++) {
File yFile = new File(czDir, "" + y);
if (!yFile.exists()) {
continue;
@ -78,7 +78,7 @@ public class HashChunkletManager implements ChunkletManager {
public void unloadChunk(int cx, int cz, World world) {
File dataDir = new File(world.getWorldFolder(), "mcmmo_data");
for(int y = 0; y < 4; y++) {
for (int y = 0; y < 4; y++) {
if (store.containsKey(world.getName() + "," + cx + "," + cz + "," + y)) {
File cxDir = new File(dataDir, "" + cx);
if (!cxDir.exists()) cxDir.mkdir();
@ -110,7 +110,7 @@ public class HashChunkletManager implements ChunkletManager {
if (!dataDir.exists())
dataDir.mkdirs();
for(String key : store.keySet()) {
for (String key : store.keySet()) {
String[] info = key.split(",");
if (worldName.equals(info[0])) {
File cxDir = new File(dataDir, "" + info[1]);
@ -130,7 +130,7 @@ public class HashChunkletManager implements ChunkletManager {
String worldName = world.getName();
for(String key : store.keySet()) {
for (String key : store.keySet()) {
String tempWorldName = key.split(",")[0];
if (tempWorldName.equals(worldName)) {
store.remove(key);
@ -141,14 +141,14 @@ public class HashChunkletManager implements ChunkletManager {
@Override
public void loadWorld(World world) {
//for(Chunk chunk : world.getLoadedChunks()) {
//for (Chunk chunk : world.getLoadedChunks()) {
// this.chunkLoaded(chunk.getX(), chunk.getZ(), world);
//}
}
@Override
public void saveAll() {
for(World world : Bukkit.getWorlds()) {
for (World world : Bukkit.getWorlds()) {
saveWorld(world);
}
}
@ -156,7 +156,7 @@ public class HashChunkletManager implements ChunkletManager {
@Override
public void unloadAll() {
saveAll();
for(World world : Bukkit.getWorlds()) {
for (World world : Bukkit.getWorlds()) {
unloadWorld(world);
}
}
@ -253,7 +253,7 @@ public class HashChunkletManager implements ChunkletManager {
@Override
public void cleanUp() {
for(String key : store.keySet()) {
for (String key : store.keySet()) {
if (store.get(key).isEmpty()) {
String[] info = key.split(",");
File dataDir = new File(Bukkit.getWorld(info[0]).getWorldFolder(), "mcmmo_data");

View File

@ -23,9 +23,9 @@ public class PrimitiveChunkletStore implements ChunkletStore {
@Override
public boolean isEmpty() {
for(int x = 0; x < 16; x++) {
for(int z = 0; z < 16; z++) {
for(int y = 0; y < 64; y++) {
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
for (int y = 0; y < 64; y++) {
if (store[x][z][y]) return false;
}
}
@ -35,9 +35,9 @@ public class PrimitiveChunkletStore implements ChunkletStore {
@Override
public void copyFrom(ChunkletStore otherStore) {
for(int x = 0; x < 16; x++) {
for(int z = 0; z < 16; z++) {
for(int y = 0; y < 64; y++) {
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
for (int y = 0; y < 64; y++) {
store[x][z][y] = otherStore.isTrue(x, y, z);
}
}

View File

@ -28,9 +28,9 @@ public class PrimitiveExChunkletStore implements ChunkletStore, Externalizable {
@Override
public boolean isEmpty() {
for(int x = 0; x < 16; x++) {
for(int z = 0; z < 16; z++) {
for(int y = 0; y < 64; y++) {
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
for (int y = 0; y < 64; y++) {
if (store[x][z][y]) return false;
}
}
@ -40,9 +40,9 @@ public class PrimitiveExChunkletStore implements ChunkletStore, Externalizable {
@Override
public void copyFrom(ChunkletStore otherStore) {
for(int x = 0; x < 16; x++) {
for(int z = 0; z < 16; z++) {
for(int y = 0; y < 64; y++) {
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
for (int y = 0; y < 64; y++) {
store[x][z][y] = otherStore.isTrue(x, y, z);
}
}
@ -54,13 +54,13 @@ public class PrimitiveExChunkletStore implements ChunkletStore, Externalizable {
byte[] buffer = new byte[2304]; // 2304 is 16*16*9
int bufferIndex = 0;
for(int x = 0; x < 16; x++) {
for(int z = 0; z < 16; z++) {
for(int y = 0; y < 64; y++) {
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
for (int y = 0; y < 64; y++) {
if (store[x][z][y]) {
byte[] temp = constructColumn(x, z);
for(int i = 0; i < 9; i++) {
for (int i = 0; i < 9; i++) {
buffer[bufferIndex] = temp[i];
bufferIndex++;
}
@ -86,8 +86,8 @@ public class PrimitiveExChunkletStore implements ChunkletStore, Externalizable {
int z = addressByteZ(temp[0]);
boolean[] yColumn = new boolean[64];
for(int i = 0; i < 8; i++) {
for(int j = 0; j < 8; j++) {
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 8; j++) {
yColumn[j + (i * 8)] = (temp[i + 1] & (1 << j)) != 0;
}
}
@ -132,7 +132,7 @@ public class PrimitiveExChunkletStore implements ChunkletStore, Externalizable {
int subColumnIndex = 8 * i;
int subColumnEnd = subColumnIndex + 8;
for(int y = subColumnIndex; y < subColumnEnd; y++) {
for (int y = subColumnIndex; y < subColumnEnd; y++) {
if (store[x][z][y]) {
yCompressed |= 1 << (y % 8);
}

View File

@ -172,7 +172,7 @@ public class HashChunkManager implements ChunkManager {
if (mobs.isEmpty() && pets.isEmpty())
return;
for(LivingEntity entity : world.getLivingEntities()) {
for (LivingEntity entity : world.getLivingEntities()) {
if (mobs.contains(entity.getUniqueId()))
addSpawnedMob(entity);
@ -192,14 +192,14 @@ public class HashChunkManager implements ChunkManager {
if (store.containsKey(world.getName() + "," + cx + "," + cz)) {
store.remove(world.getName() + "," + cx + "," + cz);
for(Entity entity : spawnedMobs) {
for (Entity entity : spawnedMobs) {
if (!isEntityInChunk(entity, cx, cz, world))
continue;
mobsToRemove.add(entity);
}
for(Entity entity : spawnedPets) {
for (Entity entity : spawnedPets) {
if (!isEntityInChunk(entity, cx, cz, world))
continue;
@ -222,7 +222,7 @@ public class HashChunkManager implements ChunkManager {
boolean unloaded = false;
if (!store.containsKey(world.getName() + "," + cx + "," + cz)) {
List<Entity> tempSpawnedMobs = new ArrayList<Entity>(spawnedMobs);
for(Entity entity : tempSpawnedMobs) {
for (Entity entity : tempSpawnedMobs) {
if (!isEntityInChunk(entity, cx, cz, world))
continue;
@ -233,7 +233,7 @@ public class HashChunkManager implements ChunkManager {
if (!unloaded) {
List<Entity> tempSpawnedPets = new ArrayList<Entity>(spawnedPets);
for(Entity entity : tempSpawnedPets) {
for (Entity entity : tempSpawnedPets) {
if (!isEntityInChunk(entity, cx, cz, world))
continue;
@ -253,7 +253,7 @@ public class HashChunkManager implements ChunkManager {
ChunkStore out = store.get(world.getName() + "," + cx + "," + cz);
List<Entity> tempSpawnedMobs = new ArrayList<Entity>(spawnedMobs);
for(Entity entity : tempSpawnedMobs) {
for (Entity entity : tempSpawnedMobs) {
if (!isEntityInChunk(entity, cx, cz, world))
continue;
@ -261,7 +261,7 @@ public class HashChunkManager implements ChunkManager {
}
List<Entity> tempSpawnedPets = new ArrayList<Entity>(spawnedPets);
for(Entity entity : tempSpawnedPets) {
for (Entity entity : tempSpawnedPets) {
if (!isEntityInChunk(entity, cx, cz, world))
continue;
@ -319,7 +319,7 @@ public class HashChunkManager implements ChunkManager {
String worldName = world.getName();
List<String> keys = new ArrayList<String>(store.keySet());
for(String key : keys) {
for (String key : keys) {
String[] info = key.split(",");
if (worldName.equals(info[0])) {
int cx = 0;
@ -337,7 +337,7 @@ public class HashChunkManager implements ChunkManager {
}
List<Entity> tempSpawnedMobs = new ArrayList<Entity>(spawnedMobs);
for(Entity entity : tempSpawnedMobs) {
for (Entity entity : tempSpawnedMobs) {
World entityWorld = entity.getWorld();
if (world != entityWorld)
@ -350,7 +350,7 @@ public class HashChunkManager implements ChunkManager {
}
List<Entity> tempSpawnedPets = new ArrayList<Entity>(spawnedPets);
for(Entity entity : tempSpawnedPets) {
for (Entity entity : tempSpawnedPets) {
World entityWorld = entity.getWorld();
if (world != entityWorld)
@ -372,7 +372,7 @@ public class HashChunkManager implements ChunkManager {
String worldName = world.getName();
List<String> keys = new ArrayList<String>(store.keySet());
for(String key : keys) {
for (String key : keys) {
String[] info = key.split(",");
if (worldName.equals(info[0])) {
int cx = 0;
@ -392,7 +392,7 @@ public class HashChunkManager implements ChunkManager {
safeToRemoveMobs = false;
List<Entity> tempSpawnedMobs = new ArrayList<Entity>(spawnedMobs);
for(Entity entity : tempSpawnedMobs) {
for (Entity entity : tempSpawnedMobs) {
World entityWorld = entity.getWorld();
if (world != entityWorld)
@ -405,7 +405,7 @@ public class HashChunkManager implements ChunkManager {
}
List<Entity> tempSpawnedPets = new ArrayList<Entity>(spawnedPets);
for(Entity entity : tempSpawnedPets) {
for (Entity entity : tempSpawnedPets) {
World entityWorld = entity.getWorld();
if (world != entityWorld)
@ -431,7 +431,7 @@ public class HashChunkManager implements ChunkManager {
public synchronized void saveAll() {
closeAll();
for(World world : Bukkit.getWorlds()) {
for (World world : Bukkit.getWorlds()) {
saveWorld(world);
}
}
@ -440,7 +440,7 @@ public class HashChunkManager implements ChunkManager {
public synchronized void unloadAll() {
closeAll();
for(World world : Bukkit.getWorlds()) {
for (World world : Bukkit.getWorlds()) {
unloadWorld(world);
}
}
@ -564,7 +564,7 @@ public class HashChunkManager implements ChunkManager {
boolean conversionSet = false;
for(BlockStoreConversionZDirectory converter : this.converters) {
for (BlockStoreConversionZDirectory converter : this.converters) {
if (converter == null)
continue;

View File

@ -82,9 +82,9 @@ public class PrimitiveChunkStore implements ChunkStore {
@Override
public boolean isEmpty() {
for(int x = 0; x < 16; x++) {
for(int z = 0; z < 16; z++) {
for(int y = 0; y < this.worldHeight; y++) {
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
for (int y = 0; y < this.worldHeight; y++) {
if (store[x][z][y]) return false;
}
}
@ -94,9 +94,9 @@ public class PrimitiveChunkStore implements ChunkStore {
@Override
public void copyFrom(ChunkletStore otherStore) {
for(int x = 0; x < 16; x++) {
for(int z = 0; z < 16; z++) {
for(int y = 0; y < this.worldHeight; y++) {
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
for (int y = 0; y < this.worldHeight; y++) {
store[x][z][y] = otherStore.isTrue(x, y, z);
}
}
@ -223,9 +223,9 @@ public class PrimitiveChunkStore implements ChunkStore {
private void fixArray() {
boolean[][][] temp = this.store;
this.store = new boolean[16][16][this.worldHeight];
for(int x = 0; x < 16; x++) {
for(int z = 0; z < 16; z++) {
for(int y = 0; y < this.worldHeight; y++) {
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
for (int y = 0; y < this.worldHeight; y++) {
try {
store[x][z][y] = temp[x][y][z];
}

View File

@ -10,8 +10,8 @@ public class PrimitiveExChunkletStoreTest {
@Before
public void populateAddresses() {
for(int x = 0; x < 16; x++) {
for(int z = 0; z < 16; z++) {
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
addresses[x][z] = PrimitiveExChunkletStore.makeAddressByte(x, z);
}
}
@ -25,8 +25,8 @@ public class PrimitiveExChunkletStoreTest {
@Test
public void addressReverseTest() {
for(int x = 0; x < 16; x++) {
for(int z = 0; z < 16; z++) {
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
assertEquals(x, PrimitiveExChunkletStore.addressByteX(addresses[x][z]));
assertEquals(z, PrimitiveExChunkletStore.addressByteZ(addresses[x][z]));
}