net.peanuuutz.fork.ui.mixin.MixinToastManager Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fork-ui Show documentation
Show all versions of fork-ui Show documentation
Comprehensive API designed for Minecraft modders
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();
}
}
}