Compare commits
48 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f83d646e02 | ||
|
|
6c4437e0cb | ||
|
|
8b8bc294e4 | ||
|
|
94cc573114 | ||
|
|
4f3da3ae84 | ||
|
|
19b52eaaa7 | ||
|
|
e9f33fd298 | ||
|
|
fc66efff53 | ||
|
|
1409620b92 | ||
|
|
f1acc877b7 | ||
|
|
d7e725822c | ||
|
|
d613e569ed | ||
|
|
22274a9bdf | ||
|
|
2ef337d4ca | ||
|
|
aacd247c54 | ||
|
|
1aa419bce7 | ||
|
|
56f948e898 | ||
|
|
d92472c0a4 | ||
|
|
7de03c1459 | ||
|
|
9109e11791 | ||
|
|
a0381e113c | ||
|
|
2d6128eca9 | ||
|
|
985608791b | ||
|
|
dd65bfa58d | ||
|
|
a61cce53c1 | ||
|
|
e7cc186e9c | ||
|
|
7fb3df354d | ||
|
|
971c643203 | ||
|
|
b2381c33fe | ||
|
|
0642ff1421 | ||
|
|
7dc5caec57 | ||
|
|
b006ebab53 | ||
|
|
3bd774265d | ||
|
|
0ff6d68a5b | ||
|
|
a27ebb1b5c | ||
|
|
afafd86eaf | ||
|
|
49a2713017 | ||
|
|
a4263e8397 | ||
|
|
17f3aa8862 | ||
|
|
c94024ea19 | ||
|
|
1daa52e1f4 | ||
|
|
a06808f802 | ||
|
|
91cf08f0ac | ||
|
|
9a7ff1760c | ||
|
|
f2c3f569b7 | ||
|
|
508cb3e216 | ||
|
|
5f998f4bad | ||
|
|
0bb4aa6d51 |
@@ -4,7 +4,7 @@ buildscript {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21"
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,12 +48,12 @@ allprojects {
|
||||
|
||||
dependencies {
|
||||
compileOnly 'com.willfp:eco:6.37.1'
|
||||
implementation 'com.willfp:libreforge:3.74.1'
|
||||
implementation 'com.willfp:libreforge:3.87.0'
|
||||
implementation 'org.joml:joml:1.10.4'
|
||||
|
||||
compileOnly 'org.jetbrains:annotations:23.0.0'
|
||||
|
||||
compileOnly 'org.jetbrains.kotlin:kotlin-stdlib:1.6.21'
|
||||
compileOnly 'org.jetbrains.kotlin:kotlin-stdlib:1.7.10'
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
|
||||
@@ -19,7 +19,7 @@ class PetDisplay(
|
||||
) : Listener {
|
||||
private var tick = 0
|
||||
|
||||
private val trackedEntities = mutableMapOf<UUID, ArmorStand>()
|
||||
private val trackedEntities = mutableMapOf<UUID, PetArmorStand>()
|
||||
|
||||
fun tickAll() {
|
||||
for (player in Bukkit.getOnlinePlayers()) {
|
||||
@@ -44,7 +44,11 @@ class PetDisplay(
|
||||
|
||||
location.y += NumberUtils.fastSin(tick / (2 * PI) * 0.5) * 0.15
|
||||
|
||||
stand.teleport(location)
|
||||
try {
|
||||
stand.teleport(location)
|
||||
} catch (_: Exception) {
|
||||
|
||||
}
|
||||
|
||||
if (!pet.entityTexture.contains(":")) {
|
||||
stand.setRotation((20 * tick / (2 * PI)).toFloat(), 0f)
|
||||
@@ -55,15 +59,30 @@ class PetDisplay(
|
||||
private fun getLocation(player: Player): Location {
|
||||
val offset = player.eyeLocation.direction.clone().normalize()
|
||||
.multiply(-1)
|
||||
.apply { y = abs(y) }
|
||||
.apply {
|
||||
y = abs(y)
|
||||
|
||||
if (abs(x) < 0.5) {
|
||||
x = 0.5
|
||||
}
|
||||
|
||||
if (abs(z) < 0.5) {
|
||||
z = 0.5
|
||||
}
|
||||
}
|
||||
.rotateAroundY(PI / 6)
|
||||
|
||||
return player.eyeLocation.clone().add(offset)
|
||||
}
|
||||
|
||||
private fun getOrNew(player: Player): ArmorStand? {
|
||||
val existing = trackedEntities[player.uniqueId]
|
||||
val tracked = trackedEntities[player.uniqueId]
|
||||
val existing = tracked?.stand
|
||||
|
||||
val pet = player.activePet
|
||||
if (pet != tracked?.pet) {
|
||||
tracked?.stand?.remove()
|
||||
}
|
||||
|
||||
if (existing == null || existing.isDead || pet == null) {
|
||||
existing?.remove()
|
||||
@@ -76,15 +95,15 @@ class PetDisplay(
|
||||
val location = getLocation(player)
|
||||
val stand = pet.makePetEntity().spawn(location)
|
||||
|
||||
trackedEntities[player.uniqueId] = stand
|
||||
trackedEntities[player.uniqueId] = PetArmorStand(stand, pet)
|
||||
}
|
||||
|
||||
return trackedEntities[player.uniqueId]
|
||||
return trackedEntities[player.uniqueId]?.stand
|
||||
}
|
||||
|
||||
fun shutdown() {
|
||||
for (stand in trackedEntities.values) {
|
||||
stand.remove()
|
||||
stand.stand.remove()
|
||||
}
|
||||
|
||||
trackedEntities.clear()
|
||||
@@ -92,7 +111,12 @@ class PetDisplay(
|
||||
|
||||
@EventHandler
|
||||
fun onLeave(event: PlayerQuitEvent) {
|
||||
trackedEntities[event.player.uniqueId]?.remove()
|
||||
trackedEntities[event.player.uniqueId]?.stand?.remove()
|
||||
trackedEntities.remove(event.player.uniqueId)
|
||||
}
|
||||
|
||||
private data class PetArmorStand(
|
||||
val stand: ArmorStand,
|
||||
val pet: Pet
|
||||
)
|
||||
}
|
||||
|
||||
@@ -16,6 +16,9 @@ class ModelEnginePetEntity(
|
||||
val modelled = ModelEngineAPI.createModeledEntity(stand)
|
||||
modelled.addActiveModel(model)
|
||||
|
||||
// ModelEngine removed addActiveModel in new API release... for no reason.
|
||||
//modelled.addModel(model,true)
|
||||
|
||||
return stand
|
||||
}
|
||||
}
|
||||
|
||||
@@ -721,45 +721,45 @@ pets:
|
||||
1:
|
||||
- "&8» &#ff0000This pet can ONLY be levelled at night."
|
||||
- ""
|
||||
- "&8» &7When hitting enemies have a &#ff0000%lifesteal_chance% &7to gain"
|
||||
- "&8» &7When hitting enemies have a &#ff0000%lifesteal_chance%% &7to gain"
|
||||
- " &7health from your enemy. Has a &#ff0000%lifesteal_cooldown% &7second cooldown."
|
||||
25:
|
||||
- "&8» &#ff0000This pet can ONLY be levelled at night."
|
||||
- ""
|
||||
- "&8» &7When hitting enemies have a &#ff0000%lifesteal_chance% &7to gain"
|
||||
- "&8» &7When hitting enemies have a &#ff0000%lifesteal_chance%% &7to gain"
|
||||
- " &7health from your enemy. Has a &#ff0000%lifesteal_cooldown% &7second cooldown."
|
||||
- ""
|
||||
- "&8» &7When hitting enemies have a &#ff0000%bleed_chance% &7to bleed"
|
||||
- "&8» &7When hitting enemies have a &#ff0000%bleed_chance%% &7to bleed"
|
||||
- " &7your enemies dealing &#ff0000%bleed_damage%&7 damage twice."
|
||||
|
||||
rewards-description:
|
||||
1:
|
||||
- "&8» &#ff0000This pet can ONLY be levelled at night."
|
||||
- ""
|
||||
- "&8» &7When hitting enemies have a &#ff0000%lifesteal_chance% &7to gain &ff0000%lifesteal_heal%"
|
||||
- "&8» &7When hitting enemies have a &#ff0000%lifesteal_chance%% &7to gain &ff0000%lifesteal_heal%"
|
||||
- " &7health from your enemy. Has a &#ff0000%lifesteal_cooldown% &7second cooldown."
|
||||
25:
|
||||
- "&8» &#ff0000This pet can ONLY be levelled at night."
|
||||
- ""
|
||||
- "&8» &7When hitting enemies have a &#ff0000%lifesteal_chance% &7to gain"
|
||||
- "&8» &7When hitting enemies have a &#ff0000%lifesteal_chance%% &7to gain"
|
||||
- " &7health from your enemy. Has a &#ff0000%lifesteal_cooldown% &7second cooldown."
|
||||
- ""
|
||||
- "&8» &7When hitting enemies have a &#ff0000%bleed_chance% &7to bleed"
|
||||
- "&8» &7When hitting enemies have a &#ff0000%bleed_chance%% &7to bleed"
|
||||
- " &7your enemies dealing &#ff0000%bleed_damage%&7 damage twice."
|
||||
|
||||
level-up-messages:
|
||||
1:
|
||||
- "&8» &#ff0000This pet can ONLY be levelled at night."
|
||||
- ""
|
||||
- "&8» &7When hitting enemies have a &#ff0000%lifesteal_chance% &7to gain"
|
||||
- "&8» &7When hitting enemies have a &#ff0000%lifesteal_chance%% &7to gain"
|
||||
- " &7health from your enemy. Has a &#ff0000%lifesteal_cooldown% &7second cooldown."
|
||||
25:
|
||||
- "&8» &#ff0000This pet can ONLY be levelled at night."
|
||||
- ""
|
||||
- "&8» &7When hitting enemies have a &#ff0000%lifesteal_chance% &7to gain"
|
||||
- "&8» &7When hitting enemies have a &#ff0000%lifesteal_chance%% &7to gain"
|
||||
- " &7health from your enemy. Has a &#ff0000%lifesteal_cooldown% &7second cooldown."
|
||||
- ""
|
||||
- "&8» &7When hitting enemies have a &#ff0000%bleed_chance% &7to bleed"
|
||||
- "&8» &7When hitting enemies have a &#ff0000%bleed_chance%% &7to bleed"
|
||||
- " &7your enemies dealing &#ff0000%bleed_damage%&7 damage twice."
|
||||
|
||||
level-commands: [ ]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#libreforge-updater
|
||||
#Tue Jul 12 14:59:32 BST 2022
|
||||
version=1.10.1
|
||||
#Tue Aug 23 11:08:06 CEST 2022
|
||||
version=1.23.0
|
||||
plugin-name=EcoPets
|
||||
|
||||
Reference in New Issue
Block a user