Skip to content

Commit

Permalink
fix: when using mods on servers via BungeeCord, and the JSON files ar…
Browse files Browse the repository at this point in the history
…e not loaded / saved in between worlds.
  • Loading branch information
sakura-ryoko committed Jul 26, 2024
1 parent c17cff2 commit 29d0edf
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 275 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ author = masa
mod_file_name = malilib-fabric

# Current mod version
mod_version = 0.20.0
mod_version = 0.20.2

# Minecraft, Fabric Loader and API and mappings versions
minecraft_version_out = 1.21
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/fi/dy/masa/malilib/mixin/MixinMinecraftClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
Expand All @@ -25,6 +26,7 @@ public abstract class MixinMinecraftClient
@Shadow
public ClientWorld world;

@Unique
private ClientWorld worldBefore;

@Inject(method = "<init>(Lnet/minecraft/client/RunArgs;)V", at = @At("RETURN"))
Expand Down Expand Up @@ -72,6 +74,20 @@ private void onLoadWorldPost(ClientWorld worldClientIn, DownloadingTerrainScreen
}
}

@Inject(method = "enterReconfiguration(Lnet/minecraft/client/gui/screen/Screen;)V", at = @At("HEAD"))
private void onReconfigurationPre(Screen screen, CallbackInfo ci)
{
this.worldBefore = this.world;
((WorldLoadHandler) WorldLoadHandler.getInstance()).onWorldLoadPre(this.worldBefore, null, (MinecraftClient)(Object) this);
}

@Inject(method = "enterReconfiguration(Lnet/minecraft/client/gui/screen/Screen;)V", at = @At("RETURN"))
private void onReconfigurationPost(Screen screen, CallbackInfo ci)
{
((WorldLoadHandler) WorldLoadHandler.getInstance()).onWorldLoadPost(this.worldBefore, null, (MinecraftClient)(Object) this);
this.worldBefore = null;
}

@Inject(method = "disconnect(Lnet/minecraft/client/gui/screen/Screen;Z)V", at = @At("HEAD"))
private void onDisconnectPre(Screen screen, boolean bl, CallbackInfo ci)
{
Expand Down
137 changes: 0 additions & 137 deletions src/main/resources/assets/malilib/lang/ru_ru.json

This file was deleted.

Loading

0 comments on commit 29d0edf

Please sign in to comment.