gentili / RailDriver

Bukkit Plugin for automated mining and railroad construction machine
4 stars 2 forks source link

Add chunk persistance for driver's location #15

Open fyrenth opened 12 years ago

fyrenth commented 12 years ago

Starting a Driver and running away from it to leave it on its own can result in its freezing due to the chunk being unloaded due to inactivity.

Intercepting chunk unload events and canceling them if they contain an active driver is probably necessary to allow for relatively unattended operation.

gentili commented 12 years ago

Yup! I've run into this problem, though when I experimented it seems that the block change events the RD issues will immediately cause the chunk to reload.

gentili commented 12 years ago

Another weird thing is that lighting updates don't happen when the RD is operating far out of view of any players. It can end up looking like the RD is in a dark cave even though there's torches in there.

fyrenth commented 12 years ago

Unfortunately tests have shown a clean shutdown of the Driver if I run away from it and let the chunk unload. Returning to the driver finds it in an off state, and can just turn back on (meaning on obstructions were ahead of it to stop it anyway). This behavior has been consistent. Going to hook the unloadchunk event.

fyrenth commented 12 years ago

or not... its stopping.. but I don't think due to chunk unloading... investigating further.