Skip to content

Commit

Permalink
chore: update ascend & stacked
Browse files Browse the repository at this point in the history
  • Loading branch information
TheFruxz committed Oct 8, 2022
1 parent 48ae430 commit 7419fec
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ repositories {
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/") // PlaceholderAPI
}

val ascendVersion = "1.0.0-RC4b"
val stackedVersion = "1.0.0-RC2"
val ascendVersion = "1.0.0"
val stackedVersion = "1.0.0"

dependencies {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package de.fruxz.sparkle.framework.extension.scoreboard

import de.fruxz.ascend.extension.container.takeOrEmpty
import de.fruxz.sparkle.framework.extension.offlinePlayer
import org.bukkit.OfflinePlayer
import org.bukkit.entity.Player
Expand All @@ -13,7 +14,7 @@ import org.bukkit.scoreboard.Team
* @since 1.0
*/
val Team?.entriesAsOfflinePlayer: List<OfflinePlayer>
get() = this?.entries?.map { offlinePlayer(it) } ?: emptyList()
get() = this?.entries?.map { offlinePlayer(it) }.takeOrEmpty()

/**
* This value returns every entry from the [entriesAsOfflinePlayer] function, mapped to a [Player] object.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package de.fruxz.sparkle.framework.visual.item

import de.fruxz.ascend.extension.container.takeOrEmpty
import de.fruxz.ascend.extension.data.buildRandomTag
import de.fruxz.ascend.extension.forceCast
import de.fruxz.ascend.extension.objects.takeIfInstance
Expand Down Expand Up @@ -84,7 +85,7 @@ data class Item(
material = itemStack.type,
label = itemStack.itemMeta?.displayName() ?: Component.empty(),
size = itemStack.amount,
lore = itemStack.lore() ?: emptyList(),
lore = itemStack.lore().takeOrEmpty(),
damage = itemStack.itemMeta?.takeIfInstance<Damageable>()?.damage ?: 0,
modifications = enchantmentsToModifications(itemStack.enchantments).toMutableSet(),
flags = itemStack.itemFlags,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package de.fruxz.sparkle.server.component.ui.gui

import de.fruxz.ascend.extension.container.edited
import de.fruxz.ascend.extension.container.takeOrEmpty
import de.fruxz.ascend.extension.empty
import de.fruxz.ascend.extension.math.ceilToInt
import de.fruxz.ascend.extension.math.maxTo
Expand Down Expand Up @@ -154,7 +155,7 @@ internal class CanvasListener : EventListener() {
if (!canvas.flags.contains(NO_CLICK_ACTIONS)) {

session.canvas.onClicks
.let { (it[null] ?: emptyList()) + (it[event.slot] ?: emptyList()) }
.let { (it[null].takeOrEmpty()) + (it[event.slot].takeOrEmpty()) }
.forEach { it.invoke(internalEvent) }

}
Expand Down

0 comments on commit 7419fec

Please sign in to comment.