gregtech 6 prefix compat for NTM crucible, lang entries for materials

This commit is contained in:
Boblet 2022-10-18 15:31:16 +02:00
parent 60e120cadb
commit 0069a3c0af
10 changed files with 228 additions and 24 deletions

View File

@ -19,6 +19,7 @@ import com.hbm.hazard.HazardEntry;
import com.hbm.hazard.HazardRegistry;
import com.hbm.hazard.HazardSystem;
import com.hbm.inventory.material.MatDistribution;
import com.hbm.inventory.material.MaterialShapes;
import com.hbm.items.ItemEnums.EnumCokeType;
import com.hbm.items.ItemEnums.EnumTarType;
import com.hbm.main.MainRegistry;
@ -480,6 +481,7 @@ public class OreDictManager {
OreDictionary.registerOre("blockGlassRed", glass_polonium);
OreDictionary.registerOre("blockGlassBlack", glass_ash);
MaterialShapes.registerCompatShapes();
MatDistribution.register(); //TEMP
}

View File

@ -9,6 +9,7 @@ import java.util.List;
import com.hbm.inventory.OreDictManager;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ModItems;
import com.hbm.util.Compat;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
@ -53,18 +54,22 @@ public class MatDistribution {
registerEntry(ModItems.pipes_steel, MAT_STEEL, BLOCK.q(3));
//actual ores
if(!Compat.isModLoaded(Compat.MOD_GT6)) {
registerOre(OreDictManager.IRON.ore(), MAT_IRON, INGOT.q(2), MAT_TITANIUM, NUGGET.q(3), MAT_STONE, QUART.q(1));
registerOre(OreDictManager.TI.ore(), MAT_TITANIUM, INGOT.q(2), MAT_IRON, NUGGET.q(3), MAT_STONE, QUART.q(1));
registerOre(OreDictManager.W.ore(), MAT_TUNGSTEN, INGOT.q(2), MAT_STONE, QUART.q(1));
registerOre(OreDictManager.AL.ore(), MAT_ALUMINIUM, INGOT.q(2), MAT_STONE, QUART.q(1));
}
registerOre(OreDictManager.COAL.ore(), MAT_COAL, GEM.q(4), MAT_STONE, QUART.q(1));
registerOre(OreDictManager.IRON.ore(), MAT_IRON, INGOT.q(2), MAT_TITANIUM, NUGGET.q(3), MAT_STONE, QUART.q(1));
registerOre(OreDictManager.GOLD.ore(), MAT_GOLD, INGOT.q(2), MAT_LEAD, NUGGET.q(3), MAT_STONE, QUART.q(1));
registerOre(OreDictManager.U.ore(), MAT_URANIUM, INGOT.q(2), MAT_LEAD, NUGGET.q(3), MAT_STONE, QUART.q(1));
registerOre(OreDictManager.TH232.ore(), MAT_THORIUM, INGOT.q(2), MAT_URANIUM, NUGGET.q(3), MAT_STONE, QUART.q(1));
registerOre(OreDictManager.TI.ore(), MAT_TITANIUM, INGOT.q(2), MAT_IRON, NUGGET.q(3), MAT_STONE, QUART.q(1));
registerOre(OreDictManager.CU.ore(), MAT_COPPER, INGOT.q(2), MAT_STONE, QUART.q(1));
registerOre(OreDictManager.W.ore(), MAT_TUNGSTEN, INGOT.q(2), MAT_STONE, QUART.q(1));
registerOre(OreDictManager.AL.ore(), MAT_ALUMINIUM, INGOT.q(2), MAT_STONE, QUART.q(1));
registerOre(OreDictManager.PB.ore(), MAT_LEAD, INGOT.q(2), MAT_GOLD, NUGGET.q(1), MAT_STONE, QUART.q(1));
registerOre(OreDictManager.BE.ore(), MAT_BERYLLIUM, INGOT.q(2), MAT_STONE, QUART.q(1));
registerOre(OreDictManager.CO.ore(), MAT_COBALT, INGOT.q(1), MAT_STONE, QUART.q(1));
registerOre(OreDictManager.REDSTONE.ore(), MAT_REDSTONE, INGOT.q(4), MAT_STONE, QUART.q(1));
}
public static void registerEntry(Object key, Object... matDef) {

View File

@ -1,22 +1,46 @@
package com.hbm.inventory.material;
public enum MaterialShapes {
import java.util.ArrayList;
import java.util.List;
import com.hbm.util.Compat;
public class MaterialShapes {
QUANTUM(1), // 1/72 of an ingot, allows the ingot to be divisible through 2, 4, 6, 8, 9, 12, 24 and 36
NUGGET(8, "nugget"),
DUSTTINY(NUGGET.quantity, "dustTiny"),
WIRE(9),
BILLET(NUGGET.quantity * 6, "billet"),
INGOT(NUGGET.quantity * 9, "ingot"),
GEM(INGOT.quantity, "gem"),
CRYSTAL(INGOT.quantity, "crystal"),
DUST(INGOT.quantity, "dust"),
PLATE(INGOT.quantity, "plate"),
QUART(162),
BLOCK(INGOT.quantity * 9, "block");
public static final List<MaterialShapes> allShapes = new ArrayList();
public static final MaterialShapes QUANTUM = new MaterialShapes(1); // 1/72 of an ingot, allows the ingot to be divisible through 2, 4, 6, 8, 9, 12, 24 and 36
public static final MaterialShapes NUGGET = new MaterialShapes(8, "nugget");
public static final MaterialShapes DUSTTINY = new MaterialShapes(NUGGET.quantity, "dustTiny");
public static final MaterialShapes WIRE = new MaterialShapes(9);
public static final MaterialShapes BILLET = new MaterialShapes(NUGGET.quantity * 6, "billet");
public static final MaterialShapes INGOT = new MaterialShapes(NUGGET.quantity * 9, "ingot");
public static final MaterialShapes GEM = new MaterialShapes(INGOT.quantity, "gem");
public static final MaterialShapes CRYSTAL = new MaterialShapes(INGOT.quantity, "crystal");
public static final MaterialShapes DUST = new MaterialShapes(INGOT.quantity, "dust");
public static final MaterialShapes PLATE = new MaterialShapes(INGOT.quantity, "plate");
public static final MaterialShapes QUART = new MaterialShapes(162);
public static final MaterialShapes BLOCK = new MaterialShapes(INGOT.quantity * 9, "block");
public static void registerCompatShapes() {
if(Compat.isModLoaded(Compat.MOD_GT6)) {
new MaterialShapes(INGOT.q(9, 8), "crushed");
new MaterialShapes(INGOT.q(9, 72), "crushedTiny");
new MaterialShapes(INGOT.q(10, 8), "crushedPurified");
new MaterialShapes(INGOT.q(10, 72), "crushedPurifiedTiny");
new MaterialShapes(INGOT.q(11, 8), "crushedCentrifuged");
new MaterialShapes(INGOT.q(11, 72), "crushedCentrifugedTiny");
new MaterialShapes(INGOT.q(1, 4), "dustSmall");
new MaterialShapes(INGOT.q(1, 72), "dustDiv72");
new MaterialShapes(INGOT.q(10, 9), "dustImpure");
new MaterialShapes(INGOT.q(11, 9), "dustPure");
new MaterialShapes(INGOT.q(12, 9), "dustRefined");
}
}
private int quantity;
String[] prefixes;
public final String[] prefixes;
private MaterialShapes(int quantity, String... prefixes) {
this.quantity = quantity;
@ -25,6 +49,8 @@ public enum MaterialShapes {
for(String prefix : prefixes) {
Mats.prefixByName.put(prefix, this);
}
allShapes.add(this);
}
public int q(int amount) {
@ -34,4 +60,8 @@ public enum MaterialShapes {
public int q(int unitsUsed, int itemsProduced) { //eg rails: INOGT.q(6, 16) since the recipe uses 6 ton ingots producing 16 individual rail blocks
return this.quantity * unitsUsed / itemsProduced;
}
public String name() {
return (prefixes != null && prefixes.length > 0) ? prefixes[0] : "unknown";
}
}

View File

@ -30,6 +30,10 @@ public class NTMMaterial {
Mats.matById.put(id, this);
}
public String getUnlocalizedName() {
return "hbmmat." + this.names[0].toLowerCase();
}
/** Shapes for autogen */
public NTMMaterial setShapes(MaterialShapes... shapes) {
this.shapes = shapes;

View File

@ -157,7 +157,7 @@ public class CrucibleRecipes extends SerializableRecipe {
HashMap<AStack, List<ItemStack>> map = new HashMap();
for(NTMMaterial material : Mats.orderedList) {
for(MaterialShapes shape : MaterialShapes.values()) {
for(MaterialShapes shape : MaterialShapes.allShapes) {
//TODO: buffer these
String name = shape.toString().toLowerCase() + material.names[0];

View File

@ -42,13 +42,13 @@ public class ItemCrucibleTemplate extends Item {
list.add(EnumChatFormatting.BOLD + I18nUtil.resolveKey("info.template_out_p"));
for(MaterialStack out : recipe.output) {
list.add(out.material.names[0] + ": " + Mats.formatAmount(out.amount));
list.add(I18nUtil.resolveKey(out.material.getUnlocalizedName()) + ": " + Mats.formatAmount(out.amount));
}
list.add(EnumChatFormatting.BOLD + I18nUtil.resolveKey("info.template_in_p"));
for(MaterialStack in : recipe.input) {
list.add(in.material.names[0] + ": " + Mats.formatAmount(in.amount));
list.add(I18nUtil.resolveKey(in.material.getUnlocalizedName()) + ": " + Mats.formatAmount(in.amount));
}
}
}

View File

@ -6,6 +6,7 @@ import java.util.List;
import com.hbm.handler.HazmatRegistry;
import com.hbm.hazard.HazardRegistry;
import cpw.mods.fml.common.Loader;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@ -140,4 +141,8 @@ public class Compat {
HazmatRegistry.registerHazmat(item, resistance);
}
}
public static boolean isModLoaded(String modid) {
return Loader.isModLoaded(modid);
}
}

View File

@ -635,6 +635,85 @@ hbmfluid.watz=Giftiger Schlamm
hbmfluid.xenon=Xenongas
hbmfluid.xpjuice=Erfahrungssaft
hbmmat.actinium227=Actinium-227
hbmmat.alloy=Fortgeschrittene Legierung
hbmmat.aluminium=Aluminium
hbmmat.americiumrg=Reaktorfähiges Armericium
hbmmat.americium241=Americium-241
hbmmat.americium242=Americium-242
hbmmat.arsenic=Arsen
hbmmat.asbestos=Asbest
hbmmat.bakelite=Bakelit
hbmmat.beryllium=Beryllium
hbmmat.borax=Borax
hbmmat.boron=Bor
hbmmat.cinnabar=Zinnober
hbmmat.cmbsteel=Combinestahl
hbmmat.coal=Kohle
hbmmat.coalcoke=Kohlekoks
hbmmat.cobalt=Kobalt
hbmmat.cobalt60=Kobalt-60
hbmmat.coltan=Coltan
hbmmat.copper=Kupfer
hbmmat.dineutronium=Dineutronium
hbmmat.durasteel=Schnellarbeitsstahl
hbmmat.euphemium=Euphemium
hbmmat.ferrouranium=Ferrouran
hbmmat.fiberglass=Fiberglas
hbmmat.fluorite=Fluorit
hbmmat.ghiorsium336=Ghiorsium-336
hbmmat.gold=Gold
hbmmat.gold198=Gold-198
hbmmat.graphene=Graphen
hbmmat.graphite=Graphit
hbmmat.iron=Eisen
hbmmat.lapis=Lapis Lazuli
hbmmat.lead=Blei
hbmmat.lead209=Blei-209
hbmmat.lignitecoke=Braunkohlekoks
hbmmat.lignite=Braunkohle
hbmmat.lithium=Lithium
hbmmat.magnetizedtungsten=Magnetisierter Wolfram
hbmmat.mingrade=Minecraft-Kupfer
hbmmat.neptunium237=Neptunium-237
hbmmat.niobium=Niob
hbmmat.osmiridium=Osmiridium
hbmmat.petcoke=Petroleumkoks
hbmmat.plutonium=Plutonium
hbmmat.plutonium238=Plutonium-238
hbmmat.plutonium239=Plutonium-239
hbmmat.plutonium240=Plutonium-240
hbmmat.plutonium241=Plutonium-241
hbmmat.plutoniumrg=Reaktorfähiges Plutonium
hbmmat.polonium210=Polonium-210
hbmmat.polymer=Polymer
hbmmat.radium226=Radium-226
hbmmat.redphosphorus=Roter Phosphor
hbmmat.redstone=Redstone
hbmmat.rubber=Gummi
hbmmat.saltpeter=Salpeter
hbmmat.saturnite=Saturnit
hbmmat.schrabidate=Eisenschrabidat
hbmmat.schrabidium=Schrabidium
hbmmat.schraranium=Schraranium
hbmmat.solinium=Solinium
hbmmat.star=Sternenmetall
hbmmat.steel=Stahl
hbmmat.stone=Stein
hbmmat.sulfur=Schwefel
hbmmat.tantalium=Tantal
hbmmat.tcalloy=Technetiumstahl
hbmmat.technetium99=Technetium-99
hbmmat.titanium=Titan
hbmmat.thorium232=Thorium-232
hbmmat.tungsten=Wolfram
hbmmat.uranium=Uran
hbmmat.uranium233=Uran-233
hbmmat.uranium235=Uran-235
hbmmat.uranium238=Uran-238
hbmmat.whitephosphorus=Weißer Phosphor
hbmmat.workersalloy=Desh
info.asbestos=Meine Lunge brennt.
info.coaldust=Das Atmen fällt mir schwer.
info.coil=Spulenstärke
@ -3274,8 +3353,8 @@ tile.concrete_slab.concrete_smooth.name=Betonstufe
tile.concrete_slab.ducrete.name=Ducretefliesenstufe
tile.concrete_slab.ducrete_smooth.name=Ducretestufe
tile.concrete_smooth.name=Beton
tile.concrete_stairs.name=Betonfliesentreppe
tile.concrete_smooth_stairs.name=Betontreppe
tile.concrete_stairs.name=Betonfliesentreppe
tile.concrete_super.name=Super Beton
tile.concrete_super_broken.name=Schimmliger Schutt
tile.conveyor.name=Förderband

View File

@ -863,6 +863,85 @@ hbmpseudofluid.pf6=Plutonium Hexafluoride
hbmpseudofluid.mud_heavy=Heavy Sludge Fraction
hbmpseudofluid.mud=Poisonous Sludge Gas
hbmmat.actinium227=Actinium-227
hbmmat.alloy=Advanced Alloy
hbmmat.aluminium=Aluminium
hbmmat.americiumrg=Reactor-Grade Americium
hbmmat.americium241=Americium-241
hbmmat.americium242=Americium-242
hbmmat.arsenic=Arsenic
hbmmat.asbestos=Asbestos
hbmmat.bakelite=Bakelite
hbmmat.beryllium=Beryllium
hbmmat.borax=Borax
hbmmat.boron=Boron
hbmmat.cinnabar=Cinnabar
hbmmat.cmbsteel=Combine Steel
hbmmat.coal=Coal
hbmmat.coalcoke=Coal Coke
hbmmat.cobalt=Cobalt
hbmmat.cobalt60=Cobalt-60
hbmmat.coltan=Coltan
hbmmat.copper=Copper
hbmmat.dineutronium=Dineutronium
hbmmat.durasteel=High-Speed Steel
hbmmat.euphemium=Euphemium
hbmmat.ferrouranium=Ferrouranium
hbmmat.fiberglass=Fiberglass
hbmmat.fluorite=Fluorite
hbmmat.ghiorsium336=Ghiorsium-336
hbmmat.gold=Gold
hbmmat.gold198=Gold-198
hbmmat.graphene=Graphene
hbmmat.graphite=Graphite
hbmmat.iron=Iron
hbmmat.lapis=Lapis Lazuli
hbmmat.lead=Lead
hbmmat.lead209=Lead-209
hbmmat.lignitecoke=Lignite Coke
hbmmat.lignite=Lignite
hbmmat.lithium=Lithium
hbmmat.magnetizedtungsten=Magnetized Tungsten
hbmmat.mingrade=Minecraft Grade Copper
hbmmat.neptunium237=Neptunium-237
hbmmat.niobium=Niobium
hbmmat.osmiridium=Osmiridium
hbmmat.petcoke=Petroleum Coke
hbmmat.plutonium=Plutonium
hbmmat.plutonium238=Plutonium-238
hbmmat.plutonium239=Plutonium-239
hbmmat.plutonium240=Plutonium-240
hbmmat.plutonium241=Plutonium-241
hbmmat.plutoniumrg=Reactor-Grade Plutonium
hbmmat.polonium210=Polonium-210
hbmmat.polymer=Polymer
hbmmat.radium226=Radium-226
hbmmat.redphosphorus=Red Phosphorus
hbmmat.redstone=Redstone
hbmmat.rubber=Rubber
hbmmat.saltpeter=Niter
hbmmat.saturnite=Saturnite
hbmmat.schrabidate=Ferric Schrabidate
hbmmat.schrabidium=Schrabidium
hbmmat.schraranium=Schraranium
hbmmat.solinium=Solinium
hbmmat.star=Starmetal
hbmmat.steel=Steel
hbmmat.stone=Stone
hbmmat.sulfur=Sulfur
hbmmat.tantalium=Tantalum
hbmmat.tcalloy=Technetium Steel
hbmmat.technetium99=Technetium-99
hbmmat.titanium=Titanium
hbmmat.thorium232=Thorium-232
hbmmat.tungsten=Tungsten
hbmmat.uranium=Uranium
hbmmat.uranium233=Uranium-233
hbmmat.uranium235=Uranium-235
hbmmat.uranium238=Uranium-238
hbmmat.whitephosphorus=White Phosphorus
hbmmat.workersalloy=Desh
info.asbestos=My lungs are burning.
info.coaldust=It's hard to breathe here.
info.coil=Coil Strength
@ -3710,8 +3789,8 @@ tile.concrete_slab.concrete_asbestos.name=Asbestos Concrete Slab
tile.concrete_slab.concrete_smooth.name=Concrete Slab
tile.concrete_slab.ducrete.name=Ducrete Tile Slab
tile.concrete_slab.ducrete_smooth.name=Ducrete Slab
tile.concrete_smooth.name=Concrete Stairs
tile.concrete_smooth_stairs.name=Concrete
tile.concrete_smooth.name=Concrete
tile.concrete_smooth_stairs.name=Concrete Stairs
tile.concrete_stairs.name=Concrete Tile Stairs
tile.concrete_super.name=Über Concrete
tile.concrete_super_broken.name=Moldy Debris

Binary file not shown.

After

Width:  |  Height:  |  Size: 465 B