Skip to content

Commit

Permalink
Check for prefabs not PrefabKey
Browse files Browse the repository at this point in the history
  • Loading branch information
0ffz committed Dec 5, 2023
1 parent b9e3af7 commit 80b892b
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.mineinabyss.geary.datatypes.GearyEntity
import com.mineinabyss.geary.helpers.toGeary
import com.mineinabyss.geary.papermc.gearyPaper
import com.mineinabyss.geary.papermc.tracking.entities.toGeary
import com.mineinabyss.geary.papermc.tracking.entities.toGearyOrNull
import com.mineinabyss.geary.prefabs.PrefabKey
import com.mineinabyss.geary.prefabs.helpers.prefabs
import com.mineinabyss.idofront.commands.Command
Expand All @@ -29,8 +30,9 @@ fun Command.query() {
val types = query.split("+")

for (world in worlds) for (entity in world.entities) {
val geary = entity.toGeary()
if (!geary.has<PrefabKey>()) continue
val geary = entity.toGearyOrNull() ?: continue
// Only select entities that are instanced from a prefab
if (geary.prefabs.isEmpty()) continue

if (types.any { type ->
fun excludeDefault() = entity.customName() == null
Expand Down

0 comments on commit 80b892b

Please sign in to comment.