File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
src/main/kotlin/com/lambda/module/modules/combat Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ import net.minecraft.client.network.OtherClientPlayerEntity
3939import net.minecraft.entity.player.PlayerEntity
4040import net.minecraft.item.BlockItem
4141import net.minecraft.util.math.BlockPos
42+ import net.minecraft.util.math.Box
4243import kotlin.jvm.optionals.getOrNull
4344
4445object PlayerTrap : Module(
@@ -88,8 +89,8 @@ object PlayerTrap : Module(
8889 }
8990
9091 fun SafeContext.getTrapPositions (player : PlayerEntity ): Set <BlockPos > {
91- val min = player.boundingBox.minPos.flooredBlockPos.add(- 1 , - 1 , - 1 )
92- val max = player.boundingBox.maxPos.flooredBlockPos.add(1 , 1 , 1 )
92+ val min = player.boundingBox.withEpsilon(). minPos.flooredBlockPos.add(- 1 , - 1 , - 1 )
93+ val max = player.boundingBox.withEpsilon(). maxPos.flooredBlockPos.add(1 , 1 , 1 )
9394
9495 return buildSet {
9596 (min.x + 1 .. < max.x).forEach { x ->
@@ -116,4 +117,11 @@ object PlayerTrap : Module(
116117 }
117118 }
118119 }
120+
121+ /* *
122+ * @see net.minecraft.util.math.Box.EPSILON
123+ */
124+ fun Box.withEpsilon (): Box {
125+ return this .expand(- 1e- 7 )
126+ }
119127}
You can’t perform that action at this time.
0 commit comments