aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/blocks
diff options
context:
space:
mode:
authorDream-Master <dream-master@gmx.net>2017-09-12 23:38:33 +0200
committerDream-Master <dream-master@gmx.net>2017-09-12 23:38:33 +0200
commit0f518a8af78e6ba89208244553998332e969be81 (patch)
treea6a7b76e253404263f37a751b25d4ad643fe484e /src/main/java/gregtech/common/blocks
parenta0f77c34ab2d90afabd810bca814c87d5de704c1 (diff)
downloadGT5-Unofficial-0f518a8af78e6ba89208244553998332e969be81.tar.gz
GT5-Unofficial-0f518a8af78e6ba89208244553998332e969be81.tar.bz2
GT5-Unofficial-0f518a8af78e6ba89208244553998332e969be81.zip
Enable Ores in Marble and Basalt too. Update a few files
Diffstat (limited to 'src/main/java/gregtech/common/blocks')
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Block_Ores.java28
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java14
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java7
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java7
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java7
5 files changed, 37 insertions, 26 deletions
diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores.java
index 70200e5199..bab31d85ed 100644
--- a/src/main/java/gregtech/common/blocks/GT_Block_Ores.java
+++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores.java
@@ -1,5 +1,6 @@
package gregtech.common.blocks;
+import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
@@ -47,27 +48,16 @@ public class GT_Block_Ores extends GT_Block_Ores_Abstract {
@Override
public Materials[] getDroppedDusts() { //Must have 8 entries; can be null.
- return new Materials[]{Materials.Stone, Materials.Netherrack, Materials.Endstone, Materials.GraniteBlack, Materials.GraniteRed, Materials.Marble, Materials.Basalt, null};
+ return new Materials[]{Materials.Stone, Materials.Netherrack, Materials.Endstone, Materials.GraniteBlack, Materials.GraniteRed, Materials.Marble, Materials.Basalt, Materials.Stone};
+ }
+
+ @Override
+ public boolean[] getEnabledMetas() {
+ return new boolean[]{true, true, true, GT_Mod.gregtechproxy.enableBlackGraniteOres, GT_Mod.gregtechproxy.enableRedGraniteOres, GT_Mod.gregtechproxy.enableMarbleOres, GT_Mod.gregtechproxy.enableBasaltOres, true};
}
@Override
public ITexture[] getTextureSet() { //Must have 16 entries.
- return new ITexture[]{
- new GT_CopiedBlockTexture(Blocks.stone, 0, 0),
- new GT_CopiedBlockTexture(Blocks.netherrack, 0, 0),
- new GT_CopiedBlockTexture(Blocks.end_stone, 0, 0),
- new GT_RenderedTexture(Textures.BlockIcons.GRANITE_BLACK_STONE),
- new GT_RenderedTexture(Textures.BlockIcons.GRANITE_RED_STONE),
- new GT_RenderedTexture(Textures.BlockIcons.MARBLE_STONE),
- new GT_RenderedTexture(Textures.BlockIcons.BASALT_STONE),
- new GT_CopiedBlockTexture(Blocks.stone, 0, 0),
- new GT_CopiedBlockTexture(Blocks.stone, 0, 0),
- new GT_CopiedBlockTexture(Blocks.netherrack, 0, 0),
- new GT_CopiedBlockTexture(Blocks.end_stone, 0, 0),
- new GT_RenderedTexture(Textures.BlockIcons.GRANITE_BLACK_STONE),
- new GT_RenderedTexture(Textures.BlockIcons.GRANITE_RED_STONE),
- new GT_RenderedTexture(Textures.BlockIcons.MARBLE_STONE),
- new GT_RenderedTexture(Textures.BlockIcons.BASALT_STONE),
- new GT_CopiedBlockTexture(Blocks.stone, 0, 0)};
+ return new ITexture[]{new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.netherrack, 0, 0), new GT_CopiedBlockTexture(Blocks.end_stone, 0, 0), new GT_RenderedTexture(Textures.BlockIcons.GRANITE_BLACK_STONE), new GT_RenderedTexture(Textures.BlockIcons.GRANITE_RED_STONE), new GT_RenderedTexture(Textures.BlockIcons.MARBLE_STONE), new GT_RenderedTexture(Textures.BlockIcons.BASALT_STONE), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0)};
}
-}
+} \ No newline at end of file
diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java
index 1d63d8bfb8..5595fa8673 100644
--- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java
+++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java
@@ -30,14 +30,17 @@ 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<>();
+ public static ThreadLocal<GT_TileEntity_Ores> mTemporaryTileEntity = new ThreadLocal();
public static boolean FUCKING_LOCK = false;
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);
@@ -45,7 +48,7 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements
setStepSound(soundTypeStone);
setCreativeTab(GregTech_API.TAB_GREGTECH_ORES);
tHideOres = Loader.isModLoaded("NotEnoughItems") && GT_Mod.gregtechproxy.mHideUnusedOres;
- if (aOreMetaCount > 8 || aOreMetaCount < 0) aOreMetaCount = 8;
+ if(aOreMetaCount > 8 || aOreMetaCount < 0) aOreMetaCount = 8;
for (int i = 0; i < 16; i++) {
GT_ModHandler.addValuableOre(this, i, 1);
@@ -53,9 +56,10 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements
for (int i = 1; i < GregTech_API.sGeneratedMaterials.length; i++) {
if (GregTech_API.sGeneratedMaterials[i] != null) {
for (int j = 0; j < aOreMetaCount; j++) {
+ 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)) {
@@ -222,6 +226,8 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements
public abstract OrePrefixes[] getProcessingPrefix(); //Must have 8 entries; an entry can be null to disable automatic recipes.
+ public abstract boolean[] getEnabledMetas(); //Must have 8 entries.
+
public abstract Block getDroppedBlock();
public abstract Materials[] getDroppedDusts(); //Must have 8 entries; can be null.
@@ -244,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));
diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java
index 52c5710ae9..bea2320f01 100644
--- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java
+++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java
@@ -44,7 +44,12 @@ public class GT_Block_Ores_UB1 extends GT_Block_Ores_Abstract {
}
@Override
+ public boolean[] getEnabledMetas() {
+ return new boolean[]{true, true, true, true, true, true, true, true};
+ }
+
+ @Override
public ITexture[] getTextureSet() { //Must have 16 entries.
return new ITexture[]{new GT_CopiedBlockTexture(aUBBlock, 0, 0), new GT_CopiedBlockTexture(aUBBlock, 0, 1), new GT_CopiedBlockTexture(aUBBlock, 0, 2), new GT_CopiedBlockTexture(aUBBlock, 0, 3), new GT_CopiedBlockTexture(aUBBlock, 0, 4), new GT_CopiedBlockTexture(aUBBlock, 0, 5), new GT_CopiedBlockTexture(aUBBlock, 0, 6), new GT_CopiedBlockTexture(aUBBlock, 0, 7), new GT_CopiedBlockTexture(aUBBlock, 0, 0), new GT_CopiedBlockTexture(aUBBlock, 0, 1), new GT_CopiedBlockTexture(aUBBlock, 0, 2), new GT_CopiedBlockTexture(aUBBlock, 0, 3), new GT_CopiedBlockTexture(aUBBlock, 0, 4), new GT_CopiedBlockTexture(aUBBlock, 0, 5), new GT_CopiedBlockTexture(aUBBlock, 0, 6), new GT_CopiedBlockTexture(aUBBlock, 0, 7)};
}
-}
+} \ No newline at end of file
diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java
index 78526c84c5..d3278f0cb4 100644
--- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java
+++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java
@@ -44,7 +44,12 @@ public class GT_Block_Ores_UB2 extends GT_Block_Ores_Abstract {
}
@Override
+ public boolean[] getEnabledMetas() {
+ return new boolean[]{true, true, true, true, true, true, true, true};
+ }
+
+ @Override
public ITexture[] getTextureSet() { //Must have 16 entries.
return new ITexture[]{new GT_CopiedBlockTexture(aUBBlock, 0, 0), new GT_CopiedBlockTexture(aUBBlock, 0, 1), new GT_CopiedBlockTexture(aUBBlock, 0, 2), new GT_CopiedBlockTexture(aUBBlock, 0, 3), new GT_CopiedBlockTexture(aUBBlock, 0, 4), new GT_CopiedBlockTexture(aUBBlock, 0, 5), new GT_CopiedBlockTexture(aUBBlock, 0, 6), new GT_CopiedBlockTexture(aUBBlock, 0, 7), new GT_CopiedBlockTexture(aUBBlock, 0, 0), new GT_CopiedBlockTexture(aUBBlock, 0, 1), new GT_CopiedBlockTexture(aUBBlock, 0, 2), new GT_CopiedBlockTexture(aUBBlock, 0, 3), new GT_CopiedBlockTexture(aUBBlock, 0, 4), new GT_CopiedBlockTexture(aUBBlock, 0, 5), new GT_CopiedBlockTexture(aUBBlock, 0, 6), new GT_CopiedBlockTexture(aUBBlock, 0, 7)};
}
-}
+} \ No newline at end of file
diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java
index dc5e07a115..7942d80b22 100644
--- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java
+++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java
@@ -44,7 +44,12 @@ public class GT_Block_Ores_UB3 extends GT_Block_Ores_Abstract {
}
@Override
+ public boolean[] getEnabledMetas() {
+ return new boolean[]{true, true, true, true, true, true, true, true};
+ }
+
+ @Override
public ITexture[] getTextureSet() { //Must have 16 entries.
return new ITexture[]{new GT_CopiedBlockTexture(aUBBlock, 0, 0), new GT_CopiedBlockTexture(aUBBlock, 0, 1), new GT_CopiedBlockTexture(aUBBlock, 0, 2), new GT_CopiedBlockTexture(aUBBlock, 0, 3), new GT_CopiedBlockTexture(aUBBlock, 0, 4), new GT_CopiedBlockTexture(aUBBlock, 0, 5), new GT_CopiedBlockTexture(aUBBlock, 0, 6), new GT_CopiedBlockTexture(aUBBlock, 0, 7), new GT_CopiedBlockTexture(aUBBlock, 0, 0), new GT_CopiedBlockTexture(aUBBlock, 0, 1), new GT_CopiedBlockTexture(aUBBlock, 0, 2), new GT_CopiedBlockTexture(aUBBlock, 0, 3), new GT_CopiedBlockTexture(aUBBlock, 0, 4), new GT_CopiedBlockTexture(aUBBlock, 0, 5), new GT_CopiedBlockTexture(aUBBlock, 0, 6), new GT_CopiedBlockTexture(aUBBlock, 0, 7)};
}
-}
+} \ No newline at end of file