Skip to content

Commit 9574836

Browse files
committed
Updating to VS2.5
1 parent 64b2f1b commit 9574836

File tree

11 files changed

+29
-41
lines changed

11 files changed

+29
-41
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins {
33
id "architectury-plugin" version "3.4.146"
44
id "dev.architectury.loom" version "1.3.355" apply false
55
// Kotlin
6-
id "org.jetbrains.kotlin.jvm" version "1.9.10" apply false
6+
id "org.jetbrains.kotlin.jvm" version "2.1.0" apply false
77
// Kotlin linter
88
id "org.jlleitschuh.gradle.ktlint" version "10.3.0"
99
// Java linter

changelog.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
Gutted and Re-wrote All of KubeVS from scratch :)
2-
3-
## Changes
4-
- Replaced `vs.info.init` with `vs.blockstate.info` event and remade it as a Startup Event (they are different I swear)
5-
- Removed `vs.ship.game_tick`
6-
- Renamed `vs.ship.phys_tick` to `vs.ship.phys`
7-
- Added `ShipAssemblyKt` to bindings
1+
# Updating to VS2.5

common/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ dependencies {
2323
compileOnly("org.valkyrienskies.core:util:${rootProject.vs_core_version}")
2424
compileOnly("org.valkyrienskies.core:impl:${rootProject.vs_core_version}")
2525

26-
api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10"
27-
api "org.jetbrains.kotlin:kotlin-reflect:1.9.10"
26+
api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.0"
27+
api "org.jetbrains.kotlin:kotlin-reflect:2.1.0"
2828

2929
// KubeJS
3030
modCompileOnly("dev.latvian.mods:kubejs:${kubejs_version}")
Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
package io.github.techtastic.kubevs.bindings;
22

33
import dev.latvian.mods.kubejs.script.BindingsEvent;
4-
import org.valkyrienskies.core.util.VectorConversionsKt;
5-
import org.valkyrienskies.mod.common.VSGameUtilsKt;
6-
import org.valkyrienskies.mod.common.assembly.ShipAssemblyKt;
7-
import org.valkyrienskies.mod.common.util.VectorConversionsMCKt;
4+
import org.valkyrienskies.mod.api.ValkyrienSkies;
5+
import org.valkyrienskies.mod.common.assembly.ShipAssembler;
86

97
public class KubeVSJavaBindings {
108
public static void addBindings(BindingsEvent event) {
11-
event.add("VSGameUtilsKt", VSGameUtilsKt.class);
12-
event.add("VectorConversionsKt", VectorConversionsKt.class);
13-
event.add("VectorConversionsMCKt", VectorConversionsMCKt.class);
14-
event.add("ShipAssemblyKt", ShipAssemblyKt.class);
9+
event.add("ShipAssemblyKt", ShipAssembler.class);
10+
event.add("ValkyrienSkies", ValkyrienSkies.class);
1511
}
1612
}

common/src/main/kotlin/io/github/techtastic/kubevs/KubeVS.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
package io.github.techtastic.kubevs
22

33
import io.github.techtastic.kubevs.registry.KubeVSBSIP
4+
import io.github.techtastic.kubevs.ship.KubeVSShipAccess
5+
import org.valkyrienskies.mod.api.vsApi
46

57
object KubeVS {
68
const val MOD_ID = "kubevs"
79

810
@JvmStatic
911
fun init() {
1012
KubeVSBSIP.register()
13+
14+
vsApi.registerAttachment(KubeVSShipAccess::class.java)
1115
}
1216

1317
@JvmStatic

common/src/main/kotlin/io/github/techtastic/kubevs/plugin/KubeVSEvents.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ import io.github.techtastic.kubevs.registry.KubeVSBSIP
55
import io.github.techtastic.kubevs.util.BlockTypeJS
66
import net.minecraft.world.level.block.state.BlockState
77
import org.valkyrienskies.core.api.ships.ClientShip
8+
import org.valkyrienskies.core.api.ships.LoadedServerShip
89
import org.valkyrienskies.core.impl.game.ships.PhysShipImpl
9-
import org.valkyrienskies.core.impl.game.ships.ShipObjectClient
10-
import org.valkyrienskies.core.impl.game.ships.ShipObjectServer
1110
import org.valkyrienskies.core.impl.hooks.VSEvents
1211
import org.valkyrienskies.mod.common.hooks.VSGameEvents
1312
import java.util.function.Function
@@ -17,7 +16,7 @@ object KubeVSEvents {
1716
// Server Events
1817

1918

20-
class ShipLoadServerEvent(val shipObjectServer: ShipObjectServer): EventJS() {
19+
class ShipLoadServerEvent(val loadedServerShip: LoadedServerShip): EventJS() {
2120
constructor(event: VSEvents.ShipLoadEvent) : this(event.ship)
2221

2322
override fun canCancel() = false
@@ -32,7 +31,7 @@ object KubeVSEvents {
3231
// Client Events
3332

3433

35-
class ShipLoadClientEvent(val shipObjectClient: ShipObjectClient): EventJS() {
34+
class ShipLoadClientEvent(val clientShip: ClientShip): EventJS() {
3635
constructor(event: VSEvents.ShipLoadEventClient) : this(event.ship)
3736

3837
override fun canCancel() = false

common/src/main/kotlin/io/github/techtastic/kubevs/plugin/KubeVSPlugin.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import net.minecraft.server.level.ServerLevel
2323
import net.minecraft.world.entity.player.Player
2424
import org.joml.*
2525
import org.joml.primitives.*
26+
import org.valkyrienskies.core.api.VsCoreApi
2627
import org.valkyrienskies.core.api.ships.*
2728
import org.valkyrienskies.core.api.world.ClientShipWorld
2829
import org.valkyrienskies.core.api.world.ServerShipWorld
@@ -35,7 +36,10 @@ import org.valkyrienskies.core.apigame.world.ServerShipWorldCore
3536
import org.valkyrienskies.core.apigame.world.chunks.BlockType
3637
import org.valkyrienskies.core.impl.hooks.VSEvents
3738
import org.valkyrienskies.core.util.datastructures.DenseBlockPosSet
39+
import org.valkyrienskies.mod.api.vsApi
40+
import org.valkyrienskies.mod.api_impl.events.VsApiImpl
3841
import org.valkyrienskies.mod.common.*
42+
import org.valkyrienskies.mod.common.assembly.createNewShipWithBlocks
3943
import org.valkyrienskies.mod.common.hooks.VSGameEvents
4044
import org.valkyrienskies.mod.common.util.IEntityDraggingInformationProvider
4145

@@ -129,6 +133,7 @@ class KubeVSPlugin: KubeJSPlugin() {
129133
filter.deny(BlockStateInfoProvider::class.java)
130134
filter.deny(BlockStateInfo::class.java)
131135
filter.deny(KubeVSBSIP::class.java)
136+
filter.deny(VsCoreApi::class.java)
132137

133138
if (type.isServer)
134139
filter.allow("org.valkyrienskies.mod.common.BlockStateInfo.INSTANCE.get")

common/src/main/kotlin/io/github/techtastic/kubevs/registry/KubeVSBSIP.kt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,11 @@ import net.minecraft.world.level.block.state.BlockState
77
import org.valkyrienskies.core.apigame.world.chunks.BlockType
88
import org.valkyrienskies.mod.common.BlockStateInfo
99
import org.valkyrienskies.mod.common.BlockStateInfoProvider
10-
import org.valkyrienskies.physics_api.Lod1BlockStateId
11-
import org.valkyrienskies.physics_api.Lod1LiquidBlockStateId
12-
import org.valkyrienskies.physics_api.Lod1SolidBlockStateId
13-
import org.valkyrienskies.physics_api.voxel.Lod1LiquidBlockState
14-
import org.valkyrienskies.physics_api.voxel.Lod1SolidBlockState
1510
import java.util.function.Function
1611

1712
object KubeVSBSIP : BlockStateInfoProvider {
18-
override val blockStateData: List<Triple<Lod1SolidBlockStateId, Lod1LiquidBlockStateId, Lod1BlockStateId>>
19-
get() = listOf()
20-
override val liquidBlockStates: List<Lod1LiquidBlockState>
21-
get() = listOf()
2213
override val priority: Int
2314
get() = 300
24-
override val solidBlockStates: List<Lod1SolidBlockState>
25-
get() = listOf()
2615

2716
lateinit var MASS_CALLBACK: Function<BlockState, Double?>
2817
lateinit var TYPE_CALLBACK: Function<BlockState, BlockTypeJS?>

common/src/main/kotlin/io/github/techtastic/kubevs/ship/KubeVSShipAccess.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package io.github.techtastic.kubevs.ship
22

33
import dev.latvian.mods.kubejs.script.ScriptType
44
import io.github.techtastic.kubevs.plugin.KubeVSEvents
5+
import org.valkyrienskies.core.api.attachment.getOrPutAttachment
56
import org.valkyrienskies.core.api.ships.*
67
import org.valkyrienskies.core.impl.game.ships.PhysShipImpl
78

@@ -12,9 +13,9 @@ class KubeVSShipAccess: ShipForcesInducer {
1213

1314
companion object {
1415
fun getOrCreateAccess(ship: LoadedServerShip): KubeVSShipAccess {
15-
return ship.getAttachment<KubeVSShipAccess>() ?: run {
16+
return ship.getOrPutAttachment<KubeVSShipAccess> {
1617
val access = KubeVSShipAccess()
17-
ship.saveAttachment<KubeVSShipAccess>(access)
18+
ship.setAttachment(access)
1819
access
1920
}
2021
}

gradle-scripts/publish-curseforge.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ curseforge {
44
apiKey = project.curse_api_key
55
project {
66
id = project.curse_project_id
7-
releaseType = 'release'
7+
releaseType = 'alpha'
88
changelogType = 'markdown'
99
changelog = rootProject.file("changelog.md").text
1010
addGameVersion project.minecraft_version
@@ -31,7 +31,7 @@ curseforge {
3131
modrinth {
3232
token = project.modrinth_api_key
3333
projectId = project.modrinth_project_id
34-
versionType = "release"
34+
versionType = "alpha"
3535
versionName = 'KubeVS ' + project.minecraft_version + '-' + project.loader_platform.toLowerCase() + '-' + project.mod_version
3636
versionNumber = project.mod_version
3737
uploadFile = remapJar.archiveFile.get().asFile

0 commit comments

Comments
 (0)