Skip to content

Commit

Permalink
chore: bump idofront
Browse files Browse the repository at this point in the history
  • Loading branch information
Boy0000 committed Jul 11, 2024
1 parent c4f7863 commit 57f757a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 18 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
group=com.mineinabyss
version=1.11
idofrontVersion=0.24.6
idofrontVersion=0.24.12
21 changes: 7 additions & 14 deletions src/main/kotlin/com/mineinabyss/bonfire/BonfireCommands.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,20 @@ import com.mineinabyss.geary.papermc.datastore.remove
import com.mineinabyss.geary.papermc.tracking.entities.toGeary
import com.mineinabyss.geary.papermc.tracking.entities.toGearyOrNull
import com.mineinabyss.geary.serialization.setPersisting
import com.mineinabyss.idofront.commands.arguments.intArg
import com.mineinabyss.idofront.commands.arguments.offlinePlayerArg
import com.mineinabyss.idofront.commands.arguments.stringArg
import com.mineinabyss.idofront.commands.brigadier.IdoCommandContext
import com.mineinabyss.idofront.commands.brigadier.commands
import com.mineinabyss.idofront.commands.execution.IdofrontCommandExecutor
import com.mineinabyss.idofront.commands.extensions.actions.playerAction
import com.mineinabyss.idofront.messaging.error
import com.mineinabyss.idofront.messaging.info
import com.mineinabyss.idofront.messaging.success
import com.mineinabyss.idofront.nms.nbt.editOfflinePDC
import com.mineinabyss.idofront.nms.nbt.getOfflinePDC
import com.mineinabyss.idofront.nms.nbt.saveOfflinePDC
import com.mineinabyss.idofront.util.to
import com.mineinabyss.idofront.plugin.actions
import com.mojang.brigadier.arguments.StringArgumentType
import io.papermc.paper.command.brigadier.argument.ArgumentTypes
import org.bukkit.Bukkit
import org.bukkit.Location
import org.bukkit.OfflinePlayer
import org.bukkit.command.Command
import org.bukkit.command.CommandSender
import org.bukkit.command.TabCompleter
import org.bukkit.entity.ItemDisplay
import org.bukkit.entity.Player

Expand Down Expand Up @@ -62,11 +53,6 @@ object BonfireCommands {
}
}
"players" {
val location by ArgumentTypes.blockPosition().suggests {
(context.source.executor as? Player)?.location?.let {
suggestFiltering("${it.blockX} ${it.blockY} ${it.blockZ}")
}
}
fun IdoCommandContext.runPlayersCommand(location: Location) {
val bonfireLoc = location.toBlockCenterLocation()
val (x,y,z) = bonfireLoc.blockX to bonfireLoc.blockY to bonfireLoc.blockZ
Expand All @@ -82,6 +68,13 @@ object BonfireCommands {
} ?: sender.error("Could not find bonfire at $x $y $z")
}
}

executes { context.source.executor?.location?.let { runPlayersCommand(it) } }
val location by ArgumentTypes.blockPosition().suggests {
(context.source.executor as? Player)?.location?.let {
suggestFiltering("${it.blockX} ${it.blockY} ${it.blockZ}")
}
}
executes { runPlayersCommand(location()?.resolve(context.source)?.toLocation(context.source.location.world)!!) }
val world by ArgumentTypes.world().suggests {
suggest(Bukkit.getWorlds().map { it.key.asString() })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ fun ItemDisplay.updateBonfireState() {
when {// Set the base-furniture item to the correct state
bonfire.bonfirePlayers.isEmpty() -> {
this.brightness = toGearyOrNull()?.get<BlockyFurniture>()?.properties?.brightness
gearyItems.createItem(bonfire.states.unlit)?.let { itemStack = it }
gearyItems.createItem(bonfire.states.unlit)?.let { setItemStack(it) }
}
else -> {
this.brightness = Display.Brightness(15, 15)
gearyItems.createItem(bonfire.states.lit)?.let { itemStack = it }
gearyItems.createItem(bonfire.states.lit)?.let { setItemStack(it) }

// Set state via packets to 'set' for all online players currently at the bonfire
val stateItem = gearyItems.createItem(bonfire.states.set) ?: return
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/paper-plugin.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Bonfire
version: "${plugin_version}"
main: com.mineinabyss.bonfire.BonfirePlugin
api-version: "1.20"
api-version: "1.21"
authors: [ boy0000, Scyu_, Norazan, Ru_Kira ]

permissions:
Expand Down

0 comments on commit 57f757a

Please sign in to comment.