Minor changes

This commit is contained in:
RaphiMC 2023-01-04 21:54:49 +01:00
parent 09bbdb41e2
commit e7dba42792
3 changed files with 10 additions and 3 deletions

View File

@ -1,6 +1,7 @@
plugins { plugins {
id "java" id "java"
id "maven-publish" id "maven-publish"
id "net.kyori.blossom" version "1.3.1"
} }
java.toolchain.languageVersion = JavaLanguageVersion.of(8) java.toolchain.languageVersion = JavaLanguageVersion.of(8)
@ -60,6 +61,10 @@ dependencies {
include "net.raphimc.netminecraft:all:2.2.2" include "net.raphimc.netminecraft:all:2.2.2"
} }
blossom {
replaceToken("\${version}", project.version, "src/main/java/net/raphimc/viaproxy/ViaProxy.java")
}
java { java {
withSourcesJar() withSourcesJar()
} }

View File

@ -29,6 +29,8 @@ import java.awt.*;
public class ViaProxy { public class ViaProxy {
public static final String VERSION = "${version}";
public static NetServer currentProxyServer; public static NetServer currentProxyServer;
public static Thread loaderThread; public static Thread loaderThread;
public static ChannelGroup c2pChannels; public static ChannelGroup c2pChannels;
@ -46,7 +48,7 @@ public class ViaProxy {
public static void injectedMain(String[] args) throws InterruptedException { public static void injectedMain(String[] args) throws InterruptedException {
Logger.setup(); Logger.setup();
ConsoleHandler.hookConsole(); ConsoleHandler.hookConsole();
Logger.LOGGER.info("Initializing ViaProxy..."); Logger.LOGGER.info("Initializing ViaProxy v" + VERSION + "...");
VersionEnum.init(); VersionEnum.init();
setNettyParameters(); setNettyParameters();
MCPipeline.useOptimizedPipeline(); MCPipeline.useOptimizedPipeline();

View File

@ -61,7 +61,7 @@ public class ViaProxyUI extends JFrame {
} }
private void initWindow() { private void initWindow() {
this.setTitle("ViaProxy"); this.setTitle("ViaProxy v" + ViaProxy.VERSION);
this.setIconImage(this.icon.getImage()); this.setIconImage(this.icon.getImage());
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setSize(500, 370); this.setSize(500, 370);
@ -131,7 +131,7 @@ public class ViaProxyUI extends JFrame {
this.contentPane.add(this.serverVersion); this.contentPane.add(this.serverVersion);
} }
{ {
JLabel bindPortLabel = new JLabel("Bind Port:"); JLabel bindPortLabel = new JLabel("Local Port:");
bindPortLabel.setBounds(10, 150, 100, 20); bindPortLabel.setBounds(10, 150, 100, 20);
this.contentPane.add(bindPortLabel); this.contentPane.add(bindPortLabel);