In this example, a bot is established, connecting to localhost with the nickname CraftIRC. Two endpoints are established, one defining the game, one defining an IRC channel. Then, we link the two together with links.
Each link can have filters on it to establish how chat is formatted on the receiving end.
Is it ready?
Absolutely! It’s rather limited at the moment, only sending chat back and forth as well as join/quits to IRC, but soon will support additional functionality.
The yaml handling predates Sponge. While this code is all new compared to the Bukkit plugin, it’s been a work in progress as an abstracted plugin for a very long time.
Latest development build runs on the latest Sponge code. I’ve updated the example config to one that distinguishes messages from IRC in-game using the fun datamapper filter.
It’s awesome this is one of the first plugins for Sponge!
Though, I’m getting an error when trying to send messages from game -> IRC. IRC -> game works fine.
[21:15:00] [Server thread/WARN] [Sponge]: A handler raised an error when handling an event
java.lang.NoSuchMethodError: org.spongepowered.api.text.translation.Translation.get()Ljava/lang/String;
at org.kitteh.craftirc.sponge.MinecraftEndpoint.onChat(MinecraftEndpoint.java:91) ~[MinecraftEndpoint.class:?]
at org.spongepowered.mod.event.handler.PlayerChatEventHandler_MinecraftEndpoint_onChat2.handle(Unknown Source) ~[?:?]
at org.spongepowered.mod.event.SpongeEventBus.callListener(SpongeEventBus.java:234) [SpongeEventBus.class:1.8-1371-2.1DEV-433+unknown-b433.git-unknown]
at org.spongepowered.mod.event.SpongeEventBus.post(SpongeEventBus.java:268) [SpongeEventBus.class:1.8-1371-2.1DEV-433+unknown-b433.git-unknown]
at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:56) [EventBus.class:?]
at net.minecraftforge.common.ForgeHooks.onServerChatEvent(ForgeHooks.java:431) [ForgeHooks.class:?]
at net.minecraft.network.NetHandlerPlayServer.func_147354_a(NetHandlerPlayServer.java:796) [rj.class:?]
at net.minecraft.network.play.client.C01PacketChatMessage.func_180757_a(SourceFile:37) [lu.class:?]
at net.minecraft.network.play.client.C01PacketChatMessage.func_148833_a(SourceFile:9) [lu.class:?]
at net.minecraft.network.PacketThreadUtil$1.run(SourceFile:13) [ih.class:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_25]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_25]
at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:709) [FMLCommonHandler.class:?]
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:655) [MinecraftServer.class:?]
at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:364) [po.class:?]
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:598) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:478) [MinecraftServer.class:?]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_25]
Build 20 contains a major change to configurations. Filters have been moved to Links. Check out the new bundled example config and update your config accordingly (or just erase yours and start from scratch).
I also even confirmed it worked before pushing it live!
hey @mbaxter I seem to be have a tad bit of bother.
Trying to start the irc but Im getting an error when starting it. I think i’ve configed it correctly but im not sure.