Skip to content

Commit 2788e7b

Browse files
committed
Gutted and Re-wrote All of KubeVS, God Help Me
1 parent 2ee7803 commit 2788e7b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+630
-562
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,4 @@ classes/
1616
.metadata
1717
.vscode
1818
.settings
19-
*.launch
20-
/.architectury-transformer/debug.log
19+
*.launch

README.md

Lines changed: 144 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,148 @@
1-
![kubevs_logo](https://github.com/TechTastic/kubevs/assets/74630543/8787de6e-7b64-45dd-b7e9-5bbabd39e8df)
1+
![kubevs_logo](https://raw.githubusercontent.com/TechTastic/kubevs/refs/heads/1.18.x/main/forge/src/main/resources/logo.png)
22
# KubeVS
33
A KubeJS x Valkyrien Skies 2 integration addon!
44

5-
Wiki: https://github.com/TechTastic/kubevs/wiki
6-
75
Discord: https://discord.gg/CgApHqxZXX
6+
7+
---
8+
9+
### Bindings
10+
This addon was half-forced to add quite a few new bindings for VS-related classes.
11+
12+
##### Common Bindings
13+
- Ship
14+
- LoadedShip
15+
- LoadedShipCore
16+
- Vector3i
17+
- Vector3ic
18+
- Vector3d
19+
- Vector3dc
20+
- Vector3f
21+
- Vector3fc
22+
- AABBi
23+
- AABBic
24+
- AABBd
25+
- AABBdc
26+
- AABBf
27+
- AABBfc
28+
- Matrix2d
29+
- Matrix2dc
30+
- Matrix2f
31+
- Matrix2dc
32+
- Matrix3d
33+
- Matrix3dc
34+
- Matrix3f
35+
- Matrix3dc
36+
- DenseBlockPosSet
37+
- BlockType
38+
- VSGameUtilsKt
39+
- VectorConversionsKt
40+
- VectorConversionsMCKt
41+
- ShipAssemblyKt
42+
43+
##### Server Bindings
44+
- ServerShip
45+
- LoadedServerShip
46+
- ServerShipCore
47+
- ServerShipWorld
48+
- ServerShipWorldCore
49+
- BlockStateInfo
50+
- Only for `get` which returns the mass and BlockType of a given BlockState as a pair.
51+
52+
##### Client Bindings
53+
- ClientShip
54+
- ClientShipCore
55+
- ClientShipWorld
56+
- ClientShipWorldCore
57+
58+
---
59+
60+
### Attachments
61+
This addon also adds new fields to Server, Level, and Player.
62+
63+
##### Server Attachments
64+
- serverShipObjectWorld
65+
- vsPipeline
66+
67+
##### Level Attachments
68+
- shipObjectWorld
69+
- allShips
70+
- dimensionId
71+
- shipWorldNullable
72+
73+
##### ServerLevel Attachments
74+
- serverShipObjectWorld
75+
76+
##### ClientLevel Attachments
77+
- clientShipObjectWorld
78+
79+
##### Player Attachments
80+
- dimensionId
81+
- draggingInformation
82+
83+
---
84+
85+
### Startup Events
86+
#### vs.blockstate.info
87+
This event is fired upon startup and cannot be cancelled.
88+
It is used to register callbacks to be called upon resolving mass and BlockTypes for BlockStates.
89+
90+
This code sets all BlockStates to provide 0kg of mass and have the BlockType (and thus collision) of Air.
91+
```javascript
92+
onEvent('vs.blockstate.info', event => {
93+
event.mass(state => {
94+
return 0
95+
})
96+
97+
event.type(state => {
98+
return BlockType.AIR
99+
})
100+
})
101+
```
102+
103+
---
104+
105+
### Server Events
106+
#### vs.ship.load
107+
This event is fired upon a Ship being loaded and cannot be cancelled.
108+
109+
This code prints out the Slug of a Ship as the Ship is loaded.
110+
```javascript
111+
onEvent('vs.ship.load', event => {
112+
var ship = event.getShipObjectServer()
113+
console.log("Ship Name: " + ship.getSlug())
114+
})
115+
```
116+
117+
#### vs.ship.phys
118+
This event is fired upon the physics tick of a Ship and cannot be cancelled.
119+
120+
This code flings the Ship up into the air along the world's Y axis by a force of 100x the Ship's mass in Newtons.
121+
```javascript
122+
onEvent('vs.ship.phys', event => {
123+
event.physShip.applyInvariantForce(Vector3d(0.0, 100.0 * event.physShip.inertia.shipMass, 0.0))
124+
})
125+
```
126+
127+
### Client Events
128+
#### vs.ship.load
129+
This event is fired upon a Ship being loaded and cannot be cancelled.
130+
131+
This code prints out the Slug of a Ship as the Ship is loaded.
132+
```javascript
133+
onEvent('vs.ship.load', event => {
134+
var ship = event.getShipObjectClient()
135+
console.log("Ship Name: " + ship.getSlug())
136+
})
137+
```
138+
139+
#### vs.ship.render
140+
This event is fired after a Ship is rendered and cannot be cancelled.
141+
142+
```javascript
143+
onEvent('vs.ship.load', event => {
144+
var ship = event.getClientShip()
145+
146+
// TBH, theres not much I can think of putting here.
147+
})
148+
```

build.gradle

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ plugins {
1313
id "com.modrinth.minotaur" version "2.4.5" apply false
1414
}
1515

16+
// Determine the version
17+
String platform = String.valueOf(loader_platform).toLowerCase()
18+
19+
version = minecraft_version + "-" + platform + "-" + mod_version
20+
1621
architectury {
1722
minecraft = rootProject.minecraft_version
1823
}
@@ -33,6 +38,13 @@ subprojects {
3338
name = "ParchmentMC"
3439
url = "https://maven.parchmentmc.org"
3540
}
41+
maven {
42+
// saps.dev Maven (KubeJS and Rhino)
43+
url = "https://maven.saps.dev/releases"
44+
content {
45+
includeGroup "dev.latvian.mods"
46+
}
47+
}
3648
}
3749

3850
dependencies {
@@ -83,7 +95,7 @@ allprojects {
8395
apply plugin: "maven-publish"
8496

8597
archivesBaseName = rootProject.archives_base_name
86-
version = rootProject.mod_version
98+
version = rootProject.version
8799
group = rootProject.maven_group
88100

89101
repositories {
@@ -103,13 +115,6 @@ allprojects {
103115
}
104116
}
105117
}
106-
maven {
107-
// saps.dev Maven (KubeJS and Rhino)
108-
url = "https://maven.saps.dev/releases"
109-
content {
110-
includeGroup "dev.latvian.mods"
111-
}
112-
}
113118
}
114119

115120
tasks.withType(JavaCompile) {

changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
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

common/build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@ dependencies {
1111
// Do NOT use other classes from fabric loader
1212
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
1313

14+
// Architectury API
1415
modApi "dev.architectury:architectury:${rootProject.architectury_version}"
1516

17+
// Valkyrien Skies 2
1618
modApi("org.valkyrienskies:valkyrienskies-118-common:${rootProject.vs2_version}")
1719

20+
// VS Core
1821
compileOnly("org.valkyrienskies.core:api:${rootProject.vs_core_version}")
1922
compileOnly("org.valkyrienskies.core:api-game:${rootProject.vs_core_version}")
2023
compileOnly("org.valkyrienskies.core:util:${rootProject.vs_core_version}")
@@ -23,7 +26,8 @@ dependencies {
2326
api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10"
2427
api "org.jetbrains.kotlin:kotlin-reflect:1.9.10"
2528

26-
modImplementation("dev.latvian.mods:kubejs:${kubejs_version}")
29+
// KubeJS
30+
modCompileOnly("dev.latvian.mods:kubejs:${kubejs_version}")
2731
}
2832

2933
publishing {

common/src/main/java/io/github/techtastic/kubevs/KubeVSJavaIntegration.java renamed to common/src/main/java/io/github/techtastic/kubevs/bindings/KubeVSJavaBindings.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1-
package io.github.techtastic.kubevs;
1+
package io.github.techtastic.kubevs.bindings;
22

33
import dev.latvian.mods.kubejs.script.BindingsEvent;
4-
import io.github.techtastic.kubevs.util.BlockStateInfoJS;
54
import org.valkyrienskies.core.util.VectorConversionsKt;
65
import org.valkyrienskies.mod.common.VSGameUtilsKt;
6+
import org.valkyrienskies.mod.common.assembly.ShipAssemblyKt;
77
import org.valkyrienskies.mod.common.util.VectorConversionsMCKt;
88

9-
public class KubeVSJavaIntegration {
9+
public class KubeVSJavaBindings {
1010
public static void addBindings(BindingsEvent event) {
1111
event.add("VSGameUtilsKt", VSGameUtilsKt.class);
1212
event.add("VectorConversionsKt", VectorConversionsKt.class);
1313
event.add("VectorConversionsMCKt", VectorConversionsMCKt.class);
14-
15-
if (event.type.isServer())
16-
event.add("BlockStateInfo", BlockStateInfoJS.INSTANCE);
14+
event.add("ShipAssemblyKt", ShipAssemblyKt.class);
1715
}
1816
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package io.github.techtastic.kubevs
2+
3+
import io.github.techtastic.kubevs.registry.KubeVSBSIP
4+
5+
object KubeVS {
6+
const val MOD_ID = "kubevs"
7+
8+
@JvmStatic
9+
fun init() {
10+
KubeVSBSIP.register()
11+
}
12+
13+
@JvmStatic
14+
fun initClient() {}
15+
}

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

Lines changed: 0 additions & 16 deletions
This file was deleted.

common/src/main/kotlin/io/github/techtastic/kubevs/events/KubeVSBlockStateInfoEvent.kt

Lines changed: 0 additions & 8 deletions
This file was deleted.

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

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)