From 3a9889ead736a380461318c3e2e5901d1e1913d7 Mon Sep 17 00:00:00 2001 From: DaMachinator Date: Thu, 15 Feb 2018 11:31:57 -0500 Subject: [PATCH] Ability to access above-mentioned commandsender --- 1.10.2/src/main/kotlin/matterlink/MatterLink.kt | 4 ++++ 1.11.2/src/main/kotlin/matterlink/MatterLink.kt | 4 ++++ 1.12.2/src/main/kotlin/matterlink/MatterLink.kt | 3 +++ core/src/main/kotlin/matterlink/IMatterLink.kt | 3 +++ 4 files changed, 14 insertions(+) diff --git a/1.10.2/src/main/kotlin/matterlink/MatterLink.kt b/1.10.2/src/main/kotlin/matterlink/MatterLink.kt index 61ead07..9977701 100644 --- a/1.10.2/src/main/kotlin/matterlink/MatterLink.kt +++ b/1.10.2/src/main/kotlin/matterlink/MatterLink.kt @@ -6,6 +6,8 @@ import matterlink.bridge.command.BridgeCommandRegistry import matterlink.bridge.command.HelpCommand import matterlink.bridge.command.PlayerListCommand import matterlink.command.CommandMatterlink +import matterlink.command.IMinecraftCommandSender +import matterlink.command.MatterlinkCommandSender import matterlink.config.cfg import net.minecraft.util.text.TextComponentString import net.minecraftforge.fml.common.FMLCommonHandler @@ -77,4 +79,6 @@ object MatterLink : IMatterLink() { override fun log(level: String, formatString: String, vararg data: Any) = logger.log(Level.toLevel(level, Level.INFO),formatString, *data) + + override var commandSender: IMinecraftCommandSender = MatterlinkCommandSender } diff --git a/1.11.2/src/main/kotlin/matterlink/MatterLink.kt b/1.11.2/src/main/kotlin/matterlink/MatterLink.kt index cf3d9fb..68d336a 100644 --- a/1.11.2/src/main/kotlin/matterlink/MatterLink.kt +++ b/1.11.2/src/main/kotlin/matterlink/MatterLink.kt @@ -6,6 +6,8 @@ import matterlink.bridge.command.BridgeCommandRegistry import matterlink.bridge.command.HelpCommand import matterlink.bridge.command.PlayerListCommand import matterlink.command.CommandMatterlink +import matterlink.command.IMinecraftCommandSender +import matterlink.command.MatterlinkCommandSender import matterlink.config.cfg import net.minecraft.util.text.TextComponentString import net.minecraftforge.fml.common.FMLCommonHandler @@ -77,4 +79,6 @@ object MatterLink : IMatterLink() { override fun log(level: String, formatString: String, vararg data: Any) = logger.log(Level.toLevel(level, Level.INFO),formatString, *data) + + override var commandSender: IMinecraftCommandSender = MatterlinkCommandSender } diff --git a/1.12.2/src/main/kotlin/matterlink/MatterLink.kt b/1.12.2/src/main/kotlin/matterlink/MatterLink.kt index cb18b50..352ecbc 100644 --- a/1.12.2/src/main/kotlin/matterlink/MatterLink.kt +++ b/1.12.2/src/main/kotlin/matterlink/MatterLink.kt @@ -4,6 +4,8 @@ import matterlink.bridge.command.BridgeCommandRegistry import matterlink.bridge.command.HelpCommand import matterlink.bridge.command.PlayerListCommand import matterlink.command.CommandMatterlink +import matterlink.command.IMinecraftCommandSender +import matterlink.command.MatterlinkCommandSender import matterlink.config.cfg import net.minecraft.util.text.TextComponentString import net.minecraftforge.fml.common.FMLCommonHandler @@ -76,4 +78,5 @@ object MatterLink : IMatterLink() { override fun log(level: String, formatString: String, vararg data: Any) = logger.log(Level.toLevel(level, Level.INFO),formatString, *data) + override var commandSender: IMinecraftCommandSender = MatterlinkCommandSender } diff --git a/core/src/main/kotlin/matterlink/IMatterLink.kt b/core/src/main/kotlin/matterlink/IMatterLink.kt index 5386204..f39c097 100644 --- a/core/src/main/kotlin/matterlink/IMatterLink.kt +++ b/core/src/main/kotlin/matterlink/IMatterLink.kt @@ -5,12 +5,15 @@ import matterlink.bridge.command.BridgeCommandRegistry import matterlink.bridge.command.HelpCommand import matterlink.bridge.command.PlayerListCommand import matterlink.bridge.command.UptimeCommand +import matterlink.command.IMinecraftCommandSender import matterlink.config.cfg lateinit var instance: IMatterLink abstract class IMatterLink { // var interrupted: Boolean = false + abstract var commandSender: IMinecraftCommandSender + abstract fun wrappedSendToPlayers(msg: String)