-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
00512e5
commit c4756bb
Showing
59 changed files
with
1,645 additions
and
1,883 deletions.
There are no files selected for viewing
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
51 changes: 33 additions & 18 deletions
51
BloodNight-core/src/main/java/de/eldoria/bloodnight/command/BloodNightCommand.java
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,33 +1,48 @@ | ||
package de.eldoria.bloodnight.command; | ||
|
||
import de.eldoria.bloodnight.command.bloodnight.*; | ||
import de.eldoria.bloodnight.command.bloodnight.CancelNight; | ||
import de.eldoria.bloodnight.command.bloodnight.ForceNight; | ||
import de.eldoria.bloodnight.command.bloodnight.Help; | ||
import de.eldoria.bloodnight.command.bloodnight.ManageDeathActions; | ||
import de.eldoria.bloodnight.command.bloodnight.ManageMob; | ||
import de.eldoria.bloodnight.command.bloodnight.ManageMobs; | ||
import de.eldoria.bloodnight.command.bloodnight.ManageNight; | ||
import de.eldoria.bloodnight.command.bloodnight.ManageNightSelection; | ||
import de.eldoria.bloodnight.command.bloodnight.ManageWorlds; | ||
import de.eldoria.bloodnight.command.bloodnight.Reload; | ||
import de.eldoria.bloodnight.command.bloodnight.SpawnMob; | ||
import de.eldoria.bloodnight.config.Configuration; | ||
import de.eldoria.bloodnight.core.manager.mobmanager.MobManager; | ||
import de.eldoria.bloodnight.core.manager.nightmanager.NightManager; | ||
import de.eldoria.bloodnight.util.Permissions; | ||
import de.eldoria.eldoutilities.simplecommands.EldoCommand; | ||
import de.eldoria.eldoutilities.simplecommands.commands.DefaultDebug; | ||
import de.eldoria.eldoutilities.commands.command.AdvancedCommand; | ||
import de.eldoria.eldoutilities.commands.command.CommandMeta; | ||
import de.eldoria.eldoutilities.commands.defaultcommands.DefaultAbout; | ||
import de.eldoria.eldoutilities.commands.defaultcommands.DefaultDebug; | ||
import org.bukkit.plugin.Plugin; | ||
|
||
public class BloodNightCommand extends EldoCommand { | ||
public class BloodNightCommand extends AdvancedCommand { | ||
|
||
public BloodNightCommand(Configuration configuration, Plugin plugin, | ||
NightManager nightManager, MobManager mobManager, InventoryListener inventoryListener) { | ||
super(plugin); | ||
Help help = new Help(plugin); | ||
setDefaultCommand(help); | ||
registerCommand("help", help); | ||
registerCommand("about", new About(plugin)); | ||
registerCommand("spawnMob", new SpawnMob(plugin, nightManager, mobManager)); | ||
registerCommand("cancelNight", new CancelNight(plugin, nightManager, configuration)); | ||
registerCommand("forceNight", new ForceNight(plugin, nightManager, configuration)); | ||
registerCommand("manageWorlds", new ManageWorlds(plugin, configuration)); | ||
registerCommand("manageMob", new ManageMob(plugin, configuration, inventoryListener)); | ||
registerCommand("manageNight", new ManageNight(plugin, configuration)); | ||
registerCommand("manageMobs", new ManageMobs(plugin, configuration, inventoryListener)); | ||
registerCommand("nightSelection", new ManageNightSelection(plugin, configuration, inventoryListener)); | ||
registerCommand("deathActions", new ManageDeathActions(plugin, configuration)); | ||
registerCommand("reload", new Reload(plugin)); | ||
registerCommand("debug", new DefaultDebug(plugin, Permissions.Admin.RELOAD)); | ||
meta(CommandMeta.builder("bloodnight") | ||
.withDefaultCommand(help) | ||
.withSubCommand(help) | ||
.withSubCommand(new DefaultAbout(plugin, "https://bn.discord.eldoria.de", "commands.about")) | ||
.withSubCommand(new SpawnMob(plugin, nightManager, mobManager)) | ||
.withSubCommand(new CancelNight(plugin, nightManager, configuration)) | ||
.withSubCommand(new ForceNight(plugin, nightManager, configuration)) | ||
.withSubCommand(new ManageWorlds(plugin, configuration)) | ||
.withSubCommand(new ManageMob(plugin, configuration, inventoryListener)) | ||
.withSubCommand(new ManageNight(plugin, configuration)) | ||
.withSubCommand(new ManageMobs(plugin, configuration, inventoryListener)) | ||
.withSubCommand(new ManageNightSelection(plugin, configuration, inventoryListener)) | ||
.withSubCommand(new ManageDeathActions(plugin, configuration)) | ||
.withSubCommand(new Reload(plugin)) | ||
.withSubCommand(new DefaultDebug(plugin, Permissions.Admin.RELOAD)) | ||
.build() | ||
); | ||
} | ||
} |
29 changes: 0 additions & 29 deletions
29
BloodNight-core/src/main/java/de/eldoria/bloodnight/command/bloodnight/About.java
This file was deleted.
Oops, something went wrong.
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
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
70 changes: 45 additions & 25 deletions
70
BloodNight-core/src/main/java/de/eldoria/bloodnight/command/bloodnight/Help.java
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,40 +1,60 @@ | ||
package de.eldoria.bloodnight.command.bloodnight; | ||
|
||
import de.eldoria.eldoutilities.simplecommands.EldoCommand; | ||
import org.bukkit.command.Command; | ||
import de.eldoria.eldoutilities.commands.command.AdvancedCommand; | ||
import de.eldoria.eldoutilities.commands.command.CommandMeta; | ||
import de.eldoria.eldoutilities.commands.command.util.Arguments; | ||
import de.eldoria.eldoutilities.commands.exceptions.CommandException; | ||
import de.eldoria.eldoutilities.commands.executor.ITabExecutor; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.plugin.Plugin; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
import static de.eldoria.eldoutilities.localization.ILocalizer.escape; | ||
|
||
public class Help extends EldoCommand { | ||
public class Help extends AdvancedCommand implements ITabExecutor { | ||
public Help(Plugin plugin) { | ||
super(plugin); | ||
super(plugin, CommandMeta.builder("help").build()); | ||
} | ||
|
||
@Override | ||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) { | ||
messageSender().sendMessage(sender, localizer().getMessage("help.help") + "\n" | ||
+ "§6/bn about§r\n" + localizer().getMessage("help.about") + "\n" | ||
+ "§6/bn forceNight§r\n" + localizer().getMessage("help.forceNight") + "\n" | ||
+ "§6/bn cancelNight§r\n" + localizer().getMessage("help.cancelNight") + "\n" | ||
+ "§6/bn manageMob§r\n" + localizer().getMessage("help.manageMob") + "\n" | ||
+ "§6/bn manageMobs§r\n" + localizer().getMessage("help.manageMobs") + "\n" | ||
+ "§6/bn manageNight§r\n" + localizer().getMessage("help.manageNight") + "\n" | ||
+ "§6/bn manageWorlds§r\n" + localizer().getMessage("help.manageWorlds") + "\n" | ||
+ "§6/bn nightSelection§r\n" + localizer().getMessage("help.nightSelection") + "\n" | ||
+ "§6/bn reload§r\n" + localizer().getMessage("help.reload") + "\n" | ||
+ "§6/bn spawnMob§r\n" + localizer().getMessage("help.spawnMob") | ||
public void onCommand(@NotNull CommandSender sender, @NotNull String alias, @NotNull Arguments args) throws CommandException { | ||
messageSender().sendMessage(sender, """ | ||
%s | ||
<field>/bn about<default> | ||
%s | ||
<field>/bn forceNight<default> | ||
%s | ||
<field>/bn cancelNight<default> | ||
%s | ||
<field>/bn manageMob<default> | ||
%s | ||
<field>/bn manageMobs<default> | ||
%s | ||
<field>/bn manageNight<default> | ||
%s | ||
<field>/bn manageWorlds<default> | ||
%s | ||
<field>/bn nightSelection<default> | ||
%s | ||
<field>/bn reload<default> | ||
%s | ||
<field>/bn spawnMob<default> | ||
%s | ||
""".stripIndent() | ||
.formatted( | ||
escape("help.help"), | ||
escape("help.about"), | ||
escape("help.forceNight"), | ||
escape("help.cancelNight"), | ||
escape("help.manageMob"), | ||
escape("help.manageMobs"), | ||
escape("help.manageNight"), | ||
escape("help.manageWorlds"), | ||
escape("help.nightSelection"), | ||
escape("help.reload"), | ||
escape("help.spawnMob") | ||
) | ||
); | ||
return true; | ||
} | ||
|
||
@Override | ||
public @Nullable | ||
List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, @NotNull String[] args) { | ||
return Collections.emptyList(); | ||
} | ||
} |
Oops, something went wrong.