Commit 2f963381 authored by liujiahua123123's avatar liujiahua123123

thread-pool

parent 5383194d
package net.mamoe.mirai; 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 * @author Him188moe
*/ */
......
...@@ -95,6 +95,11 @@ public class MiraiEventHook<T extends MiraiEvent> implements Closeable { ...@@ -95,6 +95,11 @@ public class MiraiEventHook<T extends MiraiEvent> implements Closeable {
MiraiEventManager.getInstance().registerHook(this); MiraiEventManager.getInstance().registerHook(this);
} }
public void mountAlways(){
if(this.handler == null)this.handler = a -> {};
MiraiEventManager.getInstance().hookAlways(this);
}
public void mountOnce(){ public void mountOnce(){
if(this.handler == null)this.handler = a -> {}; if(this.handler == null)this.handler = a -> {};
MiraiEventManager.getInstance().hookOnce(this); MiraiEventManager.getInstance().hookOnce(this);
......
...@@ -7,8 +7,8 @@ import java.io.IOException; ...@@ -7,8 +7,8 @@ import java.io.IOException;
public class ImageOutputTest { public class ImageOutputTest {
public static void main(String[] args) throws IOException { public static void main(String[] args) throws IOException {
BufferedImage image = ImageIO.read(new File((System.getProperty("user.dir") + "/VerificationCode.png").replace("//","/"))); BufferedImage image = ImageIO.read(new File((System.getProperty("user.dir") + "/mirai.png").replace("//","/")));
CharImageConverter charImageConvertor = new CharImageConverter(image,100); CharImageConverter charImageConvertor = new CharImageConverter(image,80);
System.out.println(charImageConvertor.call()); System.out.println(charImageConvertor.call());
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment