forked from zbx1425/mtr-nte
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'zbx1425:master' into master
- Loading branch information
Showing
68 changed files
with
998 additions
and
412 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,43 @@ | ||
# Simple workflow for deploying static content to GitHub Pages | ||
name: Deploy static content to Pages | ||
|
||
on: | ||
# Runs on pushes targeting the default branch | ||
# push: | ||
# branches: ["master"] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
# Single deploy job since we're just deploying | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v4 | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v2 | ||
with: | ||
# Upload entire repository | ||
path: 'docs' | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v3 |
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
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,81 @@ | ||
String default_minecraft_version = "1.19.2" | ||
Properties localProperties = new Properties() | ||
String minecraft_version | ||
if (project.rootProject.file('build.properties').exists()) { | ||
localProperties.load(project.rootProject.file('build.properties').newDataInputStream()) | ||
} | ||
if (rootProject.properties.containsKey("buildVersion")) { | ||
minecraft_version = rootProject.properties.get("buildVersion") | ||
} else if (localProperties.containsKey("MC_VERSION")) { | ||
String notDotted = localProperties.get("MC_VERSION") | ||
String dotted = notDotted.substring(0, 1) + "." + | ||
Integer.toString(Integer.parseInt(notDotted.substring(1, 3))) + "." + | ||
Integer.toString(Integer.parseInt(notDotted.substring(3, 5))) | ||
minecraft_version = dotted | ||
} else { | ||
minecraft_version = default_minecraft_version | ||
} | ||
rootProject.ext.minecraft_version = minecraft_version | ||
rootProject.ext.minecraft_main_version = minecraft_version.split("\\.")[1] as int | ||
rootProject.ext.minecraft_version_int = minecraft_version.split("\\.")[0] + | ||
minecraft_version.split("\\.")[1].padLeft(2, '0') + | ||
(minecraft_version.split("\\.").length > 2 ? minecraft_version.split("\\.")[2].padLeft(2, '0') : "00") | ||
rootProject.ext.is_1_19_3 = minecraft_version == "1.19.3" || minecraft_version == "1.19.4" | ||
rootProject.ext.is_1_20 = minecraft_version == "1.20" || minecraft_version == "1.20.1" | ||
|
||
rootProject.ext.supports_minecraft_version = [ | ||
"1.16.5": "1.16.x", | ||
"1.17.1": "1.17.x", "1.18.2": "1.18.x", | ||
"1.19.2": "1.19.2", "1.19.3": "1.19.3", "1.19.4": "1.19.4", | ||
"1.20.1": "1.20.x" | ||
][minecraft_version] | ||
rootProject.ext.supports_minecraft_version_range = [ | ||
"1.16.5": "[1.16, 1.17)", | ||
"1.17.1": "[1.17, 1.18)", "1.18.2": "[1.18, 1.19)", | ||
"1.19.2": "1.19.2", "1.19.3": "1.19.3", "1.19.4": "1.19.4", | ||
"1.20.1": "[1.20, 1.21)" | ||
][minecraft_version] | ||
|
||
rootProject.ext.parchment_version = [ | ||
"1.16.5": "2022.03.06", | ||
"1.17.1": "2021.12.12", "1.18.2": "2022.11.06", | ||
"1.19.2": "2022.11.27", "1.19.3": "2023.06.25", "1.19.4": "2023.06.26", | ||
"1.20.1": "2023.09.03" | ||
][minecraft_version] | ||
|
||
rootProject.ext.fabric_loader_version = "0.15.3" | ||
rootProject.ext.fabric_api_version = [ | ||
"1.16.5": "0.42.0", | ||
"1.17.1": "0.46.1+1.17", "1.18.2": "0.77.0+1.18.2", | ||
"1.19.2": "0.77.0+1.19.2", "1.19.3": "0.76.1+1.19.3", "1.19.4": "0.87.2+1.19.4", | ||
"1.20.1": "0.91.0+1.20.1" | ||
][minecraft_version] | ||
rootProject.ext.mod_menu_version = [ | ||
"1.16.5": "1.16.23", | ||
"1.17.1": "2.0.17", "1.18.2": "3.2.5", | ||
"1.19.2": "4.1.2", "1.19.3": "5.1.0", "1.19.4": "6.3.1", | ||
"1.20.1": "7.2.2" | ||
][minecraft_version] | ||
|
||
rootProject.ext.forge_version = minecraft_version + "-" + [ | ||
"1.16.5": "36.2.34", | ||
"1.17.1": "37.1.1", "1.18.2": "40.2.0", | ||
"1.19.2": "43.3.0", "1.19.3": "44.1.0", "1.19.4": "45.2.0", | ||
"1.20.1": "47.2.0" | ||
][minecraft_version] | ||
rootProject.ext.architectury_version = [ | ||
"1.16.5": "1.32.68", | ||
"1.17.1": "2.10.12", "1.18.2": "4.11.93", | ||
"1.19.2": "6.5.85", "1.19.3": "7.1.86", "1.19.4": "8.2.89", | ||
"1.20.1": "9.1.12" | ||
][minecraft_version] | ||
rootProject.ext.architectury_id = minecraft_main_version == 16 ? "me.shedaniel" : "dev.architectury" | ||
|
||
rootProject.ext.mtr_min_version = minecraft_version == "1.20.1" ? "0" : minecraft_version + "-" + rootProject.mtr_min_version | ||
|
||
rootProject.ext.cloth_config_version = [ | ||
"1.16.5": "4.17.101", | ||
"1.17.1": "5.3.63", "1.18.2": "6.5.102", | ||
"1.19.2": "8.3.103", "1.19.3": "9.1.104", "1.19.4": "10.1.105", | ||
"1.20.1": "11.1.106" | ||
][minecraft_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
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
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
37 changes: 37 additions & 0 deletions
37
common/src/main/java/cn/zbx1425/mtrsteamloco/RegistriesWrapper.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,37 @@ | ||
package cn.zbx1425.mtrsteamloco; | ||
|
||
import mtr.CreativeModeTabs; | ||
import mtr.RegistryObject; | ||
import mtr.item.ItemWithCreativeTabBase; | ||
import net.minecraft.client.KeyMapping; | ||
import net.minecraft.core.particles.ParticleType; | ||
import net.minecraft.core.particles.SimpleParticleType; | ||
import net.minecraft.resources.ResourceKey; | ||
import net.minecraft.sounds.SoundEvent; | ||
import net.minecraft.world.entity.Entity; | ||
import net.minecraft.world.entity.EntityType; | ||
import net.minecraft.world.item.CreativeModeTab; | ||
import net.minecraft.world.item.Item; | ||
import net.minecraft.world.level.block.Block; | ||
import net.minecraft.world.level.block.entity.BlockEntity; | ||
import net.minecraft.world.level.block.entity.BlockEntityType; | ||
|
||
public interface RegistriesWrapper { | ||
|
||
void registerBlock(String id, RegistryObject<Block> block); | ||
|
||
void registerItem(String id, RegistryObject<ItemWithCreativeTabBase> item); | ||
|
||
void registerBlockAndItem(String id, RegistryObject<Block> block, CreativeModeTabs.Wrapper tab); | ||
|
||
void registerBlockEntityType(String id, RegistryObject<? extends BlockEntityType<? extends BlockEntity>> blockEntityType); | ||
|
||
void registerEntityType(String id, RegistryObject<? extends EntityType<? extends Entity>> entityType); | ||
|
||
void registerSoundEvent(String id, SoundEvent soundEvent); | ||
|
||
void registerParticleType(String id, ParticleType<?> particleType); | ||
|
||
SimpleParticleType createParticleType(boolean overrideLimiter); | ||
|
||
} |
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
Oops, something went wrong.