Small fixes & Stop storage blocks and fluids for disabled materials

This commit is contained in:
Muramasa 2016-09-29 07:36:45 +01:00
parent 7e1bc813d2
commit c0f1fce859
6 changed files with 31 additions and 25 deletions

View file

@ -664,7 +664,7 @@ public enum OrePrefixes {
aMaterial == Materials.AnnealedCopper || aMaterial == Materials.Firestone || aMaterial == Materials.VanadiumGallium || aMaterial == Materials.YttriumBariumCuprate || aMaterial == Materials.AnnealedCopper || aMaterial == Materials.Firestone || aMaterial == Materials.VanadiumGallium || aMaterial == Materials.YttriumBariumCuprate ||
aMaterial == Materials.NiobiumTitanium || aMaterial == Materials.CertusQuartz || aMaterial == Materials.NetherQuartz || aMaterial == Materials.Lazurite || aMaterial == Materials.Lapis || aMaterial == Materials.NiobiumTitanium || aMaterial == Materials.CertusQuartz || aMaterial == Materials.NetherQuartz || aMaterial == Materials.Lazurite || aMaterial == Materials.Lapis ||
aMaterial == Materials.Paper || aMaterial == Materials.Jasper || aMaterial == Materials.Dilithium || aMaterial == Materials.Forcicium || aMaterial == Materials.Forcillium || aMaterial == Materials.Paper || aMaterial == Materials.Jasper || aMaterial == Materials.Dilithium || aMaterial == Materials.Forcicium || aMaterial == Materials.Forcillium ||
aMaterial == Materials.EnderPearl || aMaterial == Materials.EnderEye || aMaterial == Materials.Glass || aMaterial == Materials.Copper)) aMaterial == Materials.EnderPearl || aMaterial == Materials.EnderEye || aMaterial == Materials.Glass || aMaterial == Materials.Copper || aMaterial == Materials.Tin))
plate.mDisabledItems.add(aMaterial); plate.mDisabledItems.add(aMaterial);
//Ingot/Plate Storage //Ingot/Plate Storage
if (!enableUnusedDoubleIngots) ingotDouble.mDisabledItems.add(aMaterial); if (!enableUnusedDoubleIngots) ingotDouble.mDisabledItems.add(aMaterial);

View file

@ -5,7 +5,6 @@ import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.OrePrefixes;
import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.IIconContainer;
import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_OreDictUnificator;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -15,16 +14,21 @@ public class GT_Block_Metal extends GT_Block_Storage {
public Materials[] mMats; public Materials[] mMats;
public OrePrefixes mPrefix; public OrePrefixes mPrefix;
public IIconContainer[] mBlockIcons; public IIconContainer[] mBlockIcons;
public boolean mHideBlocks;
public GT_Block_Metal(String aName, Materials[] aMats, OrePrefixes aPrefix, IIconContainer[] aBlockIcons) { public GT_Block_Metal(String aName, Materials[] aMats, OrePrefixes aPrefix, IIconContainer[] aBlockIcons) {
super(GT_Item_Storage.class, aName, Material.iron); super(GT_Item_Storage.class, aName, Material.iron);
mMats = aMats; mMats = aMats;
mPrefix = aPrefix; mPrefix = aPrefix;
mBlockIcons = aBlockIcons; mBlockIcons = aBlockIcons;
mHideBlocks = Loader.isModLoaded("NotEnoughItems");
for (int i = 0; i < aMats.length; i++) { for (int i = 0; i < aMats.length; i++) {
if (aMats[i].mMetaItemSubID > 0) {
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + i + ".name", "Block of " + aMats[i].mDefaultLocalName); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + i + ".name", "Block of " + aMats[i].mDefaultLocalName);
GT_OreDictUnificator.registerOre(aPrefix, aMats[i], new ItemStack(this, 1, i)); GT_OreDictUnificator.registerOre(aPrefix, aMats[i], new ItemStack(this, 1, i));
} }
}
if (aMats.length<16 && Loader.isModLoaded("NotEnoughItems")) { if (aMats.length<16 && Loader.isModLoaded("NotEnoughItems")) {
for (int i = aMats.length; i < 16; i++) codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i)); for (int i = aMats.length; i < 16; i++) codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i));
} }
@ -36,5 +40,4 @@ public class GT_Block_Metal extends GT_Block_Storage {
} }
return null; return null;
} }
} }

View file

@ -95,7 +95,7 @@ public class GT_Block_Storage extends GT_Generic_Block {
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) { public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) {
for (int i = 0; i < 16; i++) { for (int i = 0; i < 16; i++) {
aList.add(new ItemStack(aItem, 1, i)); if (!(new ItemStack(aItem, 1, i).getDisplayName().contains(".name"))) aList.add(new ItemStack(aItem, 1, i));
} }
} }
} }

View file

@ -21,20 +21,23 @@ public class ProcessingConfig implements gregtech.api.interfaces.IMaterialHandle
@Override @Override
public void onComponentRegistration(Materials aMaterial) { public void onComponentRegistration(Materials aMaterial) {
/** This is just left here as an example of how to add components. /** This is just left here as an example of how to add components. **/
switch (aMaterial.mName) {
case "Cobalt": /*Enabling/Disabling components depending on the current Materials values:
OrePrefixes.spring.mDisabledItems.remove(aMaterial); if ((aMaterial.mTypes & 0x40) != 0) { //This material can be made into tool heads
OrePrefixes.ingotDouble.mDisabledItems.remove(aMaterial);
OrePrefixes.ingotTriple.mDisabledItems.remove(aMaterial);
OrePrefixes.ingotQuadruple.mDisabledItems.remove(aMaterial);
OrePrefixes.ingotQuintuple.mDisabledItems.remove(aMaterial);
OrePrefixes.plateDouble.mDisabledItems.remove(aMaterial);
OrePrefixes.plateTriple.mDisabledItems.remove(aMaterial);
OrePrefixes.plateQuadruple.mDisabledItems.remove(aMaterial); OrePrefixes.plateQuadruple.mDisabledItems.remove(aMaterial);
OrePrefixes.plateQuintuple.mDisabledItems.remove(aMaterial); } */
OrePrefixes.plateDense.mDisabledItems.remove(aMaterial);
break; /* Enabling specific components:
}**/ OrePrefixes.spring.mDisabledItems.remove(Materials.Cobalt);
OrePrefixes.ingotDouble.mDisabledItems.remove(Materials.Cobalt);
OrePrefixes.ingotTriple.mDisabledItems.remove(Materials.Cobalt);
OrePrefixes.ingotQuadruple.mDisabledItems.remove(Materials.Cobalt);
OrePrefixes.ingotQuintuple.mDisabledItems.remove(Materials.Cobalt);
OrePrefixes.plateDouble.mDisabledItems.remove(Materials.Cobalt);
OrePrefixes.plateTriple.mDisabledItems.remove(Materials.Cobalt);
OrePrefixes.plateQuadruple.mDisabledItems.remove(Materials.Cobalt);
OrePrefixes.plateQuintuple.mDisabledItems.remove(Materials.Cobalt);
OrePrefixes.plateDense.mDisabledItems.remove(Materials.Cobalt); */
} }
} }

View file

@ -52,7 +52,7 @@ public class ProcessingIngot implements gregtech.api.interfaces.IOreRecipeRegist
} }
if (!aNoSmashing) { if (!aNoSmashing) {
GT_Values.RA.addWiremillRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GT_Utility.copy(new Object[]{GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 2L), GT_OreDictUnificator.get(OrePrefixes.wireFine, aMaterial, 8L)}), 100, 4); GT_Values.RA.addWiremillRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 2L), 100, 4);
GT_Values.RA.addForgeHammerRecipe(GT_Utility.copyAmount(2L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L), (int) Math.max(aMaterialMass, 1L), 16); GT_Values.RA.addForgeHammerRecipe(GT_Utility.copyAmount(2L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L), (int) Math.max(aMaterialMass, 1L), 16);
GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L), (int) Math.max(aMaterialMass * 1L, 1L), 24); GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L), (int) Math.max(aMaterialMass * 1L, 1L), 24);
GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(2L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.plateDouble, aMaterial, 1L), (int) Math.max(aMaterialMass * 2L, 1L), 96); GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(2L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.plateDouble, aMaterial, 1L), (int) Math.max(aMaterialMass * 2L, 1L), 96);

View file

@ -465,7 +465,7 @@ public class GT_Loader_Item_Block_And_Fluid
GT_Mod.gregtechproxy.addFluid("molten.blaze", "Molten Blaze", Materials.Blaze, 4, 6400); GT_Mod.gregtechproxy.addFluid("molten.blaze", "Molten Blaze", Materials.Blaze, 4, 6400);
GT_Mod.gregtechproxy.addFluid("molten.concrete", "Wet Concrete", Materials.Concrete, 4, 300); GT_Mod.gregtechproxy.addFluid("molten.concrete", "Wet Concrete", Materials.Concrete, 4, 300);
for (Materials tMaterial : Materials.values()) { for (Materials tMaterial : Materials.values()) {
if ((tMaterial.mStandardMoltenFluid == null) && (tMaterial.contains(SubTag.SMELTING_TO_FLUID)) && (!tMaterial.contains(SubTag.NO_SMELTING))) { if ((tMaterial.mMetaItemSubID > 0) && (tMaterial.mStandardMoltenFluid == null) && (tMaterial.contains(SubTag.SMELTING_TO_FLUID)) && (!tMaterial.contains(SubTag.NO_SMELTING))) {
GT_Mod.gregtechproxy.addAutogeneratedMoltenFluid(tMaterial); GT_Mod.gregtechproxy.addAutogeneratedMoltenFluid(tMaterial);
if ((tMaterial.mSmeltInto != tMaterial) && (tMaterial.mSmeltInto.mStandardMoltenFluid == null)) { if ((tMaterial.mSmeltInto != tMaterial) && (tMaterial.mSmeltInto.mStandardMoltenFluid == null)) {
GT_Mod.gregtechproxy.addAutogeneratedMoltenFluid(tMaterial.mSmeltInto); GT_Mod.gregtechproxy.addAutogeneratedMoltenFluid(tMaterial.mSmeltInto);