Skip to content

Commit

Permalink
Merge branch 'GregTechCEu:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
marisathewitch authored Jan 8, 2024
2 parents 40ea5b7 + 7d9f90c commit 231a053
Show file tree
Hide file tree
Showing 8 changed files with 149 additions and 42 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/nuclear_test_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Nuclear Test Release

on:
push:
branches:
- nuclear-fission
jobs:
build:
runs-on: ubuntu-latest

permissions:
contents: write # needed to create GitHub releases

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

- name: Declare some variables
id: vars
shell: bash
run: |
echo "::set-output name=sha_short::$(git rev-parse --short $GITHUB_SHA)"
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'

- name: Build Project
uses: gradle/gradle-build-action@v2
with:
arguments: 'build --build-cache --daemon' # use the daemon here so the rest of the process is faster
generate-job-summary: false
gradle-home-cache-includes: |
caches
jdks
notifications
wrapper
- name: Publish to GitHub
uses: softprops/action-gh-release@v1
with:
files: "build/libs/*.jar"
fail_on_unmatched_files: true
prerelease: true
tag_name: "nuclear-testing"
name: "Nuclear Testing ${{ steps.vars.outputs.sha_short }}"
body: "Testing Pre-release for GTCEu Nuclear Update"
67 changes: 55 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 1702805890
//version: 1704659416
/*
* DO NOT CHANGE THIS FILE!
* Also, you may replace this file at any time if there is an update available.
Expand Down Expand Up @@ -62,6 +62,7 @@ propertyDefaultIfUnset("generateGradleTokenClass", "")
propertyDefaultIfUnset("gradleTokenModId", "")
propertyDefaultIfUnset("gradleTokenModName", "")
propertyDefaultIfUnset("gradleTokenVersion", "")
propertyDefaultIfUnset("useSrcApiPath", false)
propertyDefaultIfUnset("includeWellKnownRepositories", true)
propertyDefaultIfUnset("includeCommonDevEnvMods", true)
propertyDefaultIfUnset("noPublishedSources", false)
Expand Down Expand Up @@ -105,9 +106,16 @@ if (!getFile(targetPackageJava).exists() && !getFile(targetPackageScala).exists(
}

if (apiPackage) {
targetPackageJava = javaSourceDir + modGroupPath + '/' + apiPackagePath
targetPackageScala = scalaSourceDir + modGroupPath + '/' + apiPackagePath
targetPackageKotlin = kotlinSourceDir + modGroupPath + '/' + apiPackagePath
final String endApiPath = modGroupPath + '/' + apiPackagePath
if (useSrcApiPath) {
targetPackageJava = 'src/api/java/' + endApiPath
targetPackageScala = 'src/api/scala/' + endApiPath
targetPackageKotlin = 'src/api/kotlin/' + endApiPath
} else {
targetPackageJava = javaSourceDir + endApiPath
targetPackageScala = scalaSourceDir + endApiPath
targetPackageKotlin = kotlinSourceDir + endApiPath
}
if (!getFile(targetPackageJava).exists() && !getFile(targetPackageScala).exists() && !getFile(targetPackageKotlin).exists()) {
throw new GradleException("Could not resolve \"apiPackage\"! Could not find ${targetPackageJava} or ${targetPackageScala} or ${targetPackageKotlin}")
}
Expand Down Expand Up @@ -436,8 +444,7 @@ repositories {
}
maven {
name 'GTNH Maven'
url 'http://jenkins.usrv.eu:8081/nexus/content/groups/public'
allowInsecureProtocol = true
url 'https://nexus.gtnewhorizons.com/repository/public/'
}
}
if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) {
Expand Down Expand Up @@ -675,6 +682,19 @@ jar {
it.isDirectory() ? it : zipTree(it)
}
}

if (useSrcApiPath && apiPackage) {
from sourceSets.api.output
dependsOn apiClasses

include "${modGroupPath}/**"
include "assets/**"
include "mcmod.info"
include "pack.mcmeta"
if (accessTransformersFile) {
include "META-INF/${accessTransformersFile}"
}
}
}

// Configure default run tasks
Expand All @@ -691,12 +711,21 @@ if (separateRunDirectories.toBoolean()) {
// Create API library jar
tasks.register('apiJar', Jar) {
archiveClassifier.set 'api'
from(sourceSets.main.java) {
include "${modGroupPath}/${apiPackagePath}/**"
}
if (useSrcApiPath) {
from(sourceSets.api.java) {
include "${modGroupPath}/${apiPackagePath}/**"
}
from(sourceSets.api.output) {
include "${modGroupPath}/${apiPackagePath}/**"
}
} else {
from(sourceSets.main.java) {
include "${modGroupPath}/${apiPackagePath}/**"
}

from(sourceSets.main.output) {
include "${modGroupPath}/${apiPackagePath}/**"
from(sourceSets.main.output) {
include "${modGroupPath}/${apiPackagePath}/**"
}
}
}

Expand Down Expand Up @@ -906,6 +935,12 @@ if (cfApiKey.isPresent() || deploymentDebug.toBoolean()) {
}
String[] parts = dep.split(':')
String type = parts[0], slug = parts[1]
def types = [
'req' : 'requiredDependency', 'required': 'requiredDependency',
'opt' : 'optionalDependency', 'optional': 'optionalDependency',
'embed' : 'embeddedLibrary', 'embedded': 'embeddedLibrary',
'incomp': 'incompatible', 'fail' : 'incompatible']
if (types.containsKey(type)) type = types[type]
if (!(type in ['requiredDependency', 'embeddedLibrary', 'optionalDependency', 'tool', 'incompatible'])) {
throw new Exception('Invalid Curseforge dependency type: ' + type)
}
Expand Down Expand Up @@ -948,7 +983,7 @@ if (modrinthApiKey.isPresent() || deploymentDebug.toBoolean()) {
}
String[] parts = dep.split(':')
String[] qual = parts[0].split('-')
addModrinthDep(qual[0], qual[1], parts[1])
addModrinthDep(qual[0], qual.length > 1 ? qual[1] : 'project', parts[1])
}
}
tasks.modrinth.dependsOn(build)
Expand All @@ -957,9 +992,17 @@ if (modrinthApiKey.isPresent() || deploymentDebug.toBoolean()) {

def addModrinthDep(String scope, String type, String name) {
com.modrinth.minotaur.dependencies.Dependency dep
def types = [
'req' : 'required',
'opt' : 'optional',
'embed' : 'embedded',
'incomp': 'incompatible', 'fail': 'incompatible']
if (types.containsKey(scope)) scope = types[scope]
if (!(scope in ['required', 'optional', 'incompatible', 'embedded'])) {
throw new Exception('Invalid modrinth dependency scope: ' + scope)
}
types = ['proj': 'project', '': 'project', 'p': 'project', 'ver': 'version', 'v': 'version']
if (types.containsKey(type)) type = types[type]
switch (type) {
case 'project':
dep = new ModDependency(name, scope)
Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ gradleTokenVersion = VERSION
# leave this property empty.
# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api
apiPackage =
# If you want to keep your API code in src/api instead of src/main
useSrcApiPath=false

# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/
# There can be multiple files in a comma-separated list.
Expand Down Expand Up @@ -90,6 +92,7 @@ relocateShadowedDependencies = true
# Separate run directories into "run/client" for runClient task, and "run/server" for runServer task.
# Useful for debugging a server and client simultaneously. If not enabled, it will be in the standard location "run/"
separateRunDirectories = false

# The display name format of versions published to Curse and Modrinth. $MOD_NAME and $VERSION are available variables.
# Default: $MOD_NAME \u2212 $VERSION. \u2212 is the minus character which looks much better than the hyphen minus on Curse.
versionDisplayFormat=$MOD_NAME: $VERSION
Expand Down
4 changes: 1 addition & 3 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ pluginManagement {
maven {
// RetroFuturaGradle
name 'GTNH Maven'
//noinspection HttpUrlsUsage
url 'http://jenkins.usrv.eu:8081/nexus/content/groups/public/'
allowInsecureProtocol = true
url 'https://nexus.gtnewhorizons.com/repository/public/'
//noinspection GroovyAssignabilityCheck
mavenContent {
includeGroup 'com.gtnewhorizons'
Expand Down
11 changes: 9 additions & 2 deletions src/main/java/gregtech/api/recipes/Recipe.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;

import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
* Class that represent machine recipe.
Expand Down Expand Up @@ -673,8 +679,9 @@ public boolean hasValidInputsForDisplay() {
.anyMatch(s -> !s.isEmpty())) {
return true;
}
} else if (Arrays.stream(ingredient.getInputStacks()).anyMatch(s -> !s.isEmpty())) {
return true;
}
return Arrays.stream(ingredient.getInputStacks()).anyMatch(s -> !s.isEmpty());
}
for (GTRecipeInput fluidInput : fluidInputs) {
FluidStack fluidIngredient = fluidInput.getInputFluidStack();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@
import org.jetbrains.annotations.NotNull;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.stream.Collectors;
import java.util.stream.Stream;

Expand Down Expand Up @@ -214,15 +214,15 @@ public void register(IModRegistry registry) {
registry.addRecipeCatalyst(MetaTileEntities.LARGE_TITANIUM_BOILER.getStackForm(), semiFluidMapId);
registry.addRecipeCatalyst(MetaTileEntities.LARGE_TUNGSTENSTEEL_BOILER.getStackForm(), semiFluidMapId);

List<OreByProduct> oreByproductList = new CopyOnWriteArrayList<>();
List<OreByProduct> oreByproductList = new ArrayList<>();
for (Material material : GregTechAPI.materialManager.getRegisteredMaterials()) {
if (material.hasProperty(PropertyKey.ORE)) {
oreByproductList.add(new OreByProduct(material));
}
}
String oreByProductId = GTValues.MODID + ":" + "ore_by_product";
registry.addRecipes(oreByproductList, oreByProductId);
MetaTileEntity[][] machineLists = new MetaTileEntity[][] {
MetaTileEntity[][] machineLists = {
MetaTileEntities.MACERATOR,
MetaTileEntities.ORE_WASHER,
MetaTileEntities.CENTRIFUGE,
Expand All @@ -237,7 +237,7 @@ public void register(IModRegistry registry) {
}

// Material Tree
List<MaterialTree> materialTreeList = new CopyOnWriteArrayList<>();
List<MaterialTree> materialTreeList = new ArrayList<>();
for (Material material : GregTechAPI.materialManager.getRegisteredMaterials()) {
if (material.hasProperty(PropertyKey.DUST)) {
materialTreeList.add(new MaterialTree(material));
Expand All @@ -247,7 +247,7 @@ public void register(IModRegistry registry) {

// Ore Veins
List<OreDepositDefinition> oreVeins = WorldGenRegistry.getOreDeposits();
List<GTOreInfo> oreInfoList = new CopyOnWriteArrayList<>();
List<GTOreInfo> oreInfoList = new ArrayList<>();
for (OreDepositDefinition vein : oreVeins) {
oreInfoList.add(new GTOreInfo(vein));
}
Expand All @@ -261,7 +261,7 @@ public void register(IModRegistry registry) {

// Fluid Veins
List<BedrockFluidDepositDefinition> fluidVeins = WorldGenRegistry.getBedrockVeinDeposits();
List<GTFluidVeinInfo> fluidVeinInfos = new CopyOnWriteArrayList<>();
List<GTFluidVeinInfo> fluidVeinInfos = new ArrayList<>();
for (BedrockFluidDepositDefinition fluidVein : fluidVeins) {
fluidVeinInfos.add(new GTFluidVeinInfo(fluidVein));
}
Expand Down Expand Up @@ -307,7 +307,7 @@ private void setupInputHandler() {

showsRecipeFocuses.add(new MultiblockInfoRecipeFocusShower());

} catch (Exception e) {
} catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException | SecurityException e) {
getLogger().error("Could not reflect JEI Internal inputHandler", e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ private static void registerGTWoodRecipes() {
'L', MetaBlocks.PLANKS.getItemVariant(BlockGregPlanks.BlockType.TREATED_PLANK));
if (ConfigHolder.recipes.nerfWoodCrafting) {
ModHandler.addShapedRecipe("treated_wood_stick_saw", OreDictUnifier.get(OrePrefix.stick, TreatedWood, 4),
"s", "L",
"s", "L", "L",
'L', MetaBlocks.PLANKS.getItemVariant(BlockGregPlanks.BlockType.TREATED_PLANK));
}
}
Expand Down
Loading

0 comments on commit 231a053

Please sign in to comment.