-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8570e37
commit 806568a
Showing
6 changed files
with
47 additions
and
10 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
src/main/java/dev/callmeecho/globalize/main/ResourcePackManagerAccessor.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,7 @@ | ||
package dev.callmeecho.globalize.main; | ||
|
||
import net.minecraft.resource.ResourcePackProvider; | ||
|
||
public interface ResourcePackManagerAccessor { | ||
void globalize$addProvider(ResourcePackProvider provider); | ||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/dev/callmeecho/globalize/mixin/ResourcePackManagerMixin.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,23 @@ | ||
package dev.callmeecho.globalize.mixin; | ||
|
||
import com.google.common.collect.ImmutableSet; | ||
import dev.callmeecho.globalize.main.ResourcePackManagerAccessor; | ||
import net.minecraft.resource.ResourcePackManager; | ||
import net.minecraft.resource.ResourcePackProvider; | ||
import org.spongepowered.asm.mixin.Final; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Mutable; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
|
||
import java.util.Set; | ||
|
||
@Mixin(ResourcePackManager.class) | ||
public class ResourcePackManagerMixin implements ResourcePackManagerAccessor { | ||
@Mutable | ||
@Shadow @Final public Set<ResourcePackProvider> providers; | ||
|
||
@Override | ||
public void globalize$addProvider(ResourcePackProvider provider) { | ||
this.providers = ImmutableSet.<ResourcePackProvider>builder().addAll(this.providers).add(provider).build(); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
accessWidener v2 named | ||
accessible field net/minecraft/resource/ResourcePackManager providers Ljava/util/Set; |
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