SlimeVoid / DynamicTransport

7 stars 7 forks source link

Update Forge, Fix elevator platform stuck in endless loop, i18n works #47

Open hammer354 opened 6 years ago

Tarig0 commented 6 years ago

how does the check flag work?

hammer354 commented 6 years ago

The way the elevator run is master elevator moving part elevators, but which parts need to move is only saved in memory, when info in memory lost (e.g. chunk unload, player offline, game crash), master won't know which parts need to move, and parts that losing master will stuck forever. So I added code of saving parts' locations into save, and I added a flag, the flag can be understand as "create manually". When entity create manually, flag is true and nothing will happen, but when entity load from save, the default construct method will be invoke and flag is false. First remove old parts that losing master and place blocks, then master will re-spawn parts, the new parts will get camo items and remove blocks, finally master will continue moving with new parts.