jenchanws / create-track-map

Create train track map mod for Minecraft (Fabric & Forge)
https://modrinth.com/mod/create-track-map
MIT License
65 stars 19 forks source link

car.leading is undefined #55

Open OfficialPixelBrush opened 10 months ago

OfficialPixelBrush commented 10 months ago

Describe the Bug

image

There should be several trains on this map, not just one. This used to work, but now just doesn't anymore, even after removing other mods that might cause issues. image

Reproduction Steps

Just randomly broke, I'm afraid.

Expected Result

Something more like this. image

Screenshots and Videos

No response

Crash Report or Log

No response

Operating System

Debian 11

CTM Version

1.4

Create Version

0.5.1e

Minecraft Version

1.19.2

Mod Loader

Forge

Modloader Version

43.3.2

Instance Type

Server hosted on vps/dedicated server

Other Mods

AI-Improvements-1.19.2-0.5.2.jar createbb-1.19.2-2.3.2.jar create-track-map-1.4+mc1.19.2-forge-create-0.5.1.jar mcw-bridges-2.1.1-mc1.19.2forge.jar alloyed-1.19.2-v1.5a.jar createbigcannons-forge-1.19.2-0.5.2.a.jar dynview-1.19.1-2.9.jar OreExcavation-1.11.166.jar architectury-6.5.85-forge.jar createchunkloading-1.5.0-forge.jar FarmersDelight-1.19.2-1.2.3.jar Steam_Rails-1.5.1+forge-mc1.19.2.jar carryon-forge-1.19.2-2.1.1.21.jar create-confectionery1.19.2_v1.0.9.jar FastLeafDecay-30.jar supermartijn642configlib-1.1.8-forge-mc1.19.jar chunkloaders-1.2.8-forge-mc1.19.jar createdeco-1.3.3-1.19.2.jar ferritecore-5.0.3-forge.jar supermartijn642corelib-1.1.15-forge-mc1.19.2.jar comforts-forge-6.0.5+1.19.2.jar create_misc_andthings+1.19.2_4.0A.jar jei-1.19.2-forge-11.6.0.1018.jar create-1.19.2-0.5.1.e.jar create-stuff-additions1.19.2_v2.0.4a.jar kotlinforforge-3.12.0-all.jar

Additional Context

No response

OfficialPixelBrush commented 10 months ago

Found the Problem. Turns out there's no leading cart for derailed trains, so the Server got stuck on the first derailed train it ran into.

OfficialPixelBrush commented 10 months ago

Probably best to skip derailed trains, or display them as red boxes without a leading cart.

krunoo53k commented 10 months ago

You seem to be on the right track. I had the same issue on Forge 1.20.1. I seem to have fixed it by editing the create-track-map.js file by adding the following lines before line 193

      train.cars.forEach((car, i) => {
        if(car.leading == undefined){
          return
        }

Derailed trains no longer stopped other trains from rendering, but this is a very crude "fix".

D3rPole commented 4 months ago

Same issue here but only on a specific server I play on. It doesnt happen when i crash a train in singleplayer. Singleplayer on same modpack as the server.

calliecameron commented 3 weeks ago

I played around with derailing trains on my server, and it seems to be trains that are already derailed when the server starts that don't have a 'leading' car. If you derail a train, it continues displaying correctly while the server is running, but will be missing the data when the server restarts.