-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed another possible issue with reloading
- Loading branch information
1 parent
85a5be8
commit 8fb3fe5
Showing
5 changed files
with
34 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
forge/src/main/java/com/unlikepaladin/pfm/mixin/forge/PFMSaveLoaderMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.unlikepaladin.pfm.mixin.forge; | ||
|
||
import com.unlikepaladin.pfm.client.PathPackRPWrapper; | ||
import com.unlikepaladin.pfm.runtime.PFMRuntimeResources; | ||
import net.minecraft.resource.ResourcePack; | ||
import net.minecraft.server.SaveLoader; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.ModifyArg; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@Mixin(SaveLoader.class) | ||
public class PFMSaveLoaderMixin { | ||
|
||
@ModifyArg(method = "ofLoaded", at = @At(value = "INVOKE", target = "Lnet/minecraft/resource/LifecycledResourceManagerImpl;<init>(Lnet/minecraft/resource/ResourceType;Ljava/util/List;)V"), index = 1) | ||
private static List<ResourcePack> createReload(List<ResourcePack> packs) { | ||
List<ResourcePack> resourcePacks = new ArrayList<>(packs); | ||
resourcePacks.removeIf(pack -> pack instanceof PathPackRPWrapper); | ||
PFMRuntimeResources.RESOURCE_PACK_LIST = resourcePacks; | ||
return packs; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters