Skip to content

Commit

Permalink
readd getColors for weather2. Add github action to specifically build…
Browse files Browse the repository at this point in the history
… neoforge automatically
  • Loading branch information
Corosauce committed Nov 21, 2024
1 parent 061e847 commit 2dc724f
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Java CI with Gradle

on: [push]
jobs:

jdk17:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: --settings-file build_neoforge_settings.gradle build

- name: Locate built JARfile
id: jar
run: echo "##[set-output name=jarfile;]$(find build/libs/ -name "*.jar" -not -name "*slim*" -not -name "*source*")"

- name: Set Artifact name
id: jarname
run: echo "##[set-output name=jarname;]$(find build/libs/ -name "*.jar" -not -name "*slim*" -not -name "*source*" | sed 's:.*/::')"

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.jarname.outputs.jarname }}
path: ${{ steps.jar.outputs.jarfile }}
retention-days: 90

2 changes: 2 additions & 0 deletions build_neoforge_settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rootProject.name = 'build_neoforge'
rootProject.buildFileName = 'build_neoforge.gradle'
6 changes: 3 additions & 3 deletions src/main/java/com/corosus/coroutil/util/CoroUtilColor.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
public class CoroUtilColor {


/*public static int[] getColors(BlockState state) {
public static int[] getColors(BlockState state) {
BakedModel model;

//used when foliage shader is on
Expand All @@ -25,7 +25,7 @@ public class CoroUtilColor {

if (model != null && !model.isCustomRenderer()) {
//TODO: this requires a param in forge, but not in fabric, resolve this
TextureAtlasSprite sprite = model.getParticleIcon(*//*net.minecraftforge.client.model.data.ModelData.EMPTY*//*);
TextureAtlasSprite sprite = model.getParticleIcon(/*net.minecraftforge.client.model.data.ModelData.EMPTY*/);
if (sprite != null && !sprite.contents().name().equals(MissingTextureAtlasSprite.getLocation())) {
return getColors(sprite);
}
Expand Down Expand Up @@ -78,6 +78,6 @@ private static int getColor(int[] colorData) {
float mb = 1F;//(multiplier & 0xFF) / 255f;

return 0xFF000000 | (((int) (colorData[0] * mr)) << 16) | (((int) (colorData[1] * mg)) << 8) | (int) (colorData[2] * mb);
}*/
}

}

0 comments on commit 2dc724f

Please sign in to comment.