bergerhealer / TrainCarts

Minecarts redefined
MIT License
205 stars 63 forks source link

Minecarts Dissapearing after logging in #437

Closed gazpachoking closed 1 year ago

gazpachoking commented 2 years ago

Info

Please provide the following information: [23:31:36 INFO]: Train_Carts: v1.18.1-v1 (build: 995) [23:31:36 INFO]: BKCommonLib: v1.18.1-v1 (build: 1172) [23:31:36 INFO]: Server: git-Paper-77 (MC: 1.18.1)


Bug

Description

Whenever I reconnect to my server, all of the hopper minecarts that I have placed under my sheep farm are gone.

Expected behaviour

Keep carts in place.

Actual behaviour

Dissapearing the carts.

Steps to reproduce

Place hopper minecarts in a one by one spot on a track on a hopper.

image image

Log out of the server for a few minutes. Log back in to the server, get the following log messages and have the hopper minecarts be missing.

[23:02:22 INFO]: gazpachoking joined the game
[23:02:22 INFO]: gazpachoking[/192.168.0.143:64203] logged in with entity id 39777 at ([world]-393.33052013961486, 65.5,
-83.2334549812108)
[23:02:22 WARN]: [Train_Carts] 1 carts of group 'train4' are missing! (externally edited?)
[23:02:22 WARN]: [Train_Carts] 1 carts of group 'train6' are missing! (externally edited?)
[23:02:22 WARN]: [Train_Carts] 1 carts of group 'train5' are missing! (externally edited?)
[23:02:22 WARN]: Can't keep up! Is the server overloaded? Running 529817ms or 10596 ticks behind

Additional Information

I disabled TrainCarts, and the hopper minecarts have not dissapeared since, leaving me to believe it's something to do with this plugin. Let me know if there is other info I can give, or other ways to help debug.

bergerkiller commented 2 years ago

Kind of unlucky as I fixed this last night... Can you check if its still the case?

https://ci.mg-dev.eu/job/BKCommonLib/1179/ https://ci.mg-dev.eu/job/TrainCarts/998/

gazpachoking commented 2 years ago

Just updated to those versions, and everything looks good so far! 🥳 Thanks!

gazpachoking commented 2 years ago

Hmm. Now I'm having the issue that the hopper minecarts stop being hoppers after some time. Doing some more testing to verify whether it's this plugin. Just happened to have some xray vision as my server was starting which showed the problem. image I'll open a new ticket with more details if I can trace the issue to traincarts.

bergerkiller commented 2 years ago

Are the carts still hopper minecarts in every other way? So can you click on them and an inventory shows up? Can they move still? And if you look at them, can you do /train edit to select them, and does /train info show valid details?

gazpachoking commented 2 years ago

I still can't figure quite what happened. I saw a few piles of wool pooling up and replaced those carts and everything was fine. I then saw it happening to a lot of the carts later and reported here. I disabled traincarts and restarted my server and they all started working again. I then re-enabled traincarts and they are still working. I'll get more details if/when it happens again.

Are the carts still hopper minecarts in every other way? So can you click on them and an inventory shows up? Can they move still?

Yeah, they looked normal and I could interact with them to see the inventory. Not sure if they could move because I have these ones locked in a 1x1.

And if you look at them, can you do /train edit to select them, and does /train info show valid details?

Didn't happen to check this before I fixed them by disabling/re-enabling traincarts.

gazpachoking commented 2 years ago

Okay, it happened again when I logged in today. Not every hopper minecart broke, but some of them did. They all are still interactable, and if I put things in their inventory they get sucked out by the hopper below. /train edit and /train info work and look normal to me. I restarted the server without disabling traincarts this time, and some of them were fixed after restart. Restarting again and they were all fixed. I officially have no idea what's going on, and can't even be certain traincarts is the cause (though I don't have any other plugins installed that I think would affect mine carts.)

bergerkiller commented 2 years ago

I managed to reproduce this. A restart doesnt cause it, but if you log off and rejoin, then the carts are in this weird state. I'll figure out what internal state is messy, which could be the activator state, cooldown (not used), or something else.

bergerkiller commented 2 years ago

Alright so thats bad, entity onTick() isnt being called anymore. Thanks to the backup task the train physics still function. Something in BKCL I will have to look more closely into.

gazpachoking commented 2 years ago

Oh! I'm glad you could reproduce it. I was struggling to figure out exactly what caused and fixed the problem. Hopefully you can figure it out, thanks!

bergerkiller commented 2 years ago

ScreenShot 2021-12-18 23 07 07 finally, after a long search, Ive found the problem. It starts ticking the old minecart entity instead of the TrainCarts swapped-out one, and this one is dead, so it gets removed almost instantly.

Now to fix it.

bergerkiller commented 2 years ago

Fixed this issue, but I found a much more errr...interesting issue. When the cart reloads (after chunk unload), it seems to duplicate all the hopper contents inside. I remember seeing an issue ticket/report of this but never managed to reproduce it. When thats fixed Ill commit both fixes and post an update here.

bergerkiller commented 2 years ago

Should be good, for 1.17.1 at least. Ive noticed this fix broke some 1.12.2 stuff and Ill be looking into that more tomorrow.

https://ci.mg-dev.eu/job/TrainCarts/1001/ https://ci.mg-dev.eu/job/BKCommonLib/1180/

bergerkiller commented 2 years ago

You will want to grab the latest builds of both, as it fixes a few more related problems. Mostly for paper / pre-1.13

gazpachoking commented 2 years ago

You will want to grab the latest builds of both, as it fixes a few more related problems. Mostly for paper / pre-1.13

Done, thanks! Been using autoplug to grab the latest versions straight from jenkins. Everything has been looking good now. :)