Skip to content

Commit

Permalink
Compiler errors fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
MairwunNx committed Jun 21, 2020
1 parent 1111ce4 commit ec01126
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import com.mairwunnx.randomteleport.managers.TeleportRollbackManager
import com.mairwunnx.randomteleport.structs.Position
import com.mojang.brigadier.CommandDispatcher
import com.mojang.brigadier.context.CommandContext
import net.minecraft.block.BedrockBlock
import net.minecraft.block.BlockState
import net.minecraft.block.Blocks
import net.minecraft.block.MagmaBlock
import net.minecraft.block.Material
import net.minecraft.command.arguments.EntityArgumentType
Expand Down Expand Up @@ -122,8 +122,8 @@ object RandomTeleportCommand {
var newPosition: Position? = null
var locationFound = false
val justInCaseComponent = TranslatableText("random_teleport.teleport.just_in_case")
justInCaseComponent.style.clickEvent = ClickEvent(
ClickEvent.Action.RUN_COMMAND, "/bad-location"
justInCaseComponent.style = justInCaseComponent.style.withClickEvent(
ClickEvent(ClickEvent.Action.RUN_COMMAND, "/bad-location")
)

if (byOther) {
Expand Down Expand Up @@ -204,7 +204,7 @@ object RandomTeleportCommand {
}

private fun isSafeLocation(world: ServerWorld, position: Position): Pair<Boolean, Int> {
if (!world.dimension.isNether) {
if (!world.dimension.isShrunk) {
val heightTop = getTopY(world, BlockPos(position.x, 257, position.z))
val blockPos = BlockPos(position.x, heightTop, position.z)
val blockState: BlockState = world.getBlockState(blockPos)
Expand All @@ -223,7 +223,10 @@ object RandomTeleportCommand {
) {
val material = blockState.material
return Pair(
!material.isLiquid && material != Material.FIRE && blockState.block !is MagmaBlock && blockState.block !is BedrockBlock,
!material.isLiquid
&& material != Material.FIRE
&& blockState.block !is MagmaBlock
&& !blockState.block.`is`(Blocks.BEDROCK),
blockPos.y + 1
)
}
Expand Down

0 comments on commit ec01126

Please sign in to comment.