Update from sk89q/master

This commit is contained in:
Jesse Boyd
2018-09-03 00:10:38 +10:00
59 changed files with 231 additions and 200 deletions

View File

@ -27,13 +27,11 @@ import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.blocks.BaseItem;
import com.sk89q.worldedit.blocks.BaseItemStack;
import com.sk89q.worldedit.extension.platform.Platform;
import com.sk89q.worldedit.function.mask.BlockMask;
import com.sk89q.worldedit.function.mask.BlockTypeMask;
import com.sk89q.worldedit.function.mask.Mask;
import com.sk89q.worldedit.function.operation.Operation;
import com.sk89q.worldedit.util.Direction;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockType;
import com.sk89q.worldedit.world.block.BlockTypes;

View File

@ -193,7 +193,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

@ -35,6 +35,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;
}