fix: discard
This commit is contained in:
parent
cb9ae35260
commit
16a2728ac1
@ -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)
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user