This commit is contained in:
yrsegal@gmail.com 2022-08-22 22:34:00 -04:00
parent ed2abee735
commit 2ae33cf82d
2 changed files with 12 additions and 15 deletions

View file

@ -83,23 +83,14 @@ object OpTeleport : SpellOperator {
}
fun teleportRespectSticky(teleportee: Entity, delta: Vec3) {
var stickyTeleport = false
// roll our own for loop
// this really would be more readable as a c-style for loop, waugh
var cursor = teleportee.vehicle
var base: Entity? = null
while (cursor != null) {
if (cursor.type.`is`(HexEntityTags.STICKY_TELEPORTERS))
stickyTeleport = true
base = cursor
cursor = cursor.vehicle
}
val base = teleportee.rootVehicle
val playersToUpdate = mutableListOf<ServerPlayer>()
if (stickyTeleport) {
if (base.indirectPassengers.any { it.type.`is`(HexEntityTags.STICKY_TELEPORTERS) }) {
// this handles teleporting the passengers
val target = base!!.position().add(delta)
val target = base.position().add(delta)
base.teleportTo(target.x, target.y, target.z)
base.indirectPassengers
.filterIsInstance<ServerPlayer>()

View file

@ -19,6 +19,12 @@
},
"minecraft:pig",
"minecraft:strider",
"minecraft:horse"
"minecraft:horse",
"minecraft:skeleton_horse",
"minecraft:zombie_horse",
"minecraft:mule",
"minecraft:donkey",
"minecraft:llama",
"minecraft:trader_llama"
]
}
}