Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the Render Issue #41

Merged
merged 7 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## Description
<!-- Provide a brief description of the changes made in this PR. -->

## Changes
- **Change 1**: Description of what was changed.
- **Change 2**: Description of what was changed.

## How has this been tested?
<!-- Describe the tests that you ran to verify your changes. -->

## Screenshots (if applicable)
<!-- Add screenshots to explain the visual impact of the changes. -->

## 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
<!-- List any issues that this PR is related to or closes. -->
14 changes: 2 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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

132 changes: 66 additions & 66 deletions Forge/build.gradle
Original file line number Diff line number Diff line change
@@ -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/'
Expand All @@ -18,10 +28,6 @@ repositories {
includeGroup("com.eliotlash.mclib")
}
}
maven {
url "https://cursemaven.com"
}
mavenCentral()
mavenLocal()
}

Expand All @@ -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
Expand All @@ -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
}
}
}
}
}
Expand All @@ -78,60 +103,35 @@ 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,
'Specification-Vendor' : mod_authors,
'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"
}
}
}
Binary file modified Forge/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions Forge/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
14 changes: 0 additions & 14 deletions Forge/settings.gradle
Original file line number Diff line number Diff line change
@@ -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'
}
13 changes: 7 additions & 6 deletions Forge/src/main/java/software/bluelib/BlueLib.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}

Expand All @@ -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" +
Expand All @@ -120,7 +121,7 @@ public void onLoadComplete(FMLLoadCompleteEvent pEvent) {
);

scheduler.shutdown();
}, 3, TimeUnit.SECONDS);
}, 5, TimeUnit.SECONDS);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public static AttributeModifierMap.MutableAttribute createAttributes() {
}

@Override
public void registerControllers(AnimationData data) {}
public void registerControllers(AnimationData pData) {}

@Override
public AnimationFactory getFactory() {
Expand All @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Loading
Loading