Compare commits

...

3 commits

Author SHA1 Message Date
6aa369dde1 updated java version 2024-05-04 20:54:34 +02:00
839d3b9e79 updated project 2024-05-04 20:54:09 +02:00
66966c6efe Fixed mcweb command 2024-05-04 20:53:27 +02:00
7 changed files with 27 additions and 30 deletions

View file

@ -12,7 +12,7 @@ jobs:
matrix: matrix:
# Use these Java versions # Use these Java versions
java: [ java: [
17, # Current Java LTS & minimum supported by Minecraft 21, # Current Java LTS & minimum supported by Minecraft
] ]
# and run on both Linux and Windows # and run on both Linux and Windows
os: [ubuntu-22.04, windows-2022] os: [ubuntu-22.04, windows-2022]

View file

@ -1,5 +1,5 @@
plugins { plugins {
id 'fabric-loom' version '1.4-SNAPSHOT' id 'fabric-loom' version '1.6-SNAPSHOT'
id 'maven-publish' id 'maven-publish'
} }
@ -31,8 +31,6 @@ loom {
} }
dependencies { dependencies {
implementation 'org.projectlombok:lombok:1.18.26'
annotationProcessor 'org.projectlombok:lombok:1.18.26'
// To change the versions see the gradle.properties file // To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}" minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
@ -41,11 +39,9 @@ dependencies {
// Fabric API. This is technically optional, but you probably want it anyway. // Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
// Uncomment the following line to enable the deprecated Fabric API modules. compileOnly 'org.projectlombok:lombok:1.18.32'
// These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time. annotationProcessor 'org.projectlombok:lombok:1.18.32'
// modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}"
//implementation 'com.google.code.gson:gson:2.10.1'
} }
processResources { processResources {
@ -57,7 +53,7 @@ processResources {
} }
tasks.withType(JavaCompile).configureEach { tasks.withType(JavaCompile).configureEach {
it.options.release = 17 it.options.release = 21
} }
java { java {
@ -66,8 +62,8 @@ java {
// If you remove this line, sources will not be generated. // If you remove this line, sources will not be generated.
withSourcesJar() withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_17 sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_21
} }
jar { jar {
@ -79,7 +75,8 @@ jar {
// configure the maven publication // configure the maven publication
publishing { publishing {
publications { publications {
mavenJava(MavenPublication) { create("mavenJava", MavenPublication) {
artifactId = project.archives_base_name
from components.java from components.java
} }
} }

View file

@ -4,14 +4,14 @@ org.gradle.parallel=true
# Fabric Properties # Fabric Properties
# check these on https://fabricmc.net/develop # check these on https://fabricmc.net/develop
minecraft_version=1.20.4 minecraft_version=1.20.6
yarn_mappings=1.20.4+build.1 yarn_mappings=1.20.6+build.1
loader_version=0.15.0 loader_version=0.15.10
# Mod Properties # Mod Properties
mod_version = 0.3.3 mod_version = 0.3.4
maven_group = me.jonasjones maven_group = me.jonasjones
archives_base_name = mcwebserver-fabric-quilt archives_base_name = mcwebserver-fabric-quilt
# Dependencies # Dependencies
fabric_version=0.91.1+1.20.4 fabric_version=0.97.8+1.20.6

Binary file not shown.

View file

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

20
gradlew.bat vendored
View file

@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1 %JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute if %ERRORLEVEL% equ 0 goto execute
echo. echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. echo location of your Java installation. 1>&2
goto fail goto fail
@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute if exist "%JAVA_EXE%" goto execute
echo. echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. echo location of your Java installation. 1>&2
goto fail goto fail

View file

@ -42,7 +42,7 @@ public class McWebCommand {
if (MC_SERVER != null) { if (MC_SERVER != null) {
// get the player name // get the player name
String playerName = Objects.requireNonNull(context.getSource().getPlayer()).getName().getString(); String playerName = Objects.requireNonNull(context.getSource().getPlayer()).getName().getString();
MC_SERVER.getCommandManager().executeWithPrefix(MC_SERVER.getCommandSource(), "tellraw " + playerName + " [\"\",\"Token (will only show once): \",\"\\n\",\"[\",{\"text\":\"" + result + "\",\"color\":\"green\",\"clickEvent\":{\"action\":\"copy_to_clipboard\",\"value\":\"\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to Copy to Clipboard\"]}},\"]\"]"); MC_SERVER.getCommandManager().executeWithPrefix(MC_SERVER.getCommandSource(), "tellraw " + playerName + " [\"\",\"Token: [\",{\"text\":\"" + result + "\",\"color\":\"green\",\"clickEvent\":{\"action\":\"copy_to_clipboard\",\"value\":\"" + result + "\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to Copy to Clipboard\"]}},\"]\"]");
return 1; return 1;
} }
context.getSource().sendFeedback(() -> Text.of("Failed to create token (Unknown Error)"), false); context.getSource().sendFeedback(() -> Text.of("Failed to create token (Unknown Error)"), false);