mirror of
https://github.com/Auxilor/EcoMobs.git
synced 2025-12-19 23:19:17 +00:00
Compare commits
242 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
429bc6a61f | ||
|
|
b92ea06667 | ||
|
|
1e332bf845 | ||
|
|
7cec9f3e30 | ||
|
|
7db3af5dca | ||
|
|
137f4e3732 | ||
|
|
7338a24b81 | ||
|
|
bde5de1d77 | ||
|
|
b48cc66383 | ||
|
|
bf59ba4d4a | ||
|
|
127a43e032 | ||
|
|
383893c8f6 | ||
|
|
37926bd016 | ||
|
|
6778058150 | ||
|
|
8addad09d2 | ||
|
|
7fe0eece16 | ||
|
|
eca8726323 | ||
|
|
16ba41f39a | ||
|
|
685f40a71b | ||
|
|
76c6d22a00 | ||
|
|
38629407bc | ||
|
|
1eee00b88e | ||
|
|
de47ccf159 | ||
|
|
b81e7af836 | ||
|
|
fcde21c21a | ||
|
|
405659f293 | ||
|
|
2d6154d11f | ||
|
|
9fad76ffad | ||
|
|
e4a40470b8 | ||
|
|
f966629e21 | ||
|
|
93d09c1f3d | ||
|
|
56763be02d | ||
|
|
bd05d4474f | ||
|
|
aa0f9c195d | ||
|
|
e9e0214d1e | ||
|
|
744e3a943d | ||
|
|
fcaea262e8 | ||
|
|
062d2eea77 | ||
|
|
25844170eb | ||
|
|
00cc509b40 | ||
|
|
77e46ffb55 | ||
|
|
1f72e3b9b3 | ||
|
|
a94a5cc04d | ||
|
|
2b8d8eb20a | ||
|
|
1b4851fb9c | ||
|
|
80181bb66e | ||
|
|
d2d6355003 | ||
|
|
b44016d4fe | ||
|
|
74f1953074 | ||
|
|
041e8e070e | ||
|
|
d69b205de5 | ||
|
|
ad827f2b65 | ||
|
|
e8b8dcd2c4 | ||
|
|
e54660cf5e | ||
|
|
7a21d1897d | ||
|
|
64726f665f | ||
|
|
e4fdaeec1d | ||
|
|
3c5fbd6151 | ||
|
|
4329431994 | ||
|
|
c55692e89f | ||
|
|
03466f7892 | ||
|
|
1a6ebd4455 | ||
|
|
486f071dea | ||
|
|
fb4eac5e5e | ||
|
|
49d1d3f054 | ||
|
|
6dc7426146 | ||
|
|
00c5ead347 | ||
|
|
9bd501dfbe | ||
|
|
67d55bbdc2 | ||
|
|
46aa086366 | ||
|
|
9f00334ea4 | ||
|
|
e6db159bfb | ||
|
|
3df7b75737 | ||
|
|
c243a425b3 | ||
|
|
e57fe61d22 | ||
|
|
9830aed484 | ||
|
|
999b89bcb0 | ||
|
|
e7f326efbb | ||
|
|
0cb5b0b7b7 | ||
|
|
8e2d901e9b | ||
|
|
724eede36e | ||
|
|
01a2cc7118 | ||
|
|
20aace3727 | ||
|
|
ec9d4c0dd6 | ||
|
|
b3a0c1fa67 | ||
|
|
88294a17cd | ||
|
|
1ac6a350ec | ||
|
|
a9333cb8b5 | ||
|
|
05cf399e77 | ||
|
|
de2b8f7526 | ||
|
|
23085e74e2 | ||
|
|
80f02a07a4 | ||
|
|
a63625593d | ||
|
|
1dfd7bac1f | ||
|
|
34b983b185 | ||
|
|
33b2fd9e13 | ||
|
|
85cfb542dc | ||
|
|
197f9e91aa | ||
|
|
9d4a91805a | ||
|
|
87b91c46d1 | ||
|
|
4a7e6e9ff1 | ||
|
|
b59e54be01 | ||
|
|
d26f0294cc | ||
|
|
150433d46b | ||
|
|
7de4d75c93 | ||
|
|
9790459a26 | ||
|
|
666a80b401 | ||
|
|
59810059aa | ||
|
|
7b604c7812 | ||
|
|
81eab18e42 | ||
|
|
fa54c7022b | ||
|
|
26f976a7ca | ||
|
|
4fa070dabe | ||
|
|
f73327b204 | ||
|
|
d9b702f2f1 | ||
|
|
7692e84a60 | ||
|
|
ffd6037e73 | ||
|
|
7c959d7221 | ||
|
|
91ad33334d | ||
|
|
c1b8ed5b48 | ||
|
|
2f3c5f60a4 | ||
|
|
f3387668e6 | ||
|
|
b62e79d904 | ||
|
|
d7afeecc27 | ||
|
|
72e61940c5 | ||
|
|
245445473b | ||
|
|
46772ac97a | ||
|
|
29a1e541a2 | ||
|
|
89a6bc97b7 | ||
|
|
c59707e6ac | ||
|
|
99bc2a04ab | ||
|
|
b4e90d9bda | ||
|
|
72c3722429 | ||
|
|
c14b2f0a80 | ||
|
|
0b6c7152e8 | ||
|
|
6e551eeaeb | ||
|
|
d5610ae804 | ||
|
|
79c8ed4992 | ||
|
|
947a0f3c6d | ||
|
|
ce8b0af155 | ||
|
|
a41e5b702d | ||
|
|
f04bf3aeea | ||
|
|
08941461c9 | ||
|
|
743dbac656 | ||
|
|
2e8d1ea4cc | ||
|
|
d31a98fd99 | ||
|
|
f7244a7d7f | ||
|
|
268ed76951 | ||
|
|
d0ccb78c17 | ||
|
|
34de040849 | ||
|
|
6b01f8e64a | ||
|
|
2a4d5a8fd2 | ||
|
|
f9d7315fd3 | ||
|
|
497f42ccc6 | ||
|
|
d149eb7907 | ||
|
|
47277d0dd8 | ||
|
|
f307f13d1e | ||
|
|
ac3370c0be | ||
|
|
4f616ac8c8 | ||
|
|
24256e9789 | ||
|
|
bbf20e77d0 | ||
|
|
8a506c015b | ||
|
|
744883630d | ||
|
|
8519f4fc23 | ||
|
|
d1cb11ef79 | ||
|
|
edcc185b58 | ||
|
|
ab6d297222 | ||
|
|
9626588c66 | ||
|
|
c4eda19d78 | ||
|
|
691326577a | ||
|
|
e2086387e7 | ||
|
|
13a72f849d | ||
|
|
6346975e77 | ||
|
|
0d846d9dff | ||
|
|
31610383c4 | ||
|
|
d7c16ad3cc | ||
|
|
afe9095276 | ||
|
|
31a782581f | ||
|
|
8aad221450 | ||
|
|
b0bff24263 | ||
|
|
04b00fa01b | ||
|
|
276ba4616a | ||
|
|
d8e5fb9cd0 | ||
|
|
9f05a6504a | ||
|
|
322a6bb41b | ||
|
|
4dbc8afdf4 | ||
|
|
7ffa6ff4f4 | ||
|
|
3769684bb0 | ||
|
|
7bb931e027 | ||
|
|
879d6dd72d | ||
|
|
0a4aff45ad | ||
|
|
5929da1f48 | ||
|
|
6db5de581b | ||
|
|
9ce1bb7ddf | ||
|
|
351d34de9f | ||
|
|
4d2b726aa0 | ||
|
|
ff20b70784 | ||
|
|
f31cd20200 | ||
|
|
0ad2d3cfc7 | ||
|
|
ccc7c5797a | ||
|
|
a218fa96c0 | ||
|
|
13c0a4d83a | ||
|
|
62e7177b1b | ||
|
|
752b30b4a2 | ||
|
|
be4d6156e3 | ||
|
|
fed6dcafd7 | ||
|
|
36f944c58c | ||
|
|
1bc35656fe | ||
|
|
1216e83a39 | ||
|
|
4723c7982c | ||
|
|
8ba3c7834c | ||
|
|
76530a1617 | ||
|
|
bf41554846 | ||
|
|
a741c78b6b | ||
|
|
0f8dce74da | ||
|
|
0d31556b84 | ||
|
|
f8544c284e | ||
|
|
512a477fc6 | ||
|
|
8a1b473837 | ||
|
|
7464133c74 | ||
|
|
1e00b28a8b | ||
|
|
b152313f87 | ||
|
|
ec6d7175b9 | ||
|
|
804a0e88b9 | ||
|
|
ff2de5aebe | ||
|
|
990ad363eb | ||
|
|
d958b94fb0 | ||
|
|
e4f2a91968 | ||
|
|
f1d50d6222 | ||
|
|
035550db06 | ||
|
|
f4bd64c192 | ||
|
|
4b8e1c0579 | ||
|
|
d8cf08eb25 | ||
|
|
a94c96e5d4 | ||
|
|
dddf2d8a20 | ||
|
|
7e67620c8c | ||
|
|
8c44303cdc | ||
|
|
97c1045243 | ||
|
|
c47019f3c5 | ||
|
|
1ffedfcb2e | ||
|
|
17705e9fdb | ||
|
|
7087feefbc |
@@ -1,6 +1,6 @@
|
||||
<h1 align="center">
|
||||
<br>
|
||||
<img src="https://i.imgur.com/A2qieC3.png" alt="EcoBosses logo" width="256">
|
||||
<img src="https://i.imgur.com/3n3ssb4.png" alt="EcoBosses logo" width="256">
|
||||
<br>
|
||||
</h1>
|
||||
|
||||
|
||||
121
build.gradle
121
build.gradle
@@ -1,121 +0,0 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.0"
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'java-library'
|
||||
id 'com.github.johnrengelman.shadow' version '7.0.0'
|
||||
id 'maven-publish'
|
||||
id 'java'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation project(":eco-core").getSubprojects()
|
||||
}
|
||||
|
||||
allprojects {
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'kotlin'
|
||||
apply plugin: 'maven-publish'
|
||||
apply plugin: 'com.github.johnrengelman.shadow'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
maven { url 'https://jitpack.io' }
|
||||
maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
|
||||
maven { url 'https://repo.codemc.org/repository/nms/' }
|
||||
maven { url 'https://repo.codemc.org/repository/maven-public' }
|
||||
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
|
||||
maven { url 'https://oss.sonatype.org/content/groups/public/' }
|
||||
maven { url 'https://maven.enginehub.org/repo/' }
|
||||
maven { url 'https://ci.ender.zone/plugin/repository/project/' }
|
||||
maven { url 'https://ci.ender.zone/plugin/repository/everything/' }
|
||||
maven { url 'https://repo.md-5.net/content/repositories/snapshots/' }
|
||||
maven { url 'https://repo.dmulloy2.net/nexus/repository/public/' }
|
||||
maven { url 'https://papermc.io/repo/repository/maven-public/' }
|
||||
maven { url 'https://repo.maven.apache.org/maven2/' }
|
||||
maven { url 'https://repo.dustplanet.de/artifactory/ext-release-local/' }
|
||||
maven { url 'https://maven.seyfahni.de/repository/snapshots/' }
|
||||
maven { url 'https://libraries.minecraft.net/' }
|
||||
maven { url 'https://repo.spongepowered.org/maven/' }
|
||||
maven { url 'https://org.kitteh.pastegg' }
|
||||
maven { url 'https://repo.mikeprimm.com/' }
|
||||
maven { url 'https://maven.sk89q.com/repo/' }
|
||||
maven { url 'https://github.com/factions-site/repo/raw/public/' }
|
||||
maven { url 'https://repo.extendedclip.com/content/repositories/placeholderapi/' }
|
||||
}
|
||||
|
||||
jar {
|
||||
onlyIf { !sourceSets.main.allSource.files.isEmpty() }
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
relocate('com.willfp.libreforge', 'com.willfp.ecobosses.libreforge')
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly 'com.willfp:eco:6.24.0'
|
||||
implementation 'com.willfp:libreforge:3.15.1'
|
||||
|
||||
compileOnly 'org.jetbrains:annotations:23.0.0'
|
||||
|
||||
compileOnly 'org.jetbrains.kotlin:kotlin-stdlib:1.6.0'
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
options.deprecation = true
|
||||
options.encoding = 'UTF-8'
|
||||
}
|
||||
|
||||
processResources {
|
||||
filesNotMatching(["**/*.png", "**/models/**", "**/textures/**", "**lang.yml"]) {
|
||||
expand projectVersion: project.version
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
|
||||
kotlinOptions {
|
||||
jvmTarget = "17"
|
||||
}
|
||||
}
|
||||
|
||||
java.sourceCompatibility = JavaVersion.VERSION_17
|
||||
java.targetCompatibility = JavaVersion.VERSION_17
|
||||
|
||||
compileJava.options.encoding = 'UTF-8'
|
||||
compileJava.dependsOn clean
|
||||
|
||||
build.dependsOn shadowJar
|
||||
}
|
||||
|
||||
tasks.withType(Jar) {
|
||||
destinationDirectory = file("$rootDir/bin/")
|
||||
}
|
||||
|
||||
clean.doLast {
|
||||
file("${rootDir}/bin").deleteDir()
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
archiveFileName = findProperty("plugin-name") + " v" + findProperty("version") + ".jar"
|
||||
}
|
||||
|
||||
jar {
|
||||
archiveFileName = findProperty("plugin-name") + " v" + findProperty("version") + " " + "unshaded" + ".jar"
|
||||
}
|
||||
|
||||
group = 'com.willfp'
|
||||
archivesBaseName = project.name
|
||||
version = findProperty("version")
|
||||
|
||||
compileJava.options.encoding = 'UTF-8'
|
||||
|
||||
build.dependsOn shadowJar
|
||||
build.dependsOn publishToMavenLocal
|
||||
131
build.gradle.kts
Normal file
131
build.gradle.kts
Normal file
@@ -0,0 +1,131 @@
|
||||
plugins {
|
||||
java
|
||||
`java-library`
|
||||
`maven-publish`
|
||||
kotlin("jvm") version "1.7.10"
|
||||
id("com.github.johnrengelman.shadow") version "7.0.0"
|
||||
}
|
||||
|
||||
group = "com.willfp"
|
||||
version = findProperty("version")!!
|
||||
|
||||
base {
|
||||
archivesName.set(project.name)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
project(":eco-core").dependencyProject.subprojects {
|
||||
implementation(this)
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
apply(plugin = "java")
|
||||
apply(plugin = "kotlin")
|
||||
apply(plugin = "com.github.johnrengelman.shadow")
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
maven("https://jitpack.io")
|
||||
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
|
||||
maven("https://repo.codemc.org/repository/nms/")
|
||||
maven("https://repo.codemc.org/repository/maven-public")
|
||||
maven("https://repo.dmulloy2.net/nexus/repository/public/")
|
||||
maven("https://papermc.io/repo/repository/maven-public/")
|
||||
maven("https://mvn.lumine.io/repository/maven-public/")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("com.willfp:eco:6.35.1")
|
||||
compileOnly("org.jetbrains:annotations:23.0.0")
|
||||
compileOnly("org.jetbrains.kotlin:kotlin-stdlib:1.7.10")
|
||||
|
||||
implementation("com.willfp:libreforge:3.108.0")
|
||||
implementation("org.joml:joml:1.10.4")
|
||||
}
|
||||
|
||||
java {
|
||||
withSourcesJar()
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
||||
}
|
||||
|
||||
tasks {
|
||||
compileKotlin {
|
||||
kotlinOptions {
|
||||
jvmTarget = "17"
|
||||
freeCompilerArgs = freeCompilerArgs + "-Xjvm-default=all"
|
||||
}
|
||||
}
|
||||
|
||||
compileJava {
|
||||
options.isDeprecation = true
|
||||
options.encoding = "UTF-8"
|
||||
|
||||
dependsOn(clean)
|
||||
}
|
||||
|
||||
processResources {
|
||||
val ignoreList = listOf("**/*.png", "**/models/**", "**/textures/**", "**lang.yml")
|
||||
filesNotMatching(ignoreList) {
|
||||
expand("projectVersion" to project.version)
|
||||
}
|
||||
}
|
||||
|
||||
build {
|
||||
dependsOn(shadowJar)
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
relocate("com.willfp.libreforge", "com.willfp.ecobosses.libreforge")
|
||||
relocate("org.joml", "com.willfp.ecobosses.libreforge.joml")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks {
|
||||
shadowJar {
|
||||
destinationDirectory.set(file("$rootDir/bin"))
|
||||
}
|
||||
|
||||
val buyThePlugins by creating {
|
||||
dependsOn(subprojects.map { it.tasks.getByName("build") })
|
||||
|
||||
doLast {
|
||||
println("If you like the plugin, please consider buying it on Spigot or Polymart!")
|
||||
println("Spigot: https://www.spigotmc.org/resources/authors/auxilor.507394/")
|
||||
println("Polymart: https://polymart.org/user/auxilor.1107/")
|
||||
println("Buying gives you access to support and the plugin auto-updater, and it allows me to keep developing plugins.")
|
||||
}
|
||||
}
|
||||
|
||||
build {
|
||||
dependsOn(shadowJar)
|
||||
dependsOn(publishToMavenLocal)
|
||||
finalizedBy(buyThePlugins)
|
||||
}
|
||||
|
||||
clean.get().doLast { file("$rootDir/bin").deleteRecursively() }
|
||||
|
||||
fun fileName(extra: String): String = buildString {
|
||||
append(findProperty("plugin-name"))
|
||||
append(" v")
|
||||
append(findProperty("version"))
|
||||
if (extra.isNotEmpty()) {
|
||||
append(" ")
|
||||
append(extra)
|
||||
}
|
||||
append(".jar")
|
||||
}
|
||||
|
||||
shadowJar.get().archiveFileName.set(fileName(""))
|
||||
jar.get().archiveFileName.set(fileName("unshaded"))
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
register("maven", MavenPublication::class) {
|
||||
from(subprojects.first { it.name == "core-plugin" }.components["java"])
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
group 'com.willfp'
|
||||
version rootProject.version
|
||||
2
eco-core/build.gradle.kts
Normal file
2
eco-core/build.gradle.kts
Normal file
@@ -0,0 +1,2 @@
|
||||
group = "com.willfp"
|
||||
version = rootProject.version
|
||||
@@ -1,8 +0,0 @@
|
||||
group 'com.willfp'
|
||||
version rootProject.version
|
||||
|
||||
dependencies {
|
||||
compileOnly 'org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT'
|
||||
compileOnly 'com.github.lokka30:LevelledMobs:3.1.4'
|
||||
compileOnly 'net.kyori:adventure-api:4.9.3'
|
||||
}
|
||||
11
eco-core/core-plugin/build.gradle.kts
Normal file
11
eco-core/core-plugin/build.gradle.kts
Normal file
@@ -0,0 +1,11 @@
|
||||
group = "com.willfp"
|
||||
version = rootProject.version
|
||||
|
||||
dependencies {
|
||||
compileOnly("org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT")
|
||||
compileOnly("net.kyori:adventure-api:4.9.3")
|
||||
|
||||
// Integrations
|
||||
compileOnly("com.github.lokka30:LevelledMobs:3.1.4")
|
||||
compileOnly("com.ticxo.modelengine:api:R3.0.1")
|
||||
}
|
||||
@@ -1,17 +1,19 @@
|
||||
package com.willfp.ecobosses
|
||||
|
||||
import com.willfp.eco.core.command.impl.PluginCommand
|
||||
import com.willfp.eco.core.display.DisplayModule
|
||||
import com.willfp.eco.core.integrations.IntegrationLoader
|
||||
import com.willfp.ecobosses.bosses.Bosses
|
||||
import com.willfp.ecobosses.bosses.EggDisplay
|
||||
import com.willfp.ecobosses.bosses.bossHolders
|
||||
import com.willfp.ecobosses.commands.CommandEcobosses
|
||||
import com.willfp.ecobosses.config.EcoBossesYml
|
||||
import com.willfp.ecobosses.defence.DamageMultiplierHandler
|
||||
import com.willfp.ecobosses.defence.ImmunitiesHandler
|
||||
import com.willfp.ecobosses.defence.MountHandler
|
||||
import com.willfp.ecobosses.defence.PickupHandler
|
||||
import com.willfp.ecobosses.integrations.levelledmobs.IntegrationLevelledMobs
|
||||
import com.willfp.ecobosses.lifecycle.CompatibilityListeners
|
||||
import com.willfp.ecobosses.lifecycle.ConsoleLoggers
|
||||
import com.willfp.ecobosses.lifecycle.DeathListeners
|
||||
import com.willfp.ecobosses.lifecycle.LifecycleHandlers
|
||||
import com.willfp.ecobosses.spawn.AutospawnHandler
|
||||
@@ -22,15 +24,16 @@ import com.willfp.ecobosses.util.TopDamagerListener
|
||||
import com.willfp.libreforge.LibReforgePlugin
|
||||
import org.bukkit.event.Listener
|
||||
|
||||
class EcoBossesPlugin : LibReforgePlugin(525, 10635, "&9") {
|
||||
val ecoBossesYml: EcoBossesYml
|
||||
|
||||
class EcoBossesPlugin : LibReforgePlugin() {
|
||||
init {
|
||||
instance = this
|
||||
ecoBossesYml = EcoBossesYml(this)
|
||||
registerHolderProvider { it.bossHolders }
|
||||
}
|
||||
|
||||
override fun handleEnableAdditional() {
|
||||
this.copyConfigs("bosses")
|
||||
}
|
||||
|
||||
override fun handleReloadAdditional() {
|
||||
Bosses.getAllAlive().forEach { it.remove() }
|
||||
|
||||
@@ -43,6 +46,10 @@ class EcoBossesPlugin : LibReforgePlugin(525, 10635, "&9") {
|
||||
Bosses.getAllAlive().forEach { it.remove() }
|
||||
}
|
||||
|
||||
override fun createDisplayModule(): DisplayModule {
|
||||
return EggDisplay(this)
|
||||
}
|
||||
|
||||
override fun loadPluginCommands(): List<PluginCommand> {
|
||||
return listOf(
|
||||
CommandEcobosses(this)
|
||||
@@ -54,14 +61,15 @@ class EcoBossesPlugin : LibReforgePlugin(525, 10635, "&9") {
|
||||
DiscoverRecipeListener(this),
|
||||
TopDamagerListener(),
|
||||
LifecycleHandlers(),
|
||||
SpawnEggHandler(),
|
||||
SpawnEggHandler(this),
|
||||
DamageMultiplierHandler(),
|
||||
MountHandler(),
|
||||
PickupHandler(),
|
||||
ImmunitiesHandler(),
|
||||
CompatibilityListeners(),
|
||||
SpawnTotemHandler(),
|
||||
DeathListeners()
|
||||
DeathListeners(),
|
||||
ConsoleLoggers(this)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -72,7 +80,7 @@ class EcoBossesPlugin : LibReforgePlugin(525, 10635, "&9") {
|
||||
}
|
||||
|
||||
override fun getMinimumEcoVersion(): String {
|
||||
return "6.24.0"
|
||||
return "6.35.1"
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.willfp.ecobosses.bosses
|
||||
|
||||
import com.willfp.eco.core.fast.fast
|
||||
import com.willfp.ecobosses.EcoBossesPlugin
|
||||
import com.willfp.libreforge.Holder
|
||||
import org.bukkit.entity.Player
|
||||
@@ -13,7 +14,7 @@ val Player.bossHolders: Iterable<Holder>
|
||||
|
||||
for (boss in Bosses.values()) {
|
||||
for (livingBoss in boss.getAllAlive()) {
|
||||
val entity = livingBoss.entity ?: continue
|
||||
val entity = livingBoss.entity
|
||||
|
||||
if (entity.world != this.world) {
|
||||
continue
|
||||
@@ -42,8 +43,7 @@ var ItemStack.bossEgg: EcoBoss?
|
||||
this.itemMeta = meta
|
||||
}
|
||||
get() {
|
||||
val meta = this.itemMeta ?: return null
|
||||
val pdc = meta.persistentDataContainer
|
||||
val pdc = this.fast().persistentDataContainer
|
||||
val id = pdc.get(spawnEggKey, PersistentDataType.STRING) ?: return null
|
||||
return Bosses.getByID(id)
|
||||
}
|
||||
|
||||
@@ -3,16 +3,18 @@ package com.willfp.ecobosses.bosses
|
||||
import com.google.common.collect.BiMap
|
||||
import com.google.common.collect.HashBiMap
|
||||
import com.google.common.collect.ImmutableList
|
||||
import com.willfp.eco.core.config.ConfigType
|
||||
import com.willfp.eco.core.config.TransientConfig
|
||||
import com.willfp.eco.core.config.updating.ConfigUpdater
|
||||
import com.willfp.ecobosses.EcoBossesPlugin
|
||||
import com.willfp.libreforge.chains.EffectChains
|
||||
import com.willfp.libreforge.separatorAmbivalent
|
||||
import org.bukkit.entity.Entity
|
||||
import org.bukkit.entity.LivingEntity
|
||||
import java.io.File
|
||||
import java.util.UUID
|
||||
|
||||
object Bosses {
|
||||
/**
|
||||
* Registered bosses.
|
||||
*/
|
||||
/** Registered bosses. */
|
||||
private val BY_ID: BiMap<String, EcoBoss> = HashBiMap.create()
|
||||
|
||||
/**
|
||||
@@ -44,16 +46,19 @@ object Bosses {
|
||||
@ConfigUpdater
|
||||
@JvmStatic
|
||||
fun update(plugin: EcoBossesPlugin) {
|
||||
plugin.ecoBossesYml.getSubsections("chains").mapNotNull {
|
||||
EffectChains.compile(it, "Effect Chains")
|
||||
}
|
||||
|
||||
for (boss in values()) {
|
||||
removeBoss(boss)
|
||||
}
|
||||
|
||||
for (bossConfig in plugin.ecoBossesYml.getSubsections("bosses")) {
|
||||
addNewBoss(EcoBoss(bossConfig, plugin))
|
||||
for ((id, config) in plugin.fetchConfigs("bosses")) {
|
||||
addNewBoss(EcoBoss(id, config, plugin))
|
||||
}
|
||||
|
||||
val ecoBossesYml = TransientConfig(File(plugin.dataFolder, "ecobosses.yml"), ConfigType.YAML)
|
||||
|
||||
for (bossConfig in ecoBossesYml.getSubsections("bosses")) {
|
||||
// Boss configs are separator ambivalent in order to preserve backwards compatibility
|
||||
addNewBoss(EcoBoss(bossConfig.getString("id"), bossConfig.separatorAmbivalent(), plugin))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,4 +124,14 @@ object Bosses {
|
||||
operator fun get(entity: LivingEntity): LivingEcoBoss? {
|
||||
return get(entity.uniqueId)
|
||||
}
|
||||
|
||||
/** If an entity is a boss. */
|
||||
val Entity?.isBoss: Boolean
|
||||
get() {
|
||||
if (this !is LivingEntity) {
|
||||
return false
|
||||
}
|
||||
|
||||
return Bosses[this] != null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.willfp.ecobosses.bosses
|
||||
|
||||
import com.willfp.eco.core.entities.ai.Goal
|
||||
|
||||
data class ConfiguredGoal<T : Goal<*>>(
|
||||
val priority: Int,
|
||||
val goal: T
|
||||
)
|
||||
@@ -1,21 +1,29 @@
|
||||
package com.willfp.ecobosses.bosses
|
||||
|
||||
import com.ticxo.modelengine.api.ModelEngineAPI
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.core.config.interfaces.Config
|
||||
import com.willfp.eco.core.entities.CustomEntity
|
||||
import com.willfp.eco.core.entities.Entities
|
||||
import com.willfp.eco.core.entities.TestableEntity
|
||||
import com.willfp.eco.core.entities.ai.EntityController
|
||||
import com.willfp.eco.core.entities.ai.EntityGoal
|
||||
import com.willfp.eco.core.entities.ai.EntityGoals
|
||||
import com.willfp.eco.core.entities.ai.TargetGoal
|
||||
import com.willfp.eco.core.entities.ai.TargetGoals
|
||||
import com.willfp.eco.core.items.CustomItem
|
||||
import com.willfp.eco.core.items.Items
|
||||
import com.willfp.eco.core.items.builder.ItemStackBuilder
|
||||
import com.willfp.eco.core.recipe.Recipes
|
||||
import com.willfp.eco.core.recipe.parts.EmptyTestableItem
|
||||
import com.willfp.eco.core.recipe.recipes.CraftingRecipe
|
||||
import com.willfp.eco.util.NamespacedKeyUtils
|
||||
import com.willfp.eco.util.toComponent
|
||||
import com.willfp.ecobosses.events.BossKillEvent
|
||||
import com.willfp.ecobosses.lifecycle.BossLifecycle
|
||||
import com.willfp.ecobosses.tick.BossBarTicker
|
||||
import com.willfp.ecobosses.tick.BossTicker
|
||||
import com.willfp.ecobosses.tick.ChunkTicker
|
||||
import com.willfp.ecobosses.tick.DisplayNameTicker
|
||||
import com.willfp.ecobosses.tick.LifespanTicker
|
||||
import com.willfp.ecobosses.tick.TargetTicker
|
||||
@@ -24,6 +32,7 @@ import com.willfp.ecobosses.util.BossDrop
|
||||
import com.willfp.ecobosses.util.CommandReward
|
||||
import com.willfp.ecobosses.util.ConfiguredSound
|
||||
import com.willfp.ecobosses.util.LocalBroadcast
|
||||
import com.willfp.ecobosses.util.LocalCommands
|
||||
import com.willfp.ecobosses.util.PlayableSound
|
||||
import com.willfp.ecobosses.util.SpawnTotem
|
||||
import com.willfp.ecobosses.util.XpReward
|
||||
@@ -36,18 +45,19 @@ import org.bukkit.Bukkit
|
||||
import org.bukkit.Location
|
||||
import org.bukkit.Material
|
||||
import org.bukkit.entity.LivingEntity
|
||||
import org.bukkit.entity.Mob
|
||||
import org.bukkit.entity.Player
|
||||
import org.bukkit.inventory.ItemStack
|
||||
import org.bukkit.persistence.PersistentDataType
|
||||
import java.util.Objects
|
||||
import java.util.UUID
|
||||
|
||||
class EcoBoss(
|
||||
override val id: String,
|
||||
val config: Config,
|
||||
private val plugin: EcoPlugin
|
||||
) : Holder {
|
||||
val id: String = config.getString("id")
|
||||
|
||||
val displayName: String = config.getString("displayName")
|
||||
val displayName: String = config.getString("display-name")
|
||||
|
||||
val lifespan = config.getInt("lifespan")
|
||||
|
||||
@@ -57,23 +67,23 @@ class EcoBoss(
|
||||
|
||||
val targetMode = TargetMode.getByID(config.getString("target.mode"))!!
|
||||
|
||||
val isBossBarEnabled = config.getBool("bossBar.enabled")
|
||||
val isBossBarEnabled = config.getBool("boss-bar.enabled")
|
||||
|
||||
val bossBarRadius = config.getDouble("bossBar.radius")
|
||||
val bossBarRadius = config.getDouble("boss-bar.radius")
|
||||
|
||||
val isPreventingMounts = config.getBool("defence.preventMounts")
|
||||
val isPreventingMounts = config.getBool("defence.prevent-mounts")
|
||||
|
||||
val isImmuneToExplosions = config.getBool("defence.explosionImmune")
|
||||
val isImmuneToExplosions = config.getBool("defence.explosion-immune")
|
||||
|
||||
val isImmuneToFire = config.getBool("defence.fireImmune")
|
||||
val isImmuneToFire = config.getBool("defence.fire-immune")
|
||||
|
||||
val isImmuneToDrowning = config.getBool("defence.drowningImmune")
|
||||
val isImmuneToDrowning = config.getBool("defence.drowning-immune")
|
||||
|
||||
val isImmuneToSuffocation = config.getBool("defence.suffocationImmune")
|
||||
val isImmuneToSuffocation = config.getBool("defence.suffocation-immune")
|
||||
|
||||
val meleeDamageMultiplier = config.getDouble("defence.meleeDamageMultiplier")
|
||||
val meleeDamageMultiplier = config.getDouble("defence.melee-damage-multiplier")
|
||||
|
||||
val projectileDamageMultiplier = config.getDouble("defence.projectileDamageMultiplier")
|
||||
val projectileDamageMultiplier = config.getDouble("defence.projectile-damage-multiplier")
|
||||
|
||||
val canTeleport = config.getBool("defence.teleportation.enabled")
|
||||
|
||||
@@ -93,8 +103,15 @@ class EcoBoss(
|
||||
return@run null
|
||||
}
|
||||
|
||||
val name = config.getFormattedStringOrNull("spawn.egg.name")
|
||||
|
||||
val item = ItemStackBuilder(lookup)
|
||||
.addLoreLines(config.getFormattedStrings("spawn.egg.lore"))
|
||||
.apply {
|
||||
if (name != null) {
|
||||
setDisplayName(name)
|
||||
}
|
||||
}
|
||||
.build().apply { bossEgg = this@EcoBoss }
|
||||
|
||||
val key = plugin.namespacedKeyFactory.create("${this.id}_spawn_egg")
|
||||
@@ -135,9 +152,9 @@ class EcoBoss(
|
||||
}
|
||||
|
||||
SpawnTotem(
|
||||
Material.getMaterial(config.getString("spawn.totem.top")) ?: return@run null,
|
||||
Material.getMaterial(config.getString("spawn.totem.middle")) ?: return@run null,
|
||||
Material.getMaterial(config.getString("spawn.totem.bottom")) ?: return@run null
|
||||
Material.getMaterial(config.getString("spawn.totem.top").uppercase()) ?: return@run null,
|
||||
Material.getMaterial(config.getString("spawn.totem.middle").uppercase()) ?: return@run null,
|
||||
Material.getMaterial(config.getString("spawn.totem.bottom").uppercase()) ?: return@run null
|
||||
)
|
||||
}
|
||||
|
||||
@@ -153,31 +170,45 @@ class EcoBoss(
|
||||
val x = config.getDouble("x")
|
||||
val y = config.getDouble("y")
|
||||
val z = config.getDouble("z")
|
||||
locations.add(
|
||||
Location(
|
||||
world, x, y, z
|
||||
)
|
||||
)
|
||||
locations.add(Location(world, x, y, z))
|
||||
}
|
||||
|
||||
locations
|
||||
}
|
||||
|
||||
val hasCustomAI = config.getBool("custom-ai.enabled")
|
||||
|
||||
val targetGoals = config.getSubsections("custom-ai.target-goals").mapNotNull {
|
||||
val key = NamespacedKeyUtils.fromStringOrNull(it.getString("key")) ?: return@mapNotNull null
|
||||
val deserializer = TargetGoals.getByKey(key) ?: return@mapNotNull null
|
||||
val goal = deserializer.deserialize(it.getSubsection("args")) ?: return@mapNotNull null
|
||||
ConfiguredGoal(it.getInt("priority"), goal)
|
||||
}
|
||||
|
||||
val entityGoals = config.getSubsections("custom-ai.ai-goals").mapNotNull {
|
||||
val key = NamespacedKeyUtils.fromStringOrNull(it.getString("key")) ?: return@mapNotNull null
|
||||
val deserializer = EntityGoals.getByKey(key) ?: return@mapNotNull null
|
||||
val goal = deserializer.deserialize(it.getSubsection("args")) ?: return@mapNotNull null
|
||||
ConfiguredGoal(it.getInt("priority"), goal)
|
||||
}
|
||||
|
||||
val spawnConditions = config.getSubsections("spawn.conditions").mapNotNull {
|
||||
Conditions.compile(it, "$id Spawn Conditions")
|
||||
}
|
||||
|
||||
private val bossBarColor = BossBar.Color.valueOf(config.getString("bossBar.color").uppercase())
|
||||
private val bossBarColor = BossBar.Color.valueOf(config.getString("boss-bar.color").uppercase())
|
||||
|
||||
private val bossBarStyle = BossBar.Overlay.valueOf(config.getString("bossBar.style").uppercase())
|
||||
private val bossBarStyle = BossBar.Overlay.valueOf(config.getString("boss-bar.style").uppercase())
|
||||
|
||||
private val sounds: Map<BossLifecycle, PlayableSound> = run {
|
||||
val map = mutableMapOf<BossLifecycle, PlayableSound>()
|
||||
|
||||
for (value in BossLifecycle.values()) {
|
||||
map[value] = PlayableSound(config.getSubsections("sounds.${value.name.lowercase()}").map {
|
||||
map[value] = PlayableSound(
|
||||
config.getSubsections("sounds.${value.name.lowercase()}").map {
|
||||
ConfiguredSound.fromConfig(it)
|
||||
})
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
map
|
||||
@@ -195,13 +226,23 @@ class EcoBoss(
|
||||
map
|
||||
}
|
||||
|
||||
private val commands: Map<BossLifecycle, LocalCommands> = run {
|
||||
val map = mutableMapOf<BossLifecycle, LocalCommands>()
|
||||
|
||||
for (value in BossLifecycle.values()) {
|
||||
map[value] = LocalCommands(config.getStrings("commands.${value.name.lowercase()}"))
|
||||
}
|
||||
|
||||
map
|
||||
}
|
||||
|
||||
private val commandRewards: Map<Int, Iterable<CommandReward>> = run {
|
||||
val map = mutableMapOf<Int, Iterable<CommandReward>>()
|
||||
|
||||
for (rank in config.getSubsection("rewards.topDamagerCommands").getKeys(false)) {
|
||||
for (rank in config.getSubsection("rewards.top-damager-commands").getKeys(false)) {
|
||||
val rankRewards = mutableListOf<CommandReward>()
|
||||
|
||||
for (config in config.getSubsections("rewards.topDamagerCommands.$rank")) {
|
||||
for (config in config.getSubsections("rewards.top-damager-commands.$rank")) {
|
||||
rankRewards.add(
|
||||
CommandReward(
|
||||
config.getDouble("chance"),
|
||||
@@ -216,12 +257,12 @@ class EcoBoss(
|
||||
map
|
||||
}
|
||||
|
||||
private val nearbyCommandRewardRadius = config.getDouble("rewards.nearbyPlayerCommands.radius")
|
||||
private val nearbyCommandRewardRadius = config.getDouble("rewards.nearby-player-commands.radius")
|
||||
|
||||
private val nearbyCommands: Iterable<CommandReward> = run {
|
||||
val list = mutableListOf<CommandReward>()
|
||||
|
||||
for (config in config.getSubsections("rewards.nearbyPlayerCommands.commands")) {
|
||||
for (config in config.getSubsections("rewards.nearby-player-commands.commands")) {
|
||||
list.add(
|
||||
CommandReward(
|
||||
config.getDouble("chance"),
|
||||
@@ -238,7 +279,6 @@ class EcoBoss(
|
||||
config.getInt("rewards.xp.maximum")
|
||||
)
|
||||
|
||||
|
||||
private val drops: Iterable<BossDrop> = run {
|
||||
val list = mutableListOf<BossDrop>()
|
||||
|
||||
@@ -248,6 +288,7 @@ class EcoBoss(
|
||||
config.getDouble("chance"),
|
||||
config.getStrings("items")
|
||||
.map { Items.lookup(it) }
|
||||
.filter { it !is EmptyTestableItem }
|
||||
.map { it.item }
|
||||
)
|
||||
)
|
||||
@@ -258,6 +299,10 @@ class EcoBoss(
|
||||
|
||||
private val mob: TestableEntity = Entities.lookup(config.getString("mob"))
|
||||
|
||||
private val modelEngineID = config.getStringOrNull("model-engine-id")
|
||||
|
||||
private val modelEngineAnimation = config.getStringOrNull("model-engine-animation")
|
||||
|
||||
private val currentlyAlive = mutableMapOf<UUID, LivingEcoBoss>()
|
||||
|
||||
override val conditions = config.getSubsections("conditions").mapNotNull {
|
||||
@@ -285,10 +330,57 @@ class EcoBoss(
|
||||
}
|
||||
|
||||
fun spawn(location: Location): LivingEcoBoss {
|
||||
val mob = mob.spawn(location) as LivingEntity
|
||||
val mob = mob.spawn(location) as Mob
|
||||
mob.isPersistent = true
|
||||
mob.isCustomNameVisible = true
|
||||
mob.removeWhenFarAway = false
|
||||
mob.persistentDataContainer.set(
|
||||
plugin.namespacedKeyFactory.create("boss"),
|
||||
PersistentDataType.STRING,
|
||||
this.id
|
||||
)
|
||||
|
||||
if (hasCustomAI) {
|
||||
val controller = EntityController.getFor(mob).clearAllGoals()
|
||||
|
||||
@Suppress("UNCHECKED_CAST") // What could go wrong?
|
||||
targetGoals.forEach { controller.addTargetGoal(it.priority, it.goal as TargetGoal<in Mob>) }
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
entityGoals.forEach { controller.addEntityGoal(it.priority, it.goal as EntityGoal<in Mob>) }
|
||||
}
|
||||
|
||||
if (modelEngineID != null && Bukkit.getPluginManager().isPluginEnabled("ModelEngine")) {
|
||||
val model = ModelEngineAPI.createActiveModel(modelEngineID)
|
||||
|
||||
if (model == null) {
|
||||
plugin.logger.warning("Invalid Model Engine ID for boss $id")
|
||||
}
|
||||
|
||||
if (modelEngineAnimation != null) {
|
||||
val animationHandler = model.animationHandler
|
||||
val animationProperty = animationHandler.getAnimation(modelEngineAnimation)
|
||||
|
||||
if (animationProperty != null) {
|
||||
animationHandler.playAnimation(animationProperty, true)
|
||||
} else {
|
||||
plugin.logger.warning("Animation $modelEngineAnimation not found in model $modelEngineID, defaulting to walk!")
|
||||
val animationPropertyWalk = animationHandler.getAnimation("walk")
|
||||
if (animationPropertyWalk != null) {
|
||||
animationHandler.playAnimation(animationPropertyWalk, true)
|
||||
} else {
|
||||
plugin.logger.warning("Walk animation not found in $modelEngineID!")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val modelled = ModelEngineAPI.createModeledEntity(mob)
|
||||
modelled.addModel(model, true)
|
||||
modelled.isBaseEntityVisible = false
|
||||
}
|
||||
|
||||
val boss = LivingEcoBoss(
|
||||
plugin,
|
||||
mob.uniqueId,
|
||||
mob,
|
||||
this,
|
||||
createTickers()
|
||||
)
|
||||
@@ -301,7 +393,8 @@ class EcoBoss(
|
||||
LifespanTicker(),
|
||||
DisplayNameTicker(),
|
||||
TargetTicker(),
|
||||
TeleportHandler()
|
||||
TeleportHandler(),
|
||||
ChunkTicker()
|
||||
)
|
||||
|
||||
if (isBossBarEnabled) {
|
||||
@@ -323,15 +416,16 @@ class EcoBoss(
|
||||
fun handleLifecycle(lifecycle: BossLifecycle, location: Location, entity: LivingEntity?) {
|
||||
sounds[lifecycle]?.play(location)
|
||||
messages[lifecycle]?.forEach { it.broadcast(location, entity?.topDamagers ?: emptyList()) }
|
||||
commands[lifecycle]?.dispatch(location, entity?.topDamagers ?: emptyList())
|
||||
}
|
||||
|
||||
fun processRewards(event: BossKillEvent) {
|
||||
val entity = event.boss.entity ?: return
|
||||
val entity = event.boss.entity
|
||||
val location = entity.location
|
||||
val player = event.killer
|
||||
|
||||
for (drop in drops) {
|
||||
drop.drop(location, player)
|
||||
drop.drop(this, location, player)
|
||||
}
|
||||
|
||||
xp.modify(event.event)
|
||||
@@ -374,7 +468,6 @@ class EcoBoss(
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (other !is EcoBoss) {
|
||||
return false
|
||||
@@ -388,8 +481,10 @@ class EcoBoss(
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return ("EcoBoss{"
|
||||
+ id
|
||||
+ "}")
|
||||
return (
|
||||
"EcoBoss{" +
|
||||
id +
|
||||
"}"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.willfp.ecobosses.bosses
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.core.display.Display
|
||||
import com.willfp.eco.core.display.DisplayModule
|
||||
import com.willfp.eco.core.display.DisplayPriority
|
||||
import com.willfp.eco.core.fast.fast
|
||||
import org.bukkit.entity.Player
|
||||
import org.bukkit.inventory.ItemStack
|
||||
|
||||
class EggDisplay(
|
||||
plugin: EcoPlugin
|
||||
) : DisplayModule(
|
||||
plugin,
|
||||
DisplayPriority.LOW
|
||||
) {
|
||||
override fun display(itemStack: ItemStack, player: Player?, vararg args: Any) {
|
||||
if (player == null) {
|
||||
return
|
||||
}
|
||||
|
||||
val fis = itemStack.fast()
|
||||
|
||||
val lore = fis.lore.toMutableList()
|
||||
|
||||
val egg = itemStack.bossEgg ?: return
|
||||
|
||||
val lines = egg.spawnConditions
|
||||
.filterNot { it.isMet(player) }
|
||||
.mapNotNull { it.notMetLines?.map { line -> Display.PREFIX + line } }
|
||||
.flatten()
|
||||
|
||||
|
||||
if (lines.isNotEmpty()) {
|
||||
lore.add(Display.PREFIX)
|
||||
lore.addAll(lines)
|
||||
}
|
||||
|
||||
fis.lore = lore
|
||||
}
|
||||
}
|
||||
@@ -2,13 +2,12 @@ package com.willfp.ecobosses.bosses
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.ecobosses.tick.BossTicker
|
||||
import org.bukkit.Bukkit
|
||||
import org.bukkit.Chunk
|
||||
import org.bukkit.entity.Mob
|
||||
import java.util.UUID
|
||||
|
||||
class LivingEcoBoss(
|
||||
plugin: EcoPlugin,
|
||||
private val uuid: UUID,
|
||||
val entity: Mob,
|
||||
val boss: EcoBoss,
|
||||
private val tickers: Set<BossTicker>
|
||||
) {
|
||||
@@ -18,15 +17,17 @@ class LivingEcoBoss(
|
||||
}
|
||||
}.apply { runTaskTimer(1, 1) }
|
||||
|
||||
val entity: Mob?
|
||||
get() = Bukkit.getEntity(uuid) as? Mob
|
||||
val chunk: Chunk
|
||||
get() = entity.location.chunk
|
||||
|
||||
val forceLoadedChunks = mutableListOf<Chunk>()
|
||||
|
||||
val deathTime = System.currentTimeMillis() + (boss.lifespan * 1000)
|
||||
|
||||
private var currentTick = 1 // Start at 1 as 0 is divisible by everything
|
||||
|
||||
private fun tick(): Boolean {
|
||||
if (entity == null || entity?.isDead == true) {
|
||||
if (entity.isDead) {
|
||||
remove()
|
||||
return true
|
||||
}
|
||||
@@ -40,13 +41,13 @@ class LivingEcoBoss(
|
||||
|
||||
fun remove() {
|
||||
ticker.cancel()
|
||||
entity?.remove()
|
||||
entity.remove()
|
||||
tickers.forEach { it.onDeath(this, currentTick) }
|
||||
|
||||
boss.markDead(uuid)
|
||||
boss.markDead(entity.uniqueId)
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "LivingEcoBoss{boss=${boss}, uuid=${uuid}}"
|
||||
return "LivingEcoBoss{boss=$boss, uuid=${entity.uniqueId}}"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.willfp.ecobosses.bosses
|
||||
import com.google.common.collect.BiMap
|
||||
import com.google.common.collect.HashBiMap
|
||||
import com.google.common.collect.ImmutableList
|
||||
import org.bukkit.GameMode
|
||||
import org.bukkit.entity.Entity
|
||||
import org.bukkit.entity.LivingEntity
|
||||
import org.bukkit.entity.Player
|
||||
@@ -16,14 +17,16 @@ class TargetMode(
|
||||
}
|
||||
|
||||
fun getTarget(boss: LivingEcoBoss): LivingEntity? {
|
||||
val entity = boss.entity ?: return null
|
||||
val entity = boss.entity
|
||||
|
||||
return function(
|
||||
entity.getNearbyEntities(
|
||||
boss.boss.targetRange,
|
||||
boss.boss.targetRange,
|
||||
boss.boss.targetRange
|
||||
).filterIsInstance<Player>(),
|
||||
).filterIsInstance<Player>()
|
||||
.filter { listOf(GameMode.SURVIVAL, GameMode.ADVENTURE).contains(it.gameMode) }
|
||||
.ifEmpty { return null },
|
||||
entity
|
||||
)
|
||||
}
|
||||
|
||||
@@ -110,7 +110,8 @@ class CommandSpawn(plugin: EcoBossesPlugin) : Subcommand(
|
||||
val event = BossSpawnEvent(
|
||||
boss,
|
||||
location,
|
||||
BossSpawnEvent.SpawnReason.COMMAND
|
||||
BossSpawnEvent.SpawnReason.COMMAND,
|
||||
null
|
||||
)
|
||||
|
||||
Bukkit.getPluginManager().callEvent(event)
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
package com.willfp.ecobosses.config
|
||||
|
||||
import com.willfp.eco.core.config.BaseConfig
|
||||
import com.willfp.eco.core.config.ConfigType
|
||||
import com.willfp.ecobosses.EcoBossesPlugin
|
||||
|
||||
class EcoBossesYml(plugin: EcoBossesPlugin) : BaseConfig(
|
||||
"ecobosses",
|
||||
plugin,
|
||||
true,
|
||||
ConfigType.YAML
|
||||
)
|
||||
@@ -2,6 +2,7 @@ package com.willfp.ecobosses.events
|
||||
|
||||
import com.willfp.ecobosses.bosses.EcoBoss
|
||||
import org.bukkit.Location
|
||||
import org.bukkit.entity.Player
|
||||
import org.bukkit.event.Cancellable
|
||||
import org.bukkit.event.Event
|
||||
import org.bukkit.event.HandlerList
|
||||
@@ -9,7 +10,8 @@ import org.bukkit.event.HandlerList
|
||||
class BossSpawnEvent(
|
||||
val boss: EcoBoss,
|
||||
val location: Location,
|
||||
val reason: SpawnReason
|
||||
val reason: SpawnReason,
|
||||
val spawner: Player?
|
||||
) : Event(), Cancellable {
|
||||
private var isCancelled: Boolean = false
|
||||
|
||||
@@ -29,6 +31,7 @@ class BossSpawnEvent(
|
||||
TOTEM,
|
||||
EGG,
|
||||
COMMAND,
|
||||
AUTOSPAWN,
|
||||
UNKNOWN
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.willfp.ecobosses.events
|
||||
|
||||
import com.willfp.ecobosses.bosses.EcoBoss
|
||||
import org.bukkit.Location
|
||||
import org.bukkit.entity.Player
|
||||
import org.bukkit.event.Event
|
||||
import org.bukkit.event.HandlerList
|
||||
import org.bukkit.inventory.ItemStack
|
||||
|
||||
class BossTryDropItemEvent(
|
||||
val boss: EcoBoss,
|
||||
val location: Location,
|
||||
var items: MutableCollection<ItemStack>,
|
||||
var chance: Double,
|
||||
val player: Player?
|
||||
) : Event() {
|
||||
override fun getHandlers(): HandlerList {
|
||||
return HANDLERS
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val HANDLERS = HandlerList()
|
||||
|
||||
@JvmStatic
|
||||
fun getHandlerList(): HandlerList {
|
||||
return HANDLERS
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,25 @@
|
||||
package com.willfp.ecobosses.lifecycle
|
||||
|
||||
import com.willfp.ecobosses.bosses.Bosses
|
||||
import org.bukkit.entity.LivingEntity
|
||||
import com.willfp.ecobosses.bosses.Bosses.isBoss
|
||||
import org.bukkit.event.EventHandler
|
||||
import org.bukkit.event.Listener
|
||||
import org.bukkit.event.entity.EntityTransformEvent
|
||||
import org.bukkit.event.entity.SlimeSplitEvent
|
||||
|
||||
class CompatibilityListeners : Listener {
|
||||
@EventHandler
|
||||
fun handle(event: SlimeSplitEvent) {
|
||||
if (Bosses[event.entity as? LivingEntity ?: return] != null) {
|
||||
if (!event.entity.isBoss) {
|
||||
return
|
||||
}
|
||||
event.isCancelled = true
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
fun handle(event: EntityTransformEvent) {
|
||||
if (!event.entity.isBoss) {
|
||||
return
|
||||
}
|
||||
event.isCancelled = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.willfp.ecobosses.lifecycle
|
||||
|
||||
import com.willfp.ecobosses.events.BossDespawnEvent
|
||||
import com.willfp.ecobosses.events.BossKillEvent
|
||||
import com.willfp.ecobosses.events.BossSpawnEvent
|
||||
import com.willfp.libreforge.LibReforgePlugin
|
||||
import org.bukkit.event.EventHandler
|
||||
import org.bukkit.event.EventPriority
|
||||
import org.bukkit.event.Listener
|
||||
|
||||
class ConsoleLoggers(
|
||||
private val plugin: LibReforgePlugin
|
||||
) : Listener {
|
||||
@EventHandler(
|
||||
ignoreCancelled = true,
|
||||
priority = EventPriority.MONITOR
|
||||
)
|
||||
fun handle(event: BossSpawnEvent) {
|
||||
if (!plugin.configYml.getBool("log-spawn-kill")) {
|
||||
return
|
||||
}
|
||||
|
||||
val location = "${event.location.world?.name}: ${event.location.x}, ${event.location.y}, ${event.location.z}"
|
||||
|
||||
plugin.logger.info("&a${event.boss.id}&r was spawned by &a${event.spawner?.name}&r at &a$location")
|
||||
}
|
||||
|
||||
@EventHandler(
|
||||
ignoreCancelled = true,
|
||||
priority = EventPriority.MONITOR
|
||||
)
|
||||
fun handle(event: BossKillEvent) {
|
||||
if (!plugin.configYml.getBool("log-spawn-kill")) {
|
||||
return
|
||||
}
|
||||
|
||||
val loc = event.boss.entity.location
|
||||
val location = "${loc.world?.name}: ${loc.x}, ${loc.y}, ${loc.z}"
|
||||
|
||||
plugin.logger.info("&a${event.boss.boss.id}&r was killed by &a${event.killer?.name}&r at &a$location")
|
||||
}
|
||||
|
||||
@EventHandler(
|
||||
ignoreCancelled = true,
|
||||
priority = EventPriority.MONITOR
|
||||
)
|
||||
fun handle(event: BossDespawnEvent) {
|
||||
if (!plugin.configYml.getBool("log-spawn-kill")) {
|
||||
return
|
||||
}
|
||||
val loc = event.boss.entity.location
|
||||
val location = "${loc.world?.name}: ${loc.x}, ${loc.y}, ${loc.z}"
|
||||
|
||||
plugin.logger.info("&a${event.boss.boss.id}&r despawned at &a$location")
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,12 @@
|
||||
package com.willfp.ecobosses.lifecycle
|
||||
|
||||
import com.willfp.eco.core.events.EntityDeathByEntityEvent
|
||||
import com.willfp.eco.util.tryAsPlayer
|
||||
import com.willfp.ecobosses.bosses.Bosses
|
||||
import com.willfp.ecobosses.events.BossKillEvent
|
||||
import com.willfp.libreforge.tryAsPlayer
|
||||
import org.bukkit.Bukkit
|
||||
import org.bukkit.event.EventHandler
|
||||
import org.bukkit.event.EventPriority
|
||||
import org.bukkit.event.Listener
|
||||
import org.bukkit.event.entity.EntityDeathEvent
|
||||
|
||||
@@ -25,7 +26,8 @@ class DeathListeners : Listener {
|
||||
}
|
||||
|
||||
@EventHandler(
|
||||
ignoreCancelled = true
|
||||
ignoreCancelled = true,
|
||||
priority = EventPriority.HIGHEST
|
||||
)
|
||||
fun handle(event: EntityDeathEvent) {
|
||||
val boss = Bosses[event.entity] ?: return
|
||||
|
||||
@@ -28,7 +28,7 @@ class LifecycleHandlers : Listener {
|
||||
priority = EventPriority.MONITOR
|
||||
)
|
||||
fun handle(event: BossKillEvent) {
|
||||
val entity = event.boss.entity ?: return
|
||||
val entity = event.boss.entity
|
||||
|
||||
event.boss.boss.handleLifecycle(BossLifecycle.KILL, entity.location, entity)
|
||||
}
|
||||
@@ -38,7 +38,7 @@ class LifecycleHandlers : Listener {
|
||||
priority = EventPriority.MONITOR
|
||||
)
|
||||
fun handle(event: BossDespawnEvent) {
|
||||
val entity = event.boss.entity ?: return
|
||||
val entity = event.boss.entity
|
||||
|
||||
event.boss.boss.handleLifecycle(BossLifecycle.DESPAWN, entity.location, entity)
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.willfp.ecobosses.spawn
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.ecobosses.bosses.Bosses
|
||||
import com.willfp.ecobosses.events.BossSpawnEvent
|
||||
import org.bukkit.Bukkit
|
||||
|
||||
object AutospawnHandler {
|
||||
private var tick = 1
|
||||
@@ -20,12 +22,20 @@ object AutospawnHandler {
|
||||
val location = boss.autoSpawnLocations.randomOrNull() ?: continue
|
||||
val world = location.world ?: continue
|
||||
|
||||
if (plugin.configYml.getBool("autospawn.one-boss-per-world")) {
|
||||
if (Bosses.getAllAlive().mapNotNull { it.entity }.any { it.world == world }) {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
val spawnEvent = BossSpawnEvent(boss, location, BossSpawnEvent.SpawnReason.AUTOSPAWN, null)
|
||||
|
||||
Bukkit.getPluginManager().callEvent(spawnEvent)
|
||||
|
||||
if (!spawnEvent.isCancelled) {
|
||||
boss.spawn(location)
|
||||
}
|
||||
}
|
||||
|
||||
tick++
|
||||
}
|
||||
|
||||
@@ -1,16 +1,26 @@
|
||||
package com.willfp.ecobosses.spawn
|
||||
|
||||
import com.willfp.ecobosses.EcoBossesPlugin
|
||||
import com.willfp.ecobosses.bosses.bossEgg
|
||||
import com.willfp.ecobosses.events.BossSpawnEvent
|
||||
import com.willfp.libreforge.conditions.isMet
|
||||
import org.bukkit.Bukkit
|
||||
import org.bukkit.Location
|
||||
import org.bukkit.block.Container
|
||||
import org.bukkit.block.data.Directional
|
||||
import org.bukkit.entity.Player
|
||||
import org.bukkit.event.Event
|
||||
import org.bukkit.event.EventHandler
|
||||
import org.bukkit.event.Listener
|
||||
import org.bukkit.event.block.Action
|
||||
import org.bukkit.event.block.BlockDispenseEvent
|
||||
import org.bukkit.event.player.PlayerInteractEvent
|
||||
import org.bukkit.inventory.EquipmentSlot
|
||||
import org.bukkit.inventory.ItemStack
|
||||
|
||||
class SpawnEggHandler : Listener {
|
||||
class SpawnEggHandler(
|
||||
private val plugin: EcoBossesPlugin
|
||||
) : Listener {
|
||||
@EventHandler(
|
||||
ignoreCancelled = true
|
||||
)
|
||||
@@ -19,28 +29,13 @@ class SpawnEggHandler : Listener {
|
||||
return
|
||||
}
|
||||
|
||||
val item = event.item ?: return
|
||||
val boss = item.bossEgg ?: return
|
||||
if (!this.handleSpawnEgg(event.item, event.clickedBlock?.location?.add(0.0, 1.5, 0.0), event.player)) {
|
||||
return
|
||||
}
|
||||
|
||||
event.isCancelled = true
|
||||
event.setUseItemInHand(Event.Result.DENY)
|
||||
|
||||
val location = event.clickedBlock?.location?.add(0.0, 1.5, 0.0) ?: return
|
||||
|
||||
val player = event.player
|
||||
|
||||
if (!boss.spawnConditions.all { it.condition.isConditionMet(player, it.config) }) {
|
||||
return
|
||||
}
|
||||
|
||||
val spawnEvent = BossSpawnEvent(boss, location, BossSpawnEvent.SpawnReason.EGG)
|
||||
|
||||
Bukkit.getPluginManager().callEvent(spawnEvent)
|
||||
|
||||
if (spawnEvent.isCancelled) {
|
||||
return
|
||||
}
|
||||
|
||||
if (event.hand == EquipmentSlot.HAND) {
|
||||
val hand = event.player.inventory.itemInMainHand
|
||||
hand.amount = hand.amount - 1
|
||||
@@ -48,7 +43,56 @@ class SpawnEggHandler : Listener {
|
||||
val hand = event.player.inventory.itemInOffHand
|
||||
hand.amount = hand.amount - 1
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(
|
||||
ignoreCancelled = true
|
||||
)
|
||||
fun handle(event: BlockDispenseEvent) {
|
||||
val facing = (event.block.blockData as Directional).facing
|
||||
val location = event.block.location.add(facing.direction.multiply(1.7))
|
||||
|
||||
if (!this.handleSpawnEgg(event.item, location, null)) return
|
||||
|
||||
event.isCancelled = true
|
||||
|
||||
val dispenser = event.block.state as? Container ?: return
|
||||
|
||||
// This is needed as the event must finish first,
|
||||
// Otherwise the dispenser/dropper thinks the item is already removed from this event.
|
||||
plugin.scheduler.run {
|
||||
val item = dispenser.inventory.find { it?.isSimilar(event.item) == true } ?: return@run
|
||||
item.amount--
|
||||
dispenser.update()
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleSpawnEgg(
|
||||
item: ItemStack?,
|
||||
location: Location?,
|
||||
player: Player?
|
||||
): Boolean {
|
||||
val boss = item?.bossEgg ?: return false
|
||||
|
||||
if (location == null) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (player != null) {
|
||||
if (!boss.spawnConditions.isMet(player)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
val spawnEvent = BossSpawnEvent(boss, location, BossSpawnEvent.SpawnReason.EGG, player)
|
||||
Bukkit.getPluginManager().callEvent(spawnEvent)
|
||||
|
||||
if (spawnEvent.isCancelled) {
|
||||
return false
|
||||
}
|
||||
|
||||
boss.spawn(location)
|
||||
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.willfp.eco.util.containsIgnoreCase
|
||||
import com.willfp.ecobosses.bosses.Bosses
|
||||
import com.willfp.ecobosses.events.BossSpawnEvent
|
||||
import com.willfp.ecobosses.util.SpawnTotem
|
||||
import org.bukkit.Bukkit
|
||||
import org.bukkit.Material
|
||||
import org.bukkit.block.Block
|
||||
import org.bukkit.event.EventHandler
|
||||
@@ -16,36 +17,36 @@ class SpawnTotemHandler : Listener {
|
||||
)
|
||||
fun handle(event: BlockPlaceEvent) {
|
||||
for (i in 0..2) {
|
||||
lateinit var block1: Block
|
||||
lateinit var block2: Block
|
||||
lateinit var block3: Block
|
||||
lateinit var top: Block
|
||||
lateinit var middle: Block
|
||||
lateinit var bottom: Block
|
||||
|
||||
// I know this code sucks ass, but I can't be arsed to write it nicely
|
||||
when (i) {
|
||||
0 -> {
|
||||
block3 = event.block
|
||||
block2 = event.block.getRelative(0, -1, 0)
|
||||
block1 = event.block.getRelative(0, -2, 0)
|
||||
top = event.block
|
||||
middle = event.block.getRelative(0, -1, 0)
|
||||
bottom = event.block.getRelative(0, -2, 0)
|
||||
}
|
||||
1 -> {
|
||||
block1 = event.block
|
||||
block2 = event.block.getRelative(0, 1, 0)
|
||||
block3 = event.block.getRelative(0, 2, 0)
|
||||
top = event.block.getRelative(0, 2, 0)
|
||||
middle = event.block.getRelative(0, 1, 0)
|
||||
bottom = event.block
|
||||
}
|
||||
2 -> {
|
||||
block2 = event.block
|
||||
block1 = event.block.getRelative(0, -1, 0)
|
||||
block3 = event.block.getRelative(0, 1, 0)
|
||||
top = event.block.getRelative(0, 1, 0)
|
||||
middle = event.block
|
||||
bottom = event.block.getRelative(0, -1, 0)
|
||||
}
|
||||
}
|
||||
|
||||
val placedTotem = SpawnTotem(block1.type, block2.type, block3.type)
|
||||
val placedTotem = SpawnTotem(top.type, middle.type, bottom.type)
|
||||
for (boss in Bosses.values()) {
|
||||
if (boss.totem == null || boss.disabledTotemWorlds.containsIgnoreCase(event.block.world.name)) {
|
||||
continue
|
||||
}
|
||||
|
||||
if (boss.totem != placedTotem) {
|
||||
if (!boss.totem.matches(placedTotem)) {
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -55,12 +56,14 @@ class SpawnTotemHandler : Listener {
|
||||
return
|
||||
}
|
||||
|
||||
val spawnEvent = BossSpawnEvent(boss, event.block.location, BossSpawnEvent.SpawnReason.TOTEM)
|
||||
val spawnEvent = BossSpawnEvent(boss, event.block.location, BossSpawnEvent.SpawnReason.TOTEM, player)
|
||||
|
||||
Bukkit.getPluginManager().callEvent(spawnEvent)
|
||||
|
||||
if (!spawnEvent.isCancelled) {
|
||||
block1.type = Material.AIR
|
||||
block2.type = Material.AIR
|
||||
block3.type = Material.AIR
|
||||
top.type = Material.AIR
|
||||
middle.type = Material.AIR
|
||||
bottom.type = Material.AIR
|
||||
|
||||
boss.spawn(event.block.location.add(0.0, 1.5, 0.0))
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ class BossBarTicker(
|
||||
private val bar: BossBar
|
||||
) : BossTicker {
|
||||
override fun tick(boss: LivingEcoBoss, tick: Int) {
|
||||
val entity = boss.entity ?: return
|
||||
val entity = boss.entity
|
||||
|
||||
bar.name(entity.customName!!.toComponent())
|
||||
bar.progress((entity.health / entity.getAttribute(Attribute.GENERIC_MAX_HEALTH)!!.value).toFloat())
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.willfp.ecobosses.tick
|
||||
|
||||
import com.willfp.ecobosses.bosses.LivingEcoBoss
|
||||
|
||||
class ChunkTicker : BossTicker {
|
||||
override fun tick(boss: LivingEcoBoss, tick: Int) {
|
||||
val currentChunk = boss.chunk
|
||||
|
||||
if (tick % 10 != 0) {
|
||||
return
|
||||
}
|
||||
|
||||
if (currentChunk.isLoaded && currentChunk.isForceLoaded) {
|
||||
return;
|
||||
}
|
||||
|
||||
currentChunk.load()
|
||||
currentChunk.isForceLoaded = true
|
||||
boss.forceLoadedChunks.add(currentChunk)
|
||||
}
|
||||
|
||||
override fun onDeath(boss: LivingEcoBoss, tick: Int) {
|
||||
boss.forceLoadedChunks.forEach { it.isForceLoaded = false }
|
||||
boss.forceLoadedChunks.clear()
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import kotlin.math.ceil
|
||||
|
||||
class DisplayNameTicker : BossTicker {
|
||||
override fun tick(boss: LivingEcoBoss, tick: Int) {
|
||||
val entity = boss.entity ?: return
|
||||
val entity = boss.entity
|
||||
|
||||
val timeLeft = ceil(
|
||||
(boss.deathTime - System.currentTimeMillis()) / 1000.0
|
||||
|
||||
@@ -16,7 +16,7 @@ class LifespanTicker : BossTicker {
|
||||
boss.remove()
|
||||
boss.boss.handleLifecycle(
|
||||
BossLifecycle.DESPAWN,
|
||||
boss.entity?.location ?: return,
|
||||
boss.entity.location,
|
||||
boss.entity
|
||||
)
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import com.willfp.ecobosses.bosses.LivingEcoBoss
|
||||
|
||||
class TargetTicker : BossTicker {
|
||||
override fun tick(boss: LivingEcoBoss, tick: Int) {
|
||||
val entity = boss.entity ?: return
|
||||
val entity = boss.entity
|
||||
|
||||
if (tick % 10 != 0) {
|
||||
return
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.bukkit.block.BlockFace
|
||||
|
||||
class TeleportHandler : BossTicker {
|
||||
override fun tick(boss: LivingEcoBoss, tick: Int) {
|
||||
val entity = boss.entity ?: return
|
||||
val entity = boss.entity
|
||||
if (!boss.boss.canTeleport) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package com.willfp.ecobosses.util
|
||||
|
||||
import com.willfp.eco.util.tryAsPlayer
|
||||
import com.willfp.ecobosses.EcoBossesPlugin
|
||||
import com.willfp.libreforge.tryAsPlayer
|
||||
import org.bukkit.entity.LivingEntity
|
||||
import org.bukkit.event.EventHandler
|
||||
import org.bukkit.event.EventPriority
|
||||
import org.bukkit.event.Listener
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent
|
||||
import java.util.UUID
|
||||
import java.util.*
|
||||
|
||||
data class Damager(
|
||||
val uuid: UUID,
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.willfp.ecobosses.util
|
||||
|
||||
import com.willfp.eco.core.config.interfaces.Config
|
||||
import com.willfp.eco.util.NumberUtils
|
||||
import com.willfp.eco.util.savedDisplayName
|
||||
import com.willfp.ecobosses.EcoBossesPlugin
|
||||
import org.bukkit.Bukkit
|
||||
import org.bukkit.Location
|
||||
|
||||
data class LocalCommands(
|
||||
val commands: Iterable<String>,
|
||||
) {
|
||||
fun dispatch(location: Location, topDamagers: List<Damager>) {
|
||||
val toDispatch = commands.toMutableList()
|
||||
toDispatch.replaceAll {
|
||||
var command = it
|
||||
|
||||
for (i in 1..20) {
|
||||
val damager = topDamagers.getOrNull(i - 1)
|
||||
val damage = if (damager?.damage != null) NumberUtils.format(damager.damage) else
|
||||
EcoBossesPlugin.instance.langYml.getFormattedString("na")
|
||||
val player = if (damager?.uuid != null) Bukkit.getOfflinePlayer(damager.uuid).savedDisplayName else
|
||||
EcoBossesPlugin.instance.langYml.getFormattedString("na")
|
||||
|
||||
command = command.replace("%damage_${i}%", damage)
|
||||
.replace("%damage_${i}_player%", player)
|
||||
}
|
||||
|
||||
command.replace("%x%", location.blockX.toString())
|
||||
.replace("%y%", location.blockY.toString())
|
||||
.replace("%z%", location.blockZ.toString())
|
||||
}
|
||||
|
||||
for (s in toDispatch) {
|
||||
Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), s);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,8 @@ package com.willfp.ecobosses.util
|
||||
|
||||
import com.willfp.eco.core.drops.DropQueue
|
||||
import com.willfp.eco.util.NumberUtils
|
||||
import com.willfp.ecobosses.bosses.EcoBoss
|
||||
import com.willfp.ecobosses.events.BossTryDropItemEvent
|
||||
import org.bukkit.Bukkit
|
||||
import org.bukkit.Location
|
||||
import org.bukkit.entity.Player
|
||||
@@ -12,15 +14,19 @@ data class BossDrop(
|
||||
val chance: Double,
|
||||
val drops: Collection<ItemStack>
|
||||
) {
|
||||
fun drop(location: Location, player: Player?) {
|
||||
if (NumberUtils.randFloat(0.0, 100.0) < chance) {
|
||||
fun drop(boss: EcoBoss, location: Location, player: Player?) {
|
||||
val event = BossTryDropItemEvent(boss, location, drops.toMutableList(), chance, player)
|
||||
|
||||
Bukkit.getPluginManager().callEvent(event)
|
||||
|
||||
if (NumberUtils.randFloat(0.0, 100.0) < event.chance) {
|
||||
if (player != null) {
|
||||
DropQueue(player)
|
||||
.setLocation(location)
|
||||
.addItems(drops)
|
||||
.setLocation(event.location)
|
||||
.addItems(event.items)
|
||||
.push()
|
||||
} else {
|
||||
for (drop in drops) {
|
||||
for (drop in event.items) {
|
||||
location.world?.dropItemNaturally(location, drop)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,4 +6,10 @@ data class SpawnTotem(
|
||||
val top: Material,
|
||||
val middle: Material,
|
||||
val bottom: Material
|
||||
)
|
||||
) {
|
||||
fun matches(totem: SpawnTotem): Boolean {
|
||||
return this.top == totem.top
|
||||
&& this.middle == totem.middle
|
||||
&& this.bottom == totem.bottom
|
||||
}
|
||||
}
|
||||
|
||||
209
eco-core/core-plugin/src/main/resources/bosses/_example.yml
Normal file
209
eco-core/core-plugin/src/main/resources/bosses/_example.yml
Normal file
@@ -0,0 +1,209 @@
|
||||
# The ID of the boss is the name of the .yml file,
|
||||
# for example steel_golem.yml has the ID of steel_golem
|
||||
# You can place bosses anywhere in this folder,
|
||||
# including in subfolders if you want to organize your boss configs
|
||||
# _example.yml is not loaded.
|
||||
|
||||
# A base mob and modifiers
|
||||
# View an explanation for this system here: https://plugins.auxilor.io/all-plugins/the-entity-lookup-system
|
||||
mob: iron_golem attack-damage:90 movement-speed:1.5 follow-range:16 health:1200
|
||||
|
||||
# If you're using model engine, you can specify the ID and animation here. You can also specify these in the mob with the lookup system.
|
||||
model-engine-id: ""
|
||||
model-engine-animation: ""
|
||||
|
||||
# Supported placeholders: %health%, %time% (formats as minutes:seconds, eg 1:56)
|
||||
display-name: "&8Steel Golem &7| &c%health%♥ &7| &e%time%"
|
||||
|
||||
influence: 40 # The distance at which effects will be applied to players
|
||||
|
||||
custom-ai: # Custom mob AI using the entity goal system.
|
||||
enabled: false # If custom AI should be enabled, this will override the vanilla mob behaviour.
|
||||
target-goals: [ ] # How the boss decides who to attack, if the target mode isn't being used.
|
||||
ai-goals: [ ] # How the boss should behave.
|
||||
|
||||
effects: # Effects are done from the player's perspective: to treat the player as the victim, use the self_as_victim option in args
|
||||
- id: run_chain
|
||||
args:
|
||||
chain: blind
|
||||
self_as_victim: true
|
||||
chance: 20
|
||||
triggers:
|
||||
- static_20
|
||||
|
||||
conditions: [ ] # Conditions to apply effects to players; useful if you don't want to affect low-level players
|
||||
|
||||
lifespan: 120 # The lifespan of the boss before it despawns, in seconds. Set to a massive number to disable.
|
||||
|
||||
defence:
|
||||
prevent-mounts: true # If the boss shouldn't be able to get into boats, minecarts, etc
|
||||
explosion-immune: true # If the boss should be immune to explosions
|
||||
fire-immune: true # If the boss should be immune to fire damage
|
||||
drowning-immune: true # If the boss should be immune to drowning damage
|
||||
suffocation-immune: true # If the boss should be immune to suffocation
|
||||
|
||||
melee-damage-multiplier: 0.8 # Incoming melee damage will be multiplied by this value. Set to 0 to render immune against melee
|
||||
projectile-damage-multiplier: 0.2 # Same as melee multiplier, but for projectiles
|
||||
|
||||
teleportation: # Teleport every x ticks in order to avoid being caged in obsidian or similar
|
||||
enabled: true # If the boss should teleport
|
||||
interval: 100 # Ticks between teleportation attempts
|
||||
range: 20 # The range that the boss should check for safe teleportation blocks.
|
||||
|
||||
rewards:
|
||||
xp: # Experience will be randomly generated between these values
|
||||
minimum: 30000
|
||||
maximum: 60000
|
||||
|
||||
top-damager-commands:
|
||||
# You can specify as many ranks as you want (adding 4, 5, etc)
|
||||
# You can use %player% as a placeholder for the player name
|
||||
1:
|
||||
- chance: 100 # As a percentage
|
||||
commands:
|
||||
- eco give %player% 10000
|
||||
2: [ ]
|
||||
3: [ ]
|
||||
|
||||
nearby-player-commands:
|
||||
# Commands to be executed for all players near the boss death location
|
||||
radius: 10
|
||||
# Uses the same syntax as top damager commands (chance and a list of commands, can use %player%)
|
||||
commands: [ ]
|
||||
|
||||
# You can specify as many drops as you want, and group several drops together under one chance
|
||||
drops:
|
||||
- chance: 100
|
||||
items:
|
||||
- diamond_sword unbreaking:1 name:"Example Sword"
|
||||
|
||||
target:
|
||||
# How the boss should choose which player to attack, choices are:
|
||||
# highest_health, lowest_health, closest, random
|
||||
mode: highest_health
|
||||
# The distance to scan for players
|
||||
range: 40
|
||||
|
||||
boss-bar:
|
||||
# If the boss should have a boss bar
|
||||
enabled: true
|
||||
color: white # Options: blue, green, pink, purple, red, white, yellow
|
||||
style: progress # Options: progress, notched_20, notched_12, notched_10, notched_6
|
||||
radius: 120 # The distance from the boss where the boss bar is visible
|
||||
|
||||
spawn:
|
||||
# A list of conditions required for a player to be able to spawn a boss, useful to set
|
||||
# minimum skill levels, etc
|
||||
conditions: [ ]
|
||||
autospawn:
|
||||
# Spawn the boss automatically every x ticks. Picks a random location, but will only
|
||||
# ever spawn in a world if there are no other bosses of that type in the world.
|
||||
interval: -1 # The interval in ticks, set to -1 to disable
|
||||
locations: # Add as many locations as you want
|
||||
- world: world
|
||||
x: 100
|
||||
y: 100
|
||||
z: 100
|
||||
totem:
|
||||
enabled: false # A spawn totem is a set of 3 blocks on top of each other to spawn a boss (like a snow golem)
|
||||
top: netherite_block
|
||||
middle: iron_block
|
||||
bottom: magma_block
|
||||
not-in-worlds: [ ] # If spawn totems should be disallowed in certain worlds, specify them here
|
||||
egg:
|
||||
enabled: true # If the boss should have a spawn egg
|
||||
item: evoker_spawn_egg unbreaking:1 hide_enchants
|
||||
name: "&8Steel Golem&f Spawn Egg"
|
||||
lore:
|
||||
- ""
|
||||
- "&8&oPlace on the ground to"
|
||||
- "&8&osummon a &8Steel Golem"
|
||||
craftable: true
|
||||
recipe:
|
||||
- iron_block
|
||||
- netherite_block
|
||||
- iron_block
|
||||
- air
|
||||
- ecoitems:boss_core ? nether_star
|
||||
- air
|
||||
- iron_block
|
||||
- netherite_block
|
||||
- iron_block
|
||||
|
||||
commands:
|
||||
# For each category, you can add as many commands as you want, which will be executed by
|
||||
# console. Supported placeholders are the same as for messages (see below)
|
||||
spawn: [ ]
|
||||
kill: [ ]
|
||||
despawn: [ ]
|
||||
injure: [ ]
|
||||
|
||||
messages:
|
||||
# For each category, you can add as many messages as you want, each with their own radius.
|
||||
# Radius is the distance from the boss where the player will be sent the message
|
||||
# Set to -1 to broadcast globally to all players online
|
||||
|
||||
# Supported placeholders: %x%, %y%, %z% (coordinates)
|
||||
spawn:
|
||||
- message:
|
||||
- ""
|
||||
- "&fA &8&lSteel Golem&r&f has been spawned!"
|
||||
- "&fCome fight it at &8%x%&f, &8%y%&f, &8%z%&f!"
|
||||
- ""
|
||||
radius: -1
|
||||
|
||||
# Supported placeholders: %damage_<x>_player%, %damage_<X>%
|
||||
# You can include as many ranks as you want - if there is no player at a certain rank,
|
||||
# it will be replaced with N/A (change in lang.yml)
|
||||
kill:
|
||||
- message:
|
||||
- ""
|
||||
- "&fThe &8&lSteel Golem&r&f has been killed!"
|
||||
- "&fMost Damage:"
|
||||
- "&f - &8%damage_1_player%&f (%damage_1% Damage)"
|
||||
- "&f - &8%damage_2_player%&f (%damage_2% Damage)"
|
||||
- "&f - &8%damage_3_player%&f (%damage_3% Damage)"
|
||||
- ""
|
||||
radius: -1
|
||||
despawn:
|
||||
- message:
|
||||
- ""
|
||||
- "&fYou ran out of time to kill the &8&lSteel Golem&r&f!"
|
||||
- ""
|
||||
radius: -1
|
||||
injure: [ ]
|
||||
|
||||
# All sounds will be played together at the same time
|
||||
# A list of sounds can be found here: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html
|
||||
# Volume functions as the distance at which the sound will be heard
|
||||
# Pitch is any value between 0.5 and 2
|
||||
# If you don't want the vanilla mob sounds, add 'silent' as an option to the mob
|
||||
sounds:
|
||||
spawn:
|
||||
- sound: entity_iron_golem_death
|
||||
pitch: 0.8
|
||||
volume: 100
|
||||
- sound: entity_iron_golem_hurt
|
||||
pitch: 0.5
|
||||
volume: 100
|
||||
- sound: entity_ender_dragon_growl
|
||||
pitch: 0.5
|
||||
volume: 100
|
||||
kill:
|
||||
- sound: entity_ender_dragon_death
|
||||
pitch: 1.8
|
||||
volume: 100
|
||||
- sound: entity_wither_death
|
||||
pitch: 1.2
|
||||
volume: 100
|
||||
despawn:
|
||||
- sound: entity_ender_dragon_ambient
|
||||
pitch: 0.5
|
||||
volume: 50
|
||||
- sound: entity_enderman_death
|
||||
pitch: 0.5
|
||||
volume: 50
|
||||
injure:
|
||||
- sound: entity_iron_golem_damage
|
||||
pitch: 0.7
|
||||
volume: 10
|
||||
21
eco-core/core-plugin/src/main/resources/chains.yml
Normal file
21
eco-core/core-plugin/src/main/resources/chains.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
# Read more about chains: https://plugins.auxilor.io/effects/configuring-an-effect#effect-chains
|
||||
|
||||
chains:
|
||||
- id: example_chain
|
||||
effects:
|
||||
- id: teleport
|
||||
- id: potion_effect
|
||||
args:
|
||||
effect: blindness
|
||||
level: 3
|
||||
duration: 30
|
||||
apply_to_player: true
|
||||
- id: send_message
|
||||
args:
|
||||
message: "&fYou have been teleported!"
|
||||
action_bar: true
|
||||
- id: play_sound
|
||||
args:
|
||||
sound: entity_dragon_fireball_explode
|
||||
pitch: 1.5
|
||||
volume: 4
|
||||
@@ -4,6 +4,10 @@
|
||||
#
|
||||
|
||||
discover-recipes: true
|
||||
log-spawn-kill: true
|
||||
|
||||
autospawn:
|
||||
one-boss-per-world: true # If only one boss can auto-spawn per world at once.
|
||||
|
||||
cooldown:
|
||||
in-actionbar: true
|
||||
@@ -31,4 +35,16 @@ point-names: # If you have point names that look ugly (eg g_souls) then you can
|
||||
|
||||
use-faster-move-trigger: true # Disable if you want move trigger to detect sub-1-block movements
|
||||
raytrace-distance: 80 # The distance that alt_click should check for a location
|
||||
block-item-drop-place-check: true # If the block_item_drop trigger should only fire on naturally placed blocks (prevents dupes)
|
||||
|
||||
potions:
|
||||
icon:
|
||||
permanent: true
|
||||
triggered: true
|
||||
ambient:
|
||||
permanent: false
|
||||
triggered: true
|
||||
particles:
|
||||
permanent: false
|
||||
triggered: true
|
||||
|
||||
share-configs: true # If your configs are allowed to be used to gather data and improve the plugin. Nothing identifying (IP, Name, etc) is shared.
|
||||
3
eco-core/core-plugin/src/main/resources/eco.yml
Normal file
3
eco-core/core-plugin/src/main/resources/eco.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
resource-id: 525
|
||||
bstats-id: 10635
|
||||
color: "&9"
|
||||
@@ -1,193 +0,0 @@
|
||||
chains:
|
||||
- id: blind
|
||||
effects:
|
||||
- id: teleport
|
||||
- id: potion_effect
|
||||
args:
|
||||
effect: blindness
|
||||
level: 3
|
||||
duration: 30
|
||||
apply_to_player: true
|
||||
- id: send_message
|
||||
args:
|
||||
message: "&cYou have been blinded!"
|
||||
action_bar: true
|
||||
- id: play_sound
|
||||
args:
|
||||
sound: entity_dragon_fireball_explode
|
||||
pitch: 1.5
|
||||
volume: 4
|
||||
|
||||
bosses:
|
||||
- id: steel_golem
|
||||
# A base mob and modifiers
|
||||
# View an explanation for this system here: https://plugins.auxilor.io/all-plugins/the-entity-lookup-system
|
||||
mob: iron_golem attack-damage:90 movement-speed:1.5 follow-range:16 health:1200
|
||||
# Supported placeholders: %health%, %time% (formats as minutes:seconds, eg 1:56)
|
||||
displayName: "&8Steel Golem &7| &c%health%♥ &7| &e%time%"
|
||||
influence: 40 # The distance at which effects will be applied to players
|
||||
effects: # Effects are done from the player's perspective: to treat the player as the victim, use the self_as_victim option in args
|
||||
- id: run_chain
|
||||
args:
|
||||
chain: blind
|
||||
self_as_victim: true
|
||||
chance: 20
|
||||
triggers:
|
||||
- static_20
|
||||
conditions: [ ] # Conditions to apply effects to players; useful if you don't want to affect low-level players
|
||||
lifespan: 120 # The lifespan of the boss before it despawns, in seconds. Set to a massive number to disable.
|
||||
defence:
|
||||
preventMounts: true # If the boss shouldn't be able to get into boats, minecarts, etc
|
||||
explosionImmune: true # If the boss should be immune to explosions
|
||||
fireImmune: true # If the boss should be immune to fire damage
|
||||
drowningImmune: true # If the boss should be immune to drowning damage
|
||||
suffocationImmune: true # If the boss should be immune to suffocation
|
||||
|
||||
meleeDamageMultiplier: 0.8 # Incoming melee damage will be multiplied by this value. Set to 0 to render immune against melee
|
||||
projectileDamageMultiplier: 0.2 # Same as melee multiplier, but for projectiles
|
||||
|
||||
teleportation: # Teleport every x ticks in order to avoid being caged in obsidian or similar
|
||||
enabled: true # If the boss should teleport
|
||||
interval: 100 # Ticks between teleportation attempts
|
||||
range: 20 # The range that the boss should check for safe teleportation blocks.
|
||||
rewards:
|
||||
xp: # Experience will be randomly generated between these values
|
||||
minimum: 30000
|
||||
maximum: 60000
|
||||
topDamagerCommands:
|
||||
# You can specify as many ranks as you want (adding 4, 5, etc)
|
||||
# You can use %player% as a placeholder for the player name
|
||||
1:
|
||||
- chance: 100 # As a percentage
|
||||
commands:
|
||||
- eco give %player% 10000
|
||||
2: [ ]
|
||||
3: [ ]
|
||||
nearbyPlayerCommands:
|
||||
# Commands to be executed for all players near the boss death location
|
||||
radius: 10
|
||||
# Uses the same syntax as top damager commands (chance and a list of commands, can use %player%)
|
||||
commands: [ ]
|
||||
# You can specify as many drops as you want, and group several drops together under one chance
|
||||
drops:
|
||||
- chance: 100
|
||||
items:
|
||||
- diamond_sword unbreaking:1 name:"Example Sword"
|
||||
target:
|
||||
# How the boss should choose which player to attack, choices are:
|
||||
# highest_health, lowest_health, closest, random
|
||||
mode: highest_health
|
||||
# The distance to scan for players
|
||||
range: 40
|
||||
bossBar:
|
||||
# If the boss should have a boss bar
|
||||
enabled: true
|
||||
color: white # Options: blue, green, pink, purple, red, white, yellow
|
||||
style: progress # Options: progress, notched_20, notched_12, notched_10, notched_6
|
||||
radius: 120 # The distance from the boss where the boss bar is visible
|
||||
spawn:
|
||||
# A list of conditions required for a player to be able to spawn a boss, useful to set
|
||||
# minimum skill levels, etc
|
||||
conditions: [ ]
|
||||
autospawn:
|
||||
# Spawn the boss automatically every x ticks. Picks a random location, but will only
|
||||
# ever spawn in a world if there are no other bosses of that type in the world.
|
||||
interval: -1 # The interval in ticks, set to -1 to disable
|
||||
locations: # Add as many locations as you want
|
||||
- world: world
|
||||
x: 100
|
||||
y: 100
|
||||
z: 100
|
||||
totem:
|
||||
enabled: false # A spawn totem is a set of 3 blocks on top of each other to spawn a boss (like a snow golem)
|
||||
top: netherite_block
|
||||
middle: iron_block
|
||||
bottom: magma_block
|
||||
notInWorlds: [ ] # If spawn totems should be disallowed in certain worlds, specify them here
|
||||
egg:
|
||||
enabled: true # If the boss should have a spawn egg
|
||||
item: evoker_spawn_egg unbreaking:1 hide_enchants name:"&8Steel Golem&f Spawn Egg"
|
||||
lore:
|
||||
- ""
|
||||
- "&8&oPlace on the ground to"
|
||||
- "&8&osummon a &8Steel Golem"
|
||||
craftable: true
|
||||
recipe:
|
||||
- iron_block
|
||||
- netherite_block
|
||||
- iron_block
|
||||
- air
|
||||
- ecoitems:boss_core ? nether_star
|
||||
- air
|
||||
- iron_block
|
||||
- netherite_block
|
||||
- iron_block
|
||||
messages:
|
||||
# For each category, you can add as many messages as you want, each with their own radius.
|
||||
# Radius is the distance from the boss where the player will be sent the message
|
||||
# Set to -1 to broadcast globally to all players online
|
||||
|
||||
# Supported placeholders: %x%, %y%, %z% (coordinates)
|
||||
spawn:
|
||||
- message:
|
||||
- ""
|
||||
- "&fA &8&lSteel Golem&r&f has been spawned!"
|
||||
- "&fCome fight it at &8%x%&f, &8%y%&f, &8%z%&f!"
|
||||
- ""
|
||||
radius: -1
|
||||
|
||||
# Supported placeholders: %damage_<x>_player%, %damage_<X>%
|
||||
# You can include as many ranks as you want - if there is no player at a certain rank,
|
||||
# it will be replaced with N/A (change in lang.yml)
|
||||
kill:
|
||||
- message:
|
||||
- ""
|
||||
- "&fThe &8&lSteel Golem&r&f has been killed!"
|
||||
- "&fMost Damage:"
|
||||
- "&f - &8%damage_1_player%&f (%damage_1% Damage)"
|
||||
- "&f - &8%damage_2_player%&f (%damage_2% Damage)"
|
||||
- "&f - &8%damage_3_player%&f (%damage_3% Damage)"
|
||||
- ""
|
||||
radius: -1
|
||||
despawn:
|
||||
- message:
|
||||
- ""
|
||||
- "&fYou ran out of time to kill the &8&lSteel Golem&r&f!"
|
||||
- ""
|
||||
radius: -1
|
||||
injure: [ ]
|
||||
|
||||
# All sounds will be played together at the same time
|
||||
# A list of sounds can be found here: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html
|
||||
# Volume functions as the distance at which the sound will be heard
|
||||
# Pitch is any value between 0.5 and 2
|
||||
# If you don't want the vanilla mob sounds, add 'silent' as an option to the mob
|
||||
sounds:
|
||||
spawn:
|
||||
- sound: entity_iron_golem_death
|
||||
pitch: 0.8
|
||||
volume: 100
|
||||
- sound: entity_iron_golem_hurt
|
||||
pitch: 0.5
|
||||
volume: 100
|
||||
- sound: entity_ender_dragon_growl
|
||||
pitch: 0.5
|
||||
volume: 100
|
||||
kill:
|
||||
- sound: entity_ender_dragon_death
|
||||
pitch: 1.8
|
||||
volume: 100
|
||||
- sound: entity_wither_death
|
||||
pitch: 1.2
|
||||
volume: 100
|
||||
despawn:
|
||||
- sound: entity_ender_dragon_ambient
|
||||
pitch: 0.5
|
||||
volume: 50
|
||||
- sound: entity_enderman_death
|
||||
pitch: 0.5
|
||||
volume: 50
|
||||
injure:
|
||||
- sound: entity_iron_golem_damage
|
||||
pitch: 0.7
|
||||
volume: 10
|
||||
@@ -18,5 +18,6 @@ messages:
|
||||
on-cooldown: "&cThis effect is on cooldown! &fTime left: &a%seconds% seconds"
|
||||
cannot-afford: "&cYou can't afford to do this! &fCost: &a$$%cost%"
|
||||
cannot-afford-type: "&cYou can't afford to do this! &fCost: &a%cost% %type%"
|
||||
cannot-transmit: "&cYou can't transmit here!"
|
||||
|
||||
na: "N/A"
|
||||
@@ -1,7 +1,7 @@
|
||||
name: EcoBosses
|
||||
version: ${projectVersion}
|
||||
main: com.willfp.ecobosses.EcoBossesPlugin
|
||||
api-version: 1.16
|
||||
api-version: 1.17
|
||||
authors: [Auxilor]
|
||||
website: willfp.com
|
||||
load: STARTUP
|
||||
@@ -9,11 +9,19 @@ depend:
|
||||
- eco
|
||||
softdepend:
|
||||
- LevelledMobs
|
||||
- EcoSkills
|
||||
- AureliumSkills
|
||||
- Jobs
|
||||
- mcMMO
|
||||
- Vault
|
||||
- TMMobcoins
|
||||
- EcoEnchants
|
||||
- Talismans
|
||||
- EcoArmor
|
||||
- EcoItems
|
||||
- EcoSkills
|
||||
- Boosters
|
||||
- ModelEngine
|
||||
- EcoJobs
|
||||
|
||||
commands:
|
||||
ecobosses:
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
version = 8.0.0
|
||||
plugin-name = EcoBosses
|
||||
#libreforge-updater
|
||||
#Mon Oct 03 18:30:03 BST 2022
|
||||
version=8.94.0
|
||||
plugin-name=EcoBosses
|
||||
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
269
gradlew
vendored
269
gradlew
vendored
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env sh
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -17,67 +17,101 @@
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
APP_BASE_NAME=${0##*/}
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
@@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
@@ -98,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
JAVACMD=java
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
@@ -106,80 +140,95 @@ location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
case $i in
|
||||
0) set -- ;;
|
||||
1) set -- "$args0" ;;
|
||||
2) set -- "$args0" "$args1" ;;
|
||||
3) set -- "$args0" "$args1" "$args2" ;;
|
||||
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=`save "$@"`
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
|
||||
Reference in New Issue
Block a user