9
0
mirror of https://github.com/Auxilor/EcoMobs.git synced 2025-12-19 15:09:17 +00:00

Compare commits

...

177 Commits

Author SHA1 Message Date
Auxilor
a94a5cc04d libreforge-updater 2022-09-05 18:00:28 +01:00
Auxilor
2b8d8eb20a libreforge-updater 2022-09-04 17:22:44 +01:00
Auxilor
1b4851fb9c libreforge-updater 2022-09-04 16:22:01 +01:00
Auxilor
80181bb66e libreforge-updater 2022-09-03 14:20:18 +01:00
Auxilor
d2d6355003 libreforge-updater 2022-09-01 13:05:26 +01:00
Auxilor
b44016d4fe libreforge-updater 2022-08-31 12:45:30 +01:00
Auxilor
74f1953074 libreforge-updater 2022-08-30 20:29:05 +01:00
Auxilor
041e8e070e libreforge-updater 2022-08-30 19:21:42 +01:00
Auxilor
d69b205de5 libreforge-updater 2022-08-29 10:58:32 +01:00
Auxilor
ad827f2b65 libreforge-updater 2022-08-28 15:40:32 +01:00
Auxilor
e8b8dcd2c4 libreforge-updater 2022-08-27 11:22:55 +01:00
Auxilor
e54660cf5e libreforge-updater 2022-08-24 12:52:49 +02:00
Auxilor
7a21d1897d libreforge-updater 2022-08-24 12:50:14 +02:00
Auxilor
64726f665f libreforge-updater 2022-08-24 11:57:32 +02:00
Auxilor
e4fdaeec1d libreforge-updater 2022-08-23 11:07:42 +02:00
Auxilor
3c5fbd6151 libreforge-updater 2022-08-22 12:46:27 +02:00
Auxilor
4329431994 libreforge-updater 2022-08-20 10:00:02 +02:00
Auxilor
c55692e89f libreforge-updater 2022-08-17 14:21:54 +02:00
Auxilor
03466f7892 libreforge-updater 2022-08-17 12:09:45 +02:00
Auxilor
1a6ebd4455 libreforge-updater 2022-08-16 18:45:53 +02:00
Auxilor
486f071dea libreforge-updater 2022-08-14 17:30:33 +02:00
Auxilor
fb4eac5e5e Updated to 8.67.1 2022-08-13 12:12:27 +02:00
Will FP
49d1d3f054 Merge pull request #47 from grzybeek/chunkticker
small chunkticker code cleanup
2022-08-13 12:00:09 +02:00
Auxilor
6dc7426146 libreforge-updater 2022-08-13 11:58:15 +02:00
Auxilor
00c5ead347 libreforge-updater 2022-08-05 18:41:40 +01:00
Auxilor
9bd501dfbe libreforge-updater 2022-08-05 18:39:49 +01:00
Auxilor
67d55bbdc2 libreforge-updater 2022-08-04 13:03:36 +01:00
Auxilor
46aa086366 lang 2022-08-04 12:38:01 +01:00
Auxilor
9f00334ea4 lang 2022-08-04 12:31:24 +01:00
Auxilor
e6db159bfb libreforge-updater 2022-08-04 12:26:42 +01:00
Auxilor
3df7b75737 libreforge-updater 2022-08-04 12:24:14 +01:00
Auxilor
c243a425b3 libreforge-updater 2022-08-02 16:26:52 +01:00
Auxilor
e57fe61d22 libreforge-updater 2022-08-02 16:21:24 +01:00
Auxilor
9830aed484 libreforge-updater 2022-08-02 16:16:46 +01:00
Auxilor
999b89bcb0 libreforge-updater 2022-08-01 11:19:06 +01:00
Auxilor
e7f326efbb libreforge-updater 2022-07-29 17:50:41 +01:00
Auxilor
0cb5b0b7b7 libreforge-updater 2022-07-27 20:17:09 +01:00
Auxilor
8e2d901e9b Updated to 8.63.2 2022-07-26 14:41:50 +01:00
Auxilor
724eede36e Fixed boss death tracking 2022-07-26 14:41:22 +01:00
Auxilor
01a2cc7118 libreforge-updater 2022-07-25 17:53:55 +01:00
Auxilor
20aace3727 libreforge-updater 2022-07-25 17:02:32 +01:00
Auxilor
ec9d4c0dd6 libreforge-updater 2022-07-24 22:49:25 +01:00
Auxilor
b3a0c1fa67 libreforge-updater 2022-07-24 21:50:54 +01:00
Auxilor
88294a17cd libreforge-updater 2022-07-23 17:42:53 +01:00
Auxilor
1ac6a350ec libreforge-updater 2022-07-22 14:20:45 +01:00
Auxilor
a9333cb8b5 libreforge-updater 2022-07-21 20:14:10 +01:00
grzybeek
05cf399e77 remove useless mob getter 2022-07-21 17:07:37 +02:00
grzybeek
de2b8f7526 small chunkticker code cleanup 2022-07-21 17:02:42 +02:00
Auxilor
23085e74e2 Codestyle 2022-07-21 15:48:46 +01:00
Auxilor
80f02a07a4 Updated to 8.60.1 2022-07-21 15:48:22 +01:00
Will FP
a63625593d Merge pull request #45 from grzybeek/chunkticker
Fix spawning bosses on unloaded chunks
2022-07-21 15:26:05 +01:00
Auxilor
1dfd7bac1f libreforge-updater 2022-07-20 00:10:12 +01:00
Auxilor
34b983b185 libreforge-updater 2022-07-13 21:22:38 +01:00
Auxilor
33b2fd9e13 libreforge-updater 2022-07-12 14:58:43 +01:00
Auxilor
85cfb542dc libreforge-updater 2022-07-11 16:16:12 +01:00
Auxilor
197f9e91aa libreforge-updater 2022-07-09 12:10:35 +01:00
grzybeek
9d4a91805a Fix spawning bosses on unloaded chunks, keep them loaded and remove afterwards
Entity is no longer null, change not needed "?: return"
2022-07-06 02:06:46 +02:00
Auxilor
87b91c46d1 libreforge-updater 2022-07-05 18:32:14 +01:00
Auxilor
4a7e6e9ff1 libreforge-updater 2022-07-04 18:45:14 +01:00
Auxilor
b59e54be01 libreforge-updater 2022-06-30 22:54:36 +01:00
Auxilor
d26f0294cc libreforge-updater 2022-06-30 22:34:13 +01:00
Auxilor
150433d46b libreforge-updater 2022-06-26 13:03:03 +01:00
Auxilor
7de4d75c93 libreforge-updater 2022-06-25 22:22:48 +01:00
Auxilor
9790459a26 libreforge-updater 2022-06-24 13:57:52 +01:00
Auxilor
666a80b401 libreforge-updater 2022-06-22 22:24:46 +01:00
Auxilor
59810059aa libreforge-updater 2022-06-22 12:42:49 +01:00
Auxilor
7b604c7812 libreforge-updater 2022-06-21 08:29:23 +01:00
Auxilor
81eab18e42 libreforge-updater 2022-06-20 21:37:23 +01:00
Auxilor
fa54c7022b libreforge-updater 2022-06-20 14:16:54 +01:00
Auxilor
26f976a7ca libreforge-updater 2022-06-19 12:17:53 +01:00
Auxilor
4fa070dabe libreforge-updater 2022-06-18 12:19:23 +01:00
Auxilor
f73327b204 libreforge-updater 2022-06-17 21:34:43 +01:00
Auxilor
d9b702f2f1 libreforge-updater 2022-06-17 15:26:14 +01:00
Auxilor
7692e84a60 libreforge-updater 2022-06-16 16:42:42 +01:00
Auxilor
ffd6037e73 libreforge-updater 2022-06-15 15:12:17 +01:00
Auxilor
7c959d7221 libreforge-updater 2022-06-15 15:10:33 +01:00
Auxilor
91ad33334d libreforge-updater 2022-06-14 16:43:25 +01:00
Auxilor
c1b8ed5b48 libreforge-updater 2022-06-14 09:10:39 +01:00
Auxilor
2f3c5f60a4 libreforge-updater 2022-06-13 11:46:17 +01:00
Auxilor
f3387668e6 Fixed softdepends 2022-06-12 19:12:02 +01:00
Auxilor
b62e79d904 libreforge-updater 2022-06-11 11:14:57 +01:00
Auxilor
d7afeecc27 libreforge-updater 2022-06-08 21:05:47 +01:00
Auxilor
72e61940c5 libreforge-updater 2022-06-06 13:29:09 +01:00
Auxilor
245445473b libreforge-updater 2022-06-04 13:43:57 +01:00
Auxilor
46772ac97a libreforge-updater 2022-06-03 11:35:24 +01:00
Auxilor
29a1e541a2 libreforge-updater 2022-05-31 19:44:47 +01:00
Auxilor
89a6bc97b7 libreforge-updater 2022-05-30 17:04:30 +01:00
Auxilor
c59707e6ac libreforge-updater 2022-05-30 11:10:33 +01:00
Auxilor
99bc2a04ab Updated libreforge 2022-05-28 18:18:27 +01:00
Auxilor
b4e90d9bda libreforge-updater 2022-05-27 19:24:47 +01:00
Auxilor
72c3722429 libreforge-updater 2022-05-25 10:56:28 +01:00
Auxilor
c14b2f0a80 libreforge-updater 2022-05-23 16:02:39 +01:00
Auxilor
0b6c7152e8 libreforge-updater 2022-05-22 20:42:16 +01:00
Auxilor
6e551eeaeb libreforge-updater 2022-05-22 15:26:56 +01:00
Auxilor
d5610ae804 libreforge-updater 2022-05-21 17:33:43 +01:00
Auxilor
79c8ed4992 libreforge-updater 2022-05-20 18:37:00 +01:00
Auxilor
947a0f3c6d libreforge-updater 2022-05-20 18:35:57 +01:00
Auxilor
ce8b0af155 libreforge-updater 2022-05-20 18:27:10 +01:00
Auxilor
a41e5b702d libreforge-updater 2022-05-20 14:20:17 +01:00
Auxilor
f04bf3aeea libreforge-updater 2022-05-19 20:40:35 +01:00
Auxilor
08941461c9 Fixed egg display 2022-05-18 18:06:46 +01:00
Auxilor
743dbac656 Fixed egg display 2022-05-18 18:04:37 +01:00
Auxilor
2e8d1ea4cc Updated to 8.31.1 2022-05-18 17:21:43 +01:00
Auxilor
d31a98fd99 Boss eggs now display not met lore 2022-05-18 17:21:35 +01:00
Auxilor
f7244a7d7f libreforge-updater 2022-05-18 15:31:12 +01:00
Auxilor
268ed76951 libreforge-updater 2022-05-17 18:52:57 +01:00
Auxilor
d0ccb78c17 libreforge-updater 2022-05-16 21:44:52 +01:00
Auxilor
34de040849 libreforge-updater 2022-05-15 14:27:53 +01:00
Auxilor
6b01f8e64a libreforge-updater 2022-05-15 13:59:09 +01:00
Auxilor
2a4d5a8fd2 "libreforge-updater" 2022-05-15 13:33:50 +01:00
Auxilor
f9d7315fd3 Updated libreforge 2022-05-14 21:24:56 +01:00
Auxilor
497f42ccc6 Updated libreforge 2022-05-14 12:22:43 +01:00
Auxilor
d149eb7907 Updated libreforge 2022-05-13 16:02:22 +01:00
Auxilor
47277d0dd8 Updated libreforge 2022-05-12 17:24:02 +01:00
Auxilor
f307f13d1e Updated libreforge 2022-05-11 15:28:48 +01:00
Auxilor
ac3370c0be Updated libreforge 2022-05-05 21:29:00 +01:00
Auxilor
4f616ac8c8 Updated libreforge 2022-05-03 18:46:03 +01:00
Auxilor
24256e9789 Updated libreforge 2022-05-01 17:39:49 +01:00
Auxilor
bbf20e77d0 Updated libreforge 2022-04-30 11:33:18 +01:00
Auxilor
8a506c015b Updated libreforge 2022-04-29 10:20:15 +01:00
Auxilor
744883630d Updated libreforge 2022-04-27 19:00:00 +01:00
Auxilor
8519f4fc23 Updated libreforge 2022-04-27 18:58:32 +01:00
Auxilor
d1cb11ef79 Updated libreforge 2022-04-27 10:38:05 +01:00
Auxilor
edcc185b58 Updated to 8.20.4 2022-04-24 19:08:24 +01:00
Auxilor
ab6d297222 Updated eco/kotlin/libreforge 2022-04-20 11:46:01 +01:00
Auxilor
9626588c66 Updated libreforge 2022-04-16 15:45:37 +01:00
Auxilor
c4eda19d78 Updated to 8.20.4 2022-04-12 11:35:01 +01:00
Auxilor
691326577a Updated to 8.20.4 2022-04-11 14:51:47 +01:00
Auxilor
e2086387e7 Fixed custom AI not working 2022-04-11 14:51:36 +01:00
Auxilor
13a72f849d Updated to 8.20.2 2022-04-09 14:42:29 +01:00
Auxilor
6346975e77 Updated to 8.20.2 2022-04-08 18:03:48 +01:00
Auxilor
0d846d9dff Added autospawn.one-boss-per-world option 2022-04-08 18:03:39 +01:00
Auxilor
31610383c4 Updated libreforge 2022-04-06 14:18:41 +01:00
Auxilor
d7c16ad3cc Updated libreforge 2022-04-04 10:23:34 +01:00
Auxilor
afe9095276 Updated libreforge 2022-04-02 14:04:56 +01:00
Auxilor
31a782581f Updated libreforge 2022-03-31 20:20:00 +01:00
Auxilor
8aad221450 Updated libreforge 2022-03-30 20:38:08 +01:00
Auxilor
b0bff24263 Updated libreforge 2022-03-28 19:05:19 +01:00
Auxilor
04b00fa01b Merge remote-tracking branch 'origin/master'
# Conflicts:
#	build.gradle
#	gradle.properties
2022-03-28 19:05:11 +01:00
Auxilor
276ba4616a Updated libreforge 2022-03-25 09:31:29 +00:00
Auxilor
d8e5fb9cd0 Updated to 8.14.0 2022-03-21 12:40:12 +00:00
Auxilor
9f05a6504a Added support for custom entity AI 2022-03-21 12:39:09 +00:00
Auxilor
322a6bb41b Updated libreforge 2022-03-21 12:24:06 +00:00
Auxilor
4dbc8afdf4 Updated libreforge 2022-03-19 16:42:59 +00:00
Auxilor
7ffa6ff4f4 Updated libreforge 2022-03-17 08:57:55 +00:00
Auxilor
3769684bb0 Updated libreforge 2022-03-16 09:05:56 +00:00
Auxilor
7bb931e027 Updated libreforge 2022-03-13 11:59:46 +00:00
Auxilor
879d6dd72d Updated libreforge 2022-03-12 12:22:54 +00:00
Auxilor
0a4aff45ad Updated libreforge 2022-03-10 15:13:28 +00:00
Auxilor
5929da1f48 Updated libreforge 2022-03-09 12:50:07 +00:00
Will FP
6db5de581b Update README.md 2022-03-09 12:47:33 +00:00
Auxilor
9ce1bb7ddf Updated libreforge 2022-03-08 20:20:01 +00:00
Auxilor
351d34de9f Updated libreforge 2022-03-07 14:01:18 +00:00
Auxilor
4d2b726aa0 Updated to 8.7.1 2022-03-04 16:59:39 +00:00
Auxilor
ff20b70784 Improved PDC storage 2022-03-04 16:59:31 +00:00
Auxilor
f31cd20200 Updated to 8.7.0 2022-03-03 17:02:43 +00:00
Auxilor
0ad2d3cfc7 Adapted pull request 2022-03-03 17:01:19 +00:00
Will FP
ccc7c5797a Merge pull request #28
Add commands ran for lifecycle
2022-03-03 16:54:00 +00:00
Auxilor
a218fa96c0 Updated libreforge 2022-03-01 16:26:17 +00:00
Auxilor
13c0a4d83a Updated to 8.5.2 2022-02-28 10:16:04 +00:00
Auxilor
62e7177b1b Fixed autospawn 2022-02-28 10:15:52 +00:00
Auxilor
752b30b4a2 Fixed spawn event not being called with totems 2022-02-28 10:14:11 +00:00
Auxilor
be4d6156e3 Fixed spawn totems some more 2022-02-28 10:12:12 +00:00
Auxilor
fed6dcafd7 Fixed spawn totems 2022-02-28 10:09:31 +00:00
Auxilor
36f944c58c Updated libreforge 2022-02-28 10:04:53 +00:00
Auxilor
1bc35656fe Fixed bosses attacking creative and spectator mode players 2022-02-28 10:04:38 +00:00
casper
1216e83a39 Add commands ran for lifecycle 2022-02-26 15:31:52 -05:00
Auxilor
4723c7982c Updated libreforge 2022-02-25 11:24:50 +00:00
Auxilor
8ba3c7834c Updated libreforge 2022-02-20 17:25:32 +00:00
Auxilor
76530a1617 Updated libreforge 2022-02-19 15:58:02 +00:00
Auxilor
bf41554846 build.gradle messages 2022-02-18 15:10:11 +00:00
Auxilor
a741c78b6b Fixed compatibility with other plugins 2022-02-18 14:37:01 +00:00
Auxilor
0f8dce74da Updated libreforge 2022-02-18 14:36:11 +00:00
Auxilor
0d31556b84 Updated libreforge 2022-02-15 16:49:03 +00:00
Auxilor
f8544c284e Updated libreforge 2022-02-14 17:18:16 +00:00
Auxilor
512a477fc6 Updated libreforge 2022-02-13 15:41:22 +00:00
Auxilor
8a1b473837 Updated libreforge 2022-02-12 10:51:41 +00:00
35 changed files with 548 additions and 292 deletions

View File

@@ -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>

View File

@@ -4,7 +4,7 @@ buildscript {
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10"
}
}
@@ -58,15 +58,17 @@ allprojects {
shadowJar {
relocate('com.willfp.libreforge', 'com.willfp.ecobosses.libreforge')
relocate('org.joml', 'com.willfp.ecobosses.libreforge.joml')
}
dependencies {
compileOnly 'com.willfp:eco:6.24.0'
implementation 'com.willfp:libreforge:3.17.0'
compileOnly 'com.willfp:eco:6.35.1'
implementation 'com.willfp:libreforge:3.93.2'
implementation 'org.joml:joml:1.10.4'
compileOnly 'org.jetbrains:annotations:23.0.0'
compileOnly 'org.jetbrains.kotlin:kotlin-stdlib:1.6.0'
compileOnly 'org.jetbrains.kotlin:kotlin-stdlib:1.7.10'
}
tasks.withType(JavaCompile) {
@@ -83,6 +85,7 @@ allprojects {
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
kotlinOptions {
jvmTarget = "17"
freeCompilerArgs += ["-Xjvm-default=all"]
}
}
@@ -118,4 +121,16 @@ version = findProperty("version")
compileJava.options.encoding = 'UTF-8'
build.dependsOn shadowJar
build.dependsOn publishToMavenLocal
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

View File

@@ -1,2 +1,2 @@
group 'com.willfp'
version rootProject.version
version rootProject.version

View File

@@ -1,11 +1,12 @@
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
@@ -23,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() }
@@ -44,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)
@@ -74,7 +80,7 @@ class EcoBossesPlugin : LibReforgePlugin(525, 10635, "&9") {
}
override fun getMinimumEcoVersion(): String {
return "6.24.0"
return "6.35.1"
}
companion object {

View File

@@ -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)
}

View File

@@ -3,11 +3,13 @@ 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 org.bukkit.entity.LivingEntity
import java.util.UUID
import java.io.File
import java.util.*
object Bosses {
/**
@@ -44,16 +46,18 @@ 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")) {
addNewBoss(EcoBoss(bossConfig.getString("id"), bossConfig, plugin))
}
}

View File

@@ -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
)

View File

@@ -5,17 +5,37 @@ 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.*
import com.willfp.ecobosses.util.*
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
import com.willfp.ecobosses.tick.TeleportHandler
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
import com.willfp.ecobosses.util.topDamagers
import com.willfp.libreforge.Holder
import com.willfp.libreforge.conditions.Conditions
import com.willfp.libreforge.effects.Effects
@@ -24,16 +44,17 @@ 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.*
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 lifespan = config.getInt("lifespan")
@@ -157,6 +178,22 @@ class EcoBoss(
locations
}
val hasCustomAI = config.getBool("customai.enabled")
val targetGoals = config.getSubsections("customai.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 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")
}
@@ -189,6 +226,16 @@ 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>>()
@@ -280,14 +327,29 @@ 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>) }
}
val boss = LivingEcoBoss(
plugin,
mob.uniqueId,
mob,
this,
createTickers()
)
@@ -300,7 +362,8 @@ class EcoBoss(
LifespanTicker(),
DisplayNameTicker(),
TargetTicker(),
TeleportHandler()
TeleportHandler(),
ChunkTicker()
)
if (isBossBarEnabled) {
@@ -322,10 +385,11 @@ 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

View File

@@ -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
}
}

View File

@@ -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}}"
}
}

View File

@@ -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
)
}

View File

@@ -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
)

View File

@@ -31,6 +31,7 @@ class BossSpawnEvent(
TOTEM,
EGG,
COMMAND,
AUTOSPAWN,
UNKNOWN
}

View File

@@ -34,8 +34,8 @@ class ConsoleLoggers(
return
}
val loc = event.boss.entity?.location
val location = "${loc?.world?.name}: ${loc?.x}, ${loc?.y}, ${loc?.z}"
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")
}
@@ -48,8 +48,8 @@ class ConsoleLoggers(
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}"
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")
}

View File

@@ -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

View File

@@ -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)
}

View File

@@ -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,11 +22,19 @@ object AutospawnHandler {
val location = boss.autoSpawnLocations.randomOrNull() ?: continue
val world = location.world ?: continue
if (Bosses.getAllAlive().mapNotNull { it.entity }.any { it.world == world }) {
continue
if (plugin.configYml.getBool("autospawn.one-boss-per-world")) {
if (Bosses.getAllAlive().mapNotNull { it.entity }.any { it.world == world }) {
continue
}
}
boss.spawn(location)
val spawnEvent = BossSpawnEvent(boss, location, BossSpawnEvent.SpawnReason.AUTOSPAWN, null)
Bukkit.getPluginManager().callEvent(spawnEvent)
if (!spawnEvent.isCancelled) {
boss.spawn(location)
}
}
tick++

View File

@@ -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
}
@@ -57,10 +58,12 @@ class SpawnTotemHandler : Listener {
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))
}

View File

@@ -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())

View File

@@ -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()
}
}

View File

@@ -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

View File

@@ -16,7 +16,7 @@ class LifespanTicker : BossTicker {
boss.remove()
boss.boss.handleLifecycle(
BossLifecycle.DESPAWN,
boss.entity?.location ?: return,
boss.entity.location,
boss.entity
)
}

View File

@@ -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

View File

@@ -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
}

View File

@@ -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,

View File

@@ -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);
}
}
}

View File

@@ -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
}
}

View File

@@ -0,0 +1,189 @@
# 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
# 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
customai: # 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:
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
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

View 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

View File

@@ -6,6 +6,9 @@
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
sound:
@@ -32,4 +35,15 @@ 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)
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

View File

@@ -0,0 +1,3 @@
resource-id: 525
bstats-id: 10635
color: "&9"

View File

@@ -1,194 +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

View File

@@ -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"

View File

@@ -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,13 +9,17 @@ depend:
- eco
softdepend:
- LevelledMobs
- EcoSkills
- AureliumSkills
- Jobs
- mcMMO
- Vault
- ShopGUIPlus
- DeluxeSellwands
- TMMobcoins
- EcoEnchants
- Talismans
- EcoArmor
- EcoItems
- EcoSkills
- Boosters
commands:
ecobosses:

View File

@@ -1,2 +1,4 @@
version = 8.3.0
plugin-name = EcoBosses
#libreforge-updater
#Mon Sep 05 18:00:28 BST 2022
version=8.78.2
plugin-name=EcoBosses