dev.lukebemish.dynamicassetgenerator.impl.mixin.MultiPackResourceManagerMixin Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dynamicassetgenerator Show documentation
Show all versions of dynamicassetgenerator Show documentation
A tool for dynamically generating textures and other resources at runtime
The newest version!
package dev.lukebemish.dynamicassetgenerator.impl.mixin;
import dev.lukebemish.dynamicassetgenerator.impl.ResourceFinder;
import net.minecraft.server.packs.PackResources;
import net.minecraft.server.packs.PackType;
import net.minecraft.server.packs.resources.MultiPackResourceManager;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyVariable;
import java.util.List;
@Mixin(MultiPackResourceManager.class)
public class MultiPackResourceManagerMixin {
@ModifyVariable(method = "", at = @At(value = "HEAD"), argsOnly = true)
private static List dynamic_asset_generator$loadPacks(List packs, PackType type, List packsAgain) {
ResourceFinder.INSTANCES[type.ordinal()] = packs::stream;
return packs;
}
}