SlimeVoid / DynamicTransport

7 stars 7 forks source link

Refactor elevator so moving parts are children of the computer #31

Closed Tarig0 closed 9 years ago

Tarig0 commented 10 years ago

There will now be a Elevator master or the brain and each physical piece will be an elevator part

call elevator

computer inits master elevator

pass master elevator bound elevator list and elevator settings.

Master elevator spawns parts.

on master update loop through each part and update, where calculations relevant to the whole elevator are calculated once.

on world reset the master elevator must wait till all parts are re-spawned before moving.

a flag will default to false when ever the elevator is spawned (not read from nbt)

that will be flipped to true once the elevator part list matched the length of the list saved or passed form the elevator computer

Tarig0 commented 10 years ago

And again refactor entity to have the master entity be the computer.

Tarig0 commented 10 years ago

I need to figure out how horizontal movement will work since then we get chunk (un)loading issues there.

Maybe have the computer chunload itself when horizontal movement is occurring, and it will check to see if the entity has all it's parts in a loaded chunk.

Means I have to loop through the entities twice =.= might need to add a server config option to change maximum elevator size so server admins can keep the lag down.

Tarig0 commented 9 years ago

Hmm could make it so the elevator is respawned on each load.

Elevator computer contains a new tag, moving Elevator

This will store all the required data to spawn the elevator parts at the correct position.

Elevator will chunkload itself when ever the status of the elevator is in transit