Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions mapsync-mod/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ dependencies {
modImplementation(libs.fabricLoader)
modImplementation(libs.fabricApi)

libs.java.ws.also {
project(":dep-websockets", configuration = "shadedElements").also {
implementation(it)
include(it)
}
Expand Down Expand Up @@ -107,7 +107,6 @@ tasks {
this@expansions["mod_issues_url"] = project_issues_url
this@expansions["minecraft_version"] = libs.versions.minecraft.get()
this@expansions["fabric_loader_version"] = libs.versions.fabricLoader.get()
this@expansions["java_websockets_version"] = libs.versions.java.ws.get()
}
inputs.properties(expansions)
filesMatching("fabric.mod.json") {
Expand Down
35 changes: 35 additions & 0 deletions mapsync-mod/dep-websockets/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
plugins {
id("java-library")
alias(libs.plugins.shadow)
}

group = libs.java.ws.get().group
version = libs.java.ws.get().version!!

dependencies {
implementation(libs.java.ws)
}

repositories {
mavenCentral()
}

tasks {
shadowJar {
// Remove slf4j code
exclude("org/slf4j/**", "META-INF/maven/org.slf4j/**")
relocate(
"org.java_websocket",
"gjum.minecraft.mapsync.mod.deps.websockets"
)
}
}

val shadedElements by configurations.creating {
isCanBeConsumed = true
isCanBeResolved = false
}

artifacts {
add(shadedElements.name, tasks.shadowJar)
}
5 changes: 2 additions & 3 deletions mapsync-mod/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ minecraft = "1.21.11"
fabricLoom = "1.15-SNAPSHOT"
fabricLoader = "0.18.6"
fabricApi = "0.141.3+1.21.11"
# https://mvnrepository.com/artifact/org.java-websocket/Java-WebSocket
java-ws = "1.6.0"

[libraries]
minecraft = { group = "com.mojang", name = "minecraft", version.ref = "minecraft" }
Expand All @@ -24,7 +22,8 @@ voxelmap = { group = "maven.modrinth", name = "voxelmap-updated", version = "oL1
journeymap = { group = "maven.modrinth", name = "journeymap", version = "ajOMv0sc" }
# https://modrinth.com/mod/xaeros-world-map/versions?l=fabric
xaerosmap = { group = "maven.modrinth", name = "xaeros-world-map", version = "CkZVhVE0" }
java-ws = { group = "org.java-websocket", name = "Java-WebSocket", version.ref = "java-ws" }
# https://mvnrepository.com/artifact/org.java-websocket/Java-WebSocket
java-ws = { group = "org.java-websocket", name = "Java-WebSocket", version = "1.6.0" }

[plugins]
fabricLoom = { id = "fabric-loom", version.ref = "fabricLoom" }
Expand Down
2 changes: 2 additions & 0 deletions mapsync-mod/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ pluginManagement {
}

rootProject.name = "MapSync"

include(":dep-websockets")
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

import gjum.minecraft.mapsync.mod.MapSyncMod;
import gjum.minecraft.mapsync.mod.data.ChunkTile;
import gjum.minecraft.mapsync.mod.deps.websockets.client.WebSocketClient;
import gjum.minecraft.mapsync.mod.deps.websockets.drafts.Draft;
import gjum.minecraft.mapsync.mod.deps.websockets.drafts.Draft_6455;
import gjum.minecraft.mapsync.mod.deps.websockets.exceptions.WebsocketNotConnectedException;
import gjum.minecraft.mapsync.mod.deps.websockets.handshake.ServerHandshake;
import gjum.minecraft.mapsync.mod.net.auth.AuthStateHolder;
import gjum.minecraft.mapsync.mod.net.auth.Welcomed;
import gjum.minecraft.mapsync.mod.net.buffers.BufferReader;
Expand All @@ -17,11 +22,6 @@
import java.util.Objects;
import java.util.concurrent.atomic.AtomicLong;
import net.minecraft.world.level.ChunkPos;
import org.java_websocket.client.WebSocketClient;
import org.java_websocket.drafts.Draft;
import org.java_websocket.drafts.Draft_6455;
import org.java_websocket.exceptions.WebsocketNotConnectedException;
import org.java_websocket.handshake.ServerHandshake;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
Expand Down
4 changes: 1 addition & 3 deletions mapsync-mod/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
"depends": {
"minecraft": "${minecraft_version}",
"fabricloader": ">=${fabric_loader_version}",
"fabric": "*",

"org_java-websocket_java-websocket": ">=${java_websockets_version}"
"fabric": "*"
},
"suggests": {
"modmenu": "*",
Expand Down