Allow to teleport on leaves

This commit is contained in:
DBotThePony 2022-10-02 21:54:16 +07:00
parent ffc56ada1a
commit 0845458921
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -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
}