From a4983ffea09c0cc317e4571b37d516d86c2e444d Mon Sep 17 00:00:00 2001 From: Sen2000 <18487475+SenPr@users.noreply.github.com> Date: Wed, 19 Jul 2023 01:10:40 +0700 Subject: [PATCH] Add total_pets placeholder --- .../com/willfp/ecopets/EcoPetsPlugin.kt | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecopets/EcoPetsPlugin.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecopets/EcoPetsPlugin.kt index 944221e..689dae4 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecopets/EcoPetsPlugin.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecopets/EcoPetsPlugin.kt @@ -12,13 +12,7 @@ import com.willfp.ecopets.libreforge.EffectPetXpMultiplier import com.willfp.ecopets.libreforge.FilterPet import com.willfp.ecopets.libreforge.TriggerGainPetXp import com.willfp.ecopets.libreforge.TriggerLevelUpPet -import com.willfp.ecopets.pets.DiscoverRecipeListener -import com.willfp.ecopets.pets.PetDisplay -import com.willfp.ecopets.pets.PetLevelListener -import com.willfp.ecopets.pets.Pets -import com.willfp.ecopets.pets.SpawnEggHandler -import com.willfp.ecopets.pets.activePet -import com.willfp.ecopets.pets.activePetLevel +import com.willfp.ecopets.pets.* import com.willfp.ecopets.pets.entity.ModelEnginePetEntity import com.willfp.ecopets.pets.entity.PetEntity import com.willfp.libreforge.SimpleProvidedHolder @@ -68,6 +62,18 @@ class EcoPetsPlugin : LibreforgePlugin() { this, "pet_id" ) { 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() {