Skip to content

Commit

Permalink
Merge branch 'GregTechCEu:1.20.1' into 1.20.1
Browse files Browse the repository at this point in the history
  • Loading branch information
code-onigiri authored Dec 10, 2024
2 parents 37df0ea + ac947ed commit 2ed760a
Show file tree
Hide file tree
Showing 23 changed files with 359 additions and 560 deletions.
2 changes: 1 addition & 1 deletion gradle/scripts/moddevgradle.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ neoForge {

data {
data()
sourceSet = sourceSets.main
sourceSet = sourceSets.extra
ideName = "Data Generation"

gameDirectory.set(file('run/data'))
Expand Down
4 changes: 4 additions & 0 deletions src/generated/resources/assets/gtceu/lang/en_ud.json
Original file line number Diff line number Diff line change
Expand Up @@ -2299,6 +2299,9 @@
"gtceu.fluid_solidifier": "ɹǝıɟıpıןoS pınןℲ",
"gtceu.forge_hammer": "ɹǝɯɯɐH ǝbɹoℲ",
"gtceu.forming_press": "ssǝɹԀ buıɯɹoℲ",
"gtceu.forming_press.naming.named": "ɯǝʇI pǝɯɐNo§",
"gtceu.forming_press.naming.press": "ssǝɹԀ pǝɯɐNo§",
"gtceu.forming_press.naming.to_name": "ǝɯɐN oʇ ɯǝʇIo§",
"gtceu.fusion_reactor": "ɹoʇɔɐǝᴚ uoısnℲ",
"gtceu.gas_collector": "ɹoʇɔǝןןoƆ sɐ⅁",
"gtceu.gas_turbine": "ǝuıqɹn⟘ sɐ⅁",
Expand Down Expand Up @@ -5063,6 +5066,7 @@
"material.gtceu.nether_air": "ɹıⱯ ɹǝɥʇǝN",
"material.gtceu.nether_quartz": "zʇɹɐnὉ ɹǝɥʇǝN",
"material.gtceu.nether_star": "ɹɐʇS ɹǝɥʇǝN",
"material.gtceu.netherite": "ǝʇıɹǝɥʇǝN",
"material.gtceu.netherrack": "ʞɔɐɹɹǝɥʇǝN",
"material.gtceu.neutronium": "ɯnıuoɹʇnǝN",
"material.gtceu.nichrome": "ǝɯoɹɥɔıN",
Expand Down
4 changes: 4 additions & 0 deletions src/generated/resources/assets/gtceu/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -2299,6 +2299,9 @@
"gtceu.fluid_solidifier": "Fluid Solidifier",
"gtceu.forge_hammer": "Forge Hammer",
"gtceu.forming_press": "Forming Press",
"gtceu.forming_press.naming.named": "§oNamed Item",
"gtceu.forming_press.naming.press": "§oNamed Press",
"gtceu.forming_press.naming.to_name": "§oItem to Name",
"gtceu.fusion_reactor": "Fusion Reactor",
"gtceu.gas_collector": "Gas Collector",
"gtceu.gas_turbine": "Gas Turbine",
Expand Down Expand Up @@ -5063,6 +5066,7 @@
"material.gtceu.nether_air": "Nether Air",
"material.gtceu.nether_quartz": "Nether Quartz",
"material.gtceu.nether_star": "Nether Star",
"material.gtceu.netherite": "Netherite",
"material.gtceu.netherrack": "Netherrack",
"material.gtceu.neutronium": "Neutronium",
"material.gtceu.nichrome": "Nichrome",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ public GTRecipe(GTRecipeType recipeType,
this.duration = duration;
this.isFuel = isFuel;
this.recipeCategory = (recipeCategory != GTRecipeCategory.DEFAULT) ? recipeCategory : recipeType.getCategory();
if (id != null) this.recipeType.addToCategoryMap(this.recipeCategory, this);
}

public Map<RecipeCapability<?>, List<Content>> copyContents(Map<RecipeCapability<?>, List<Content>> contents,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ public GTRecipe fromNetwork(@NotNull ResourceLocation id, @NotNull FriendlyByteB
inputChanceLogics, outputChanceLogics, tickInputChanceLogics, tickOutputChanceLogics,
conditions, ingredientActions, data, duration, isFuel, category);

recipe.recipeCategory.addRecipe(recipe);

// a little special piece of code for loading all the research entries into the recipe type's list on the
// client.
ResearchCondition researchCondition = conditions.stream().filter(ResearchCondition.class::isInstance).findAny()
Expand Down
25 changes: 11 additions & 14 deletions src/main/java/com/gregtechceu/gtceu/api/recipe/GTRecipeType.java
Original file line number Diff line number Diff line change
Expand Up @@ -331,15 +331,14 @@ public GTRecipe toGTrecipe(ResourceLocation id, Recipe<?> recipe) {
return GTRecipeSerializer.SERIALIZER.fromJson(id, builder.build().serializeRecipe());
}

public @NotNull List<GTRecipe> getRepresentativeRecipes() {
List<GTRecipe> recipes = new ArrayList<>();
public void buildRepresentativeRecipes() {
for (ICustomRecipeLogic logic : customRecipeLogicRunners) {
List<GTRecipe> logicRecipes = logic.getRepresentativeRecipes();
if (logicRecipes != null && !logicRecipes.isEmpty()) {
recipes.addAll(logicRecipes);
}
logic.buildRepresentativeRecipes();
}
return recipes;
}

public void addToMainCategory(GTRecipe recipe) {
addToCategoryMap(category, recipe);
}

public void addToCategoryMap(GTRecipeCategory category, GTRecipe recipe) {
Expand All @@ -357,19 +356,17 @@ public Set<GTRecipe> getRecipesInCategory(GTRecipeCategory category) {
public interface ICustomRecipeLogic {

/**
* @return A custom recipe to run given the current Scanner's inputs. Will be called only if a registered
* @return A custom recipe to run given the current holder's inputs. Will be called only if a registered
* recipe is not found to run. Return null if no recipe should be run by your logic.
*/
@Nullable
GTRecipe createCustomRecipe(IRecipeCapabilityHolder holder);

/**
* @return A list of Recipes that are never registered, but are added to JEI to demonstrate the custom logic.
* Not required, can return empty or null to not add any.
* Build all representative recipes in this method, then add them to the appropriate recipe category.
* These are added to XEI to demonstrate the custom logic.
* Not required, can NOOP if unneeded.
*/
@Nullable
default List<GTRecipe> getRepresentativeRecipes() {
return null;
}
default void buildRepresentativeRecipes() {}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.gregtechceu.gtceu.api.recipe.category;

import com.gregtechceu.gtceu.GTCEu;
import com.gregtechceu.gtceu.api.recipe.GTRecipe;
import com.gregtechceu.gtceu.api.recipe.GTRecipeType;
import com.gregtechceu.gtceu.api.registry.GTRegistries;
import com.gregtechceu.gtceu.common.data.GTRecipeTypes;
Expand Down Expand Up @@ -64,6 +65,10 @@ public IGuiTexture getIcon() {
return icon;
}

public void addRecipe(GTRecipe recipe) {
recipeType.addToCategoryMap(this, recipe);
}

@Override
public boolean equals(Object obj) {
if (this == obj) return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -469,11 +469,11 @@ public boolean addRecipe(GTRecipe recipe) {
if (recipe.getType() == GTRecipeTypes.COMBUSTION_GENERATOR_FUELS) {
Content content = recipe.getInputContents(FluidRecipeCapability.CAP).get(0);
FluidIngredient fluid = FluidRecipeCapability.CAP.of(content.content);
PowerlessJetpack.FUELS.put(fluid, recipe.duration);
PowerlessJetpack.FUELS.putIfAbsent(fluid, recipe.duration);
}
List<List<AbstractMapIngredient>> items = fromRecipe(recipe);
if (recurseIngredientTreeAdd(recipe, items, lookup, 0, 0)) {
recipeType.addToCategoryMap(recipe.recipeCategory, recipe);
recipe.recipeCategory.addRecipe(recipe);
return true;
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.gregtechceu.gtceu.api.recipe.GTRecipe;
import com.gregtechceu.gtceu.api.recipe.GTRecipeType;
import com.gregtechceu.gtceu.api.recipe.RecipeCondition;
import com.gregtechceu.gtceu.api.recipe.category.GTRecipeCategory;
import com.gregtechceu.gtceu.integration.emi.recipe.GTRecipeEMICategory;
import com.gregtechceu.gtceu.integration.jei.recipe.GTRecipeJEICategory;
import com.gregtechceu.gtceu.integration.rei.recipe.GTRecipeREICategory;
Expand Down Expand Up @@ -246,12 +247,14 @@ public IEditableUI<WidgetGroup, RecipeHolder> createEditableUITemplate(final boo
if (LDLib.isReiLoaded()) {
ViewSearchBuilder.builder().addCategories(
recipeType.getCategories().stream()
.filter(GTRecipeCategory::isXEIVisible)
.map(GTRecipeREICategory::machineCategory)
.collect(Collectors.toList()))
.open();
} else if (LDLib.isJeiLoaded()) {
JEIPlugin.jeiRuntime.getRecipesGui().showTypes(
recipeType.getCategories().stream()
.filter(GTRecipeCategory::isXEIVisible)
.map(GTRecipeJEICategory::machineType)
.collect(Collectors.toList()));
} else if (LDLib.isEmiLoaded()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ private static void registerDuctPipeBlock(int index) {
.tag(GTToolType.WRENCH.harvestTags.get(0), BlockTags.MINEABLE_WITH_PICKAXE)
.item(BlockItem::new)
.build()
.register();;
.register();
public static final BlockEntry<Block> HIGH_POWER_CASING = createCasingBlock("high_power_casing",
GTCEu.id("block/casings/hpca/high_power_casing"));

Expand Down
Loading

0 comments on commit 2ed760a

Please sign in to comment.