item entity: don't tick if below world

This commit is contained in:
Bixilon 2023-06-25 00:56:37 +02:00
parent 74347891e5
commit 0b7b6261da
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4

View File

@ -54,6 +54,8 @@ class ItemEntityPhysics(entity: ItemEntity) : EntityPhysics<ItemEntity>(entity)
private fun move() { private fun move() {
// This is not 100% vanilla, but performance optimized // This is not 100% vanilla, but performance optimized
if (position.y < entity.connection.world.dimension.minY - 10.0) return // ignore out of world entities
if (onGround && this.velocity.xz.length2() <= 9.999999747378752E-6 && entity.age % 4 != 0) return if (onGround && this.velocity.xz.length2() <= 9.999999747378752E-6 && entity.age % 4 != 0) return
move(this.velocity) move(this.velocity)