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() {
|
override fun tick() {
|
||||||
super.tick()
|
super.tick()
|
||||||
if (tickCount % 20 == 0) {
|
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() {
|
override fun checkDespawn() {
|
||||||
super.checkDespawn()
|
super.checkDespawn()
|
||||||
if (!checkProjectionEffect()) remove(RemovalReason.KILLED)
|
if (!checkProjectionEffect()) {
|
||||||
|
dropEquipment()
|
||||||
|
remove(RemovalReason.KILLED)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private val inventory = SimpleContainer(10)
|
private val inventory = SimpleContainer(10)
|
||||||
@ -217,4 +223,9 @@ class ProjectedPersonEntity(entityType: EntityType<out PathfinderMob>, level: Le
|
|||||||
brain.eraseMemory(MemoryModuleType.HOME)
|
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
|
import kotlin.math.min
|
||||||
|
|
||||||
data class SwarmProjectionEffect(
|
data class SwarmProjectionEffect(
|
||||||
var maxCount: Int = 100,
|
var maxCount: Int = 180,
|
||||||
) : ProjectionEffect() {
|
) : ProjectionEffect() {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
Loading…
Reference in New Issue
Block a user