Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Auxilor/libreforge
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4.70.0
Choose a base ref
...
head repository: Auxilor/libreforge
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Aug 3, 2024

  1. Added swept filter

    WillFP committed Aug 3, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    70d7e38 View commit details
  2. Updated to 4.71.0

    WillFP committed Aug 3, 2024
    Copy the full SHA
    64e3252 View commit details

Commits on Aug 15, 2024

  1. Fixed shield_block

    WillFP committed Aug 15, 2024
    Copy the full SHA
    47aec16 View commit details
  2. Updated to 4.71.1

    WillFP committed Aug 15, 2024
    Copy the full SHA
    c969b00 View commit details

Commits on Aug 19, 2024

  1. Fixed build

    WillFP committed Aug 19, 2024
    Copy the full SHA
    0a0c8de View commit details

Commits on Aug 21, 2024

  1. Copy the full SHA
    4d31bd3 View commit details
  2. Copy the full SHA
    2b2d2ad View commit details
  3. Updated to 4.71.2

    WillFP committed Aug 21, 2024
    Copy the full SHA
    6f1bf20 View commit details

Commits on Aug 23, 2024

  1. Copy the full SHA
    898eef0 View commit details
  2. Fixed bug with filters

    WillFP committed Aug 23, 2024
    Copy the full SHA
    68f07ea View commit details
  3. Updated to 4.71.3

    WillFP committed Aug 23, 2024
    Copy the full SHA
    42b3d4f View commit details

Commits on Aug 29, 2024

  1. Copy the full SHA
    661b544 View commit details
  2. Updated to 4.71.4

    WillFP committed Aug 29, 2024
    Copy the full SHA
    40f6807 View commit details

Commits on Aug 30, 2024

  1. Improved enchantments

    WillFP committed Aug 30, 2024
    Copy the full SHA
    9ccd77d View commit details
  2. Updated to 4.71.5

    WillFP committed Aug 30, 2024
    Copy the full SHA
    b071034 View commit details

Commits on Sep 1, 2024

  1. Copy the full SHA
    b95363c View commit details

Commits on Sep 2, 2024

  1. Updated to 4.71.6

    WillFP committed Sep 2, 2024
    Copy the full SHA
    0e6a808 View commit details
  2. Copy the full SHA
    1e01871 View commit details

Commits on Sep 19, 2024

  1. collect_honeycomb trigger

    This trigger specifically fires when right-clicking a beehive or bee_nest with shears when it has honey level 5.
    Exanthiax committed Sep 19, 2024
    Copy the full SHA
    89f2522 View commit details
  2. collect_honey trigger

    This trigger will fire specifically when a player collects honey in a bottle from a beehive or bee_nest with a honey level of 5
    Exanthiax committed Sep 19, 2024
    Copy the full SHA
    d6c691f View commit details
  3. added honey_level_full filter

    this checks if the beehive/bee_nest is full of honey (honey-level:5).
    Exanthiax committed Sep 19, 2024
    Copy the full SHA
    f66687c View commit details
  4. Copy the full SHA
    4fa6df8 View commit details

Commits on Sep 21, 2024

  1. added sheep_color filter

    Adds a filter that checks for sheep's color when killed, sheared, etc.
    Exanthiax committed Sep 21, 2024
    Copy the full SHA
    e9490b1 View commit details
  2. Copy the full SHA
    3aee26d View commit details
  3. Corrected file name

    Exanthiax committed Sep 21, 2024
    Copy the full SHA
    0bc9989 View commit details
  4. Copy the full SHA
    14a25cb View commit details

Commits on Sep 22, 2024

  1. Merge pull request #166 from Auxilor/develop

    Fixed manipulating global points via command
    WillFP authored Sep 22, 2024
    1
    Copy the full SHA
    3e8a893 View commit details
  2. Merge pull request #164 from b0hle/master

    Fixed the wack angular math, use block face its much cleaner in game.
    WillFP authored Sep 22, 2024
    Copy the full SHA
    2ddb95d View commit details
  3. Updated to 4.72.0

    WillFP committed Sep 22, 2024
    Copy the full SHA
    f613460 View commit details
  4. Merge pull request #168 from Exanthiax/honeycomb

    added `honey_level_full` filter
    WillFP authored Sep 22, 2024
    1
    Copy the full SHA
    b889b95 View commit details

Commits on Oct 18, 2024

  1. Copy the full SHA
    2685596 View commit details

Commits on Oct 22, 2024

  1. Merge pull request #169 from ErikSzabo/master

    Added ability to disable holder update on item pickup
    WillFP authored Oct 22, 2024
    1
    Copy the full SHA
    1375279 View commit details
  2. Updated to 4.72.1

    WillFP committed Oct 22, 2024
    1
    Copy the full SHA
    76ef325 View commit details
  3. Copy the full SHA
    61dcf59 View commit details

Commits on Oct 30, 2024

  1. Copy the full SHA
    4c96412 View commit details

Commits on Nov 3, 2024

  1. Copy the full SHA
    a1560ca View commit details
  2. Merge pull request #172 from Auxilor/revert-164-master

    Revert "Fixed the wack angular math, use block face its much cleaner in game."
    WillFP authored Nov 3, 2024
    1
    Copy the full SHA
    85213d7 View commit details

Commits on Nov 4, 2024

  1. Update EffectReplantCrops.kt

    This PR fixes an issue whereby if both `consume_seeds` and `only_fully_grown` are true, if a player breaks a non-fully-grown crop, it: breaks the crop, does not replant, drops the seed but ALSO consumes a seed. Meaning for each ungrown crop broken, the player loses a seed each time.
    Exanthiax committed Nov 4, 2024
    Copy the full SHA
    d1608ea View commit details

Commits on Nov 6, 2024

  1. Updated to 4.72.2

    WillFP committed Nov 6, 2024
    Copy the full SHA
    484b051 View commit details

Commits on Nov 26, 2024

  1. Merge pull request #171 from kiriharu/master

    FEAT: Added ability to use `projectile` filter with `headshot` trigger
    WillFP authored Nov 26, 2024
    Copy the full SHA
    404decb View commit details

Commits on Jan 4, 2025

  1. added support for FancyNPCs

    Added support for FancyNPCs.
    "left_click_npc" Trigger
    "right_click_npc" Trigger
    "npc" Filter
    Exanthiax committed Jan 4, 2025
    Copy the full SHA
    e978334 View commit details

Commits on Jan 6, 2025

  1. Merge pull request #177 from Exanthiax/fancynpcs_integration

    added support for FancyNPCs
    WillFP authored Jan 6, 2025
    Copy the full SHA
    6b8f9b7 View commit details

Commits on Jan 18, 2025

  1. Copy the full SHA
    1beb285 View commit details

Commits on Jan 20, 2025

  1. Updated eco

    WillFP committed Jan 20, 2025
    Copy the full SHA
    9bca745 View commit details
  2. Moved to SoundUtils

    WillFP committed Jan 20, 2025
    Copy the full SHA
    2910a90 View commit details
  3. Copy the full SHA
    aad5f70 View commit details
  4. Copy the full SHA
    6a35acb View commit details
  5. Updated to 4.73.0

    WillFP committed Jan 20, 2025
    Copy the full SHA
    7602299 View commit details
  6. Updated to K2 Compiler

    WillFP committed Jan 20, 2025
    Copy the full SHA
    8b7b0f7 View commit details

Commits on Jan 25, 2025

  1. deeper mcmmo integration

    Utilises more of the available events to offer customers/users a more indepth McMMO integration
    Exanthiax committed Jan 25, 2025
    Copy the full SHA
    88ed09b View commit details
Showing with 767 additions and 236 deletions.
  1. +8 −8 build.gradle.kts
  2. +1 −1 core/build.gradle.kts
  3. +0 −1 core/common/build.gradle.kts
  4. +34 −0 core/common/src/main/kotlin/com/willfp/libreforge/EntityRefreshListener.kt
  5. +4 −0 core/common/src/main/kotlin/com/willfp/libreforge/HolderUpdates.kt
  6. +7 −4 core/common/src/main/kotlin/com/willfp/libreforge/LibreforgeSpigotPlugin.kt
  7. +9 −2 core/common/src/main/kotlin/com/willfp/libreforge/Utils.kt
  8. +8 −2 core/common/src/main/kotlin/com/willfp/libreforge/Weighted.kt
  9. +1 −1 core/common/src/main/kotlin/com/willfp/libreforge/commands/CommandPointsGet.kt
  10. +1 −1 core/common/src/main/kotlin/com/willfp/libreforge/commands/CommandPointsGive.kt
  11. +1 −1 core/common/src/main/kotlin/com/willfp/libreforge/commands/CommandPointsSet.kt
  12. +1 −1 core/common/src/main/kotlin/com/willfp/libreforge/commands/CommandPointsTake.kt
  13. +3 −1 core/common/src/main/kotlin/com/willfp/libreforge/commands/CommandTrigger.kt
  14. +2 −2 core/common/src/main/kotlin/com/willfp/libreforge/conditions/impl/ConditionPlaceholderGreaterThan.kt
  15. +2 −2 core/common/src/main/kotlin/com/willfp/libreforge/conditions/impl/ConditionPlaceholderLessThan.kt
  16. +2 −1 core/common/src/main/kotlin/com/willfp/libreforge/counters/bind/BoundCounters.kt
  17. +1 −2 core/common/src/main/kotlin/com/willfp/libreforge/effects/Chain.kt
  18. +1 −0 core/common/src/main/kotlin/com/willfp/libreforge/effects/EffectContext.kt
  19. +2 −1 core/common/src/main/kotlin/com/willfp/libreforge/effects/arguments/impl/ArgumentCooldown.kt
  20. +2 −1 core/common/src/main/kotlin/com/willfp/libreforge/effects/arguments/impl/ArgumentCost.kt
  21. +2 −1 core/common/src/main/kotlin/com/willfp/libreforge/effects/arguments/impl/ArgumentPointCost.kt
  22. +2 −1 core/common/src/main/kotlin/com/willfp/libreforge/effects/arguments/impl/ArgumentPrice.kt
  23. +1 −0 core/common/src/main/kotlin/com/willfp/libreforge/effects/executors/impl/RandomExecutorFactory.kt
  24. +3 −3 core/common/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectAddHolder.kt
  25. +3 −3 core/common/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectAddHolderToVictim.kt
  26. +1 −0 core/common/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectBroadcast.kt
  27. +8 −1 core/common/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectDamageNearbyEntities.kt
  28. +1 −0 core/common/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectDamageTwice.kt
  29. +2 −2 core/common/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectFeatherStep.kt
  30. +2 −2 core/common/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectFlight.kt
  31. +2 −2 core/common/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectKeepInventory.kt
  32. +2 −2 core/common/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectKeepLevel.kt
  33. +2 −3 core/common/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectPlaySound.kt
  34. +2 −2 core/common/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectRapidBows.kt
  35. +7 −7 core/common/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectReplantCrops.kt
  36. +1 −0 core/common/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectRunCommand.kt
  37. +1 −0 core/common/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectRunPlayerCommand.kt
  38. +1 −0 core/common/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectSendMessage.kt
  39. +2 −2 core/common/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectTelekinesis.kt
  40. +1 −1 core/common/src/main/kotlin/com/willfp/libreforge/effects/impl/bossbar/BossBars.kt
  41. +2 −2 core/common/src/main/kotlin/com/willfp/libreforge/effects/templates/ChanceMultiplierEffect.kt
  42. +4 −4 core/common/src/main/kotlin/com/willfp/libreforge/effects/templates/MultiMultiplierEffect.kt
  43. +2 −2 core/common/src/main/kotlin/com/willfp/libreforge/effects/templates/MultiplierEffect.kt
  44. +1 −3 core/common/src/main/kotlin/com/willfp/libreforge/filters/Filter.kt
  45. +2 −14 core/common/src/main/kotlin/com/willfp/libreforge/filters/FilterBlock.kt
  46. +14 −39 core/common/src/main/kotlin/com/willfp/libreforge/filters/Filters.kt
  47. +25 −0 core/common/src/main/kotlin/com/willfp/libreforge/filters/impl/FilterHoneyLevelFull.kt
  48. +20 −0 core/common/src/main/kotlin/com/willfp/libreforge/filters/impl/FilterSheepColor.kt
  49. +18 −0 core/common/src/main/kotlin/com/willfp/libreforge/filters/impl/FilterSwept.kt
  50. +3 −2 core/common/src/main/kotlin/com/willfp/libreforge/integrations/auraskills/AuraSkillsIntegration.kt
  51. +2 −1 core/common/src/main/kotlin/com/willfp/libreforge/integrations/auraskills/impl/ArgumentManaCost.kt
  52. +46 −0 ...mmon/src/main/kotlin/com/willfp/libreforge/integrations/auraskills/impl/ConditionHasSkillLevel.kt
  53. +2 −1 ...common/src/main/kotlin/com/willfp/libreforge/integrations/aureliumskills/impl/ArgumentManaCost.kt
  54. +1 −1 core/common/src/main/kotlin/com/willfp/libreforge/integrations/axenvoy/impl/FilterEnvoyType.kt
  55. +0 −3 ...ain/kotlin/com/willfp/libreforge/integrations/custombiomes/impl/CustomBiomesTerraformGenerator.kt
  56. +21 −0 core/common/src/main/kotlin/com/willfp/libreforge/integrations/fancynpcs/FancyNPCsIntegration.kt
  57. +19 −0 core/common/src/main/kotlin/com/willfp/libreforge/integrations/fancynpcs/impl/FilterNPC.kt
  58. +31 −0 core/common/src/main/kotlin/com/willfp/libreforge/integrations/fancynpcs/impl/TriggerLeftClickNPC.kt
  59. +31 −0 .../common/src/main/kotlin/com/willfp/libreforge/integrations/fancynpcs/impl/TriggerRightClickNPC.kt
  60. +21 −0 core/common/src/main/kotlin/com/willfp/libreforge/integrations/mcmmo/McMMOIntegration.kt
  61. +48 −0 core/common/src/main/kotlin/com/willfp/libreforge/integrations/mcmmo/impl/ConditionHasMcMMOLevel.kt
  62. +40 −0 .../src/main/kotlin/com/willfp/libreforge/integrations/mcmmo/impl/ConditionMcMMOAbilityOnCooldown.kt
  63. +19 −0 core/common/src/main/kotlin/com/willfp/libreforge/integrations/mcmmo/impl/FilterMcMMOAbility.kt
  64. +39 −0 core/common/src/main/kotlin/com/willfp/libreforge/integrations/mcmmo/impl/FilterMcMMOSkill.kt
  65. +32 −0 core/common/src/main/kotlin/com/willfp/libreforge/integrations/mcmmo/impl/TriggerGainMcMMOXp.kt
  66. +32 −0 core/common/src/main/kotlin/com/willfp/libreforge/integrations/mcmmo/impl/TriggerLevelDownMcMMO.kt
  67. +32 −0 core/common/src/main/kotlin/com/willfp/libreforge/integrations/mcmmo/impl/TriggerLevelUpMcMMO.kt
  68. +32 −0 ...mmon/src/main/kotlin/com/willfp/libreforge/integrations/mcmmo/impl/TriggerMcMMOAbilityActivate.kt
  69. +32 −0 ...on/src/main/kotlin/com/willfp/libreforge/integrations/mcmmo/impl/TriggerMcMMOAbilityDeactivate.kt
  70. +1 −0 core/common/src/main/kotlin/com/willfp/libreforge/integrations/paper/impl/EffectSendMinimessage.kt
  71. +1 −1 core/common/src/main/kotlin/com/willfp/libreforge/integrations/vault/impl/EffectGivePermission.kt
  72. +1 −1 core/common/src/main/kotlin/com/willfp/libreforge/integrations/votifier/impl/FilterVoteService.kt
  73. +1 −1 core/common/src/main/kotlin/com/willfp/libreforge/triggers/DispatchedTriggerFactory.kt
  74. +1 −90 core/common/src/main/kotlin/com/willfp/libreforge/triggers/Triggers.kt
  75. +2 −1 core/common/src/main/kotlin/com/willfp/libreforge/triggers/impl/TriggerHeadshot.kt
  76. +11 −0 core/common/src/main/kotlin/com/willfp/libreforge/triggers/impl/TriggerMeleeAttack.kt
  77. +1 −2 core/common/src/main/kotlin/com/willfp/libreforge/triggers/impl/TriggerShearEntity.kt
  78. +6 −1 core/common/src/main/kotlin/com/willfp/libreforge/triggers/impl/TriggerShieldBlock.kt
  79. +2 −0 core/common/src/main/resources/config.yml
  80. +1 −0 core/common/src/main/resources/plugin.yml
  81. +4 −2 core/modern/build.gradle.kts
  82. +2 −0 core/modern/src/main/kotlin/com/willfp/libreforge/proxy/modern/effects/VersionSpecificEffectsImpl.kt
  83. +22 −0 core/modern/src/main/kotlin/com/willfp/libreforge/proxy/modern/effects/impl/EffectScale.kt
  84. +2 −1 gradle.properties
  85. BIN lib/FancyNpcs-2.4.1.jar
  86. BIN lib/Terra-bukkit-6.4.3-BETA+ab60f14ff-shaded.jar
  87. +2 −0 loader/src/main/kotlin/com/willfp/libreforge/loader/internal/LibreforgeLoader.kt
16 changes: 8 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

buildscript {
@@ -6,39 +7,38 @@ buildscript {
}

dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:2.1.0")
}
}

plugins {
java
id("java-library")
id("io.github.goooler.shadow") version "8.1.7"
id("com.gradleup.shadow") version "8.3.5"
id("maven-publish")
}

allprojects {
apply(plugin = "kotlin")
apply(plugin = "java")
apply(plugin = "maven-publish")
apply(plugin = "io.github.goooler.shadow")
apply(plugin = "com.gradleup.shadow")

repositories {
mavenLocal() // TODO: REMOVE
mavenCentral()
mavenLocal()
maven("https://repo.auxilor.io/repository/maven-public/")
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
maven("https://repo.codemc.io/repository/maven-public/")
maven("https://maven.enginehub.org/repo/")
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/")
maven("https://maven.citizensnpcs.co/repo")
maven("https://nexuslite.gcnt.net/repos/other/")
}

dependencies {
compileOnly("org.jetbrains:annotations:23.0.0")
compileOnly("org.jetbrains.kotlin:kotlin-stdlib:1.9.20")
compileOnly(kotlin("stdlib", version = "2.1.0"))

compileOnly(fileTree("lib") { include("*.jar") })
}
@@ -69,8 +69,8 @@ allprojects {
}

withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "17"
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
}
}

2 changes: 1 addition & 1 deletion core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ version = rootProject.version

subprojects {
dependencies {
compileOnly("com.willfp:eco:6.73.0")
compileOnly("com.willfp:eco:6.75.0")
}
}

1 change: 0 additions & 1 deletion core/common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -23,7 +23,6 @@ dependencies {
compileOnly("net.citizensnpcs:citizens-main:2.0.31-SNAPSHOT") {
exclude(group = "net.byteflux", module = "libby-bukkit")
}
compileOnly("com.dfsek.terra:common:6.4.1-BETA+3aef97738")

compileOnly(fileTree("../../lib") {
include("*.jar")
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.willfp.libreforge

import com.willfp.eco.core.EcoPlugin
import org.bukkit.attribute.Attribute
import org.bukkit.attribute.AttributeInstance
import org.bukkit.entity.LivingEntity
import org.bukkit.entity.Player
import org.bukkit.event.EventHandler
import org.bukkit.event.Listener
import org.bukkit.event.world.ChunkLoadEvent

class EntityRefreshListener(
private val plugin: EcoPlugin
) : Listener {

@EventHandler
fun onChunkLoad(event: ChunkLoadEvent) {
event.chunk.entities.filterIsInstance<LivingEntity>()
.filterNot { it is Player }
.forEach { entity ->
removeEcoAttributeModifiers(entity)
}
}

private fun removeEcoAttributeModifiers(entity: LivingEntity) {
for (attribute in Attribute.entries) {
val attributeInstance: AttributeInstance = entity.getAttribute(attribute) ?: continue

attributeInstance.modifiers
.filter { modifier -> modifier.name.matches(Regex("\\d+_\\d+")) }
.forEach { modifier -> attributeInstance.removeModifier(modifier) }
}
}
}
Original file line number Diff line number Diff line change
@@ -29,6 +29,10 @@ class ItemRefreshListener(

@EventHandler(priority = EventPriority.LOWEST)
fun onItemPickup(event: EntityPickupItemEvent) {
if (!plugin.configYml.getBool("refresh.pickup.enabled")) {
return
}

if (plugin.configYml.getBool("refresh.pickup.require-meta")) {
if (!event.item.itemStack.hasItemMeta()) {
return
Original file line number Diff line number Diff line change
@@ -19,9 +19,9 @@ import com.willfp.libreforge.integrations.auraskills.AuraSkillsIntegration
import com.willfp.libreforge.integrations.aureliumskills.AureliumSkillsIntegration
import com.willfp.libreforge.integrations.axenvoy.AxEnvoyIntegration
import com.willfp.libreforge.integrations.citizens.CitizensIntegration
import com.willfp.libreforge.integrations.votifier.VotifierIntegration
import com.willfp.libreforge.integrations.custombiomes.impl.CustomBiomesTerra
import com.willfp.libreforge.integrations.custombiomes.impl.CustomBiomesTerraformGenerator
import com.willfp.libreforge.integrations.fancynpcs.FancyNPCsIntegration
import com.willfp.libreforge.integrations.jobs.JobsIntegration
import com.willfp.libreforge.integrations.levelledmobs.LevelledMobsIntegration
import com.willfp.libreforge.integrations.mcmmo.McMMOIntegration
@@ -31,6 +31,7 @@ import com.willfp.libreforge.integrations.scyther.ScytherIntegration
import com.willfp.libreforge.integrations.tab.TabIntegration
import com.willfp.libreforge.integrations.tmmobcoins.TMMobcoinsIntegration
import com.willfp.libreforge.integrations.vault.VaultIntegration
import com.willfp.libreforge.integrations.votifier.VotifierIntegration
import com.willfp.libreforge.integrations.worldguard.WorldGuardIntegration
import com.willfp.libreforge.levels.LevelTypes
import com.willfp.libreforge.levels.placeholder.*
@@ -169,7 +170,8 @@ class LibreforgeSpigotPlugin : EcoPlugin() {
override fun loadListeners(): List<Listener> {
val listeners = mutableListOf(
EffectDataFixer,
ItemRefreshListener(this)
ItemRefreshListener(this),
EntityRefreshListener(this)
)

if (Prerequisite.HAS_PAPER.isMet) {
@@ -195,8 +197,9 @@ class LibreforgeSpigotPlugin : EcoPlugin() {
IntegrationLoader("Terra") { CustomBiomesTerra.load(this) },
IntegrationLoader("TerraformGenerator") { CustomBiomesTerraformGenerator.load(this) },
IntegrationLoader("AxEnvoy") { AxEnvoyIntegration.load(this) },
IntegrationLoader("Votifier") { VotifierIntegration.load(this)},
IntegrationLoader("ModelEngine") { ModelEngineIntegration.load(this) }
IntegrationLoader("Votifier") { VotifierIntegration.load(this) },
IntegrationLoader("ModelEngine") { ModelEngineIntegration.load(this) },
IntegrationLoader("FancyNpcs") { FancyNPCsIntegration.load(this) }
)
}

11 changes: 9 additions & 2 deletions core/common/src/main/kotlin/com/willfp/libreforge/Utils.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.willfp.libreforge

import com.willfp.eco.core.items.Items
import com.willfp.eco.util.namespacedKeyOf
import com.willfp.libreforge.proxy.Proxy
import com.willfp.libreforge.proxy.loadProxy
import org.bukkit.Bukkit
@@ -93,8 +94,14 @@ fun ItemStack.applyDamage(damage: Int, player: Player?): Boolean {
}

// 1.21 compat
fun getEnchantment(id: String): Enchantment? =
Enchantment.getByKey(NamespacedKey.minecraft(id))
fun getEnchantment(id: String): Enchantment? {
if (id.contains(':')) {
val key = namespacedKeyOf(id)
return Enchantment.getByKey(key)
} else {
return Enchantment.getByKey(NamespacedKey.minecraft(id))
}
}

@Proxy("OpenInventoryAccessorImpl")
interface OpenInventoryAccessor {
10 changes: 8 additions & 2 deletions core/common/src/main/kotlin/com/willfp/libreforge/Weighted.kt
Original file line number Diff line number Diff line change
@@ -11,17 +11,23 @@ data class WeightedItems(
override val weight: Double
) : Weighted

class WeightedList<T : Weighted>(
open class WeightedList<T : Weighted>(
list: List<T>
) : DelegatedList<T>(list) {
fun random() = this.randomOrNull() ?: throw NoSuchElementException("List is empty")

fun randomOrNull(): T? {
if (this.isEmpty()) {
return null
}

val totalWeight = this.sumOf { it.weight }
val random = Math.random() * totalWeight
if (totalWeight == 0.0) {
val randomIndex = (Math.random() * this.size).toInt()
return this[randomIndex]
}

val random = Math.random() * totalWeight
var current = 0.0
for (item in this) {
current += item.weight
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ internal class CommandPointsGet(plugin: EcoPlugin): Subcommand(

val player = Bukkit.getPlayer(playerString)

if (player == null && playerString.equals("global", ignoreCase = true)) {
if (player == null && !playerString.equals("global", ignoreCase = true)) {
sender.sendMessage(plugin.langYml.getMessage("invalid-player"))
return
}
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ internal class CommandPointsGive(plugin: EcoPlugin): Subcommand(

val player = Bukkit.getPlayer(playerString)

if (player == null && playerString.equals("global", ignoreCase = true)) {
if (player == null && !playerString.equals("global", ignoreCase = true)) {
sender.sendMessage(plugin.langYml.getMessage("invalid-player"))
return
}
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ internal class CommandPointsSet(plugin: EcoPlugin): Subcommand(

val player = Bukkit.getPlayer(playerString)

if (player == null && playerString.equals("global", ignoreCase = true)) {
if (player == null && !playerString.equals("global", ignoreCase = true)) {
sender.sendMessage(plugin.langYml.getMessage("invalid-player"))
return
}
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ internal class CommandPointsTake(plugin: EcoPlugin): Subcommand(

val player = Bukkit.getPlayer(playerString)

if (player == null && playerString.equals("global", ignoreCase = true)) {
if (player == null && !playerString.equals("global", ignoreCase = true)) {
sender.sendMessage(plugin.langYml.getMessage("invalid-player"))
return
}
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ package com.willfp.libreforge.commands

import com.willfp.eco.core.EcoPlugin
import com.willfp.eco.core.command.impl.Subcommand
import com.willfp.eco.util.formatEco
import com.willfp.libreforge.Dispatcher
import com.willfp.libreforge.GlobalDispatcher
import com.willfp.libreforge.get
@@ -62,7 +63,8 @@ internal class CommandTrigger(
return
}

val value = args.getOrNull(2)?.toDoubleOrNull()
val value = args.getOrNull(2)?.formatEco(Bukkit.getPlayer(dispatcherName), true)
?.toDoubleOrNull()

for (dispatcher in dispatchers) {
TriggerGroupCustom.create(trigger).dispatch(
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ object ConditionPlaceholderGreaterThan : Condition<NoCompileData>("placeholder_g
): Boolean {
val player = dispatcher.get<Player>()

return (config.getFormattedString("placeholder", placeholderContext(player = player))
.toDoubleOrNull() ?: 0.0) > config.getDoubleFromExpression("value", player)
return (config.getDoubleFromExpression("placeholder", placeholderContext(player = player))) >=
config.getDoubleFromExpression("value", placeholderContext(player = player))
}
}
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ object ConditionPlaceholderLessThan : Condition<NoCompileData>("placeholder_less
): Boolean {
val player = dispatcher.get<Player>()

return (config.getFormattedString("placeholder", placeholderContext(player = player))
.toDoubleOrNull() ?: 0.0) < config.getDoubleFromExpression("value", player)
return (config.getDoubleFromExpression("placeholder", placeholderContext(player = player))) <
config.getDoubleFromExpression("value", placeholderContext(player = player))
}
}
Original file line number Diff line number Diff line change
@@ -3,12 +3,13 @@ package com.willfp.libreforge.counters.bind
import com.willfp.eco.core.map.listMap
import com.willfp.libreforge.counters.Accumulator
import com.willfp.libreforge.counters.Counter
import net.kyori.adventure.chat.ChatType.Bound

internal object BoundCounters {
private val bindings = listMap<Counter, BoundCounter>()

fun bind(counter: Counter, accumulator: Accumulator) {
bindings[counter] += BoundCounter(counter, accumulator)
bindings[counter].add(BoundCounter(counter, accumulator))
}

fun unbind(counter: Counter) {
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.willfp.libreforge.effects

import com.willfp.libreforge.DelegatedList
import com.willfp.libreforge.Dispatcher
import com.willfp.libreforge.WeightedList
import com.willfp.libreforge.effects.executors.ChainExecutor
@@ -18,7 +17,7 @@ import org.bukkit.entity.Player
class Chain internal constructor(
effects: WeightedList<ChainElement<*>>,
private val executor: ChainExecutor
) : DelegatedList<ChainElement<*>>(
) : WeightedList<ChainElement<*>>(
effects.sortedBy {
it.runOrder.weight
}
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@ import com.willfp.libreforge.mutators.MutatorList
* EffectContext exists in order to abstract out some compile logic between
* element compilation and rich chain compilation.
*/
@ConsistentCopyVisibility
data class EffectContext internal constructor(
val arguments: EffectArgumentList,
val conditions: ConditionList,
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ package com.willfp.libreforge.effects.arguments.impl

import com.willfp.eco.core.config.interfaces.Config
import com.willfp.eco.util.PlayerUtils
import com.willfp.eco.util.SoundUtils
import com.willfp.eco.util.StringUtils
import com.willfp.eco.util.formatEco
import com.willfp.libreforge.ConfigurableElement
@@ -79,7 +80,7 @@ object ArgumentCooldown : EffectArgument<Chain?>("cooldown") {
if (plugin.configYml.getBool("cooldown.sound.enabled")) {
player.playSound(
player.location,
Sound.valueOf(plugin.configYml.getString("cooldown.sound.sound").uppercase()),
SoundUtils.getSound(plugin.configYml.getString("cooldown.sound.sound"))!!,
1.0f,
plugin.configYml.getDouble("cooldown.sound.pitch").toFloat()
)
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ package com.willfp.libreforge.effects.arguments.impl
import com.willfp.eco.core.integrations.economy.balance
import com.willfp.eco.util.NumberUtils
import com.willfp.eco.util.PlayerUtils
import com.willfp.eco.util.SoundUtils
import com.willfp.eco.util.StringUtils
import com.willfp.libreforge.ConfigurableElement
import com.willfp.libreforge.NoCompileData
@@ -42,7 +43,7 @@ object ArgumentCost : EffectArgument<NoCompileData>("cost") {
if (plugin.configYml.getBool("cannot-afford.sound.enabled")) {
player.playSound(
player.location,
Sound.valueOf(plugin.configYml.getString("cannot-afford.sound.sound").uppercase()),
SoundUtils.getSound(plugin.configYml.getString("cannot-afford.sound.sound"))!!,
1.0f,
plugin.configYml.getDouble("cannot-afford.sound.pitch").toFloat()
)
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ package com.willfp.libreforge.effects.arguments.impl

import com.willfp.eco.util.NumberUtils
import com.willfp.eco.util.PlayerUtils
import com.willfp.eco.util.SoundUtils
import com.willfp.eco.util.StringUtils
import com.willfp.libreforge.ConfigurableElement
import com.willfp.libreforge.NoCompileData
@@ -48,7 +49,7 @@ object ArgumentPointCost : EffectArgument<NoCompileData>("point_cost") {
if (plugin.configYml.getBool("cannot-afford-type.sound.enabled")) {
player.playSound(
player.location,
Sound.valueOf(plugin.configYml.getString("cannot-afford-type.sound.sound").uppercase()),
SoundUtils.getSound(plugin.configYml.getString("cannot-afford-type.sound.sound"))!!,
1.0f,
plugin.configYml.getDouble("cannot-afford-type.sound.pitch").toFloat()
)
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ package com.willfp.libreforge.effects.arguments.impl
import com.willfp.eco.core.price.Prices
import com.willfp.eco.util.NumberUtils
import com.willfp.eco.util.PlayerUtils
import com.willfp.eco.util.SoundUtils
import com.willfp.eco.util.StringUtils
import com.willfp.libreforge.ConfigurableElement
import com.willfp.libreforge.NoCompileData
@@ -76,7 +77,7 @@ object ArgumentPrice : EffectArgument<NoCompileData>("price") {
if (plugin.configYml.getBool("cannot-afford-price.sound.enabled")) {
player.playSound(
player.location,
Sound.valueOf(plugin.configYml.getString("cannot-afford-price.sound.sound").uppercase()),
SoundUtils.getSound(plugin.configYml.getString("cannot-afford-price.sound.sound"))!!,
1.0f,
plugin.configYml.getDouble("cannot-afford-price.sound.pitch").toFloat()
)
Loading