Skip to content

Commit 1542a1e

Browse files
I made these changes a whileeeee ago and have no idea what is going on at this point :D
1 parent 6eb7ab2 commit 1542a1e

File tree

8 files changed

+120
-1
lines changed

8 files changed

+120
-1
lines changed

build.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ subprojects {
3232
withJavadocJar()
3333
}
3434

35+
javadoc {
36+
options.addFileOption('-add-stylesheet', project.file("javadoc-stylesheet.css"))
37+
}
38+
39+
jar {
40+
from("LICENSE") {
41+
rename { "${it}_${project.archivesBaseName}" }
42+
}
43+
}
3544
jar {
3645
from("${rootProject.projectDir}/LICENSE") {
3746
rename { "${it}" }

fabric/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Check at https://fabricmc.net/develop
33
# These should be automatically updated, unless the environment
44
# variable "DISABLE_PROPERTIES_UPDATE" is set.
5-
yarn_version = 1.21.4+build.4
5+
yarn_version = 1.21.4+build.8
66
loader_version = 0.16.9
77

88
# Dependencies

fabric/src/main/java/top/offsetmonkey538/meshlib/mixin/ServerNetworkIoMixin.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package top.offsetmonkey538.meshlib.mixin;
22

33
import io.netty.channel.Channel;
4+
import net.minecraft.network.ClientConnection;
45
import org.spongepowered.asm.mixin.Mixin;
56
import org.spongepowered.asm.mixin.injection.At;
67
import org.spongepowered.asm.mixin.injection.Inject;
@@ -21,5 +22,6 @@ public abstract class ServerNetworkIoMixin {
2122
)
2223
private void meshlib$addHttpHandler(Channel channel, CallbackInfo ci) {
2324
channel.pipeline().addFirst(MOD_ID, new ProtocolHandler());
25+
System.out.println(channel.pipeline().names());
2426
}
2527
}

velocity/build.gradle

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
plugins {
2+
id 'com.gradleup.shadow' version '9.0.0-beta4'
3+
id 'xyz.jpenilla.run-velocity' version '2.3.1'
4+
id 'maven-publish'
5+
}
6+
7+
repositories {
8+
mavenCentral()
9+
maven {
10+
name = 'papermc'
11+
url = 'https://repo.papermc.io/repository/maven-public/'
12+
}
13+
}
14+
15+
configurations {
16+
common {
17+
canBeResolved = true
18+
canBeConsumed = false
19+
}
20+
api.extendsFrom common
21+
}
22+
23+
dependencies {
24+
// Paper
25+
compileOnly "com.velocitypowered:velocity-api:${project.velocity_version}"
26+
annotationProcessor "com.velocitypowered:velocity-api:${project.velocity_version}"
27+
28+
//// Userdev
29+
//paperweight.paperDevBundle(project.paper_version)
30+
31+
// Common
32+
common project(path: ":common", configuration: "shadow")
33+
}
34+
tasks.build.dependsOn(shadowJar)
35+
36+
processResources {
37+
final Map properties = Map<String, String>.of(
38+
"modVersion", rootProject.mod_version,
39+
"lowestMinecraftVersion", outlet.mcVersions().first() // Hopefully outlet always does stuff in this order
40+
)
41+
42+
inputs.properties(properties)
43+
44+
filesMatching("plugin.yml") {
45+
expand(properties)
46+
}
47+
}
48+
49+
tasks.runVelocity {
50+
velocityVersion(project.velocity_version)
51+
jvmArgs "-DmeshEnableExamples=true"
52+
}
53+
54+
modrinth {
55+
loaders = ["velocity"]
56+
uploadFile = shadowJar
57+
}

velocity/gradle.properties

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
## Netty, only used for netty-codec-http. Hopefully this version won't conflict with other versions of Netty
2+
netty_version = 4.1.82.Final
3+
4+
## no idea where to get this
5+
velocity_version = 3.4.0-SNAPSHOT
6+
7+
8+
nameSuffix = paper
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package top.offsetmonkey538.meshlib;
2+
3+
import net.kyori.adventure.key.Key;
4+
import top.offsetmonkey538.meshlib.impl.ProtocolHandler;
5+
6+
public final class MeshLib {
7+
private MeshLib() {
8+
9+
}
10+
11+
public static void initialize() {
12+
//ChannelInitializeListenerHolder.addListener(Key.key("meshlib", "meshlib"), channel -> channel.pipeline().addFirst(MESHLib.MOD_ID, new ProtocolHandler()));
13+
}
14+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package top.offsetmonkey538.meshlib;
2+
3+
import com.velocitypowered.api.event.Subscribe;
4+
import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
5+
import com.velocitypowered.api.plugin.Plugin;
6+
import top.offsetmonkey538.meshlib.example.ExampleMain;
7+
8+
@Plugin(
9+
id = "mesh-lib",
10+
name = "MeshLib",
11+
version = "0.0.0"
12+
)
13+
public class MeshLibPlugin {
14+
15+
@Subscribe
16+
public void onProxyInitialization(ProxyInitializeEvent event) {
17+
MeshLib.initialize();
18+
19+
ExampleMain.onInitialize();
20+
}
21+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: MESH-Lib
2+
version: '${modVersion}'
3+
main: top.offsetmonkey538.meshlib.MeshLibPlugin
4+
description: Easy to use library for hosting an HTTP server on the Minecraft server's port
5+
author: OffsetMonkey538
6+
website: https://github.com/OffsetMods538/MESH-Lib
7+
api-version: '${lowestMinecraftVersion}'
8+
load: STARTUP

0 commit comments

Comments
 (0)