Add timer command, recraft module & recipes
Introduce a /timer admin command with tab completion (speedhg.admin.timer) and a parseTimeToSeconds utility; add CommandSender.sendMsg extension and language strings. Add RecraftManager module that enforces a configurable recraft-nerf (reduces extra recraft points for alive players) and starts from GameManager; wire the new module into GameManager. Register mushroom-stew shapeless recipes for cocoa and cactus in plugin startup and tidy command registration. Update plugin.yml with permission/command entries and adjust imports as needed.
This commit is contained in:
@@ -2,6 +2,7 @@ package club.mcscrims.speedhg
|
||||
|
||||
import club.mcscrims.speedhg.command.KitCommand
|
||||
import club.mcscrims.speedhg.command.LeaderboardCommand
|
||||
import club.mcscrims.speedhg.command.TimerCommand
|
||||
import club.mcscrims.speedhg.config.LanguageManager
|
||||
import club.mcscrims.speedhg.database.DatabaseManager
|
||||
import club.mcscrims.speedhg.database.StatsManager
|
||||
@@ -18,6 +19,10 @@ import club.mcscrims.speedhg.listener.StatsListener
|
||||
import club.mcscrims.speedhg.scoreboard.ScoreboardManager
|
||||
import club.mcscrims.speedhg.webhook.DiscordWebhookManager
|
||||
import org.bukkit.Bukkit
|
||||
import org.bukkit.Material
|
||||
import org.bukkit.NamespacedKey
|
||||
import org.bukkit.inventory.ItemStack
|
||||
import org.bukkit.inventory.ShapelessRecipe
|
||||
import org.bukkit.plugin.java.JavaPlugin
|
||||
|
||||
class SpeedHG : JavaPlugin() {
|
||||
@@ -81,6 +86,7 @@ class SpeedHG : JavaPlugin() {
|
||||
registerKits()
|
||||
registerCommands()
|
||||
registerListener()
|
||||
registerRecipes()
|
||||
|
||||
logger.info("SpeedHG wurde geladen!")
|
||||
}
|
||||
@@ -105,8 +111,16 @@ class SpeedHG : JavaPlugin() {
|
||||
private fun registerCommands()
|
||||
{
|
||||
val kitCommand = KitCommand()
|
||||
getCommand( "kit" )?.setExecutor( kitCommand )
|
||||
getCommand( "kit" )?.tabCompleter = kitCommand
|
||||
getCommand( "kit" )?.apply {
|
||||
setExecutor( kitCommand )
|
||||
tabCompleter = kitCommand
|
||||
}
|
||||
|
||||
val timerCommand = TimerCommand( this )
|
||||
getCommand( "timer" )?.apply {
|
||||
setExecutor( timerCommand )
|
||||
tabCompleter = timerCommand
|
||||
}
|
||||
|
||||
getCommand( "leaderboard" )?.setExecutor( LeaderboardCommand() )
|
||||
}
|
||||
@@ -123,4 +137,20 @@ class SpeedHG : JavaPlugin() {
|
||||
pm.registerEvents( MenuListener(), this )
|
||||
}
|
||||
|
||||
private fun registerRecipes()
|
||||
{
|
||||
val soup = ItemStack( Material.MUSHROOM_STEW )
|
||||
|
||||
val cocoRecipe = ShapelessRecipe(NamespacedKey.minecraft( "cocoa_soup" ), soup )
|
||||
cocoRecipe.addIngredient( Material.COCOA_BEANS )
|
||||
cocoRecipe.addIngredient( Material.BOWL )
|
||||
|
||||
val cactiRecipe = ShapelessRecipe(NamespacedKey.minecraft( "cacti_soup" ), soup )
|
||||
cactiRecipe.addIngredient( Material.CACTUS )
|
||||
cactiRecipe.addIngredient( Material.BOWL )
|
||||
|
||||
Bukkit.addRecipe( cocoRecipe )
|
||||
Bukkit.addRecipe( cactiRecipe )
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user