fix: drop equipment
This commit is contained in:
parent
16a2728ac1
commit
f5b1372693
@ -158,7 +158,10 @@ class ProjectedPersonEntity(entityType: EntityType<out PathfinderMob>, level: Le
|
||||
override fun tick() {
|
||||
super.tick()
|
||||
if (tickCount % 20 == 0) {
|
||||
if (!checkProjectionEffect()) remove(RemovalReason.KILLED)
|
||||
if (!checkProjectionEffect()) {
|
||||
dropEquipment()
|
||||
remove(RemovalReason.KILLED)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -167,7 +170,10 @@ class ProjectedPersonEntity(entityType: EntityType<out PathfinderMob>, level: Le
|
||||
|
||||
override fun checkDespawn() {
|
||||
super.checkDespawn()
|
||||
if (!checkProjectionEffect()) remove(RemovalReason.KILLED)
|
||||
if (!checkProjectionEffect()) {
|
||||
dropEquipment()
|
||||
remove(RemovalReason.KILLED)
|
||||
}
|
||||
}
|
||||
|
||||
private val inventory = SimpleContainer(10)
|
||||
@ -217,4 +223,9 @@ class ProjectedPersonEntity(entityType: EntityType<out PathfinderMob>, level: Le
|
||||
brain.eraseMemory(MemoryModuleType.HOME)
|
||||
}
|
||||
|
||||
override fun dropEquipment() {
|
||||
super.dropEquipment()
|
||||
inventory.removeAllItems().forEach(::spawnAtLocation)
|
||||
}
|
||||
|
||||
}
|
@ -10,7 +10,7 @@ import quaedam.projector.ProjectorBlockEntity
|
||||
import kotlin.math.min
|
||||
|
||||
data class SwarmProjectionEffect(
|
||||
var maxCount: Int = 100,
|
||||
var maxCount: Int = 180,
|
||||
) : ProjectionEffect() {
|
||||
|
||||
companion object {
|
||||
|
Loading…
Reference in New Issue
Block a user