Skip to content

Commit

Permalink
Merge pull request #49 from MisterJulsen/1.19.2-dev
Browse files Browse the repository at this point in the history
1.19.2 dev
  • Loading branch information
MisterJulsen authored Oct 10, 2024
2 parents 77af806 + 61b72db commit 47e85b3
Show file tree
Hide file tree
Showing 53 changed files with 1,287 additions and 492 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ run/
out/
*.iml
.gradle/
.vscode/
output/
bin/
libs/
Expand Down
3 changes: 1 addition & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"java.compile.nullAnalysis.mode": "disabled",
"commentTranslate.hover.enabled": false,
"java.configuration.updateBuildConfiguration": "automatic"
"java.compile.nullAnalysis.mode": "disabled"
}
29 changes: 17 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
# Create Railways Navigator (Minecraft Create Mod Addon)
![Logo](https://github.com/MisterJulsen/Create-Train-Navigator/blob/1.19.2/icon_256px.png)
# 🚅 Create Railways Navigator (Minecraft Create Mod Addon)
![Logo](https://github.com/MisterJulsen/Create-Train-Navigator/blob/1.18.2/icon_256px.png)

Get a list possible train connections in your world from one station to another using the Create Railways Navigator.

[![Discord](https://i.imgur.com/YnDoeHs.png)](https://discord.gg/AeSbNgvc7f)
[![Modrinth](https://i.imgur.com/uLIB4gb.png)](https://modrinth.com/mod/create-railways-navigator)
[![CurseForge](https://i.imgur.com/XZYlGVF.png)](https://www.curseforge.com/minecraft/mc-mods/create-railways-navigator)

## Dependencies
## 📚 Dependencies
This mod requires the Minecraft [Create Mod v0.5.1e](https://www.curseforge.com/minecraft/mc-mods/create) or newer for [Minecraft Forge](https://files.minecraftforge.net) or later. This mod also uses [DragonLib](https://www.curseforge.com/minecraft/mc-mods/dragonlib), which is already embedded into the built jar, so you don't have to install it manually.

## Features
## Features
This mod adds a new item, the Create Railways Navigator, which is inspired by the [DB Navigator](https://de.wikipedia.org/wiki/DB_Navigator) (an app in Germany where, among other things, you can get possible train connections). Like this app, the navigator in this mod is intended to suggest possible train connections for trains from the Create Mod in your Minecraft world. Various customization options allow you to specify which track stations should be treated as a single station and how your navigation results should be filtered and sorted so that you always receive the best possible route suggestions.

## Supported Languages
- English (100%)
- German (100%)
- Dutch (100%) (by TheSatanicFlame)
- Polish (100%) (by Slasherss)

## **Please note!**
## 🗣️ Supported Languages
- English
- German
- Dutch (by TheSatanicFlame)
- Polish (by Slasherss)
- Chinese (simplified) (by Mingshuai Zhu, iaddda)
- Saxon (DE) (by PULZ418)
- Bavarian (DE)
- Spanish (by albertosaurio65)
- Russian (by VGamerGroup)

## ⚠️ **Please note!**
To protect your world from damage, you should always create a backup of your world before installing an update of this mod. Alpha versions in particular may contain critical bugs!

## **Dependencies**
## 🐉 **Dependencies**
This mod uses **DragonLib** as a library mod that contains useful code shared accross all my mods. DragonLib is embedded in all builds of Create Railways Navigator since version `0.2.0-beta-1.18.2`, so you don't need to install DragonLib manually. If you are developer and are interested in this library you can find more information about it on [GitHub](https://github.com/MisterJulsen/MC-DragonLib "DragonLib on GitHub").

[![DragonLib](https://i.imgur.com/4d8BF5J.png)](https://github.com/MisterJulsen/MC-DragonLib "DragonLib on GitHub")
137 changes: 69 additions & 68 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,102 +1,103 @@
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.5-SNAPSHOT" apply false
id 'dev.architectury.loom' version '1.6-SNAPSHOT' apply false
id 'architectury-plugin' version '3.4-SNAPSHOT'
id 'com.github.johnrengelman.shadow' version '8.1.1' apply false
}

architectury {
minecraft = rootProject.minecraft_version
minecraft = project.minecraft_version
}

subprojects {
apply plugin: "dev.architectury.loom"

loom {
silentMojangMappingsLicense()
}

dependencies {
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
// The following line declares the mojmap mappings, you may use other mappings as well

mappings loom.layered() {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-${rootProject.minecraft_version}:${rootProject.parchment_version}@zip")
}
}
allprojects {
group = rootProject.maven_group
version = "$rootProject.minecraft_version-$rootProject.mod_version"
}

allprojects {
apply plugin: "java"
apply plugin: "architectury-plugin"
apply plugin: "maven-publish"
subprojects {
apply plugin: 'dev.architectury.loom'
apply plugin: 'architectury-plugin'
apply plugin: 'maven-publish'

base {
archivesName = rootProject.archives_base_name
archivesName = "$rootProject.archives_name-$project.name"
}

version = "${rootProject.mod_version}-${project.name}"
group = rootProject.maven_group

repositories {
maven { // Flywheel
url = "https://maven.tterrag.com/"
content {
includeGroup("com.jozufozu.flywheel")
}
}
maven { // DragonLib
name = "MrJulsen's Mod Resources"
url = "https://raw.githubusercontent.com/MisterJulsen/modsrepo/main/maven"
}
maven { // Forge Config Api (required for fabric version of DragonLib)
name = "Fuzs Mod Resources"
url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/"
}
maven {
url "https://cursemaven.com"
maven { url = "https://raw.githubusercontent.com/MisterJulsen/modsrepo/main/maven" } // DragonLib
maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" } // Forge Config API
maven { url = "https://maven.parchmentmc.org" } // ParchmentMC
maven { url = "https://maven.terraformersmc.com/" } // ModMenu
maven { url = "https://maven.shedaniel.me/" } // Cloth Config, REI
maven { url = "https://maven.blamejared.com/" } // JEI
maven { url = "https://maven.quiltmc.org/repository/release" } // Quilt Mappings
maven { url = "https://api.modrinth.com/maven" } // LazyDFU
maven { url = "https://maven.terraformersmc.com/releases/" } // Mod Menu
maven { url = "https://mvn.devos.one/snapshots/" } // Create, Porting Lib, Forge Tags, Milk Lib, Registrate
maven { url = "https://maven.jamieswhiteshirt.com/libs-release" } // Reach Entity Attributes
maven { url = "https://jitpack.io/" } // Mixin Extras, Fabric ASM

maven { url = "https://cursemaven.com"
content {
includeGroup "curse.maven"
}
}


maven { // Create Forge and Registrate Forge
url = "https://maven.tterrag.com/"
maven { url = "https://maven.tterrag.com/" // Create Forge, Registrate Forge, Flywheel
content {
includeGroup("com.jozufozu.flywheel")
includeGroup("com.tterrag.registrate")
includeGroup("com.simibubi.create")
}
}

maven { url = "https://maven.shedaniel.me/" } // Cloth Config, REI
maven { url = "https://maven.blamejared.com/" } // JEI
maven { url = "https://maven.parchmentmc.org" } // Parchment mappings
maven { url = "https://maven.quiltmc.org/repository/release" } // Quilt Mappings
maven { url = "https://api.modrinth.com/maven" } // LazyDFU
maven { url = "https://maven.terraformersmc.com/releases/" } // Mod Menu
maven { url = "https://mvn.devos.one/snapshots/" } // Create, Porting Lib, Forge Tags, Milk Lib, Registrate
maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" } // Forge Config API Port
maven { url = "https://maven.jamieswhiteshirt.com/libs-release" } // Reach Entity Attributes
maven { url = "https://jitpack.io/" } // Mixin Extras, Fabric ASM
maven { url = "https://maven.tterrag.com/" } // Flywheel
}

tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.release = 17
}

publishing {
repositories {
maven {
name "GitHub"
url "file://${System.getProperty('user.home')}/.m2/github/modsrepo/maven"
dependencies {
minecraft "net.minecraft:minecraft:$rootProject.minecraft_version"
mappings loom.layered() {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-${rootProject.minecraft_version}:${rootProject.parchment_version}@zip")
}
}
}

java {
withSourcesJar()
withJavadocJar()

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

javadoc {
options {
title = "DragNSounds API ${rootProject.release_channel}-${rootProject.mod_version}"
tags("apiNote:a:API Note:")
tags("implNote:a:Impl Note:")
tags("implSpec:a:Impl Spec:")
tags("related:a:Related:")
tags("example:a:Examples:")
tags("side:a:Valid on side:")
}
}

tasks.withType(JavaCompile).configureEach {
it.options.release = 17
}

// Configure Maven publishing.
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = rootProject.archives_name + "-" + project.name
from components.java
}
}

repositories {
maven {
name "GitHub"
url "file://${System.getProperty('user.home')}/.m2/github/modsrepo/maven"
}
}
}
}
30 changes: 8 additions & 22 deletions common/build.gradle
Original file line number Diff line number Diff line change
@@ -1,31 +1,17 @@
architectury {
common(rootProject.enabled_platforms.split(","))
common rootProject.enabled_platforms.split(',')
}

loom {
accessWidenerPath = file("src/main/resources/createrailwaysnavigator.accesswidener")
}

dependencies {
// We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies
// Do NOT use other classes from fabric loader
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"

modImplementation(include("de.mrjulsen.mcdragonlib:dragonlib-fabric:${rootProject.minecraft_version}-${rootProject.dragonlib_version}"))
modImplementation "net.fabricmc:fabric-loader:$rootProject.fabric_loader_version"

modImplementation("dev.architectury:architectury:${rootProject.architectury_api_version}")
modImplementation("com.electronwill.night-config:toml:3.6.0")
modImplementation("net.minecraftforge:forgeconfigapiport-fabric:${rootProject.forge_config_api_port_version}")
modImplementation("de.mrjulsen.mcdragonlib:dragonlib-fabric:${rootProject.minecraft_version}-${rootProject.dragonlib_version}")
modImplementation("com.simibubi.create:create-fabric-${rootProject.minecraft_version}:${rootProject.create_fabric_version}")

}

publishing {
publications {
mavenCommon(MavenPublication) {
artifactId = rootProject.archives_base_name
from components.java
}
}

// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
}
}
}
8 changes: 8 additions & 0 deletions common/src/main/java/de/mrjulsen/crn/CRNPlatformSpecific.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
import dev.architectury.injectables.annotations.ExpectPlatform;
import dev.architectury.platform.Platform;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.level.block.entity.BlockEntity;

import java.nio.file.Path;

import com.simibubi.create.content.trains.station.GlobalStation;

public class CRNPlatformSpecific {
/**
* We can use {@link Platform#getConfigFolder()} but this is just an example of {@link ExpectPlatform}.
Expand Down Expand Up @@ -35,4 +38,9 @@ public static MinecraftServer getServer() {
public static void registerConfig() {
throw new AssertionError();
}

@ExpectPlatform
public static GlobalStation getStationFromBlockEntity(BlockEntity be) {
throw new AssertionError();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package de.mrjulsen.crn;

import java.util.function.Supplier;

import com.simibubi.create.foundation.block.connected.ConnectedTextureBehaviour;
import dev.architectury.injectables.annotations.ExpectPlatform;
import net.minecraft.world.level.block.Block;

public class CRNPlatformSpecificClient {

@ExpectPlatform
public static void registerCTBehviour(Block entry, Supplier<ConnectedTextureBehaviour> behaviorSupplier) {
throw new AssertionError();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import de.mrjulsen.crn.registry.ModItems;
import de.mrjulsen.mcdragonlib.net.NetworkManagerBase;
import dev.architectury.platform.Platform;
import net.fabricmc.api.EnvType;
import dev.architectury.utils.Env;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
Expand Down Expand Up @@ -109,7 +109,7 @@ public static void init() {
CRNPlatformSpecific.registerConfig();

ModEvents.init();
if (Platform.getEnv() == EnvType.CLIENT) {
if (Platform.getEnvironment() == Env.CLIENT) {
ClientEvents.init();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import java.util.Comparator;
import java.util.List;

import com.simibubi.create.content.contraptions.Contraption;
import com.simibubi.create.content.trains.display.FlapDisplayBlock;
import com.simibubi.create.content.trains.entity.CarriageContraption;
import com.simibubi.create.content.trains.entity.CarriageContraptionEntity;
Expand Down Expand Up @@ -519,7 +518,7 @@ public void lazyTick() {
}

@Override
public void contraptionTick(Level level, BlockPos pos, BlockState state, Contraption contraption) {
public void contraptionTick(Level level, BlockPos pos, BlockState state, CarriageContraption carriage) {
getRenderer().tick(level, pos, state, this);

if (!isController()) {
Expand All @@ -532,7 +531,6 @@ public void contraptionTick(Level level, BlockPos pos, BlockState state, Contrap

syncTicks++;
if ((syncTicks %= 100) == 0) {
CarriageContraption carriage = (CarriageContraption)contraption;
long id = InstanceManager.registerClientTrainDataResponseAction((data, refreshTime) -> {
if (data == null) {
return;
Expand Down Expand Up @@ -618,7 +616,9 @@ public void read(CompoundTag pTag, boolean clientPacket) {

xSize = pTag.getByte(NBT_XSIZE);
ySize = pTag.getByte(NBT_YSIZE);
color = pTag.getInt(NBT_COLOR);
if (pTag.contains(NBT_COLOR)) {
color = pTag.getInt(NBT_COLOR);
}
glowing = pTag.getBoolean(NBT_GLOWING);
isController = pTag.getBoolean(NBT_CONTROLLER);
infoType = EDisplayInfo.getTypeById(pTag.getInt(NBT_INFO_TYPE));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package de.mrjulsen.crn.block.be;

import com.simibubi.create.content.contraptions.Contraption;
import com.simibubi.create.content.trains.entity.CarriageContraption;

import net.minecraft.core.BlockPos;
import net.minecraft.world.level.Level;
Expand All @@ -15,5 +15,5 @@ public interface IContraptionBlockEntity<T extends BlockEntity> {
* @param state
* @param contraption
*/
void contraptionTick(Level level, BlockPos pos, BlockState state, Contraption contraption);
void contraptionTick(Level level, BlockPos pos, BlockState state, CarriageContraption carriage);
}
Loading

0 comments on commit 47e85b3

Please sign in to comment.