Skip to content

Commit

Permalink
Included information on Reflection relocation
Browse files Browse the repository at this point in the history
  • Loading branch information
Swofty-Developments committed Dec 2, 2023
1 parent 3c2ba54 commit 951d9f3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 26 deletions.
4 changes: 4 additions & 0 deletions .docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ Yes, you can! However, that requires doing some extra steps. Take a look at the

Multiverse-Core detects SWM worlds as unloaded, as it cannot find the world directory, and then just ignores them. Although there should be no issues, MV commands won't work with SWM worlds.

* It appears that my reflections aren't working after installing, what happened?

Follow the instructions found on this Spigot post in regards to relocation; https://www.spigotmc.org/threads/issue-with-reflections-library-and-multiple-plugins.397903/

* What's the world size limit?

The Slime Region Format can handle up a 46340x4630 chunk area. That's the maximum size that SWM can _theoretically_ handle, given enough memory. However, having a world so big is not recommended at all.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
@Getter
@RequiredArgsConstructor
public class LevelData {

private final Map<String, String> gameRules;

private final int spawnX;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ private static LevelData readLevelData(File file) throws IOException, InvalidWor
Optional<CompoundTag> dataTag = tag.get().getAsCompoundTag("Data");

if (dataTag.isPresent()) {
// Data version
int dataVersion = dataTag.get().getIntValue("DataVersion").orElse(-1);

// Game rules
Map<String, String> gameRules = new HashMap<>();
Optional<CompoundTag> rulesList = dataTag.get().getAsCompoundTag("GameRules");
Expand Down Expand Up @@ -154,7 +151,6 @@ private static List<SlimeChunk> loadChunks(File file) throws IOException {
}

List<SlimeChunk> loadedChunks = chunks.stream().map((entry) -> {

try {
DataInputStream headerStream = new DataInputStream(new ByteArrayInputStream(regionByteArray, entry.getOffset(), entry.getPaddedSize()));

Expand Down Expand Up @@ -205,13 +201,8 @@ private static SlimeChunk readChunk(CompoundTag compound) {
biomes = null;
}

Optional<CompoundTag> optionalHeightMaps = compound.getAsCompoundTag("Heightmaps");
CompoundTag heightMapsCompound;

// Pre 1.13 world

CompoundTag heightMapsCompound = new CompoundTag("", new CompoundMap());
int[] heightMap = compound.getIntArrayValue("HeightMap").orElse(new int[256]);
heightMapsCompound = new CompoundTag("", new CompoundMap());
heightMapsCompound.getValue().put("heightMap", new IntArrayTag("heightMap", heightMap));

List<CompoundTag> tileEntities = ((ListTag<CompoundTag>) compound.getAsListTag("TileEntities")
Expand All @@ -224,11 +215,6 @@ private static SlimeChunk readChunk(CompoundTag compound) {
for (CompoundTag sectionTag : sectionsTag.getValue()) {
int index = sectionTag.getByteValue("Y").get();

if (index < 0) {
// For some reason MC 1.14 worlds contain an empty section with Y = -1.
continue;
}

byte[] blocks = sectionTag.getByteArrayValue("Blocks").orElse(null);
NibbleArray dataArray;
ListTag<CompoundTag> paletteTag;
Expand Down Expand Up @@ -278,16 +264,6 @@ private static boolean isEmpty(byte[] array) {
return true;
}

private static boolean isEmpty(long[] array) {
for (long b : array) {
if (b != 0L) {
return false;
}
}

return true;
}

@Getter
@RequiredArgsConstructor
private static class ChunkEntry {
Expand Down

0 comments on commit 951d9f3

Please sign in to comment.