Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.19.2 dev #73

Merged
merged 12 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ out/
output/
bin/
libs/
doc/

.classpath
.project
.idea/
classes/
.metadata
.vscode
.settings
*.launch
*.launch
.vscode/settings.json
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# 🚅 Create Railways Navigator (Minecraft Create Mod Addon)
![Logo](https://github.com/MisterJulsen/Create-Train-Navigator/blob/1.18.2/icon_256px.png)
![Logo](https://github.com/user-attachments/assets/2ee05cf6-c816-4dd7-8c24-6bb05062758e)

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

Expand All @@ -23,6 +23,10 @@ This mod adds a new item, the Create Railways Navigator, which is inspired by th
- Bavarian (DE)
- Spanish (by albertosaurio65)
- Russian (by VGamerGroup)
- French (by GeoffreyGx)
- Portuguese (by AlfredoProgramer)
- Korean (by queso-gato1355)
- Swedish (by Geoffrey)

## ⚠️ **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!
Expand Down
59 changes: 35 additions & 24 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ architectury {

allprojects {
group = rootProject.maven_group
version = "$rootProject.minecraft_version-$rootProject.mod_version"
version = "$rootProject.minecraft_version${rootProject.release_channel != "release" ? "-$rootProject.release_channel" : ""}-$rootProject.mod_version"
}

subprojects {
Expand All @@ -23,33 +23,25 @@ subprojects {
}

repositories {
maven { url = "file://${System.getProperty('user.home')}/.m2/github/modsrepo/maven" } // Local
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.tterrag.com/" } // Flywheel
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://maven.tterrag.com/" } // Flywheel
maven { url = "https://cursemaven.com"
content {
includeGroup "curse.maven"
}
}

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

}

dependencies {
Expand All @@ -60,6 +52,37 @@ subprojects {
}
}

processResources {
def expandProps = [
"version": version,
"minecraft_version": rootProject.minecraft_version,
"issues": rootProject.issues,
"source": rootProject.source,
"license": rootProject.license,
"modid": rootProject.archives_name,
"display_name": rootProject.display_name,
"homepage": rootProject.homepage,
"authors": rootProject.authors,
"description": rootProject.description,
"icon": rootProject.icon,
"discord": rootProject.discord,
"next_unsupported_minecraft_version": rootProject.next_unsupported_minecraft_version,
"dragonlib_version": "$rootProject.minecraft_version-$rootProject.dragonlib_version",
"forge_version_int": rootProject.forge_version_int,
"fabric_loader_version": rootProject.fabric_loader_version,
"java_version": rootProject.java_version,
"maven_group": rootProject.maven_group,
"create_forge_version": rootProject.create_forge_version,
"main_class_name": rootProject.main_class_name,
"create_forge_version_dependency": rootProject.create_forge_version_dependency,
]
filesMatching(['pack.mcmeta', 'fabric.mod.json', 'META-INF/mods.toml', 'createrailwaysnavigator.mixins.json']) {
expand expandProps
}
inputs.properties(expandProps)
exclude ".cache" // Remove cache from generated data
}

java {
withSourcesJar()
withJavadocJar()
Expand All @@ -68,18 +91,6 @@ subprojects {
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
}
Expand Down
7 changes: 4 additions & 3 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ loom {
dependencies {
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}")
modCompileOnly("dev.architectury:architectury:${rootProject.architectury_api_version}")
modCompileOnly("com.electronwill.night-config:toml:3.6.0")
modCompileOnly("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}")
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ public static void registerConfig() {
public static GlobalStation getStationFromBlockEntity(BlockEntity be) {
throw new AssertionError();
}

}
27 changes: 24 additions & 3 deletions common/src/main/java/de/mrjulsen/crn/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,29 @@ public class Constants {
public static final Component TEXT_FALSE = TextUtils.translate("gui." + CreateRailwaysNavigator.MOD_ID + ".common.false");
public static final Component TEXT_SERVER_ERROR = TextUtils.translate("gui." + CreateRailwaysNavigator.MOD_ID + ".common.server_error");
public static final Component TEXT_SEARCH = TextUtils.translate("gui." + CreateRailwaysNavigator.MOD_ID + ".common.search");
public static final UUID ZERO_UUID = UUID.fromString("00000000-0000-0000-0000-000000000000");
public static final Component TEXT_HELP = TextUtils.translate("gui." + CreateRailwaysNavigator.MOD_ID + ".common.help");
public static final Component TEXT_COPY = TextUtils.translate("gui." + CreateRailwaysNavigator.MOD_ID + ".common.copy");
public static final Component TEXT_PASTE = TextUtils.translate("gui." + CreateRailwaysNavigator.MOD_ID + ".common.paste");
public static final Component TEXT_RESET = TextUtils.translate("gui." + CreateRailwaysNavigator.MOD_ID + ".common.reset_defaults");
public static final UUID ZERO_UUID = new UUID(0, 0);
public static final int[] DEFAULT_TRAIN_TYPE_COLORS = new int[] { 0xFF393939, 0xFFf0f3f5, 0xFFafb4bb, 0xFF878c96, 0xFF2a7230, 0xFF814997, 0xFF1455c0, 0xFFa9455d, 0xFF55b9e6, 0xFFffd800 };

public static final int COLOR_ON_TIME = 0x1AEA5F;
public static final int COLOR_DELAYED = 0xFF4242;
public static final int COLOR_ON_TIME = 0xFF1AEA5F;
public static final int COLOR_DELAYED = 0xFFFF4242;
public static final int COLOR_TRAIN_BACKGROUND = 0xFF393939;

public static final String GITHUB_WIKI = "https://github.com/MisterJulsen/Create-Train-Navigator/wiki/";
public static final String HELP_PAGE_ADVANCED_DISPLAYS = GITHUB_WIKI + "Advanced-Displays";
public static final String HELP_PAGE_DYNAMIC_DELAYS = GITHUB_WIKI + "Dynamic-Delays";
public static final String HELP_PAGE_TRAIN_SEPARATION = GITHUB_WIKI + "Train-Separation";
public static final String HELP_PAGE_GLOBAL_SETTINGS = GITHUB_WIKI + "Global-Settings";
public static final String HELP_PAGE_NAVIGATION_WARNING = GITHUB_WIKI + "Navigation-Warning";
public static final String HELP_PAGE_SCHEDULE_SECTIONS = GITHUB_WIKI + "Train-Schedule-Sections";
public static final String HELP_PAGE_SCHEDULED_TIMES_AND_REAL_TIME = GITHUB_WIKI + "Scheduled-Time-and-Real-Time";
public static final String HELP_PAGE_STATION_BLACKLIST = GITHUB_WIKI + "Station-Blacklist";
public static final String HELP_PAGE_STATION_TAGS = GITHUB_WIKI + "Station-Tags";
public static final String HELP_PAGE_TRAIN_BLACKLIST = GITHUB_WIKI + "Train-Blacklist";
public static final String HELP_PAGE_TRAIN_GROUPS = GITHUB_WIKI + "Train-Groups";
public static final String HELP_PAGE_TRAIN_INITIALIZATION = GITHUB_WIKI + "Train-Imnitialization";
public static final String HELP_PAGE_TRAIN_LINES = GITHUB_WIKI + "Train-Lines";
}
80 changes: 35 additions & 45 deletions common/src/main/java/de/mrjulsen/crn/CreateRailwaysNavigator.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,23 @@
import com.simibubi.create.foundation.item.TooltipHelper.Palette;

import de.mrjulsen.crn.block.AdvancedDisplayBlock;
import de.mrjulsen.crn.event.ClientEvents;
import de.mrjulsen.crn.event.ModEvents;
import de.mrjulsen.crn.event.CRNClientEventsRegistryEvent;
import de.mrjulsen.crn.event.CRNEventsManager;
import de.mrjulsen.crn.event.ModClientEvents;
import de.mrjulsen.crn.event.ModCommonEvents;
import de.mrjulsen.crn.network.packets.cts.AdvancedDisplayUpdatePacket;
import de.mrjulsen.crn.network.packets.cts.GlobalSettingsRequestPacket;
import de.mrjulsen.crn.network.packets.cts.GlobalSettingsUpdatePacket;
import de.mrjulsen.crn.network.packets.cts.NavigationRequestPacket;
import de.mrjulsen.crn.network.packets.cts.NearestStationRequestPacket;
import de.mrjulsen.crn.network.packets.cts.NextConnectionsRequestPacket;
import de.mrjulsen.crn.network.packets.cts.RealtimeRequestPacket;
import de.mrjulsen.crn.network.packets.cts.TrackStationsRequestPacket;
import de.mrjulsen.crn.network.packets.cts.TrainDataRequestPacket;
import de.mrjulsen.crn.network.packets.stc.GlobalSettingsResponsePacket;
import de.mrjulsen.crn.network.packets.stc.NavigationResponsePacket;
import de.mrjulsen.crn.network.packets.stc.NearestStationResponsePacket;
import de.mrjulsen.crn.network.packets.stc.NextConnectionsResponsePacket;
import de.mrjulsen.crn.network.packets.stc.RealtimeResponsePacket;
import de.mrjulsen.crn.network.packets.stc.ServerErrorPacket;
import de.mrjulsen.crn.network.packets.stc.TimeCorrectionPacket;
import de.mrjulsen.crn.network.packets.stc.TrackStationResponsePacket;
import de.mrjulsen.crn.network.packets.stc.TrainDataResponsePacket;
import de.mrjulsen.crn.registry.ModAccessorTypes;
import de.mrjulsen.crn.registry.ModBlockEntities;
import de.mrjulsen.crn.registry.ModBlocks;
import de.mrjulsen.crn.registry.ModDisplayTypes;
import de.mrjulsen.crn.registry.ModExtras;
import de.mrjulsen.crn.registry.ModItems;
import de.mrjulsen.crn.registry.ModSchedule;
import de.mrjulsen.crn.registry.ModTrainStatusInfos;
import de.mrjulsen.mcdragonlib.net.NetworkManagerBase;
import dev.architectury.platform.Platform;
import dev.architectury.utils.Env;
import net.fabricmc.api.EnvType;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
Expand All @@ -47,7 +37,11 @@
public final class CreateRailwaysNavigator {

public static final String MOD_ID = "createrailwaysnavigator";
public static final String SHORT_MOD_ID = "crn";
public static final Logger LOGGER = LogUtils.getLogger();

public static final String DISCORD = "https://discord.gg/hH7YxTrPpk";
public static final String GITHUB = "https://github.com/MisterJulsen/Create-Train-Navigator";

public static final CreateRegistrate REGISTRATE = CreateRegistrate.create(MOD_ID);

Expand All @@ -69,52 +63,48 @@ public static KineticStats create(Item item) {
return null;
}



private static NetworkManagerBase crnNet;



public static void load() {}

public static void init() {

ModBlocks.register();
ModItems.register();
ModBlockEntities.register();
ModExtras.register();
ModBlocks.init();
ModItems.init();
ModBlockEntities.init();
ModExtras.init();
ModSchedule.init();
ModAccessorTypes.init();
ModTrainStatusInfos.init();
ModDisplayTypes.init();

crnNet = new NetworkManagerBase(MOD_ID, "crn_network", List.of(
// cts
GlobalSettingsRequestPacket.class,
GlobalSettingsUpdatePacket.class,
NavigationRequestPacket.class,
NearestStationRequestPacket.class,
NextConnectionsRequestPacket.class,
RealtimeRequestPacket.class,
TrackStationsRequestPacket.class,
TrainDataRequestPacket.class,
AdvancedDisplayUpdatePacket.class,

// stc
GlobalSettingsResponsePacket.class,
NavigationResponsePacket.class,
NearestStationResponsePacket.class,
NextConnectionsResponsePacket.class,
RealtimeResponsePacket.class,
ServerErrorPacket.class,
TrackStationResponsePacket.class,
TrainDataResponsePacket.class,
TimeCorrectionPacket.class
ServerErrorPacket.class
));

CRNPlatformSpecific.registerConfig();

ModEvents.init();
if (Platform.getEnvironment() == Env.CLIENT) {
ClientEvents.init();
ModCommonEvents.init();
if (Platform.getEnv() == EnvType.CLIENT) {
ModClientEvents.init();
}

CRNEventsManager.getEvent(CRNClientEventsRegistryEvent.class).register(MOD_ID, () -> {
});

}

public static NetworkManagerBase net() {
return crnNet;
}

public static boolean isDebug() {
return Platform.isDevelopmentEnvironment();
}
}
Loading