Skip to content

Commit

Permalink
release: 2.3.1-SNAPSHOT
Browse files Browse the repository at this point in the history
- 1.20.2 support
  • Loading branch information
iGabyTM committed Nov 11, 2023
1 parent 365e586 commit 1cdaf7e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

group 'me.gabytm.minecraft'
version '2.3.0-SNAPSHOT'
version '2.3.1-SNAPSHOT'

subprojects {
if (project.name != 'comet') {
Expand Down
7 changes: 4 additions & 3 deletions plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,17 @@ dependencies {
compileOnly('com.github.MilkBowl:VaultAPI:1.7') { transitive false }

// NBT
compileOnly 'de.tr7zw:item-nbt-api-plugin:2.11.3'
compileOnly 'de.tr7zw:item-nbt-api-plugin:2.12.1'

// Adventure
def adventureVersion = '4.14.0'
def adventurePlatformVersion = '4.3.1'
implementation "net.kyori:adventure-api:$adventureVersion"
implementation 'net.kyori:adventure-platform-bukkit:4.3.0'
implementation "net.kyori:adventure-platform-bukkit:$adventurePlatformVersion"
implementation "net.kyori:adventure-text-minimessage:$adventureVersion"

// GUis and commands
implementation 'dev.triumphteam:triumph-gui:3.1.5'
implementation 'dev.triumphteam:triumph-gui:3.1.7'
implementation 'me.mattstudios.utils:matt-framework:1.4.6'

// Heads
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ class VoucherUseListener(private val plugin: ArcaneVouchers) : Listener {
return
}

val compound = nbt.getCompound(NBT.VOUCHER_COMPOUND)
val voucherId = compound.getString(NBT.VOUCHER_NAME)
val compound = nbt.getCompound(NBT.VOUCHER_COMPOUND) ?: return
val voucherId = compound.getString(NBT.VOUCHER_NAME) ?: return
val voucher = voucherManager.getVoucher(voucherId) ?: return // it was probably removed from config
val settings = voucher.settings

Expand All @@ -138,7 +138,7 @@ class VoucherUseListener(private val plugin: ArcaneVouchers) : Listener {

this.isCancelled = true

val args = compound.getCompound(NBT.ARGUMENTS_COMPOUND).getArgs()
val args = compound.getCompound(NBT.ARGUMENTS_COMPOUND)?.getArgs() ?: mutableMapOf()
val (placeholders, values) = args

val audience = audiences.player(this.player)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ class VoucherManager(private val plugin: ArcaneVouchers) {
val nbt = NBTItem(voucher.item.clone())

// Set the arguments and player's name inside the item
val compound = nbt.getCompound(NBT.VOUCHER_COMPOUND)
val argumentsCompound = compound.getCompound(NBT.ARGUMENTS_COMPOUND)
val compound = nbt.getOrCreateCompound(NBT.VOUCHER_COMPOUND)
val argumentsCompound = compound.getOrCreateCompound(NBT.ARGUMENTS_COMPOUND)

argsMap.entries.forEach { (key, value) -> argumentsCompound.setString(key, value) }
compound.setReceiverUUID(player.uniqueId)
Expand Down

0 comments on commit 1cdaf7e

Please sign in to comment.