-
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.
- Loading branch information
BuildTools
committed
Aug 7, 2019
1 parent
4f29ac8
commit 395267e
Showing
2 changed files
with
49 additions
and
0 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,5 @@ | ||
name: NoNameTag | ||
main: ca.fastis.NoNameTag | ||
version: 1.0 | ||
author: Auracle | ||
api-version: 1.14 |
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,44 @@ | ||
package ca.fastis; | ||
|
||
|
||
import org.bukkit.ChatColor; | ||
import org.bukkit.Server; | ||
import org.bukkit.command.ConsoleCommandSender; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.Listener; | ||
import org.bukkit.event.player.PlayerJoinEvent; | ||
import org.bukkit.plugin.Plugin; | ||
import org.bukkit.plugin.java.JavaPlugin; | ||
import org.bukkit.scoreboard.NameTagVisibility; | ||
import org.bukkit.scoreboard.ScoreboardManager; | ||
import org.bukkit.scoreboard.Team; | ||
|
||
@SuppressWarnings("deprecation") | ||
public class NoNameTag extends JavaPlugin implements Listener { | ||
static Server server; | ||
static ConsoleCommandSender console; | ||
static Plugin plugin; | ||
Team NoNameTagTeam; | ||
|
||
public void onEnable() { | ||
plugin = this; | ||
server = this.getServer(); | ||
console = server.getConsoleSender(); | ||
server.getPluginManager().registerEvents(this, this); | ||
ScoreboardManager sbm = server.getScoreboardManager(); | ||
if (sbm.getMainScoreboard().getTeam("NoNameTagTeam") == null) sbm.getMainScoreboard().registerNewTeam("NoNameTagTeam"); | ||
NoNameTagTeam = sbm.getMainScoreboard().getTeam("NoNameTagTeam"); | ||
NoNameTagTeam.setNameTagVisibility(NameTagVisibility.NEVER); | ||
console.sendMessage(ChatColor.GREEN + "" + ChatColor.ITALIC + "NoNameTag Loaded"); | ||
} | ||
|
||
@EventHandler | ||
public void onPlayerJoin(PlayerJoinEvent event) { | ||
NoNameTagTeam.addPlayer(event.getPlayer()); | ||
} | ||
|
||
@Override | ||
public void onDisable() { | ||
console.sendMessage(ChatColor.RED + "NoNameTag Disabled"); | ||
} | ||
} |