diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/script/lua/SteamWarLuaPlugin.java b/BauSystem_Main/src/de/steamwar/bausystem/features/script/lua/SteamWarLuaPlugin.java index f6b0da69..b2bf51cc 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/script/lua/SteamWarLuaPlugin.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/script/lua/SteamWarLuaPlugin.java @@ -31,6 +31,7 @@ import de.steamwar.bausystem.features.world.WorldEditListener; import de.steamwar.bausystem.utils.WorldEditUtils; import de.steamwar.inventory.SWAnvilInv; import org.bukkit.Bukkit; +import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.entity.Player; @@ -192,7 +193,7 @@ public class SteamWarLuaPlugin extends TwoArgFunction { class Print extends VarArgFunction { @Override public Varargs invoke(Varargs args) { - player.sendMessage(varArgsToString(args).replaceAll("&([a-z0-9klmnor])", "§\1")); + player.sendMessage(ChatColor.translateAlternateColorCodes('&', varArgsToString(args))); return LuaValue.NIL; } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/script/lua/libs/PlayerLib.java b/BauSystem_Main/src/de/steamwar/bausystem/features/script/lua/libs/PlayerLib.java index 9a6441da..d4895693 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/script/lua/libs/PlayerLib.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/script/lua/libs/PlayerLib.java @@ -22,7 +22,7 @@ package de.steamwar.bausystem.features.script.lua.libs; import de.steamwar.linkage.Linked; import net.md_5.bungee.api.ChatMessageType; import net.md_5.bungee.api.chat.TextComponent; -import org.bukkit.Color; +import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.entity.Player; import org.luaj.vm2.LuaTable; @@ -94,7 +94,7 @@ public class PlayerLib implements LuaLib { @Override public Varargs invoke(Varargs args) { - player.sendMessage(varArgsToString(args).replaceAll("&([a-z0-9klmnor])", "§\1")); + player.sendMessage(ChatColor.translateAlternateColorCodes('&', varArgsToString(args))); return LuaValue.NIL; } } @@ -108,7 +108,7 @@ public class PlayerLib implements LuaLib { @Override public Varargs invoke(Varargs args) { - player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(varArgsToString(args).replaceAll("&([a-z0-9klmnor])", "§\1"))); + player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(ChatColor.translateAlternateColorCodes('&', varArgsToString(args)))); return LuaValue.NIL; } }