Skip to content

Commit

Permalink
Yeet sand drops
Browse files Browse the repository at this point in the history
  • Loading branch information
Irgendwer01 authored and serenibyss committed Nov 25, 2023
1 parent fd4edf7 commit c7637d3
Show file tree
Hide file tree
Showing 35 changed files with 4 additions and 167 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,11 @@ public class ExNihiloModule extends IntegrationSubmodule {
public static OrePrefix oreChunk;
public static OrePrefix oreEnderChunk;
public static OrePrefix oreNetherChunk;
public static OrePrefix oreSandyChunk;

// Icon Types

public static MaterialIconType oreChunkIcon;
public static MaterialIconType oreEnderChunkIcon;
public static MaterialIconType oreNetherChunkIcon;
public static MaterialIconType oreSandyChunkIcon;

@Nonnull
@Override
Expand Down Expand Up @@ -113,19 +110,17 @@ public static void registerMaterials(MaterialEvent event) {
oreChunkIcon = new MaterialIconType("oreChunk");
oreEnderChunkIcon = new MaterialIconType("oreEnderChunk");
oreNetherChunkIcon = new MaterialIconType("oreNetherChunk");
oreSandyChunkIcon = new MaterialIconType("oreSandyChunk");


oreChunk = new OrePrefix("oreChunk", -1, null, oreChunkIcon, ENABLE_UNIFICATION, hasOreProperty);
oreEnderChunk = new OrePrefix("oreEnderChunk", -1, null, oreEnderChunkIcon, ENABLE_UNIFICATION, hasOreProperty);
oreNetherChunk = new OrePrefix("oreNetherChunk", -1, null, oreNetherChunkIcon, ENABLE_UNIFICATION, hasOreProperty);
oreSandyChunk = new OrePrefix("oreSandyChunk", -1, null, oreSandyChunkIcon, ENABLE_UNIFICATION, hasOreProperty);

oreChunk.setAlternativeOreName(OrePrefix.ore.name());
oreEnderChunk.setAlternativeOreName(OrePrefix.oreEndstone.name());
oreNetherChunk.setAlternativeOreName(OrePrefix.oreNetherrack.name());
oreSandyChunk.setAlternativeOreName(OrePrefix.ore.name());

MetaItems.addOrePrefix(oreChunk, oreEnderChunk, oreNetherChunk, oreSandyChunk);
MetaItems.addOrePrefix(oreChunk, oreEnderChunk, oreNetherChunk);
}

private void registerMetaTileEntities() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public static void registerHandlers() {
ExNihiloModule.oreChunk.addProcessingHandler(PropertyKey.ORE, ExNihiloRecipes::processChunk);
ExNihiloModule.oreEnderChunk.addProcessingHandler(PropertyKey.ORE, ExNihiloRecipes::processChunk);
ExNihiloModule.oreNetherChunk.addProcessingHandler(PropertyKey.ORE, ExNihiloRecipes::processChunk);
ExNihiloModule.oreSandyChunk.addProcessingHandler(PropertyKey.ORE, ExNihiloRecipes::processChunk);
}

private static void processChunk(OrePrefix orePrefix, Material material, OreProperty oreProperty) {
Expand All @@ -42,7 +41,6 @@ private static void processChunk(OrePrefix orePrefix, Material material, OreProp
if (oreProperty.getDirectSmeltResult() != null) {
smeltingMaterial = oreProperty.getDirectSmeltResult();
}

if (smeltingMaterial.hasProperty(PropertyKey.INGOT)) {
smeltStack = OreDictUnifier.get(OrePrefix.ingot, smeltingMaterial);
} else if (smeltingMaterial.hasProperty(PropertyKey.GEM)) {
Expand All @@ -60,7 +58,7 @@ public static void registerGTRecipes() {
ModHandler.addShapedRecipe("steam_sieve_steel", STEAM_SIEVE_STEEL.getStackForm(), "BPB", "WMW", "BBB", 'B', new UnificationEntry(OrePrefix.pipeSmallFluid, Materials.WroughtIron), 'M', STEAM_SIEVE_BRONZE.getStackForm(), 'W', new UnificationEntry(OrePrefix.plate, Materials.WroughtIron), 'P', new UnificationEntry(OrePrefix.plate, Materials.Steel));
}

// Has to be done in init phase because of ExNi registering outside of the Registry event
// Has to be done in init phase because of ExNi registering outside the Registry event
public static void registerExNihiloRecipes() {
// Mirror Ex Nihilo Sifter recipes to Sifter RecipeMap
for (SieveRecipe recipe : ExNihiloRegistryManager.SIEVE_REGISTRY.getRecipeList()) {
Expand All @@ -74,7 +72,7 @@ public static void registerExNihiloRecipes() {
if ((int) (siftable.getChance() * (float) Recipe.getMaxChancedValue()) >= Recipe.getMaxChancedValue()) {
builder.outputs(siftable.getDrop().getItemStack());
} else {
builder.chancedOutput(siftable.getDrop().getItemStack(), (int) (siftable.getChance() * (float) Recipe.getMaxChancedValue()), 500);
builder.chancedOutput(siftable.getDrop().getItemStack(), (int) (siftable.getChance() * (float) Recipe.getMaxChancedValue()), 200);
}
}
builder.buildAndRegister();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,16 @@
import exnihilocreatio.registries.types.Siftable;
import exnihilocreatio.util.ItemInfo;
import gregtech.api.unification.material.Material;
import gregtech.api.unification.ore.OrePrefix;
import gregtech.common.blocks.MetaBlocks;
import gregtech.integration.exnihilo.ExNihiloConfig;
import gregtech.integration.exnihilo.ExNihiloModule;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.NonNullList;

import javax.annotation.Nonnull;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class SieveDrops {

private static Map<SieveDropType, List<SieveDrop>> SIEVE_DROPS_MAP = new HashMap<>();
public static void registerRecipes() {
NonNullList<Siftable> siftable = NonNullList.create();
if (ExNihiloConfig.overrideAllSiftDrops) {
Expand All @@ -47,35 +39,6 @@ public static void registerRecipes() {
}
}

// TODO Move away from valueOf for GTCEu
private enum SieveDropType implements IStringSerializable {
SAND("sand", ExNihiloModule.oreSandyChunk),
GRAVEL("gravel", ExNihiloModule.oreChunk),
NETHERRACK("nether", ExNihiloModule.oreNetherChunk),
END("end", ExNihiloModule.oreEnderChunk),
GRANITE("crushedGranite", ExNihiloModule.oreChunk),
DIORITE("crushedDiorite", ExNihiloModule.oreChunk),
ANDESITE("crushedAndesite", ExNihiloModule.oreChunk);

private final String name;
private final OrePrefix prefix;

SieveDropType(String name, OrePrefix prefix) {
this.name = name;
this.prefix = prefix;
}

@Override
@Nonnull
public String getName() {
return name;
}

public OrePrefix getPrefix() {
return prefix;
}
}

private static class SieveDrop {
public Material material;
public float chance;
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit c7637d3

Please sign in to comment.