Closed Tarig0 closed 10 years ago
Considering a tick handler.
if (loaded entity list contains Dynamic Transport entities) check if those elevator blocks have any entities colliding or just above them and add the appropriate motion to them.
Ew no! Not on tick, no need.
We can just store static HashMap <EntityPlayer, Integer> playersOnElevators
When an Elevator spawns it does if isplayer then playersOnElevators.put(player, elevatorId)
in Player tick handler if playerIsOnElevator then set motionY = getElevator(elevatorId).motionY
All server side of course.
Winning!
We may still run into the same problem, but its a start.
The issue is that motion Y for player needs to be calculated on the client side.
I think the client tick event is what we are going to need
this is the one case where all server side is losing
We have two options on Player Client Tick, or simply Client Tick.
I'm leaning towards Player client
Player Client Tick will allow us to have each player check if they are standing on an elevator, simple and works.
Then on elevator tick we ignore any player entities and do what we do with the other entities.
The only thing left after that is why does item entities fall through the elevator.
Yep! For consistent updates.
Sent from Windows Mail
From: Allen Cook Sent: Friday, 3 January 2014 09:43 To: SlimeVoid/DynamicTransport Cc: Greg Jones
We have two options on Player Client Tick, or simply Client Tick.
I'm leaning towards Player client
Player Client Tick will allow us to have each player check if they are standing on an elevator, simple and works.
Then on elevator tick we ignore any player entities and do what we do with the other entities.
— Reply to this email directly or view it on GitHub.
Almost, I've looked at the entity code and compared it to the EntityArrow and I think we have the entity only being updated on the server side is incorrect
Made it so the entity updates client and server, and passes the destination to client so the elevator gets updated with the correct logic.
NO go at least with major lag, possibility of setting max speed by server config? Think the only thing left is to slow down the elevator, currently moves faster that creative flying
Done
It seems impossible to use an entity to push a player up with any kind of lag, due to mojangs attempts to keep lag issues down.
Thuamcraft and Thumanic Tinkers use blocks to move entities, we could create ghost blocks that "follow" the elevator up and down transferring the current motion from the elevator block to an entitys within the blocks bounds, (which could be changed depending on the location of the elevator.)
ex. single elevator entity is moving up at motion y = 2 the curent center of the entity is at y = 60 or the top,bottom 60.5 - 59.5.
This will set two motion blocks at y 60 and 59.
These blocks on collision will first ignore the elevator, and then detect if there is any other entities within it's full block bounds.
if entity detected
Blocks should self check if they contain an elevator on random tick/ collision and kill themselves if no elevator is found.