Started MultiLib build

This commit is contained in:
Frank 2022-07-05 16:31:01 +02:00
parent a73bd23ddf
commit 643052aa89
643 changed files with 818 additions and 360 deletions

View file

@ -7,12 +7,13 @@ buildscript {
gradlePluginPortal()
}
}
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group
//archivesBaseName = project.archives_base_name
//version = project.mod_version
//group = project.maven_group
apply from: "gradle/bclib-common.gradle"
repositories {
maven { url "https://maven.dblsaiko.net/" }
@ -23,20 +24,102 @@ repositories {
maven { url 'https://maven.terraformersmc.com/releases' }
}
loom {
accessWidenerPath = file("src/main/resources/bclib.accesswidener")
}
allprojects {
group = project.maven_group
apply plugin: "java-library"
apply plugin: "fabric-loom"
dependencies {
tasks.withType(GenerateModuleMetadata) {
enabled = false
}
tasks.withType(JavaCompile).configureEach {
it.options.release = 17
}
java {
// Must be added before the split source sets are setup.
withSourcesJar()
}
allprojects.each { p ->
loom.mods.register(p.name) {
sourceSet p.sourceSets.main
}
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings loom.officialMojangMappings()
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modCompileOnly "com.terraformersmc:modmenu:${project.modmenu_version}"
}
//useApi "vazkii.patchouli:Patchouli:1.16.4-${project.patchouli_version}"
loom {
// shareRemapCaches = true
}
tasks.withType(ProcessResources).configureEach {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
tasks.withType(AbstractArchiveTask) {
preserveFileTimestamps = false
reproducibleFileOrder = true
}
jar {
from "../LICENSE"
}
}
subprojects {
javadoc.enabled = false
afterEvaluate {
// Disable the gen sources task on sub projects
// genCommonSourcesWithCfr.enabled = false
// genCommonSourcesWithFernFlower.enabled = false
// unpickCommonJar.enabled = false
}
}
javadoc {
options {
source = "17"
encoding = "UTF-8"
charSet = "UTF-8"
memberLevel = JavadocMemberLevel.PACKAGE
// Disable the crazy super-strict doclint tool in Java 8
addStringOption("Xdoclint:none", "-quiet")
}
allprojects.each {
if (it.name == "deprecated") return
source(it.sourceSets.main.allJava.srcDirs)
}
classpath = files(sourceSets.main.compileClasspath)
include("**")
failOnError false
}
task javadocJar(type: Jar) {
dependsOn javadoc
from javadoc.destinationDir
//Set as `fatjavadoc` to prevent an ide form trying to use this javadoc, over using the modules javadoc
archiveClassifier = "fatjavadoc"
}
build.dependsOn javadocJar
loom {}
processResources {
println "Version: ${project.mod_version}"
inputs.property "version", project.mod_version
@ -46,6 +129,27 @@ processResources {
}
}
subprojects.each {
remapJar.dependsOn("${it.path}:remapJar")
}
dependencies {
afterEvaluate {
subprojects.each {
api project(path: "${it.path}", configuration: "namedElements")
}
}
}
remapJar {
afterEvaluate {
subprojects.each {
nestedJars.from project("${it.path}").tasks.getByName("remapJar")
}
}
}
// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
@ -59,19 +163,6 @@ javadoc {
options.stylesheetFile = new File(projectDir, "javadoc.css");
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this task, sources will not be generated.
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
jar {
from "LICENSE"
}

View file

@ -1,7 +1,7 @@
plugins {
id 'idea'
id 'eclipse'
id 'fabric-loom' version "${loom_version}"
id 'fabric-loom' version "${loom_version}" apply false
id 'maven-publish'
}

23
core-v1/build.gradle Normal file
View file

@ -0,0 +1,23 @@
archivesBaseName = "core-v1"
version = getSubprojectVersion(project)
loom {
accessWidenerPath = file("src/main/resources/bclib.accesswidener")
}
moduleDependencies(project, ["together-v1"])
//compileOnlyDependencies(project, [
// "com.terraformersmc:modmenu:${project.modmenu_version}"
//])
repositories {
maven { url 'https://maven.terraformersmc.com/releases' }
}
dependencies {
modCompileOnly "com.terraformersmc:modmenu:${project.modmenu_version}"
}
jar {
from "../LICENSE"
}

View file

@ -0,0 +1,2 @@
# Dependencies
modmenu_version=4.0.0

View file

@ -19,9 +19,9 @@ import org.betterx.bclib.recipes.AnvilRecipe;
import org.betterx.bclib.recipes.CraftingRecipes;
import org.betterx.bclib.registry.BaseBlockEntities;
import org.betterx.bclib.registry.BaseRegistry;
import org.betterx.bclib.util.Logger;
import org.betterx.worlds.together.WorldsTogether;
import org.betterx.worlds.together.tag.v3.TagManager;
import org.betterx.worlds.together.util.Logger;
import org.betterx.worlds.together.world.WorldConfig;
import net.minecraft.resources.ResourceLocation;
@ -41,7 +41,6 @@ public class BCLib implements ModInitializer {
@Override
public void onInitialize() {
LevelGenEvents.register();
WorldsTogether.onInitialize();
BlockPredicates.ensureStaticInitialization();
BaseRegistry.register();
GeneratorOptions.init();

View file

@ -7,7 +7,7 @@ import org.betterx.bclib.client.gui.screens.LevelFixErrorScreen;
import org.betterx.bclib.client.gui.screens.LevelFixErrorScreen.Listener;
import org.betterx.bclib.client.gui.screens.ProgressScreen;
import org.betterx.bclib.config.Configs;
import org.betterx.bclib.util.Logger;
import org.betterx.worlds.together.util.Logger;
import org.betterx.worlds.together.world.WorldConfig;
import net.minecraft.Util;

View file

@ -7,19 +7,25 @@ import org.betterx.bclib.api.v2.datafixer.DataFixerAPI;
import org.betterx.bclib.api.v2.generator.BCLibEndBiomeSource;
import org.betterx.bclib.api.v2.generator.config.BCLEndBiomeSourceConfig;
import org.betterx.bclib.api.v2.levelgen.biomes.InternalBiomeAPI;
import org.betterx.bclib.api.v2.tag.TagAPI;
import org.betterx.bclib.registry.PresetsRegistry;
import org.betterx.worlds.together.tag.v3.TagManager;
import org.betterx.worlds.together.world.WorldConfig;
import org.betterx.worlds.together.world.event.WorldEvents;
import org.betterx.worlds.together.worldPreset.TogetherWorldPreset;
import net.minecraft.core.Holder;
import net.minecraft.core.RegistryAccess;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.TagLoader;
import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.dimension.LevelStem;
import net.minecraft.world.level.levelgen.WorldGenSettings;
import net.minecraft.world.level.levelgen.presets.WorldPreset;
import net.minecraft.world.level.storage.LevelStorageSource;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Consumer;
@ -40,6 +46,21 @@ public class LevelGenEvents {
WorldEvents.PATCH_WORLD.on(LevelGenEvents::patchExistingWorld);
WorldEvents.ADAPT_WORLD_PRESET.on(LevelGenEvents::adaptWorldPresetSettings);
WorldEvents.BEFORE_ADDING_TAGS.on(LevelGenEvents::appplyTags);
}
private static void appplyTags(
String directory,
Map<ResourceLocation, List<TagLoader.EntryWithSource>> tagsMap
) {
//make sure we include Tags registered by the deprecated API
TagAPI.apply(directory, tagsMap);
if (directory.equals(TagManager.BIOMES.directory)) {
InternalBiomeAPI._runBiomeTagAdders();
}
}
@ -103,6 +124,7 @@ public class LevelGenEvents {
) {
setupWorld();
if (isNewWorld) {
WorldConfig.saveFile(BCLib.MOD_ID);
DataFixerAPI.initializePatchData();
} else {
LevelGenUtil.migrateGeneratorSettings();
@ -117,6 +139,7 @@ public class LevelGenEvents {
setupWorld();
if (isNewWorld) {
WorldConfig.saveFile(BCLib.MOD_ID);
DataFixerAPI.initializePatchData();
} else {
LevelGenUtil.migrateGeneratorSettings();

View file

@ -844,7 +844,7 @@ public class BCLBiomeBuilder {
final Biome biome = builder.build();
final T res = biomeConstructor.apply(biomeID, biome, settings);
tags.forEach(tagKey -> TagManager.BIOMES.add(tagKey, res));
tags.forEach(tagKey -> TagManager.BIOMES.add(tagKey, res.getBiomeKey()));
//res.addBiomeTags(tags);
//res.setSurface(surfaceRule);

View file

@ -195,11 +195,11 @@ public class BiomeAPI {
BiomeType.BIOME_TYPE_MAP.put(bclbiome.getID(), dim);
if (dim != null && dim.is(BiomeType.NETHER)) {
TagManager.BIOMES.add(BiomeTags.IS_NETHER, bclbiome);
TagManager.BIOMES.add(CommonBiomeTags.IN_NETHER, bclbiome);
TagManager.BIOMES.add(BiomeTags.IS_NETHER, bclbiome.getBiomeKey());
TagManager.BIOMES.add(CommonBiomeTags.IN_NETHER, bclbiome.getBiomeKey());
} else if (dim != null && dim.is(BiomeType.END)) {
TagManager.BIOMES.add(BiomeTags.IS_END, bclbiome);
TagManager.BIOMES.add(CommonBiomeTags.IN_END, bclbiome);
TagManager.BIOMES.add(BiomeTags.IS_END, bclbiome.getBiomeKey());
TagManager.BIOMES.add(CommonBiomeTags.IN_END, bclbiome.getBiomeKey());
}
bclbiome.afterRegistration();

View file

@ -10,6 +10,7 @@ import java.util.List;
/**
* @deprecated Please use {@link org.betterx.bclib.api.v3.levelgen.features.config.TemplateFeatureConfig} instead
*/
@Deprecated(forRemoval = true)
public class TemplateFeatureConfig extends org.betterx.bclib.api.v3.levelgen.features.config.TemplateFeatureConfig {
public TemplateFeatureConfig(ResourceLocation location, int offsetY, StructurePlacementType type) {

Some files were not shown because too many files have changed in this diff Show more