From 8cebf4243e7c248b3c3271a4016019312b3b0ce2 Mon Sep 17 00:00:00 2001 From: Luligabi1 <33578169+Luligabi1@users.noreply.github.com> Date: Thu, 2 Nov 2023 15:56:56 -0300 Subject: [PATCH] Fix #140 --- .../dev/nathanpb/dml/blockEntity/BlockEntityTrialKeystone.kt | 2 +- base/src/main/kotlin/dev/nathanpb/dml/utils/Math.kt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/base/src/main/kotlin/dev/nathanpb/dml/blockEntity/BlockEntityTrialKeystone.kt b/base/src/main/kotlin/dev/nathanpb/dml/blockEntity/BlockEntityTrialKeystone.kt index bb43e47f..c99ef2d9 100644 --- a/base/src/main/kotlin/dev/nathanpb/dml/blockEntity/BlockEntityTrialKeystone.kt +++ b/base/src/main/kotlin/dev/nathanpb/dml/blockEntity/BlockEntityTrialKeystone.kt @@ -273,7 +273,7 @@ class BlockEntityTrialKeystone(pos: BlockPos, state: BlockState) : val innerBlockPos = BlockPos(x, y, z) if ( innerBlockPos != pos - && innerBlockPos.getSquaredDistance(pos) <= config.trial.arenaRadius.squared() + && innerBlockPos.getSquaredDistance(pos) < config.trial.arenaRadius.squared() && world?.getBlockState(innerBlockPos)?.isAir != true ) { list += innerBlockPos diff --git a/base/src/main/kotlin/dev/nathanpb/dml/utils/Math.kt b/base/src/main/kotlin/dev/nathanpb/dml/utils/Math.kt index a6ceb09d..24ff9e4e 100644 --- a/base/src/main/kotlin/dev/nathanpb/dml/utils/Math.kt +++ b/base/src/main/kotlin/dev/nathanpb/dml/utils/Math.kt @@ -24,6 +24,7 @@ import kotlin.random.Random fun Double.lerp(min: Double, max: Double) = (1 - this) * min + this * max fun Int.lerp(min: Double, max: Double) = (1 - this) * min + this * max +fun Double.squared() = this * this fun Int.squared() = this * this // https://stackoverflow.com/a/35701777/9893963