mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-05 20:36:42 +00:00
Insert Locale.ROOT into all case change methods
This commit is contained in:
committed by
Kenzie Togami
parent
b47c70025e
commit
13a8c480e3
@ -22,6 +22,7 @@ package com.sk89q.worldedit.world.block;
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.worldedit.registry.state.Property;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -92,9 +93,11 @@ public interface BlockStateHolder<B extends BlockStateHolder<B>> {
|
||||
if (getStates().isEmpty()) {
|
||||
return this.getBlockType().getId();
|
||||
} else {
|
||||
String properties =
|
||||
getStates().entrySet().stream().map(entry -> entry.getKey().getName() + "=" + entry.getValue().toString().toLowerCase()).collect(Collectors.joining(
|
||||
","));
|
||||
String properties = getStates().entrySet().stream()
|
||||
.map(entry -> entry.getKey().getName()
|
||||
+ "="
|
||||
+ entry.getValue().toString().toLowerCase(Locale.ROOT))
|
||||
.collect(Collectors.joining(","));
|
||||
return this.getBlockType().getId() + "[" + properties + "]";
|
||||
}
|
||||
}
|
||||
|
@ -35,6 +35,7 @@ import org.slf4j.LoggerFactory;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.Locale;
|
||||
import java.util.zip.ZipFile;
|
||||
|
||||
/**
|
||||
@ -83,7 +84,8 @@ public class Snapshot implements Comparable<Snapshot> {
|
||||
* @throws DataException
|
||||
*/
|
||||
private ChunkStore internalGetChunkStore() throws IOException, DataException {
|
||||
if (file.getName().toLowerCase().endsWith(".zip")) {
|
||||
String lowerCaseFileName = file.getName().toLowerCase(Locale.ROOT);
|
||||
if (lowerCaseFileName.endsWith(".zip")) {
|
||||
try {
|
||||
ChunkStore chunkStore = new TrueZipMcRegionChunkStore(file);
|
||||
|
||||
@ -101,9 +103,9 @@ public class Snapshot implements Comparable<Snapshot> {
|
||||
|
||||
return chunkStore;
|
||||
}
|
||||
} else if (file.getName().toLowerCase().endsWith(".tar.bz2")
|
||||
|| file.getName().toLowerCase().endsWith(".tar.gz")
|
||||
|| file.getName().toLowerCase().endsWith(".tar")) {
|
||||
} else if (lowerCaseFileName.endsWith(".tar.bz2")
|
||||
|| lowerCaseFileName.endsWith(".tar.gz")
|
||||
|| lowerCaseFileName.endsWith(".tar")) {
|
||||
try {
|
||||
ChunkStore chunkStore = new TrueZipMcRegionChunkStore(file);
|
||||
|
||||
@ -133,14 +135,15 @@ public class Snapshot implements Comparable<Snapshot> {
|
||||
*/
|
||||
public boolean containsWorld(String worldname) {
|
||||
try {
|
||||
if (file.getName().toLowerCase().endsWith(".zip")) {
|
||||
String lowerCaseFileName = file.getName().toLowerCase(Locale.ROOT);
|
||||
if (lowerCaseFileName.endsWith(".zip")) {
|
||||
try (ZipFile entry = new ZipFile(file)) {
|
||||
return (entry.getEntry(worldname) != null
|
||||
|| entry.getEntry(worldname + "/level.dat") != null);
|
||||
}
|
||||
} else if (file.getName().toLowerCase().endsWith(".tar.bz2")
|
||||
|| file.getName().toLowerCase().endsWith(".tar.gz")
|
||||
|| file.getName().toLowerCase().endsWith(".tar")) {
|
||||
} else if (lowerCaseFileName.endsWith(".tar.bz2")
|
||||
|| lowerCaseFileName.endsWith(".tar.gz")
|
||||
|| lowerCaseFileName.endsWith(".tar")) {
|
||||
try {
|
||||
de.schlichtherle.util.zip.ZipFile entry = new de.schlichtherle.util.zip.ZipFile(file);
|
||||
|
||||
|
@ -32,6 +32,7 @@ import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* A repository contains zero or more snapshots.
|
||||
@ -208,11 +209,17 @@ public class SnapshotRepository {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (file.isDirectory() && (new File(file, "level.dat")).exists())
|
||||
|| (file.isFile() && (file.getName().toLowerCase().endsWith(".zip")
|
||||
|| file.getName().toLowerCase().endsWith(".tar.bz2")
|
||||
|| file.getName().toLowerCase().endsWith(".tar.gz")
|
||||
|| file.getName().toLowerCase().endsWith(".tar")));
|
||||
if (file.isDirectory() && new File(file, "level.dat").exists()) {
|
||||
return true;
|
||||
}
|
||||
if (file.isFile()) {
|
||||
String lowerCaseFileName = file.getName().toLowerCase(Locale.ROOT);
|
||||
return lowerCaseFileName.endsWith(".zip")
|
||||
|| lowerCaseFileName.endsWith(".tar.bz2")
|
||||
|| lowerCaseFileName.endsWith(".tar.gz")
|
||||
|| lowerCaseFileName.endsWith(".tar");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user