Clean up code, 1.20.x compatibility
This commit is contained in:
parent
58b1191f9d
commit
5702e1d30c
@ -7,8 +7,8 @@ import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.StreamSupport;
|
||||
|
||||
import org.apache.commons.lang3.stream.Streams;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -36,7 +36,7 @@ public class ArchiveServer implements ModInitializer {
|
||||
|
||||
Gson gson = new Gson();
|
||||
JsonObject object = gson.fromJson(Files.readString(WORLDS_CONFIG, StandardCharsets.UTF_8), JsonObject.class);
|
||||
worlds = Streams.of(object.getAsJsonArray("worlds").iterator()).map(e -> e.getAsString()).toList();
|
||||
worlds = StreamSupport.stream(object.getAsJsonArray("worlds").spliterator(), false).map(e -> e.getAsString()).toList();
|
||||
LOGGER.info("ArchiveServer config loaded!");
|
||||
LOGGER.info("Archived worlds: " + worlds);
|
||||
}catch(IOException | JsonParseException e) {
|
||||
|
@ -72,12 +72,6 @@ public class ChunkStatusMixin {
|
||||
}else {
|
||||
callback.setReturnValue(CompletableFuture.completedFuture(Either.left(theChunk)));
|
||||
}
|
||||
|
||||
// callback.setReturnValue(ChunkHolder.UNLOADED_CHUNK_FUTURE);
|
||||
// WorldChunk
|
||||
// callback.setReturnValue(ChunkStatus.EMPTY.runGenerationTask(executor, world, generator, structureTemplateManager, lightingProvider, fullChunkConverter, chunks));
|
||||
// callback.setReturnValue(CompletableFuture.completedFuture(Either.left(chunks.get(chunks.size() / 2))));
|
||||
// callback.setReturnValue(CompletableFuture.completedFuture(Either.left(new WorldChunk(world, new ChunkPos(0, 0)))));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -23,7 +23,6 @@ public class POISaveMixin {
|
||||
World world = (World) ((SerializingRegionBasedStorageAccessor) this).getWorld();
|
||||
if(!ArchiveServer.isArchived(world.getRegistryKey().getValue())) return;
|
||||
|
||||
System.out.println(world.getRegistryKey().getValue().toString());
|
||||
callback.cancel();
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.3",
|
||||
"minecraft": "~1.20.4",
|
||||
"minecraft": "~1.20",
|
||||
"java": ">=17",
|
||||
"fabric-api": "*"
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user