From 9d15add89d0db9055a257e42769a7e6fcb96df5c Mon Sep 17 00:00:00 2001 From: Illyrius Date: Tue, 4 Nov 2025 10:11:07 +0100 Subject: [PATCH 1/2] init Signed-off-by: Illyrius --- .../org/xodium/vanillaplus/modules/EntityModule.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/kotlin/org/xodium/vanillaplus/modules/EntityModule.kt b/src/main/kotlin/org/xodium/vanillaplus/modules/EntityModule.kt index d13c3e6b0..49c9b135b 100644 --- a/src/main/kotlin/org/xodium/vanillaplus/modules/EntityModule.kt +++ b/src/main/kotlin/org/xodium/vanillaplus/modules/EntityModule.kt @@ -2,11 +2,15 @@ package org.xodium.vanillaplus.modules +import org.bukkit.Material import org.bukkit.entity.* import org.bukkit.event.EventHandler import org.bukkit.event.entity.EntityChangeBlockEvent +import org.bukkit.event.entity.EntityDeathEvent import org.bukkit.event.entity.EntityExplodeEvent +import org.bukkit.inventory.ItemStack import org.xodium.vanillaplus.interfaces.ModuleInterface +import kotlin.random.Random /** Represents a module handling entity mechanics within the system. */ internal class EntityModule : ModuleInterface { @@ -24,6 +28,14 @@ internal class EntityModule : ModuleInterface { if (shouldCancelGrief(event.entity)) event.blockList().clear() } + @EventHandler + fun on(event: EntityDeathEvent) { + if (!enabled() || event.entity.killer == null) return + if (Random.nextDouble() <= config.entityEggDropChance) { + event.drops.add(ItemStack.of(Material.matchMaterial("${event.entity.type.name}_SPAWN_EGG") ?: return)) + } + } + /** * Determines whether an entity's griefing behaviour should be cancelled based on configuration settings. * @param entity The entity whose griefing behaviour is being evaluated. @@ -49,5 +61,6 @@ internal class EntityModule : ModuleInterface { var disableEndermanGrief: Boolean = true, var disableGhastGrief: Boolean = true, var disableWitherGrief: Boolean = true, + var entityEggDropChance: Double = 0.1, ) : ModuleInterface.Config } From 2db347caa485ddf4a7babb131c0e2bc541774d7c Mon Sep 17 00:00:00 2001 From: Illyrius Date: Tue, 4 Nov 2025 10:23:54 +0100 Subject: [PATCH 2/2] docs(pr): update pull request template Signed-off-by: Illyrius --- .github/pull_request_template.md | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index f4be4eae2..7424ad4c3 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,6 +1,6 @@ ## Description - + ## How Has This Been Tested? @@ -10,18 +10,3 @@ - [ ] Integration tests - [ ] Manual testing - [ ] Other (please describe) - -## Checklist: - -- [ ] Follow style guidelines of this project. -- [ ] Perform self-review of the code. -- [ ] Comment on hard-to-understand areas. -- [ ] Update documentation accordingly. -- [ ] Ensure changes generate no new warnings. -- [ ] Add tests proving the fix is effective, or the feature works. -- [ ] Verify new and existing unit tests pass locally. -- [ ] Ensure dependent changes are merged and published. - -## Additional context: - - \ No newline at end of file