diff --git a/resources/languages/de.yml b/resources/languages/de.yml index f29a3ab..37042f2 100644 --- a/resources/languages/de.yml +++ b/resources/languages/de.yml @@ -45,6 +45,7 @@ Error_Recipeload: '&cEs konnten nicht alle Rezepte wiederhergesellt werden: Sieh Error_ShowHelp: 'Benutze &6/brew help &fum die Hilfe anzuzeigen' Error_UnknownCommand: Unbekannter Befehl Error_YmlRead: 'config.yml konnte nicht gelesen werden, ist die Datei im korrekten yml-Format (korrekte Leerzeichen, Strings mit '' '' usw.)?' +Error_NoPlayer: 'Spieler &v1 nicht gefunden' # Etc Etc_Page: Seite @@ -72,6 +73,7 @@ Help_WakeupRemove: '&6/brew Wakeup Remove &9Entfernt einen Aufwachpunkt' Help_Static: '&6/brew Static &9Trank unveränderlich machen -> Kein weiteres reifen oder destillieren möglich' Help_Create: '&6/brew Create [Qualität] [Spieler] &9Erstellt einen Trank mit optionaler Qualität (1-10)' Help_Give: '&6/brew give [Qualität] [Spieler] &9Alias für /brew create' +Help_Puke: '&6/brew puke [Spieler] [Menge] &9Bringt dich, oder [Player] zum erbrechen' # Permission Perms_NoBarrelCreate: '&cDu hast keine Rechte Fässer zu erstellen!' diff --git a/resources/languages/en.yml b/resources/languages/en.yml index 4fd3cbe..a05f93c 100644 --- a/resources/languages/en.yml +++ b/resources/languages/en.yml @@ -45,6 +45,7 @@ Error_Recipeload: '&cNot all recipes could be restored: More information in the Error_ShowHelp: Use &6/brew help &fto display the help Error_UnknownCommand: Unknown Command Error_YmlRead: 'Could not read file config.yml, please make sure the file is in valid yml format (correct spaces, using '' '' etc.)' +Error_NoPlayer: 'Player not found: &v1' # Etc Etc_Barrel: Barrel @@ -72,6 +73,7 @@ Help_WakeupCheck: '&6/brew wakeup check &9Teleports to all wakeup points' Help_WakeupCheckSpecific: '&6/brew wakeup check &9Teleports to the wakeup point with ' Help_WakeupList: '&6/brew wakeup list [World]&9 Lists all wakeup points of ' Help_WakeupRemove: '&6/brew wakeup remove &9Removes the wakeup point with ' +Help_Puke: '&6/brew puke [Player] [Amount] &9Makes you or [Player] puke' # Perms Perms_NoBarrelCreate: '&cYou don''t have permissions to create barrels!' diff --git a/resources/languages/es.yml b/resources/languages/es.yml index ec83c45..4073554 100644 --- a/resources/languages/es.yml +++ b/resources/languages/es.yml @@ -46,6 +46,7 @@ Error_Recipeload: '&cNo se pudieron restaurar todas las recetas: ¡Más informac Error_ShowHelp: Usa &6/brew help &fpara mostrar la ayuda Error_UnknownCommand: Comando desconocido Error_YmlRead: 'No se pudo leer el archivo config.yml, asegúrese de que el archivo esté en formato yml válido (espacios correctos, etc.)' +Error_NoPlayer: 'Player not found: &v1' # Etc Etc_Barrel: Barril @@ -73,6 +74,7 @@ Help_WakeupCheck: '&6/brew wakeup check &9Teletransporta a todos los puntos de a Help_WakeupCheckSpecific: '&6/brew wakeup check &9Teletransporta al punto de activación con ' Help_WakeupList: '&6/brew wakeup list [Mundo]&9 Enumera todos los puntos de activación del ' Help_WakeupRemove: '&6/brew wakeup remove &9Elimina el punto de activación con ' +Help_Puke: '&6/brew puke [Player] [Amount] &9Makes you or [Player] puke' # Perms Perms_NoBarrelCreate: '&c¡No tienes permisos para crear barriles!' diff --git a/resources/languages/fr.yml b/resources/languages/fr.yml index 0997626..783c9f2 100644 --- a/resources/languages/fr.yml +++ b/resources/languages/fr.yml @@ -45,6 +45,7 @@ Error_Recipeload: '&cToutes les recettes n´ont pu être restaurées: Plus d´in Error_ShowHelp: Utilisez &6/brew help &fpour regarder l´aide Error_UnknownCommand: Commande inconnue Error_YmlRead: 'Could not read file config.yml, please make sure the file is in valid yml format (correct spaces, using '' '' etc.)' +Error_NoPlayer: 'Player not found: &v1' # Etc Etc_Barrel: Baril @@ -72,6 +73,7 @@ Help_WakeupCheck: '&6/brew wakeup check &9Téléportation vers tous les points d Help_WakeupCheckSpecific: '&6/brew wakeup check &9Téléportation vers le point de réveil avec l´ID ' Help_WakeupList: '&6/brew wakeup list [World]&9 Affiche une liste de tous les points de réveil de [world]' Help_WakeupRemove: '&6/brew wakeup remove &9Enlève le point de réveil avec l´ID ' +Help_Puke: '&6/brew puke [Player] [Amount] &9Makes you or [Player] puke' # Permissions Perms_NoBarrelCreate: '&cVous n´avez pas la permission de créer des barils !' diff --git a/resources/languages/it.yml b/resources/languages/it.yml index 4991859..6900c2c 100755 --- a/resources/languages/it.yml +++ b/resources/languages/it.yml @@ -45,6 +45,7 @@ Error_Recipeload: '&cNon è stato possibile recuperare tutte le ricette: ulterio Error_ShowHelp: Usa &6/brew help &fper visualizzare l''aiuto Error_UnknownCommand: Comando sconosciuto Error_YmlRead: 'Could not read file config.yml, please make sure the file is in valid yml format (correct spaces, using '' '' etc.)' +Error_NoPlayer: 'Player not found: &v1' # Varie Etc_Barrel: Barile @@ -72,6 +73,7 @@ Help_WakeupCheck: '&6/brew wakeup check &9Ti teletrasporta nei punti di risvegli Help_WakeupCheckSpecific: '&6/brew wakeup check &9Ti teletrasporta al punto di risveglio con id ' Help_WakeupList: '&6/brew wakeup list &9 Elenca tutti i punti di risveglio di ' Help_WakeupRemove: '&6/brew wakeup remove &9Rimuove il punto di risveglio con id ' +Help_Puke: '&6/brew puke [Player] [Amount] &9Makes you or [Player] puke' # Permessi Perms_NoBarrelCreate: '&cNon hai il permesso di costruire barili!' diff --git a/resources/languages/ru.yml b/resources/languages/ru.yml index ad06a81..1609642 100644 --- a/resources/languages/ru.yml +++ b/resources/languages/ru.yml @@ -45,6 +45,7 @@ Error_Recipeload: '&cNot all recipes could be restored: More information in the Error_ShowHelp: Использование &6/brew help &fдля отображения помощи Error_UnknownCommand: Неизвестная команда Error_YmlRead: 'не могу прочитать config.yml, пожалуйста, проверь, что там всё верно. (Корректируй пробелы, используя '' '' и др.)' +Error_NoPlayer: 'Player not found: &v1' # Etc Etc_Barrel: 'Бочка' @@ -72,6 +73,7 @@ Help_WakeupCheck: '&6/brew wakeup check &9Телепортируется на в Help_WakeupCheckSpecific: '&6/brew wakeup check &9Телепортация в точку пробуждения с айди ' Help_WakeupList: '&6/brew wakeup list [World]&9 Список всех точек пробуждения в ' Help_WakeupRemove: '&6/brew wakeup remove &9Удаление всех точек пробуждения с айди ' +Help_Puke: '&6/brew puke [Player] [Amount] &9Makes you or [Player] puke' # Perms Perms_NoBarrelCreate: '&cУ тебя нет прав на создание бочек!' diff --git a/resources/languages/tw.yml b/resources/languages/tw.yml index 123ac4d..61cea74 100644 --- a/resources/languages/tw.yml +++ b/resources/languages/tw.yml @@ -45,6 +45,7 @@ Error_Recipeload: '&c並非所有配方都可以有用:服務器日誌中的 Error_ShowHelp: 使用 &6/brew help &f顯示幫助 Error_UnknownCommand: 未知的指令 Error_YmlRead: 'Could not read file config.yml, please make sure the file is in valid yml format (correct spaces, using '' '' etc.)' +Error_NoPlayer: 'Player not found: &v1' # Etc Etc_Barrel: 釀造桶 @@ -72,6 +73,7 @@ Help_WakeupCheck: '&6/brew wakeup check &9傳送到所有喚醒點' Help_WakeupCheckSpecific: '&6/brew wakeup check &9使用傳送到喚醒點' Help_WakeupList: '&6/brew wakeup list <頁數> [World]&9 列出的所有喚醒點' Help_WakeupRemove: '&6/brew wakeup remove &9使用刪除喚醒點' +Help_Puke: '&6/brew puke [Player] [Amount] &9Makes you or [Player] puke' # Perms Perms_NoBarrelCreate: '&c您沒有權限創建釀造桶!' diff --git a/resources/languages/zh.yml b/resources/languages/zh.yml index 03b4830..9edea35 100644 --- a/resources/languages/zh.yml +++ b/resources/languages/zh.yml @@ -45,6 +45,7 @@ Error_Recipeload: '&c加载饮品配方时出现问题, 请查看控制台以获 Error_ShowHelp: 使用&6/brew help&f以查看帮助 Error_UnknownCommand: 未知命令. Error_YmlRead: '无法读取config.yml, 请保证该文件符合正确的yml格式!(例如更正错误的空格等试试看…)' +Error_NoPlayer: 'Player not found: &v1' # Etc Etc_Barrel: 木桶 @@ -72,6 +73,7 @@ Help_WakeupCheck: '&6/brew wakeup check &9传送至每一个苏醒处进行一 Help_WakeupCheckSpecific: '&6/brew wakeup check &9传送至指定苏醒处.' Help_WakeupList: '&6/brew wakeup list <页数> [世界] &9列出该世界所有的苏醒处.' Help_WakeupRemove: '&6/brew wakeup remove <页数> &9移除指定id的苏醒处.' +Help_Puke: '&6/brew puke [Player] [Amount] &9Makes you or [Player] puke' # Perms Perms_NoBarrelCreate: '&c你没有权限创造木桶!' diff --git a/resources/plugin.yml b/resources/plugin.yml index ab99610..e6750db 100644 --- a/resources/plugin.yml +++ b/resources/plugin.yml @@ -38,6 +38,8 @@ permissions: brewery.cmd.info: true brewery.cmd.infoOther: true brewery.cmd.seal: true + brewery.cmd.puke: true + brewery.cmd.pukeOther: true brewery.cmd.player: true brewery.cmd.create: true brewery.cmd.copy: true @@ -63,6 +65,10 @@ permissions: description: Information about the drunkeness of another Player brewery.cmd.seal: description: Open the Brew Sealer by command + brewery.cmd.puke: + description: Make yourself puke + brewery.cmd.pukeOther: + description: Make other Players puke brewery.cmd.player: description: Set Player-values brewery.cmd.wakeup: diff --git a/src/com/dre/brewery/listeners/CommandListener.java b/src/com/dre/brewery/listeners/CommandListener.java index b68a183..31d699c 100644 --- a/src/com/dre/brewery/listeners/CommandListener.java +++ b/src/com/dre/brewery/listeners/CommandListener.java @@ -136,6 +136,10 @@ public class CommandListener implements CommandExecutor { showStats(sender); + } else if (cmd.equalsIgnoreCase("puke") || cmd.equalsIgnoreCase("vomit") || cmd.equalsIgnoreCase("barf")) { + + cmdPuke(sender, args); + } else { if (p.getServer().getPlayerExact(cmd) != null || BPlayer.hasPlayerbyName(cmd)) { @@ -215,6 +219,10 @@ public class CommandListener implements CommandExecutor { cmds.add(p.languageReader.get("Help_Reload")); } + if (sender.hasPermission("brewery.cmd.puke") || sender.hasPermission("brewery.cmd.pukeOther")) { + cmds.add(p.languageReader.get("Help_Puke")); + } + if (sender.hasPermission("brewery.cmd.wakeup")) { cmds.add(p.languageReader.get("Help_Wakeup")); cmds.add(p.languageReader.get("Help_WakeupList")); @@ -685,4 +693,42 @@ public class CommandListener implements CommandExecutor { } + public void cmdPuke(CommandSender sender, String[] args) { + if (!sender.hasPermission("brewery.cmd.puke")) { + p.msg(sender, p.languageReader.get("Error_NoPermissions")); + return; + } + + Player player = null; + if (args.length > 1) { + player = p.getServer().getPlayer(args[1]); + if (player == null) { + p.msg(sender, p.languageReader.get("Error_NoPlayer", args[1])); + return; + } + } + + if (!(sender instanceof Player) && player == null) { + p.msg(sender, p.languageReader.get("Error_PlayerCommand")); + return; + } + if (player == null) { + player = ((Player) sender); + } else { + if (!sender.hasPermission("brewery.cmd.pukeOther") && !player.equals(sender)) { + p.msg(sender, p.languageReader.get("Error_NoPermissions")); + return; + } + } + int count = 0; + if (args.length > 2) { + count = P.p.parseInt(args[2]); + } + if (count <= 0) { + count = 20 + (int) (Math.random() * 40); + } + BPlayer.addPuke(player, count); + return; + } + }