Skip to content

Commit

Permalink
Merge remote-tracking branch 'chochem/remove-valuable-ores' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Dream-Master committed Jan 10, 2025
2 parents 0eec1ca + b2a5b61 commit 2c5f775
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import bartworks.util.MathUtils;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GTLanguageManager;
import gregtech.api.util.GTModHandler;

public class BWMetaGeneratedOres extends BWMetaGeneratedBlocks {

Expand All @@ -45,12 +44,7 @@ public BWMetaGeneratedOres(Material p_i45386_1_, Class<? extends TileEntity> til
}

@Override
protected void doRegistrationStuff(Werkstoff w) {
if (w != null) {
if (!w.hasItemType(OrePrefixes.ore) || (w.getGenerationFeatures().blacklist & 0b1000) != 0) return;
GTModHandler.addValuableOre(this, w.getmID(), 1);
}
}
protected void doRegistrationStuff(Werkstoff w) {}

public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean air, Block block,
int[] aBlockMeta) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GTLanguageManager;
import gregtech.api.util.GTModHandler;

public class BWMetaGeneratedSmallOres extends BWMetaGeneratedOres {

Expand All @@ -35,12 +34,7 @@ public BWMetaGeneratedSmallOres(Material p_i45386_1_, Class<? extends TileEntity
}

@Override
protected void doRegistrationStuff(Werkstoff w) {
if (w != null) {
if (!w.hasItemType(OrePrefixes.ore) || (w.getGenerationFeatures().blacklist & 0b1000) != 0) return;
GTModHandler.addValuableOre(this, w.getmID(), 1);
}
}
protected void doRegistrationStuff(Werkstoff w) {}

@Override
public String getUnlocalizedName() {
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/gregtech/GTMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@
import gregtech.loaders.postload.ItemMaxStacksizeLoader;
import gregtech.loaders.postload.MachineRecipeLoader;
import gregtech.loaders.postload.MachineTooltipsLoader;
import gregtech.loaders.postload.MinableRegistrator;
import gregtech.loaders.postload.PosteaTransformers;
import gregtech.loaders.postload.RecyclerBlacklistLoader;
import gregtech.loaders.postload.ScrapboxDropLoader;
Expand Down Expand Up @@ -416,7 +415,6 @@ public void onPostLoad(FMLPostInitializationEvent aEvent) {
new ItemMaxStacksizeLoader().run();
new BlockResistanceLoader().run();
new RecyclerBlacklistLoader().run();
new MinableRegistrator().run();
new FakeRecipeLoader().run();
new MachineRecipeLoader().run();
new ScrapboxDropLoader().run();
Expand Down
17 changes: 0 additions & 17 deletions src/main/java/gregtech/api/util/GTModHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

import javax.annotation.Nullable;

import net.minecraft.block.Block;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
Expand Down Expand Up @@ -83,7 +82,6 @@
import ic2.api.recipe.RecipeInputItemStack;
import ic2.api.recipe.RecipeOutput;
import ic2.api.recipe.Recipes;
import ic2.core.IC2;
import ic2.core.item.ItemToolbox;

/**
Expand Down Expand Up @@ -455,21 +453,6 @@ public static boolean getJumpKeyDown(EntityPlayer aPlayer) {
return false;
}

/**
* Adds a Valuable Ore to the Miner
*/
public static boolean addValuableOre(Block aBlock, int aMeta, int aValue) {
if (aValue <= 0) return false;
try {
IC2.addValuableOre(new RecipeInputItemStack(new ItemStack(aBlock, 1, aMeta)), aValue);
} catch (Exception e) {
// TODO remove try catch
// TODO fix : why is bartworks registering items stacks with .getItem() == null
GTLog.err.println("Caught exception when calling IC2.addValuableOre");
}
return true;
}

/**
* Adds a Scrapbox Drop. Fails at April first for the "suddenly Hoes"-Feature of IC2
*/
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/gregtech/common/blocks/BlockOresAbstract.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import gregtech.api.interfaces.ITexture;
import gregtech.api.items.GTGenericBlock;
import gregtech.api.util.GTLanguageManager;
import gregtech.api.util.GTModHandler;
import gregtech.api.util.GTOreDictUnificator;
import gregtech.api.util.GTUtility;
import gregtech.common.render.GTRendererBlock;
Expand All @@ -58,9 +57,6 @@ protected BlockOresAbstract(String aUnlocalizedName, int aOreMetaCount, boolean
tHideOres = NotEnoughItems.isModLoaded() && GTMod.gregtechproxy.mHideUnusedOres;
if (aOreMetaCount > 8 || aOreMetaCount < 0) aOreMetaCount = 8;

for (int i = 0; i < 16; i++) {
GTModHandler.addValuableOre(this, i, 1);
}
for (int i = 1; i < GregTechAPI.sGeneratedMaterials.length; i++) {
if (GregTechAPI.sGeneratedMaterials[i] != null) {
for (int j = 0; j < aOreMetaCount; j++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic
private boolean registerStandardOreRecipes(OrePrefixes aPrefix, Materials aMaterial, ItemStack aOreStack,
int aMultiplier) {
if ((aOreStack == null) || (aMaterial == null)) return false;
GTModHandler
.addValuableOre(GTUtility.getBlockFromStack(aOreStack), aOreStack.getItemDamage(), aMaterial.mOreValue);
Materials tMaterial = aMaterial.mOreReplacement;
Materials tPrimaryByMaterial = null;
aMultiplier = Math.max(1, aMultiplier);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic
private boolean registerStandardOreRecipes(OrePrefixes aPrefix, Materials aMaterial, ItemStack aOreStack,
int aMultiplier) {
if ((aOreStack == null) || (aMaterial == null)) return false;
GTModHandler
.addValuableOre(GTUtility.getBlockFromStack(aOreStack), aOreStack.getItemDamage(), aMaterial.mOreValue);
Materials tMaterial = aMaterial.mOreReplacement;
Materials tPrimaryByMaterial = null;
aMultiplier = Math.max(1, aMultiplier);
Expand Down
16 changes: 0 additions & 16 deletions src/main/java/gregtech/loaders/postload/MinableRegistrator.java

This file was deleted.

0 comments on commit 2c5f775

Please sign in to comment.