Skip to content

Commit

Permalink
fix: world download module lacks apache compress library + unable to …
Browse files Browse the repository at this point in the history
…use /download if resource world module is disabled.
  • Loading branch information
sakurawald committed Jun 4, 2024
1 parent 833af35 commit 686b9e2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ dependencies {

implementation "me.lucko:spark-api:${project.spark_version}"

include(implementation group: 'org.apache.commons', name: 'commons-compress', version: "${project.apache_commons_compression_version}")
include(implementation group: 'commons-io', name: 'commons-io', version: "${project.apache_commons_io_version}")
include(implementation group: 'org.quartz-scheduler', name: 'quartz', version: "${project.quartz_version}")
include(implementation "org.apache.commons:commons-compress:${project.apache_commons_compression_version}")
include(implementation "commons-io:commons-io:${project.apache_commons_io_version}")
include(implementation "org.quartz-scheduler:quartz:${project.quartz_version}")
include(implementation "org.reflections:reflections:${project.reflections_version}")
include(implementation "org.javassist:javassist:${project.javaassist_version}")
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ adventure_platform_fabric_version=5.13.0
fabric_permissions_version=0.2-SNAPSHOT
spark_version=0.1-SNAPSHOT
mixin_extras_version=0.2.0-beta.8
apache_commons_compression_version=1.26.0
apache_commons_compression_version=1.26.2
apache_commons_io_version=2.14.0
gson_version=2.10.1
lombok_version=1.18.30
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import io.github.sakurawald.Fuji;
import io.github.sakurawald.config.Configs;
import io.github.sakurawald.module.initializer.ModuleInitializer;
import io.github.sakurawald.module.mixin.resource_world.MinecraftServerAccessor;
import io.github.sakurawald.util.CommandUtil;
import io.github.sakurawald.util.MessageUtil;
import lombok.SneakyThrows;
Expand Down Expand Up @@ -128,9 +127,8 @@ public File compressRegionFile(ServerPlayerEntity player) {
/* get world folder */
ServerWorld world = player.getServerWorld();
MinecraftServer server = world.getServer();
MinecraftServerAccessor serverAccess = (MinecraftServerAccessor) server;
RegistryKey<World> dimensionKey = world.getRegistryKey();
LevelStorage.Session session = serverAccess.getSession();
LevelStorage.Session session = server.session;
File worldDirectory = session.getWorldDirectory(dimensionKey).toFile();

/* compress file */
Expand Down
5 changes: 4 additions & 1 deletion src/main/resources/fuji.accesswidener
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ accessible method net/minecraft/util/UserCache$Entry getProfile ()Lcom/mojang/au
accessible field net/minecraft/server/world/ChunkHolder UNLOADED_WORLD_CHUNK Lnet/minecraft/server/world/OptionalChunk;
accessible field net/minecraft/server/world/ChunkHolder UNLOADED_WORLD_CHUNK_FUTURE Ljava/util/concurrent/CompletableFuture;

accessible field net/minecraft/registry/entry/RegistryEntry$Reference value Ljava/lang/Object;
accessible field net/minecraft/registry/entry/RegistryEntry$Reference value Ljava/lang/Object;

accessible method net/minecraft/server/MinecraftServer getWorlds ()Ljava/lang/Iterable;
accessible field net/minecraft/server/MinecraftServer session Lnet/minecraft/world/level/storage/LevelStorage$Session;

0 comments on commit 686b9e2

Please sign in to comment.