mirror of
https://github.com/YouHaveTrouble/NotJustNameplates.git
synced 2026-05-12 06:26:58 +00:00
cleanup
This commit is contained in:
@@ -13,7 +13,6 @@ import java.util.HashMap;
|
||||
public class NJNConfig {
|
||||
|
||||
private final NotJustNameplates plugin;
|
||||
private FileConfiguration config;
|
||||
|
||||
private final HashMap<String, DisplayContent> displayContents = new HashMap<>();
|
||||
|
||||
@@ -24,7 +23,7 @@ public class NJNConfig {
|
||||
plugin.saveDefaultConfig();
|
||||
plugin.reloadConfig();
|
||||
|
||||
this.config = plugin.getConfig();
|
||||
FileConfiguration config = plugin.getConfig();
|
||||
|
||||
ConfigurationSection messagesSection = config.getConfigurationSection("messages");
|
||||
if (messagesSection == null) {
|
||||
|
||||
@@ -2,7 +2,6 @@ package me.youhavetrouble.notjustnameplates;
|
||||
|
||||
import me.youhavetrouble.notjustnameplates.commands.MainCommand;
|
||||
import me.youhavetrouble.notjustnameplates.nameplates.TeamManagementListener;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.permissions.PermissionDefault;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.util.permissions.DefaultPermissions;
|
||||
|
||||
+10
-10
@@ -1,27 +1,19 @@
|
||||
package me.youhavetrouble.notjustnameplates.nameplates;
|
||||
|
||||
import io.papermc.paper.event.entity.EntityPortalReadyEvent;
|
||||
import me.youhavetrouble.notjustnameplates.NotJustNameplates;
|
||||
import me.youhavetrouble.notjustnameplates.displays.DisplayContent;
|
||||
import net.minecraft.network.protocol.game.ClientboundSetPlayerTeamPacket;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraft.world.scores.PlayerTeam;
|
||||
import net.minecraft.world.scores.Scoreboard;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.TextDisplay;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.EntityPortalEnterEvent;
|
||||
import org.bukkit.event.entity.EntityPortalExitEvent;
|
||||
import org.bukkit.event.player.*;
|
||||
import org.bukkit.persistence.PersistentDataType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.purpurmc.purpur.event.entity.EntityTeleportHinderedEvent;
|
||||
|
||||
@@ -70,9 +62,17 @@ public class TeamManagementListener implements Listener {
|
||||
|
||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
|
||||
public void onPlayerMove(PlayerMoveEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
if (player.getGameMode() == GameMode.SPECTATOR) {
|
||||
Nameplate nameplate = players.get(player.getName());
|
||||
if (nameplate == null) return;
|
||||
nameplate.forceHide = true;
|
||||
nameplate.remove();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!event.hasChangedPosition()) return;
|
||||
|
||||
Player player = event.getPlayer();
|
||||
Nameplate nameplate = players.get(player.getName());
|
||||
if (nameplate == null) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user