Files
src
build.gradle
settings.gradle
Code
10 908
src/main/java/com/kodari/tpafriends/TpaFriendsPlugin.java
package com.kodari.tpafriends;
import org.bukkit.ChatColor;
import org.bukkit.command.PluginCommand;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
public final class TpaFriendsPlugin extends JavaPlugin {
private ProfileStore profiles;
private FriendService friends;
private TeleportService teleports;
private FriendsMenu menu;
@Override
public void onEnable() {
saveDefaultConfig();
profiles = new ProfileStore(this);
friends = new FriendService(this, profiles);
teleports = new TeleportService(this, profiles);
menu = new FriendsMenu(this, profiles, friends);
PluginCommands commands = new PluginCommands(this, profiles, friends, teleports, menu);
for (String name : new String[] {"tpa", "tpahere", "tpaccept", "tpdeny", "friend", "friends",
"home", "homes", "sethome", "delhome", "homeinvite", "homeuninvite"}) {
PluginCommand command = getCommand(name);
if (command != null) {
command.setExecutor(commands);
command.setTabCompleter(commands);
}
}
getServer().getPluginManager().registerEvents(menu, this);
}
public void tell(Player player, String message) {
player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&6[TpaFriends] &r" + message));
}
}