Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
Fix lwjglAgent configuration, add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
3arthqu4ke committed Mar 30, 2024
1 parent 7b4a639 commit 1590654
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 8 deletions.
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM openjdk:17-alpine

WORKDIR /pingbypass
COPY . /pingbypass

RUN mkdir -p pb-server/run/client/mods
RUN wget -O pb-server/run/client/mods/hmc-specifics-1.20.4.jar \
https://github.com/3arthqu4ke/hmc-specifics/releases/download/v1.20.4-1.8.1/hmc-specifics-fabric-1.20.4-1.8.1.jar

RUN wget -O pb-server/run/client/mods/hmc-optimizations-0.1.0-fabric.jar \
https://github.com/3arthqu4ke/hmc-optimizations/releases/download/latest/hmc-optimizations-0.1.0-fabric.jar

RUN mkdir -p pb-server/run/client/
RUN cp -f config/options.txt pb-server/run/client/

RUN mkdir -p pb-server/run/client/pingbypass/server/
RUN cp -f config/pingbypass.properties pb-server/run/client/pingbypass/server/

RUN chmod +x gradlew
RUN ./gradlew -Phmc.lwjgl=true test
RUN ./gradlew -Phmc.lwjgl=true pb-server:fabricJar
RUN ./gradlew -Phmc.lwjgl=true pb-server:fabricPreRunClient
ENTRYPOINT sh -c "./gradlew -Phmc.lwjgl=true pb-server:fabricRunClient --console=plain"
EXPOSE 25565
16 changes: 8 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ subprojects {

configurations {
lwjglAgent
lwjglAgent.extendsFrom runtimeOnly
runtimeOnly.extendsFrom lwjglAgent

// see pb-api build.gradle, these need to be on the classpath when building our JavaDoc
javaDocLibs
Expand Down Expand Up @@ -261,13 +261,13 @@ subprojects {
// So instead we just run from the built jar
afterEvaluate {
fabricRunClient {
configureTaskForLwjglAgent(it)
configureTaskForLwjglAgent(project, it)
}

// TODO: check if we can run plugins with this? Is deencapsulation on the classpath?
lexforgeRunClient {
dependsOn(lexforgeJar)
configureTaskForLwjglAgent(it)
configureTaskForLwjglAgent(project, it)
classpath = classpath.filter {
!it.toString().contains("${project.name}/build/classes/java/".replace('/', File.separator))
&& !it.toString().contains("${project.name}/build/resources/".replace('/', File.separator))
Expand All @@ -278,7 +278,7 @@ subprojects {

neoforgeRunClient {
dependsOn(neoforgeJar)
configureTaskForLwjglAgent(it)
configureTaskForLwjglAgent(project, it)
classpath = classpath.filter {
!it.toString().contains("${project.name}/build/classes/java/".replace('/', File.separator))
&& !it.toString().contains("${project.name}/build/resources/".replace('/', File.separator))
Expand All @@ -289,12 +289,12 @@ subprojects {
}
}

private void configureTaskForLwjglAgent(JavaExec exec) {
private void configureTaskForLwjglAgent(Project project, JavaExec exec) {
exec.standardInput = System.in
if (rootProject.property('hmc.lwjgl').toBoolean()) {
exec.jvmArgs += ["-javaagent:${configurations.lwjglAgent.files.iterator().next()}"]
exec.jvmArgs += ["-javaagent:${project.configurations.lwjglAgent.files.iterator().next()}"]
exec.systemProperties['joml.nounsafe'] = 'true'
exec.systemProperties['fabric.systemLibraries'] = "${configurations.lwjglAgent.files.iterator().next()}"
exec.systemProperties['fabric.systemLibraries'] = "${project.configurations.lwjglAgent.files.iterator().next()}"
}
}

Expand All @@ -314,7 +314,7 @@ subprojects {
group = 'build'
archiveClassifier = "${platform}-release"
from remapJarTask.outputs
configurations = [ project.configurations.jarLibsImpl ]
it.configurations += [ project.configurations.jarLibsImpl ]
}

rootProject.tasks.named('build') { finalizedBy(shadowTask) }
Expand Down
12 changes: 12 additions & 0 deletions config/options.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version:3700
autoJump:false
enableVsync:false
touchscreen:false
fullscreen:false
renderDistance:12
simulationDistance:12
maxFps:260
graphicsMode:1
skipMultiplayerWarning:true
joinedFirstServer:true
onboardAccessibility:false
File renamed without changes.

0 comments on commit 1590654

Please sign in to comment.