Skip to content

Commit

Permalink
receives message: base color is white not black
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Aug 14, 2022
1 parent 856e6de commit a62a682
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
@@ -1,7 +1,5 @@
package com.denizenscript.denizen.events.player;

import net.md_5.bungee.api.ChatColor;

public class PlayerReceivesActionbarScriptEvent extends PlayerReceivesMessageScriptEvent {

// <--[event]
Expand Down Expand Up @@ -34,11 +32,6 @@ public PlayerReceivesActionbarScriptEvent() {
instance = this;
}

@Override
public ChatColor baseColor() {
return ChatColor.WHITE;
}

public static PlayerReceivesActionbarScriptEvent instance;

@Override
Expand Down
Expand Up @@ -53,10 +53,6 @@ public PlayerReceivesMessageScriptEvent() {
public PlayerTag player;
public boolean loaded;

public ChatColor baseColor() {
return ChatColor.BLACK;
}

public void reset() {
player = null;
message = null;
Expand Down Expand Up @@ -94,13 +90,13 @@ public boolean applyDetermination(ScriptPath path, ObjectTag determinationObj) {
String lower = CoreUtilities.toLowerCase(determination);
if (lower.startsWith("message:")) {
message = new ElementTag(determination.substring("message:".length()), true);
rawJson = new ElementTag(ComponentSerializer.toString(FormattedTextHelper.parse(message.asString(), baseColor())), true);
rawJson = new ElementTag(ComponentSerializer.toString(FormattedTextHelper.parse(message.asString(), ChatColor.WHITE)), true);
modified = true;
return true;
}
if (lower.startsWith("raw_json:")) {
rawJson = new ElementTag(determination.substring("raw_json:".length()));
message = new ElementTag(FormattedTextHelper.stringify(ComponentSerializer.parse(rawJson.asString()), baseColor()), true);
message = new ElementTag(FormattedTextHelper.stringify(ComponentSerializer.parse(rawJson.asString()), ChatColor.WHITE), true);
modified = true;
return true;
}
Expand Down

0 comments on commit a62a682

Please sign in to comment.