Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow disabling small/tiny piles of dust via material flags. #2595

Open
wants to merge 2 commits into
base: 1.20.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ can influence how the material behaves, as well as which items are generated for
- `GENERATE_SMALL_GEAR`
- `GENERATE_SPRING`
- `GENERATE_SPRING_SMALL`
- `NO_GENERATE_DUST_PILES`


## Other Flags
Expand Down Expand Up @@ -64,4 +65,4 @@ can influence how the material behaves, as well as which items are generated for
- `SOLDER_MATERIAL`
- `SOLDER_MATERIAL_BAD`
- `SOLDER_MATERIAL_GOOD`
- `STICKY`
- `STICKY`
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,14 @@ public String toString() {
.requireProps(PropertyKey.DUST)
.build();

/**
* Prevent generating small/tiny piles of dust for this material.
*/
public static final MaterialFlag NO_GENERATE_DUST_PILES = new MaterialFlag.Builder(
"no_generate_dust_piles")
.requireProps(PropertyKey.DUST)
.build();

/**
* This will prevent material from creating Shapeless recipes for dust to block and vice versa
* Also preventing extruding and alloy smelting recipes via SHAPE_EXTRUDING/MOLD_BLOCK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@ public static TagPrefix get(String name) {
.materialIconType(MaterialIconType.dustSmall)
.unificationEnabled(true)
.generateItem(true)
.generationCondition(hasDustProperty);
.generationCondition(
mat -> mat.hasProperty(PropertyKey.DUST) && !mat.hasFlag(MaterialFlags.NO_GENERATE_DUST_PILES));

// 1/9th of a Dust.
public static final TagPrefix dustTiny = new TagPrefix("tinyDust")
Expand All @@ -351,7 +352,8 @@ public static TagPrefix get(String name) {
.materialIconType(MaterialIconType.dustTiny)
.unificationEnabled(true)
.generateItem(true)
.generationCondition(hasDustProperty);
.generationCondition(
mat -> mat.hasProperty(PropertyKey.DUST) && !mat.hasFlag(MaterialFlags.NO_GENERATE_DUST_PILES));

// Dust with impurities. 1 Unit of Main Material and 1/9 - 1/4 Unit of secondary Material
public static final TagPrefix dustImpure = new TagPrefix("impureDust")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,6 @@ public static void init() {
plate.setIgnored(BorosilicateGlass);
foil.setIgnored(BorosilicateGlass);

dustSmall.setIgnored(Lapotron);
dustTiny.setIgnored(Lapotron);

dye.setIgnored(DyeBlack, Items.BLACK_DYE);
dye.setIgnored(DyeRed, Items.RED_DYE);
dye.setIgnored(DyeGreen, Items.GREEN_DYE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ public static void register() {
Lapotron = new Material.Builder(GTCEu.id("lapotron"))
.gem()
.color(0x7497ea).secondaryColor(0x1c0b39).iconSet(DIAMOND)
.flags(NO_UNIFICATION)
.flags(NO_UNIFICATION, NO_GENERATE_DUST_PILES)
.buildAndRegister();

TreatedWood = new Material.Builder(GTCEu.id("treated_wood"))
Expand Down
Loading