aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/blocks
diff options
context:
space:
mode:
authorMuramasa <haydenkilloh@gmail.com>2016-09-15 15:48:47 +0100
committerMuramasa <haydenkilloh@gmail.com>2016-09-15 15:48:47 +0100
commitb22bb2dfa6ec7d1e91d8657fcb8bd0389ff7e74a (patch)
treeed46bf1d37f8a2d518381dfb3bacf7b48bb7cee6 /src/main/java/gregtech/common/blocks
parent1c195f5aab22c23aed4df944e49631e62312bd8b (diff)
parentb10acf8244e3e69f7b37af2a1506eb71f57834c2 (diff)
downloadGT5-Unofficial-b22bb2dfa6ec7d1e91d8657fcb8bd0389ff7e74a.tar.gz
GT5-Unofficial-b22bb2dfa6ec7d1e91d8657fcb8bd0389ff7e74a.tar.bz2
GT5-Unofficial-b22bb2dfa6ec7d1e91d8657fcb8bd0389ff7e74a.zip
Update Part 1
Diffstat (limited to 'src/main/java/gregtech/common/blocks')
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Block_Machines.java30
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java42
-rw-r--r--src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java7
3 files changed, 41 insertions, 38 deletions
diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Machines.java b/src/main/java/gregtech/common/blocks/GT_Block_Machines.java
index 2793130d91..d9c05fd17a 100644
--- a/src/main/java/gregtech/common/blocks/GT_Block_Machines.java
+++ b/src/main/java/gregtech/common/blocks/GT_Block_Machines.java
@@ -12,6 +12,7 @@ import gregtech.api.items.GT_Generic_Block;
import gregtech.api.metatileentity.BaseMetaPipeEntity;
import gregtech.api.metatileentity.BaseMetaTileEntity;
import gregtech.api.metatileentity.BaseTileEntity;
+import gregtech.api.objects.XSTR;
import gregtech.api.util.GT_BaseCrop;
import gregtech.api.util.GT_Log;
import gregtech.api.util.GT_Utility;
@@ -211,15 +212,13 @@ public class GT_Block_Machines
GregTech_API.sBlockIcons = aIconRegister;
GT_Log.out.println("GT_Mod: Registering MetaTileEntity specific Textures");
- for (IMetaTileEntity tMetaTileEntity : GregTech_API.METATILEENTITIES) {
- try {
+ try {
+ for (IMetaTileEntity tMetaTileEntity : GregTech_API.METATILEENTITIES) {
if (tMetaTileEntity != null) {
tMetaTileEntity.registerIcons(aIconRegister);
}
- } catch (Throwable e) {
- e.printStackTrace(GT_Log.err);
}
- }
+ } catch (Throwable e) {e.printStackTrace(GT_Log.err);}
GT_Log.out.println("GT_Mod: Registering Crop specific Textures");
try {
for (GT_BaseCrop tCrop : GT_BaseCrop.sCropList) {
@@ -230,13 +229,11 @@ public class GT_Block_Machines
}
GT_Log.out.println("GT_Mod: Starting Block Icon Load Phase");
System.out.println("GT_Mod: Starting Block Icon Load Phase");
- for (Runnable tRunnable : GregTech_API.sGTBlockIconload) {
- try {
+ try {
+ for (Runnable tRunnable : GregTech_API.sGTBlockIconload) {
tRunnable.run();
- } catch (Throwable e) {
- e.printStackTrace(GT_Log.err);
}
- }
+ } catch (Throwable e) {e.printStackTrace(GT_Log.err);}
GT_Log.out.println("GT_Mod: Finished Block Icon Load Phase");
System.out.println("GT_Mod: Finished Block Icon Load Phase");
}
@@ -281,8 +278,7 @@ public class GT_Block_Machines
public void onBlockClicked(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer) {
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if ((tTileEntity != null) &&
- ((tTileEntity instanceof IGregTechTileEntity))) {
+ if (((tTileEntity instanceof IGregTechTileEntity))) {
((IGregTechTileEntity) tTileEntity).onLeftclick(aPlayer);
}
}
@@ -308,7 +304,7 @@ public class GT_Block_Machines
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
if ((tTileEntity instanceof IGregTechTileEntity)) {
IGregTechTileEntity tGregTechTileEntity = (IGregTechTileEntity) tTileEntity;
- Random tRandom = new Random();
+ Random tRandom = new XSTR();
mTemporaryTileEntity.set(tGregTechTileEntity);
for (int i = 0; i < tGregTechTileEntity.getSizeInventory(); i++) {
ItemStack tItem = tGregTechTileEntity.getStackInSlot(i);
@@ -340,7 +336,7 @@ public class GT_Block_Machines
public int getComparatorInputOverride(World aWorld, int aX, int aY, int aZ, int aSide) {
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if ((tTileEntity != null) && ((tTileEntity instanceof IGregTechTileEntity))) {
+ if (((tTileEntity instanceof IGregTechTileEntity))) {
return ((IGregTechTileEntity) tTileEntity).getComparatorValue((byte) aSide);
}
return 0;
@@ -351,7 +347,7 @@ public class GT_Block_Machines
return 0;
}
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if ((tTileEntity != null) && ((tTileEntity instanceof IGregTechTileEntity))) {
+ if (((tTileEntity instanceof IGregTechTileEntity))) {
return ((IGregTechTileEntity) tTileEntity).getOutputRedstoneSignal(GT_Utility.getOppositeSide(aSide));
}
return 0;
@@ -362,7 +358,7 @@ public class GT_Block_Machines
return 0;
}
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if ((tTileEntity != null) && ((tTileEntity instanceof IGregTechTileEntity))) {
+ if (((tTileEntity instanceof IGregTechTileEntity))) {
return ((IGregTechTileEntity) tTileEntity).getStrongOutputRedstoneSignal(GT_Utility.getOppositeSide(aSide));
}
return 0;
@@ -428,7 +424,7 @@ public class GT_Block_Machines
public float getExplosionResistance(Entity par1Entity, World aWorld, int aX, int aY, int aZ, double explosionX, double explosionY, double explosionZ) {
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if ((tTileEntity != null) && ((tTileEntity instanceof IGregTechTileEntity))) {
+ if (((tTileEntity instanceof IGregTechTileEntity))) {
return ((IGregTechTileEntity) tTileEntity).getBlastResistance((byte) 6);
}
return 10.0F;
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 17351475b2..6cc77cd2a1 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
@@ -37,6 +37,8 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements
public static boolean FUCKING_LOCK = false;
public static boolean tHideOres;
public static int tOreMetaCount;
+ private final String aTextName = ".name";
+ private final String aTextSmall = "Small ";
protected GT_Block_Ores_Abstract(String aUnlocalizedName, int aOreMetaCount, boolean aHideFirstMeta, Material aMaterial) {
super(GT_Item_Ores.class, aUnlocalizedName, aMaterial);
@@ -53,8 +55,8 @@ 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++) {
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + (j * 1000)) + ".name", getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + ((i + 16000) + (j * 1000)) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
+ 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) {
GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[j] != null ? this.getProcessingPrefix()[j].get(GregTech_API.sGeneratedMaterials[i]) : "", new ItemStack(this, 1, i + (j * 1000)));
if (tHideOres) {
@@ -151,7 +153,7 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements
public abstract String getUnlocalizedName();
public String getLocalizedName() {
- return StatCollector.translateToLocal(getUnlocalizedName() + ".name");
+ return StatCollector.translateToLocal(getUnlocalizedName() + aTextName);
}
public int getRenderType() {
@@ -199,7 +201,7 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements
public int getDamageValue(World aWorld, int aX, int aY, int aZ) {
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if ((tTileEntity != null) && ((tTileEntity instanceof GT_TileEntity_Ores))) {
+ if (((tTileEntity instanceof GT_TileEntity_Ores))) {
return ((GT_TileEntity_Ores) tTileEntity).getMetaData();
}
return 0;
@@ -239,22 +241,22 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements
for (int i = 0; i < GregTech_API.sGeneratedMaterials.length; i++) {
Materials tMaterial = GregTech_API.sGeneratedMaterials[i];
if ((tMaterial != null) && ((tMaterial.mTypes & 0x8) != 0)) {
- if (!(new ItemStack(aItem, 1, i).getDisplayName().contains(".name"))) aList.add(new ItemStack(aItem, 1, i));
- if (!(new ItemStack(aItem, 1, i + 1000).getDisplayName().contains(".name"))) aList.add(new ItemStack(aItem, 1, i + 1000));
- if (!(new ItemStack(aItem, 1, i + 2000).getDisplayName().contains(".name"))) aList.add(new ItemStack(aItem, 1, i + 2000));
- if (!(new ItemStack(aItem, 1, i + 3000).getDisplayName().contains(".name"))) aList.add(new ItemStack(aItem, 1, i + 3000));
- if (!(new ItemStack(aItem, 1, i + 4000).getDisplayName().contains(".name"))) aList.add(new ItemStack(aItem, 1, i + 4000));
- if (!(new ItemStack(aItem, 1, i + 5000).getDisplayName().contains(".name"))) aList.add(new ItemStack(aItem, 1, i + 5000));
- if (!(new ItemStack(aItem, 1, i + 6000).getDisplayName().contains(".name"))) aList.add(new ItemStack(aItem, 1, i + 6000));
- if (!(new ItemStack(aItem, 1, i + 7000).getDisplayName().contains(".name"))) aList.add(new ItemStack(aItem, 1, i + 7000));
- if (!(new ItemStack(aItem, 1, i + 16000).getDisplayName().contains(".name"))) aList.add(new ItemStack(aItem, 1, i + 16000));
- if (!(new ItemStack(aItem, 1, i + 17000).getDisplayName().contains(".name"))) aList.add(new ItemStack(aItem, 1, i + 17000));
- if (!(new ItemStack(aItem, 1, i + 18000).getDisplayName().contains(".name"))) aList.add(new ItemStack(aItem, 1, i + 18000));
- if (!(new ItemStack(aItem, 1, i + 19000).getDisplayName().contains(".name"))) aList.add(new ItemStack(aItem, 1, i + 19000));
- if (!(new ItemStack(aItem, 1, i + 20000).getDisplayName().contains(".name"))) aList.add(new ItemStack(aItem, 1, i + 20000));
- if (!(new ItemStack(aItem, 1, i + 21000).getDisplayName().contains(".name"))) aList.add(new ItemStack(aItem, 1, i + 21000));
- if (!(new ItemStack(aItem, 1, i + 22000).getDisplayName().contains(".name"))) aList.add(new ItemStack(aItem, 1, i + 22000));
- if (!(new ItemStack(aItem, 1, i + 23000).getDisplayName().contains(".name"))) aList.add(new ItemStack(aItem, 1, i + 23000));
+ 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));
+ if (!(new ItemStack(aItem, 1, i + 3000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 3000));
+ if (!(new ItemStack(aItem, 1, i + 4000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 4000));
+ if (!(new ItemStack(aItem, 1, i + 5000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 5000));
+ if (!(new ItemStack(aItem, 1, i + 6000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 6000));
+ if (!(new ItemStack(aItem, 1, i + 7000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 7000));
+ if (!(new ItemStack(aItem, 1, i + 16000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 16000));
+ if (!(new ItemStack(aItem, 1, i + 17000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 17000));
+ if (!(new ItemStack(aItem, 1, i + 18000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 18000));
+ if (!(new ItemStack(aItem, 1, i + 19000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 19000));
+ if (!(new ItemStack(aItem, 1, i + 20000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 20000));
+ if (!(new ItemStack(aItem, 1, i + 21000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 21000));
+ if (!(new ItemStack(aItem, 1, i + 22000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 22000));
+ if (!(new ItemStack(aItem, 1, i + 23000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 23000));
}
}
}
diff --git a/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java b/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java
index b3a28fb0ae..587a08a538 100644
--- a/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java
+++ b/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java
@@ -9,6 +9,7 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.ITexturedTileEntity;
import gregtech.api.objects.GT_CopiedBlockTexture;
import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.objects.XSTR;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
import net.minecraft.block.Block;
@@ -54,16 +55,19 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit
if (GregTech_API.sBlockOresUb1 != null) {
tOreBlock = GregTech_API.sBlockOresUb1;
aMetaData += (BlockMeta * 1000);
+ //System.out.println("Block changed to UB1");
}
} else if (BlockName.equals("tile.metamorphicStone")) {
if (GregTech_API.sBlockOresUb2 != null) {
tOreBlock = GregTech_API.sBlockOresUb2;
aMetaData += (BlockMeta * 1000);
+ //System.out.println("Block changed to UB2");
}
} else if (BlockName.equals("tile.sedimentaryStone")) {
if (GregTech_API.sBlockOresUb3 != null) {
tOreBlock = GregTech_API.sBlockOresUb3;
aMetaData += (BlockMeta * 1000);
+ //System.out.println("Block changed to UB3");
}
} else if (BlockName.equals("tile.moonBlock") && (BlockMeta == 3 || BlockMeta == 4)) {
if (GregTech_API.sBlockOresGC != null) {
@@ -106,6 +110,7 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit
} else if (!tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)) {
return false;
}
+ System.out.println(tOreBlock);
aWorld.setBlock(aX, aY, aZ, tOreBlock, getHarvestData((short) aMetaData), 0);
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
if ((tTileEntity instanceof GT_TileEntity_Ores)) {
@@ -208,7 +213,7 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit
aFortune = 0;
}
if (aMaterial != null) {
- Random tRandom = new Random(this.xCoord ^ this.yCoord ^ this.zCoord);
+ Random tRandom = new XSTR(this.xCoord ^ this.yCoord ^ this.zCoord);
ArrayList<ItemStack> tSelector = new ArrayList();