thread-pool

This commit is contained in:
liujiahua123123 2019-09-10 19:52:13 +08:00
parent 5383194db1
commit 2f96338107
3 changed files with 11 additions and 2 deletions

View File

@ -1,6 +1,10 @@
package net.mamoe.mirai;
import net.mamoe.mirai.event.MiraiEventHook;
import net.mamoe.mirai.event.MiraiEventManager;
import net.mamoe.mirai.event.events.qq.FriendMessageEvent;
/**
* @author Him188moe
*/

View File

@ -95,6 +95,11 @@ public class MiraiEventHook<T extends MiraiEvent> implements Closeable {
MiraiEventManager.getInstance().registerHook(this);
}
public void mountAlways(){
if(this.handler == null)this.handler = a -> {};
MiraiEventManager.getInstance().hookAlways(this);
}
public void mountOnce(){
if(this.handler == null)this.handler = a -> {};
MiraiEventManager.getInstance().hookOnce(this);

View File

@ -7,8 +7,8 @@ import java.io.IOException;
public class ImageOutputTest {
public static void main(String[] args) throws IOException {
BufferedImage image = ImageIO.read(new File((System.getProperty("user.dir") + "/VerificationCode.png").replace("//","/")));
CharImageConverter charImageConvertor = new CharImageConverter(image,100);
BufferedImage image = ImageIO.read(new File((System.getProperty("user.dir") + "/mirai.png").replace("//","/")));
CharImageConverter charImageConvertor = new CharImageConverter(image,80);
System.out.println(charImageConvertor.call());
}
}