make all the things work

This commit is contained in:
NikkyAI 2018-02-10 03:19:01 +01:00 committed by Unknown
parent af7c93885b
commit 1e6014622f
18 changed files with 120 additions and 134 deletions

View File

@ -1,84 +0,0 @@
buildscript {
ext.kotlin_version = '1.2.20'
repositories {
jcenter()
maven { url = "http://files.minecraftforge.net/maven" }
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.4'
}
}
apply plugin: 'kotlin'
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'com.github.johnrengelman.shadow'
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
archivesBaseName = "MatterLink"
sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
compileJava {
sourceCompatibility = targetCompatibility = '1.8'
}
minecraft {
version = "1.12.2-14.23.1.2599"
runDir = "run"
// the mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD snapshot are built nightly.
// stable_# stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not always work.
// simply re-run your setup task after changing the mappings to update your workspace.
mappings = "snapshot_20171003"
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
replaceIn 'src/main/kotlin/matterlink/MatterLink.kt'
replace '@VERSION@', project.version
}
repositories {
jcenter()
maven {
url = 'http://unascribed.com/maven/releases'
}
maven {
url "http://maven.shadowfacts.net/"
}
}
dependencies {
compile project(':core')
compile group: "net.shadowfacts", name: "Forgelin", version: "1.6.0"
}
shadowJar {
relocate 'org.jetbrains.annotations', 'matterlink.jetbrains.annotations'
classifier ''
configurations = [project.configurations.shadow]
}
reobf {
shadowJar { mappingType = 'SEARGE' }
}
processResources {
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version
}
// copy everything else except the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}

4
1.12.2/gradle.properties Normal file
View File

@ -0,0 +1,4 @@
group = matterbridge
mc_version = 1.12.2
mcp_mappings = snapshot_20171003
forge_version = 14.23.1.2599

View File

@ -2,6 +2,7 @@ package matterlink
import matterlink.bridge.ServerChatHandler
import matterlink.bridge.USER_ACTION
import matterlink.config.cfg
import matterlink.handlers.*
import net.minecraft.command.server.CommandBroadcast
import net.minecraft.command.server.CommandEmote

View File

@ -1,5 +1,7 @@
package matterlink
import matterlink.config.IMatterLinkConfig
import matterlink.config.cfg
import net.minecraftforge.common.config.Configuration
import java.io.File
import java.util.regex.Pattern

View File

@ -3,7 +3,7 @@ package matterlink.handlers
import matterlink.antiping
import matterlink.bridge.ApiMessage
import matterlink.bridge.MessageHandler
import matterlink.cfg
import matterlink.config.cfg
object DeathHandler {
fun handleDeath(player: String, deathMessage: String) {

View File

@ -4,7 +4,7 @@ import matterlink.antiping
import matterlink.bridge.ApiMessage
import matterlink.bridge.JOIN_LEAVE
import matterlink.bridge.MessageHandler
import matterlink.cfg
import matterlink.config.cfg
object JoinLeaveHandler {
fun handleJoin(player: String) {

View File

@ -3,7 +3,7 @@ package matterlink.handlers
import matterlink.antiping
import matterlink.bridge.ApiMessage
import matterlink.bridge.MessageHandler
import matterlink.cfg
import matterlink.config.cfg
object ProgressHandler {

View File

@ -1,16 +1,109 @@
buildscript {
ext.kotlin_version = '1.2.21'
repositories {
jcenter()
maven { url = "http://files.minecraftforge.net/maven" }
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
}
}
plugins {
id "org.jetbrains.kotlin.jvm" version "1.2.20"
id "com.github.johnrengelman.shadow" version "1.2.4"
id 'idea'
}
subprojects {
apply plugin: "kotlin"
apply plugin: 'idea'
group = 'matterlink'
version = '1.1.1'
idea {
module {
excludeDirs += [file("run")]
}
}
if(name != "core") {
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'com.github.johnrengelman.shadow'
version = mc_version + "-" + mod_version
archivesBaseName = "MatterLink"
sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
compileJava {
sourceCompatibility = targetCompatibility = '1.8'
}
minecraft {
version = mc_version + "-" + forge_version
runDir = "run"
mappings = mcp_mappings
replaceIn 'MatterLink.kt'
replace '@VERSION@', mod_version
}
processResources {
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
// replace stuff in mcmod.info, nothing else
from(project(":core").sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version
}
// copy everything else except the mcmod.info
from(project(":core").sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
repositories {
jcenter()
maven {
url = 'http://unascribed.com/maven/releases'
}
maven {
url "http://maven.shadowfacts.net/"
}
}
dependencies {
compile project(':core')
compile group: "net.shadowfacts", name: "Forgelin", version: "1.6.0"
}
shadowJar {
classifier ''
// configurations = [project.configurations.shadow]
relocate "org.apache.http", "matterlink.repack.org.apache.http"
relocate "org.apache.commons.logging", "matterlink.repack.org.apache.commons.logging"
dependencies {
include(project(":core"))
include(dependency("org.apache.httpcomponents:httpclient:4.3.3"))
include(dependency("org.apache.httpcomponents:httpcore:4.3.2"))
include(dependency('commons-logging:commons-logging:1.1.3'))
}
exclude 'dummyThing'
}
reobf {
shadowJar { mappingType = 'SEARGE' }
}
tasks.reobfShadowJar.mustRunAfter shadowJar
}
}

View File

@ -2,6 +2,7 @@
buildscript {
ext.kotlin_version = '1.2.21'
repositories {
jcenter()
mavenCentral()
}
dependencies {
@ -17,9 +18,8 @@ repositories {
}
dependencies {
compile 'org.apache.logging.log4j:log4j-api:2.8.1'
compile "org.apache.httpcomponents:httpclient:4.3.3"
compile "com.google.code.gson:gson:2.8.0"
compile 'org.apache.httpcomponents:httpclient:4.3.3'
compile 'com.google.code.gson:gson:2.8.0'
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
}

View File

@ -1,27 +1,10 @@
package matterlink
import matterlink.bridge.MessageHandler
import matterlink.bridge.ServerChatHandler
import org.apache.logging.log4j.Level
import org.apache.logging.log4j.Logger
import org.apache.logging.log4j.message.SimpleMessageFactory
import org.apache.logging.log4j.simple.SimpleLogger
import org.apache.logging.log4j.util.PropertiesUtil
import java.util.*
var instance: IMatterLink = DummyLink()
//create fake logger to get around Nullability
var logger: Logger = SimpleLogger("",
Level.OFF,
false,
false,
false,
false,
"",
SimpleMessageFactory(),
PropertiesUtil(Properties()),
System.out)
lateinit var instance: IMatterLink
lateinit var logger: Logger
abstract class IMatterLink {
abstract fun wrappedSendToPlayers(msg: String)
@ -39,16 +22,4 @@ abstract class IMatterLink {
fun disconnect () {
MessageHandler.stop()
}
}
class DummyLink : IMatterLink() {
override fun wrappedPlayerList(): Array<String> {
TODO("not implemented, make sure the MatterLink implementations is loaded") //To change body of created functions use File | Settings | File Templates.
}
override fun wrappedSendToPlayers(msg: String) {
TODO("not implemented, make sure the MatterLink implementations is loaded") //To change body of created functions use File | Settings | File Templates.
}
}
}

View File

@ -1,6 +1,6 @@
package matterlink.bridge
import matterlink.cfg
import matterlink.config.cfg
import matterlink.antiping
import com.google.gson.Gson

View File

@ -1,7 +1,6 @@
package matterlink.bridge
import matterlink.IMatterLink
import matterlink.cfg
import matterlink.config.cfg
import matterlink.logger
import org.apache.http.client.methods.HttpGet
import org.apache.http.client.methods.HttpPost

View File

@ -3,7 +3,7 @@ package matterlink.bridge
import matterlink.logger
import matterlink.instance
import matterlink.bridge.command.BridgeCommandRegistry
import matterlink.cfg
import matterlink.config.cfg
object ServerChatHandler {

View File

@ -1,7 +1,6 @@
package matterlink.bridge.command
import matterlink.IMatterLink
import matterlink.cfg
import matterlink.config.cfg
import matterlink.logger
import java.util.*

View File

@ -2,7 +2,7 @@ package matterlink.bridge.command
import matterlink.bridge.ApiMessage
import matterlink.bridge.MessageHandler
import matterlink.cfg
import matterlink.config.cfg
object HelpCommand : IBridgeCommand {
override val name: String = "help"

View File

@ -4,7 +4,7 @@ import matterlink.instance
import matterlink.antiping
import matterlink.bridge.ApiMessage
import matterlink.bridge.MessageHandler
import matterlink.cfg
import matterlink.config.cfg
object PlayerListCommand : IBridgeCommand {
override val name: String = "players"

View File

@ -1,4 +1,4 @@
package matterlink
package matterlink.config
var cfg: IMatterLinkConfig? = null

1
gradle.properties Normal file
View File

@ -0,0 +1 @@
mod_version = 1.1.1