Search in sources :

Example 1 with PluginRepositorySource

use of org.spongepowered.vanilla.server.packs.PluginRepositorySource in project SpongeCommon by SpongePowered.

the class PackRepositoryMixin_Vanilla method vanilla$addPluginRepository.

@SuppressWarnings("rawtypes")
@Redirect(method = "<init>*", at = @At(value = "INVOKE", target = "Lcom/google/common/collect/ImmutableSet;copyOf([Ljava/lang/Object;)Lcom/google/common/collect/ImmutableSet;"))
private ImmutableSet vanilla$addPluginRepository(final Object[] elements) {
    final Object[] copied = Arrays.copyOf(elements, elements.length + 1);
    copied[elements.length] = new PluginRepositorySource((PackRepository) (Object) this);
    return ImmutableSet.copyOf(copied);
}
Also used : PackRepository(net.minecraft.server.packs.repository.PackRepository) PluginRepositorySource(org.spongepowered.vanilla.server.packs.PluginRepositorySource) Redirect(org.spongepowered.asm.mixin.injection.Redirect)

Aggregations

PackRepository (net.minecraft.server.packs.repository.PackRepository)1 Redirect (org.spongepowered.asm.mixin.injection.Redirect)1 PluginRepositorySource (org.spongepowered.vanilla.server.packs.PluginRepositorySource)1