Skip to content

MaterialFlags

ALongStringOfNumbers edited this page Jun 17, 2021 · 4 revisions

Material Flags

This page should provide information regarding what Material Flags are which are available and how to use them.

What is material flag?

This is concept which allows GTCE to generated or prevent generation of specific items and recipes. For example MaterialIngot will generate Ingot, Block, Nugget and Dust (in all three sizes). But no plate. If Plate is required then it has to be specified via flag GENERATE_PLATE.

Using more then one Flag

More then one flag can be specified for example if GENERATE_PLATE and GENERATE_ROD is used Material will generate both Plate and Rod. This is done be binary OR.

Limitation

Not all Material Flags can be applied to every Material. For example it does not make sense to generate Lens from Ingot Material like Iron. So flag will be ignored.

Mistake correction and flag superseding

System is designed to fix possible problems regarding missing steps in generation. For example if flag GENERATE_FINE_WIRE is used but flag GENERATE_FOIL is missing it will be automatically applied as Fine Wire could not be created without Foil. Best superseding example is EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES and EXCLUDE_BLOCK_CRAFTING_RECIPES first will remove recipes for hand crafting and second one will do same as first one plus removes also recipes for extruding and alloy smelting recipes via SHAPE_EXTRUDING/MOLD_BLOCK.

Usage

Material flags can be applied either on construction of Material (not available for CT) or later via addFlags. Flags can be added until Material registry freezing and they can't be removed.

API

Creating material with Flags on construction:

IngotMaterial AnnealedCopper = new IngotMaterial(87, "annealed_copper", 0xFF7814, MaterialIconSet.SHINY, 2, of(new MaterialStack(Copper, 1)), GENERATE_PLATE | GENERATE_ROD | GENERATE_BOLT_SCREW | GENERATE_LONG_ROD | GENERATE_GEAR | GENERATE_FOIL | GENERATE_FINE_WIRE | MORTAR_GRINDABLE);

Applying flags later:

IngotMaterial AnnealedCopper = new IngotMaterial(87, "annealed_copper", 0xFF7814, MaterialIconSet.SHINY, 2, of(new MaterialStack(Copper, 1)));
AnnealedCopper.addFlag(GENERATE_PLATE | GENERATE_ROD | GENERATE_BOLT_SCREW | GENERATE_LONG_ROD | GENERATE_GEAR | GENERATE_FOIL | GENERATE_FINE_WIRE | MORTAR_GRINDABLE);

CraftTweaker

Applying flags later:

val specialCopper = MaterialRegistry.createIngotMaterial(500, "special_copper", 0xFF7814, "shiny", 2);
specialCopper.addFlags(["GENERATE_PLATE","GENERATE_ROD","GENERATE_BOLT_SCREW","GENERATE_LONG_ROD","GENERATE_GEAR","GENERATE_FOIL","GENERATE_FINE_WIRE","MORTAR_GRINDABLE"]);

This must be done in a file with a special crafttweaker loader, #loader gregtech at the top of the file.

Flag Table

Flags with ID 0 to 3 (included) are not applicable to Materials they are shown only for completion. Some flags are marked Not implemented as they lack any implementation even if flag is used.

ID Name Description Notes Owner class
0 ENABLE_UNIFICATION OrePrefix
1 SELF_REFERENCING OrePrefix
2 FLUID_CONTAINER OrePrefix
3 DISALLOW_RECYCLING OrePrefix
4 EXPLOSIVE Whether material is explosive Material
5 NO_UNIFICATION Not implemented Material
6 NO_RECYCLING Not implemented Material
7 BURNING Material with constantly burning aura Not implemented Material
8 DECOMPOSITION_REQUIRES_HYDROGEN Decomposition requires Hydrogen Amount of Hydrogen needed is equal to material input Material
9 GENERATE_PLASMA Material will generate Plasma fluid FluidMaterial
10 STATE_GAS Material is of gaseous state Air for example FluidMaterial
11 GENERATE_ORE Ores for this material will be generated DustMaterial
12 GENERATE_PLATE Material will generate Plate Recipe will be generated in Bending Machine for Ingot Material in Compressor for Dust Material and in Cutting Saw if Material has block form DustMaterial
13 NO_WORKING Material can be worked only by smashing or smelting DustMaterial
14 NO_SMASHING Material cannot be used for regular Metal working techniques since it is not possible to bend it DustMaterial
15 NO_SMELTING Material cannot be smelted DustMaterial
16 INDUCTION_SMELTING_LOW_OUTPUT Material will output less in Induction Smelter DustMaterial
17 SMELT_INTO_FLUID Material can be smelted to to fluid This will generate fluid for it DustMaterial
18 EXCLUDE_BLOCK_CRAFTING_RECIPES Material will not create extruding and alloy smelting recipes via SHAPE_EXTRUDING/MOLD_BLOCK This supersedes EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES DustMaterial
19 EXCLUDE_PLATE_COMPRESSOR_RECIPE Material will not generate recipe for Plate like item in Compressor Example is Paper which does not recipe for Chad to Paper as Wood Pulp to Wood Plank has DustMaterial
20 GENERATE_ROD Material will generate Rod SolidMaterial
21 GENERATE_GEAR Material will generate Gear SolidMaterial
22 GENERATE_LONG_ROD Material will generate Long Rod SolidMaterial
24 MORTAR_GRINDABLE Material will be grindable in Mortar Applies only to ingots, gems, plates SolidMaterial
25 GENERATE_FOIL Material will generate Foil IngotMaterial
26 GENERATE_BOLT_SCREW Material will generate Bolt and Screw IngotMaterial
27 GENERATE_RING Material will generate Ring IngotMaterial
28 GENERATE_SPRING Material will generate Spring IngotMaterial
29 GENERATE_FINE_WIRE Material will generate Fine Wire IngotMaterial
30 GENERATE_ROTOR Material will generate Rotor IngotMaterial
31 GENERATE_SMALL_GEAR Material will generate Small Gear IngotMaterial
32 GENERATE_DENSE Material will generate Dense Plate IngotMaterial
33 GENERATE_SPRING_SMALL Material will generate Small Spring Not implemented IngotMaterial
34 CRYSTALLISABLE Material will generate Autoclave recipe from dust to gem GemMaterial
35 BLAST_FURNACE_CALCITE_DOUBLE Not implemented IngotMaterial
36 BLAST_FURNACE_CALCITE_TRIPLE Not implemented IngotMaterial
37 GENERATE_LENSE Material will generate Lens GemMaterial
38 HIGH_SIFTER_OUTPUT Whether this Material should produce more output in Sifter GemMaterial
40 DECOMPOSITION_BY_ELECTROLYZING Allows decomposition via Electrolyzer Material
41 DECOMPOSITION_BY_CENTRIFUGING Allows decomposition via Centrifuge Material
42 FLAMMABLE Whether material is flammable Material
43 DISABLE_DECOMPOSITION Material will not allow decomposition same goes for materials which are using this one as component Overrides DECOMPOSITION_BY_ELECTROLYZING and DECOMPOSITION_BY_CENTRIFUGING Material
44 GENERATE_FLUID_BLOCK Whether this Material should have place-able fluid block FluidMaterial
45 GENERATE_FRAME Material will generate Frame SolidMaterial
46 EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES Material will not create Shapeless recipes for dust to block and vice versa DustMaterial