mirror of
https://github.com/Auxilor/EcoMobs.git
synced 2025-12-19 15:09:17 +00:00
Compare commits
89 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
df70871bad | ||
|
|
b030af609a | ||
|
|
344e71cd9a | ||
|
|
7b7a16f9c6 | ||
|
|
ba1c348f8e | ||
|
|
c81f7174e2 | ||
|
|
53b037816d | ||
|
|
d7e07c1a62 | ||
|
|
d939296d96 | ||
|
|
2505ddd845 | ||
|
|
ea7371db9e | ||
|
|
b53ab306ed | ||
|
|
33f82117e4 | ||
|
|
a80e060a7e | ||
|
|
a915752922 | ||
|
|
06eb724bd8 | ||
|
|
18c66ef10c | ||
|
|
ae0c8531b0 | ||
|
|
705eafb9af | ||
|
|
e83ede56f0 | ||
|
|
6bddf72111 | ||
|
|
d32d07f4e2 | ||
|
|
8c40d9861d | ||
|
|
03272f794e | ||
|
|
8ff42da43c | ||
|
|
7f61f6a66a | ||
|
|
c1dde026b7 | ||
|
|
983246a7c4 | ||
|
|
ee32897b1c | ||
|
|
67b38896ca | ||
|
|
39b91bc828 | ||
|
|
e2e7b44a75 | ||
|
|
3c1e5ee192 | ||
|
|
56789f331b | ||
|
|
e99b96132f | ||
|
|
c0297cd3db | ||
|
|
3b798a8ed7 | ||
|
|
bc73201ec5 | ||
|
|
b1365855af | ||
|
|
1ce50cb0b9 | ||
|
|
2a50868624 | ||
|
|
0a0e7a9661 | ||
|
|
8cd4ccdbd7 | ||
|
|
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 |
136
build.gradle
136
build.gradle
@@ -1,136 +0,0 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10"
|
||||
}
|
||||
}
|
||||
|
||||
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')
|
||||
relocate('org.joml', 'com.willfp.ecobosses.libreforge.joml')
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly 'com.willfp:eco:6.35.1'
|
||||
implementation 'com.willfp:libreforge:3.92.0'
|
||||
implementation 'org.joml:joml:1.10.4'
|
||||
|
||||
compileOnly 'org.jetbrains:annotations:23.0.0'
|
||||
|
||||
compileOnly 'org.jetbrains.kotlin:kotlin-stdlib:1.7.10'
|
||||
}
|
||||
|
||||
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"
|
||||
freeCompilerArgs += ["-Xjvm-default=all"]
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
task buyThePlugins {
|
||||
dependsOn subprojects.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.finalizedBy buyThePlugins
|
||||
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.44.0")
|
||||
compileOnly("org.jetbrains:annotations:23.0.0")
|
||||
compileOnly("org.jetbrains.kotlin:kotlin-stdlib:1.7.10")
|
||||
|
||||
implementation("com.willfp:libreforge:3.129.3")
|
||||
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")
|
||||
}
|
||||
@@ -61,7 +61,7 @@ class EcoBossesPlugin : LibReforgePlugin() {
|
||||
DiscoverRecipeListener(this),
|
||||
TopDamagerListener(),
|
||||
LifecycleHandlers(),
|
||||
SpawnEggHandler(),
|
||||
SpawnEggHandler(this),
|
||||
DamageMultiplierHandler(),
|
||||
MountHandler(),
|
||||
PickupHandler(),
|
||||
@@ -79,10 +79,6 @@ class EcoBossesPlugin : LibReforgePlugin() {
|
||||
)
|
||||
}
|
||||
|
||||
override fun getMinimumEcoVersion(): String {
|
||||
return "6.35.1"
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
lateinit var instance: EcoBossesPlugin
|
||||
|
||||
@@ -4,17 +4,17 @@ 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.readConfig
|
||||
import com.willfp.eco.core.config.updating.ConfigUpdater
|
||||
import com.willfp.ecobosses.EcoBossesPlugin
|
||||
import com.willfp.libreforge.separatorAmbivalent
|
||||
import org.bukkit.entity.Entity
|
||||
import org.bukkit.entity.LivingEntity
|
||||
import java.io.File
|
||||
import java.util.*
|
||||
import java.util.UUID
|
||||
|
||||
object Bosses {
|
||||
/**
|
||||
* Registered bosses.
|
||||
*/
|
||||
/** Registered bosses. */
|
||||
private val BY_ID: BiMap<String, EcoBoss> = HashBiMap.create()
|
||||
|
||||
/**
|
||||
@@ -54,10 +54,11 @@ object Bosses {
|
||||
addNewBoss(EcoBoss(id, config, plugin))
|
||||
}
|
||||
|
||||
val ecoBossesYml = TransientConfig(File(plugin.dataFolder, "ecobosses.yml"), ConfigType.YAML)
|
||||
val ecoBossesYml = File(plugin.dataFolder, "ecobosses.yml").readConfig(ConfigType.YAML)
|
||||
|
||||
for (bossConfig in ecoBossesYml.getSubsections("bosses")) {
|
||||
addNewBoss(EcoBoss(bossConfig.getString("id"), bossConfig, plugin))
|
||||
// Boss configs are separator ambivalent in order to preserve backwards compatibility
|
||||
addNewBoss(EcoBoss(bossConfig.getString("id"), bossConfig.separatorAmbivalent(), plugin))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
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
|
||||
@@ -48,14 +49,15 @@ import org.bukkit.entity.Mob
|
||||
import org.bukkit.entity.Player
|
||||
import org.bukkit.inventory.ItemStack
|
||||
import org.bukkit.persistence.PersistentDataType
|
||||
import java.util.*
|
||||
import java.util.Objects
|
||||
import java.util.UUID
|
||||
|
||||
class EcoBoss(
|
||||
override val id: String,
|
||||
val config: Config,
|
||||
private val plugin: EcoPlugin
|
||||
) : Holder {
|
||||
val displayName: String = config.getString("displayName")
|
||||
val displayName: String = config.getString("display-name")
|
||||
|
||||
val lifespan = config.getInt("lifespan")
|
||||
|
||||
@@ -65,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")
|
||||
|
||||
@@ -156,7 +158,7 @@ class EcoBoss(
|
||||
)
|
||||
}
|
||||
|
||||
val disabledTotemWorlds: List<String> = config.getStrings("spawn.totem.notInWorlds")
|
||||
val disabledTotemWorlds: List<String> = config.getStrings("spawn.totem.not-in-worlds")
|
||||
|
||||
val autoSpawnInterval = config.getInt("spawn.autospawn.interval")
|
||||
|
||||
@@ -168,26 +170,22 @@ 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("customai.enabled")
|
||||
val hasCustomAI = config.getBool("custom-ai.enabled")
|
||||
|
||||
val targetGoals = config.getSubsections("customai.target-goals").mapNotNull {
|
||||
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("customai.ai-goals").mapNotNull {
|
||||
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
|
||||
@@ -198,17 +196,19 @@ class EcoBoss(
|
||||
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 {
|
||||
ConfiguredSound.fromConfig(it)
|
||||
})
|
||||
map[value] = PlayableSound(
|
||||
config.getSubsections("sounds.${value.name.lowercase()}").map {
|
||||
ConfiguredSound.fromConfig(it)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
map
|
||||
@@ -239,10 +239,10 @@ class EcoBoss(
|
||||
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"),
|
||||
@@ -257,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"),
|
||||
@@ -279,7 +279,6 @@ class EcoBoss(
|
||||
config.getInt("rewards.xp.maximum")
|
||||
)
|
||||
|
||||
|
||||
private val drops: Iterable<BossDrop> = run {
|
||||
val list = mutableListOf<BossDrop>()
|
||||
|
||||
@@ -300,15 +299,21 @@ 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 {
|
||||
Conditions.compile(it, "Boss ID $id")
|
||||
}.toSet()
|
||||
override val conditions = Conditions.compile(
|
||||
config.getSubsections("conditions"),
|
||||
"Boss ID $id"
|
||||
)
|
||||
|
||||
override val effects = config.getSubsections("effects").mapNotNull {
|
||||
Effects.compile(it, "Boss ID $id")
|
||||
}.toSet()
|
||||
override val effects = Effects.compile(
|
||||
config.getSubsections("effects"),
|
||||
"Boss ID $id"
|
||||
)
|
||||
|
||||
fun markDead(uuid: UUID) {
|
||||
currentlyAlive.remove(uuid)
|
||||
@@ -338,8 +343,7 @@ class EcoBoss(
|
||||
)
|
||||
|
||||
if (hasCustomAI) {
|
||||
val controller = EntityController.getFor(mob)
|
||||
.clearAllGoals()
|
||||
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>) }
|
||||
@@ -347,6 +351,35 @@ class EcoBoss(
|
||||
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,
|
||||
@@ -437,7 +470,6 @@ class EcoBoss(
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (other !is EcoBoss) {
|
||||
return false
|
||||
@@ -451,8 +483,10 @@ class EcoBoss(
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return ("EcoBoss{"
|
||||
+ id
|
||||
+ "}")
|
||||
return (
|
||||
"EcoBoss{" +
|
||||
id +
|
||||
"}"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,6 +48,6 @@ class LivingEcoBoss(
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "LivingEcoBoss{boss=${boss}, uuid=${entity.uniqueId}}"
|
||||
return "LivingEcoBoss{boss=$boss, uuid=${entity.uniqueId}}"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,10 @@ package com.willfp.ecobosses.commands
|
||||
|
||||
import com.willfp.eco.core.command.impl.PluginCommand
|
||||
import com.willfp.ecobosses.EcoBossesPlugin
|
||||
import com.willfp.ecobosses.bosses.Bosses
|
||||
import com.willfp.libreforge.lrcdb.CommandExport
|
||||
import com.willfp.libreforge.lrcdb.CommandImport
|
||||
import com.willfp.libreforge.lrcdb.ExportableConfig
|
||||
import org.bukkit.command.CommandSender
|
||||
|
||||
class CommandEcobosses(plugin: EcoBossesPlugin) : PluginCommand(
|
||||
@@ -22,5 +26,14 @@ class CommandEcobosses(plugin: EcoBossesPlugin) : PluginCommand(
|
||||
.addSubcommand(CommandKillall(plugin))
|
||||
.addSubcommand(CommandSpawn(plugin))
|
||||
.addSubcommand(CommandGive(plugin))
|
||||
.addSubcommand(CommandImport("bosses", plugin))
|
||||
.addSubcommand(CommandExport(plugin) {
|
||||
Bosses.values().map {
|
||||
ExportableConfig(
|
||||
it.id,
|
||||
it.config
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package com.willfp.ecobosses.events
|
||||
|
||||
import com.willfp.ecobosses.bosses.LivingEcoBoss
|
||||
import com.willfp.ecobosses.lifecycle.BossLifecycle
|
||||
import org.bukkit.event.Event
|
||||
import org.bukkit.event.HandlerList
|
||||
import org.bukkit.event.entity.EntityDeathEvent
|
||||
|
||||
abstract class BossDeathEvent(
|
||||
val boss: LivingEcoBoss
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.willfp.ecobosses.events
|
||||
|
||||
import com.willfp.ecobosses.bosses.LivingEcoBoss
|
||||
import com.willfp.ecobosses.lifecycle.BossLifecycle
|
||||
import org.bukkit.event.HandlerList
|
||||
|
||||
class BossDespawnEvent(
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.willfp.ecobosses.events
|
||||
|
||||
import com.willfp.ecobosses.bosses.LivingEcoBoss
|
||||
import com.willfp.ecobosses.lifecycle.BossLifecycle
|
||||
import org.bukkit.entity.Player
|
||||
import org.bukkit.event.HandlerList
|
||||
import org.bukkit.event.entity.EntityDeathEvent
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.willfp.ecobosses.events
|
||||
|
||||
import com.willfp.ecobosses.bosses.EcoBoss
|
||||
import com.willfp.ecobosses.bosses.LivingEcoBoss
|
||||
import org.bukkit.Location
|
||||
import org.bukkit.entity.Player
|
||||
import org.bukkit.event.Event
|
||||
@@ -14,7 +13,7 @@ class BossTryDropItemEvent(
|
||||
var items: MutableCollection<ItemStack>,
|
||||
var chance: Double,
|
||||
val player: Player?
|
||||
): Event() {
|
||||
) : Event() {
|
||||
override fun getHandlers(): 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) {
|
||||
event.isCancelled = true
|
||||
if (!event.entity.isBoss) {
|
||||
return
|
||||
}
|
||||
event.isCancelled = true
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
fun handle(event: EntityTransformEvent) {
|
||||
if (!event.entity.isBoss) {
|
||||
return
|
||||
}
|
||||
event.isCancelled = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.willfp.ecobosses.lifecycle
|
||||
|
||||
import com.willfp.ecobosses.bosses.Bosses
|
||||
import com.willfp.ecobosses.events.BossDeathEvent
|
||||
import com.willfp.ecobosses.events.BossDespawnEvent
|
||||
import com.willfp.ecobosses.events.BossKillEvent
|
||||
import com.willfp.ecobosses.events.BossSpawnEvent
|
||||
|
||||
@@ -23,7 +23,7 @@ object AutospawnHandler {
|
||||
val world = location.world ?: continue
|
||||
|
||||
if (plugin.configYml.getBool("autospawn.one-boss-per-world")) {
|
||||
if (Bosses.getAllAlive().mapNotNull { it.entity }.any { it.world == world }) {
|
||||
if (Bosses.getAllAlive().map { it.entity }.any { it.world == world }) {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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, player)
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ class ChunkTicker : BossTicker {
|
||||
}
|
||||
|
||||
if (currentChunk.isLoaded && currentChunk.isForceLoaded) {
|
||||
return;
|
||||
return
|
||||
}
|
||||
|
||||
currentChunk.load()
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
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
|
||||
@@ -32,7 +31,7 @@ data class LocalCommands(
|
||||
}
|
||||
|
||||
for (s in toDispatch) {
|
||||
Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), s);
|
||||
Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), s)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,13 +7,21 @@
|
||||
# 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)
|
||||
displayName: "&8Steel Golem &7| &c%health%♥ &7| &e%time%"
|
||||
display-name: "&8Steel Golem &7| &c%health%♥ &7| &e%time%"
|
||||
|
||||
influence: 40 # The distance at which effects will be applied to players
|
||||
customai: # Custom mob AI using the entity goal system.
|
||||
|
||||
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:
|
||||
@@ -22,27 +30,32 @@ effects: # Effects are done from the player's perspective: to treat the player a
|
||||
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
|
||||
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
|
||||
topDamagerCommands:
|
||||
|
||||
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:
|
||||
@@ -51,28 +64,33 @@ rewards:
|
||||
- eco give %player% 10000
|
||||
2: [ ]
|
||||
3: [ ]
|
||||
nearbyPlayerCommands:
|
||||
|
||||
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
|
||||
bossBar:
|
||||
|
||||
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
|
||||
@@ -91,7 +109,7 @@ spawn:
|
||||
top: netherite_block
|
||||
middle: iron_block
|
||||
bottom: magma_block
|
||||
notInWorlds: [ ] # If spawn totems should be disallowed in certain worlds, specify them here
|
||||
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
|
||||
@@ -111,6 +129,7 @@ spawn:
|
||||
- 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)
|
||||
@@ -118,6 +137,7 @@ commands:
|
||||
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
|
||||
|
||||
210
eco-core/core-plugin/src/main/resources/bosses/illusioner.yml
Normal file
210
eco-core/core-plugin/src/main/resources/bosses/illusioner.yml
Normal file
@@ -0,0 +1,210 @@
|
||||
mob: illusioner attack-damage:50 health:600 hand:"iron_sword sharpness:5"
|
||||
|
||||
model-engine-id: ""
|
||||
model-engine-animation: ""
|
||||
|
||||
display-name: "&9Illusioner &7| &c%health%♥ &7| &e%time%"
|
||||
|
||||
influence: 40
|
||||
|
||||
custom-ai:
|
||||
enabled: true
|
||||
|
||||
target-goals:
|
||||
- key: minecraft:hurt_by
|
||||
priority: 0
|
||||
args:
|
||||
blacklist: [ ]
|
||||
- key: minecraft:nearest_attackable
|
||||
priority: 1
|
||||
args:
|
||||
target:
|
||||
- player
|
||||
checkVisibility: false
|
||||
checkCanNavigate: true
|
||||
reciprocalChance: 300
|
||||
- key: minecraft:nearest_attackable
|
||||
priority: 2
|
||||
args:
|
||||
target:
|
||||
- iron_golem
|
||||
- villager
|
||||
checkVisibility: false
|
||||
checkCanNavigate: true
|
||||
reciprocalChance: 300
|
||||
|
||||
ai-goals:
|
||||
- key: minecraft:float
|
||||
priority: 0
|
||||
- key: minecraft:illusioner_mirror_spell
|
||||
priority: 1
|
||||
- key: minecraft:melee_attack
|
||||
priority: 2
|
||||
args:
|
||||
speed: 1.6
|
||||
pauseWhenMobIdle: false
|
||||
- key: minecraft:random_stroll
|
||||
priority: 8
|
||||
args:
|
||||
speed: 0.6
|
||||
interval: 80
|
||||
canDespawn: false
|
||||
- key: minecraft:look_at_player
|
||||
priority: 9
|
||||
args:
|
||||
range: 6
|
||||
chance: 1
|
||||
|
||||
effects:
|
||||
- id: run_chain
|
||||
args:
|
||||
chain: blind
|
||||
self_as_victim: true
|
||||
chance: 20
|
||||
triggers:
|
||||
- static_20
|
||||
|
||||
conditions: [ ]
|
||||
|
||||
lifespan: 120
|
||||
|
||||
defence:
|
||||
prevent-mounts: true
|
||||
explosion-immune: true
|
||||
fire-immune: true
|
||||
drowning-immune: true
|
||||
suffocation-immune: true
|
||||
|
||||
melee-damage-multiplier: 1
|
||||
projectile-damage-multiplier: 0.8
|
||||
|
||||
teleportation:
|
||||
enabled: true
|
||||
interval: 200
|
||||
range: 20
|
||||
|
||||
rewards:
|
||||
xp:
|
||||
minimum: 20000
|
||||
maximum: 40000
|
||||
|
||||
top-damager-commands:
|
||||
1:
|
||||
- chance: 100 # As a percentage
|
||||
commands:
|
||||
- eco give %player% 10000
|
||||
2: [ ]
|
||||
3: [ ]
|
||||
|
||||
nearby-player-commands:
|
||||
radius: 10
|
||||
commands: [ ]
|
||||
|
||||
drops: []
|
||||
|
||||
target:
|
||||
mode: closest
|
||||
range: 40
|
||||
|
||||
boss-bar:
|
||||
enabled: true
|
||||
color: blue
|
||||
style: notched_20
|
||||
radius: 120
|
||||
|
||||
spawn:
|
||||
conditions: [ ]
|
||||
autospawn:
|
||||
interval: -1
|
||||
locations: []
|
||||
totem:
|
||||
enabled: false
|
||||
top: carved_pumpkin
|
||||
middle: beacon
|
||||
bottom: diamond_block
|
||||
not-in-worlds: [ ]
|
||||
egg:
|
||||
enabled: true
|
||||
item: dolphin_spawn_egg unbreaking:1 hide_enchants
|
||||
name: "&9Illusioner&f Spawn Egg"
|
||||
lore:
|
||||
- ""
|
||||
- "&8&oPlace on the ground to"
|
||||
- "&8&osummon an &9Illusioner"
|
||||
craftable: true
|
||||
recipe:
|
||||
- ""
|
||||
- fermented_spider_eye 64
|
||||
- ""
|
||||
- fermented_spider_eye 64
|
||||
- ecoitems:boss_core ? nether_star
|
||||
- fermented_spider_eye 64
|
||||
- ""
|
||||
- fermented_spider_eye 64
|
||||
- ""
|
||||
|
||||
commands:
|
||||
spawn: [ ]
|
||||
kill: [ ]
|
||||
despawn: [ ]
|
||||
injure: [ ]
|
||||
|
||||
messages:
|
||||
spawn:
|
||||
- message:
|
||||
- ""
|
||||
- "&fAn &9&lIllusioner&r&f has been spawned!"
|
||||
- "&fCome fight it at &9%x%&f, &9%y%&f, &9%z%&f!"
|
||||
- ""
|
||||
radius: -1
|
||||
|
||||
kill:
|
||||
- message:
|
||||
- ""
|
||||
- "&fThe &9&lIllusioner&r&f has been killed!"
|
||||
- "&fMost Damage:"
|
||||
- "&f - &9%damage_1_player%&f (%damage_1% Damage)"
|
||||
- "&f - &9%damage_2_player%&f (%damage_2% Damage)"
|
||||
- "&f - &9%damage_3_player%&f (%damage_3% Damage)"
|
||||
- ""
|
||||
radius: -1
|
||||
despawn:
|
||||
- message:
|
||||
- ""
|
||||
- "&fYou ran out of time to kill the &9&lIllusioner&r&f!"
|
||||
- ""
|
||||
radius: -1
|
||||
injure: [ ]
|
||||
|
||||
sounds:
|
||||
spawn:
|
||||
- sound: entity_illusioner_mirror_move
|
||||
pitch: 0.5
|
||||
volume: 100
|
||||
- sound: entity_wither_spawn
|
||||
pitch: 2
|
||||
volume: 100
|
||||
|
||||
kill:
|
||||
- sound: entity_evoker_prepare_wololo
|
||||
pitch: 0.8
|
||||
volume: 100
|
||||
- sound: entity_illusioner_prepare_blindness
|
||||
pitch: 1
|
||||
volume: 100
|
||||
- sound: entity_wither_death
|
||||
pitch: 2
|
||||
volume: 100
|
||||
|
||||
despawn:
|
||||
- sound: entity_ender_dragon_ambient
|
||||
pitch: 0.6
|
||||
volume: 50
|
||||
- sound: entity_enderman_death
|
||||
pitch: 0.8
|
||||
volume: 50
|
||||
|
||||
injure:
|
||||
- sound: entity_illusioner_cast_spell
|
||||
pitch: 2
|
||||
volume: 10
|
||||
16
eco-core/core-plugin/src/main/resources/chains.yml
Normal file
16
eco-core/core-plugin/src/main/resources/chains.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
# Read more about chains: https://plugins.auxilor.io/effects/configuring-an-effect#effect-chains
|
||||
|
||||
chains:
|
||||
- id: blind
|
||||
effects:
|
||||
- id: potion_effect
|
||||
args:
|
||||
effect: blindness
|
||||
level: 3
|
||||
duration: 30
|
||||
apply_to_player: true
|
||||
- id: play_sound
|
||||
args:
|
||||
sound: entity_dragon_fireball_explode
|
||||
pitch: 1.5
|
||||
volume: 4
|
||||
@@ -30,12 +30,18 @@ cannot-afford-type:
|
||||
sound: "BLOCK_NOTE_BLOCK_PLING"
|
||||
pitch: 0.5
|
||||
|
||||
point-names: # If you have point names that look ugly (eg g_souls) then you can map them to nice names to be shown to players.
|
||||
cannot-afford-price:
|
||||
in-actionbar: true
|
||||
sound:
|
||||
enabled: true
|
||||
sound: "BLOCK_NOTE_BLOCK_PLING"
|
||||
pitch: 0.5
|
||||
|
||||
point-names: # If you have point names that look ugly (e.g. souls) then you can map them to nice names to be shown to players.
|
||||
example_point: "Nicely Formatted Point"
|
||||
|
||||
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:
|
||||
|
||||
@@ -1,9 +1,22 @@
|
||||
messages:
|
||||
prefix: "&9&lEcoBosses &f» "
|
||||
no-permission: "&cYou don't have permission to do this!"
|
||||
invalid-command: "&cUnknown subcommand!"
|
||||
not-player: "&cThis command must be run by a player"
|
||||
invalid-command: "&cUnknown subcommand!"
|
||||
reloaded: "Reloaded!"
|
||||
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-afford-price: "&cYou can't afford to do this! &fPrice: %price%"
|
||||
on-cooldown: "&cThis effect is on cooldown! &fTime left: &a%seconds% seconds"
|
||||
cannot-transmit: "&cYou can't transmit here!"
|
||||
must-specify-lrcdb-id: "&cYou must specify the ID of the config to download! Not sure what this means? Go to &alrcdb.auxilor.io"
|
||||
lrcdb-import-error: "&cError importing config: &f%message%"
|
||||
lrcdb-import-success: "&fImported &a%name%&f! Reload the plugin to install it"
|
||||
must-specify-config-name: "&cYou must specify the config name!"
|
||||
invalid-config-name: "&cInvalid config name!"
|
||||
lrcdb-export-error: "&cError exporting config: &f%message%"
|
||||
lrcdb-export-success: "&fExported &a%name%&f! View it on &alrcdb.auxilor.io&f, or share your config ID: &f%id%"
|
||||
|
||||
sent-drop: "Check console for the drop!"
|
||||
specify-boss: "&cYou must specify a valid boss!"
|
||||
invalid-location: "&cInvalid location!"
|
||||
@@ -15,9 +28,5 @@ messages:
|
||||
invalid-stone: "&cInvalid boss!"
|
||||
give-success: "Gave &a%boss%&r spawn egg to &a%recipient%"
|
||||
requirements-not-met: "&cYou can't spawn this boss!"
|
||||
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"
|
||||
19
eco-core/core-plugin/src/main/resources/lrcdb.yml
Normal file
19
eco-core/core-plugin/src/main/resources/lrcdb.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
# Options for lrcdb (https://lrcdb.auxilor.io), a website to share configs
|
||||
# with other server owners, so you can get more configs without making them
|
||||
# yourself!
|
||||
|
||||
author: "Unknown Author" # The name attached to configs you export
|
||||
|
||||
# Options about automatically sharing configs you create
|
||||
share-configs:
|
||||
# If you want all your configs to automatically be publicly available,
|
||||
# set this to true. This really helps out other users!
|
||||
publicly: false
|
||||
|
||||
# If you don't want your configs to be usable to gather information about
|
||||
# plugin usage or to improve the plugins in the future, disable this.
|
||||
# Nothing identifying is shared.
|
||||
enabled: true
|
||||
|
||||
# If you disable share-configs, you can still share select configs publicly
|
||||
# with /ecobosses export <config>.
|
||||
@@ -20,6 +20,8 @@ softdepend:
|
||||
- EcoItems
|
||||
- EcoSkills
|
||||
- Boosters
|
||||
- ModelEngine
|
||||
- EcoJobs
|
||||
|
||||
commands:
|
||||
ecobosses:
|
||||
@@ -40,6 +42,8 @@ permissions:
|
||||
ecobosses.command.reload: true
|
||||
ecobosses.command.spawn: true
|
||||
ecobosses.command.give: true
|
||||
ecobosses.command.import: true
|
||||
ecobosses.command.export: true
|
||||
|
||||
ecobosses.command.ecobosses:
|
||||
description: Allows the use of /ecobosses
|
||||
@@ -59,4 +63,12 @@ permissions:
|
||||
|
||||
ecobosses.command.reload:
|
||||
description: Allows the use of /ecobosses reload
|
||||
default: op
|
||||
|
||||
ecobosses.command.import:
|
||||
description: Allows the use of /ecobosses import
|
||||
default: op
|
||||
|
||||
ecobosses.command.export:
|
||||
description: Allows the use of /ecobosses export
|
||||
default: op
|
||||
@@ -1,4 +1,4 @@
|
||||
#libreforge-updater
|
||||
#Thu Sep 01 13:05:26 BST 2022
|
||||
version=8.77.0
|
||||
#Wed Feb 22 15:02:39 GMT 2023
|
||||
version=8.115.3
|
||||
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