Skip to content

Commit

Permalink
Edited recipes of all MultiPart hatch/buses (#1791)
Browse files Browse the repository at this point in the history
  • Loading branch information
YoungOnionMC authored Aug 20, 2024
1 parent 6be610a commit cbd624b
Show file tree
Hide file tree
Showing 3 changed files with 162 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ public static BiConsumer<ItemStack, List<Component>> createCreativeTooltips(bool
.tooltipBuilder(CHEST_TOOLTIPS)
.tooltips(Component.translatable("gtceu.machine.quantum_chest.tooltip"),
Component.translatable("gtceu.universal.tooltip.item_storage_total",
FormattingUtil.formatNumbers(4000000L * (long) Math.pow(2, tier))))
FormattingUtil.formatNumbers(4000000L * (long) Math.pow(2, tier - 1))))
.compassNode("super_chest")
.register(),
LOW_TIERS);
Expand All @@ -672,7 +672,7 @@ public static BiConsumer<ItemStack, List<Component>> createCreativeTooltips(bool
.tooltips(Component.translatable("gtceu.machine.quantum_chest.tooltip"),
Component.translatable("gtceu.universal.tooltip.item_storage_total",
/* tier == GTValues.UHV ? Integer.MAX_VALUE : */ FormattingUtil
.formatNumbers(4000000L * (long) Math.pow(2, tier))))
.formatNumbers(4000000L * (long) Math.pow(2, tier - 1))))
.compassNode("super_chest")
.register(),
HIGH_TIERS);
Expand Down Expand Up @@ -708,7 +708,7 @@ public static BiConsumer<ItemStack, List<Component>> createTankTooltips(String n
.tooltipBuilder(createTankTooltips("stored", null))
.tooltips(Component.translatable("gtceu.machine.quantum_tank.tooltip"),
Component.translatable("gtceu.universal.tooltip.fluid_storage_capacity",
FormattingUtil.formatNumbers(4000000L * (long) Math.pow(2, tier))))
FormattingUtil.formatNumbers(4000000L * (long) Math.pow(2, tier - 1))))
.compassNode("super_tank")
.register(),
LOW_TIERS);
Expand All @@ -727,7 +727,7 @@ public static BiConsumer<ItemStack, List<Component>> createTankTooltips(String n
.tooltips(Component.translatable("gtceu.machine.quantum_tank.tooltip"),
Component.translatable("gtceu.universal.tooltip.fluid_storage_capacity",
/* tier == GTValues.UHV ? Integer.MAX_VALUE : */ FormattingUtil
.formatNumbers(4000000L * (long) Math.pow(2, tier))))
.formatNumbers(4000000L * (long) Math.pow(2, tier - 1))))
.compassNode("super_tank")
.register(),
HIGH_TIERS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ public class CraftingComponent {
public static Component POWER_COMPONENT;
public static Component VOLTAGE_COIL;
public static Component SPRING;
public static Component CRATE;
public static Component DRUM;
public static Component FRAME;

public static final Map<BlastProperty.GasTier, FluidIngredient> EBF_GASES = new EnumMap<>(
BlastProperty.GasTier.class);
Expand Down Expand Up @@ -876,6 +879,45 @@ public static void initializeComponents() {
{ 9, new UnificationEntry(TagPrefix.spring, GTMaterials.Europium) },

}).collect(Collectors.toMap(data -> (Integer) data[0], data -> data[1])));

CRATE = new Component(Stream.of(new Object[][] {
{ 0, new ItemStack(Blocks.CHEST) },
{ 1, GTMachines.WOODEN_CRATE.asStack() },
{ 2, GTMachines.BRONZE_CRATE.asStack() },
{ 3, GTMachines.STEEL_CRATE.asStack() },
{ 4, GTMachines.ALUMINIUM_CRATE.asStack() },
{ 5, GTMachines.STAINLESS_STEEL_CRATE.asStack() },
{ 6, GTMachines.TITANIUM_CRATE.asStack() },
{ 7, GTMachines.TUNGSTENSTEEL_CRATE.asStack() },
{ 8, GTMachines.SUPER_CHEST[1].asStack() },
{ FALLBACK, GTMachines.SUPER_CHEST[1].asStack() },
}).collect(Collectors.toMap(data -> (Integer) data[0], data -> data[1])));

DRUM = new Component(Stream.of(new Object[][] {
{ 0, new ItemStack(Blocks.GLASS) },
{ 1, GTMachines.WOODEN_DRUM.asStack() },
{ 2, GTMachines.BRONZE_DRUM.asStack() },
{ 3, GTMachines.STEEL_DRUM.asStack() },
{ 4, GTMachines.ALUMINIUM_DRUM.asStack() },
{ 5, GTMachines.STAINLESS_STEEL_DRUM.asStack() },
{ 6, GTMachines.TITANIUM_DRUM.asStack() },
{ 7, GTMachines.TUNGSTENSTEEL_DRUM.asStack() },
{ 8, GTMachines.SUPER_TANK[1].asStack() },
{ FALLBACK, GTMachines.SUPER_TANK[1].asStack() },
}).collect(Collectors.toMap(data -> (Integer) data[0], data -> data[1])));

FRAME = new Component(Stream.of(new Object[][] {
{ 0, new UnificationEntry(TagPrefix.frameGt, GTMaterials.Wood) },
{ 1, new UnificationEntry(TagPrefix.frameGt, GTMaterials.Steel) },
{ 2, new UnificationEntry(TagPrefix.frameGt, GTMaterials.Aluminium) },
{ 3, new UnificationEntry(TagPrefix.frameGt, GTMaterials.StainlessSteel) },
{ 4, new UnificationEntry(TagPrefix.frameGt, GTMaterials.Titanium) },
{ 5, new UnificationEntry(TagPrefix.frameGt, GTMaterials.TungstenSteel) },
{ 6, new UnificationEntry(TagPrefix.frameGt, GTMaterials.Ruridit) },
{ 7, new UnificationEntry(TagPrefix.frameGt, GTMaterials.Iridium) },
{ 8, new UnificationEntry(TagPrefix.frameGt, GTMaterials.NaquadahAlloy) },
{ FALLBACK, new UnificationEntry(TagPrefix.frameGt, GTMaterials.NaquadahAlloy) },
}).collect(Collectors.toMap(data -> (Integer) data[0], data -> data[1])));
}

public static class Component {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
import com.gregtechceu.gtceu.api.data.chemical.material.stack.UnificationEntry;
import com.gregtechceu.gtceu.api.data.tag.TagPrefix;
import com.gregtechceu.gtceu.api.machine.MachineDefinition;
import com.gregtechceu.gtceu.common.data.GTBlocks;
import com.gregtechceu.gtceu.common.data.GTItems;
import com.gregtechceu.gtceu.common.data.GTMachines;
import com.gregtechceu.gtceu.common.data.GTMaterials;
import com.gregtechceu.gtceu.common.data.*;
import com.gregtechceu.gtceu.config.ConfigHolder;
import com.gregtechceu.gtceu.data.recipe.CustomTags;
import com.gregtechceu.gtceu.data.recipe.VanillaRecipeHelper;
Expand Down Expand Up @@ -876,20 +873,123 @@ public static void init(Consumer<FinishedRecipe> provider) {

registerMachineRecipe(provider, GTMachines.CHARGER_4, "WTW", "WMW", "BCB", 'M', HULL, 'W', WIRE_QUAD, 'T',
CustomTags.WOODEN_CHESTS, 'B', CABLE, 'C', CIRCUIT);
registerMachineRecipe(provider, GTMachines.FLUID_IMPORT_HATCH, " G", " M", 'M', HULL, 'G', GLASS);
registerMachineRecipe(provider, GTMachines.FLUID_EXPORT_HATCH, " M", " G", 'M', HULL, 'G', GLASS);

registerMachineRecipe(provider, GTMachines.ITEM_IMPORT_BUS, " C", " M", 'M', HULL, 'C',
CustomTags.WOODEN_CHESTS);
registerMachineRecipe(provider, GTMachines.ITEM_EXPORT_BUS, " M", " C", 'M', HULL, 'C',
CustomTags.WOODEN_CHESTS);
Material[] fluidMap = new Material[] { GTMaterials.Glue, GTMaterials.Polyethylene,
GTMaterials.Polytetrafluoroethylene, GTMaterials.Polybenzimidazole };

for (var machine : GTMachines.FLUID_IMPORT_HATCH) {
int tier = machine.getTier();
int j = Math.min(fluidMap.length - 1, tier / 2);
for (; j < fluidMap.length; j++) {
int fluidAmount = GTValues.L * 2 * (tier + 1);
GTRecipeTypes.ASSEMBLER_RECIPES
.recipeBuilder("fluid_hatch_" + VN[tier].toLowerCase() + "_" + fluidMap[j].getName())
.inputItems((ItemStack) HULL.getIngredient(tier))
.inputItems((ItemStack) DRUM.getIngredient(tier))
.circuitMeta(1)
.inputFluids(fluidMap[j].getFluid(fluidAmount >> j))
.outputItems(machine)
.duration(300)
.EUt(VA[tier])
.save(provider);
}
}

for (var machine : GTMachines.FLUID_EXPORT_HATCH) {
int tier = machine.getTier();
int j = Math.min(fluidMap.length - 1, tier / 2);
for (; j < fluidMap.length; j++) {
int fluidAmount = GTValues.L * 2 * (tier + 1);
GTRecipeTypes.ASSEMBLER_RECIPES
.recipeBuilder("fluid_export_hatch_" + VN[tier].toLowerCase() + "_" + fluidMap[j].getName())
.inputItems((ItemStack) HULL.getIngredient(tier))
.inputItems((ItemStack) DRUM.getIngredient(tier))
.circuitMeta(2)
.inputFluids(fluidMap[j].getFluid(fluidAmount >> j))
.outputItems(machine)
.duration(300)
.EUt(VA[tier])
.save(provider);
}
}

for (var machine : GTMachines.ITEM_IMPORT_BUS) {
int tier = machine.getTier();
int j = Math.min(fluidMap.length - 1, tier / 2);
for (; j < fluidMap.length; j++) {
int fluidAmount = GTValues.L * 2 * (tier + 1);
GTRecipeTypes.ASSEMBLER_RECIPES
.recipeBuilder("item_import_bus_" + VN[tier].toLowerCase() + "_" + fluidMap[j].getName())
.inputItems((ItemStack) HULL.getIngredient(tier))
.inputItems((ItemStack) CRATE.getIngredient(tier))
.circuitMeta(1)
.inputFluids(fluidMap[j].getFluid(fluidAmount >> j))
.outputItems(machine)
.duration(300)
.EUt(VA[tier])
.save(provider);
}
}

registerMachineRecipe(provider, GTMachines.DUAL_IMPORT_HATCH, "PG", "CM", 'P', PIPE_NONUPLE, 'M', HULL, 'G',
GLASS,
'C', CustomTags.WOODEN_CHESTS);
registerMachineRecipe(provider, GTMachines.DUAL_EXPORT_HATCH, "MG", "CP", 'P', PIPE_NONUPLE, 'M', HULL, 'G',
GLASS,
'C', CustomTags.WOODEN_CHESTS);
for (var machine : GTMachines.ITEM_EXPORT_BUS) {
int tier = machine.getTier();
int j = Math.min(fluidMap.length - 1, tier / 2);
for (; j < fluidMap.length; j++) {
int fluidAmount = GTValues.L * 2 * (tier + 1);
GTRecipeTypes.ASSEMBLER_RECIPES
.recipeBuilder("item_export_bus_" + VN[tier].toLowerCase() + "_" + fluidMap[j].getName())
.inputItems((ItemStack) HULL.getIngredient(tier))
.inputItems((ItemStack) CRATE.getIngredient(tier))
.circuitMeta(2)
.inputFluids(fluidMap[j].getFluid(fluidAmount >> j))
.outputItems(machine)
.duration(300)
.EUt(VA[tier])
.save(provider);
}
}

for (var machine : GTMachines.DUAL_IMPORT_HATCH) {
if (machine == null) continue;
int tier = machine.getTier();
int j = Math.min(fluidMap.length - 1, tier / 2);
for (; j < fluidMap.length; j++) {
int fluidAmount = GTValues.L * 8 * (tier + 1);
GTRecipeTypes.ASSEMBLER_RECIPES
.recipeBuilder("dual_import_bus_" + VN[tier].toLowerCase() + "_" + fluidMap[j].getName())
.inputItems(GTMachines.ITEM_IMPORT_BUS[tier])
.inputItems(GTMachines.FLUID_IMPORT_HATCH[tier])
.inputItems((UnificationEntry) PIPE_NONUPLE.getIngredient(tier))
.inputItems((UnificationEntry) FRAME.getIngredient(tier), 3)
.circuitMeta(1)
.inputFluids(fluidMap[j].getFluid(fluidAmount >> j))
.outputItems(machine)
.duration(300)
.EUt(VA[tier])
.save(provider);
}
}

for (var machine : GTMachines.DUAL_EXPORT_HATCH) {
if (machine == null) continue;
int tier = machine.getTier();
int j = Math.min(fluidMap.length - 1, tier / 2);
for (; j < fluidMap.length; j++) {
int fluidAmount = GTValues.L * 8 * (tier + 1);
GTRecipeTypes.ASSEMBLER_RECIPES
.recipeBuilder("dual_export_bus_" + VN[tier].toLowerCase() + "_" + fluidMap[j].getName())
.inputItems(GTMachines.ITEM_IMPORT_BUS[tier])
.inputItems(GTMachines.FLUID_IMPORT_HATCH[tier])
.inputItems((UnificationEntry) PIPE_NONUPLE.getIngredient(tier))
.inputItems((UnificationEntry) FRAME.getIngredient(tier), 3)
.circuitMeta(2)
.inputFluids(fluidMap[j].getFluid(fluidAmount >> j))
.outputItems(machine)
.duration(300)
.EUt(VA[tier])
.save(provider);
}
}

VanillaRecipeHelper.addShapedRecipe(provider, true, "wooden_crate", GTMachines.WOODEN_CRATE.asStack(), "RPR",
"PsP", "RPR", 'P', ItemTags.PLANKS, 'R', new UnificationEntry(TagPrefix.screw, GTMaterials.Iron));
Expand Down

0 comments on commit cbd624b

Please sign in to comment.