Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle stuff rework, minor cleanup. #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: FireflyX Artifacts
path: build/libs/
path: build/libs/
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
- name: make gradle wrapper executable
run: chmod +x ./gradlew
- name: build
run: ./gradlew publish
run: ./gradlew publish
38 changes: 30 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
`java-library`
`maven-publish`
id("io.izzel.taboolib") version "1.40"
id("org.jetbrains.kotlin.jvm") version "1.5.10"
id("com.github.johnrengelman.shadow") version "7.1.2"
}

taboolib {
Expand Down Expand Up @@ -31,22 +35,40 @@ taboolib {

repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }

maven {
name = "JitPack"
url = uri("https://jitpack.io/")
}

maven {
name = "SpigotMC"
url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
}

maven {
name = "CodeMC NMS"
url = uri("https://repo.codemc.org/repository/maven-public/")
}
}

dependencies {
compileOnly("ink.ptms:nms-all:1.0.0")
compileOnly("ink.ptms.core:v11900:11900-minimize:mapped")
compileOnly("ink.ptms.core:v11900:11900-minimize:universal")
compileOnly(kotlin("stdlib"))
compileOnly(fileTree("libs"))
compileOnly ("org.jetbrains.kotlin:kotlin-stdlib")
compileOnly ("ink.ptms:nms-all:1.0.0")
compileOnly ("ink.ptms.core:v11900:11900-minimize:mapped")
compileOnly ("ink.ptms.core:v11900:11900-minimize:universal")
compileOnly ("com.github.MilkBowl:VaultAPI:1.7")
}

tasks.withType<ShadowJar> {
manifest.attributes["Main-Class"] = "work.crash.micalhl.fireflyx.FireflyX"
}

tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = listOf("-Xjvm-default=all")
Expand Down Expand Up @@ -77,4 +99,4 @@ publishing {
groupId = project.group.toString()
}
}
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
group=work.crash.micalhl
version=1.0.0-beta1
version=1.0.0-beta1
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists
Binary file removed libs/Vault-1.7.3.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rootProject.name="FireflyX"
rootProject.name="FireflyX"
2 changes: 1 addition & 1 deletion src/main/kotlin/work/crash/micalhl/fireflyx/FireflyX.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ object FireflyX : Plugin() {
info("Successfully running ExamplePlugin!")
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ object FireflyXAPI {

val databaseEconomy = Economy()

}
}
4 changes: 1 addition & 3 deletions src/main/kotlin/work/crash/micalhl/fireflyx/compat/Vault.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ package work.crash.micalhl.fireflyx.compat
import net.milkbowl.vault.economy.AbstractEconomy
import net.milkbowl.vault.economy.EconomyResponse
import org.bukkit.OfflinePlayer
import taboolib.module.chat.colored
import work.crash.micalhl.fireflyx.api.FireflyXAPI
import work.crash.micalhl.fireflyx.module.config.Settings
import work.crash.micalhl.fireflyx.util.plugin
import java.math.BigDecimal
import java.text.DecimalFormat

@Suppress("deprecation")
Expand Down Expand Up @@ -138,4 +136,4 @@ class Vault : AbstractEconomy() {
return createPlayerAccount(player.name!!)
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ object VaultHook {
plugin().server.servicesManager.unregisterAll(plugin())
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,4 @@ object FlyCommand {
}
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,4 @@ object MoneyCommand {
}
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ object PingCommand {
}
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ object TPSCommand {
}
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -140,5 +140,4 @@ object TpCommand {
}
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ object Settings {
var captchaIndex = 6
private set

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@ class CaptchaConversation(private val user: ProxyPlayer, val func: () -> Unit) :
}
return END_OF_CONVERSATION
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,4 @@ class Economy {
where { "user" eq user }
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ object EconomyListener {
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ object JoinQuitTipListener {
e.quitMessage = console().asLangText("message-quit", e.player.name, if (Settings.quitTipFix) onlinePlayers().size - 1 else onlinePlayers().size)
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ object BalanceTop {
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ object Captcha {
return captcha.toString()
}

}
}
2 changes: 1 addition & 1 deletion src/main/kotlin/work/crash/micalhl/fireflyx/util/Map.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ inline fun <reified T, R> Map<T, R>.getKeys(value: Any): List<T> {
}
}
return result
}
}
6 changes: 2 additions & 4 deletions src/main/kotlin/work/crash/micalhl/fireflyx/util/Player.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,5 @@ fun ProxyPlayer.toOfflinePlayer(): OfflinePlayer = plugin().server.getOfflinePla
fun ProxyPlayer.toBKPlayer(): Player? {
return if (isOnline()) {
return plugin().server.getPlayer(uniqueId)
} else {
null
}
}
} else null
}
2 changes: 1 addition & 1 deletion src/main/kotlin/work/crash/micalhl/fireflyx/util/Plugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ fun getTPS(): List<Double> {
return result
}

fun plugin() = FireflyX.plugin
fun plugin() = FireflyX.plugin
2 changes: 1 addition & 1 deletion src/main/kotlin/work/crash/micalhl/fireflyx/util/Util.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ fun String.isDouble(): Boolean {
} catch (e: Throwable) {
false
}
}
}
2 changes: 1 addition & 1 deletion src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ TeleportTime: 120
QuitTipFix: true
FirstJoinMoney: 100.0
CurrencyName: "硬币"
CaptchaIndex: 6
CaptchaIndex: 6