actually fix the commands and remove gray npc names because adventure is complaining
This commit is contained in:
parent
1d2573947a
commit
5225410814
2 changed files with 2 additions and 4 deletions
|
@ -20,7 +20,7 @@ public class CommandInvoker {
|
|||
|
||||
public void execute(CommandSender sender, Object command) throws CommandException {
|
||||
// Check if the sender is not a player
|
||||
if (!(sender instanceof Player player))
|
||||
if (!(sender.getCommandSender() instanceof Player player))
|
||||
throw new CommandException("Only players may execute this command.");
|
||||
|
||||
// Check if the permission is not empty and the player does not have the permission
|
||||
|
|
|
@ -13,7 +13,6 @@ import io.github.znetworkw.znpcservers.user.ZUser;
|
|||
import io.github.znetworkw.znpcservers.utility.Utils;
|
||||
import io.github.znetworkw.znpcservers.utility.location.ZLocation;
|
||||
import lol.pyr.znpcsplus.ZNPCsPlus;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
@ -21,7 +20,6 @@ import java.util.*;
|
|||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class NPC {
|
||||
private static final ConcurrentMap<Integer, NPC> NPC_MAP = new ConcurrentHashMap<>();
|
||||
private final Set<ZUser> viewers = new HashSet<>();
|
||||
|
@ -72,7 +70,7 @@ public class NPC {
|
|||
|
||||
public void onLoad() {
|
||||
if (NPC_MAP.containsKey(getNpcPojo().getId())) throw new IllegalStateException("npc with id " + getNpcPojo().getId() + " already exists.");
|
||||
this.gameProfile = new GameProfile(UUID.randomUUID(), ChatColor.GRAY + "[ZNPC] " + this.npcName);
|
||||
this.gameProfile = new GameProfile(UUID.randomUUID(), "[ZNPC] " + this.npcName);
|
||||
this.gameProfile.getProperties().put("textures", new Property("textures", this.npcPojo.getSkin(), this.npcPojo.getSignature()));
|
||||
changeType(this.npcPojo.getNpcType());
|
||||
updateProfile(this.gameProfile.getProperties());
|
||||
|
|
Loading…
Reference in a new issue