Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Commit

Permalink
chore: Move collectPrefabs and deepInstance into Geary
Browse files Browse the repository at this point in the history
fix: Mark entities with SetMythicMob as CustomMob
fix: Apply NMS plugin in root project (seems otherwise some classes aren't found, perhaps referencing wrong MC version?)
  • Loading branch information
0ffz committed Apr 10, 2024
1 parent 6e8aa12 commit 882dc4a
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 43 deletions.
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
alias(idofrontLibs.plugins.mia.kotlin.jvm)
alias(idofrontLibs.plugins.kotlinx.serialization)
alias(idofrontLibs.plugins.mia.papermc)
alias(idofrontLibs.plugins.mia.nms)
alias(idofrontLibs.plugins.mia.copyjar)
alias(idofrontLibs.plugins.mia.publication)
alias(idofrontLibs.plugins.mia.testing)
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
gearyPaper = "0.30.1-dev.5"
gearyPaper = "0.30.1-dev.9"

[libraries]
geary-papermc = { module = "com.mineinabyss:geary-papermc", version.ref = "gearyPaper" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.mineinabyss.mobzy.mythicmobs.spawning

import com.mineinabyss.geary.autoscan.AutoScan
import com.mineinabyss.geary.modules.GearyModule
import com.mineinabyss.geary.papermc.tracking.entities.components.CustomMob
import com.mineinabyss.geary.systems.builders.listener
import com.mineinabyss.geary.systems.query.ListenerQuery

@AutoScan
fun GearyModule.markMMAsCustomMob() = listener(
object : ListenerQuery() {
val mobType by get<SetMythicMob>()
override fun ensure() = event.anySet(::mobType)
}
).exec {
entity.add<CustomMob>()
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.mineinabyss.mobzy.spawning
import com.mineinabyss.geary.datatypes.GearyEntity
import com.mineinabyss.geary.helpers.fastForEach
import com.mineinabyss.geary.papermc.tracking.entities.toGearyOrNull
import com.mineinabyss.mobzy.spawning.conditions.collectPrefabs
import org.bukkit.Chunk

class PlayerSpawnInfo {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import com.mineinabyss.geary.systems.builders.listener
import com.mineinabyss.geary.systems.query.ListenerQuery
import com.mineinabyss.idofront.serialization.IntRangeSerializer
import com.mineinabyss.idofront.util.randomOrMin
import com.mineinabyss.mobzy.spawning.conditions.collectPrefabs
import com.mineinabyss.mobzy.spawning.event.MobzySpawnEvent
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
Expand Down Expand Up @@ -155,7 +154,7 @@ fun GearyModule.spawnRequestListener() = listener(object : ListenerQuery() {
} else {
ensureSuitableLocationOrNull(
chosenLoc,
(boundingBox?.clone()?.shift(chosenLoc)) ?: BoundingBox.of(chosenLoc.toVector(), 1.0, 2.0, 1.0)
(boundingBox.clone().shift(chosenLoc))
) ?: return@repeat
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.mineinabyss.mobzy.spawning.event
import com.mineinabyss.mobzy.spawning.SpawnPosition
import com.mineinabyss.mobzy.spawning.mobzySpawning
import org.bukkit.Chunk
import org.bukkit.Material
import org.bukkit.block.Block
import org.bukkit.entity.Entity
import kotlin.math.min
Expand Down Expand Up @@ -72,7 +73,7 @@ class SpawnStrip {
}

SpawnPosition.WATER -> if (!block.isLiquid) return null
SpawnPosition.AIR -> if (block.isSolid) return null
SpawnPosition.AIR -> if (block.type != Material.AIR) return null
}

return block
Expand Down
8 changes: 0 additions & 8 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ pluginManagement {
google()
mavenLocal()
}

val idofrontVersion: String by settings
resolutionStrategy {
eachPlugin {
if (requested.id.id.startsWith("com.mineinabyss.conventions"))
useVersion(idofrontVersion)
}
}
}

dependencyResolutionManagement {
Expand Down

0 comments on commit 882dc4a

Please sign in to comment.