Template
Initial commit
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
#
|
||||
# https://help.github.com/articles/dealing-with-line-endings/
|
||||
#
|
||||
# Linux start script should use lf
|
||||
/gradlew text eol=lf
|
||||
|
||||
# These are Windows script files and should use crlf
|
||||
*.bat text eol=crlf
|
||||
|
||||
# Binary files should be left untouched
|
||||
*.jar binary
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# Ignore Gradle project-specific cache directory
|
||||
.gradle
|
||||
|
||||
# Ignore Gradle build output directory
|
||||
build
|
||||
|
||||
# Ignore Kotlin plugin data
|
||||
.kotlin
|
||||
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>hellofabric</name>
|
||||
<comment>Project hellofabric created by Buildship.</comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
|
||||
</natures>
|
||||
<filteredResources>
|
||||
<filter>
|
||||
<id>1768744127131</id>
|
||||
<name></name>
|
||||
<type>30</type>
|
||||
<matcher>
|
||||
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
||||
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
||||
</matcher>
|
||||
</filter>
|
||||
</filteredResources>
|
||||
</projectDescription>
|
||||
@@ -0,0 +1,6 @@
|
||||
Copyright (C) 2026 by bedohswe <bedohswe@firemail.cc> <root@bedohswe.eu.org>
|
||||
https://github.com/bedohswe/ https://gitea.bedohswe.eu.org/bedohswe/
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
@@ -0,0 +1,7 @@
|
||||
# HelloFabric
|
||||
|
||||
This is a template for Fabric apps.
|
||||
|
||||
- `./gradlew buildAndCopy`
|
||||
- `./launch.sh`
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" output="bin/main" path="src/main/java">
|
||||
<attributes>
|
||||
<attribute name="gradle_scope" value="main"/>
|
||||
<attribute name="gradle_used_by_scope" value="main,test"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" output="bin/main" path="src/main/resources">
|
||||
<attributes>
|
||||
<attribute name="gradle_scope" value="main"/>
|
||||
<attribute name="gradle_used_by_scope" value="main,test"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-25/"/>
|
||||
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
|
||||
<classpathentry kind="output" path="bin/default"/>
|
||||
</classpath>
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>app</name>
|
||||
<comment>Project app created by Buildship.</comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
|
||||
</natures>
|
||||
<filteredResources>
|
||||
<filter>
|
||||
<id>1768747393729</id>
|
||||
<name></name>
|
||||
<type>30</type>
|
||||
<matcher>
|
||||
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
||||
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
||||
</matcher>
|
||||
</filter>
|
||||
</filteredResources>
|
||||
</projectDescription>
|
||||
@@ -0,0 +1,63 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'java-library'
|
||||
}
|
||||
|
||||
version = "0.0.1"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
||||
maven {
|
||||
url "https://repo.spongepowered.org/maven/"
|
||||
}
|
||||
maven {
|
||||
url "https://maven.fabricmc.net/"
|
||||
}
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion = JavaLanguageVersion.of(25)
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api libs.guava
|
||||
api "com.google.code.gson:gson:_"
|
||||
|
||||
api "net.fabricmc:fabric-loader:_"
|
||||
api "net.fabricmc:access-widener:_"
|
||||
|
||||
api "org.ow2.asm:asm:_"
|
||||
api "org.ow2.asm:asm-analysis:_"
|
||||
api "org.ow2.asm:asm-commons:_"
|
||||
api "org.ow2.asm:asm-tree:_"
|
||||
api "org.ow2.asm:asm-util:_"
|
||||
api "net.fabricmc:sponge-mixin:_"
|
||||
}
|
||||
|
||||
jar {
|
||||
archiveFileName = "hellofabric.jar"
|
||||
manifest {
|
||||
attributes(
|
||||
'Class-Path': configurations.runtimeClasspath.collect { it.getName() }.join(' '),
|
||||
'Specification-Version': 8.0,
|
||||
'Multi-Release': 'true',
|
||||
'Implementation-Title': "HelloFabric",
|
||||
'Implementation-Version': version
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
task copyDependencies(type: Copy) {
|
||||
group 'build'
|
||||
from configurations.runtimeClasspath
|
||||
into "build/libs/deps/"
|
||||
}
|
||||
|
||||
assemble {
|
||||
group 'build'
|
||||
dependsOn 'jar'
|
||||
dependsOn 'copyDependencies'
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package sib.bedohswe.hellofabric;
|
||||
|
||||
public class Main {
|
||||
public String getMessage() {
|
||||
return "Hello World!";
|
||||
}
|
||||
|
||||
public static void main(String args[]) {
|
||||
System.out.println(new Main().getMessage());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,164 @@
|
||||
package sib.bedohswe.hellofabric.modloader;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.fabricmc.loader.impl.game.GameProvider;
|
||||
import net.fabricmc.loader.impl.game.patch.GameTransformer;
|
||||
import net.fabricmc.loader.impl.launch.FabricLauncher;
|
||||
import net.fabricmc.loader.impl.metadata.BuiltinModMetadata;
|
||||
import net.fabricmc.loader.impl.metadata.ContactInformationImpl;
|
||||
import net.fabricmc.loader.impl.util.Arguments;
|
||||
import net.fabricmc.loader.impl.util.SystemProperties;
|
||||
|
||||
public class GameProviderImpl implements GameProvider {
|
||||
public static final String CLIENT_ENTRYPOINT = "sib.bedohswe.hellofabric.Main";
|
||||
public static final String[] ENTRYPOINTS = { CLIENT_ENTRYPOINT };
|
||||
|
||||
public static final String PROPERTY_APP_DIRECTORY = "appDirectory";
|
||||
|
||||
private static final GameTransformer TRANSFORMER = new GameTransformerImpl();
|
||||
|
||||
private Arguments arguments;
|
||||
private Path appJar;
|
||||
private final List<Path> appJarList = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public String getGameId() {
|
||||