-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
break changes (change command manager, permission, commands)
- Loading branch information
Showing
19 changed files
with
763 additions
and
533 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 |
---|---|---|
|
@@ -7,6 +7,8 @@ | |
.idea | ||
*.iml | ||
|
||
dependency-reduced-pom.xml | ||
|
||
# Ignore output generated files | ||
target | ||
out |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package fr.nivcoo.pointz.commands; | ||
|
||
import fr.nivcoo.pointz.Pointz; | ||
import fr.nivcoo.pointz.constructor.PlayersInformations; | ||
import fr.nivcoo.utilsz.commands.Command; | ||
import org.bukkit.Bukkit; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.plugin.java.JavaPlugin; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
public interface CCommand extends Command { | ||
|
||
default void execute(JavaPlugin plugin, CommandSender sender, String[] args) { | ||
execute((Pointz) plugin, sender, args); | ||
} | ||
|
||
default List<String> tabComplete(JavaPlugin plugin, CommandSender sender, String[] args) { | ||
return tabComplete((Pointz) plugin, sender, args); | ||
} | ||
|
||
void execute(Pointz plugin, CommandSender sender, String[] args); | ||
|
||
List<String> tabComplete(Pointz plugin, CommandSender sender, String[] args); | ||
|
||
default PlayersInformations getWebsiteUser(Player p) { | ||
List<PlayersInformations> users = Pointz.get().getWebsiteAPI().getPlayersInfos(Collections.singletonList(p)); | ||
return users.get(0); | ||
} | ||
|
||
default List<String> getOnlinePlayersNames() { | ||
List<String> players = new ArrayList<>(); | ||
for (Player p : Bukkit.getOnlinePlayers()) { | ||
players.add(p.getName()); | ||
} | ||
return players; | ||
} | ||
} |
Oops, something went wrong.