From 2243f48ff862f49281608f3d1e7aa2eaf999ac0b Mon Sep 17 00:00:00 2001 From: Liliesh Date: Sat, 6 Dec 2025 10:39:13 +0100 Subject: [PATCH] Added stuff --- .idea/vcs.xml | 6 ++++++ .../world/pinkhaj/boxOfMeow/BoxOfMeow.kt | 5 +++-- .../boxOfMeow/modules/PreventMobGriefing.kt | 19 +++++++++++++++++++ .../{other => }/sounds/ChatNotification.kt | 2 +- 4 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 .idea/vcs.xml create mode 100644 src/main/kotlin/world/pinkhaj/boxOfMeow/modules/PreventMobGriefing.kt rename src/main/kotlin/world/pinkhaj/boxOfMeow/{other => }/sounds/ChatNotification.kt (92%) diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/main/kotlin/world/pinkhaj/boxOfMeow/BoxOfMeow.kt b/src/main/kotlin/world/pinkhaj/boxOfMeow/BoxOfMeow.kt index a3430fe..03bb146 100644 --- a/src/main/kotlin/world/pinkhaj/boxOfMeow/BoxOfMeow.kt +++ b/src/main/kotlin/world/pinkhaj/boxOfMeow/BoxOfMeow.kt @@ -1,9 +1,9 @@ package world.pinkhaj.boxOfMeow -import org.bukkit.configuration.file.FileConfiguration import org.bukkit.plugin.java.JavaPlugin +import world.pinkhaj.boxOfMeow.modules.PreventMobGriefing import world.pinkhaj.boxOfMeow.other.ConsoleColor -import world.pinkhaj.boxOfMeow.other.sounds.ChatNotification +import world.pinkhaj.boxOfMeow.sounds.ChatNotification class BoxOfMeow : JavaPlugin() { val fileConfiguration = this.config @@ -20,5 +20,6 @@ class BoxOfMeow : JavaPlugin() { fun registerEvents() { this.server.pluginManager.registerEvents(ChatNotification(), this) + this.server.pluginManager.registerEvents(PreventMobGriefing(this), this) } } diff --git a/src/main/kotlin/world/pinkhaj/boxOfMeow/modules/PreventMobGriefing.kt b/src/main/kotlin/world/pinkhaj/boxOfMeow/modules/PreventMobGriefing.kt new file mode 100644 index 0000000..5db028c --- /dev/null +++ b/src/main/kotlin/world/pinkhaj/boxOfMeow/modules/PreventMobGriefing.kt @@ -0,0 +1,19 @@ +package world.pinkhaj.boxOfMeow.modules + +import org.bukkit.entity.EntityType +import org.bukkit.event.EventHandler +import org.bukkit.event.Listener +import org.bukkit.event.entity.ExplosionPrimeEvent +import world.pinkhaj.boxOfMeow.BoxOfMeow + +class PreventMobGriefing(val main: BoxOfMeow): Listener { + val configPrefix = "PreventMobGriefing" + + @EventHandler + fun PreventExplosion(e: ExplosionPrimeEvent) { + if (main.config.getBoolean(configPrefix + "." + e.entityType.name)) { + e.radius = 0.0f + e.fire = false + } + } +} \ No newline at end of file diff --git a/src/main/kotlin/world/pinkhaj/boxOfMeow/other/sounds/ChatNotification.kt b/src/main/kotlin/world/pinkhaj/boxOfMeow/sounds/ChatNotification.kt similarity index 92% rename from src/main/kotlin/world/pinkhaj/boxOfMeow/other/sounds/ChatNotification.kt rename to src/main/kotlin/world/pinkhaj/boxOfMeow/sounds/ChatNotification.kt index 8823c86..5bdd3d9 100644 --- a/src/main/kotlin/world/pinkhaj/boxOfMeow/other/sounds/ChatNotification.kt +++ b/src/main/kotlin/world/pinkhaj/boxOfMeow/sounds/ChatNotification.kt @@ -1,4 +1,4 @@ -package world.pinkhaj.boxOfMeow.other.sounds +package world.pinkhaj.boxOfMeow.sounds import io.papermc.paper.event.player.AsyncChatEvent import org.bukkit.Bukkit