import cleanup and autoformatting

This commit is contained in:
Nikky Ai 2018-01-21 11:58:54 +01:00
parent 47f014c344
commit aa564d1e1f
7 changed files with 4 additions and 20 deletions

View File

@ -12,16 +12,10 @@ import net.minecraftforge.fml.common.Mod
import net.minecraftforge.fml.common.event.*
import org.apache.logging.log4j.Level
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.simple.SimpleLogger
import org.apache.logging.log4j.spi.AbstractLogger
import org.apache.logging.log4j.util.PropertiesUtil
import java.io.File
import java.time.format.DateTimeFormatter
import java.time.format.DateTimeFormatterBuilder
import java.util.*
const val MODID = "civilengineering"
@ -37,13 +31,10 @@ const val VERSION = "0.0.1"
modLanguageAdapter = "net.shadowfacts.forgelin.KotlinAdapter"
)
object CivilEngineering {
init {
}
var config: Configuration = Configuration()
//create fake logger to get around Nullability
var logger: Logger = SimpleLogger ("",
var logger: Logger = SimpleLogger("",
Level.OFF,
false,
false,

View File

@ -1,10 +1,8 @@
package civilengineering.bridge
import civilengineering.Config
import com.google.gson.Gson
import java.util.*
data class ApiMessage (
data class ApiMessage(
val text: String = "",
val channel: String = "",
val username: String = "",

View File

@ -9,7 +9,7 @@ import java.net.HttpURLConnection
* @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()
var waitingOnNetwork = true
var cancelled = false
@ -22,7 +22,7 @@ class CancellableConnectionFollowThread (httpConnClosure: () -> HttpURLConnectio
httpConn.requestMethod = "GET"
InputStreamReader(httpConn.inputStream).useLines {
it.forEach{
it.forEach {
synchronized(cancelGuard) {
if (cancelled) return
waitingOnNetwork = false

View File

@ -8,7 +8,6 @@ import java.net.HttpURLConnection
import java.net.URL
import java.util.concurrent.ConcurrentLinkedQueue
object MessageHandler {
private fun createThread(): CancellableConnectionFollowThread {

View File

@ -1,6 +1,5 @@
package civilengineering.command
import civilengineering.CivilEngineering
import civilengineering.*
import civilengineering.CivilEngineering.logger
import civilengineering.bridge.MessageHandler

View File

@ -3,10 +3,8 @@ package civilengineering.eventhandlers
import civilengineering.Config
import civilengineering.bridge.ApiMessage
import civilengineering.bridge.MessageHandler
import net.minecraft.entity.EntityLivingBase
import net.minecraft.entity.player.EntityPlayer
import net.minecraftforge.event.entity.living.LivingDeathEvent
import net.minecraftforge.fml.common.Mod
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
class DeathEventHandler {

View File

@ -5,7 +5,6 @@ import civilengineering.bridge.MessageHandler
import net.minecraft.command.server.CommandEmote
import net.minecraft.entity.player.EntityPlayer
import net.minecraftforge.event.CommandEvent
import net.minecraftforge.fml.common.Mod
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
class UserActionHandler {