fix: discard

This commit is contained in:
xtex 2023-07-03 15:49:59 +08:00
parent cb9ae35260
commit 16a2728ac1
Signed by: xtex
GPG Key ID: B918086ED8045B91
2 changed files with 4 additions and 2 deletions

View File

@ -167,7 +167,7 @@ class ProjectedPersonEntity(entityType: EntityType<out PathfinderMob>, level: Le
override fun checkDespawn() { override fun checkDespawn() {
super.checkDespawn() super.checkDespawn()
if (!checkProjectionEffect()) discard() if (!checkProjectionEffect()) remove(RemovalReason.KILLED)
} }
private val inventory = SimpleContainer(10) private val inventory = SimpleContainer(10)

View File

@ -20,7 +20,9 @@ fun <E> LostItem(chance: Int): OneShot<E>
val count = level.random.nextInt(item.count) val count = level.random.nextInt(item.count)
item.shrink(count) item.shrink(count)
inventory.setChanged() inventory.setChanged()
level.addFreshEntity(ItemEntity(level, entity.x, entity.y + 0.25, entity.z, item.copyWithCount(count))) val itemEntity = ItemEntity(level, entity.x, entity.y + 0.25, entity.z, item.copyWithCount(count))
itemEntity.setDefaultPickUpDelay()
level.addFreshEntity(itemEntity)
return@Trigger true return@Trigger true
} else { } else {
return@Trigger false return@Trigger false