Skip to content
This repository has been archived by the owner on Jul 4, 2024. It is now read-only.

Commit

Permalink
Hotfix: Recipe output is multiplied by an error
Browse files Browse the repository at this point in the history
  • Loading branch information
qwer523 committed May 10, 2024
1 parent 88c7f6f commit e48a2bd
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 17 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Release
on:
release:
types:
- published

jobs:
build:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: checkout
uses: actions/checkout@v4

- name: validate gradle wrapper
uses: gradle/actions/wrapper-validation@v3

- name: Setup Java 17
uses: actions/[email protected]
with:
distribution: zulu
java-version: 17

- name: make gradle wrapper executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew

- name: Build with Gradle
uses: gradle/actions/setup-gradle@v3

- name: Build
run: ./gradlew build

- name: Read Properties
id: 'properties'
uses: christian-draeger/[email protected]
with:
path: gradle.properties
properties: 'mod_id mod_name'

- name: Get Version
id: var
run: |
MESSAGE=$(ls build/libs/* | grep sources.jar -v | grep shadow.jar -v | grep slim.jar -v | awk -F '${{ steps.properties.outputs.mod_id }}-|.jar' '{print $2}')
echo version=$MESSAGE >> $GITHUB_OUTPUT
- name: "publish md mod"
uses: Kir-Antipov/[email protected]
with:
name: "${{ steps.properties.outputs.mod_name }} v${{ steps.var.outputs.version }}"
version: ${{ steps.var.outputs.version }}
game-versions: 1.20.1
version-type: release
java: 17
loaders: forge
files: build/libs/${{ steps.properties.outputs.mod_id }}-${{ steps.var.outputs.version }}.jar

github-token: ${{ secrets.GITHUB_TOKEN }}

modrinth-id: KvSy350p
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}

curseforge-id: 1015315
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ mod_url =

archives_base_name = monazite
# The mod version. See https://semver.org/
mod_version = 1.1.2
mod_version = 1.1.3
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
Expand Down
2 changes: 1 addition & 1 deletion gradle/scripts/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ dependencies {
modImplementation("maven.modrinth:oculus:1.20.1-1.6.9")

// GTM
modImplementation("maven.modrinth:gregtechceu-modern:mc1.20.1-1.1.3.b")
modImplementation("maven.modrinth:gregtechceu-modern:mc1.20.1-1.2.1")

// Runtime only testing mods
//modRuntimeOnly(forge.worldStripper)
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ dependencyResolutionManagement {
def vineFlowerVersion = "1.+"
def macheteVersion = "1.+"
def configurationVersion = "2.2.0"
def ldLibVersion = "1.0.23.a"
def ldLibVersion = "1.0.25.g"
def mixinextrasVersion = "0.2.0"
def shimmerVersion = "0.2.2"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static class OreVeinDisplayConfigs {
public boolean useNHDimensionDisplay = true; // default true

@Configurable
@Configurable.Comment({"If true, the dimension display will show dimension tier.", "Default: true"})
@Configurable.Comment({"If true, the dimension display will show dimension tier.", "Default: false"})
public boolean showDimensionTier = false; // default false

@Configurable
Expand Down
10 changes: 2 additions & 8 deletions src/main/java/com/epimorphismmc/monazite/utils/RecipeUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,14 @@ public static List<ItemStack> getOutputItem(GTRecipe recipe) {
return new ArrayList<>(recipe.getOutputContents(ItemRecipeCapability.CAP).stream()
.map(content -> ItemRecipeCapability.CAP.of(content.getContent()))
.flatMap(ingredient -> Arrays.stream(ingredient.getItems()))
.collect(Collectors.toMap(ItemStack::getItem, Function.identity(), (s1, s2) -> {
s1.grow(s2.getCount());
return s1;
})).values());
.collect(Collectors.toMap(ItemStack::getItem, Function.identity(), (s1, s2) -> s1.copyWithCount(s1.getCount() + s2.getCount()))).values());
}

public static List<FluidStack> getOutputFluid(GTRecipe recipe) {
return new ArrayList<>(recipe.getOutputContents(FluidRecipeCapability.CAP).stream()
.map(content -> FluidRecipeCapability.CAP.of(content.getContent()))
.flatMap(ingredient -> Arrays.stream(ingredient.getStacks()))
.collect(Collectors.toMap(FluidStack::getFluid, Function.identity(), (s1, s2) -> {
s1.grow(s2.getAmount());
return s1;
})).values());
.collect(Collectors.toMap(FluidStack::getFluid, Function.identity(), (s1, s2) -> s1.copy(s1.getAmount() + s2.getAmount()))).values());
}

}
22 changes: 17 additions & 5 deletions src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,23 @@ description='''${mod_description}'''
ordering="NONE"
side="BOTH"
[[dependencies.${mod_id}]]
modId = "gtceu"
mandatory = true
versionRange = "[1.0.0,)"
ordering = "AFTER"
side = "BOTH"
modId="gtceu"
mandatory=true
versionRange="[1.0.0,)"
ordering="AFTER"
side="BOTH"
[[dependencies.${mod_id}]]
modId="jade"
mandatory=false
versionRange="[11.0.0,)"
ordering="NONE"
side="BOTH"
[[dependencies.${mod_id}]]
modId="theoneprobe"
mandatory=false
versionRange="[1.20.1-9.0.0,)"
ordering="NONE"
side="BOTH"

# Features are specific properties of the game environment, that you may want to declare you require. This example declares
# that your mod requires GL version 3.2 or higher. Other features will be added. They are side aware so declaring this won't
Expand Down

0 comments on commit e48a2bd

Please sign in to comment.