Skip to content

Commit

Permalink
Add command permission requirements for give/take shulker commands
Browse files Browse the repository at this point in the history
  • Loading branch information
4Ply committed Dec 28, 2023
1 parent e76fab8 commit 1a03745
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package org.trackedout.citadel.commands

import co.aikar.commands.BaseCommand
import co.aikar.commands.annotation.CommandAlias
import co.aikar.commands.annotation.Default
import co.aikar.commands.annotation.Dependency
import co.aikar.commands.annotation.Description
import co.aikar.commands.annotation.*
import com.saicone.rtag.RtagItem
import org.bukkit.Material
import org.bukkit.block.ShulkerBox
Expand All @@ -28,6 +25,7 @@ class GiveShulkerCommand(
private fun isDeckedOutShulker(it: ItemStack) = it.type == Material.SHULKER_BOX

@Default
@CommandPermission("decked-out.inventory.get-shulker")
@Description("Add Decked Out 2 shulker into player's inventory")
fun giveShulker(player: Player) {
if (!playerMayReceiveShulker(player)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package org.trackedout.citadel.commands

import co.aikar.commands.BaseCommand
import co.aikar.commands.annotation.CommandAlias
import co.aikar.commands.annotation.Default
import co.aikar.commands.annotation.Dependency
import co.aikar.commands.annotation.Description
import co.aikar.commands.annotation.*
import org.bukkit.Material
import org.bukkit.entity.Player
import org.bukkit.inventory.ItemStack
Expand All @@ -21,6 +18,7 @@ class TakeShulkerCommand : BaseCommand() {
private fun isDeckedOutShulker(it: ItemStack) = it.type == Material.SHULKER_BOX // TODO: Validate using NBT data; validate that this player owns it

@Default
@CommandPermission("decked-out.inventory.return-shulker")
@Description("Take Decked Out 2 shulker from player's inventory")
fun takeShulker(player: Player) {
val deckedOutShulker = player.inventory.storageContents.find { itemStack ->
Expand Down

0 comments on commit 1a03745

Please sign in to comment.