Added Puke command

This commit is contained in:
Sn0wStorm 2020-11-15 13:38:25 +01:00
parent df004cc79c
commit e525dc4bff
10 changed files with 68 additions and 0 deletions

View File

@ -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 <id> &9Entfernt einen Aufwachpunkt'
Help_Static: '&6/brew Static &9Trank unveränderlich machen -> Kein weiteres reifen oder destillieren möglich'
Help_Create: '&6/brew Create <Rezept> [Qualität] [Spieler] &9Erstellt einen Trank mit optionaler Qualität (1-10)'
Help_Give: '&6/brew give <Rezept> [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!'

View File

@ -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 <id> &9Teleports to the wakeup point with <id>'
Help_WakeupList: '&6/brew wakeup list <Page> [World]&9 Lists all wakeup points of <world>'
Help_WakeupRemove: '&6/brew wakeup remove <id> &9Removes the wakeup point with <id>'
Help_Puke: '&6/brew puke [Player] [Amount] &9Makes you or [Player] puke'
# Perms
Perms_NoBarrelCreate: '&cYou don''t have permissions to create barrels!'

View File

@ -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 <id> &9Teletransporta al punto de activación con <id>'
Help_WakeupList: '&6/brew wakeup list <Página> [Mundo]&9 Enumera todos los puntos de activación del <Mundo>'
Help_WakeupRemove: '&6/brew wakeup remove <id> &9Elimina el punto de activación con <id>'
Help_Puke: '&6/brew puke [Player] [Amount] &9Makes you or [Player] puke'
# Perms
Perms_NoBarrelCreate: '&c¡No tienes permisos para crear barriles!'

View File

@ -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 <id> &9Téléportation vers le point de réveil avec l´ID <id>'
Help_WakeupList: '&6/brew wakeup list <Page> [World]&9 Affiche une liste de tous les points de réveil de [world]'
Help_WakeupRemove: '&6/brew wakeup remove <id> &9Enlève le point de réveil avec l´ID <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 !'

View File

@ -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 <ID> &9Ti teletrasporta al punto di risveglio con id <id>'
Help_WakeupList: '&6/brew wakeup list <Pagina> <Mondo>&9 Elenca tutti i punti di risveglio di <Mondo>'
Help_WakeupRemove: '&6/brew wakeup remove <ID> &9Rimuove il punto di risveglio con id <id>'
Help_Puke: '&6/brew puke [Player] [Amount] &9Makes you or [Player] puke'
# Permessi
Perms_NoBarrelCreate: '&cNon hai il permesso di costruire barili!'

View File

@ -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 <id> &9Телепортация в точку пробуждения с айди <id>'
Help_WakeupList: '&6/brew wakeup list <Page> [World]&9 Список всех точек пробуждения в <world>'
Help_WakeupRemove: '&6/brew wakeup remove <id> &9Удаление всех точек пробуждения с айди <id>'
Help_Puke: '&6/brew puke [Player] [Amount] &9Makes you or [Player] puke'
# Perms
Perms_NoBarrelCreate: '&cУ тебя нет прав на создание бочек!'

View File

@ -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 <id> &9使用<id>傳送到喚醒點'
Help_WakeupList: '&6/brew wakeup list <頁數> [World]&9 列出<world>的所有喚醒點'
Help_WakeupRemove: '&6/brew wakeup remove <id> &9使用<id>刪除喚醒點'
Help_Puke: '&6/brew puke [Player] [Amount] &9Makes you or [Player] puke'
# Perms
Perms_NoBarrelCreate: '&c您沒有權限創建釀造桶!'

View File

@ -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 <id> &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你没有权限创造木桶!'

View File

@ -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:

View File

@ -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;
}
}