Hard remove ores that might be exploitable by MRF laser drill

This commit is contained in:
Blood-Asp 2017-09-12 22:53:02 +02:00
parent 34ee89fc4b
commit 51a4389f7c
3 changed files with 14 additions and 2 deletions

View file

@ -19,6 +19,7 @@ import gregtech.common.GT_DummyWorld;
import gregtech.common.GT_Network;
import gregtech.common.GT_Proxy;
import gregtech.common.GT_RecipeAdder;
import gregtech.common.blocks.GT_Block_Ores_Abstract;
import gregtech.common.entities.GT_Entity_Arrow;
import gregtech.common.entities.GT_Entity_Arrow_Potion;
import gregtech.common.items.armor.components.LoadArmorComponents;
@ -279,6 +280,13 @@ public class GT_Mod implements IGT_Mod {
gregtechproxy.enableGCOres = GregTech_API.sWorldgenFile.get("general", "enableGCOres", gregtechproxy.enableGCOres);
gregtechproxy.enableUBOres = GregTech_API.sWorldgenFile.get("general", "enableUBOres", gregtechproxy.enableUBOres);
Materials[] tDisableOres = new Materials[]{Materials.Chrome, Materials.Naquadria, Materials.Silicon, Materials.Cobalt, Materials.Cadmium, Materials.Indium, Materials.Tungsten,
Materials.Adamantium, Materials.Mithril, Materials.DarkIron, Materials.Rutile, Materials.Alduorite, Materials.Magnesium, Materials.Nikolite};
for(Materials tMat : tDisableOres){
if(!GregTech_API.sMaterialComponents.get("disableLaserDrillOres", tMat.mName, false))
GT_Block_Ores_Abstract.aBlockedOres.add(tMat);
}
GregTech_API.mUseOnlyGoodSolderingMaterials = GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.harderrecipes, "useonlygoodsolderingmaterials", GregTech_API.mUseOnlyGoodSolderingMaterials);
if (tMainConfig.get("general", "hardermobspawners", true).getBoolean(true)) {

View file

@ -30,7 +30,9 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements ITileEntityProvider {
public static ThreadLocal<GT_TileEntity_Ores> mTemporaryTileEntity = new ThreadLocal();
@ -38,6 +40,7 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements
public static boolean tHideOres;
private final String aTextName = ".name";
private final String aTextSmall = "Small ";
public static Set aBlockedOres = new HashSet<Materials>();
protected GT_Block_Ores_Abstract(String aUnlocalizedName, int aOreMetaCount, boolean aHideFirstMeta, Material aMaterial) {
super(GT_Item_Ores.class, aUnlocalizedName, aMaterial);
@ -56,7 +59,7 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements
if (!this.getEnabledMetas()[j]) continue;
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + (j * 1000)) + aTextName, getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + ((i + 16000) + (j * 1000)) + aTextName, aTextSmall + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
if ((GregTech_API.sGeneratedMaterials[i].mTypes & 0x8) != 0) {
if ((GregTech_API.sGeneratedMaterials[i].mTypes & 0x8) != 0 && !aBlockedOres.contains(GregTech_API.sGeneratedMaterials[i])) {
GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[j] != null ? this.getProcessingPrefix()[j].get(GregTech_API.sGeneratedMaterials[i]) : "", new ItemStack(this, 1, i + (j * 1000)));
if (tHideOres) {
if (!(j == 0 && !aHideFirstMeta)) {
@ -247,7 +250,7 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements
public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) {
for (int i = 0; i < GregTech_API.sGeneratedMaterials.length; i++) {
Materials tMaterial = GregTech_API.sGeneratedMaterials[i];
if ((tMaterial != null) && ((tMaterial.mTypes & 0x8) != 0)) {
if ((tMaterial != null) && ((tMaterial.mTypes & 0x8) != 0)&& !aBlockedOres.contains(tMaterial)) {
if (!(new ItemStack(aItem, 1, i).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i));
if (!(new ItemStack(aItem, 1, i + 1000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 1000));
if (!(new ItemStack(aItem, 1, i + 2000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 2000));

View file

@ -79,6 +79,7 @@ public class ProcessingModSupport implements gregtech.api.interfaces.IMaterialHa
Materials.ShadowSteel.mHasParentMod = false;
Materials.AstralSilver.mHasParentMod = false;
Materials.Midasium.mHasParentMod = false;
Materials.Adamantium.mHasParentMod = false;
}
if (!aEnableThaumcraftMats) {
Materials.Amber.mHasParentMod = false;