Javadoc and Formatting fixes. (#619)

Javadoc and Formatting fixes.

Also, extremely minor code changes which have been tested.
This commit is only part one of two commits that aim to fix problems with formatting in our project. In part two I will modify the Google Java Style Guide (since it closely matches our code style) for our project so there is guidance on how to format and document. 

* Updated PlotSquared URL
* Removed plugin acronyms
* Fixed a typo
* Fixed grammar
* Use modern block id's
* Update YouTube video URL
This commit is contained in:
Matt
2020-10-05 13:41:41 -04:00
committed by GitHub
parent b06d943f7c
commit 96dcb95b7c
393 changed files with 6537 additions and 4700 deletions

View File

@ -37,6 +37,7 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
@ -276,7 +277,7 @@ public class MCAChunk implements IChunk {
int ordinal = blocks[i];
int palette = blockToPalette[ordinal];
if (palette == Integer.MAX_VALUE) {
// BlockState state = BlockTypesCache.states[ordinal];
//BlockState state = BlockTypesCache.states[ordinal];
blockToPalette[ordinal] = palette = num_palette;
paletteToBlock[num_palette] = ordinal;
num_palette++;
@ -308,7 +309,7 @@ public class MCAChunk implements IChunk {
String valueStr = value.toString();
if (Character.isUpperCase(valueStr.charAt(0))) {
System.out.println("Invalid uppercase value " + value);
valueStr = valueStr.toLowerCase();
valueStr = valueStr.toLowerCase(Locale.ROOT);
}
out.writeNamedTag(key, valueStr);
}
@ -337,13 +338,13 @@ public class MCAChunk implements IChunk {
}
// out.writeNamedTagName("BlockLight", NBTConstants.TYPE_BYTE_ARRAY);
// out.writeInt(2048);
// out.write(blockLight, layer << 11, 1 << 11);
//
// out.writeNamedTagName("SkyLight", NBTConstants.TYPE_BYTE_ARRAY);
// out.writeInt(2048);
// out.write(skyLight, layer << 11, 1 << 11);
/* out.writeNamedTagName("BlockLight", NBTConstants.TYPE_BYTE_ARRAY);
out.writeInt(2048);
out.write(blockLight, layer << 11, 1 << 11);
out.writeNamedTagName("SkyLight", NBTConstants.TYPE_BYTE_ARRAY);
out.writeInt(2048);
out.write(skyLight, layer << 11, 1 << 11); */
out.writeEndTag();
@ -397,9 +398,13 @@ public class MCAChunk implements IChunk {
@Override
public boolean isEmpty() {
if (deleted) return true;
if (deleted) {
return true;
}
for (boolean hasSection : hasSections) {
if (hasSection) return false;
if (hasSection) {
return false;
}
}
return true;
}
@ -450,15 +455,19 @@ public class MCAChunk implements IChunk {
}
@Override public void removeSectionLighting(int layer, boolean sky) {}
@Override public void removeSectionLighting(int layer, boolean sky) {
}
@Override public void setFullBright(int layer) {}
@Override public void setFullBright(int layer) {
}
@Override
public void setLightLayer(int layer, char[] toSet) {}
public void setLightLayer(int layer, char[] toSet) {
}
@Override
public void setSkyLightLayer(int layer, char[] toSet) {}
public void setSkyLightLayer(int layer, char[] toSet) {
}
@Override
public void setEntity(CompoundTag entityTag) {

View File

@ -66,7 +66,8 @@ public class MCAFile extends ExtentBatchProcessorHolder implements Trimable, ICh
private RandomAccessFile raf;
private boolean deleted;
private int X, Z;
private int X;
private int Z;
private MCAChunk[] chunks;
private boolean[] chunkInitialized;
private Object[] locks;
@ -336,7 +337,7 @@ public class MCAFile extends ExtentBatchProcessorHolder implements Trimable, ICh
if (size != 0) {
try {
onEach.accept(getChunk(x, z));
} catch (Throwable ignore) {
} catch (Throwable ignored) {
}
}
}
@ -462,7 +463,9 @@ public class MCAFile extends ExtentBatchProcessorHolder implements Trimable, ICh
}
public void close() {
if (raf == null) return;
if (raf == null) {
return;
}
synchronized (raf) {
if (raf != null) {
flush(true);

View File

@ -100,7 +100,9 @@ public class StreamDelegate {
default: {
for (; index < keys.length; index++) {
byte[] key = keys[index];
if (key.length < nameLength) continue;
if (key.length < nameLength) {
continue;
}
if (key.length == nameLength) {
break;
} else {