Little bit of formatting

This commit is contained in:
Matthew Miller
2018-08-27 17:24:18 +10:00
parent fb5cb9a7bb
commit c931095736
46 changed files with 76 additions and 86 deletions

View File

@ -25,7 +25,6 @@ import com.sk89q.jnbt.CompoundTag;
import com.sk89q.jnbt.StringTag;
import com.sk89q.jnbt.Tag;
import com.sk89q.worldedit.blocks.TileEntityBlock;
import com.sk89q.worldedit.function.mask.Mask;
import com.sk89q.worldedit.registry.state.Property;
import java.util.Map;

View File

@ -200,7 +200,7 @@ public class Snapshot implements Comparable<Snapshot> {
public int compareTo(Snapshot o) {
if (o.date == null || date == null) {
// Remove the folder from the name
int i = name.indexOf("/"), j = o.name.indexOf("/");
int i = name.indexOf('/'), j = o.name.indexOf('/');
return name.substring((i > 0 ? 0 : i)).compareTo(o.name.substring((j > 0 ? 0 : j)));
} else {
return date.compareTo(o.date);

View File

@ -36,6 +36,6 @@ public interface SnapshotDateParser {
* @return date or null
*/
@Nullable
public Calendar detectDate(File file);
Calendar detectDate(File file);
}

View File

@ -88,7 +88,7 @@ public class TrueZipLegacyChunkStore extends LegacyChunkStore {
// Detect subfolder for the world's files
if (folder != null) {
if (!folder.equals("")) {
if (!folder.isEmpty()) {
file = folder + "/" + file;
}
} else {

View File

@ -87,7 +87,7 @@ public class TrueZipMcRegionChunkStore extends McRegionChunkStore {
protected InputStream getInputStream(String name, String worldName) throws IOException, DataException {
// Detect subfolder for the world's files
if (folder != null) {
if (!folder.equals("")) {
if (!folder.isEmpty()) {
name = folder + "/" + name;
}
} else {
@ -100,7 +100,7 @@ public class TrueZipMcRegionChunkStore extends McRegionChunkStore {
if (worldPattern.matcher(worldName).matches()) {
// Check for file
if (pattern.matcher(testEntry.getName()).matches()) {
folder = testEntry.getName().substring(0, testEntry.getName().lastIndexOf("/"));
folder = testEntry.getName().substring(0, testEntry.getName().lastIndexOf('/'));
name = folder + "/" + name;
break;
}

View File

@ -82,7 +82,7 @@ public class ZippedLegacyChunkStore extends LegacyChunkStore {
// Detect subfolder for the world's files
if (folder != null) {
if (!folder.equals("")) {
if (!folder.isEmpty()) {
file = folder + "/" + file;
}
} else {

View File

@ -76,7 +76,7 @@ public class ZippedMcRegionChunkStore extends McRegionChunkStore {
protected InputStream getInputStream(String name, String worldName) throws IOException, DataException {
// Detect subfolder for the world's files
if (folder != null) {
if (!folder.equals("")) {
if (!folder.isEmpty()) {
name = folder + "/" + name;
}
} else {
@ -86,7 +86,7 @@ public class ZippedMcRegionChunkStore extends McRegionChunkStore {
// Check for world
if (testEntry.getName().startsWith(worldName + "/")) {
if (pattern.matcher(testEntry.getName()).matches()) { // does entry end in .mca
folder = testEntry.getName().substring(0, testEntry.getName().lastIndexOf("/"));
folder = testEntry.getName().substring(0, testEntry.getName().lastIndexOf('/'));
name = folder + "/" + name;
break;
}