Started MultiLib build
This commit is contained in:
parent
a73bd23ddf
commit
643052aa89
643 changed files with 818 additions and 360 deletions
145
bclib.gradle
145
bclib.gradle
|
@ -7,12 +7,13 @@ buildscript {
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sourceCompatibility = JavaVersion.VERSION_17
|
|
||||||
targetCompatibility = JavaVersion.VERSION_17
|
|
||||||
|
|
||||||
archivesBaseName = project.archives_base_name
|
|
||||||
version = project.mod_version
|
//archivesBaseName = project.archives_base_name
|
||||||
group = project.maven_group
|
//version = project.mod_version
|
||||||
|
//group = project.maven_group
|
||||||
|
|
||||||
|
apply from: "gradle/bclib-common.gradle"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven { url "https://maven.dblsaiko.net/" }
|
maven { url "https://maven.dblsaiko.net/" }
|
||||||
|
@ -23,20 +24,102 @@ repositories {
|
||||||
maven { url 'https://maven.terraformersmc.com/releases' }
|
maven { url 'https://maven.terraformersmc.com/releases' }
|
||||||
}
|
}
|
||||||
|
|
||||||
loom {
|
allprojects {
|
||||||
accessWidenerPath = file("src/main/resources/bclib.accesswidener")
|
group = project.maven_group
|
||||||
|
apply plugin: "java-library"
|
||||||
|
apply plugin: "fabric-loom"
|
||||||
|
|
||||||
|
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}"
|
||||||
|
}
|
||||||
|
|
||||||
|
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"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
subprojects {
|
||||||
minecraft "com.mojang:minecraft:${project.minecraft_version}"
|
javadoc.enabled = false
|
||||||
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}"
|
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 {
|
processResources {
|
||||||
println "Version: ${project.mod_version}"
|
println "Version: ${project.mod_version}"
|
||||||
inputs.property "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
|
// 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
|
// 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
|
// 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");
|
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 {
|
jar {
|
||||||
from "LICENSE"
|
from "LICENSE"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
plugins {
|
plugins {
|
||||||
id 'idea'
|
id 'idea'
|
||||||
id 'eclipse'
|
id 'eclipse'
|
||||||
id 'fabric-loom' version "${loom_version}"
|
id 'fabric-loom' version "${loom_version}" apply false
|
||||||
id 'maven-publish'
|
id 'maven-publish'
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: "bclib.gradle"
|
apply from: "bclib.gradle"
|
23
core-v1/build.gradle
Normal file
23
core-v1/build.gradle
Normal 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"
|
||||||
|
}
|
2
core-v1/gradle.properties
Normal file
2
core-v1/gradle.properties
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# Dependencies
|
||||||
|
modmenu_version=4.0.0
|
|
@ -19,9 +19,9 @@ import org.betterx.bclib.recipes.AnvilRecipe;
|
||||||
import org.betterx.bclib.recipes.CraftingRecipes;
|
import org.betterx.bclib.recipes.CraftingRecipes;
|
||||||
import org.betterx.bclib.registry.BaseBlockEntities;
|
import org.betterx.bclib.registry.BaseBlockEntities;
|
||||||
import org.betterx.bclib.registry.BaseRegistry;
|
import org.betterx.bclib.registry.BaseRegistry;
|
||||||
import org.betterx.bclib.util.Logger;
|
|
||||||
import org.betterx.worlds.together.WorldsTogether;
|
import org.betterx.worlds.together.WorldsTogether;
|
||||||
import org.betterx.worlds.together.tag.v3.TagManager;
|
import org.betterx.worlds.together.tag.v3.TagManager;
|
||||||
|
import org.betterx.worlds.together.util.Logger;
|
||||||
import org.betterx.worlds.together.world.WorldConfig;
|
import org.betterx.worlds.together.world.WorldConfig;
|
||||||
|
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
@ -41,7 +41,6 @@ public class BCLib implements ModInitializer {
|
||||||
@Override
|
@Override
|
||||||
public void onInitialize() {
|
public void onInitialize() {
|
||||||
LevelGenEvents.register();
|
LevelGenEvents.register();
|
||||||
WorldsTogether.onInitialize();
|
|
||||||
BlockPredicates.ensureStaticInitialization();
|
BlockPredicates.ensureStaticInitialization();
|
||||||
BaseRegistry.register();
|
BaseRegistry.register();
|
||||||
GeneratorOptions.init();
|
GeneratorOptions.init();
|
|
@ -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.LevelFixErrorScreen.Listener;
|
||||||
import org.betterx.bclib.client.gui.screens.ProgressScreen;
|
import org.betterx.bclib.client.gui.screens.ProgressScreen;
|
||||||
import org.betterx.bclib.config.Configs;
|
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 org.betterx.worlds.together.world.WorldConfig;
|
||||||
|
|
||||||
import net.minecraft.Util;
|
import net.minecraft.Util;
|
|
@ -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.BCLibEndBiomeSource;
|
||||||
import org.betterx.bclib.api.v2.generator.config.BCLEndBiomeSourceConfig;
|
import org.betterx.bclib.api.v2.generator.config.BCLEndBiomeSourceConfig;
|
||||||
import org.betterx.bclib.api.v2.levelgen.biomes.InternalBiomeAPI;
|
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.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.world.event.WorldEvents;
|
||||||
import org.betterx.worlds.together.worldPreset.TogetherWorldPreset;
|
import org.betterx.worlds.together.worldPreset.TogetherWorldPreset;
|
||||||
|
|
||||||
import net.minecraft.core.Holder;
|
import net.minecraft.core.Holder;
|
||||||
import net.minecraft.core.RegistryAccess;
|
import net.minecraft.core.RegistryAccess;
|
||||||
import net.minecraft.resources.ResourceKey;
|
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.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.level.dimension.LevelStem;
|
import net.minecraft.world.level.dimension.LevelStem;
|
||||||
import net.minecraft.world.level.levelgen.WorldGenSettings;
|
import net.minecraft.world.level.levelgen.WorldGenSettings;
|
||||||
import net.minecraft.world.level.levelgen.presets.WorldPreset;
|
import net.minecraft.world.level.levelgen.presets.WorldPreset;
|
||||||
import net.minecraft.world.level.storage.LevelStorageSource;
|
import net.minecraft.world.level.storage.LevelStorageSource;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
@ -40,6 +46,21 @@ public class LevelGenEvents {
|
||||||
|
|
||||||
WorldEvents.PATCH_WORLD.on(LevelGenEvents::patchExistingWorld);
|
WorldEvents.PATCH_WORLD.on(LevelGenEvents::patchExistingWorld);
|
||||||
WorldEvents.ADAPT_WORLD_PRESET.on(LevelGenEvents::adaptWorldPresetSettings);
|
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();
|
setupWorld();
|
||||||
if (isNewWorld) {
|
if (isNewWorld) {
|
||||||
|
WorldConfig.saveFile(BCLib.MOD_ID);
|
||||||
DataFixerAPI.initializePatchData();
|
DataFixerAPI.initializePatchData();
|
||||||
} else {
|
} else {
|
||||||
LevelGenUtil.migrateGeneratorSettings();
|
LevelGenUtil.migrateGeneratorSettings();
|
||||||
|
@ -117,6 +139,7 @@ public class LevelGenEvents {
|
||||||
setupWorld();
|
setupWorld();
|
||||||
|
|
||||||
if (isNewWorld) {
|
if (isNewWorld) {
|
||||||
|
WorldConfig.saveFile(BCLib.MOD_ID);
|
||||||
DataFixerAPI.initializePatchData();
|
DataFixerAPI.initializePatchData();
|
||||||
} else {
|
} else {
|
||||||
LevelGenUtil.migrateGeneratorSettings();
|
LevelGenUtil.migrateGeneratorSettings();
|
|
@ -844,7 +844,7 @@ public class BCLBiomeBuilder {
|
||||||
|
|
||||||
final Biome biome = builder.build();
|
final Biome biome = builder.build();
|
||||||
final T res = biomeConstructor.apply(biomeID, biome, settings);
|
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.addBiomeTags(tags);
|
||||||
//res.setSurface(surfaceRule);
|
//res.setSurface(surfaceRule);
|
|
@ -195,11 +195,11 @@ public class BiomeAPI {
|
||||||
BiomeType.BIOME_TYPE_MAP.put(bclbiome.getID(), dim);
|
BiomeType.BIOME_TYPE_MAP.put(bclbiome.getID(), dim);
|
||||||
|
|
||||||
if (dim != null && dim.is(BiomeType.NETHER)) {
|
if (dim != null && dim.is(BiomeType.NETHER)) {
|
||||||
TagManager.BIOMES.add(BiomeTags.IS_NETHER, bclbiome);
|
TagManager.BIOMES.add(BiomeTags.IS_NETHER, bclbiome.getBiomeKey());
|
||||||
TagManager.BIOMES.add(CommonBiomeTags.IN_NETHER, bclbiome);
|
TagManager.BIOMES.add(CommonBiomeTags.IN_NETHER, bclbiome.getBiomeKey());
|
||||||
} else if (dim != null && dim.is(BiomeType.END)) {
|
} else if (dim != null && dim.is(BiomeType.END)) {
|
||||||
TagManager.BIOMES.add(BiomeTags.IS_END, bclbiome);
|
TagManager.BIOMES.add(BiomeTags.IS_END, bclbiome.getBiomeKey());
|
||||||
TagManager.BIOMES.add(CommonBiomeTags.IN_END, bclbiome);
|
TagManager.BIOMES.add(CommonBiomeTags.IN_END, bclbiome.getBiomeKey());
|
||||||
}
|
}
|
||||||
|
|
||||||
bclbiome.afterRegistration();
|
bclbiome.afterRegistration();
|
|
@ -10,6 +10,7 @@ import java.util.List;
|
||||||
/**
|
/**
|
||||||
* @deprecated Please use {@link org.betterx.bclib.api.v3.levelgen.features.config.TemplateFeatureConfig} instead
|
* @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 class TemplateFeatureConfig extends org.betterx.bclib.api.v3.levelgen.features.config.TemplateFeatureConfig {
|
||||||
|
|
||||||
public TemplateFeatureConfig(ResourceLocation location, int offsetY, StructurePlacementType type) {
|
public TemplateFeatureConfig(ResourceLocation location, int offsetY, StructurePlacementType type) {
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue