mirror of
https://github.com/FabricMC/fabric.git
synced 2024-11-14 19:25:23 -05:00
append fabric reload listeners also on initial asset load
This commit is contained in:
parent
98c307909e
commit
cc7320db01
1 changed files with 14 additions and 2 deletions
|
@ -17,8 +17,11 @@
|
|||
package net.fabricmc.fabric.mixin.resources;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.fabricmc.fabric.impl.resources.ResourceManagerHelperImpl;
|
||||
import net.minecraft.resource.*;
|
||||
import net.minecraft.util.Void;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
|
@ -39,9 +42,18 @@ public class MixinReloadableResourceManagerImpl {
|
|||
@Shadow
|
||||
private ResourceType type;
|
||||
|
||||
@Inject(at = @At("HEAD"), method = "reload")
|
||||
public void reload(Executor var1, Executor var2, List<ResourcePack> packs, CompletableFuture future, CallbackInfoReturnable<CompletableFuture> info) {
|
||||
private void fabric_injectListeners() {
|
||||
ResourceManagerHelperImpl.sort(type, field_17935);
|
||||
ResourceManagerHelperImpl.sort(type, field_17936);
|
||||
}
|
||||
|
||||
@Inject(at = @At("HEAD"), method = "createReloadHandler")
|
||||
public void createReloadHandler(Executor executor_1, Executor executor_2, CompletableFuture<Void> completableFuture_1, CallbackInfoReturnable<ResourceReloadHandler> callback) {
|
||||
fabric_injectListeners();
|
||||
}
|
||||
|
||||
@Inject(at = @At("HEAD"), method = "reload")
|
||||
public void reload(Executor var1, Executor var2, List<ResourcePack> packs, CompletableFuture future, CallbackInfoReturnable<CompletableFuture> info) {
|
||||
fabric_injectListeners();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue