Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forge support #83

Open
wants to merge 24 commits into
base: dev/0.3.x
Choose a base branch
from
Open

Forge support #83

wants to merge 24 commits into from

Conversation

ExerciseBook
Copy link

@ExerciseBook ExerciseBook commented Jan 6, 2023

Notice Forge support is still under developing.

link to #40

Preview

Test on our FTB Stone Block3 server.
image

Something need to discuss

  1. Which forge version we should support? Now we are prepare to support 1.12 1.16 1.18, but we are not sure whether 1.19 can reuse 1.18's code. So it may add not less than 3 submodules @warmthdawn
  2. For compatibility, we downgrade gradle version and relocate more package. @ExerciseBook
  3. If we support many forge version, how the submodule naming.

Feel free to code review, we are trying to make it better.

@ExerciseBook ExerciseBook marked this pull request as draft January 6, 2023 15:52
@Cubxity
Copy link
Owner

Cubxity commented Jan 6, 2023

Great work, thanks for the contribution!

For compatibility, we downgrade gradle version and relocate more package.If we support many forge version, how the submodule naming.

Are there no other workarounds? I would ideally like to stick to the latest version of Gradle.

If we support many forge version, how the submodule naming.

forge-{minor version}, e.g. forge-18, forge-19

I will be reviewing the code later on.

@Cubxity
Copy link
Owner

Cubxity commented Jan 6, 2023

I recommend looking into https://github.com/architectury/architectury-loom instead of forgegradle. Forgegradle uses many Gradle internals, thus being incompatible with the latest version of Gradle.

@nicognaW
Copy link

nicognaW commented Jan 7, 2023

I recommend looking into https://github.com/architectury/architectury-loom instead of forgegradle. Forgegradle uses many Gradle internals, thus being incompatible with the latest version of Gradle.

I think @warmthdawn had tried architectury-loom (if you look through this commit), but it didn't work, so he refactored the plugin to forgegradle so it could build successfully.

We will continue to experiment with architecture-loom in the hopes that it will work.

@ExerciseBook
Copy link
Author

ExerciseBook commented Mar 27, 2023

image

After migrating to loom, It can work on my server

But ping count and login count is wrong.

@ExerciseBook ExerciseBook changed the title WIP: Forge support Forge support Mar 28, 2023
@ExerciseBook ExerciseBook marked this pull request as ready for review March 28, 2023 12:05
@ExerciseBook
Copy link
Author

if we set shadowjar after remap, manifest will be overwrite. We can only set mixin cfg manually.

@Cubxity
Copy link
Owner

Cubxity commented Apr 6, 2023

Is this PR ready for review? Are metric issues resolved yet?

@ExerciseBook
Copy link
Author

yes, this pr ready now
image

image

@ExerciseBook
Copy link
Author

@eaglesemanation If there is any problem when you try this branch, feel free to cantact me.

@eaglesemanation
Copy link

@ExerciseBook I'm not sure if I can actually build it, I'm not that familiar with minecraft mod development. Just really excited to get metrics on my forge server =)
Maybe I'll have some time on Sunday.

@eaglesemanation
Copy link

Last quarter was tiring, finally got some time to test this. Looks like it's working, tested on Vault Hunters server.
Screenshot from 2023-05-04 02-52-55
I'm not sure why TPS and MSPT graphs work in overview, but don't work in server section. That's probably my misconfiguration, same thing happens to my PaperMC server

@ExerciseBook
Copy link
Author

ExerciseBook commented May 5, 2023

@eaglesemanation Here is my TPS and MSPT expression. Maybe we are different in the metrics query.

TPS

rate(minecraft_tick_duration_seconds_count{instance=~"^$instance$",exported_job=~"^$job$"}[$__interval])

MSPT

histogram_quantile(0.99, sum(rate(minecraft_tick_duration_seconds_bucket{instance=~"^$instance$",exported_job=~"^$job$"}[$__interval])) by (le))
histogram_quantile(0.95, sum(rate(minecraft_tick_duration_seconds_bucket{instance=~"^$instance$",exported_job=~"^$job$"}[$__interval])) by (le))
histogram_quantile(0.75, sum(rate(minecraft_tick_duration_seconds_bucket{instance=~"^$instance$",exported_job=~"^$job$"}[$__interval])) by (le))
histogram_quantile(0.50, sum(rate(minecraft_tick_duration_seconds_bucket{instance=~"^$instance$",exported_job=~"^$job$"}[$__interval])) by (le))

https://grafana.com/grafana/dashboards/18584-unifiedmetrics-0-3-x-prometheus/?
I use this template.

@eaglesemanation
Copy link

Interesting, your queries did not work for me as well, but I found out the fix - replacing $__interval with $__rate_interval worked. I'm really new to Prometheus, so I have no clue if that's an actual fix, but at least it shows something =)

@mja00
Copy link

mja00 commented Jun 18, 2023

I've ran this in production for about a month now. 0 issues. Looks really good!

@dark-penguin
Copy link

Hi @ExerciseBook ! I'm trying to use this, but I'm somewhat new to the Java ecosystem. I'm following the build guide in README.md .
I'm running Forge 1.12.2 on Oracle JRE 1.8.0_251, so that's what I'm targeting.

  • Is 1.12.2 supported? Should I specify any flags to build for 1.12.2 ?
  • I'm getting this error:
An exception occurred applying plugin request [id: 'fabric-loom', version: '1.0.16']
> Failed to apply plugin 'fabric-loom'.
   > You are using an outdated version of Java (8). Java 17 or higher is required.

I'm not sure that everything would be fine if I build on OpenJDK 17, and then run on Oracle JRE 1.8.0. I don't need fabric support (the one that requires 16+) - only Forge, so 1.8 should be fine, right? Is there a way to disable building parts I don't need?

@ExerciseBook
Copy link
Author

@dark-penguin

You could try it. the build script I wrote is just a model after Dynmap's build script. so in my memory, it needs to be built on jdk17 and run on jdk8.

@dark-penguin
Copy link

@ExerciseBook I've built it with openjdk-17-jdk on Debian Bookworm. I guess I should look for the output under platforms/, but:

$ ls platforms
bukkit  bungee  fabric  forge-1.18.2  minestom  velocity

How do I specify Forge-1.12.2 ? Or could it be that 1.18.2 is the only one supported?
gradlew projects returns:

Root project 'UnifiedMetrics' - Fully featured metrics collector agent for Minecraft servers.
+--- Project ':unifiedmetrics-api' - Fully featured metrics collector agent for Minecraft servers.
+--- Project ':unifiedmetrics-common' - Fully featured metrics collector agent for Minecraft servers.
+--- Project ':unifiedmetrics-core' - Fully featured metrics collector agent for Minecraft servers.
+--- Project ':unifiedmetrics-driver-influx' - Fully featured metrics collector agent for Minecraft servers.
+--- Project ':unifiedmetrics-driver-prometheus' - Fully featured metrics collector agent for Minecraft servers.
+--- Project ':unifiedmetrics-platform-bukkit' - Fully featured metrics collector agent for Minecraft servers.
+--- Project ':unifiedmetrics-platform-bungee' - Fully featured metrics collector agent for Minecraft servers.
+--- Project ':unifiedmetrics-platform-fabric' - Fully featured metrics collector agent for Minecraft servers.
+--- Project ':unifiedmetrics-platform-forge-1.18.2' - Fully featured metrics collector agent for Minecraft servers.
+--- Project ':unifiedmetrics-platform-minestom' - Fully featured metrics collector agent for Minecraft servers.
\--- Project ':unifiedmetrics-platform-velocity' - Fully featured metrics collector agent for Minecraft servers.

@ExerciseBook
Copy link
Author

@dark-penguin
I am so sorry about my response. Because I did not use this plugin for a long time I forgot what I wrote before.

I look a glance on my code. Only the 1.18.2 is available. 1.12.2 is stuck on buildscript, I didn’t find a way to pack it up yet. So maybe you could try to workout it.

I am very appreciate that you could help me to solve this problem.

@dark-penguin
Copy link

Normally, I would be happy to try, but as you can see, with Java I'm barely able to build something by following instructions. 🙂

But just in case, what should I do to initiate an 1.12.2 build? Is it possible to build only that, without the other targets?

@ExerciseBook
Copy link
Author

@dark-penguin

I am so sorry for my late response, I was busy yesterday.

In fact, I didn't successfully build 1.12.2 ever. So maybe you could try to find the way out.

@iTrooz
Copy link

iTrooz commented Aug 15, 2024

I tried to compile this for 1.19.2 but I keep getting the error Failed to read /META-INF/versions/19/org/lwjgl/panama/Test.class
Does anyone know how to fix this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants