Skip to content

Commit

Permalink
fix disguise global without a player link
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Mar 23, 2021
1 parent 4f17f4e commit 7179849
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
Expand Up @@ -351,7 +351,7 @@ public void execute(ScriptEntry scriptEntry) {
playerMap = disguises.computeIfAbsent(entity.getUUID(), k -> new HashMap<>());
playerMap.put(null, disguise);
disguise.isActive = true;
ArrayList<PlayerTag> playerSet = new ArrayList<>(players);
ArrayList<PlayerTag> playerSet = players == null ? new ArrayList<>() : new ArrayList<>(players);
for (Player player : entity.getWorld().getPlayers()) {
if (!playerSet.contains(new PlayerTag(player)) && !player.getUniqueId().equals(entity.getUUID())) {
playerSet.add(new PlayerTag(player));
Expand All @@ -360,10 +360,12 @@ public void execute(ScriptEntry scriptEntry) {
disguise.sendTo(playerSet);
}
else {
for (PlayerTag player : players) {
playerMap = disguises.computeIfAbsent(entity.getUUID(), k -> new HashMap<>());
playerMap.put(player.getUUID(), disguise);
disguise.isActive = true;
if (players != null) {
for (PlayerTag player : players) {
playerMap = disguises.computeIfAbsent(entity.getUUID(), k -> new HashMap<>());
playerMap.put(player.getUUID(), disguise);
disguise.isActive = true;
}
}
disguise.sendTo(players);
}
Expand Down
@@ -1,6 +1,5 @@
package com.denizenscript.denizen.scripts.containers.core;

import com.denizenscript.denizen.utilities.command.scripted.DenizenCommand;
import com.denizenscript.denizen.utilities.debugging.Debug;
import com.denizenscript.denizen.utilities.implementation.BukkitScriptEntryData;
import com.denizenscript.denizen.objects.NPCTag;
Expand Down
Expand Up @@ -351,7 +351,7 @@ public void run(ReplaceableTagEvent event) {
}, "p");

// <--[tag]
// @attribute <&hover[<hover text>]>
// @attribute <&hover[<hover_text>]>
// @returns ElementTag
// @description
// Returns a special chat code that makes the following text display the input hover text when the mouse is left over it.
Expand All @@ -366,7 +366,7 @@ public void run(ReplaceableTagEvent event) {
String hoverText = attribute.getContext(1);

// <--[tag]
// @attribute <&hover[<hover text>].type[<type>]>
// @attribute <&hover[<hover_text>].type[<type>]>
// @returns ElementTag
// @description
// Returns a special chat code that makes the following text display the input hover text when the mouse is left over it.
Expand All @@ -386,7 +386,7 @@ public void run(ReplaceableTagEvent event) {
}, "&hover");

// <--[tag]
// @attribute <&click[<click command>]>
// @attribute <&click[<click_command>]>
// @returns ElementTag
// @description
// Returns a special chat code that makes the following text execute the input command line value when clicked.
Expand All @@ -403,7 +403,7 @@ public void run(ReplaceableTagEvent event) {
String clickText = attribute.getContext(1);

// <--[tag]
// @attribute <&click[<click command>].type[<type>]>
// @attribute <&click[<click_command>].type[<type>]>
// @returns ElementTag
// @description
// Returns a special chat code that makes the following text execute the input command when clicked.
Expand Down

0 comments on commit 7179849

Please sign in to comment.