aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/kotlin/dulkirmod/features/MemoryLeakFix.kt7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/kotlin/dulkirmod/features/MemoryLeakFix.kt b/src/main/kotlin/dulkirmod/features/MemoryLeakFix.kt
index 0bf768f..0c7fcb9 100644
--- a/src/main/kotlin/dulkirmod/features/MemoryLeakFix.kt
+++ b/src/main/kotlin/dulkirmod/features/MemoryLeakFix.kt
@@ -34,12 +34,13 @@ object MemoryLeakFix {
}
fun clearBlankStands() {
+ if (!DulkirConfig.blankStandRemoval) return
val world = mc.theWorld ?: return
val currentEnts = world.loadedEntityList
currentEnts.forEach {
- if (it !is EntityArmorStand) return
- if (it.name != "Armor Stand") return
- if (it.inventory.any{slot -> slot != null}) return
+ if (it !is EntityArmorStand) return@forEach
+ if (it.name != "Armor Stand") return@forEach
+ if (it.inventory.any{slot -> slot != null}) return@forEach
world.removeEntityFromWorld(it.entityId)
}
}