From d785283c1cae22458f57b61a98d73c07c59888c6 Mon Sep 17 00:00:00 2001 From: YoungOnion <39562198+YoungOnionMC@users.noreply.github.com> Date: Tue, 19 Dec 2023 20:32:01 -0700 Subject: [PATCH 1/5] make small and tiny dusts a material flag and fix recipes that used them --- .../material/info/MaterialFlags.java | 8 +++++++ .../material/materials/ElementMaterials.java | 21 +++++++++++++------ .../materials/FirstDegreeMaterials.java | 12 ++++++----- .../materials/HigherDegreeMaterials.java | 2 +- .../materials/SecondDegreeMaterials.java | 8 +++---- .../UnknownCompositionMaterials.java | 4 ++-- .../api/unification/ore/OrePrefix.java | 4 ++-- 7 files changed, 39 insertions(+), 20 deletions(-) diff --git a/src/main/java/gregtech/api/unification/material/info/MaterialFlags.java b/src/main/java/gregtech/api/unification/material/info/MaterialFlags.java index 2bed36b06a4..88cdce577fe 100644 --- a/src/main/java/gregtech/api/unification/material/info/MaterialFlags.java +++ b/src/main/java/gregtech/api/unification/material/info/MaterialFlags.java @@ -198,6 +198,14 @@ public String toString() { .requireProps(PropertyKey.DUST) .build(); + public static final MaterialFlag GENERATE_SMALL_DUST = new MaterialFlag.Builder("small_dust") + .requireProps(PropertyKey.DUST) + .build(); + + public static final MaterialFlag GENERATE_TINY_DUST = new MaterialFlag.Builder("tiny_dust") + .requireProps(PropertyKey.DUST) + .build(); + ///////////////// // FLUID // ///////////////// diff --git a/src/main/java/gregtech/api/unification/material/materials/ElementMaterials.java b/src/main/java/gregtech/api/unification/material/materials/ElementMaterials.java index 8d4af1f4fa7..ec43d5e465c 100644 --- a/src/main/java/gregtech/api/unification/material/materials/ElementMaterials.java +++ b/src/main/java/gregtech/api/unification/material/materials/ElementMaterials.java @@ -146,6 +146,7 @@ public static void register() { .dust() .color(0x32323C).iconSet(SHINY) .element(Elements.Cd) + .flags(GENERATE_SMALL_DUST) .build(); Cerium = new Material.Builder(20, gregtechId("cerium")) @@ -153,6 +154,7 @@ public static void register() { .liquid(new FluidBuilder().temperature(1068)) .color(0x87917D).iconSet(METALLIC) .element(Elements.Ce) + .flags(GENERATE_SMALL_DUST) .build(); Chlorine = new Material.Builder(21, gregtechId("chlorine")) @@ -194,7 +196,7 @@ public static void register() { .ore() .color(0xFF6400).iconSet(SHINY) .flags(EXT_METAL, MORTAR_GRINDABLE, GENERATE_SPRING, GENERATE_SPRING_SMALL, GENERATE_FINE_WIRE, - GENERATE_DOUBLE_PLATE) + GENERATE_DOUBLE_PLATE, GENERATE_TINY_DUST) .element(Elements.Cu) .cableProperties(V[MV], 1, 2) .fluidPipeProperties(1696, 6, true) @@ -352,6 +354,7 @@ public static void register() { .liquid(new FluidBuilder().temperature(430)) .color(0x400080).iconSet(SHINY) .element(Elements.In) + .flags(GENERATE_SMALL_DUST) .build(); Iodine = new Material.Builder(49, gregtechId("iodine")) @@ -402,6 +405,7 @@ public static void register() { .liquid(new FluidBuilder().temperature(1193)) .color(0x5D7575).iconSet(METALLIC) .element(Elements.La) + .flags(GENERATE_SMALL_DUST) .build(); Lawrencium = new Material.Builder(54, gregtechId("lawrencium")) @@ -427,6 +431,7 @@ public static void register() { .ore() .color(0xBDC7DB) .element(Elements.Li) + .flags(GENERATE_TINY_DUST) .build(); Livermorium = new Material.Builder(57, gregtechId("livermorium")) @@ -491,7 +496,7 @@ public static void register() { Neodymium = new Material.Builder(66, gregtechId("neodymium")) .ingot().fluid().ore() .color(0x646464).iconSet(METALLIC) - .flags(STD_METAL, GENERATE_ROD, GENERATE_BOLT_SCREW) + .flags(STD_METAL, GENERATE_ROD, GENERATE_BOLT_SCREW, GENERATE_SMALL_DUST) .element(Elements.Nd) .rotorStats(7.0f, 2.0f, 512) .blast(1297, GasTier.MID) @@ -593,6 +598,7 @@ public static void register() { .dust() .color(0xFFFF00) .element(Elements.P) + .flags(GENERATE_SMALL_DUST) .build(); Polonium = new Material.Builder(79, gregtechId("polonium")) @@ -617,6 +623,7 @@ public static void register() { .ore(true) .color(0xF03232).iconSet(METALLIC) .element(Elements.Pu239) + .flags(GENERATE_TINY_DUST) .build(); Plutonium241 = new Material.Builder(82, gregtechId("plutonium_241")) @@ -632,6 +639,7 @@ public static void register() { .liquid(new FluidBuilder().temperature(337)) .color(0xBEDCFF).iconSet(METALLIC) .element(Elements.K) + .flags(GENERATE_TINY_DUST) .build(); Praseodymium = new Material.Builder(84, gregtechId("praseodymium")) @@ -706,7 +714,7 @@ public static void register() { .ingot() .liquid(new FluidBuilder().temperature(1345)) .color(0xFFFFCC).iconSet(METALLIC) - .flags(GENERATE_LONG_ROD) + .flags(GENERATE_LONG_ROD, GENERATE_SMALL_DUST) .element(Elements.Sm) .blast(b -> b .temp(5400, GasTier.HIGH) @@ -869,7 +877,7 @@ public static void register() { .ingot(3) .liquid(new FluidBuilder().temperature(1405)) .color(0x32F032).iconSet(METALLIC) - .flags(EXT_METAL) + .flags(EXT_METAL, GENERATE_TINY_DUST) .element(Elements.U238) .build(); @@ -877,7 +885,7 @@ public static void register() { .ingot(3) .liquid(new FluidBuilder().temperature(1405)) .color(0x46FA46).iconSet(SHINY) - .flags(EXT_METAL) + .flags(EXT_METAL, GENERATE_TINY_DUST) .element(Elements.U235) .build(); @@ -904,6 +912,7 @@ public static void register() { .color(0x76524C).iconSet(METALLIC) .element(Elements.Y) .blast(1799) + .flags(GENERATE_SMALL_DUST) .build(); Zinc = new Material.Builder(122, gregtechId("zinc")) @@ -953,7 +962,7 @@ public static void register() { .liquid(new FluidBuilder().customStill()) .color(0x1E1E1E).iconSet(SHINY) .flags(EXT_METAL, GENERATE_DOUBLE_PLATE, GENERATE_FOIL, GENERATE_GEAR, GENERATE_FINE_WIRE, - GENERATE_BOLT_SCREW) + GENERATE_BOLT_SCREW, GENERATE_TINY_DUST) .element(Elements.Nq2) .blast(b -> b .temp(9000, GasTier.HIGH) diff --git a/src/main/java/gregtech/api/unification/material/materials/FirstDegreeMaterials.java b/src/main/java/gregtech/api/unification/material/materials/FirstDegreeMaterials.java index c5136fc4a32..6053ff4b755 100644 --- a/src/main/java/gregtech/api/unification/material/materials/FirstDegreeMaterials.java +++ b/src/main/java/gregtech/api/unification/material/materials/FirstDegreeMaterials.java @@ -53,7 +53,7 @@ public static void register() { Ash = new Material.Builder(254, gregtechId("ash")) .dust(1) .color(0x969696) - .flags(DISABLE_DECOMPOSITION) + .flags(DISABLE_DECOMPOSITION, GENERATE_TINY_DUST) .components(Carbon, 1) .build(); @@ -81,7 +81,7 @@ public static void register() { Bone = new Material.Builder(258, gregtechId("bone")) .dust(1) .color(0xFAFAFA) - .flags(MORTAR_GRINDABLE, EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES) + .flags(MORTAR_GRINDABLE, EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES, GENERATE_TINY_DUST) .components(Calcium, 1) .build(); @@ -201,7 +201,7 @@ public static void register() { DarkAsh = new Material.Builder(275, gregtechId("dark_ash")) .dust(1) .color(0x323232) - .flags(DISABLE_DECOMPOSITION) + .flags(DISABLE_DECOMPOSITION, GENERATE_TINY_DUST) .components(Carbon, 1) .build(); @@ -830,7 +830,7 @@ public static void register() { .ingot(1) .liquid(new FluidBuilder().temperature(1511)) .color(0xA0A0A0) - .flags(STD_METAL, DECOMPOSITION_BY_CENTRIFUGING) + .flags(STD_METAL, DECOMPOSITION_BY_CENTRIFUGING, GENERATE_SMALL_DUST) .components(Arsenic, 1, Gallium, 1) .blast(b -> b.temp(1200, GasTier.LOW).blastStats(VA[MV], 1200)) .build(); @@ -938,6 +938,7 @@ public static void register() { .dust(1) .color(0xFF084E) .components(Potassium, 2, Chrome, 2, Oxygen, 7) + .flags(GENERATE_TINY_DUST) .build(); ChromiumTrioxide = new Material.Builder(368, gregtechId("chromium_trioxide")) @@ -950,6 +951,7 @@ public static void register() { .dust(1) .color(0xE6E6F0) .components(Antimony, 2, Oxygen, 3) + .flags(GENERATE_TINY_DUST) .build(); Zincite = new Material.Builder(370, gregtechId("zincite")) @@ -997,7 +999,7 @@ public static void register() { SodiumHydroxide = new Material.Builder(377, gregtechId("sodium_hydroxide")) .dust(1) .color(0x003380) - .flags(DISABLE_DECOMPOSITION) + .flags(DISABLE_DECOMPOSITION, GENERATE_TINY_DUST) .components(Sodium, 1, Oxygen, 1, Hydrogen, 1) .build(); diff --git a/src/main/java/gregtech/api/unification/material/materials/HigherDegreeMaterials.java b/src/main/java/gregtech/api/unification/material/materials/HigherDegreeMaterials.java index eae825e44d3..09a96cb38c6 100644 --- a/src/main/java/gregtech/api/unification/material/materials/HigherDegreeMaterials.java +++ b/src/main/java/gregtech/api/unification/material/materials/HigherDegreeMaterials.java @@ -158,7 +158,7 @@ public static void register() { Brick = new Material.Builder(2524, gregtechId("brick")) .dust() .color(0x9B5643).iconSet(ROUGH) - .flags(EXCLUDE_BLOCK_CRAFTING_RECIPES, NO_SMELTING, DECOMPOSITION_BY_CENTRIFUGING) + .flags(EXCLUDE_BLOCK_CRAFTING_RECIPES, NO_SMELTING, DECOMPOSITION_BY_CENTRIFUGING, GENERATE_SMALL_DUST) .components(Clay, 1) .build(); diff --git a/src/main/java/gregtech/api/unification/material/materials/SecondDegreeMaterials.java b/src/main/java/gregtech/api/unification/material/materials/SecondDegreeMaterials.java index aff4da9ac1f..8b14c7db774 100644 --- a/src/main/java/gregtech/api/unification/material/materials/SecondDegreeMaterials.java +++ b/src/main/java/gregtech/api/unification/material/materials/SecondDegreeMaterials.java @@ -22,7 +22,7 @@ public static void register() { .gem(0) .liquid(new FluidBuilder().temperature(1200).customStill()) .color(0xFAFAFA).iconSet(GLASS) - .flags(GENERATE_LENS, NO_SMASHING, EXCLUDE_BLOCK_CRAFTING_RECIPES, DECOMPOSITION_BY_CENTRIFUGING) + .flags(GENERATE_LENS, NO_SMASHING, EXCLUDE_BLOCK_CRAFTING_RECIPES, DECOMPOSITION_BY_CENTRIFUGING, GENERATE_SMALL_DUST, GENERATE_TINY_DUST) .components(SiliconDioxide, 1) .build(); @@ -145,7 +145,7 @@ public static void register() { TricalciumPhosphate = new Material.Builder(2015, gregtechId("tricalcium_phosphate")) .dust().ore(3, 1) .color(0xFFFF00).iconSet(FLINT) - .flags(NO_SMASHING, NO_SMELTING, FLAMMABLE, EXPLOSIVE, DECOMPOSITION_BY_CENTRIFUGING) + .flags(NO_SMASHING, NO_SMELTING, FLAMMABLE, EXPLOSIVE, DECOMPOSITION_BY_CENTRIFUGING, GENERATE_SMALL_DUST) .components(Calcium, 3, Phosphate, 2) .build(); @@ -381,7 +381,7 @@ public static void register() { Flint = new Material.Builder(2049, gregtechId("flint")) .gem(1) .color(0x002040).iconSet(FLINT) - .flags(NO_SMASHING, MORTAR_GRINDABLE, DECOMPOSITION_BY_CENTRIFUGING) + .flags(NO_SMASHING, MORTAR_GRINDABLE, DECOMPOSITION_BY_CENTRIFUGING, GENERATE_TINY_DUST) .components(SiliconDioxide, 1) .toolStats(ToolProperty.Builder.of(0.0F, 1.0F, 64, 1) .enchantability(5).ignoreCraftingTools() @@ -491,7 +491,7 @@ public static void register() { Clay = new Material.Builder(2063, gregtechId("clay")) .dust(1) .color(0xC8C8DC).iconSet(ROUGH) - .flags(MORTAR_GRINDABLE, EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES) + .flags(MORTAR_GRINDABLE, EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES, GENERATE_SMALL_DUST) .components(Sodium, 2, Lithium, 1, Aluminium, 2, Silicon, 2, Water, 6) .build(); diff --git a/src/main/java/gregtech/api/unification/material/materials/UnknownCompositionMaterials.java b/src/main/java/gregtech/api/unification/material/materials/UnknownCompositionMaterials.java index 2b8918b2abb..0017819d810 100644 --- a/src/main/java/gregtech/api/unification/material/materials/UnknownCompositionMaterials.java +++ b/src/main/java/gregtech/api/unification/material/materials/UnknownCompositionMaterials.java @@ -427,7 +427,7 @@ public static void register() { Stone = new Material.Builder(1599, gregtechId("stone")) .dust(2) .color(0xCDCDCD).iconSet(ROUGH) - .flags(MORTAR_GRINDABLE, GENERATE_GEAR, NO_SMASHING, NO_SMELTING) + .flags(MORTAR_GRINDABLE, GENERATE_GEAR, NO_SMASHING, NO_SMELTING, GENERATE_SMALL_DUST) .build(); Lava = new Material.Builder(1600, gregtechId("lava")) @@ -517,7 +517,7 @@ public static void register() { .wood() .color(0x896727).iconSet(WOOD) .flags(GENERATE_PLATE, GENERATE_ROD, GENERATE_BOLT_SCREW, GENERATE_LONG_ROD, GENERATE_GEAR, - GENERATE_FRAME) + GENERATE_FRAME, GENERATE_TINY_DUST, GENERATE_SMALL_DUST) .fluidPipeProperties(340, 5, false) .build(); diff --git a/src/main/java/gregtech/api/unification/ore/OrePrefix.java b/src/main/java/gregtech/api/unification/ore/OrePrefix.java index 30239988324..d175fe91aa0 100644 --- a/src/main/java/gregtech/api/unification/ore/OrePrefix.java +++ b/src/main/java/gregtech/api/unification/ore/OrePrefix.java @@ -115,10 +115,10 @@ public class OrePrefix { // 1/4th of a Dust. public static final OrePrefix dustSmall = new OrePrefix("dustSmall", M / 4, null, MaterialIconType.dustSmall, - ENABLE_UNIFICATION, hasDustProperty); + ENABLE_UNIFICATION, hasDustProperty.and(m -> m.hasFlag(GENERATE_SMALL_DUST))); // 1/9th of a Dust. public static final OrePrefix dustTiny = new OrePrefix("dustTiny", M / 9, null, MaterialIconType.dustTiny, - ENABLE_UNIFICATION, hasDustProperty); + ENABLE_UNIFICATION, hasDustProperty.and(m -> m.hasFlag(GENERATE_TINY_DUST))); // Dust with impurities. 1 Unit of Main Material and 1/9 - 1/4 Unit of secondary Material public static final OrePrefix dustImpure = new OrePrefix("dustImpure", M, null, MaterialIconType.dustImpure, ENABLE_UNIFICATION, hasOreProperty, From ad57be66d6120fa4a8625b40864d8458fa72a35e Mon Sep 17 00:00:00 2001 From: YoungOnion <39562198+YoungOnionMC@users.noreply.github.com> Date: Tue, 19 Dec 2023 20:38:51 -0700 Subject: [PATCH 2/5] spotless :lets: --- .../material/materials/SecondDegreeMaterials.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/gregtech/api/unification/material/materials/SecondDegreeMaterials.java b/src/main/java/gregtech/api/unification/material/materials/SecondDegreeMaterials.java index 8b14c7db774..5144e15f6cd 100644 --- a/src/main/java/gregtech/api/unification/material/materials/SecondDegreeMaterials.java +++ b/src/main/java/gregtech/api/unification/material/materials/SecondDegreeMaterials.java @@ -22,7 +22,8 @@ public static void register() { .gem(0) .liquid(new FluidBuilder().temperature(1200).customStill()) .color(0xFAFAFA).iconSet(GLASS) - .flags(GENERATE_LENS, NO_SMASHING, EXCLUDE_BLOCK_CRAFTING_RECIPES, DECOMPOSITION_BY_CENTRIFUGING, GENERATE_SMALL_DUST, GENERATE_TINY_DUST) + .flags(GENERATE_LENS, NO_SMASHING, EXCLUDE_BLOCK_CRAFTING_RECIPES, DECOMPOSITION_BY_CENTRIFUGING, + GENERATE_SMALL_DUST, GENERATE_TINY_DUST) .components(SiliconDioxide, 1) .build(); @@ -145,7 +146,8 @@ public static void register() { TricalciumPhosphate = new Material.Builder(2015, gregtechId("tricalcium_phosphate")) .dust().ore(3, 1) .color(0xFFFF00).iconSet(FLINT) - .flags(NO_SMASHING, NO_SMELTING, FLAMMABLE, EXPLOSIVE, DECOMPOSITION_BY_CENTRIFUGING, GENERATE_SMALL_DUST) + .flags(NO_SMASHING, NO_SMELTING, FLAMMABLE, EXPLOSIVE, DECOMPOSITION_BY_CENTRIFUGING, + GENERATE_SMALL_DUST) .components(Calcium, 3, Phosphate, 2) .build(); From bf28ffcb927f899a3dbb75f8062aedc7d0b5beb8 Mon Sep 17 00:00:00 2001 From: YoungOnion <39562198+YoungOnionMC@users.noreply.github.com> Date: Tue, 19 Dec 2023 23:59:45 -0700 Subject: [PATCH 3/5] fix surface rocks to give chanced full dusts, and fix some recipes to use full dusts --- .../material/materials/ElementMaterials.java | 8 ++------ .../gregtech/common/blocks/BlockSurfaceRock.java | 10 ++++++++-- .../loaders/recipe/MachineRecipeLoader.java | 12 ++++++------ .../loaders/recipe/VanillaStandardRecipes.java | 8 ++++---- .../loaders/recipe/chemistry/ReactorRecipes.java | 4 ++-- .../recipe/chemistry/SeparationRecipes.java | 16 ++++++++-------- 6 files changed, 30 insertions(+), 28 deletions(-) diff --git a/src/main/java/gregtech/api/unification/material/materials/ElementMaterials.java b/src/main/java/gregtech/api/unification/material/materials/ElementMaterials.java index ec43d5e465c..2c3cc2f3505 100644 --- a/src/main/java/gregtech/api/unification/material/materials/ElementMaterials.java +++ b/src/main/java/gregtech/api/unification/material/materials/ElementMaterials.java @@ -146,7 +146,6 @@ public static void register() { .dust() .color(0x32323C).iconSet(SHINY) .element(Elements.Cd) - .flags(GENERATE_SMALL_DUST) .build(); Cerium = new Material.Builder(20, gregtechId("cerium")) @@ -154,7 +153,6 @@ public static void register() { .liquid(new FluidBuilder().temperature(1068)) .color(0x87917D).iconSet(METALLIC) .element(Elements.Ce) - .flags(GENERATE_SMALL_DUST) .build(); Chlorine = new Material.Builder(21, gregtechId("chlorine")) @@ -405,7 +403,6 @@ public static void register() { .liquid(new FluidBuilder().temperature(1193)) .color(0x5D7575).iconSet(METALLIC) .element(Elements.La) - .flags(GENERATE_SMALL_DUST) .build(); Lawrencium = new Material.Builder(54, gregtechId("lawrencium")) @@ -496,7 +493,7 @@ public static void register() { Neodymium = new Material.Builder(66, gregtechId("neodymium")) .ingot().fluid().ore() .color(0x646464).iconSet(METALLIC) - .flags(STD_METAL, GENERATE_ROD, GENERATE_BOLT_SCREW, GENERATE_SMALL_DUST) + .flags(STD_METAL, GENERATE_ROD, GENERATE_BOLT_SCREW) .element(Elements.Nd) .rotorStats(7.0f, 2.0f, 512) .blast(1297, GasTier.MID) @@ -714,7 +711,7 @@ public static void register() { .ingot() .liquid(new FluidBuilder().temperature(1345)) .color(0xFFFFCC).iconSet(METALLIC) - .flags(GENERATE_LONG_ROD, GENERATE_SMALL_DUST) + .flags(GENERATE_LONG_ROD) .element(Elements.Sm) .blast(b -> b .temp(5400, GasTier.HIGH) @@ -912,7 +909,6 @@ public static void register() { .color(0x76524C).iconSet(METALLIC) .element(Elements.Y) .blast(1799) - .flags(GENERATE_SMALL_DUST) .build(); Zinc = new Material.Builder(122, gregtechId("zinc")) diff --git a/src/main/java/gregtech/common/blocks/BlockSurfaceRock.java b/src/main/java/gregtech/common/blocks/BlockSurfaceRock.java index 8d98ee3b007..2f7a802aa74 100755 --- a/src/main/java/gregtech/common/blocks/BlockSurfaceRock.java +++ b/src/main/java/gregtech/common/blocks/BlockSurfaceRock.java @@ -4,6 +4,7 @@ import gregtech.api.items.toolitem.ToolClasses; import gregtech.api.unification.OreDictUnifier; import gregtech.api.unification.material.Material; +import gregtech.api.unification.material.Materials; import gregtech.api.unification.ore.OrePrefix; import gregtech.api.util.GTUtility; import gregtech.common.blocks.properties.PropertyMaterial; @@ -85,7 +86,7 @@ public AxisAlignedBB getBoundingBox(@NotNull IBlockState state, @NotNull IBlockA } private ItemStack getDropStack(IBlockState state, int amount) { - return OreDictUnifier.get(OrePrefix.dustTiny, getGtMaterial(state), amount); + return OreDictUnifier.get(OrePrefix.dust, getGtMaterial(state), amount); } @Override @@ -99,7 +100,12 @@ public ItemStack getPickBlock(@NotNull IBlockState state, @NotNull RayTraceResul public void getDrops(NonNullList drops, @NotNull IBlockAccess world, @NotNull BlockPos pos, @NotNull IBlockState state, int fortune) { int amount = 3 + GTValues.RNG.nextInt((int) (2 + fortune * 1.5)); - drops.add(getDropStack(state, amount)); + int dropChance = GTValues.RNG.nextInt(3); + if (dropChance == 0) { + drops.add(getDropStack(state, amount)); + } else { + drops.add(OreDictUnifier.get(OrePrefix.dust, Materials.Stone, amount)); + } } @Override diff --git a/src/main/java/gregtech/loaders/recipe/MachineRecipeLoader.java b/src/main/java/gregtech/loaders/recipe/MachineRecipeLoader.java index eb820fbe624..eb63c94486e 100644 --- a/src/main/java/gregtech/loaders/recipe/MachineRecipeLoader.java +++ b/src/main/java/gregtech/loaders/recipe/MachineRecipeLoader.java @@ -1239,40 +1239,40 @@ private static void registerRecyclingRecipes() { .inputs(new ItemStack(Items.PORKCHOP)) .output(dust, Meat) .chancedOutput(dust, Meat, 5000, 0) - .output(dustTiny, Bone) + .chancedOutput(dust, Bone, 1111, 0) .duration(102).buildAndRegister(); MACERATOR_RECIPES.recipeBuilder() .inputs(new ItemStack(Items.FISH, 1, GTValues.W)) .output(dust, Meat) .chancedOutput(dust, Meat, 5000, 0) - .output(dustTiny, Bone) + .chancedOutput(dust, Bone, 1111, 0) .duration(102).buildAndRegister(); MACERATOR_RECIPES.recipeBuilder() .inputs(new ItemStack(Items.CHICKEN)) .output(dust, Meat) - .output(dustTiny, Bone) + .chancedOutput(dust, Bone, 1111, 0) .duration(102).buildAndRegister(); MACERATOR_RECIPES.recipeBuilder() .inputs(new ItemStack(Items.BEEF)) .output(dust, Meat) .chancedOutput(dust, Meat, 5000, 0) - .output(dustTiny, Bone) + .chancedOutput(dust, Bone, 1111, 0) .duration(102).buildAndRegister(); MACERATOR_RECIPES.recipeBuilder() .inputs(new ItemStack(Items.RABBIT)) .output(dust, Meat) .chancedOutput(dust, Meat, 5000, 0) - .output(dustTiny, Bone) + .chancedOutput(dust, Bone, 1111, 0) .duration(102).buildAndRegister(); MACERATOR_RECIPES.recipeBuilder() .inputs(new ItemStack(Items.MUTTON)) .output(dust, Meat) - .output(dustTiny, Bone) + .chancedOutput(dust, Bone, 1111, 0) .duration(102).buildAndRegister(); } diff --git a/src/main/java/gregtech/loaders/recipe/VanillaStandardRecipes.java b/src/main/java/gregtech/loaders/recipe/VanillaStandardRecipes.java index ecfb4e8e739..727a2700dfd 100644 --- a/src/main/java/gregtech/loaders/recipe/VanillaStandardRecipes.java +++ b/src/main/java/gregtech/loaders/recipe/VanillaStandardRecipes.java @@ -382,14 +382,14 @@ private static void woodRecipes() { LATHE_RECIPES.recipeBuilder() .input("treeSapling") .outputs(new ItemStack(Items.STICK)) - .output(dustTiny, Wood) + .chancedOutput(dust, Wood, 1111, 0) .duration(16).EUt(VA[ULV]) .buildAndRegister(); LATHE_RECIPES.recipeBuilder() .input(slab, Wood) .outputs(new ItemStack(Items.BOWL)) - .output(dustSmall, Wood) + .chancedOutput(dust, Wood, 2500, 0) .duration(50).EUt(VA[ULV]) .buildAndRegister(); @@ -1223,13 +1223,13 @@ private static void miscRecipes() { LATHE_RECIPES.recipeBuilder() .inputs(new ItemStack(Blocks.COBBLESTONE)) .output(OrePrefix.stick, Materials.Stone, 1) - .output(dustSmall, Stone, 2) + .chancedOutput(dust, Stone, 5000, 0) .duration(20).EUt(VA[ULV]) .buildAndRegister(); LATHE_RECIPES.recipeBuilder() .inputs(new ItemStack(Blocks.STONE)) .output(OrePrefix.stick, Materials.Stone, 1) - .output(dustSmall, Stone, 2) + .chancedOutput(dust, Stone, 5000, 0) .duration(20).EUt(VA[ULV]) .buildAndRegister(); } else { diff --git a/src/main/java/gregtech/loaders/recipe/chemistry/ReactorRecipes.java b/src/main/java/gregtech/loaders/recipe/chemistry/ReactorRecipes.java index 7871a518e8c..2ef961f8d92 100644 --- a/src/main/java/gregtech/loaders/recipe/chemistry/ReactorRecipes.java +++ b/src/main/java/gregtech/loaders/recipe/chemistry/ReactorRecipes.java @@ -633,8 +633,8 @@ public static void init() { CHEMICAL_RECIPES.recipeBuilder() .inputs(new ItemStack(Items.GHAST_TEAR)) .fluidInputs(Water.getFluid(1000)) - .output(dustTiny, Potassium) - .output(dustTiny, Lithium) + .chancedOutput(dust, Potassium, 1111, 0) + .chancedOutput(dust, Lithium, 1111, 0) .fluidOutputs(SaltWater.getFluid(1000)) .duration(400).EUt(VA[LV]).buildAndRegister(); diff --git a/src/main/java/gregtech/loaders/recipe/chemistry/SeparationRecipes.java b/src/main/java/gregtech/loaders/recipe/chemistry/SeparationRecipes.java index fc433308a0d..ae6c964083b 100644 --- a/src/main/java/gregtech/loaders/recipe/chemistry/SeparationRecipes.java +++ b/src/main/java/gregtech/loaders/recipe/chemistry/SeparationRecipes.java @@ -220,14 +220,14 @@ public static void init() { .chancedOutput(dust, Tantalite, 125, 35) .buildAndRegister(); - CENTRIFUGE_RECIPES.recipeBuilder().duration(64).EUt(20) - .input(dust, RareEarth) - .chancedOutput(dustSmall, Cadmium, 2500, 400) - .chancedOutput(dustSmall, Neodymium, 2500, 400) - .chancedOutput(dustSmall, Samarium, 2500, 400) - .chancedOutput(dustSmall, Cerium, 2500, 400) - .chancedOutput(dustSmall, Yttrium, 2500, 400) - .chancedOutput(dustSmall, Lanthanum, 2500, 400) + CENTRIFUGE_RECIPES.recipeBuilder().duration(256).EUt(20) + .input(dust, RareEarth, 4) + .chancedOutput(dust, Cadmium, 2500, 400) + .chancedOutput(dust, Neodymium, 2500, 400) + .chancedOutput(dust, Samarium, 2500, 400) + .chancedOutput(dust, Cerium, 2500, 400) + .chancedOutput(dust, Yttrium, 2500, 400) + .chancedOutput(dust, Lanthanum, 2500, 400) .buildAndRegister(); CENTRIFUGE_RECIPES.recipeBuilder().duration(50).EUt(VA[LV]) From 3f3ff7dbfd42001347d287a02a2e1aee42293c28 Mon Sep 17 00:00:00 2001 From: YoungOnion <39562198+YoungOnionMC@users.noreply.github.com> Date: Wed, 20 Dec 2023 00:39:09 -0700 Subject: [PATCH 4/5] surface rock chanced update --- .../java/gregtech/common/blocks/BlockSurfaceRock.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/gregtech/common/blocks/BlockSurfaceRock.java b/src/main/java/gregtech/common/blocks/BlockSurfaceRock.java index 2f7a802aa74..f732fccbcb3 100755 --- a/src/main/java/gregtech/common/blocks/BlockSurfaceRock.java +++ b/src/main/java/gregtech/common/blocks/BlockSurfaceRock.java @@ -99,12 +99,11 @@ public ItemStack getPickBlock(@NotNull IBlockState state, @NotNull RayTraceResul @Override public void getDrops(NonNullList drops, @NotNull IBlockAccess world, @NotNull BlockPos pos, @NotNull IBlockState state, int fortune) { - int amount = 3 + GTValues.RNG.nextInt((int) (2 + fortune * 1.5)); - int dropChance = GTValues.RNG.nextInt(3); - if (dropChance == 0) { - drops.add(getDropStack(state, amount)); + int amount = GTValues.RNG.nextInt(Math.max(1, 9 - (fortune * 2))); + if (amount == 0) { + drops.add(getDropStack(state, 1)); } else { - drops.add(OreDictUnifier.get(OrePrefix.dust, Materials.Stone, amount)); + drops.add(OreDictUnifier.get(OrePrefix.dust, Materials.Stone, 1)); } } From 66e6ed22abcf1daa7e998969b079464f3b3b3e13 Mon Sep 17 00:00:00 2001 From: YoungOnion <39562198+YoungOnionMC@users.noreply.github.com> Date: Tue, 26 Dec 2023 02:23:14 -0700 Subject: [PATCH 5/5] Multiply up recycling recipes for tiny/small dust removals --- .../api/unification/OreDictUnifier.java | 18 ++++++++++++---- .../loaders/recipe/RecyclingRecipes.java | 21 +++++++++++++++++-- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/src/main/java/gregtech/api/unification/OreDictUnifier.java b/src/main/java/gregtech/api/unification/OreDictUnifier.java index a945fe5b4f5..7a284d101b1 100644 --- a/src/main/java/gregtech/api/unification/OreDictUnifier.java +++ b/src/main/java/gregtech/api/unification/OreDictUnifier.java @@ -3,6 +3,7 @@ import gregtech.api.GTValues; import gregtech.api.GregTechAPI; import gregtech.api.unification.material.Material; +import gregtech.api.unification.material.info.MaterialFlags; import gregtech.api.unification.material.properties.PropertyKey; import gregtech.api.unification.material.registry.MaterialRegistry; import gregtech.api.unification.ore.OrePrefix; @@ -310,10 +311,19 @@ public static ItemStack getDust(Material material, long materialAmount) { return ItemStack.EMPTY; if (materialAmount % M == 0 || materialAmount >= M * 16) return get(OrePrefix.dust, material, (int) (materialAmount / M)); - else if ((materialAmount * 4) % M == 0 || materialAmount >= M * 8) - return get(OrePrefix.dustSmall, material, (int) ((materialAmount * 4) / M)); - else if ((materialAmount * 9) >= M) - return get(OrePrefix.dustTiny, material, (int) ((materialAmount * 9) / M)); + else if ((materialAmount * 4) % M == 0 || materialAmount >= M * 8) { + if (material.hasFlag(MaterialFlags.GENERATE_SMALL_DUST)) + return get(OrePrefix.dustSmall, material, (int) ((materialAmount * 4) / M)); + else + return get(OrePrefix.dust, material, 1); + } + else if ((materialAmount * 9) >= M) { + if(material.hasFlag(MaterialFlags.GENERATE_TINY_DUST)) + return get(OrePrefix.dustTiny, material, (int) (((materialAmount * 9) / M))); + else + return get(OrePrefix.dust, material, 1); + } + return ItemStack.EMPTY; } diff --git a/src/main/java/gregtech/loaders/recipe/RecyclingRecipes.java b/src/main/java/gregtech/loaders/recipe/RecyclingRecipes.java index ba4223d289f..ed7c1206e9e 100644 --- a/src/main/java/gregtech/loaders/recipe/RecyclingRecipes.java +++ b/src/main/java/gregtech/loaders/recipe/RecyclingRecipes.java @@ -1,6 +1,7 @@ package gregtech.loaders.recipe; import gregtech.api.GTValues; +import gregtech.api.items.materialitem.MetaPrefixItem; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.recipes.RecipeBuilder; import gregtech.api.recipes.RecipeMaps; @@ -20,6 +21,8 @@ import gregtech.api.unification.stack.UnificationEntry; import gregtech.api.util.GTUtility; +import gregtech.api.util.SmallDigits; + import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.Tuple; @@ -112,14 +115,28 @@ private static void registerMaceratorRecycling(ItemStack input, List= M && materials.get(0).material.hasFlag(GENERATE_TINY_DUST)) + mult = 1; + else if ((matAmount * 4) % M == 0 && materials.get(0).material.hasFlag(GENERATE_SMALL_DUST)) + mult = 1; + else + mult = (int) M / (int) matAmount; + } + // Exit if no valid Materials exist for this recycling Recipe. if (outputs.size() == 0) return; + ItemStack in = input.copy(); + in.setCount(input.getCount() * mult); + // Build the final Recipe. RecipeBuilder recipe = RecipeMaps.MACERATOR_RECIPES.recipeBuilder() - .inputs(input.copy()) + .inputs(in) .outputs(outputs) - .duration(calculateDuration(outputs)) + .duration(calculateDuration(outputs) * mult) .EUt(2 * multiplier) .category(RecipeCategories.MACERATOR_RECYCLING);