mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
completely re-do console
This commit is contained in:
parent
7c74df2aa2
commit
266d374167
15 changed files with 225 additions and 126 deletions
|
@ -52,8 +52,8 @@ public class ChatColor {
|
|||
public static final String RESET = ESCAPE + "r";
|
||||
|
||||
public static String toANSI(String string) {
|
||||
string = string.replace(BOLD, "");
|
||||
string = string.replace(OBFUSCATED, (char) 0x1b + "[6m");
|
||||
string = string.replace(BOLD, (char) 0x1b + "[1m");
|
||||
string = string.replace(OBFUSCATED, (char) 0x1b + "[5m");
|
||||
string = string.replace(ITALIC, (char) 0x1b + "[3m");
|
||||
string = string.replace(UNDERLINE, (char) 0x1b + "[4m");
|
||||
string = string.replace(STRIKETHROUGH, (char) 0x1b + "[9m");
|
||||
|
|
69
api/src/main/java/org/geysermc/api/ConsoleColors.java
Normal file
69
api/src/main/java/org/geysermc/api/ConsoleColors.java
Normal file
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
* Copyright (c) 2019 GeyserMC. http://geysermc.org
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
* @author GeyserMC
|
||||
* @link https://github.com/GeyserMC/Geyser
|
||||
*/
|
||||
|
||||
package org.geysermc.api;
|
||||
|
||||
public class ConsoleColors {
|
||||
public static final String RESET = "\u001b[0m";
|
||||
|
||||
public static final String BOLD = "\u001b[1m";
|
||||
public static final String BLINK = "\u001b[5m";
|
||||
|
||||
public static final String WHITE = "\u001b[30m";
|
||||
public static final String RED = "\u001b[31m";
|
||||
public static final String GREEN = "\u001b[32m";
|
||||
public static final String YELLOW = "\u001b[33m";
|
||||
public static final String BLUE = "\u001b[34m";
|
||||
public static final String MAGENTA = "\u001b[35m";
|
||||
public static final String CYAN = "\u001b[36m";
|
||||
public static final String LIGHT_GRAY = "\u001b[37m";
|
||||
|
||||
public static final String DARK_GRAY = "\u001b[90m";
|
||||
public static final String BRIGHT_RED = "\u001b[91m";
|
||||
public static final String BRIGHT_GREEN = "\u001b[92m";
|
||||
public static final String BRIGHT_YELLOW = "\u001b[93m";
|
||||
public static final String BRIGHT_BLUE = "\u001b[94m";
|
||||
public static final String BRIGHT_MAGENTA = "\u001b[95m";
|
||||
public static final String BRIGHT_CYAN = "\u001b[96m";
|
||||
public static final String BLACK = "\u001b[97m";
|
||||
|
||||
public static final String BLACK_BACKGROUND = "\u001b[30m";
|
||||
public static final String RED_BACKGROUND = "\u001b[31m";
|
||||
public static final String GREEN_BACKGROUND = "\u001b[32m";
|
||||
public static final String YELLOW_BACKGROUND = "\u001b[33m";
|
||||
public static final String BLUE_BACKGROUND = "\u001b[34m";
|
||||
public static final String MAGENTA_BACKGROUND = "\u001b[35m";
|
||||
public static final String CYAN_BACKGROUND = "\u001b[36m";
|
||||
public static final String WHITE_BACKGROUND = "\u001b[37m";
|
||||
|
||||
/*public static final String BLACK_BACKGROUND = "\u001b[30m";
|
||||
public static final String RED_BACKGROUND = "\u001b[31m";
|
||||
public static final String GREEN_BACKGROUND = "\u001b[32m";
|
||||
public static final String YELLOW_BACKGROUND = "\u001b[33m";
|
||||
public static final String BLUE_BACKGROUND = "\u001b[34m";
|
||||
public static final String MAGENTA_BACKGROUND = "\u001b[35m";
|
||||
public static final String CYAN_BACKGROUND = "\u001b[36m";
|
||||
public static final String WHITE_BACKGROUND = "\u001b[37m";*/
|
||||
}
|
4
api/src/main/java/org/geysermc/api/GeyserAPI.java
Normal file
4
api/src/main/java/org/geysermc/api/GeyserAPI.java
Normal file
|
@ -0,0 +1,4 @@
|
|||
package org.geysermc.api;
|
||||
|
||||
public class GeyserAPI {
|
||||
}
|
|
@ -27,13 +27,6 @@ package org.geysermc.api.logger;
|
|||
|
||||
public interface Logger {
|
||||
|
||||
/**
|
||||
* Logs an info message to console
|
||||
*
|
||||
* @param message the message to log
|
||||
*/
|
||||
void info(String message);
|
||||
|
||||
/**
|
||||
* Logs a severe message to console
|
||||
*
|
||||
|
@ -41,6 +34,13 @@ public interface Logger {
|
|||
*/
|
||||
void severe(String message);
|
||||
|
||||
/**
|
||||
* Logs an error message to console
|
||||
*
|
||||
* @param message the message to log
|
||||
*/
|
||||
void error(String message);
|
||||
|
||||
/**
|
||||
* Logs a warning message to console
|
||||
*
|
||||
|
@ -48,6 +48,13 @@ public interface Logger {
|
|||
*/
|
||||
void warning(String message);
|
||||
|
||||
/**
|
||||
* Logs an info message to console
|
||||
*
|
||||
* @param message the message to log
|
||||
*/
|
||||
void info(String message);
|
||||
|
||||
/**
|
||||
* Logs a debug message to console
|
||||
*
|
||||
|
|
|
@ -28,6 +28,10 @@ package org.geysermc.api.plugin;
|
|||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* The class that any main plugin class should extend.
|
||||
* The first init point is the constructor, followed by onLoad, and finally onEnable.
|
||||
*/
|
||||
public class Plugin {
|
||||
|
||||
@Getter
|
||||
|
@ -54,4 +58,11 @@ public class Plugin {
|
|||
public void onLoad() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when th server is reloaded
|
||||
*/
|
||||
public void onReload() {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue