Skip to content

Commit a21cc10

Browse files
committed
switch to vtil
1 parent b49fdba commit a21cc10

File tree

21 files changed

+119
-562
lines changed

21 files changed

+119
-562
lines changed

buildSrc/src/main/groovy/multiloader-common.gradle

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,21 @@ repositories {
3838
}
3939
}
4040

41+
exclusiveContent {
42+
forRepository {
43+
mavenLocal()
44+
}
45+
forRepository {
46+
maven {
47+
name = 'LiterMC maven'
48+
url = 'https://litermc.github.io/maven/'
49+
}
50+
}
51+
filter {
52+
includeGroupAndSubgroups('com.github.litermc')
53+
}
54+
}
55+
4156
exclusiveContent {
4257
forRepository {
4358
maven {
@@ -280,23 +295,24 @@ jar {
280295

281296
processResources {
282297
var expandProps = [
283-
'version' : version,
284-
'group' : project.group, // Else we target the task's group.
285-
'java_version' : java_version,
286-
287-
'minecraft_version' : minecraft_version,
288-
'minecraft_version_range' : minecraft_version_range,
289-
'fabric_loader_version' : fabric_loader_version,
290-
'forge_version' : forge_version,
291-
'forge_loader_version_range' : forge_loader_version_range,
292-
293-
'mod_name' : mod_name,
294-
'mod_author' : mod_author,
295-
'mod_id' : mod_id,
296-
'license' : license,
297-
'credits' : credits,
298-
'description' : project.description,
299-
'github_repo' : github_repo,
298+
'version' : version,
299+
'group' : project.group, // Else we target the task's group.
300+
'java_version' : java_version,
301+
302+
'minecraft_version' : minecraft_version,
303+
'fabric_loader_version' : fabric_loader_version,
304+
'forge_version' : forge_version,
305+
'forge_loader_version_range' : forge_loader_version_range,
306+
307+
'mod_name' : mod_name,
308+
'mod_author' : mod_author,
309+
'mod_id' : mod_id,
310+
'license' : license,
311+
'credits' : credits,
312+
'description' : project.description,
313+
'github_repo' : github_repo,
314+
315+
'vtil_version' : vtil_version,
300316
]
301317

302318
var jsonExpandProps = expandProps.collectEntries {

common/build.gradle

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,15 @@ dependencies {
2424
implementation "com.google.auto.service:auto-service:1.1.1"
2525
annotationProcessor "com.google.auto.service:auto-service:1.1.1"
2626

27-
// Architectury API
28-
// NOTE: This is only for the platform-independent API stuff.
29-
// This WILL make your Forge jar depend on Architectury API
30-
// This is OPTIONAL. You can still use architectury, just without this API.
31-
// (You'll just have to do more loader-specific stuff)
32-
modApi "dev.architectury:architectury:${architectury_version}"
33-
3427
modApi "org.valkyrienskies:valkyrienskies-120-common:${vs2_version}"
3528

3629
implementation "org.valkyrienskies.core:api:${vs_core_version}"
3730
implementation "org.valkyrienskies.core:api-game:${vs_core_version}"
3831
implementation "org.valkyrienskies.core:util:${vs_core_version}"
3932
implementation "org.valkyrienskies.core:impl:${vs_core_version}"
33+
modImplementation "com.github.litermc.vtil:vtil-common-${minecraft_version}:${vtil_version}"
4034

4135
compileOnly "cc.tweaked:cc-tweaked-${minecraft_version}-common:${cct_version}"
42-
43-
modCompileOnly "com.simibubi.create:create-fabric-${minecraft_version}:${create_fabric_version}"
4436
}
4537

4638
configurations {

common/src/main/java/com/github/litermc/vschunkloader/VSCListeners.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import com.github.litermc.vschunkloader.util.ChunkLoaderManager;
66
import com.github.litermc.vschunkloader.util.ChunkSensor;
77
import com.github.litermc.vschunkloader.util.TaskUtil;
8-
import com.github.litermc.vschunkloader.util.Utils;
8+
import com.github.litermc.vtil.util.LevelUtil;
99

1010
import net.minecraft.core.BlockPos;
1111
import net.minecraft.server.MinecraftServer;
@@ -22,12 +22,10 @@ public final class VSCListeners {
2222
private VSCListeners() {}
2323

2424
public static void onServerLevelLoad(final ServerLevel level) {
25-
Utils.onServerLevelLoad(level);
2625
ChunkLoaderManager.get(level);
2726
}
2827

2928
public static void onServerLevelUnload(final ServerLevel level) {
30-
Utils.onServerLevelUnload(level);
3129
}
3230

3331
public static void preServerTick(final MinecraftServer server) {
@@ -42,7 +40,7 @@ public static void preServerTick(final MinecraftServer server) {
4240
} else if (!VSCApi.isForceLoaded(server, ship.getId())) {
4341
continue;
4442
}
45-
final ServerLevel level = Utils.getLevel(ship.getChunkClaimDimension());
43+
final ServerLevel level = LevelUtil.getLevel(ship.getChunkClaimDimension());
4644
if (level == null) {
4745
continue;
4846
}

common/src/main/java/com/github/litermc/vschunkloader/attachment/AmmoShipAttachment.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
import com.github.litermc.vschunkloader.VSCApi;
55
import com.github.litermc.vschunkloader.config.Config;
66
import com.github.litermc.vschunkloader.platform.PlatformHelper;
7-
import com.github.litermc.vschunkloader.util.ShipAllocator;
87
import com.github.litermc.vschunkloader.util.TaskUtil;
9-
import com.github.litermc.vschunkloader.util.Utils;
8+
import com.github.litermc.vtil.api.assemble.ShipAllocator;
9+
import com.github.litermc.vtil.util.LevelUtil;
1010

1111
import net.minecraft.resources.ResourceLocation;
1212
import net.minecraft.server.MinecraftServer;
@@ -128,11 +128,11 @@ private void deactivate() {
128128
if (ship == null) {
129129
return;
130130
}
131-
final ServerLevel level = Utils.getLevel(ship.getChunkClaimDimension());
131+
final ServerLevel level = LevelUtil.getLevel(ship.getChunkClaimDimension());
132132
if (level == null) {
133133
this.world.deleteShip(ship);
134134
return;
135135
}
136-
TaskUtil.queueTickStart(() -> ShipAllocator.get(level).putShip(ship));
136+
TaskUtil.queueTickStart(() -> ShipAllocator.get(level.getServer()).putShip(ship));
137137
}
138138
}

common/src/main/java/com/github/litermc/vschunkloader/attachment/ChunkSensorAttachment.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import com.github.litermc.vschunkloader.util.ChunkLoaderManager;
77
import com.github.litermc.vschunkloader.util.ChunkSensor;
88
import com.github.litermc.vschunkloader.util.TaskUtil;
9-
import com.github.litermc.vschunkloader.util.Utils;
9+
import com.github.litermc.vtil.util.LevelUtil;
1010

1111
import net.minecraft.core.SectionPos;
1212
import net.minecraft.server.level.ServerLevel;
@@ -111,7 +111,7 @@ public void serverTick(final LoadedServerShip ship) {
111111
if (shipBox == null) {
112112
return;
113113
}
114-
final ServerLevel level = Utils.getLevel(ship.getChunkClaimDimension());
114+
final ServerLevel level = LevelUtil.getLevel(ship.getChunkClaimDimension());
115115
if (level == null) {
116116
return;
117117
}
@@ -158,7 +158,7 @@ public void applyForces(final PhysShip phyShip) {
158158
if (shipBox == null) {
159159
return;
160160
}
161-
final ServerLevel level = Utils.getLevel(ship.getChunkClaimDimension());
161+
final ServerLevel level = LevelUtil.getLevel(ship.getChunkClaimDimension());
162162
if (level == null) {
163163
return;
164164
}

0 commit comments

Comments
 (0)