1.2.0-dev
This commit is contained in:
		
					parent
					
						
							
								d0c27ae733
							
						
					
				
			
			
				commit
				
					
						0f349c3ea0
					
				
			
		
					 7 changed files with 67 additions and 14 deletions
				
			
		|  | @ -1,5 +1,6 @@ | |||
| package de.lunarakai.minecleaner.commands; | ||||
| 
 | ||||
| import net.kyori.adventure.text.format.NamedTextColor; | ||||
| import org.bukkit.command.Command; | ||||
| import org.bukkit.command.CommandSender; | ||||
| import de.iani.cubesideutils.bukkit.commands.SubCommand; | ||||
|  | @ -13,6 +14,8 @@ import de.iani.playerUUIDCache.CachedPlayer; | |||
| import de.lunarakai.minecleaner.MinecleanerPlugin; | ||||
| import net.md_5.bungee.api.ChatColor; | ||||
| 
 | ||||
| import static de.lunarakai.minecleaner.utils.MinecleanerComponentUtils.createLangComponent; | ||||
| 
 | ||||
| public class DeletePlayerScoreCommand extends SubCommand{ | ||||
|     private final MinecleanerPlugin plugin; | ||||
| 
 | ||||
|  | @ -48,10 +51,10 @@ public class DeletePlayerScoreCommand extends SubCommand{ | |||
| 
 | ||||
|         CachedPlayer cachedPlayer = plugin.getPlayerUUIDCache().getPlayer(player); | ||||
|         if(cachedPlayer == null) { | ||||
|             sender.sendMessage(ChatColor.DARK_RED + "Ein Spieler mit dem Namen '" + player + "' konnte nicht gefunden werden."); | ||||
|             sender.sendMessage(createLangComponent("data.delete.playerNotFound", player, NamedTextColor.DARK_RED)); | ||||
|         } | ||||
|         plugin.getManager().deleteScores(cachedPlayer.getUUID()); | ||||
|         sender.sendMessage(ChatColor.DARK_RED + "Alle " + plugin.getDisplayedPluginName() + "-Statistiken von Spieler '" + cachedPlayer.getName() + "' wurden gelöscht."); | ||||
|         sender.sendMessage(createLangComponent("data.delete.deleted", plugin.getDisplayedPluginName(), cachedPlayer.getName(), NamedTextColor.DARK_RED)); | ||||
|         return true; | ||||
|     } | ||||
|      | ||||
|  |  | |||
|  | @ -1,5 +1,7 @@ | |||
| package de.lunarakai.minecleaner.commands; | ||||
| 
 | ||||
| import de.iani.cubesideutils.NamedChatColor; | ||||
| import net.kyori.adventure.text.format.NamedTextColor; | ||||
| import org.bukkit.command.Command; | ||||
| import org.bukkit.command.CommandSender; | ||||
| import de.iani.cubesideutils.bukkit.commands.SubCommand; | ||||
|  | @ -12,6 +14,8 @@ import de.iani.cubesideutils.commands.ArgsParser; | |||
| import de.lunarakai.minecleaner.MinecleanerPlugin; | ||||
| import net.md_5.bungee.api.ChatColor; | ||||
| 
 | ||||
| import static de.lunarakai.minecleaner.utils.MinecleanerComponentUtils.createLangComponent; | ||||
| 
 | ||||
| public class InfoCommand extends SubCommand{ | ||||
|     MinecleanerPlugin plugin; | ||||
| 
 | ||||
|  | @ -38,11 +42,11 @@ public class InfoCommand extends SubCommand{ | |||
|     public boolean onCommand(CommandSender sender, Command arg1, String arg2, String arg3, | ||||
|             ArgsParser args) throws DisallowsCommandBlockException, RequiresPlayerException, | ||||
|             NoPermissionException, IllegalSyntaxException, InternalCommandException { | ||||
|                 sender.sendMessage(ChatColor.GREEN + "--- " + ChatColor.AQUA + plugin.getName() + ChatColor.GREEN + " ---"); | ||||
|                 sender.sendMessage(ChatColor.AQUA + "Version: " + ChatColor.GREEN + plugin.getPluginMeta().getVersion()); | ||||
|                 sender.sendMessage(ChatColor.AQUA + "Entwickelt von: " + ChatColor.GREEN + plugin.getPluginMeta().getAuthors().get(0)); | ||||
|                 sender.sendMessage(ChatColor.AQUA + "Website: " + ChatColor.GREEN + plugin.getPluginMeta().getWebsite()); | ||||
|                 sender.sendMessage(ChatColor.AQUA + "Lizenz: " + ChatColor.GREEN + "GPL-3.0"); | ||||
|                 sender.sendMessage(NamedChatColor.GREEN + "--- " + ChatColor.AQUA + plugin.getName() + ChatColor.GREEN + " ---"); | ||||
|                 sender.sendMessage(createLangComponent("minecleaner.info.version", NamedTextColor.AQUA) + ": " + ChatColor.GREEN + plugin.getPluginMeta().getVersion()); | ||||
|                 sender.sendMessage(createLangComponent("minecleaner.info.developer", NamedTextColor.AQUA) + ": " + ChatColor.GREEN + plugin.getPluginMeta().getAuthors().get(0)); | ||||
|                 sender.sendMessage(createLangComponent("minecleaner.info.website", NamedTextColor.AQUA) + ": " + ChatColor.GREEN + plugin.getPluginMeta().getWebsite()); | ||||
|                 sender.sendMessage(createLangComponent("minecleaner.info.license", NamedTextColor.AQUA) + ": " + ChatColor.GREEN + "GPL-3.0"); | ||||
|                 return true; | ||||
|     } | ||||
| } | ||||
|  |  | |||
|  | @ -2,6 +2,8 @@ package de.lunarakai.minecleaner.commands; | |||
| 
 | ||||
| import java.util.Collection; | ||||
| import java.util.List; | ||||
| 
 | ||||
| import net.kyori.adventure.text.format.NamedTextColor; | ||||
| import org.bukkit.Location; | ||||
| import org.bukkit.command.Command; | ||||
| import org.bukkit.command.CommandSender; | ||||
|  | @ -16,6 +18,8 @@ import de.lunarakai.minecleaner.MinecleanerArena; | |||
| import de.lunarakai.minecleaner.MinecleanerPlugin; | ||||
| import net.md_5.bungee.api.ChatColor; | ||||
| 
 | ||||
| import static de.lunarakai.minecleaner.utils.MinecleanerComponentUtils.createLangComponent; | ||||
| 
 | ||||
| public class ListCommand extends SubCommand{ | ||||
| 
 | ||||
|     private final MinecleanerPlugin plugin; | ||||
|  | @ -41,7 +45,7 @@ public class ListCommand extends SubCommand{ | |||
| 
 | ||||
|     @Override | ||||
|     public boolean onCommand(CommandSender sender, Command arg1, String arg2, String commandString, ArgsParser args) throws DisallowsCommandBlockException, RequiresPlayerException, NoPermissionException, IllegalSyntaxException, InternalCommandException { | ||||
|         sender.sendMessage(ChatColor.YELLOW + "Angelegte "+ plugin.getDisplayedPluginName() + "-Arenen"); | ||||
|         sender.sendMessage(createLangComponent("arena.list", plugin.getDisplayedPluginName(), NamedTextColor.YELLOW)); | ||||
|         boolean any = false; | ||||
|         for(MinecleanerArena arena : plugin.getArenaList().getArenas()) { | ||||
|             Location location = arena.getLocation(); | ||||
|  | @ -49,7 +53,7 @@ public class ListCommand extends SubCommand{ | |||
|             any = true; | ||||
|         } | ||||
|         if(!any) { | ||||
|             sender.sendMessage(ChatColor.GRAY + "  (keine)"); | ||||
|             sender.sendMessage("  " + createLangComponent("arena.list.none", NamedTextColor.GRAY)); | ||||
|         } | ||||
|         return true; | ||||
|     } | ||||
|  |  | |||
|  | @ -2,6 +2,9 @@ package de.lunarakai.minecleaner.commands; | |||
| 
 | ||||
| import java.util.Map.Entry; | ||||
| import java.util.function.Consumer; | ||||
| 
 | ||||
| import net.kyori.adventure.text.Component; | ||||
| import net.kyori.adventure.text.format.NamedTextColor; | ||||
| import org.bukkit.command.Command; | ||||
| import org.bukkit.command.CommandSender; | ||||
| import org.bukkit.entity.Player; | ||||
|  | @ -18,6 +21,8 @@ import de.lunarakai.minecleaner.PlayerStatisticsData; | |||
| import de.lunarakai.minecleaner.utils.MinecleanerStringUtil; | ||||
| import net.md_5.bungee.api.ChatColor; | ||||
| 
 | ||||
| import static de.lunarakai.minecleaner.utils.MinecleanerComponentUtils.createLangComponent; | ||||
| 
 | ||||
| public class StatsCommand extends SubCommand { | ||||
|     private final MinecleanerPlugin plugin; | ||||
| 
 | ||||
|  | @ -48,13 +53,13 @@ public class StatsCommand extends SubCommand { | |||
|             @Override | ||||
|             public void accept(PlayerStatisticsData data) { | ||||
|                 if(data == null) { | ||||
|                     sender.sendMessage(ChatColor.GREEN + "Für Spieler '" + playerName + "' existieren keine Daten."); | ||||
|                     sender.sendMessage(createLangComponent("data.player.noData", playerName, NamedTextColor.GREEN)); | ||||
|                     return; | ||||
|                 } | ||||
|                 if(playerName == null) { | ||||
|                     sender.sendMessage(ChatColor.AQUA + "Deine " + plugin.getDisplayedPluginName() + " Statistik:"); | ||||
|                     sender.sendMessage(createLangComponent("data.player.self", plugin.getDisplayedPluginName(), NamedTextColor.AQUA).append(Component.text(":"))); | ||||
|                 } else { | ||||
|                     sender.sendMessage(ChatColor.AQUA + plugin.getDisplayedPluginName() + "-Statistik von " + data.getPlayerName() + ":"); | ||||
|                     sender.sendMessage(createLangComponent("data.player.other", plugin.getDisplayedPluginName(), data.getPlayerName(), NamedTextColor.AQUA).append(Component.text(":"))); | ||||
|                 } | ||||
|                 sender.sendMessage(ChatColor.BLUE + "  Punkte erspielt: " + ChatColor.GREEN + data.getPointsAcquiredTotal() + " (Dieser Monat: " + data.getPointsAquiredMonth() + ")"); | ||||
|                 sender.sendMessage(ChatColor.BLUE + "  Runden gewonnen: " + ChatColor.GREEN + data.getWonGamesPlayed() + " (Dieser Monat: " + data.getWonGamesPlayedThisMonth() + ")"); | ||||
|  |  | |||
|  | @ -20,4 +20,11 @@ public class MinecleanerComponentUtils { | |||
|                 .build(); | ||||
|     } | ||||
| 
 | ||||
|     public static TextComponent createLangComponent(String langKey, String arg0, String arg1, NamedTextColor namedColor) { | ||||
|         return Component.text() | ||||
|                 .color(namedColor) | ||||
|                 .append(Component.translatable(langKey, Component.text(arg0), Component.text(arg1))) | ||||
|                 .build(); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
|  |  | |||
|  | @ -1,3 +1,8 @@ | |||
| minecleaner.info.version=Version | ||||
| minecleaner.info.developer=Entwickelt von | ||||
| minecleaner.info.website=Website | ||||
| minecleaner.info.license=Lizenz | ||||
| 
 | ||||
| arena.name.invalid=Ungueltiger Arenaname. Erlaubt sind Buchstaben, Zahlen und der Unterstrich | ||||
| arena.name.exists=Eine Arena mit diesem Namen existiert bereits | ||||
| arena.widthindex.invalid=Kein Valider Arena WidthIndex! | ||||
|  | @ -6,4 +11,14 @@ arena.widthindex.toolarge=Arena WidthIndex darf nicht groesser als 3 sein | |||
| arena.create.lookAtCenter=Bitte gucke den Block an, der im Zentrum des {0}-Spielfelds sein soll. | ||||
| arena.create.lookAtSide=Bitte gucke die Seite des Blockes an, wo das {0}-Spielfeld erstellt werden soll. | ||||
| arena.create.otherArena=An dieser Stelle befindet sich bereits eine Arena. | ||||
| arena.create.success=Die Arena wurde erfolgreich angelegt. | ||||
| arena.create.success=Die Arena wurde erfolgreich angelegt. | ||||
| 
 | ||||
| arena.list=Angelegte {0}-Arenen | ||||
| arena.list.none=(keine) | ||||
| 
 | ||||
| data.player.noData=Fuer Spieler "{0}" existieren keine Daten. | ||||
| data.player.self=Deine {0} Statistik | ||||
| data.player.other={0}-Statistik von {1} | ||||
| 
 | ||||
| data.delete.playerNotFound=Ein Spieler mit dem Namen "{0}" konnte nicht gefunden werden. | ||||
| data.delete.deleted=Alle {0}-Statistiken von Spieler "{1}" wurden geloescht. | ||||
|  | @ -1,3 +1,8 @@ | |||
| minecleaner.info.version=Version | ||||
| minecleaner.info.developer=Developed by | ||||
| minecleaner.info.website=Website | ||||
| minecleaner.info.license=License | ||||
| 
 | ||||
| arena.name.invalid=Invalid arena name. Allowed are letters, numbers and the underscore | ||||
| arena.name.exists=An arena with this name already exists | ||||
| arena.widthindex.invalid=Not a valid Arena WidthIndex | ||||
|  | @ -6,4 +11,14 @@ arena.widthindex.toolarge=Arena WidthIndex must not be greater than 3 | |||
| arena.create.lookAtCenter=Please look at the block that should be in the center of the {0} field. | ||||
| arena.create.lookAtSide=Please look at the side of the block where the {0} field is to be created. | ||||
| arena.create.otherArena=There is already an arena at this location. | ||||
| arena.create.success=The arena has been created successfully. | ||||
| arena.create.success=The arena has been created successfully. | ||||
| 
 | ||||
| arena.list=Created {0} arenas | ||||
| arena.list.none=(none) | ||||
| 
 | ||||
| data.player.noData=No data exists for player "{0}". | ||||
| data.player.self=Your {0} statistics | ||||
| data.player.other={0} statistics from {1} | ||||
| 
 | ||||
| data.delete.playerNotFound=A player with the name "{0}" could not be found. | ||||
| data.delete.deleted=All {0} stats of player "{1}" have been deleted. | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue