parent
9623f84eb5
commit
b5ed902871
@ -157,6 +157,7 @@ class EnderTeleporterFeature(capability: MatteryPlayerCapability) : AndroidActiv
|
||||
val testPositions = ply.genericPositions()
|
||||
|
||||
if (
|
||||
!ply.isShiftKeyDown &&
|
||||
result.direction == Direction.UP &&
|
||||
isValidPosition(result.blockPos.above()) &&
|
||||
shortestDistanceBetween(testPositions, result.blockPos.above().asVector()) <= ServerConfig.EnderTeleporter.MAX_DISTANCE
|
||||
@ -167,6 +168,7 @@ class EnderTeleporterFeature(capability: MatteryPlayerCapability) : AndroidActiv
|
||||
val candidates = LinkedList<TraceResult>()
|
||||
|
||||
if (
|
||||
!ply.isShiftKeyDown &&
|
||||
result.direction != Direction.UP &&
|
||||
result.direction != Direction.DOWN &&
|
||||
!isAirGap(result.blockPos) &&
|
||||
@ -196,7 +198,15 @@ class EnderTeleporterFeature(capability: MatteryPlayerCapability) : AndroidActiv
|
||||
var phasedBlocks = 0
|
||||
val phasedBlocksList = ArrayList<BlockPos>()
|
||||
|
||||
for (y in (if (ply.level.getBlockState(result.blockPos).`is`(BlockTags.CLIMBABLE)) -1 else 0) .. ply.level.maxBuildHeight - ply.level.minBuildHeight) {
|
||||
val searchDirection: IntProgression
|
||||
|
||||
if (ply.isShiftKeyDown) {
|
||||
searchDirection = -1 downTo ply.level.minBuildHeight - ply.level.maxBuildHeight
|
||||
} else {
|
||||
searchDirection = (if (ply.level.getBlockState(result.blockPos).`is`(BlockTags.CLIMBABLE)) -1 else 0) .. ply.level.maxBuildHeight - ply.level.minBuildHeight
|
||||
}
|
||||
|
||||
for (y in searchDirection) {
|
||||
val pos = BlockPos(result.blockPos.x, result.blockPos.y + y + 1, result.blockPos.z)
|
||||
val state = ply.level.getBlockState(pos)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user