CraftIRC - An IRC-minecraft relay plugin [API 5.0.0]

Introducing …

CraftIRC!

A simple IRC-game relay plugin, now for Sponge.

Downloads Issues Powered by Kittens

Links

Download
Source (Github)
Issue Tracker

Commands

/craftirc - Outputs version info
/craftirc reload - Reloads the config, reconnects all bots. Requires permission.

Permissions

craftirc.reload - Ability to use the reload command

Setup

By default a config file is created at craftirc/config.yml
Here is that file

bots:
  - host: localhost
    name: MyInternalBotName
    nick: CraftIRC
    debug-output:
      exceptions: false
      input: false
      output: false
endpoints:
  - name: Chat
    type: mc-chat
  - name: Join
    type: mc-join
  - name: Quit
    type: mc-quit
  - name: IRC
    type: irc
    extra:
      bot: MyInternalBotName
      channel: "#craftirc"
links:
  - source: Chat
    target: IRC
    filters:
      - colorize
  - source: IRC
    target: Chat
    filters:
      - colorize
      - type: datamapper
        message: "[IRC] <%IRC_PREFIX%%SENDER_NAME%> %MESSAGE_TEXT%"
  - source: Join
    target: IRC
  - source: Quit
    target: IRC
repeatable-filters:
  colorize:
    type: color

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.

Where’s the proper documentation?

Soon!

5 Likes

I like how you made the core platform-independent :slight_smile:

1 Like

eww. y u no hocon? :stuck_out_tongue:

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.

Plus, I don’t hate my users! ^___^

4 Likes

Oh nice, I like being able to link chat and irc together.

1 Like

I really, reallly, like dis. :DD

1 Like

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. :slight_smile:

3 Likes

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]

Sponge-Version: 1.8-1371-2.1DEV-433
Forge-Version: 1.8-11.14.1.1397
Client: Vanilla
Installed Mods: only CraftIRC, Build #10
Java: Java™ SE Runtime Environment (build 1.8.0_25-b17)
OS: 3.16-0.bpo.2-amd64 #1 SMP Debian 7.7 3.16.3-2~bpo70+1 (2014-09-21) x86_64 GNU/Linux

Thanks! Turns out that a day after my last commit, some API was changed that broke stuffs!

Will fix soon and create a new post mentioning such.

1 Like

Nice plugin, I got a screenshot!

1 Like

Build 11 compiled with the latest SpongeAPI snapshot should work. :slight_smile:

1 Like

Works like a charm, thanks! :cat:
Even ä, ü, ö and ß work just fine.

2 Likes

Build 17 may actually work. So that’s nice.

1 Like

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! :smiley:

T-T-T-Triple post!

CraftIRC 4.0.0 is now released! You can get it here! This build appears rather stable, and thus gets the honor of the first release!

CraftIRC 4.0.1 will support colors in chat and you already get functional color-stuffs in the latest dev builds.

2 Likes

Woohooo. Now get Joe to install it on the testserver :smiley:
@Joe_Schmo2840

1 Like

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.

Sponge version:
SpongeMod: 1.8-2.1DEV-0+unknown-b0.git-unkown
SpngeAPI: 2.1-SNAPSHOT

Ive downloaded the lasted CraftIRC.jar from the here.

Server Log
CraftIRC Config

Right in the error:

Caused by: java.net.ConnectException: Connection refused: localhost/127.0.0.1:6667

1 Like

When players type in minecraft it relays their name in the IRC with a space in between every letter.

[07:43] <CraftIRC> <d e i m o s 1 6 1> test

In game it bugs out as well, it put this weird icon in after the first letter to everyones name;

Space between letters is because you have the antihighlight filter.

As for the in-game, I’d be interested in seeing what the IRC message looked like that lead to that.