multimodal
This commit is contained in:
@@ -23,16 +23,33 @@ Here is the relevant code path for the optimization.
|
||||
#note[ `onGround` is only ever updated from `move()`, and this branch is the *only* place that
|
||||
`move()` is called. ]
|
||||
|
||||
```java public class ItemEntity extends Entity { public void tick() { ... if (this.onGround() &&
|
||||
!(this.getDeltaMovement().horizontalDistanceSqr() > (double)1.0E-5F) && (this.tickCount +
|
||||
this.getId()) % 4 != 0) { ... } else { this.move(MoverType.SELF, this.getDeltaMovement()); ... } ...
|
||||
} }
|
||||
```java
|
||||
public class ItemEntity extends Entity {
|
||||
public void tick() {
|
||||
...
|
||||
if (this.onGround() && !(this.getDeltaMovement().horizontalDistanceSqr() > (double)1.0E-5F) && (this.tickCount + this.getId()) % 4 != 0) {
|
||||
...
|
||||
} else {
|
||||
this.move(MoverType.SELF, this.getDeltaMovement());
|
||||
...
|
||||
}
|
||||
...
|
||||
}
|
||||
}
|
||||
|
||||
public class Entity { public void move(final MoverType moverType, Vec3 delta) { ...
|
||||
this.setOnGroundWithMovement(this.verticalCollisionBelow, this.horizontalCollision, movement); ... }
|
||||
public class Entity {
|
||||
public void move(final MoverType moverType, Vec3 delta) {
|
||||
...
|
||||
this.setOnGroundWithMovement(this.verticalCollisionBelow, this.horizontalCollision, movement);
|
||||
...
|
||||
}
|
||||
|
||||
public void setOnGroundWithMovement(final boolean onGround, final boolean horizontalCollision,
|
||||
final Vec3 movement) { this.onGround = onGround; ... } } ```
|
||||
public void setOnGroundWithMovement(final boolean onGround, final boolean horizontalCollision, final Vec3 movement) {
|
||||
this.onGround = onGround;
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
== Observable Drop Delay
|
||||
|
||||
|
||||
@@ -25,7 +25,9 @@ thread") *also* tracks some entities.
|
||||
|
||||
In versions before 26.2, there was a bug that caused the client thread and server thread to use the
|
||||
*same* global ID counter. Therefore every entity might increment the counter twice: once when it
|
||||
spawns in the server, and once when the client begins to track it.
|
||||
spawns in the server, and once when the client begins to track it. Because this depends on the
|
||||
position and orientation of the player, and also on the unpredictable scheduling of the two
|
||||
execution threads, it is impossible to truly compensate for these effects.
|
||||
|
||||
The solution is to either use a dedicated minecraft server, so that the client and servers run in
|
||||
separate processes, or install a mod which patches the game to use a separate counter for the
|
||||
|
||||
Reference in New Issue
Block a user