Skip to content

Commit

Permalink
add simple washer
Browse files Browse the repository at this point in the history
  • Loading branch information
TechLord22 committed Aug 13, 2021
1 parent 807092a commit 664bd32
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/gregtech/api/recipes/RecipeMaps.java
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,11 @@ public class RecipeMaps {
.setSlotOverlay(true, true, GuiTextures.CENTRIFUGE_OVERLAY)
.setProgressBar(GuiTextures.PROGRESS_BAR_GAS_COLLECTOR, MoveType.HORIZONTAL);

public static final RecipeMap<SimpleRecipeBuilder> SIMPLE_WASHER_RECIPES = new RecipeMap<>("simple_washer", 1, 1, 1, 1, 1, 1, 0, 0, new SimpleRecipeBuilder(), true)
.setSlotOverlay(false, false, GuiTextures.CRUSHED_ORE_OVERLAY)
.setSlotOverlay(true, false, GuiTextures.DUST_OVERLAY)
.setProgressBar(GuiTextures.PROGRESS_BAR_BATH, MoveType.HORIZONTAL);

@ZenProperty
public static final FuelRecipeMap COMBUSTION_GENERATOR_FUELS = new FuelRecipeMap("combustion_generator");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ public class MetaTileEntities {
public static final SimpleMachineMetaTileEntity[] REPLICATOR = new SimpleMachineMetaTileEntity[GTValues.V.length - 1];
public static final SimpleMachineMetaTileEntity[] SCANNER = new SimpleMachineMetaTileEntity[GTValues.V.length - 1];
public static final SimpleMachineMetaTileEntity[] GAS_COLLECTOR = new SimpleMachineMetaTileEntity[GTValues.V.length - 1];
public static MetaTileEntitySimpleOreWasher SIMPLE_ORE_WASHER;

//GENERATORS SECTION
public static final SimpleGeneratorMetaTileEntity[] COMBUSTION_GENERATOR = new SimpleGeneratorMetaTileEntity[4];
Expand Down Expand Up @@ -625,6 +626,7 @@ public static void init() {
STEAM_EXPORT_BUS = GregTechAPI.registerMetaTileEntity(1650, new MetaTileEntitySteamItemBus(gregtechId("steam_export_bus"), true));
STEAM_IMPORT_BUS = GregTechAPI.registerMetaTileEntity(1651, new MetaTileEntitySteamItemBus(gregtechId("steam_import_bus"), false));
STEAM_HATCH = GregTechAPI.registerMetaTileEntity(1652, new MetaTileEntitySteamHatch(gregtechId("steam_hatch")));
SIMPLE_ORE_WASHER = GregTechAPI.registerMetaTileEntity(1653, new MetaTileEntitySimpleOreWasher(gregtechId("ore_washer.simple"), RecipeMaps.SIMPLE_WASHER_RECIPES, Textures.ORE_WASHER_OVERLAY, 0));

/*
* FOR ADDON DEVELOPERS:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package gregtech.common.metatileentities.electric;

import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.MetaTileEntityHolder;
import gregtech.api.metatileentity.SimpleMachineMetaTileEntity;
import gregtech.api.recipes.RecipeMap;
import gregtech.api.render.OrientedOverlayRenderer;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.items.IItemHandlerModifiable;
import net.minecraftforge.items.ItemStackHandler;
public class MetaTileEntitySimpleOreWasher extends SimpleMachineMetaTileEntity {

public MetaTileEntitySimpleOreWasher(ResourceLocation metaTileEntityId, RecipeMap<?> recipeMap, OrientedOverlayRenderer renderer, int tier) {
super(metaTileEntityId, recipeMap, renderer, tier, true);
initializeInventory();
}

@Override
protected IItemHandlerModifiable createExportItemHandler() {
return new ItemStackHandler(1);
}

@Override
public MetaTileEntity createMetaTileEntity(MetaTileEntityHolder holder) {
return new MetaTileEntitySimpleOreWasher(metaTileEntityId, workable.recipeMap, renderer, getTier());
}
}
18 changes: 18 additions & 0 deletions src/main/java/gregtech/loaders/oreprocessing/OreRecipeHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ public static void processCrushedOre(OrePrefix crushedPrefix, Material material,
OreDictUnifier.get(OrePrefix.dust, Materials.Stone))
.buildAndRegister();

RecipeMaps.SIMPLE_WASHER_RECIPES.recipeBuilder()
.input(crushedPrefix, material)
.fluidInputs(Materials.Water.getFluid(100))
.outputs(crushedPurifiedOre)
.duration(8).EUt(1).buildAndRegister();

RecipeMaps.ORE_WASHER_RECIPES.recipeBuilder()
.input(crushedPrefix, material)
.fluidInputs(Materials.DistilledWater.getFluid(1000))
Expand Down Expand Up @@ -224,6 +230,12 @@ public static void processCrushedPurified(OrePrefix purifiedPrefix, Material mat
.EUt(12)
.buildAndRegister();

RecipeMaps.SIMPLE_WASHER_RECIPES.recipeBuilder()
.input(purifiedPrefix, material)
.fluidInputs(Materials.Water.getFluid(100))
.outputs(dustStack)
.duration(8).EUt(1).buildAndRegister();

ModHandler.addShapelessRecipe(String.format("purified_ore_to_dust_%s", material), dustStack,
'h', new UnificationEntry(purifiedPrefix, material));

Expand Down Expand Up @@ -289,6 +301,12 @@ public static void processDirtyDust(OrePrefix dustPrefix, Material material, Ore

builder.buildAndRegister();

RecipeMaps.SIMPLE_WASHER_RECIPES.recipeBuilder()
.input(dustPrefix, material)
.fluidInputs(Materials.Water.getFluid(100))
.outputs(dustStack)
.duration(8).EUt(1).buildAndRegister();

//dust gains same amount of material as normal dust
processMetalSmelting(dustPrefix, material, property);
}
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/assets/gregtech/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -2704,6 +2704,9 @@ gregtech.machine.ore_washer.uiv.name=High-Tech Ore Washing Plant III
gregtech.machine.ore_washer.umv.name=High-Tech Ore Washing Plant IV
gregtech.machine.ore_washer.uxv.name=Ultimate Ore Washing Plant

gregtech.machine.ore_washer.simple.name=Simple Ore Washing Plant
gregtech.machine.ore_washer.simple.tooltip=It's like an automatic Cauldron for Washing. Grants no Byproducts, but it is fast.

gregtech.machine.packer.tooltip=Puts things into Boxes

gregtech.machine.packer.lv.name=Basic Packager
Expand Down

0 comments on commit 664bd32

Please sign in to comment.