Reduce Marble/Basalt harvest level and setOreBlock fixes

This commit is contained in:
Muramasa 2016-09-16 15:42:27 +01:00
parent 0e60389c41
commit 769362d60b
2 changed files with 34 additions and 38 deletions

View file

@ -48,7 +48,7 @@ public class GT_Block_Stones extends GT_Block_Stones_Abstract {
} }
public int getHarvestLevel(int aMeta) { public int getHarvestLevel(int aMeta) {
return 2; return 1;
} }
public float getBlockHardness(World aWorld, int aX, int aY, int aZ) { public float getBlockHardness(World aWorld, int aX, int aY, int aZ) {

View file

@ -46,43 +46,13 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit
aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1)); aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1));
} }
Block tBlock = aWorld.getBlock(aX, aY, aZ); Block tBlock = aWorld.getBlock(aX, aY, aZ);
Block tOreBlock = GregTech_API.sBlockOres1; Block tOreBlock = null;
int BlockMeta = aWorld.getBlockMetadata(aX, aY, aZ); int BlockMeta = aWorld.getBlockMetadata(aX, aY, aZ);
String BlockName = tBlock.getUnlocalizedName(); String BlockName = tBlock.getUnlocalizedName();
aMetaData += isSmallOre ? 16000 : 0; aMetaData += isSmallOre ? 16000 : 0;
if ((aMetaData > 0) && ((tBlock != Blocks.air) || air)) { if ((aMetaData > 0) && ((tBlock != Blocks.air) || air)) {
if (BlockName.equals("tile.igneousStone")) { if (tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)) {
if (GregTech_API.sBlockOresUb1 != null) { tOreBlock = GregTech_API.sBlockOres1;
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) {
switch (BlockMeta) {
case 3: tOreBlock = GregTech_API.sBlockOresGC; break;
case 4: aMetaData += 1000; tOreBlock = GregTech_API.sBlockOresGC; break;
}
}
} else if (BlockName.equals("tile.mars") && (BlockMeta == 6 || BlockMeta == 9)) {
if (GregTech_API.sBlockOresGC != null) {
switch (BlockMeta) {
case 6: aMetaData += 2000; tOreBlock = GregTech_API.sBlockOresGC; break;
case 9: aMetaData += 3000; tOreBlock = GregTech_API.sBlockOresGC; break;
}
}
} else if (tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.netherrack)) { } else if (tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.netherrack)) {
aMetaData += 1000; aMetaData += 1000;
} else if (tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.end_stone)) { } else if (tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.end_stone)) {
@ -107,10 +77,36 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit
} else { } else {
aMetaData += 5000; aMetaData += 5000;
} }
} else if (!tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)) { } else if (BlockName.equals("tile.igneousStone")) {
return false; if (GregTech_API.sBlockOresUb1 != null) {
} tOreBlock = GregTech_API.sBlockOresUb1;
System.out.println(tOreBlock); aMetaData += (BlockMeta * 1000);
}
} else if (BlockName.equals("tile.metamorphicStone")) {
if (GregTech_API.sBlockOresUb2 != null) {
tOreBlock = GregTech_API.sBlockOresUb2;
aMetaData += (BlockMeta * 1000);
}
} else if (BlockName.equals("tile.sedimentaryStone")) {
if (GregTech_API.sBlockOresUb3 != null) {
tOreBlock = GregTech_API.sBlockOresUb3;
aMetaData += (BlockMeta * 1000);
}
} else if (BlockName.equals("tile.moonBlock") && (BlockMeta == 3 || BlockMeta == 4)) {
if (GregTech_API.sBlockOresGC != null) {
switch (BlockMeta) {
case 3: tOreBlock = GregTech_API.sBlockOresGC; break;
case 4: aMetaData += 1000; tOreBlock = GregTech_API.sBlockOresGC; break;
}
}
} else if (BlockName.equals("tile.mars") && (BlockMeta == 6 || BlockMeta == 9)) {
if (GregTech_API.sBlockOresGC != null) {
switch (BlockMeta) {
case 6: aMetaData += 2000; tOreBlock = GregTech_API.sBlockOresGC; break;
case 9: aMetaData += 3000; tOreBlock = GregTech_API.sBlockOresGC; break;
}
}
} else tOreBlock = GregTech_API.sBlockOres1;
aWorld.setBlock(aX, aY, aZ, tOreBlock, getHarvestData((short) aMetaData), 0); aWorld.setBlock(aX, aY, aZ, tOreBlock, getHarvestData((short) aMetaData), 0);
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
if ((tTileEntity instanceof GT_TileEntity_Ores)) { if ((tTileEntity instanceof GT_TileEntity_Ores)) {