Search in sources :

Example 1 with StitcherStub

use of me.shedaniel.betterloadingscreen.impl.mixinstub.StitcherStub in project BetterLoadingScreen by shedaniel.

the class MixinTextureAtlas method stitch.

@Inject(method = "prepareToStitch", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/texture/Stitcher;stitch()V"), locals = LocalCapture.CAPTURE_FAILSOFT, require = 0)
private void stitch(ResourceManager resourceManager, Stream<ResourceLocation> stream, ProfilerFiller profilerFiller, int i, CallbackInfoReturnable<TextureAtlas.Preparations> cir, Set<ResourceLocation> set, int j, Stitcher stitcher) {
    if (stitcher.texturesToBeStitched.size() < 50)
        return;
    if (!LoadGameSteps.loadModel().isCompleted())
        return;
    ParentTask task = LoadGameSteps.stitchTexture();
    activeTask = task.stepped(LoadGameSteps.StitchTexture.STITCH);
    activeTask.setTotalSteps(stitcher.texturesToBeStitched.size());
    ((StitcherStub) stitcher).betterloadingscreen$setActiveTask(activeTask);
}
Also used : ParentTask(me.shedaniel.betterloadingscreen.api.step.ParentTask) StitcherStub(me.shedaniel.betterloadingscreen.impl.mixinstub.StitcherStub) Inject(org.spongepowered.asm.mixin.injection.Inject)

Example 2 with StitcherStub

use of me.shedaniel.betterloadingscreen.impl.mixinstub.StitcherStub in project BetterLoadingScreen by shedaniel.

the class MixinTextureAtlas method stitchOptifine.

@Inject(method = "prepareToStitch", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/texture/Stitcher;stitch()V"), locals = LocalCapture.CAPTURE_FAILSOFT, require = 0)
private void stitchOptifine(ResourceManager resourceManager, Stream<ResourceLocation> stream, ProfilerFiller profilerFiller, int i, CallbackInfoReturnable<TextureAtlas.Preparations> cir, int ii, Set<ResourceLocation> set, Set<ResourceLocation> setEmissive, int j, Stitcher stitcher) {
    if (stitcher.texturesToBeStitched.size() < 50)
        return;
    if (!LoadGameSteps.loadModel().isCompleted())
        return;
    ParentTask task = LoadGameSteps.stitchTexture();
    activeTask = task.stepped(LoadGameSteps.StitchTexture.STITCH);
    activeTask.setTotalSteps(stitcher.texturesToBeStitched.size());
    ((StitcherStub) stitcher).betterloadingscreen$setActiveTask(activeTask);
}
Also used : ParentTask(me.shedaniel.betterloadingscreen.api.step.ParentTask) StitcherStub(me.shedaniel.betterloadingscreen.impl.mixinstub.StitcherStub) Inject(org.spongepowered.asm.mixin.injection.Inject)

Aggregations

ParentTask (me.shedaniel.betterloadingscreen.api.step.ParentTask)2 StitcherStub (me.shedaniel.betterloadingscreen.impl.mixinstub.StitcherStub)2 Inject (org.spongepowered.asm.mixin.injection.Inject)2