-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This reverts commit d4f61da.
- Loading branch information
Showing
45 changed files
with
1,232 additions
and
662 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module version="4"> | ||
<component name="FacetManager"> | ||
<facet type="minecraft" name="Minecraft"> | ||
<configuration> | ||
<autoDetectTypes> | ||
<platformType>SPIGOT</platformType> | ||
</autoDetectTypes> | ||
<projectReimportVersion>1</projectReimportVersion> | ||
</configuration> | ||
</facet> | ||
</component> | ||
</module> |
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
45 changes: 0 additions & 45 deletions
45
src/main/java/org/callvdois/daynightpvp/Listeners/ListenersHandler.java
This file was deleted.
Oops, something went wrong.
7 changes: 3 additions & 4 deletions
7
.../daynightpvp/commands/CommandHandler.java → .../daynightpvp/commands/CommandManager.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,12 +1,11 @@ | ||
package org.callvdois.daynightpvp.commands; | ||
|
||
import org.callvdois.daynightpvp.DayNightPvP; | ||
import org.callvdois.daynightpvp.commands.dnp.DnpCommand; | ||
|
||
public class CommandHandler { | ||
|
||
public class CommandManager { | ||
public void register() { | ||
|
||
DayNightPvP.getInstance().getCommand("daynightpvp").setExecutor(new DnpCommand()); | ||
DayNightPvP.getInstance().getCommand("daynightpvp").setTabCompleter(new DnpCommand()); | ||
DayNightPvP.getInstance().getCommand("daynightpvp").setTabCompleter(new DnpTabCompleter()); | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
src/main/java/org/callvdois/daynightpvp/commands/DnpCommand.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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package org.callvdois.daynightpvp.commands; | ||
|
||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandExecutor; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
import org.callvdois.daynightpvp.DayNightPvP; | ||
import org.callvdois.daynightpvp.config.FilesManager; | ||
import org.callvdois.daynightpvp.config.LangManager; | ||
import org.callvdois.daynightpvp.gui.MainGui; | ||
import org.callvdois.daynightpvp.utils.PlayerUtils; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class DnpCommand implements CommandExecutor { | ||
|
||
private final MainGui mainGui; | ||
private final FilesManager filesManager; | ||
private final LangManager langManager; | ||
|
||
public DnpCommand() { | ||
mainGui = new MainGui(); | ||
filesManager = new FilesManager(); | ||
langManager = new LangManager(); | ||
} | ||
|
||
@Override | ||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) { | ||
if (sender instanceof Player player) { | ||
if (sender.hasPermission("dnp.admin")) { | ||
if (args.length == 0) { | ||
mainGui.open(player); | ||
return true; | ||
} | ||
if (args.length == 1) { | ||
if (args[0].equals("reload")) { | ||
filesManager.reloadPlugin(); | ||
PlayerUtils.sendMessageToPlayer(player, langManager.getFeedbackReloadPlugin()); | ||
return true; | ||
} else { | ||
PlayerUtils.sendMessageToPlayer(player, langManager.getFeedbackNonExistentCommand()); | ||
return false; | ||
} | ||
} | ||
return false; | ||
} else { | ||
PlayerUtils.sendMessageToPlayer(player, "§8[§e☀§8] §9DayNightPvP §8- §7v" + DayNightPvP.getInstance().getDescription().getVersion()); | ||
return false; | ||
} | ||
} else { | ||
sender.sendMessage("This command can only be executed by players."); | ||
return false; | ||
} | ||
} | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/org/callvdois/daynightpvp/commands/DnpTabCompleter.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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.callvdois.daynightpvp.commands; | ||
|
||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.command.TabCompleter; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
public class DnpTabCompleter implements TabCompleter { | ||
|
||
@Override | ||
public List<String> onTabComplete(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String[] strings) { | ||
return Collections.emptyList(); | ||
} | ||
} |
8 changes: 0 additions & 8 deletions
8
src/main/java/org/callvdois/daynightpvp/commands/SubCommandHandler.java
This file was deleted.
Oops, something went wrong.
52 changes: 0 additions & 52 deletions
52
src/main/java/org/callvdois/daynightpvp/commands/dnp/DnpCommand.java
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
src/main/java/org/callvdois/daynightpvp/commands/dnp/reload/DnpReloadCommand.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.