diff --git a/1.10.2/src/main/kotlin/matterlink/EventWrapper.kt b/1.10.2/src/main/kotlin/matterlink/EventHandler.kt similarity index 95% rename from 1.10.2/src/main/kotlin/matterlink/EventWrapper.kt rename to 1.10.2/src/main/kotlin/matterlink/EventHandler.kt index fddc791..1a41c6d 100644 --- a/1.10.2/src/main/kotlin/matterlink/EventWrapper.kt +++ b/1.10.2/src/main/kotlin/matterlink/EventHandler.kt @@ -21,7 +21,7 @@ import net.minecraftforge.fml.common.gameevent.TickEvent //FORGE-DEPENDENT @Mod.EventBusSubscriber -object EventWrapper { +object EventHandler { //MC-VERSION & FORGE DEPENDENT @SubscribeEvent @@ -38,7 +38,7 @@ object EventWrapper { fun chatEvent(e: ServerChatEvent) { val user = e.username val msg = e.message - ChatHandler.handleChat(user, msg) + ChatProcessor.sendToBridge(user, msg,"") } //FORGE-DEPENDENT @@ -58,7 +58,7 @@ object EventWrapper { e.command is CommandBroadcast -> "" else -> return } - CommandHandler.handleCommand(sender, args, type) + ChatProcessor.sendToBridge(sender, args, type) } diff --git a/1.11.2/src/main/kotlin/matterlink/EventWrapper.kt b/1.11.2/src/main/kotlin/matterlink/EventHandler.kt similarity index 95% rename from 1.11.2/src/main/kotlin/matterlink/EventWrapper.kt rename to 1.11.2/src/main/kotlin/matterlink/EventHandler.kt index fddc791..1a41c6d 100644 --- a/1.11.2/src/main/kotlin/matterlink/EventWrapper.kt +++ b/1.11.2/src/main/kotlin/matterlink/EventHandler.kt @@ -21,7 +21,7 @@ import net.minecraftforge.fml.common.gameevent.TickEvent //FORGE-DEPENDENT @Mod.EventBusSubscriber -object EventWrapper { +object EventHandler { //MC-VERSION & FORGE DEPENDENT @SubscribeEvent @@ -38,7 +38,7 @@ object EventWrapper { fun chatEvent(e: ServerChatEvent) { val user = e.username val msg = e.message - ChatHandler.handleChat(user, msg) + ChatProcessor.sendToBridge(user, msg,"") } //FORGE-DEPENDENT @@ -58,7 +58,7 @@ object EventWrapper { e.command is CommandBroadcast -> "" else -> return } - CommandHandler.handleCommand(sender, args, type) + ChatProcessor.sendToBridge(sender, args, type) } diff --git a/1.12.2/src/main/kotlin/matterlink/EventWrapper.kt b/1.12.2/src/main/kotlin/matterlink/EventHandler.kt similarity index 96% rename from 1.12.2/src/main/kotlin/matterlink/EventWrapper.kt rename to 1.12.2/src/main/kotlin/matterlink/EventHandler.kt index 5619117..08da6c4 100644 --- a/1.12.2/src/main/kotlin/matterlink/EventWrapper.kt +++ b/1.12.2/src/main/kotlin/matterlink/EventHandler.kt @@ -21,7 +21,7 @@ import net.minecraftforge.fml.common.gameevent.TickEvent //FORGE-DEPENDENT @Mod.EventBusSubscriber -object EventWrapper { +object EventHandler { //MC-VERSION & FORGE DEPENDENT @SubscribeEvent @@ -39,7 +39,7 @@ object EventWrapper { fun chatEvent(e: ServerChatEvent) { val user = e.username val msg = e.message - ChatHandler.handleChat(user, msg) + ChatProcessor.sendToBridge(user, msg,"") } //FORGE-DEPENDENT @@ -59,7 +59,7 @@ object EventWrapper { e.command is CommandBroadcast -> "" else -> return } - CommandHandler.handleCommand(sender, args, type) + ChatProcessor.sendToBridge(sender, args, type) } diff --git a/core/src/main/kotlin/matterlink/handlers/ChatHandler.kt b/core/src/main/kotlin/matterlink/handlers/ChatProcessor.kt similarity index 83% rename from core/src/main/kotlin/matterlink/handlers/ChatHandler.kt rename to core/src/main/kotlin/matterlink/handlers/ChatProcessor.kt index 3e98ab2..195cbd4 100644 --- a/core/src/main/kotlin/matterlink/handlers/ChatHandler.kt +++ b/core/src/main/kotlin/matterlink/handlers/ChatProcessor.kt @@ -4,8 +4,8 @@ import matterlink.bridge.ApiMessage import matterlink.bridge.MessageHandler import matterlink.instance -object ChatHandler { - fun handleChat(user: String, msg: String) { +object ChatProcessor { + fun sendToBridge(user: String, msg: String, event: String) { val message = msg.trim() when { message.isNotBlank() -> MessageHandler.transmit(ApiMessage( diff --git a/core/src/main/kotlin/matterlink/handlers/CommandHandler.kt b/core/src/main/kotlin/matterlink/handlers/CommandHandler.kt deleted file mode 100644 index e188a9a..0000000 --- a/core/src/main/kotlin/matterlink/handlers/CommandHandler.kt +++ /dev/null @@ -1,14 +0,0 @@ -package matterlink.handlers - -import matterlink.bridge.ApiMessage -import matterlink.bridge.MessageHandler - -object CommandHandler { - fun handleCommand(sender: String, args: String, type: String) { - MessageHandler.transmit(ApiMessage( - username = sender, - text = args, - event = type - )) - } -}