-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: toIdo() called on existing IdoArgumentType incorrectly wraps com…
…mand twice chore: Remove sample command in ido plugin class
- Loading branch information
Showing
2 changed files
with
5 additions
and
25 deletions.
There are no files selected for viewing
24 changes: 0 additions & 24 deletions
24
idofront-catalog-shaded/src/main/java/com/mineinabyss/idofront/IdofrontPlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,14 @@ | ||
package com.mineinabyss.idofront | ||
|
||
import com.mineinabyss.idofront.commands.brigadier.Args | ||
import com.mineinabyss.idofront.commands.brigadier.ArgsMinecraft | ||
import com.mineinabyss.idofront.commands.brigadier.commands | ||
import com.mineinabyss.idofront.commands.brigadier.executes | ||
import com.mineinabyss.idofront.di.DI | ||
import com.mineinabyss.idofront.plugin.listeners | ||
import com.mineinabyss.idofront.serialization.recipes.options.IngredientOptionsListener | ||
import kotlinx.coroutines.flow.merge | ||
import org.bukkit.entity.Player | ||
import org.bukkit.plugin.java.JavaPlugin | ||
|
||
class IdofrontPlugin : JavaPlugin() { | ||
override fun onEnable() { | ||
val recipeOptionsListener = IngredientOptionsListener(this) | ||
DI.add(recipeOptionsListener) | ||
listeners(recipeOptionsListener) | ||
|
||
commands { | ||
"idofront" { | ||
"msg" { | ||
executes( | ||
Args.string(), | ||
ArgsMinecraft.player().resolve() | ||
.map { it.single() } | ||
.default { sender as? Player ?: fail("Receiver should be player") }, | ||
Args.integer(min = 0).default { 1 } | ||
) { msg, player, times -> | ||
repeat(times) { | ||
player.sendMessage(msg) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters