Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package io.github.fabricators_of_create.porting_lib.mixin.common;

import com.google.common.collect.ImmutableSet;
import io.github.fabricators_of_create.porting_lib.extensions.PackRepositoryExtension;
import net.minecraft.server.packs.repository.PackRepository;
import net.minecraft.server.packs.repository.RepositorySource;
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.HashSet;
import java.util.Set;

@Mixin(PackRepository.class)
public class PackRepositoryMixin implements PackRepositoryExtension {
@Mutable
@Shadow @Final private Set<RepositorySource> sources;

public void pl$addPackFinder(RepositorySource packFinder) {
if (sources instanceof ImmutableSet<RepositorySource>)
sources = new HashSet<>(sources);
sources.add(packFinder);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"common.MainMixin",
"common.MapDecorationMixin",
"common.MushroomCowMixin",
"common.PackRepositoryMixin",
"common.PiglinAiMixin",
"common.PistonMovingBlockEntityMixin",
"common.PistonStructureResolverMixin",
Expand Down
Loading