Clean up code, 1.20.x compatibility

This commit is contained in:
MrLetsplay 2023-12-31 01:16:14 +01:00
parent 58b1191f9d
commit 5702e1d30c
Signed by: mr
SSH Key Fingerprint: SHA256:92jBH80vpXyaZHjaIl47pjRq+Yt7XGTArqQg1V7hSqg
4 changed files with 3 additions and 10 deletions

View File

@ -7,8 +7,8 @@ import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.stream.StreamSupport;
import org.apache.commons.lang3.stream.Streams;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -36,7 +36,7 @@ public class ArchiveServer implements ModInitializer {
Gson gson = new Gson(); Gson gson = new Gson();
JsonObject object = gson.fromJson(Files.readString(WORLDS_CONFIG, StandardCharsets.UTF_8), JsonObject.class); 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("ArchiveServer config loaded!");
LOGGER.info("Archived worlds: " + worlds); LOGGER.info("Archived worlds: " + worlds);
}catch(IOException | JsonParseException e) { }catch(IOException | JsonParseException e) {

View File

@ -72,12 +72,6 @@ public class ChunkStatusMixin {
}else { }else {
callback.setReturnValue(CompletableFuture.completedFuture(Either.left(theChunk))); 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)))));
} }
} }

View File

@ -23,7 +23,6 @@ public class POISaveMixin {
World world = (World) ((SerializingRegionBasedStorageAccessor) this).getWorld(); World world = (World) ((SerializingRegionBasedStorageAccessor) this).getWorld();
if(!ArchiveServer.isArchived(world.getRegistryKey().getValue())) return; if(!ArchiveServer.isArchived(world.getRegistryKey().getValue())) return;
System.out.println(world.getRegistryKey().getValue().toString());
callback.cancel(); callback.cancel();
} }

View File

@ -24,7 +24,7 @@
], ],
"depends": { "depends": {
"fabricloader": ">=0.15.3", "fabricloader": ">=0.15.3",
"minecraft": "~1.20.4", "minecraft": "~1.20",
"java": ">=17", "java": ">=17",
"fabric-api": "*" "fabric-api": "*"
}, },