Skip to content

Commit

Permalink
3.1.0 & #30 Installer
Browse files Browse the repository at this point in the history
  • Loading branch information
XDPXI committed Nov 19, 2024
1 parent 0ae4591 commit 4e7045c
Show file tree
Hide file tree
Showing 15 changed files with 75 additions and 34 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
org.gradle.jvmargs=-Xmx8G
org.gradle.parallel=true

mod_version=3.0.1
mod_version=3.1.0
maven_group=dev.xdpxi
archives_base_name=xdlib
Binary file modified installer/XDLibInstaller.jar
Binary file not shown.
12 changes: 9 additions & 3 deletions installer/XDLibInstaller.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static void main(String[] args) {
frame.setUndecorated(true);
frame.setShape(new RoundRectangle2D.Double(0, 0, frame.getWidth(), frame.getHeight(), 20, 20));
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setCustomIcon(frame, "https://raw.githubusercontent.com/Ztrolix/ZtrolixLibs/main/assets/icon.png");
setCustomIcon(frame, "https://raw.githubusercontent.com/Ztrolix/ZtrolixLibs/main/assets/r-icon.png");

addDraggableFeature(frame);

Expand Down Expand Up @@ -261,14 +261,18 @@ private static String getModrinthUrl(String loader, String version) {
return FABRIC_API_BASE_URL + "Yolngp3s/fabric-api-0.91.1%2B1.20.3.jar";
case "1.20.4":
return FABRIC_API_BASE_URL + "QVBohPm2/fabric-api-0.97.2%2B1.20.4.jar";
case "1.20.5":
return FABRIC_API_BASE_URL + "GCdY4I8I/fabric-api-0.97.8%2B1.20.5.jar";
case "1.20.6":
return FABRIC_API_BASE_URL + "ocg4hG3t/fabric-api-0.100.8%2B1.20.6.jar";
case "1.21":
return FABRIC_API_BASE_URL + "oGwyXeEI/fabric-api-0.102.0%2B1.21.jar";
case "1.21.1":
return FABRIC_API_BASE_URL + "GcoFPm9u/fabric-api-0.108.0%2B1.21.1.jar";
return FABRIC_API_BASE_URL + "aHuj8q0Q/fabric-api-0.109.0%2B1.21.1.jar";
case "1.21.2":
return FABRIC_API_BASE_URL + "UEjZZNue/fabric-api-0.106.1%2B1.21.2.jar";
case "1.21.3":
return FABRIC_API_BASE_URL + "kwP1bhmH/fabric-api-0.108.0%2B1.21.3.jar";
return FABRIC_API_BASE_URL + "Xhw2LuSh/fabric-api-0.109.0%2B1.21.3.jar";
default:
return null;
}
Expand Down Expand Up @@ -305,6 +309,8 @@ private static void updateVersionDropdown(String selectedLoader, JComboBox<Strin
versionDropdown.addItem("1.21.2");
versionDropdown.addItem("1.21.1");
versionDropdown.addItem("1.21");
versionDropdown.addItem("1.20.6");
versionDropdown.addItem("1.20.5");
versionDropdown.addItem("1.20.4");
versionDropdown.addItem("1.20.3");
versionDropdown.addItem("1.20.2");
Expand Down
89 changes: 62 additions & 27 deletions installer/compile.bat
Original file line number Diff line number Diff line change
@@ -1,38 +1,73 @@
@echo off
set JAVA_FILE=XDLibInstaller.java
set CLASS_FILES=XDLibInstaller*.class
set MANIFEST_FILE=manifest.txt
set JAR_FILE=XDLibInstaller.jar
set FLATLAF_JAR=flatlaf-3.5.2.jar

echo Compiling %JAVA_FILE%...
javac -cp %FLATLAF_JAR% -Xlint:deprecation %JAVA_FILE%
if %errorlevel% neq 0 (
echo Compilation failed!
setlocal EnableDelayedExpansion

:: Configuration
set "JAVA_FILE=XDLibInstaller.java"
set "CLASS_FILES=XDLibInstaller*.class"
set "MANIFEST_FILE=manifest.txt"
set "JAR_FILE=XDLibInstaller.jar"
set "FLATLAF_JAR=flatlaf-3.5.2.jar"

:: Check if Java is installed
where java >nul 2>nul
if %ERRORLEVEL% neq 0 (
echo Error: Java is not installed or not in PATH
pause
exit /b %errorlevel%
exit /b 1
)

echo Creating JAR file %JAR_FILE%...
echo Main-Class: XDLibInstaller > %MANIFEST_FILE%
jar cfm %JAR_FILE% %MANIFEST_FILE% %CLASS_FILES%
if %errorlevel% neq 0 (
echo Failed to create JAR file!
:: Check if required files exist
if not exist "%JAVA_FILE%" (
echo Error: %JAVA_FILE% not found
pause
exit /b %errorlevel%
exit /b 1
)

echo Running %JAR_FILE%...
java -cp "%JAR_FILE%;%FLATLAF_JAR%" XDLibInstaller
if %errorlevel% neq 0 (
echo Failed to run JAR file!
if not exist "%FLATLAF_JAR%" (
echo Error: %FLATLAF_JAR% not found
pause
exit /b %errorlevel%
exit /b 1
)

echo Cleaning up...
del %CLASS_FILES%
del %MANIFEST_FILE%
:: Compile
echo [*] Compiling %JAVA_FILE%...
javac -cp "%FLATLAF_JAR%" -Xlint:deprecation "%JAVA_FILE%"
if %ERRORLEVEL% neq 0 (
echo Error: Compilation failed
pause
exit /b %ERRORLEVEL%
)

:: Create JAR
echo [*] Creating JAR file %JAR_FILE%...
(
echo Manifest-Version: 1.0
echo Main-Class: XDLibInstaller
echo Class-Path: %FLATLAF_JAR%
) > "%MANIFEST_FILE%"

jar cfm "%JAR_FILE%" "%MANIFEST_FILE%" %CLASS_FILES%
if %ERRORLEVEL% neq 0 (
echo Error: Failed to create JAR file
pause
exit /b %ERRORLEVEL%
)

:: Run JAR
echo [*] Running %JAR_FILE%...
java -jar "%JAR_FILE%"
if %ERRORLEVEL% neq 0 (
echo Error: Failed to run JAR file
pause
exit /b %ERRORLEVEL%
)

:: Cleanup
echo [*] Cleaning up temporary files...
del /q %CLASS_FILES% 2>nul
del /q %MANIFEST_FILE% 2>nul

echo [*] Done!
pause

echo Done!
pause
endlocal
Binary file modified installer/versions/1.21/bukkit.jar
Binary file not shown.
Binary file modified installer/versions/1.21/bungee.jar
Binary file not shown.
Binary file modified installer/versions/1.21/fabric.jar
Binary file not shown.
Binary file modified installer/versions/1.21/neo.jar
Binary file not shown.
Binary file modified installer/versions/1.21/velo.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion src/main/java/dev/xdpxi/xdlib/plugin/velocity.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import java.nio.file.Path;

@Plugin(id = "xdlib", name = "XDLib", version = "3.0.1", description = "This is a library for many uses and is included as an player counter for XDPXI's mods and modpacks!", url = "https://xdpxi.vercel.app/mc/xdlib", authors = {"XDPXI"})
@Plugin(id = "xdlib", name = "XDLib", version = "3.1.0", description = "This is a library for many uses and is included as an player counter for XDPXI's mods and modpacks!", url = "https://xdpxi.vercel.app/mc/xdlib", authors = {"XDPXI"})
public class velocity {
private final Logger logger;
private final ProxyServer proxyServer;
Expand Down
Binary file modified src/main/resources/XDLibInstaller$4.class
Binary file not shown.
Binary file modified src/main/resources/XDLibInstaller$RoundedBorder.class
Binary file not shown.
Binary file modified src/main/resources/XDLibInstaller.class
Binary file not shown.
2 changes: 1 addition & 1 deletion src/main/resources/bungee.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: XDLib
version: '3.0.1'
version: '3.1.0'
main: dev.xdpxi.xdlib.plugin.bungee
author: XDPXI
description: This is a library for many uses and is included as an player counter for XDPXI's mods and modpacks!
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: XDLib
version: '3.0.1'
version: '3.1.0'
main: dev.xdpxi.xdlib.plugin.xdlib
api-version: '1.21'
prefix: XDLib
Expand Down

0 comments on commit 4e7045c

Please sign in to comment.