From 0845458921ec668f99f84e491c0c4df5198c6a9a Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sun, 2 Oct 2022 21:54:16 +0700 Subject: [PATCH] Allow to teleport on leaves --- .../mc/otm/android/feature/EnderTeleporterFeature.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/android/feature/EnderTeleporterFeature.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/android/feature/EnderTeleporterFeature.kt index 6dc6d6ceb..30cd8d73c 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/android/feature/EnderTeleporterFeature.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/android/feature/EnderTeleporterFeature.kt @@ -12,6 +12,7 @@ import net.minecraft.resources.ResourceLocation import net.minecraft.server.level.ServerPlayer import net.minecraft.world.level.ClipContext import net.minecraft.world.level.block.Block +import net.minecraft.world.level.material.Material import net.minecraft.world.phys.BlockHitResult import net.minecraft.world.phys.HitResult import net.minecraft.world.phys.shapes.CollisionContext @@ -65,7 +66,7 @@ class EnderTeleporterFeature(capability: MatteryPlayerCapability) : AndroidActiv } private fun isValidPosition(blockPos: BlockPos): Boolean { - if (!Block.canSupportCenter(ply.level, blockPos.below(), Direction.UP) && !Block.canSupportRigidBlock(ply.level, blockPos.below())) { + if (!Block.canSupportCenter(ply.level, blockPos.below(), Direction.UP) && !Block.canSupportRigidBlock(ply.level, blockPos.below()) && ply.level.getBlockState(blockPos.below()).material != Material.LEAVES) { return false }