chore: annotate private things in mixins as @Unique
ci/woodpecker/push/jfmod Pipeline was successful
Details
ci/woodpecker/push/jfmod Pipeline was successful
Details
This commit is contained in:
parent
134df39ca1
commit
91632aa068
|
@ -33,11 +33,13 @@ public abstract class ResourcePackOrganizerMixin {
|
|||
if (aps$lock.requestScan().shouldStart()) aps$startScan();
|
||||
}
|
||||
|
||||
@Unique
|
||||
private void aps$startScan() {
|
||||
Future<Void>[] tasks = new Future[1];
|
||||
aps$packScan = tasks[0] = resourcePackManager.scanPacksAsync(() -> aps$afterScan(tasks[0]));
|
||||
}
|
||||
|
||||
@Unique
|
||||
private void aps$afterScan(Future<Void> task) {
|
||||
try (var lock = aps$lock.lockResources()) {
|
||||
if (task.isCancelled()) return;
|
||||
|
@ -52,6 +54,7 @@ public abstract class ResourcePackOrganizerMixin {
|
|||
if (aps$lock.emitScanFinished().shouldContinue()) aps$startScan();
|
||||
}
|
||||
|
||||
@Unique
|
||||
private void filterFabricPacks(List<ResourcePackProfile> list) {
|
||||
list.removeIf(profile -> profile instanceof FabricResourcePackProfile prpp && prpp.fabric_isHidden());
|
||||
}
|
||||
|
|
|
@ -5,12 +5,14 @@ import io.gitlab.jfronny.aps.impl.VoidFuture;
|
|||
import net.minecraft.resource.ResourcePackManager;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
|
||||
import java.util.concurrent.ForkJoinPool;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
@Mixin(ResourcePackManager.class)
|
||||
public abstract class ResourcePackManagerMixin implements AsyncResourcePackManager {
|
||||
@Unique
|
||||
private static final ForkJoinPool APS$POOL = ForkJoinPool.commonPool();
|
||||
@Shadow
|
||||
public abstract void scanPacks();
|
||||
|
|
Loading…
Reference in New Issue