Skip to content

Commit

Permalink
Fix material iconsets, colors, and textures
Browse files Browse the repository at this point in the history
  • Loading branch information
TechLord22 committed Jun 23, 2021
1 parent 6155d82 commit 8dcbf49
Show file tree
Hide file tree
Showing 238 changed files with 1,100 additions and 692 deletions.
13 changes: 9 additions & 4 deletions src/main/java/gregtech/api/unification/Element.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import stanhebben.zenscript.annotations.ZenProperty;

/**
* This is some kind of Periodic Table, which I use to determine Properties of the Materials.
* This is some kind of Periodic Table, which can be used to determine Properties of the Materials.
*/
@ZenClass("mods.gregtech.material.Element")
@ZenRegister
Expand Down Expand Up @@ -136,10 +136,15 @@ public enum Element {
Lv(116, 177, -1, null, "Livermorium", false),
Ts(117, 177, -1, null, "Tennessine", false),
Og(118, 176, -1, null, "Oganesson", false),
//stargate
//fantasy
Tr(119, 178, -1, null, "Tritanium", false),
Dr(120, 180, -1, null, "Duranium", false),
Nq(121, 172, 140, null, "Naquadah", true);
Nq(121, 172, 140, null, "Naquadah", true),
Nt(0, 5000, -1, null, "Neutronium", false),
Ke(1000, 1000, -1, null, "Trinium", false),
Ad(750, 1000, -1, null, "Adamantium", false),
Vb(850, 900, -1, null, "Vibranium", false),
Tn(550, 670, -1, null, "Taranium", false);

public final String name;
public final long protons;
Expand Down Expand Up @@ -202,4 +207,4 @@ public long getMass() {
public String toString() {
return super.toString();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ public enum MaterialIconType {
turbineBlade,
handleMallet,
toolHeadMallet,
plateCurved,
coke,

//BLOCK TEXTURES
block,
Expand Down
952 changes: 502 additions & 450 deletions src/main/java/gregtech/api/unification/material/Materials.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ public static final class MatFlags {
*/
public static final long EXCLUDE_BLOCK_CRAFTING_RECIPES = createFlag(18);

public static final long EXCLUDE_PLATE_COMPRESSOR_RECIPE = createFlag(19);

/**
* This will prevent material from creating Shapeless recipes for dust to block and vice versa
*/
public static final long EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES = createFlag(46);

public static final long EXCLUDE_PLATE_COMPRESSOR_RECIPE = createFlag(19);

static {
Material.MatFlags.registerMaterialFlagsHolder(MatFlags.class, DustMaterial.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ public static final class MatFlags {
public static final long BLAST_FURNACE_CALCITE_DOUBLE = createFlag(35);
public static final long BLAST_FURNACE_CALCITE_TRIPLE = createFlag(36);

public static final long GENERATE_ROUND = createFlag(51);
public static final long GENERATE_DOUBLE_PLATE = createFlag(52);

static {
Material.MatFlags.registerMaterialFlagsHolder(MatFlags.class, IngotMaterial.class);
}
Expand Down
34 changes: 17 additions & 17 deletions src/main/java/gregtech/api/unification/material/type/Material.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,50 +100,50 @@ else if (!flagEntry.getValue().isAssignableFrom(selfClass))
}

/**
* Enables electrolyzer decomposition recipe generation
* Add to material if it is some kind of explosive
*/
public static final long DECOMPOSITION_BY_ELECTROLYZING = createFlag(40);
public static final long EXPLOSIVE = createFlag(4);

/**
* Enables centrifuge decomposition recipe generation
* Add to material to disable it's unification fully
*/
public static final long DECOMPOSITION_BY_CENTRIFUGING = createFlag(41);
public static final long NO_UNIFICATION = createFlag(5);

/**
* Add to material if any of it's items cannot be recycled to get scrub
*/
public static final long NO_RECYCLING = createFlag(6);

/**
* Add to material if it has constantly burning aura
*/
public static final long BURNING = createFlag(7);

/**
* Add to material if it is some kind of flammable
* Decomposition recipe requires hydrogen as additional input. Amount is equal to input amount
*/
public static final long FLAMMABLE = createFlag(42);
public static final long DECOMPOSITION_REQUIRES_HYDROGEN = createFlag(8);

/**
* Add to material if it is some kind of explosive
* Enables electrolyzer decomposition recipe generation
*/
public static final long EXPLOSIVE = createFlag(4);
public static final long DECOMPOSITION_BY_ELECTROLYZING = createFlag(40);

/**
* Add to material to disable it's unification fully
* Enables centrifuge decomposition recipe generation
*/
public static final long NO_UNIFICATION = createFlag(5);
public static final long DECOMPOSITION_BY_CENTRIFUGING = createFlag(41);

/**
* Add to material if any of it's items cannot be recycled to get scrub
* Add to material if it is some kind of flammable
*/
public static final long NO_RECYCLING = createFlag(6);
public static final long FLAMMABLE = createFlag(42);

/**
* Disables decomposition recipe generation for this material and all materials that has it as component
*/
public static final long DISABLE_DECOMPOSITION = createFlag(43);

/**
* Decomposition recipe requires hydrogen as additional input. Amount is equal to input amount
*/
public static final long DECOMPOSITION_REQUIRES_HYDROGEN = createFlag(8);

static {
registerMaterialFlagsHolder(MatFlags.class, Material.class);
}
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/gregtech/api/unification/ore/OrePrefix.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,15 @@ public enum OrePrefix {

nugget("Nuggets", M / 9, null, MaterialIconType.nugget, ENABLE_UNIFICATION | DISALLOW_RECYCLING, mat -> mat instanceof IngotMaterial), // A Nugget. Introduced by Eloraam

plateCurved("Curved Plates", M, null, MaterialIconType.plateCurved, ENABLE_UNIFICATION, mat -> mat instanceof IngotMaterial && mat.hasFlag(GENERATE_PLATE)),
plateDense("Dense Plates", M * 9, null, MaterialIconType.plateDense, ENABLE_UNIFICATION, mat -> mat instanceof IngotMaterial && mat.hasFlag(GENERATE_PLATE | GENERATE_DENSE) && !mat.hasFlag(NO_SMASHING)), // 9 Plates combined in one Item.
plateDouble("Double Plates", M * 2, null, MaterialIconType.plateDouble, ENABLE_UNIFICATION, mat -> mat instanceof IngotMaterial && mat.hasFlag(GENERATE_DOUBLE_PLATE) && !mat.hasFlag(NO_SMASHING)),
plate("Plates", M, null, MaterialIconType.plate, ENABLE_UNIFICATION, mat -> mat instanceof DustMaterial && mat.hasFlag(GENERATE_PLATE)), // Regular Plate made of one Ingot/Dust. Introduced by Calclavia
compressed("Compressed Materials", M * 2, null, null, ENABLE_UNIFICATION, null), // Compressed Material, worth 1 Unit. Introduced by Galacticraft

round("Rounds", M / 9, null, MaterialIconType.round, OrePrefix.Flags.ENABLE_UNIFICATION, mat -> mat instanceof IngotMaterial && mat.hasFlag(GENERATE_ROUND)),
foil("Foils", M / 4, null, MaterialIconType.foil, ENABLE_UNIFICATION, mat -> mat instanceof IngotMaterial && mat.hasFlag(GENERATE_FOIL)), // Foil made of 1/4 Ingot/Dust.

stickLong("Long Sticks/Rods", M, null, MaterialIconType.stickLong, ENABLE_UNIFICATION, mat -> mat instanceof SolidMaterial && mat.hasFlag(GENERATE_LONG_ROD)), // Stick made of an Ingot.
stick("Sticks/Rods", M / 2, null, MaterialIconType.stick, ENABLE_UNIFICATION, mat -> mat instanceof SolidMaterial && mat.hasFlag(GENERATE_ROD)), // Stick made of half an Ingot. Introduced by Eloraam

Expand Down
48 changes: 36 additions & 12 deletions src/main/java/gregtech/common/MetaFluids.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ public class MetaFluids {

public static final ResourceLocation AUTO_GENERATED_FLUID_TEXTURE = new ResourceLocation(
GTValues.MODID, "blocks/fluids/fluid.molten.autogenerated");
public static final ResourceLocation AUTO_GENERATED_PLASMA_TEXTURE = new ResourceLocation(
GTValues.MODID, "blocks/fluids/fluid.plasma.autogenerated");

private static final Map<Pair<FluidMaterial, FluidType>, ResourceLocation> fluidTextureMap = new HashMap<>();

public static final Fluid DISTILLED_WATER = new Fluid("distilled_water",
Expand Down Expand Up @@ -80,6 +83,7 @@ public static void init() {
FluidRegistry.registerFluid(DISTILLED_WATER);
Materials.DistilledWater.setMaterialFluid(DISTILLED_WATER);
fluidSprites.add(AUTO_GENERATED_FLUID_TEXTURE);
fluidSprites.add(AUTO_GENERATED_PLASMA_TEXTURE);

FluidTooltipUtil.registerTooltip(FluidRegistry.WATER, FluidTooltipUtil.getWaterTooltip());
FluidTooltipUtil.registerTooltip(DISTILLED_WATER, FluidTooltipUtil.getWaterTooltip());
Expand All @@ -96,48 +100,57 @@ public static void init() {
setDefaultTexture(Materials.Deuterium, FluidType.NORMAL);
setDefaultTexture(Materials.Tritium, FluidType.NORMAL);
setDefaultTexture(Materials.Helium, FluidType.NORMAL);
setDefaultTexture(Materials.Helium, FluidType.PLASMA);
setDefaultTexture(Materials.Helium3, FluidType.NORMAL);
setDefaultTexture(Materials.Argon, FluidType.NORMAL);
setDefaultTexture(Materials.Radon, FluidType.NORMAL);
setDefaultTexture(Materials.Fluorine, FluidType.NORMAL);
setDefaultTexture(Materials.TitaniumTetrachloride, FluidType.NORMAL);
setDefaultTexture(Materials.Helium3, FluidType.NORMAL);
setDefaultTexture(Materials.Methane, FluidType.NORMAL);
setDefaultTexture(Materials.Nitrogen, FluidType.NORMAL);
setDefaultTexture(Materials.Nitrogen, FluidType.PLASMA);
setDefaultTexture(Materials.NitrogenDioxide, FluidType.NORMAL);
setDefaultTexture(Materials.Steam, FluidType.NORMAL);
setDefaultTexture(Materials.OilHeavy, FluidType.NORMAL);
setDefaultTexture(Materials.OilMedium, FluidType.NORMAL);
setDefaultTexture(Materials.OilLight, FluidType.NORMAL);
setDefaultTexture(Materials.HydrogenSulfide, FluidType.NORMAL);
setDefaultTexture(Materials.SulfuricGas, FluidType.NORMAL);
setDefaultTexture(Materials.Gas, FluidType.NORMAL);
setDefaultTexture(Materials.RefineryGas, FluidType.NORMAL);
setDefaultTexture(Materials.SulfuricNaphtha, FluidType.NORMAL);
setDefaultTexture(Materials.SulfuricLightFuel, FluidType.NORMAL);
setDefaultTexture(Materials.SulfuricHeavyFuel, FluidType.NORMAL);
setDefaultTexture(Materials.Naphtha, FluidType.NORMAL);
setDefaultTexture(Materials.LightFuel, FluidType.NORMAL);
setDefaultTexture(Materials.HeavyFuel, FluidType.NORMAL);
setDefaultTexture(Materials.LPG, FluidType.NORMAL);
setDefaultTexture(Materials.CrackedLightFuel, FluidType.NORMAL);
setDefaultTexture(Materials.CrackedHeavyFuel, FluidType.NORMAL);
setDefaultTexture(Materials.SteamCrackedLightFuel, FluidType.NORMAL);
setDefaultTexture(Materials.SteamCrackedHeavyFuel, FluidType.NORMAL);
setDefaultTexture(Materials.UUAmplifier, FluidType.NORMAL);
setDefaultTexture(Materials.Chlorine, FluidType.NORMAL);
setDefaultTexture(Materials.Mercury, FluidType.NORMAL);
setDefaultTexture(Materials.NitroFuel, FluidType.NORMAL);
setDefaultTexture(Materials.NitroDiesel, FluidType.NORMAL);
setDefaultTexture(Materials.SodiumPersulfate, FluidType.NORMAL);
setDefaultTexture(Materials.Glyceryl, FluidType.NORMAL);
setDefaultTexture(Materials.Lubricant, FluidType.NORMAL);
setDefaultTexture(Materials.Creosote, FluidType.NORMAL);
setDefaultTexture(Materials.SeedOil, FluidType.NORMAL);
setDefaultTexture(Materials.Oil, FluidType.NORMAL);
setDefaultTexture(Materials.Fuel, FluidType.NORMAL);
setDefaultTexture(Materials.Diesel, FluidType.NORMAL);
setDefaultTexture(Materials.Honey, FluidType.NORMAL);
setDefaultTexture(Materials.Biomass, FluidType.NORMAL);
setDefaultTexture(Materials.Ethanol, FluidType.NORMAL);
setDefaultTexture(Materials.SulfuricAcid, FluidType.NORMAL);
setDefaultTexture(Materials.Milk, FluidType.NORMAL);
setDefaultTexture(Materials.McGuffium239, FluidType.NORMAL);
setDefaultTexture(Materials.Glue, FluidType.NORMAL);
setDefaultTexture(Materials.HydrochloricAcid, FluidType.NORMAL);
setDefaultTexture(Materials.LeadZincSolution, FluidType.NORMAL);
setDefaultTexture(Materials.Epichlorohydrin, FluidType.NORMAL);
setDefaultTexture(Materials.NaturalGas, FluidType.NORMAL);
setDefaultTexture(Materials.Blaze, FluidType.NORMAL);
setDefaultTexture(Materials.Glass, FluidType.NORMAL);
setDefaultTexture(Materials.Toluene, FluidType.NORMAL);

for (Material material : Material.MATERIAL_REGISTRY) {
if (!(material instanceof FluidMaterial)) continue;
Expand All @@ -156,17 +169,24 @@ public static void init() {
}
}

private static void setDefaultTexture(FluidMaterial material, FluidType fluidType) {
/**
* Changes the texture of specified material's fluid.
* The material color is overlayed on top of the texture, set the materialRGB to 0xFFFFFF to remove the overlay.
*
* @param material the material whose texture to change
* @param fluidType the type of the fluid
*/
public static void setDefaultTexture(FluidMaterial material, FluidType fluidType) {
ResourceLocation resourceLocation = new ResourceLocation(GTValues.MODID, "blocks/fluids/fluid." + material.toString());
setMaterialFluidTexture(material, fluidType, resourceLocation);
}

private static void setMaterialFluidTexture(FluidMaterial material, FluidType fluidType, ResourceLocation textureLocation) {
public static void setMaterialFluidTexture(FluidMaterial material, FluidType fluidType, ResourceLocation textureLocation) {
fluidTextureMap.put(Pair.of(material, fluidType), textureLocation);
fluidSprites.add(textureLocation);
}

private static void setAlternativeFluidName(FluidMaterial material, FluidType fluidType, String alternativeName) {
public static void setAlternativeFluidName(FluidMaterial material, FluidType fluidType, String alternativeName) {
alternativeFluidNames.put(fluidType.getFluidName(material), alternativeName);
}

Expand All @@ -181,10 +201,14 @@ public static Fluid registerFluid(FluidMaterial material, FluidType fluidType, i

if (fluid == null) {
FluidState fluidState = fluidType.getFluidState(material);
ResourceLocation textureLocation = fluidTextureMap.getOrDefault(Pair.of(material, fluidType), AUTO_GENERATED_FLUID_TEXTURE);
ResourceLocation textureLocation;
// if (fluidType.equals(FluidType.PLASMA))
// textureLocation = fluidTextureMap.getOrDefault(Pair.of(material, fluidType), AUTO_GENERATED_PLASMA_TEXTURE); //todo make plasma and regular texture locations different
// else
textureLocation = fluidTextureMap.getOrDefault(Pair.of(material, fluidType), AUTO_GENERATED_FLUID_TEXTURE);
fluid = new MaterialFluid(fluidName, material, fluidState, textureLocation);
fluid.setTemperature(temperature);
if (textureLocation == AUTO_GENERATED_FLUID_TEXTURE) {
if (textureLocation.equals(AUTO_GENERATED_FLUID_TEXTURE) || textureLocation.equals(AUTO_GENERATED_PLASMA_TEXTURE)) {
fluid.setColor(GTUtility.convertRGBtoOpaqueRGBA_MC(material.materialRGB));
}
setStateProperties(fluid, fluidState);
Expand All @@ -207,7 +231,7 @@ public static FluidMaterial getMaterialFromFluid(Fluid fluid) {
return fluidToMaterialMappings.get(fluid.getName());
}

private static void setStateProperties(Fluid fluid, FluidState fluidState) {
public static void setStateProperties(Fluid fluid, FluidState fluidState) {
switch (fluidState) {
case LIQUID:
fluid.setGaseous(false);
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/gregtech/common/items/MetaItem1.java
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public void registerRecipes() {
.buildAndRegister();

RecipeMaps.ASSEMBLER_RECIPES.recipeBuilder()
.input(OrePrefix.stick, Materials.Wood).input(OrePrefix.dustSmall, Materials.Phosphor)
.input(OrePrefix.stick, Materials.Wood).input(OrePrefix.dustSmall, Materials.TricalciumPhosphate)
.outputs(TOOL_MATCHES.getStackForm())
.duration(16).EUt(16)
.buildAndRegister();
Expand All @@ -339,7 +339,7 @@ public void registerRecipes() {
.buildAndRegister();

RecipeMaps.ASSEMBLER_RECIPES.recipeBuilder()
.input(OrePrefix.stick, Materials.Wood, 4).input(OrePrefix.dust, Materials.Phosphor)
.input(OrePrefix.stick, Materials.Wood, 4).input(OrePrefix.dust, Materials.TricalciumPhosphate)
.outputs(TOOL_MATCHES.getStackForm(4))
.duration(64)
.EUt(16)
Expand Down Expand Up @@ -552,4 +552,4 @@ protected void addMaterialTooltip(ItemStack itemStack, OrePrefix prefix, Materia
}
}

}
}
4 changes: 2 additions & 2 deletions src/main/java/gregtech/common/items/MetaTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public void registerRecipes() {
}

SolidMaterial[] softHammerMaterials = new SolidMaterial[]{
Materials.Wood, Materials.Rubber, Materials.Plastic, Materials.Polytetrafluoroethylene
Materials.Wood, Materials.Rubber, Materials.Polyethylene, Materials.Polytetrafluoroethylene
};
for (int i = 0; i < softHammerMaterials.length; i++) {
SolidMaterial solidMaterial = softHammerMaterials[i];
Expand Down Expand Up @@ -261,4 +261,4 @@ private void registerFlintToolRecipes() {
'F', new ItemStack(Items.FLINT, 1));
}

}
}
10 changes: 5 additions & 5 deletions src/main/java/gregtech/loaders/recipe/FuelRecipes.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ public static void registerFuels() {
registerDieselGeneratorFuel(Materials.Ethanol.getFluid(1), 6, GTValues.LV);
registerDieselGeneratorFuel(Materials.BioDiesel.getFluid(1), 8, GTValues.LV);
registerDieselGeneratorFuel(Materials.LightFuel.getFluid(1), 10, GTValues.LV);
registerDieselGeneratorFuel(Materials.Fuel.getFluid(1), 15, GTValues.LV);
registerDieselGeneratorFuel(Materials.NitroFuel.getFluid(2), 45, GTValues.LV);
registerDieselGeneratorFuel(Materials.Diesel.getFluid(1), 15, GTValues.LV);
registerDieselGeneratorFuel(Materials.NitroDiesel.getFluid(2), 45, GTValues.LV);

//steam generator fuels
registerSteamGeneratorFuel(Materials.Steam.getFluid(60), 1, GTValues.LV);

//low-tier gas turbine fuels
registerGasGeneratorFuel(Materials.NaturalGas.getFluid(8), 5, GTValues.LV);
registerGasGeneratorFuel(Materials.Hydrogen.getFluid(8), 5, GTValues.LV);
registerGasGeneratorFuel(Materials.CarbonMonoxde.getFluid(8), 6, GTValues.LV);
registerGasGeneratorFuel(Materials.CarbonMonoxide.getFluid(8), 6, GTValues.LV);
registerGasGeneratorFuel(Materials.WoodGas.getFluid(8), 6, GTValues.LV);
registerGasGeneratorFuel(Materials.SulfuricGas.getFluid(32), 25, GTValues.LV);
registerGasGeneratorFuel(Materials.SulfuricNaphtha.getFluid(4), 5, GTValues.LV);
registerGasGeneratorFuel(Materials.Methane.getFluid(4), 14, GTValues.LV);
registerGasGeneratorFuel(Materials.Ethylene.getFluid(1), 4, GTValues.LV);
registerGasGeneratorFuel(Materials.Gas.getFluid(1), 5, GTValues.LV);
registerGasGeneratorFuel(Materials.RefineryGas.getFluid(1), 5, GTValues.LV);
registerGasGeneratorFuel(Materials.Ethane.getFluid(4), 21, GTValues.LV);
registerGasGeneratorFuel(Materials.Propene.getFluid(1), 6, GTValues.LV);
registerGasGeneratorFuel(Materials.Butadiene.getFluid(16), 103, GTValues.LV);
Expand Down Expand Up @@ -82,4 +82,4 @@ public static void registerGasGeneratorFuel(FluidStack fuelStack, int duration,
public static void registerSemiFluidGeneratorFuel(FluidStack fuelStack, int duration, int tier) {
RecipeMaps.SEMI_FLUID_GENERATOR_FUELS.addRecipe(new FuelRecipe(fuelStack, duration, GTValues.V[tier]));
}
}
}
Loading

0 comments on commit 8dcbf49

Please sign in to comment.