Elevators v2

Elevators v2

27.2k Downloads

Elevators not working after server restart

Salzian opened this issue ยท 3 comments

commented

When restarting the server, the elevators are not working anymore.

Expected Behavior

Clicking a call- or elevator-sign triggers the elevators intended behaviour.

Current Behavior

Nothing happens.

Current workaround

Go to the floor where the platform currently is, break the glass and replace the sign. The elevator detects all floors and works again as expected.

Steps to Reproduce

  1. Build an elevator.
  2. Reload server.
  3. Try to interact with the elevator.

Additional information

When running the script in debug mode it throws the following error into the console:

[14:52:08 INFO]: [Elevators] Error in fromElevSign: Elevator not detected for sign: CraftBlock{chunk=CraftChunk{x=11z=17},x=179,y=61,z=272,type=WALL_SIGN,data=5}

The same error can be found in-game:

image

This happens both when clicking the call- and the elevator-sign.

commented

I decided to download the source code and investigate in an own build. As far as I can see it right now, the plugin does not actually save the elevators into the config.yml file. So every time the server reloads/restarts it reads zero elevators from the file. When the plugin now tries to run the loop in Elevator.fromCallSign or Elevator.fromElevBlock, it immediately drops out of the loop and throws an error.

commented

It's probably deleting your elevators because they are invalid. That's the only reason it doesn't save them or deletes them from the config. Does it say Deleted 1 saved elevator(s) because they were invalid when loading?

commented

Please have a look at this fix: #7