Compare commits
42 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
345c8e9049 | ||
|
|
87e3a15d01 | ||
|
|
1ea152058c | ||
|
|
a1a08f750a | ||
|
|
0ec4e566b3 | ||
|
|
98c71e938c | ||
|
|
2e3db38e67 | ||
|
|
d3438a0db1 | ||
|
|
69b8179672 | ||
|
|
ffe6f47e22 | ||
|
|
759f921287 | ||
|
|
2a0e27d7e1 | ||
|
|
ad1e639d00 | ||
|
|
9f1f6b206c | ||
|
|
2a465013d4 | ||
|
|
6b2ea93e3b | ||
|
|
9f55826f5e | ||
|
|
ff9e2cbcba | ||
|
|
8e90f57364 | ||
|
|
682cfe6c8e | ||
|
|
a4983ffea0 | ||
|
|
ebda2dd3c9 | ||
|
|
75794f4af7 | ||
|
|
53d7688436 | ||
|
|
e145b21cb8 | ||
|
|
bf436b239f | ||
|
|
4707291704 | ||
|
|
321d3ed92c | ||
|
|
88b25f93ce | ||
|
|
244626682e | ||
|
|
af6b811458 | ||
|
|
e5064aabef | ||
|
|
558431d39c | ||
|
|
eca0980869 | ||
|
|
5645698d3f | ||
|
|
d4cf108d52 | ||
|
|
95c8fe5277 | ||
|
|
0975391c9c | ||
|
|
3d4666f7e0 | ||
|
|
ae2c9680f3 | ||
|
|
ad3892fc90 | ||
|
|
658aeee2cc |
1
.github/CODEOWNERS
vendored
Normal file
1
.github/CODEOWNERS
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
* @WillFP
|
||||||
@@ -3,7 +3,7 @@ version = rootProject.version
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly("io.papermc.paper:paper-api:1.19.3-R0.1-SNAPSHOT")
|
compileOnly("io.papermc.paper:paper-api:1.19.3-R0.1-SNAPSHOT")
|
||||||
compileOnly("com.ticxo.modelengine:api:R3.1.5")
|
compileOnly("com.ticxo.modelengine:api:R3.1.6")
|
||||||
compileOnly("com.github.ben-manes.caffeine:caffeine:3.0.2")
|
compileOnly("com.github.ben-manes.caffeine:caffeine:3.0.2")
|
||||||
|
|
||||||
implementation("com.willfp:ecomponent:1.3.0")
|
implementation("com.willfp:ecomponent:1.3.0")
|
||||||
@@ -11,9 +11,12 @@ dependencies {
|
|||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
register("maven", MavenPublication::class) {
|
register<MavenPublication>("maven") {
|
||||||
from(components["java"])
|
groupId = project.group.toString()
|
||||||
|
version = project.version.toString()
|
||||||
artifactId = rootProject.name
|
artifactId = rootProject.name
|
||||||
|
|
||||||
|
artifact(rootProject.tasks.shadowJar.get().archiveFile)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.willfp.eco.core.placeholder.PlayerPlaceholder
|
|||||||
import com.willfp.ecopets.commands.CommandEcoPets
|
import com.willfp.ecopets.commands.CommandEcoPets
|
||||||
import com.willfp.ecopets.commands.CommandPets
|
import com.willfp.ecopets.commands.CommandPets
|
||||||
import com.willfp.ecopets.libreforge.ConditionHasActivePet
|
import com.willfp.ecopets.libreforge.ConditionHasActivePet
|
||||||
|
import com.willfp.ecopets.libreforge.ConditionHasPet
|
||||||
import com.willfp.ecopets.libreforge.ConditionHasPetLevel
|
import com.willfp.ecopets.libreforge.ConditionHasPetLevel
|
||||||
import com.willfp.ecopets.libreforge.EffectGivePetXp
|
import com.willfp.ecopets.libreforge.EffectGivePetXp
|
||||||
import com.willfp.ecopets.libreforge.EffectPetXpMultiplier
|
import com.willfp.ecopets.libreforge.EffectPetXpMultiplier
|
||||||
@@ -19,6 +20,7 @@ import com.willfp.ecopets.pets.Pets
|
|||||||
import com.willfp.ecopets.pets.SpawnEggHandler
|
import com.willfp.ecopets.pets.SpawnEggHandler
|
||||||
import com.willfp.ecopets.pets.activePet
|
import com.willfp.ecopets.pets.activePet
|
||||||
import com.willfp.ecopets.pets.activePetLevel
|
import com.willfp.ecopets.pets.activePetLevel
|
||||||
|
import com.willfp.ecopets.pets.hasPet
|
||||||
import com.willfp.ecopets.pets.entity.ModelEnginePetEntity
|
import com.willfp.ecopets.pets.entity.ModelEnginePetEntity
|
||||||
import com.willfp.ecopets.pets.entity.PetEntity
|
import com.willfp.ecopets.pets.entity.PetEntity
|
||||||
import com.willfp.libreforge.SimpleProvidedHolder
|
import com.willfp.libreforge.SimpleProvidedHolder
|
||||||
@@ -47,6 +49,7 @@ class EcoPetsPlugin : LibreforgePlugin() {
|
|||||||
override fun handleEnable() {
|
override fun handleEnable() {
|
||||||
Conditions.register(ConditionHasPetLevel)
|
Conditions.register(ConditionHasPetLevel)
|
||||||
Conditions.register(ConditionHasActivePet)
|
Conditions.register(ConditionHasActivePet)
|
||||||
|
Conditions.register(ConditionHasPet)
|
||||||
Effects.register(EffectPetXpMultiplier)
|
Effects.register(EffectPetXpMultiplier)
|
||||||
Effects.register(EffectGivePetXp)
|
Effects.register(EffectGivePetXp)
|
||||||
Triggers.register(TriggerGainPetXp)
|
Triggers.register(TriggerGainPetXp)
|
||||||
@@ -68,6 +71,18 @@ class EcoPetsPlugin : LibreforgePlugin() {
|
|||||||
this,
|
this,
|
||||||
"pet_id"
|
"pet_id"
|
||||||
) { it.activePet?.id ?: "" }.register()
|
) { it.activePet?.id ?: "" }.register()
|
||||||
|
|
||||||
|
PlayerPlaceholder(
|
||||||
|
this,
|
||||||
|
"total_pets"
|
||||||
|
) {
|
||||||
|
var pets = 0
|
||||||
|
for (pet in Pets.values()) {
|
||||||
|
if (it.hasPet(pet))
|
||||||
|
pets++
|
||||||
|
}
|
||||||
|
pets.toString()
|
||||||
|
}.register()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun handleReload() {
|
override fun handleReload() {
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import com.willfp.ecopets.pets.hasPet
|
|||||||
import com.willfp.ecopets.pets.setPetLevel
|
import com.willfp.ecopets.pets.setPetLevel
|
||||||
import org.bukkit.Bukkit
|
import org.bukkit.Bukkit
|
||||||
import org.bukkit.command.CommandSender
|
import org.bukkit.command.CommandSender
|
||||||
|
import org.bukkit.entity.Player
|
||||||
import org.bukkit.util.StringUtil
|
import org.bukkit.util.StringUtil
|
||||||
|
|
||||||
class CommandGive(plugin: EcoPlugin) : Subcommand(plugin, "give", "ecopets.command.give", false) {
|
class CommandGive(plugin: EcoPlugin) : Subcommand(plugin, "give", "ecopets.command.give", false) {
|
||||||
@@ -28,7 +29,7 @@ class CommandGive(plugin: EcoPlugin) : Subcommand(plugin, "give", "ecopets.comma
|
|||||||
@Suppress("DEPRECATION")
|
@Suppress("DEPRECATION")
|
||||||
val player = Bukkit.getOfflinePlayer(playerName)
|
val player = Bukkit.getOfflinePlayer(playerName)
|
||||||
|
|
||||||
if (!player.hasPlayedBefore()) {
|
if (!player.hasPlayedBefore() && player !is Player) {
|
||||||
sender.sendMessage(plugin.langYml.getMessage("invalid-player"))
|
sender.sendMessage(plugin.langYml.getMessage("invalid-player"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,9 +14,10 @@ object ConditionHasActivePet : Condition<NoCompileData>("has_active_pet") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun isMet(player: Player, config: Config, compileData: NoCompileData): Boolean {
|
override fun isMet(player: Player, config: Config, compileData: NoCompileData): Boolean {
|
||||||
return EcoPetsAPI.instance.hasPet(
|
return EcoPetsAPI.instance.getActivePet(player) == Pets.getByID(config.getString("pet").lowercase())
|
||||||
player,
|
// return EcoPetsAPI.instance.hasPet(
|
||||||
Pets.getByID(config.getString("pet").lowercase()) ?: return false
|
// player,
|
||||||
)
|
// Pets.getByID(config.getString("pet").lowercase()) ?: return false
|
||||||
|
// )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.willfp.ecopets.libreforge
|
||||||
|
|
||||||
|
import com.willfp.eco.core.config.interfaces.Config
|
||||||
|
import com.willfp.ecopets.api.EcoPetsAPI
|
||||||
|
import com.willfp.ecopets.pets.Pets
|
||||||
|
import com.willfp.libreforge.NoCompileData
|
||||||
|
import com.willfp.libreforge.conditions.Condition
|
||||||
|
import org.bukkit.entity.Player
|
||||||
|
|
||||||
|
object ConditionHasPet : Condition<NoCompileData>("has_pet") {
|
||||||
|
override fun isMet(player: Player, config: Config, compileData: NoCompileData): Boolean {
|
||||||
|
return EcoPetsAPI.instance.hasPet(
|
||||||
|
player,
|
||||||
|
Pets.getByID(config.getString("pet").lowercase()) ?: return false
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -36,6 +36,11 @@ class PetDisplay(
|
|||||||
val pet = player.activePet
|
val pet = player.activePet
|
||||||
|
|
||||||
if (pet != null) {
|
if (pet != null) {
|
||||||
|
if (player.isInvisible) {
|
||||||
|
remove(player)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
@Suppress("DEPRECATION")
|
@Suppress("DEPRECATION")
|
||||||
stand.customName = plugin.configYml.getString("pet-entity.name")
|
stand.customName = plugin.configYml.getString("pet-entity.name")
|
||||||
.replace("%player%", player.displayName)
|
.replace("%player%", player.displayName)
|
||||||
@@ -77,6 +82,10 @@ class PetDisplay(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun getOrNew(player: Player): ArmorStand? {
|
private fun getOrNew(player: Player): ArmorStand? {
|
||||||
|
if (player.isInvisible) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
val tracked = trackedEntities[player.uniqueId]
|
val tracked = trackedEntities[player.uniqueId]
|
||||||
val existing = tracked?.stand
|
val existing = tracked?.stand
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#libreforge-updater
|
#libreforge-updater
|
||||||
#Sat May 20 17:41:14 BST 2023
|
#Thu Aug 10 19:59:38 BST 2023
|
||||||
kotlin.code.style=official
|
kotlin.code.style=official
|
||||||
libreforge-version=4.14.2
|
libreforge-version=4.28.0
|
||||||
version=2.14.2
|
version=2.27.0
|
||||||
|
|||||||
Reference in New Issue
Block a user