import cleanup and autoformatting
This commit is contained in:
parent
47f014c344
commit
aa564d1e1f
|
@ -12,16 +12,10 @@ import net.minecraftforge.fml.common.Mod
|
||||||
import net.minecraftforge.fml.common.event.*
|
import net.minecraftforge.fml.common.event.*
|
||||||
import org.apache.logging.log4j.Level
|
import org.apache.logging.log4j.Level
|
||||||
import org.apache.logging.log4j.Logger
|
import org.apache.logging.log4j.Logger
|
||||||
import org.apache.logging.log4j.Marker
|
|
||||||
import org.apache.logging.log4j.message.Message
|
|
||||||
import org.apache.logging.log4j.message.MessageFactory
|
|
||||||
import org.apache.logging.log4j.message.SimpleMessageFactory
|
import org.apache.logging.log4j.message.SimpleMessageFactory
|
||||||
import org.apache.logging.log4j.simple.SimpleLogger
|
import org.apache.logging.log4j.simple.SimpleLogger
|
||||||
import org.apache.logging.log4j.spi.AbstractLogger
|
|
||||||
import org.apache.logging.log4j.util.PropertiesUtil
|
import org.apache.logging.log4j.util.PropertiesUtil
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.time.format.DateTimeFormatter
|
|
||||||
import java.time.format.DateTimeFormatterBuilder
|
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
const val MODID = "civilengineering"
|
const val MODID = "civilengineering"
|
||||||
|
@ -37,13 +31,10 @@ const val VERSION = "0.0.1"
|
||||||
modLanguageAdapter = "net.shadowfacts.forgelin.KotlinAdapter"
|
modLanguageAdapter = "net.shadowfacts.forgelin.KotlinAdapter"
|
||||||
)
|
)
|
||||||
object CivilEngineering {
|
object CivilEngineering {
|
||||||
init {
|
|
||||||
}
|
|
||||||
|
|
||||||
var config: Configuration = Configuration()
|
var config: Configuration = Configuration()
|
||||||
|
|
||||||
//create fake logger to get around Nullability
|
//create fake logger to get around Nullability
|
||||||
var logger: Logger = SimpleLogger ("",
|
var logger: Logger = SimpleLogger("",
|
||||||
Level.OFF,
|
Level.OFF,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
package civilengineering.bridge
|
package civilengineering.bridge
|
||||||
|
|
||||||
import civilengineering.Config
|
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
data class ApiMessage (
|
data class ApiMessage(
|
||||||
val text: String = "",
|
val text: String = "",
|
||||||
val channel: String = "",
|
val channel: String = "",
|
||||||
val username: String = "",
|
val username: String = "",
|
||||||
|
|
|
@ -9,7 +9,7 @@ import java.net.HttpURLConnection
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class CancellableConnectionFollowThread (httpConnClosure: () -> HttpURLConnection, private val mhandler: (String) -> Unit): Thread() {
|
class CancellableConnectionFollowThread(httpConnClosure: () -> HttpURLConnection, private val mhandler: (String) -> Unit) : Thread() {
|
||||||
val cancelGuard = Object()
|
val cancelGuard = Object()
|
||||||
var waitingOnNetwork = true
|
var waitingOnNetwork = true
|
||||||
var cancelled = false
|
var cancelled = false
|
||||||
|
@ -22,7 +22,7 @@ class CancellableConnectionFollowThread (httpConnClosure: () -> HttpURLConnectio
|
||||||
httpConn.requestMethod = "GET"
|
httpConn.requestMethod = "GET"
|
||||||
|
|
||||||
InputStreamReader(httpConn.inputStream).useLines {
|
InputStreamReader(httpConn.inputStream).useLines {
|
||||||
it.forEach{
|
it.forEach {
|
||||||
synchronized(cancelGuard) {
|
synchronized(cancelGuard) {
|
||||||
if (cancelled) return
|
if (cancelled) return
|
||||||
waitingOnNetwork = false
|
waitingOnNetwork = false
|
||||||
|
|
|
@ -8,7 +8,6 @@ import java.net.HttpURLConnection
|
||||||
import java.net.URL
|
import java.net.URL
|
||||||
import java.util.concurrent.ConcurrentLinkedQueue
|
import java.util.concurrent.ConcurrentLinkedQueue
|
||||||
|
|
||||||
|
|
||||||
object MessageHandler {
|
object MessageHandler {
|
||||||
|
|
||||||
private fun createThread(): CancellableConnectionFollowThread {
|
private fun createThread(): CancellableConnectionFollowThread {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package civilengineering.command
|
package civilengineering.command
|
||||||
|
|
||||||
import civilengineering.CivilEngineering
|
|
||||||
import civilengineering.*
|
import civilengineering.*
|
||||||
import civilengineering.CivilEngineering.logger
|
import civilengineering.CivilEngineering.logger
|
||||||
import civilengineering.bridge.MessageHandler
|
import civilengineering.bridge.MessageHandler
|
||||||
|
|
|
@ -3,10 +3,8 @@ package civilengineering.eventhandlers
|
||||||
import civilengineering.Config
|
import civilengineering.Config
|
||||||
import civilengineering.bridge.ApiMessage
|
import civilengineering.bridge.ApiMessage
|
||||||
import civilengineering.bridge.MessageHandler
|
import civilengineering.bridge.MessageHandler
|
||||||
import net.minecraft.entity.EntityLivingBase
|
|
||||||
import net.minecraft.entity.player.EntityPlayer
|
import net.minecraft.entity.player.EntityPlayer
|
||||||
import net.minecraftforge.event.entity.living.LivingDeathEvent
|
import net.minecraftforge.event.entity.living.LivingDeathEvent
|
||||||
import net.minecraftforge.fml.common.Mod
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
|
||||||
|
|
||||||
class DeathEventHandler {
|
class DeathEventHandler {
|
||||||
|
|
|
@ -5,7 +5,6 @@ import civilengineering.bridge.MessageHandler
|
||||||
import net.minecraft.command.server.CommandEmote
|
import net.minecraft.command.server.CommandEmote
|
||||||
import net.minecraft.entity.player.EntityPlayer
|
import net.minecraft.entity.player.EntityPlayer
|
||||||
import net.minecraftforge.event.CommandEvent
|
import net.minecraftforge.event.CommandEvent
|
||||||
import net.minecraftforge.fml.common.Mod
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
|
||||||
|
|
||||||
class UserActionHandler {
|
class UserActionHandler {
|
||||||
|
|
Loading…
Reference in New Issue