aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/api/util')
-rw-r--r--src/main/java/gregtech/api/util/GT_BaseCrop.java4
-rw-r--r--src/main/java/gregtech/api/util/GT_Config.java12
2 files changed, 14 insertions, 2 deletions
diff --git a/src/main/java/gregtech/api/util/GT_BaseCrop.java b/src/main/java/gregtech/api/util/GT_BaseCrop.java
index 304a0f3c62..c106816ba2 100644
--- a/src/main/java/gregtech/api/util/GT_BaseCrop.java
+++ b/src/main/java/gregtech/api/util/GT_BaseCrop.java
@@ -7,7 +7,7 @@ import gregtech.api.enums.ConfigCategories;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.objects.ItemData;
-import gregtech.common.blocks.GT_Block_Ores;
+import gregtech.common.blocks.GT_Block_Ores_Abstract;
import gregtech.common.blocks.GT_TileEntity_Ores;
import ic2.api.crops.CropCard;
import ic2.api.crops.Crops;
@@ -200,7 +200,7 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo {
}
for (int i = 1; i < this.getrootslength(aCrop); i++) {
Block tBlock = aCrop.getWorld().getBlock(aCrop.getLocation().posX, aCrop.getLocation().posY - i, aCrop.getLocation().posZ);
- if ((tBlock instanceof GT_Block_Ores)) {
+ if ((tBlock instanceof GT_Block_Ores_Abstract)) {
TileEntity tTileEntity = aCrop.getWorld().getTileEntity(aCrop.getLocation().posX, aCrop.getLocation().posY - i, aCrop.getLocation().posZ);
if ((tTileEntity instanceof GT_TileEntity_Ores)) {
Materials tMaterial = GregTech_API.sGeneratedMaterials[(((GT_TileEntity_Ores) tTileEntity).mMetaData % 1000)];
diff --git a/src/main/java/gregtech/api/util/GT_Config.java b/src/main/java/gregtech/api/util/GT_Config.java
index f4631f5de6..23a43f7085 100644
--- a/src/main/java/gregtech/api/util/GT_Config.java
+++ b/src/main/java/gregtech/api/util/GT_Config.java
@@ -80,6 +80,18 @@ public class GT_Config implements Runnable {
return rResult;
}
+ public String get(Object aCategory, ItemStack aStack, String aDefault) {
+ return get(aCategory, getStackConfigName(aStack), aDefault);
+ }
+
+ public String get(Object aCategory, String aName, String aDefault) {
+ if (GT_Utility.isStringInvalid(aName)) return aDefault;
+ Property tProperty = mConfig.get(aCategory.toString().replaceAll("\\|", "_"), (aName + "_" + aDefault).replaceAll("\\|", "_"), aDefault);
+ String rResult = tProperty.getString();
+ if (!tProperty.wasRead() && GregTech_API.sPostloadFinished) mConfig.save();
+ return rResult;
+ }
+
@Override
public void run() {
mConfig.save();