#Spigot sendMessage() Skipping Lines

1 messages · Page 1 of 1 (latest)

mellow atlas
#

Hello, When I am using the getConsoleSender().sendMessage(message) it seems to be skipping a line in the console. I have never had this error before and cannot see what mistake I made.

#
public static String CONSOLE_PREFIX = "&6[&aMyPlugin&6] &f: ";
#
this.getServer().getConsoleSender().sendMessage(ChatColor.translateAlternateColorCodes('&', CONSOLE_PREFIX + "Test"));
this.getServer().getConsoleSender().sendMessage(ChatColor.translateAlternateColorCodes('&', CONSOLE_PREFIX + "Test1"));
wise hollow
#

I think its to do with you using getConsoleSender() to send a messgae

#

DO you get the same issue when using Bukkit's logger or your BukkitPlugin logger?

mellow atlas
#

Haven't used Bukket Logger

#

what is the syntax for it?

#

is it this?

this.getLogger().fine(ChatColor.translateAlternateColorCodes('&', CONSOLE_PREFIX + message));
#

nvm I think I foud it

mellow atlas
wise hollow
#

or you can use .log and specify a log level

#

argument for .info is a string

mellow atlas
#

worked, but the colors didn't print out

mellow atlas
#

would it have something to do with maven?

wise hollow
mellow atlas
#

yeah

wise hollow
#

TBF i just use System.out.println when i do logs and create a custom logger class but people will tell you not to use that

mellow atlas
#

should I use Color.?

mellow atlas
#

this is the line I used

this.getLogger().info(ChatColor.translateAlternateColorCodes('&', CONSOLE_PREFIX + message));
#

ok, when I used System.out.println("mgrioegm") it did the line skipping thing

#

when I use the normal print it doesn't

#

this should not happen

autumn jewel
#

you would be correct

#

that should not be happening tf

mellow atlas
#

IKR

#

LIKE WTF

autumn jewel
#

what terminal is that running in

mellow atlas
#

command prompt

autumn jewel
#

why are the colors different

mellow atlas
#

fine, it's macos terminal (don't hate on me).
Still it never happened before

autumn jewel
#

try it with regular cmd see if it still happens

mellow atlas
#

that is regular cmd

autumn jewel
#

oh

#

mac os..

mellow atlas
#

mac is unix tho and so is linux.

#

let me right a normal hello world in java... with 2 println

#

I want to see what happens

autumn jewel
#

try it without colors

mellow atlas
#

ok

#

I'm just going to remove the translate. It will just print out the & sign

autumn jewel
#

ok

mellow atlas
wise hollow
autumn jewel
#

send the whole function thats sending that

mellow atlas
#
public void sendToConsole(String message)
{
    this.getServer().getConsoleSender().sendMessage(CONSOLE_PREFIX  + message);
}
#
this.sendToConsole("&fStatus: &aEnabled");
this.sendToConsole("&fVersion &av" + PLUGIN_VERSION);
this.sendToConsole("&fAuthors: &a" + PLUGIN_AUTHORS);
#
public static String CONSOLE_PREFIX = "&6[&aParrotPanel&6] &f: ";
#

question, would maven have any cause for this?

autumn jewel
#

doubt

mellow atlas
#

because last time I checked, it didn't

autumn jewel
#

send ur defs for plugin_version and plugin_author too

mellow atlas
#

let me write a normal java program

shrewd steeple
#

does this issue persist through different platforms / jars?

mellow atlas
shrewd steeple
#

Pterdactyl / localhost?

mellow atlas
#

local host

shrewd steeple
#

have you tried launching the server differently? are you using a custom filter / CMD setup?

mellow atlas
shrewd steeple
#

are you able to upload the .jar / whole source code?

mellow atlas
#

I can upload the jar

autumn jewel
#

yes send the jar

mellow atlas
#

the github is private, I can make it public for a sec

autumn jewel
#

ill try it

autumn jewel
#

holy long

mellow atlas
#

wtf?

autumn jewel
#

so its a mac issue

shrewd steeple
#

it is most likely a platform issue

mellow atlas
#

then it's my comptuer then

shrewd steeple
#

what server version are you running?

mellow atlas
#

let me check

autumn jewel
#

it runs on my 1.17 server so

mellow atlas
#

1.12.2

#

let me try 1.17

autumn jewel
#

k

mellow atlas
#

well... now I'm really confused

autumn jewel
#

hmm

#

1.12 is poopoo

shrewd steeple
#

^

#

paper or spigot?

mellow atlas
#

spigot

shrewd steeple
#

interesting

#

well- is there a reason why you're using 1.12?

mellow atlas
#

well.. that's the only way I know how to do backwards and sometimes forward compatibility

#

Ik there is another, but I don't fully understand it

#

If I make it 1.17 would it still work on 1.8-1.16. That is one of my concerns

autumn jewel
#

some will

#

some wont

#

nms will have to be updated.

mellow atlas
#

So if I don’t use any nms then I don’t need to worry about it?

shrewd steeple
#

I would recommend coding with the lowest version you want to support

#

you won't have access to the newer API additions