This commit is contained in:
AverageGithub 2024-07-19 14:29:41 +02:00
parent f96668a838
commit 4dc876593e
7 changed files with 11 additions and 27 deletions

View File

@ -18,11 +18,11 @@ data class ChunkPos(val world: World, val x: Int, val z: Int, @Volatile @JvmFiel
}
fun setTicking(ticking: Boolean) {
this.ticking = ticking
minions.forEach {
it.setTicking(true)
}
this.ticking = ticking
}
override fun toString(): String {

View File

@ -7,7 +7,7 @@ plugins {
}
group = 'com.artillexstudios.axminions'
version = '1.0.11'
version = '1.0.12'
repositories {
mavenCentral()
@ -138,7 +138,7 @@ allprojects {
compileOnly 'com.github.LoneDev6:api-itemsadder:3.6.1'
compileOnly 'com.palmergames.bukkit.towny:towny:0.100.1.0'
implementation platform('com.intellectualsites.bom:bom-newest:1.35')
implementation("com.artillexstudios.axapi:axapi:1.4.269:all")
implementation("com.artillexstudios.axapi:axapi:1.4.295:all")
implementation("com.zaxxer:HikariCP:5.1.0")
implementation("org.bstats:bstats-bukkit:3.0.2")
compileOnly 'org.black_ixx:playerpoints:3.2.6'

View File

@ -54,9 +54,9 @@ class AxMinionsPlugin : AxPlugin() {
init {
val manager = BukkitLibraryManager(this)
val stdLib = Library.builder().groupId("org{}jetbrains{}kotlin").artifactId("kotlin-stdlib").version("1.9.22")
.relocate("org{}jetbrains{}kotlin", "com{}artillexstudios{}axminions{}libs{}kotlin").build()
.relocate("org{}jetbrains{}kotlin", "com.artillexstudios.axminions.libs.kotlin").build()
val h2 = Library.builder().groupId("com{}h2database").artifactId("h2").version("2.2.220")
.relocate("org{}h2", "com{}artillexstudios{}axminions{}libs{}h2").build()
.relocate("org{}h2", "com.artillexstudios.axminions.libs.h2").build()
manager.addMavenCentral()
manager.loadLibrary(stdLib)
manager.loadLibrary(h2)
@ -138,7 +138,7 @@ class AxMinionsPlugin : AxPlugin() {
MinionTicker.startTicking()
Scheduler.get().runTimer({
Scheduler.get().runTimer({ task ->
dataQueue.submit {
Minions.get {
it.fastFor { pos ->

View File

@ -62,22 +62,6 @@ class AxMinionsCommand {
AxMinionsPlugin.config.getConfig().save()
}
@Subcommand("reset")
@CommandPermission("axminions.command.reset")
@Description("Reset player's minion")
@AutoComplete("*")
fun reset(
sender: CommandSender,
receiver: Player
) {
AxMinionsAPI.INSTANCE.getMinions().fastFor {
if (it.getOwnerUUID() == receiver.uniqueId) {
it.remove()
}
}
}
@Subcommand("reload")
@CommandPermission("axminions.command.reload")
@Description("Reload the configurations of the plugin")

View File

@ -29,7 +29,7 @@ class MinionDamageListener : Listener {
)
event.minion.setStorage(coerced)
Scheduler.get().runLaterAt(event.target.location, {
Scheduler.get().runLaterAt(event.target.location, { task ->
event.target.location.world!!.getNearbyEntities(event.target.location, 4.0, 4.0, 4.0)
.filterIsInstance<Item>().fastFor { item ->
if (event.minion.getLinkedInventory()?.firstEmpty() == -1) {

View File

@ -126,7 +126,7 @@ class Minion(
broken.set(true)
}
Scheduler.get().runAt(location) {
Scheduler.get().runAt(location) { task ->
val canBuildAt = AxMinionsPlugin.integrations.getProtectionIntegration().canBuildAt(
event.player,
event.packetEntity.location()
@ -653,7 +653,7 @@ class Minion(
if (linkedChest == null) return
if (ticking) {
Scheduler.get().runAt(linkedChest) {
Scheduler.get().executeAt(linkedChest) {
if (linkedChest!!.world!!.isChunkLoaded(linkedChest!!.blockX shr 4, linkedChest!!.blockZ shr 4)) {
linkedInventory = (linkedChest?.block?.state as? Container)?.inventory
}

View File

@ -175,7 +175,7 @@ class MinerMinionType : MinionType("miner", AxMinionsPlugin.INSTANCE.getResource
}
if (canBreak) {
Scheduler.get().run {
Scheduler.get().run { task ->
val block = location.block
val drops = block.getDrops(minion.getTool())
xp += NMSHandler.get().getExp(block, minion.getTool() ?: return@run)