Skip to content

Commit ab97852

Browse files
committed
Fixed java interop
1 parent 2b93c82 commit ab97852

File tree

6 files changed

+22
-19
lines changed

6 files changed

+22
-19
lines changed

common/src/main/kotlin/com/lambda/graphics/RenderMain.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import org.joml.Matrix4f
3434
object RenderMain {
3535
val projectionMatrix = Matrix4f()
3636
val modelViewMatrix get() = Matrices.peek()
37-
val projModel get() = Matrix4f(projectionMatrix).mul(modelViewMatrix)
37+
val projModel: Matrix4f get() = Matrix4f(projectionMatrix).mul(modelViewMatrix)
3838

3939
var screenSize = Vec2d.ZERO
4040
var scaleFactor = 1.0

common/src/main/kotlin/com/lambda/interaction/construction/simulation/BuildSimulator.kt

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -456,19 +456,20 @@ object BuildSimulator {
456456
)
457457

458458
/* player has a better tool for the job available */
459-
if (!player.isCreative) findBestAvailableTool(state)?.let { bestTool ->
460-
Hand.entries.firstOrNull {
461-
val stack = player.getStackInHand(it)
462-
stack.item == bestTool
463-
}?.let { hand ->
464-
breakContext.hand = hand
465-
acc.add(BreakResult.Break(pos, breakContext))
466-
return acc
467-
} ?: run {
468-
acc.add(BuildResult.WrongItem(pos, breakContext, bestTool, player.activeItem, inventory))
469-
return acc
459+
if (!player.isCreative) findBestAvailableTool(state)
460+
?.let { bestTool ->
461+
Hand.entries.firstOrNull {
462+
val stack = player.getStackInHand(it)
463+
stack.item == bestTool
464+
}?.let { hand ->
465+
breakContext.hand = hand
466+
acc.add(BreakResult.Break(pos, breakContext))
467+
return acc
468+
} ?: run {
469+
acc.add(BuildResult.WrongItem(pos, breakContext, bestTool, player.activeItem, inventory))
470+
return acc
471+
}
470472
}
471-
}
472473

473474
acc.add(BreakResult.Break(pos, breakContext))
474475
}

common/src/main/kotlin/com/lambda/module/modules/client/Network.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ object Network : Module(
5555
val mappings by setting("Mappings", "https://mappings.lambda-client.org")
5656
val cdn by setting("CDN", "https://cdn.lambda-client.org")
5757

58-
val gameVersion = SharedConstants.getGameVersion().name
58+
@Suppress("Deprecation")
59+
const val GAME_VERSION = SharedConstants.VERSION_NAME
5960

6061
private var hash: String? = null
6162

common/src/main/kotlin/com/lambda/util/DynamicReflectionSerializer.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ object DynamicReflectionSerializer : Loadable {
7676
private const val INDENT = 2
7777

7878
private val mappings = runBlocking {
79-
"${Network.mappings}/${Network.gameVersion}"
80-
.downloadIfNotPresent(cache.resolveFile(Network.gameVersion))
79+
"${Network.mappings}/${Network.GAME_VERSION}"
80+
.downloadIfNotPresent(cache.resolveFile(Network.GAME_VERSION))
8181
.map { file ->
8282
val standardMappings = file.readLines()
8383
.map { it.split(' ') }

common/src/main/kotlin/com/lambda/util/extension/World.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import net.minecraft.block.Blocks
2828
import net.minecraft.fluid.FluidState
2929
import net.minecraft.fluid.Fluids
3030
import net.minecraft.util.math.BlockPos
31+
import net.minecraft.util.shape.VoxelShape
3132
import net.minecraft.world.World
3233
import java.awt.Color
3334

@@ -43,10 +44,10 @@ val World?.dimensionName: String
4344
else -> "Unknown"
4445
}
4546

46-
fun SafeContext.collisionShape(state: BlockState, pos: BlockPos) =
47+
fun SafeContext.collisionShape(state: BlockState, pos: BlockPos): VoxelShape =
4748
state.getCollisionShape(world, pos).offset(pos.x.toDouble(), pos.y.toDouble(), pos.z.toDouble())
4849

49-
fun SafeContext.outlineShape(state: BlockState, pos: BlockPos) =
50+
fun SafeContext.outlineShape(state: BlockState, pos: BlockPos): VoxelShape =
5051
state.getOutlineShape(world, pos).offset(pos.x.toDouble(), pos.y.toDouble(), pos.z.toDouble())
5152

5253
fun SafeContext.blockColor(state: BlockState, pos: BlockPos) =

common/src/main/kotlin/com/lambda/util/player/MovementUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ object MovementUtils {
146146
fun SafeContext.movementVector(radDir: Double = calcMoveRad(), y: Double = 0.0) =
147147
Vec3d(-sin(radDir), y, cos(radDir))
148148

149-
var Entity.motion
149+
var Entity.motion: Vec3d
150150
get() = velocity
151151
set(value) {
152152
velocity = value

0 commit comments

Comments
 (0)