All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.peanuuutz.fork.ui.mixin.MixinToastManager Maven / Gradle / Ivy

The newest version!
package net.peanuuutz.fork.ui.mixin;

import net.minecraft.class_368;
import net.minecraft.class_374;
import net.minecraft.class_4587;
import net.peanuuutz.fork.ui.scene.toast.ComposeToast;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(class_374.class)
public class MixinToastManager {
    @Inject(method = "method_45074", at = @At(value = "INVOKE", target = "Ljava/util/BitSet;clear(II)V", shift = At.Shift.AFTER))
    private void forkui$disposeComposeToast(int i, class_4587 matrixStack, class_374.class_375 visibleEntry, CallbackInfoReturnable cir) {
        class_368 toast = visibleEntry.getInstance();
        if (toast instanceof ComposeToast composeToast) {
            composeToast.dispose();
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy