CC:C Bridge

CC:C Bridge

5M Downloads

Train Station Disassemble() reverts train blocks to their initial states

CammyFentreux opened this issue ยท 17 comments

commented

Description
I have a train with a set of Immersive Engineering MV Accumulators, designed to carry power to a factory. It is decorated with various blocks from Framed Blocks. At the factory train station I have a CC computer running code pasted below (and also double checked with a simplified version) that will automatically disassemble any train that arrives at the station, so that the accumulators revert to blocks and connect to the power cables.

This idea works perfectly fine when disassembling the train through the station UI, but when using the computer seemingly all blocks get 'reset'. Accumulators lose their charge and all faces but the top disable their connections and the framed blocks lose their set texture. Also, despite being blocks and having a connection on the top where the cable is, no connection is made between the power line and the accumulator despite this also working when using the system manually.

To Reproduce
Steps to reproduce the behaviour:

  1. Create a train with customisable blocks (such as IE accumulators or FramedBlocks slopes), with obvious customisations made
  2. Assemble the train through the train station UI
  3. Run either script below
  4. Observe the blocks revert to their newly placed, newly crafted state

Expected behaviour
I would expect disassembly through a CC:Tweaked computer to work exactly the same as disassembly through the train station UI, putting all blocks of the contraption back into their block state without any loss.

Screenshots
Before disassembly, pre-arrival:
image
After Disassembly, post-arrival:
image

Full Script:

station = peripheral.wrap('left')
isNewTrain = true
while true do
  isTrainPresent = station.getPresentTrain()
  print(isTrainPresent)
  
  if not isTrainPresent and not isNewTrain then
    isNewTrain = true
  end
  if isTrainPresent and isNewTrain then
    station.disassemble()
    os.pullEvent('redstone')
    station.assemble()
  end
  sleep(10)
end

Shortened Script:

station = peripheral.wrap('left')
station.disassemble()

Software (please complete the following information):

  • Minecraft Version 1.18.2
  • Mod Version 1.3.1
  • ModLoader Forge

This is running on a server, as part of the FTB Plexiglass Mountain Modpack. CC:C Bridge is the only custom mod (aside from FTB Backups 2, on the server only). I thought I had this working in a single player world, but testing again this occurs there too.

commented

Hi i tried fixing this. Could you try using this version ?
https://github.com/tweaked-programs/cccbridge/files/11347687/JarFiles.zip

commented

Hey! Thanks for reporting this.
This sounds very odd. The Train Stations currently do for some reason much shenanigans.
We will take a look at this.

commented

Hi, sorry for the problems. Just to make sure for my Documentation do you have this problem too when doing the same but with the station GUI ?

commented

This idea works perfectly fine when disassembling the train through the station UI, but when using the computer seemingly all blocks get 'reset'.

Nope, manually pressing disassemble causes no problems. Everything works as expected through the station's GUI.

commented

Hi, has been a busy week sorry. Hopefully I'll get the chance to try it this weekend. Thanks ^-^!

commented

And as an addition, you could tweak your code to make it listen for the "arrival" event so you can check easier when a train arrive :)

commented

Ah I didn't know about that event! Thanks a bunch, that'll be much neater. Where is that documented? I don't see it in the train station part of the wiki anywhere.

commented

Cause you got a preview test version to validate that everything works, it's not yet documented

commented

Mm, I misunderstood, thought you were saying it was something pre-existing I'd missed. I'll try check out the fix as soon as possible!

commented

Finally got around to checking this out (exam season is the worst), but unless I'm being dumb I think the files you gave are for the wrong version for the pack we're playing on. The pack we're using is for 1.18.2 but the .jar file says 1.19.2.

commented

Sorry, I've read your issue wrong.
But I may take a lot longer to make a new 1.18.2 version because it includes many 1.19.2 only stuff so

commented

Not a problem, would have spotted it earlier if I'd managed to test it so it's no worries.

commented

Yeah,my Version was fucked up cause it is 1.19.2 and had some bugs on Different machines but not mine I am currently working on fixing that

commented

Hey i had the same issue and i tried your version @Luke1505 on 1.19.2 but it crashed my game when i launched

2023-06-10-3.log.gz

commented

Okay Thanks

commented

Hello again, because the Train assembly and disassembly was taken care of by Create Themselves all our colliding functions will be replaced by theirs but that does not mean we are not adding additional functions to it in the future.
Kind Regards Luke.

commented

Closed (removed function)