mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-09-04 19:37:55 +00:00
Move datagen to its own source set
MC 1.21.4 means we have to move more data generation code into the client source set. Given all this code movement, it probably makes sense to put data generation in a separate source set instead. 1.21.4 also has split data generators for client and server, but neither mod loader recommends this. This means we can/should merge DataProviders and ClientDataProviders into a single class. Data generators are no longer bundled with the jar, which does reduce file size, but by a tiny amount (~70KiB).
This commit is contained in:
@@ -8,7 +8,7 @@ import java.util.*
|
||||
|
||||
plugins {
|
||||
id("cc-tweaked.fabric")
|
||||
id("cc-tweaked.gametest")
|
||||
id("cc-tweaked.mod")
|
||||
id("cc-tweaked.mod-publishing")
|
||||
}
|
||||
|
||||
@@ -146,6 +146,8 @@ loom {
|
||||
configName = "Datagen"
|
||||
client()
|
||||
|
||||
source(sourceSets.datagen.get())
|
||||
|
||||
runDir("run/dataGen")
|
||||
property("fabric-api.datagen")
|
||||
property("fabric-api.datagen.output-dir", layout.buildDirectory.dir("generatedResources").getAbsolutePath())
|
||||
|
@@ -26,7 +26,7 @@ import java.util.concurrent.CompletableFuture;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class FabricDataGenerators implements DataGeneratorEntrypoint {
|
||||
public class FabricDataProviders implements DataGeneratorEntrypoint {
|
||||
@Override
|
||||
public void onInitializeDataGenerator(FabricDataGenerator generator) {
|
||||
var pack = new PlatformGeneratorsImpl(generator.createPack());
|
13
projects/fabric/src/datagen/resources/fabric.mod.json
Normal file
13
projects/fabric/src/datagen/resources/fabric.mod.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"id": "cc-datagen",
|
||||
"version": "1.0.0",
|
||||
"entrypoints": {
|
||||
"fabric-datagen": [
|
||||
"dan200.computercraft.data.FabricDataProviders"
|
||||
]
|
||||
},
|
||||
"depends": {
|
||||
"computercraft": "*"
|
||||
}
|
||||
}
|
@@ -23,9 +23,6 @@
|
||||
"client": [
|
||||
"dan200.computercraft.client.ComputerCraftClient::init"
|
||||
],
|
||||
"fabric-datagen": [
|
||||
"dan200.computercraft.data.FabricDataGenerators"
|
||||
],
|
||||
"jei_mod_plugin": [
|
||||
"dan200.computercraft.client.integration.jei.JEIComputerCraft"
|
||||
],
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"id": "cctest",
|
||||
"id": "cc-datagen",
|
||||
"version": "1.0.0",
|
||||
"entrypoints": {
|
||||
"main": [
|
||||
|
Reference in New Issue
Block a user