Skip to content

Commit

Permalink
refactor: remove dye command
Browse files Browse the repository at this point in the history
  • Loading branch information
Boy0000 committed May 17, 2024
1 parent 47050a8 commit 994a4ea
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions src/main/kotlin/com/mineinabyss/blocky/BlockyCommandExecutor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -68,25 +68,6 @@ class BlockyCommandExecutor : IdofrontCommandExecutor(), TabCompleter {
player.inventory.addItem(item)
}
}
"dye" {
val color by stringArg()
playerAction {
val player = sender as? Player ?: return@playerAction
val item = player.inventory.itemInMainHand
val furniture = player.gearyInventory?.get(EquipmentSlot.HAND)?.get<BlockyFurniture>()

if (furniture == null) {
player.error("This command only supports furniture.")
return@playerAction
}

item.editItemMeta {
(asColorable() ?: return@playerAction player.error("This item cannot be dyed.")).color =
color.toColor()
}
player.success("Dyed item to $color")
}
}
"menu" {
playerAction {
val player = sender as Player
Expand All @@ -104,7 +85,7 @@ class BlockyCommandExecutor : IdofrontCommandExecutor(), TabCompleter {
): List<String> {
return if (command.name == "blocky") {
when (args.size) {
1 -> listOf("reload", "give", "dye", "menu").filter { it.startsWith(args[0]) }
1 -> listOf("reload", "give", "menu").filter { it.startsWith(args[0]) }
2 -> when (args[0]) {
"give" -> blocky.prefabQuery.mapWithEntity { prefabKey }.asSequence()
.filter { it.data.key.startsWith(args[1]) || it.data.full.startsWith(args[1]) }
Expand Down

0 comments on commit 994a4ea

Please sign in to comment.