diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..2241979c --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,26 @@ +## Description + + +## Changes +- **Change 1**: Description of what was changed. +- **Change 2**: Description of what was changed. + +## How has this been tested? + + +## Screenshots (if applicable) + + +## Type of Change +- [ ] Bug fix +- [ ] New feature +- [ ] Documentation update + +## Checklist +- [ ] My code follows the style guidelines of this project. [Contributing](https://github.com/MeAlam1/BlueLib/blob/1.21/CONTRIBUTING.md) +- [ ] I have performed a self-review of my own code. +- [ ] I have commented my code following the guidelines. [Contributing](https://github.com/MeAlam1/BlueLib/blob/1.21/CONTRIBUTING.md) +- [ ] My changes generate no new warnings. + +## Related Issues + \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 15e2ea33..25910c9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,10 +3,10 @@ name: CI for Minecraft Mod on: pull_request: branches: - - 1.20.4 + - 1.16 push: branches: - - 1.20.4 + - 1.16 jobs: build: @@ -34,18 +34,8 @@ jobs: - name: Grant execute permission for Gradle wrappers run: | - chmod +x NeoForge/gradlew chmod +x Forge/gradlew - - name: Build for NeoForge - run: cd NeoForge && ./gradlew build - - name: Build for Forge run: cd Forge && ./gradlew build - - name: Run Additional Tasks for NeoForge - run: cd NeoForge && ./gradlew jar - - - name: Run Additional Tasks for Forge - run: cd Forge && ./gradlew jar - diff --git a/Forge/build.gradle b/Forge/build.gradle index 141dc086..a91c80d4 100644 --- a/Forge/build.gradle +++ b/Forge/build.gradle @@ -1,15 +1,25 @@ -plugins { - id 'eclipse' - id 'idea' - id 'maven-publish' - id 'net.minecraftforge.gradle' version '[6.0.16,6.2)' - id 'org.spongepowered.mixin' version '0.7.+' +buildscript { + repositories { + maven { url = 'https://maven.minecraftforge.net' } + mavenCentral() + } + dependencies { + classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true + } } +apply plugin: 'net.minecraftforge.gradle' +apply plugin: 'eclipse' +apply plugin: 'maven-publish' version = mod_version group = mod_group_id +archivesBaseName = mod_id repositories { + mavenCentral() + maven { + url "https://cursemaven.com" + } maven { name = 'GeckoLib' url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/' @@ -18,10 +28,6 @@ repositories { includeGroup("com.eliotlash.mclib") } } - maven { - url "https://cursemaven.com" - } - mavenCentral() mavenLocal() } @@ -35,19 +41,19 @@ println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty ' minecraft { mappings channel: mapping_channel, version: mapping_version - copyIdeResources = true - runs { - configureEach { + client { workingDirectory project.file('run') property 'forge.logging.markers', 'REGISTRIES' property 'forge.logging.console.level', 'debug' - } - client { - property 'forge.enabledGameTestNamespaces', mod_id + mods { + bluelib { + source sourceSets.main + } + } mods { geckolib { source sourceSets.main @@ -56,18 +62,37 @@ minecraft { } server { - property 'forge.enabledGameTestNamespaces', mod_id - args '--nogui' - } + workingDirectory project.file('run') + + property 'forge.logging.markers', 'REGISTRIES' + + property 'forge.logging.console.level', 'debug' - gameTestServer { - property 'forge.enabledGameTestNamespaces', mod_id + mods { + bluelib { + source sourceSets.main + } + } + mods { + geckolib { + source sourceSets.main + } + } } data { - workingDirectory project.file('run-data') + workingDirectory project.file('run') + + property 'forge.logging.markers', 'REGISTRIES' + + property 'forge.logging.console.level', 'debug' + args '--mod', 'bluelib', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') - args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') + mods { + examplemod { + source sourceSets.main + } + } } } } @@ -78,32 +103,11 @@ dependencies { minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" //compileOnly fg.deobf("software.bernie.geckolib:geckolib-forge-${geckolib_version}") //runtimeOnly fg.deobf("software.bernie.geckolib:geckolib-forge-${geckolib_version}") - runtimeOnly "curse.maven:geckolib-388172:${geckolib_file}" - compileOnly "curse.maven:geckolib-388172:${geckolib_file}" + runtimeOnly fg.deobf("curse.maven:geckolib-388172:${geckolib_file}") + compileOnly fg.deobf("curse.maven:geckolib-388172:${geckolib_file}") } -tasks.named('processResources', ProcessResources).configure { - def replaceProperties = [ - minecraft_version: minecraft_version, - minecraft_version_range: minecraft_version_range, - forge_version: forge_version, - forge_version_range: forge_version_range, - loader_version_range: loader_version_range, - mod_id: mod_id, - mod_name: mod_name, - mod_license: mod_license, - mod_version: mod_version, - mod_authors: mod_authors, - mod_description: mod_description, - ] - inputs.properties replaceProperties - - filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) { - expand replaceProperties + [project: project] - } -} - -tasks.named('jar', Jar).configure { +jar { manifest { attributes([ 'Specification-Title' : mod_id, @@ -111,27 +115,23 @@ tasks.named('jar', Jar).configure { 'Specification-Version' : mod_version, 'Implementation-Title' : project.name, 'Implementation-Version' : project.jar.archiveVersion, - 'Implementation-Vendor' : mod_authors + 'Implementation-Vendor' : mod_authors, + "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") ]) } - - finalizedBy 'reobfJar' } -tasks.withType(JavaCompile).configureEach { - options.encoding = 'UTF-8' -} - -eclipse { - synchronizationTasks 'genEclipseRuns' -} +publish.dependsOn('reobfJar') -sourceSets.main.resources { - srcDir 'src/generated/resources' -} - -/*sourceSets.each { - def dir = layout.buildDirectory.dir("sourcesSets/$it.name") - it.output.resourcesDir = dir - it.java.destinationDirectory = dir -}*/ +publishing { + publications { + mavenJava(MavenPublication) { + artifact jar + } + } + repositories { + maven { + url "file:///${project.projectDir}/mcmodsrepo" + } + } +} \ No newline at end of file diff --git a/Forge/gradle/wrapper/gradle-wrapper.jar b/Forge/gradle/wrapper/gradle-wrapper.jar index c1962a79..e708b1c0 100644 Binary files a/Forge/gradle/wrapper/gradle-wrapper.jar and b/Forge/gradle/wrapper/gradle-wrapper.jar differ diff --git a/Forge/gradle/wrapper/gradle-wrapper.properties b/Forge/gradle/wrapper/gradle-wrapper.properties index 54f3c9ac..2e6e5897 100644 --- a/Forge/gradle/wrapper/gradle-wrapper.properties +++ b/Forge/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Tue Sep 03 15:47:51 SAST 2024 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/Forge/settings.gradle b/Forge/settings.gradle index ba32d060..c0c3e501 100644 --- a/Forge/settings.gradle +++ b/Forge/settings.gradle @@ -1,19 +1,5 @@ -pluginManagement { - repositories { - gradlePluginPortal() - maven { - name = 'MinecraftForge' - url = 'https://maven.minecraftforge.net/' - } - } -} - buildscript { repositories { maven { url = 'https://repo.spongepowered.org/repository/maven-public/' } } -} - -plugins { - id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0' } \ No newline at end of file diff --git a/Forge/src/main/java/software/bluelib/BlueLib.java b/Forge/src/main/java/software/bluelib/BlueLib.java index a90941ed..22190fd8 100644 --- a/Forge/src/main/java/software/bluelib/BlueLib.java +++ b/Forge/src/main/java/software/bluelib/BlueLib.java @@ -11,6 +11,7 @@ import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.minecraftforge.fml.loading.FMLEnvironment; +import software.bernie.geckolib3.GeckoLib; import software.bluelib.example.event.ReloadHandler; import software.bluelib.example.init.ModEntities; import software.bluelib.example.proxy.ClientProxy; @@ -79,19 +80,18 @@ public BlueLib() if (isDeveloperMode()) { ModEntities.register(modEventBus); + GeckoLib.initialize(); MinecraftForge.EVENT_BUS.register(ReloadHandler.class); modEventBus.addListener(this::setupComplete); modEventBus.addListener(this::setupClient); } } - private void setupClient(final FMLClientSetupEvent event) { - event.enqueueWork(() -> { - PROXY.clientInit(); - }); + private void setupClient(final FMLClientSetupEvent pEvent) { + PROXY.clientInit(); } - private void setupComplete(final FMLLoadCompleteEvent event) { + private void setupComplete(final FMLLoadCompleteEvent pEvent) { PROXY.postInit(); } @@ -111,6 +111,7 @@ public void onLoadComplete(FMLLoadCompleteEvent pEvent) { if (isDeveloperMode()) { scheduler.schedule(() -> { System.out.println( + "\n" + "**************************************************\n" + "* *\n" + "* Thank you for using BlueLib! *\n" + @@ -120,7 +121,7 @@ public void onLoadComplete(FMLLoadCompleteEvent pEvent) { ); scheduler.shutdown(); - }, 3, TimeUnit.SECONDS); + }, 5, TimeUnit.SECONDS); } } diff --git a/Forge/src/main/java/software/bluelib/entity/variant/VariantLoader.java b/Forge/src/main/java/software/bluelib/entity/variant/VariantLoader.java index 01be1ee2..7e84881e 100644 --- a/Forge/src/main/java/software/bluelib/entity/variant/VariantLoader.java +++ b/Forge/src/main/java/software/bluelib/entity/variant/VariantLoader.java @@ -67,7 +67,7 @@ public class VariantLoader implements IVariantEntityBase { */ public static void loadVariants(ResourceLocation pJSONLocationMod, ResourceLocation pJSONLocationData, MinecraftServer pServer, String pEntityName) { clearVariantsForEntity(pEntityName); - IResourceManager resourceManager = pServer.getResourceManager(); + IResourceManager resourceManager = pServer.getDataPackRegistries().getResourceManager(); JsonObject mergedJsonObject = new JsonObject(); JsonObject modJson = jsonLoader.loadJson(pJSONLocationMod, resourceManager); diff --git a/Forge/src/main/java/software/bluelib/example/entity/dragon/DragonEntity.java b/Forge/src/main/java/software/bluelib/example/entity/dragon/DragonEntity.java index a7be228d..20fe9fc0 100644 --- a/Forge/src/main/java/software/bluelib/example/entity/dragon/DragonEntity.java +++ b/Forge/src/main/java/software/bluelib/example/entity/dragon/DragonEntity.java @@ -207,12 +207,12 @@ public static AttributeModifierMap.MutableAttribute createAttributes() { @Nullable @Override - public AgeableEntity getBreedOffspring(ServerWorld serverWorld, AgeableEntity ageableEntity) { + public AgeableEntity getBreedOffspring(ServerWorld pServerWorld, AgeableEntity pAgeableEntity) { return null; } @Override - public void registerControllers(AnimationData data) {} + public void registerControllers(AnimationData pData) {} @Override public AnimationFactory getFactory() { diff --git a/Forge/src/main/java/software/bluelib/example/entity/rex/RexEntity.java b/Forge/src/main/java/software/bluelib/example/entity/rex/RexEntity.java index cbdc9d07..ed815316 100644 --- a/Forge/src/main/java/software/bluelib/example/entity/rex/RexEntity.java +++ b/Forge/src/main/java/software/bluelib/example/entity/rex/RexEntity.java @@ -208,7 +208,7 @@ public static AttributeModifierMap.MutableAttribute createAttributes() { } @Override - public void registerControllers(AnimationData data) {} + public void registerControllers(AnimationData pData) {} @Override public AnimationFactory getFactory() { @@ -217,7 +217,7 @@ public AnimationFactory getFactory() { @Nullable @Override - public AgeableEntity getBreedOffspring(ServerWorld serverWorld, AgeableEntity ageableEntity) { + public AgeableEntity getBreedOffspring(ServerWorld pServerWorld, AgeableEntity pAgeableEntity) { return null; } } diff --git a/Forge/src/main/java/software/bluelib/example/init/ModEntities.java b/Forge/src/main/java/software/bluelib/example/init/ModEntities.java index 8ee739dc..2ab0554a 100644 --- a/Forge/src/main/java/software/bluelib/example/init/ModEntities.java +++ b/Forge/src/main/java/software/bluelib/example/init/ModEntities.java @@ -30,7 +30,7 @@ public class ModEntities { .sized(0.6f, 1.8f) .build(new ResourceLocation(BlueLib.MODID, "rex").toString())); - public static void register(IEventBus eventBus) { - REGISTER.register(eventBus); + public static void register(IEventBus pEventBus) { + REGISTER.register(pEventBus); } } \ No newline at end of file diff --git a/Forge/src/main/resources/META-INF/mods.toml b/Forge/src/main/resources/META-INF/mods.toml index d79a67b3..4988580c 100644 --- a/Forge/src/main/resources/META-INF/mods.toml +++ b/Forge/src/main/resources/META-INF/mods.toml @@ -1,25 +1,25 @@ modLoader="javafml" loaderVersion="${loader_version_range}" -license="${mod_license}" +license="MIT License" [[mods]] -modId="${mod_id}" -version="${mod_version}" -displayName="${mod_name}" +modId="bluelib" +version="1.0.0" +displayName="BlueLib" displayURL="https://github.com/MeAlam1/BlueLib/wiki" #logoFile="examplemod.png" credits="Anyone who contributed to the Source Code of BlueLib!" -authors="${mod_authors}" -description='''${mod_description}''' +authors="MeAlam, Dan" +description='''BlueLib is an All round Minecraft mod library that offers data-driven features, allowing users to implement and customize its features with full freedom. \nIt supports both Resource and Datapacks, ensuring seamless integration and flexibility.''' -[[dependencies.${mod_id}]] +[[dependencies.bluelib]] modId="forge" mandatory=true versionRange="${forge_version_range}" ordering="NONE" side="BOTH" -[[dependencies.${mod_id}]] +[[dependencies.bluelib]] modId="minecraft" mandatory=true versionRange="${minecraft_version_range}" diff --git a/Forge/src/main/resources/pack.mcmeta b/Forge/src/main/resources/pack.mcmeta index 001e27cb..279c6cb1 100644 --- a/Forge/src/main/resources/pack.mcmeta +++ b/Forge/src/main/resources/pack.mcmeta @@ -1,6 +1,6 @@ { "pack": { "description": "bluelib", - "pack_format": 22 + "pack_format": 6 } } \ No newline at end of file