-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 22f1e03
Showing
511 changed files
with
17,857 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Build | ||
on: [ pull_request, push ] | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
minecraft: [ 1.16.5, 1.19.4 ] | ||
loader: [ fabric ] #forge | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Validate gradle wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
- name: Setup JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 17 | ||
- name: Make gradle wrapper executable | ||
run: chmod +x ./gradlew | ||
- name: Setup ${{ matrix.minecraft }} ${{ matrix.loader }} | ||
run: ./gradlew setupLibrary -PbuildVersion="${{ matrix.minecraft }}" | ||
- name: Build ${{ matrix.minecraft }} ${{ matrix.loader }} | ||
run: ./gradlew ${{ matrix.loader }}:build -PbuildVersion="${{ matrix.minecraft }}" | ||
#- name: Capture release artifacts | ||
# uses: actions/upload-artifact@v3 | ||
# with: | ||
# name: Fabric&Forge Artifacts | ||
# path: build/release/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# gradle | ||
|
||
.gradle/ | ||
build/ | ||
out/ | ||
classes/ | ||
checkouts/ | ||
|
||
# eclipse | ||
|
||
*.launch | ||
|
||
# idea | ||
|
||
.idea/ | ||
*.iml | ||
*.ipr | ||
*.iws | ||
|
||
# vscode | ||
|
||
.settings/ | ||
.vscode/ | ||
bin/ | ||
.classpath | ||
.project | ||
|
||
# macos | ||
|
||
*.DS_Store | ||
|
||
# fabric | ||
|
||
fabric/run/ | ||
run/ | ||
forge/src/main/java/**/mod | ||
forge/src/main/resources/assets | ||
forge/src/main/resources/data | ||
forge/run | ||
|
||
**/lang/*.json | ||
!en_us.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2022-2024 ZiYueCommentary | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Tianjin Metro | ||
|
||
<img alt="Requires Java 16" height="50px" src="icons/requires_java16.svg"/> | ||
|
||
A small mod for [Minecraft Transit Railway](https://github.com/jonafanho/Minecraft-Transit-Railway), in developing stage. | ||
|
||
## How to build | ||
|
||
1. Clone this repository | ||
2. Sync the Gradle project | ||
|
||
# 天津地铁模组 | ||
|
||
一个 [Minecraft Transit Railway](https://github.com/jonafanho/Minecraft-Transit-Railway) 的附属模组,处于开发阶段。 | ||
|
||
## 构建步骤 | ||
|
||
1. 克隆仓库 | ||
2. 同步 Gradle 项目 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
plugins { | ||
id "io.github.pacifistmc.forgix" version "1.+" | ||
} | ||
|
||
forgix { | ||
group = "ziyue.tjmetro" | ||
mergedJarName = "${project.archives_base_name}-${project.mod_version}+${project.minecraft_version}.jar" | ||
outputDir = "build/" | ||
|
||
fabric { | ||
projectName = "fabric" | ||
jarLocation = "build/libs/${project.archives_base_name}-fabric-${project.mod_version}+${project.minecraft_version}.jar" | ||
} | ||
|
||
forge { | ||
projectName = "forge" | ||
jarLocation = "build/libs/${project.archives_base_name}-forge-${project.mod_version}+${project.minecraft_version}.jar" | ||
} | ||
} | ||
|
||
subprojects { | ||
apply plugin: "java" | ||
|
||
group project.maven_group | ||
version "${rootProject.properties.mod_version}+${rootProject.properties.minecraft_version}" | ||
|
||
base { | ||
archivesName = "${rootProject.archives_base_name}-${project.properties.loader_name}" | ||
} | ||
|
||
dependencies { | ||
implementation 'com.google.code.findbugs:jsr305:+' | ||
} | ||
|
||
repositories { | ||
flatDir { dirs "../libs" } | ||
maven { url "https://jitpack.io" } | ||
maven { url "https://maven.ziyuesinicization.site/releases/" } | ||
maven { url "https://maven.shedaniel.me/" } | ||
} | ||
|
||
def mc_ver = rootProject.properties.minecraft_version | ||
def mc_major = mc_ver.split("\\.")[0] | ||
def mc_main = mc_ver.split("\\.")[1] | ||
def mc_minor = mc_ver.split("\\.").size() > 2 ? (mc_ver.split("\\.")[2] as String).padLeft(2, '0') : 0 | ||
def merged_mc_version = "$mc_major$mc_main$mc_minor" | ||
|
||
ext { // Expose to subproject | ||
java_version = 17 | ||
|
||
full_mod_version = version | ||
} | ||
|
||
/* Manifold support */ | ||
tasks.withType(JavaCompile).forEach { | ||
it.options.compilerArgs += ["-Xplugin:Manifold", | ||
"-AMC_VERSION=$merged_mc_version", | ||
"-ALOADER=$project.properties.loader_name"] | ||
} | ||
|
||
// Some system don't compile with UTF-8 by default | ||
compileJava { | ||
options.encoding = 'UTF-8' | ||
} | ||
|
||
// Replace placeholder resources | ||
processResources { | ||
inputs.property "version", mod_version | ||
inputs.property "minecraft_version", minecraft_version | ||
|
||
filesMatching('META-INF/mods.toml') { | ||
expand( | ||
"minecraft_version": minecraft_version, | ||
"version": mod_version | ||
) | ||
} | ||
|
||
filesMatching("fabric.mod.json") { | ||
expand( | ||
"version": mod_version, | ||
"minecraft_version": minecraft_version | ||
) | ||
} | ||
} | ||
|
||
build.finalizedBy(mergeJars) | ||
assemble.finalizedBy(mergeJars) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
dependencies { | ||
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}" | ||
modApi "${rootProject.architectury_id}:architectury:${rootProject.architectury_version}" | ||
modApi("me.shedaniel.cloth:cloth-config-fabric:${rootProject.cloth_config_fabric_version}") { | ||
exclude(group: "net.fabricmc.fabric-api") | ||
} | ||
modApi "ziyue:filters:${rootProject.filters_api_version}" | ||
} | ||
|
||
architectury { | ||
common() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"version": "@version@" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"required": true, | ||
"minVersion": "0.8", | ||
"package": "ziyue.tjmetro.mixin", | ||
"compatibilityLevel": "JAVA_16", | ||
"mixins": [ | ||
], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
}, | ||
"client": [ | ||
], | ||
"refmap": "tjmetro-refmap.json" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
plugins { | ||
id 'fabric-loom' version '1.7-SNAPSHOT' | ||
} | ||
|
||
loom { | ||
runConfigs.configureEach { ideConfigGenerated = true } | ||
} | ||
|
||
repositories { | ||
maven { url = "https://maven.terraformersmc.com/" } | ||
} | ||
|
||
def yarn_version = project.properties["yarn_mappings_${rootProject.minecraft_version}"] | ||
def fabric_api_version = project.properties["fabric_api_version_${rootProject.minecraft_version}"] | ||
def mod_menu_version = project.properties["mod_menu_version_${rootProject.minecraft_version}"] | ||
def cloth_config_version = project.properties["cloth_config_version_${rootProject.minecraft_version}"] | ||
|
||
dependencies { | ||
// To change the versions see the gradle.properties file | ||
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}" | ||
mappings "net.fabricmc:yarn:${yarn_version}:v2" | ||
//modImplementation "org.mtr:MTR-fabric:${rootProject.mtr_version}+${rootProject.minecraft_version}-server" | ||
modImplementation(files("E:\\Tianjin-Metro\\libs\\MTR-fabric-4.0.0-beta-8+1.16.5-server.jar")) | ||
modImplementation "net.fabricmc:fabric-loader:${project.fabric_loader_version}" | ||
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_api_version}" | ||
modApi "com.terraformersmc:modmenu:${mod_menu_version}" | ||
modApi("me.shedaniel.cloth:cloth-config-fabric:${cloth_config_version}") { | ||
exclude(group: "net.fabricmc.fabric-api") | ||
} | ||
modApi ("ziyue.filters:filters-fabric:1.0.0+${rootProject.minecraft_version}") { | ||
exclude(group: "net.fabricmc") | ||
} | ||
annotationProcessor 'systems.manifold:manifold-preprocessor:2023.1.33' // Delibrate: Newer versions just throws an error *when displaying an compiling error* | ||
} | ||
|
||
tasks.withType(JavaCompile).configureEach { | ||
it.options.release = 17 | ||
} | ||
|
||
configurations.configureEach { | ||
// Force use our version of mod-loader even if dependency requires a lower mod-loader so the game can launch | ||
// May cause problems, but they're usually backward compatible | ||
resolutionStrategy { | ||
force("net.fabricmc:fabric-loader:$project.fabric_loader_version") | ||
} | ||
} | ||
|
||
java { | ||
withSourcesJar() | ||
|
||
sourceCompatibility = JavaVersion.VERSION_16 | ||
targetCompatibility = JavaVersion.VERSION_16 | ||
} | ||
|
||
jar { | ||
from("LICENSE") { | ||
rename { "${it}_${base.archivesName.get()}"} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Fabric Properties | ||
# check these on https://fabricmc.net/develop | ||
fabric_loader_version=0.15.11 | ||
loader_name=fabric | ||
|
||
yarn_mappings_1.20.4=1.20.4+build.3 | ||
yarn_mappings_1.20.1=1.20.1+build.10 | ||
yarn_mappings_1.19.4=1.19.4+build.2 | ||
yarn_mappings_1.19.2=1.19.2+build.28 | ||
yarn_mappings_1.18.2=1.18.2+build.4 | ||
yarn_mappings_1.17.1=1.17.1+build.65 | ||
yarn_mappings_1.16.5=1.16.5+build.10 | ||
|
||
# Dependencies | ||
fabric_api_version_1.20.4=0.97.0+1.20.4 | ||
fabric_api_version_1.20.1=0.92.1+1.20.1 | ||
fabric_api_version_1.19.4=0.87.2+1.19.4 | ||
fabric_api_version_1.19.2=0.77.0+1.19.2 | ||
fabric_api_version_1.18.2=0.77.0+1.18.2 | ||
fabric_api_version_1.17.1=0.46.1+1.17 | ||
fabric_api_version_1.16.5=0.42.0+1.16 | ||
|
||
mod_menu_version_1.20.4=9.0.0 | ||
mod_menu_version_1.20.1=7.2.2 | ||
mod_menu_version_1.19.4=6.3.1 | ||
mod_menu_version_1.19.2=4.1.2 | ||
mod_menu_version_1.18.2=3.2.5 | ||
mod_menu_version_1.17.1=2.0.17 | ||
mod_menu_version_1.16.5=1.16.23 | ||
|
||
cloth_config_version_1.16.5=4.17.101 | ||
cloth_config_version_1.19.4=10.1.117 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package ziyue.tjmetro.fabric; | ||
|
||
import net.fabricmc.api.ModInitializer; | ||
import ziyue.tjmetro.mod.Registry; | ||
import ziyue.tjmetro.mod.TianjinMetro; | ||
|
||
public final class MainFabric implements ModInitializer { | ||
|
||
@Override | ||
public void onInitialize() { | ||
TianjinMetro.init(); | ||
Registry.FILTERS_REGISTRY_ITEM.forEach(pair -> pair.getFirst().addItems(pair.getSecond().get().data)); | ||
Registry.FILTERS_REGISTRY_BLOCK.forEach(pair -> pair.getFirst().addItems(pair.getSecond().get().asItem().data)); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
fabric/src/main/java/ziyue/tjmetro/fabric/MainFabricClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package ziyue.tjmetro.fabric; | ||
|
||
import net.fabricmc.api.ClientModInitializer; | ||
import ziyue.tjmetro.mod.Registry; | ||
import ziyue.tjmetro.mod.TianjinMetroClient; | ||
|
||
public final class MainFabricClient implements ClientModInitializer | ||
{ | ||
@Override | ||
public void onInitializeClient() { | ||
TianjinMetroClient.init(); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
fabric/src/main/java/ziyue/tjmetro/fabric/ModMenuConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package ziyue.tjmetro.fabric; | ||
|
||
import com.terraformersmc.modmenu.api.ConfigScreenFactory; | ||
import com.terraformersmc.modmenu.api.ModMenuApi; | ||
import org.mtr.mapping.holder.Screen; | ||
import ziyue.tjmetro.mod.config.ConfigClient; | ||
|
||
public class ModMenuConfig implements ModMenuApi | ||
{ | ||
@Override | ||
public ConfigScreenFactory<?> getModConfigScreenFactory() { | ||
return screen -> ConfigClient.getConfigScreen(new Screen(screen)).data; | ||
} | ||
} |
Oops, something went wrong.