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

Allow Simple Washers to clean Purified Dusts, adds LV/HV/IV/ZPM Simple Washers #783

Merged
merged 7 commits into from
Nov 20, 2023
85 changes: 24 additions & 61 deletions src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import static gregtech.api.enums.Mods.Railcraft;
import static gregtech.api.enums.Mods.RemoteIO;

import java.util.List;

import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
Expand All @@ -17,6 +19,7 @@

import com.github.technus.tectech.recipe.TT_recipeAdder;
import com.github.technus.tectech.thing.CustomItemList;
import com.google.common.collect.ImmutableList;

import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
Expand Down Expand Up @@ -1686,68 +1689,28 @@ private static void runModRecipes() {
}

if (CORE.ConfigSwitches.enableMachine_SimpleWasher) {
ItemStack plateWrought = ItemUtils.getItemStackOfAmountFromOreDict("plateWroughtIron", 1);
ItemStack washerPipe;

if (CORE.ConfigSwitches.enableCustom_Pipes) {
washerPipe = ItemUtils.getItemStackOfAmountFromOreDict("pipeLargeClay", 1);
RecipeUtils.addShapedGregtechRecipe(
plateWrought,
CI.electricPump_LV,
plateWrought,
plateWrought,
washerPipe,
plateWrought,
plateWrought,
CI.machineCasing_ULV,
plateWrought,
GregtechItemList.SimpleDustWasher_ULV.get(1));
}
// Add Recipe
washerPipe = ItemUtils.getItemStackOfAmountFromOreDict("pipeLargeCopper", 1);
RecipeUtils.addShapedGregtechRecipe(
plateWrought,
CI.electricPump_LV,
plateWrought,
plateWrought,
washerPipe,
plateWrought,
plateWrought,
CI.machineCasing_ULV,
plateWrought,
GregtechItemList.SimpleDustWasher_ULV.get(1));

int aSimpleWasherTier = 2;
int aSlot = 0;
ItemStack[][] aInputsForSimpleWashers = new ItemStack[4][6];

aInputsForSimpleWashers[0] = new ItemStack[] { CI.getTieredMachineHull(2),
CI.getTieredComponent(OrePrefixes.screw, 2, 8), CI.getTieredComponent(OrePrefixes.plate, 1, 4),
CI.getTieredComponent(OrePrefixes.rod, 2, 2), CI.getTieredComponent(OrePrefixes.circuit, 2, 1), };
aInputsForSimpleWashers[1] = new ItemStack[] { CI.getTieredMachineHull(4),
CI.getTieredComponent(OrePrefixes.screw, 4, 12), CI.getTieredComponent(OrePrefixes.plate, 3, 6),
CI.getTieredComponent(OrePrefixes.rod, 4, 3), CI.getTieredComponent(OrePrefixes.circuit, 4, 2), };
aInputsForSimpleWashers[2] = new ItemStack[] { CI.getTieredMachineHull(6),
CI.getTieredComponent(OrePrefixes.screw, 6, 24), CI.getTieredComponent(OrePrefixes.plate, 5, 8),
CI.getTieredComponent(OrePrefixes.rod, 6, 4), CI.getTieredComponent(OrePrefixes.circuit, 6, 3), };
aInputsForSimpleWashers[3] = new ItemStack[] { CI.getTieredMachineHull(8),
CI.getTieredComponent(OrePrefixes.screw, 8, 32), CI.getTieredComponent(OrePrefixes.plate, 7, 16),
CI.getTieredComponent(OrePrefixes.rod, 8, 5), CI.getTieredComponent(OrePrefixes.circuit, 8, 4), };

ItemStack[] aSimpleWashers = new ItemStack[] { GregtechItemList.SimpleDustWasher_MV.get(1),
GregtechItemList.SimpleDustWasher_EV.get(1), GregtechItemList.SimpleDustWasher_LuV.get(1),
GregtechItemList.SimpleDustWasher_UV.get(1) };
for (int i = 0; i < 4; i++) {

final List<ItemStack> washers = ImmutableList.of(
GregtechItemList.SimpleDustWasher_LV.get(1),
GregtechItemList.SimpleDustWasher_MV.get(1),
GregtechItemList.SimpleDustWasher_HV.get(1),
GregtechItemList.SimpleDustWasher_EV.get(1),
GregtechItemList.SimpleDustWasher_IV.get(1),
GregtechItemList.SimpleDustWasher_LuV.get(1),
GregtechItemList.SimpleDustWasher_ZPM.get(1),
GregtechItemList.SimpleDustWasher_UV.get(1));

for (int i = 0; i < washers.size(); i++) {
final int tier = i + 1;
CORE.RA.addSixSlotAssemblingRecipe(
aInputsForSimpleWashers[aSlot],
CI.getTieredFluid(aSimpleWasherTier, 144 * aSimpleWasherTier),
aSimpleWashers[aSlot],
20 * 15 * aSimpleWasherTier,
(int) GT_Values.V[aSimpleWasherTier]);

aSimpleWasherTier += 2;
aSlot++;
new ItemStack[] { CI.getTieredMachineHull(tier),
CI.getTieredComponent(OrePrefixes.screw, tier, tier * 4),
CI.getTieredComponent(OrePrefixes.plate, tier - 1, tier * 2),
CI.getTieredComponent(OrePrefixes.rod, tier, tier),
CI.getTieredComponent(OrePrefixes.circuit, tier, 1) },
CI.getTieredFluid(tier, 144 * tier),
washers.get(i),
20 * 5 * tier,
(int) GT_Values.V[tier]);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,11 @@ public enum GregtechItemList implements GregtechItemContainer {
Cover_Overflow_Item_IV,

// ----------------------------------------------------------------------------
// Additional washers
SimpleDustWasher_LV,
SimpleDustWasher_HV,
SimpleDustWasher_IV,
SimpleDustWasher_ZPM,

;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package gtPlusPlus.xmod.gregtech.registration.gregtech;

import java.util.List;

import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;

import com.github.bartimaeusnek.bartworks.system.material.Werkstoff;
import com.google.common.collect.ImmutableList;

import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
Expand All @@ -12,6 +15,7 @@
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_GT_Recipe.SpecialEffects;
import gregtech.api.util.GTPP_Recipe;
import gregtech.api.util.GT_OreDictUnificator;
import gtPlusPlus.api.objects.data.Quad;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
Expand All @@ -23,88 +27,60 @@ public static void run() {
generateDirtyDustRecipes();
generateDirtyCrushedRecipes();
// Register the Simple Washer Entity.
GregtechItemList.SimpleDustWasher_ULV.set(
new GT_MetaTileEntity_BasicMachine_GT_Recipe(
767,
"simplewasher.01.tier.01",
"Simple Washer I",
0,
new String[] { "It's like an automatic Cauldron for washing dusts.",
CORE.GT_Tooltip.get() },
GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes,
1,
1,
true,
SoundResource.NONE,
false,
false,
SpecialEffects.NONE,
"SIMPLE_WASHER",
null).getStackForm(1L));

// People want them in higher tiers apparently
GregtechItemList.SimpleDustWasher_MV.set(
new GT_MetaTileEntity_BasicMachine_GT_Recipe(
// The unlocalized names here have inconsistent numbering because there only used to be a simple washer
// every other tier, and they were numbered numerically. In order to maintain backwards compatibility,
// the tier numbers need to stay as they were.
List<Quad<GregtechItemList, Integer, String, String>> washers = ImmutableList.of(
new Quad<>(
GregtechItemList.SimpleDustWasher_LV,
31790,
"simplewasher.01.tier.06",
"Simple Washer I"),
new Quad<>(
GregtechItemList.SimpleDustWasher_MV,
31017,
"simplewasher.01.tier.02",
"Simple Washer II",
2,
new String[] { "It's like an automatic Cauldron for washing dusts.",
CORE.GT_Tooltip.get() },
GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes,
1,
1,
true,
SoundResource.NONE,
false,
false,
SpecialEffects.NONE,
"SIMPLE_WASHER",
null).getStackForm(1L));
GregtechItemList.SimpleDustWasher_EV.set(
new GT_MetaTileEntity_BasicMachine_GT_Recipe(
"Simple Washer II"),
new Quad<>(
GregtechItemList.SimpleDustWasher_HV,
31791,
"simplewasher.01.tier.07",
"Simple Washer III"),
new Quad<>(
GregtechItemList.SimpleDustWasher_EV,
31018,
"simplewasher.01.tier.03",
"Simple Washer III",
4,
new String[] { "It's like an automatic Cauldron for washing dusts.",
CORE.GT_Tooltip.get() },
GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes,
1,
1,
true,
SoundResource.NONE,
false,
false,
SpecialEffects.NONE,
"SIMPLE_WASHER",
null).getStackForm(1L));
GregtechItemList.SimpleDustWasher_LuV.set(
new GT_MetaTileEntity_BasicMachine_GT_Recipe(
"Simple Washer IV"),
new Quad<>(
GregtechItemList.SimpleDustWasher_IV,
31792,
"simplewasher.01.tier.08",
"Simple Washer V"),
new Quad<>(
GregtechItemList.SimpleDustWasher_LuV,
31019,
"simplewasher.01.tier.04",
"Simple Washer IV",
6,
new String[] { "It's like an automatic Cauldron for washing dusts.",
CORE.GT_Tooltip.get() },
GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes,
1,
1,
true,
SoundResource.NONE,
false,
false,
SpecialEffects.NONE,
"SIMPLE_WASHER",
null).getStackForm(1L));
GregtechItemList.SimpleDustWasher_UV.set(
new GT_MetaTileEntity_BasicMachine_GT_Recipe(
"Simple Washer VI"),
new Quad<>(
GregtechItemList.SimpleDustWasher_ZPM,
31793,
"simplewasher.01.tier.09",
"Simple Washer VII"),
new Quad<>(
GregtechItemList.SimpleDustWasher_UV,
31020,
"simplewasher.01.tier.05",
"Simple Washer V",
8,
"Simple Washer VIII"));

GregtechItemList.SimpleDustWasher_ULV.set(
new GT_MetaTileEntity_BasicMachine_GT_Recipe(
767,
"simplewasher.01.tier.01",
"Deprecated ULV Simple Washer",
0,
new String[] { "It's like an automatic Cauldron for washing dusts.",
CORE.GT_Tooltip.get() },
"§cDEPRECATED: No recipe.§r Make a Simple Washer I.", CORE.GT_Tooltip.get() },
GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes,
1,
1,
Expand All @@ -115,6 +91,28 @@ public static void run() {
SpecialEffects.NONE,
"SIMPLE_WASHER",
null).getStackForm(1L));

for (int i = 0; i < washers.size(); i++) {
Quad<GregtechItemList, Integer, String, String> washer = washers.get(i);
washer.getKey().set(
new GT_MetaTileEntity_BasicMachine_GT_Recipe(
washer.getValue_1(),
washer.getValue_2(),
washer.getValue_3(),
i + 1,
new String[] { "It's like an automatic Cauldron for washing dusts.",
CORE.GT_Tooltip.get() },
GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes,
1,
1,
true,
SoundResource.NONE,
false,
false,
SpecialEffects.NONE,
"SIMPLE_WASHER",
null).getStackForm(1L));
}
}
}

Expand All @@ -123,6 +121,7 @@ private static boolean generateDirtyDustRecipes() {
// Generate Recipe Map for the Dust Washer.
ItemStack dustClean;
ItemStack dustDirty;
ItemStack dustPure;
for (Materials v : Materials.values()) {
if (v == Materials.Platinum || v == Materials.Osmium
|| v == Materials.Iridium
Expand All @@ -132,13 +131,17 @@ private static boolean generateDirtyDustRecipes() {

dustClean = GT_OreDictUnificator.get(OrePrefixes.dust, v, 1L);
dustDirty = GT_OreDictUnificator.get(OrePrefixes.dustImpure, v, 1L);
dustPure = GT_OreDictUnificator.get(OrePrefixes.dustPure, v, 1L);
addSimpleWashRecipe(dustDirty, dustClean);
addSimpleWashRecipe(dustPure, dustClean);
}

for (Werkstoff v : Werkstoff.werkstoffHashSet) {
dustClean = v.hasItemType(OrePrefixes.dust) ? v.get(OrePrefixes.dust) : null;
dustDirty = v.hasItemType(OrePrefixes.dustImpure) ? v.get(OrePrefixes.dustImpure) : null;
dustPure = v.hasItemType(OrePrefixes.dustPure) ? v.get(OrePrefixes.dustPure) : null;
addSimpleWashRecipe(dustDirty, dustClean);
addSimpleWashRecipe(dustPure, dustClean);
}

return GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes.mRecipeList.size() > mRecipeCount;
Expand Down