Skip to content

Commit

Permalink
cherrypick 1.19 to 1.20 (#508)
Browse files Browse the repository at this point in the history
* alloy blast smelter fix (#506)

* fill out changelog

* run data

---------

Co-authored-by: Rundas <[email protected]>
  • Loading branch information
screret and Rundas01 authored Nov 3, 2023
1 parent abce4b3 commit 73e8fcf
Show file tree
Hide file tree
Showing 37 changed files with 1,193 additions and 16 deletions.
11 changes: 6 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# ChangeLog

* fix stone ores having broken translations
* fix transfer + fix ldlib
* fix fluid slot overflow
* fix assembly line recipe handling
* update zh_cn lang
* Add ME stocking input bus/hatch, ME output bus/hatch
* add laser cables
* add high-tier content config option
* add ore processing chart recipeviewer page
* make manual compression recipes be shaped
* switch certus quartz material amount to 4
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@ public class GuiTextures {
public static final ResourceTexture MAINTENANCE_ICON = new ResourceTexture("gtceu:textures/block/overlay/machine/overlay_maintenance.png");
public static final ResourceTexture BUTTON_MINER_MODES = new ResourceTexture("gtceu:textures/gui/widget/button_miner_modes.png");

//ORE PROCESSING
public static final ResourceTexture OREBY_BASE = new ResourceTexture("gtceu:textures/gui/arrows/oreby-base.png");
public static final ResourceTexture OREBY_CHEM = new ResourceTexture("gtceu:textures/gui/arrows/oreby-chem.png");
public static final ResourceTexture OREBY_SEP = new ResourceTexture("gtceu:textures/gui/arrows/oreby-sep.png");
public static final ResourceTexture OREBY_SIFT = new ResourceTexture("gtceu:textures/gui/arrows/oreby-sift.png");
public static final ResourceTexture OREBY_SMELT = new ResourceTexture("gtceu:textures/gui/arrows/oreby-smelt.png");


//PRIMITIVE
public static final ResourceBorderTexture PRIMITIVE_BACKGROUND = new ResourceBorderTexture("gtceu:textures/gui/primitive/primitive_background.png", 176, 166, 3, 3);
public static final ResourceBorderTexture PRIMITIVE_SLOT = new ResourceBorderTexture("gtceu:textures/gui/primitive/primitive_slot.png", 18, 18, 1, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public static void init(RegistrateLangProvider provider) {
/** JEI, REI, EMI */
private static void initRecipeViewerLang(RegistrateLangProvider provider) {
provider.add("gtceu.jei.multiblock_info", "Multiblock Info");
provider.add("gtceu.jei.ore_processing_diagram", "Ore Processing Diagram");
}

/** Jade, TheOneProbe, WTHIT */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import javax.annotation.Nonnull;
import java.util.function.Consumer;

import static com.gregtechceu.gtceu.api.data.tag.TagPrefix.ingotHot;

public class AlloyBlastRecipeProducer {

public static final AlloyBlastRecipeProducer DEFAULT_PRODUCER = new AlloyBlastRecipeProducer();
Expand All @@ -44,7 +46,13 @@ public void produce(@Nonnull Material material, @Nonnull BlastProperty property,
if (componentAmount < 2) return;

// get the output fluid
Fluid molten = GTUtil.getMoltenFluid(material);
Fluid molten;
if (ingotHot.doGenerateItem(material)) {
molten = GTUtil.getMoltenFluid(material);
addFreezerRecipes(material, molten, property.getBlastTemperature(), provider);
}else {
molten = material.getFluid();
}
if (molten == null) return;

GTRecipeBuilder builder = createBuilder(property, material);
Expand All @@ -53,11 +61,6 @@ public void produce(@Nonnull Material material, @Nonnull BlastProperty property,
if (outputAmount <= 0) return;

buildRecipes(property, molten, outputAmount, componentAmount, builder, provider);

// if the material does not need a vacuum freezer, exit
if (!TagPrefix.ingotHot.doGenerateItem(material)) return;

addFreezerRecipes(material, molten, property.getBlastTemperature(), provider);
}

/**
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.gregtechceu.gtceu.api.recipe.GTRecipeType;
import com.gregtechceu.gtceu.common.data.GTMachines;
import com.gregtechceu.gtceu.integration.emi.multipage.MultiblockInfoEmiCategory;
import com.gregtechceu.gtceu.integration.emi.oreprocessing.GTOreProcessingEmiCategory;
import com.gregtechceu.gtceu.integration.emi.recipe.GTRecipeTypeEmiCategory;
import dev.emi.emi.api.EmiEntrypoint;
import dev.emi.emi.api.EmiPlugin;
Expand All @@ -23,6 +24,7 @@ public class GTEMIPlugin implements EmiPlugin {
@Override
public void register(EmiRegistry registry) {
registry.addCategory(MultiblockInfoEmiCategory.CATEGORY);
registry.addCategory(GTOreProcessingEmiCategory.CATEGORY);
for (RecipeType<?> recipeType : BuiltInRegistries.RECIPE_TYPE) {
if (recipeType instanceof GTRecipeType gtRecipeType) {
registry.addCategory(GTRecipeTypeEmiCategory.CATEGORIES.apply(gtRecipeType));
Expand All @@ -31,9 +33,11 @@ public void register(EmiRegistry registry) {
// recipes
MultiblockInfoEmiCategory.registerDisplays(registry);
GTRecipeTypeEmiCategory.registerDisplays(registry);
GTOreProcessingEmiCategory.registerDisplays(registry);
// workstations
MultiblockInfoEmiCategory.registerWorkStations(registry);
GTRecipeTypeEmiCategory.registerWorkStations(registry);
GTOreProcessingEmiCategory.registerWorkStations(registry);
for (MachineDefinition definition : GTMachines.ELECTRIC_FURNACE) {
if (definition != null) {
registry.addWorkstation(VanillaEmiRecipeCategories.SMELTING, EmiStack.of(definition.asStack()));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.gregtechceu.gtceu.integration.emi.oreprocessing;

import com.gregtechceu.gtceu.GTCEu;
import com.gregtechceu.gtceu.api.data.chemical.material.Material;
import com.gregtechceu.gtceu.integration.GTOreProcessingWidget;
import com.lowdragmc.lowdraglib.emi.ModularEmiRecipe;
import com.lowdragmc.lowdraglib.gui.widget.WidgetGroup;
import dev.emi.emi.api.recipe.EmiRecipeCategory;
import net.minecraft.resources.ResourceLocation;
import org.jetbrains.annotations.Nullable;

public class GTEmiOreProcessing extends ModularEmiRecipe<WidgetGroup> {
final Material material;

public GTEmiOreProcessing(Material material) {
super(() -> new GTOreProcessingWidget(material));
this.material = material;
}

@Override
public EmiRecipeCategory getCategory() {
return GTOreProcessingEmiCategory.CATEGORY;
}

@Override
public @Nullable ResourceLocation getId() {
return GTCEu.id(material.getName());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package com.gregtechceu.gtceu.integration.emi.oreprocessing;

import com.gregtechceu.gtceu.GTCEu;
import com.gregtechceu.gtceu.api.data.chemical.material.Material;
import com.gregtechceu.gtceu.api.machine.MachineDefinition;
import com.gregtechceu.gtceu.api.recipe.GTRecipeType;
import com.gregtechceu.gtceu.api.registry.GTRegistries;
import com.gregtechceu.gtceu.integration.rei.oreprocessing.GTOreProcessingDisplayCategory;
import com.lowdragmc.lowdraglib.emi.ModularUIEmiRecipeCategory;
import dev.emi.emi.api.EmiRegistry;
import dev.emi.emi.api.stack.EmiStack;
import me.shedaniel.rei.api.common.util.EntryStacks;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Items;

import java.util.ArrayList;
import java.util.List;

import static com.gregtechceu.gtceu.api.data.chemical.material.properties.PropertyKey.ORE;
import static com.gregtechceu.gtceu.common.data.GTRecipeTypes.*;

public class GTOreProcessingEmiCategory extends ModularUIEmiRecipeCategory {
public static final GTOreProcessingEmiCategory CATEGORY = new GTOreProcessingEmiCategory();
public GTOreProcessingEmiCategory() {
super(GTCEu.id("ore_processing_diagram"), EmiStack.of(Items.IRON_ORE));
}

public static void registerDisplays(EmiRegistry registry) {
for (Material mat : GTRegistries.MATERIALS) {
if (mat.hasProperty(ORE)) {
registry.addRecipe(new GTEmiOreProcessing(mat));
}
}
}

public static void registerWorkStations(EmiRegistry registry) {
List<MachineDefinition> registeredMachines = new ArrayList<>();
GTRecipeType[] validTypes = new GTRecipeType[] {
MACERATOR_RECIPES,ORE_WASHER_RECIPES,THERMAL_CENTRIFUGE_RECIPES,CENTRIFUGE_RECIPES,CHEMICAL_BATH_RECIPES,ELECTROMAGNETIC_SEPARATOR_RECIPES,SIFTER_RECIPES
};
for (MachineDefinition machine : GTRegistries.MACHINES) {
if (machine.getRecipeTypes() != null) {
for (GTRecipeType type : machine.getRecipeTypes()){
for (GTRecipeType validType : validTypes){
if (type == validType && !registeredMachines.contains(machine)) {
registry.addWorkstation(CATEGORY, EmiStack.of(machine.asStack()));
registeredMachines.add(machine);
}
}
}
}
}
}

@Override
public Component getName() {
return Component.translatable("gtceu.jei.ore_processing_diagram");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.gregtechceu.gtceu.api.recipe.GTRecipeType;
import com.gregtechceu.gtceu.common.data.GTMachines;
import com.gregtechceu.gtceu.integration.jei.multipage.MultiblockInfoCategory;
import com.gregtechceu.gtceu.integration.jei.oreprocessing.GTOreProcessingInfoCategory;
import com.gregtechceu.gtceu.integration.jei.recipe.GTRecipeTypeCategory;
import com.lowdragmc.lowdraglib.LDLib;
import mezz.jei.api.IModPlugin;
Expand Down Expand Up @@ -43,6 +44,7 @@ public void registerCategories(@Nonnull IRecipeCategoryRegistration registry) {
GTCEu.LOGGER.info("JEI register categories");
IJeiHelpers jeiHelpers = registry.getJeiHelpers();
registry.addRecipeCategories(new MultiblockInfoCategory(jeiHelpers));
registry.addRecipeCategories(new GTOreProcessingInfoCategory(jeiHelpers));
for (RecipeType<?> recipeType : BuiltInRegistries.RECIPE_TYPE) {
if (recipeType instanceof GTRecipeType gtRecipeType) {
registry.addRecipeCategories(new GTRecipeTypeCategory(jeiHelpers, gtRecipeType));
Expand All @@ -55,6 +57,7 @@ public void registerRecipeCatalysts(@Nonnull IRecipeCatalystRegistration registr
if (LDLib.isReiLoaded() || LDLib.isEmiLoaded()) return;
MultiblockInfoCategory.registerRecipeCatalysts(registration);
GTRecipeTypeCategory.registerRecipeCatalysts(registration);
GTOreProcessingInfoCategory.registerRecipeCatalysts(registration);
for (MachineDefinition definition : GTMachines.ELECTRIC_FURNACE) {
if (definition != null) {
registration.addRecipeCatalyst(definition.asStack(), RecipeTypes.SMELTING);
Expand All @@ -72,6 +75,7 @@ public void registerRecipes(@Nonnull IRecipeRegistration registration) {
GTCEu.LOGGER.info("JEI register");
MultiblockInfoCategory.registerRecipes(registration);
GTRecipeTypeCategory.registerRecipes(registration);
GTOreProcessingInfoCategory.registerRecipes(registration);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
package com.gregtechceu.gtceu.integration.jei.oreprocessing;

import com.gregtechceu.gtceu.GTCEu;
import com.gregtechceu.gtceu.api.data.chemical.ChemicalHelper;
import com.gregtechceu.gtceu.api.data.chemical.material.Material;
import com.gregtechceu.gtceu.api.data.chemical.material.properties.PropertyKey;
import com.gregtechceu.gtceu.api.registry.GTRegistries;
import com.lowdragmc.lowdraglib.jei.ModularUIRecipeCategory;
import mezz.jei.api.gui.drawable.IDrawable;
import mezz.jei.api.helpers.IGuiHelper;
import mezz.jei.api.helpers.IJeiHelpers;
import mezz.jei.api.recipe.RecipeType;
import mezz.jei.api.registration.IRecipeCatalystRegistration;
import mezz.jei.api.registration.IRecipeRegistration;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;

import javax.annotation.Nonnull;

import static com.gregtechceu.gtceu.api.data.chemical.material.properties.PropertyKey.DUST;
import static com.gregtechceu.gtceu.api.data.chemical.material.properties.PropertyKey.ORE;
import static com.gregtechceu.gtceu.api.data.tag.TagPrefix.*;
import static com.gregtechceu.gtceu.common.data.GTMaterials.Aluminium;
import static com.gregtechceu.gtceu.common.data.GTMaterials.Iron;

public class GTOreProcessingInfoCategory extends ModularUIRecipeCategory<GTOreProcessingInfoWrapper> {
public final static RecipeType<GTOreProcessingInfoWrapper> RECIPE_TYPE = new RecipeType<>(GTCEu.id("ore_processing_diagram"), GTOreProcessingInfoWrapper.class);
private final IDrawable background;
private final IDrawable icon;

public GTOreProcessingInfoCategory(IJeiHelpers helpers) {
IGuiHelper guiHelper = helpers.getGuiHelper();
this.background = guiHelper.createBlankDrawable(186, 174);
this.icon = helpers.getGuiHelper().createDrawableItemStack(ChemicalHelper.get(ore,Iron));
}

public static void registerRecipes(IRecipeRegistration registry) {
registry.addRecipes(RECIPE_TYPE, GTRegistries.MATERIALS.values().stream()
.filter((material) -> material.hasProperty(PropertyKey.ORE))
.map(GTOreProcessingInfoWrapper::new)
.toList());
}

public static void registerRecipeCatalysts(IRecipeCatalystRegistration registration) {
for (Material mat : GTRegistries.MATERIALS) {
if (mat.hasProperty(ORE)) {
registration.addRecipeCatalyst(ChemicalHelper.get(ore, mat), RECIPE_TYPE);
registration.addRecipeCatalyst(ChemicalHelper.get(rawOre, mat), RECIPE_TYPE);
registration.addRecipeCatalyst(ChemicalHelper.get(crushed, mat), RECIPE_TYPE);
registration.addRecipeCatalyst(ChemicalHelper.get(crushedPurified, mat), RECIPE_TYPE);
registration.addRecipeCatalyst(ChemicalHelper.get(crushedRefined, mat), RECIPE_TYPE);
registration.addRecipeCatalyst(ChemicalHelper.get(ore, mat), RECIPE_TYPE);
if (mat.hasProperty(DUST)) {
registration.addRecipeCatalyst(ChemicalHelper.get(dust, mat), RECIPE_TYPE);
}
}
}
}


@Override
@Nonnull
public RecipeType<GTOreProcessingInfoWrapper> getRecipeType() {
return RECIPE_TYPE;
}

@Nonnull
@Override
public Component getTitle() {
return Component.translatable("gtceu.jei.ore_processing_info");
}

@Nonnull
@Override
public IDrawable getBackground() {
return background;
}

@Nonnull
@Override
public IDrawable getIcon() {
return icon;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.gregtechceu.gtceu.integration.jei.oreprocessing;

import com.gregtechceu.gtceu.api.data.chemical.material.Material;
import com.gregtechceu.gtceu.integration.GTOreProcessingWidget;
import com.lowdragmc.lowdraglib.jei.ModularWrapper;

public class GTOreProcessingInfoWrapper extends ModularWrapper<GTOreProcessingWidget> {
public final Material material;

public GTOreProcessingInfoWrapper(Material mat) {
super(new GTOreProcessingWidget(mat));
this.material = mat;
}

}
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package com.gregtechceu.gtceu.integration.rei;

import com.gregtechceu.gtceu.GTCEu;
import com.gregtechceu.gtceu.api.data.chemical.material.Material;
import com.gregtechceu.gtceu.api.item.tool.GTToolType;
import com.gregtechceu.gtceu.api.machine.MachineDefinition;
import com.gregtechceu.gtceu.api.recipe.GTRecipeType;
import com.gregtechceu.gtceu.api.registry.GTRegistries;
import com.gregtechceu.gtceu.common.data.GTMachines;
import com.gregtechceu.gtceu.integration.rei.multipage.MultiblockInfoDisplayCategory;
import com.gregtechceu.gtceu.integration.rei.oreprocessing.GTOreProcessingDisplayCategory;
import com.gregtechceu.gtceu.integration.rei.recipe.GTRecipeTypeDisplayCategory;
import me.shedaniel.rei.api.client.plugins.REIClientPlugin;
import me.shedaniel.rei.api.client.registry.category.CategoryRegistry;
Expand All @@ -28,6 +31,7 @@ public class GTREIPlugin implements REIClientPlugin {
@Override
public void registerCategories(CategoryRegistry registry) {
registry.add(new MultiblockInfoDisplayCategory());
registry.add(new GTOreProcessingDisplayCategory());
for (RecipeType<?> recipeType : BuiltInRegistries.RECIPE_TYPE) {
if (recipeType instanceof GTRecipeType gtRecipeType) {
registry.add(new GTRecipeTypeDisplayCategory(gtRecipeType));
Expand All @@ -36,6 +40,7 @@ public void registerCategories(CategoryRegistry registry) {
// workstations
MultiblockInfoDisplayCategory.registerWorkStations(registry);
GTRecipeTypeDisplayCategory.registerWorkStations(registry);
GTOreProcessingDisplayCategory.registerWorkstations(registry);
for (MachineDefinition definition : GTMachines.ELECTRIC_FURNACE) {
if (definition != null) {
registry.addWorkstations(SMELTING, EntryStacks.of(definition.asStack()));
Expand All @@ -51,6 +56,7 @@ public void registerCategories(CategoryRegistry registry) {
public void registerDisplays(DisplayRegistry registry) {
GTRecipeTypeDisplayCategory.registerDisplays(registry);
MultiblockInfoDisplayCategory.registerDisplays(registry);
GTOreProcessingDisplayCategory.registerDisplays(registry);
}

@Override
Expand Down
Loading

0 comments on commit 73e8fcf

Please sign in to comment.