Skip to content

Commit

Permalink
Fix for 1.20.2+ for #358 (Easy cherry-pick to lower versions)
Browse files Browse the repository at this point in the history
  • Loading branch information
OroArmor committed Feb 24, 2024
1 parent 46772e9 commit b10c5ca
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executor;

import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
Expand All @@ -39,13 +40,13 @@

@Mixin(ServerReloadableResources.class)
public class ServerReloadableResourcesMixin {
@Inject(method = "getReloaders", at = @At("RETURN"), cancellable = true)
private void onGetResourceReloaders(CallbackInfoReturnable<List<ResourceReloader>> cir) {
@ModifyReturnValue(method = "getReloaders", at = @At("RETURN"))
private List<ResourceReloader> onGetResourceReloaders(List<ResourceReloader> original) {
// Re-inject resource reloaders server-side.
// It is currently unknown why ReloadableResourceManager#reload isn't called anymore.
var list = new ArrayList<>(cir.getReturnValue());
var list = new ArrayList<>(original);
ResourceLoaderImpl.sort(ResourceType.SERVER_DATA, list);
cir.setReturnValue(list);
return list;
}

@Inject(method = "loadResources", at = @At("HEAD"))
Expand Down

0 comments on commit b10c5ca

Please sign in to comment.