Fix "stone" veins
Fix an issue where an "stone" vein would override ore textures but not other stones. Added missing small ore for marble and basalt. Removed wither check from Block_Stones.
This commit is contained in:
parent
2704680a2e
commit
d756cebd17
4 changed files with 14 additions and 15 deletions
|
@ -60,12 +60,13 @@ public class GT_Worldgen_Stone
|
||||||
if (tTargetedBlock instanceof GT_Block_Ores_Abstract) {
|
if (tTargetedBlock instanceof GT_Block_Ores_Abstract) {
|
||||||
TileEntity tTileEntity = aWorld.getTileEntity(eX, eY, eZ);
|
TileEntity tTileEntity = aWorld.getTileEntity(eX, eY, eZ);
|
||||||
if ((tTileEntity instanceof GT_TileEntity_Ores)) {
|
if ((tTileEntity instanceof GT_TileEntity_Ores)) {
|
||||||
|
short aMeta = ((GT_TileEntity_Ores) tTileEntity).mMetaData;
|
||||||
if (tTargetedBlock != GregTech_API.sBlockOres1) {
|
if (tTargetedBlock != GregTech_API.sBlockOres1) {
|
||||||
((GT_TileEntity_Ores) tTileEntity).convertOreBlock(aWorld, ((GT_TileEntity_Ores) tTileEntity).mMetaData, eX, eY, eZ);
|
((GT_TileEntity_Ores) tTileEntity).convertOreBlock(aWorld, aMeta, eX, eY, eZ);
|
||||||
}
|
}
|
||||||
((GT_TileEntity_Ores)tTileEntity).overrideOreBlockMaterial(this.mBlock, (byte) this.mBlockMeta);
|
((GT_TileEntity_Ores)tTileEntity).overrideOreBlockMaterial(this.mBlock, (byte) this.mBlockMeta);
|
||||||
}
|
}
|
||||||
} else if (((this.mAllowToGenerateinVoid) && (aWorld.getBlock(eX, eY, eZ).isAir(aWorld, eX, eY, eZ))) || ((tTargetedBlock != null) && ((tTargetedBlock.isReplaceableOreGen(aWorld, eX, eY, eZ, Blocks.stone)) || (tTargetedBlock.isReplaceableOreGen(aWorld, eX, eY, eZ, Blocks.end_stone)) || (tTargetedBlock.isReplaceableOreGen(aWorld, eX, eY, eZ, Blocks.netherrack))))) {
|
} else if (((this.mAllowToGenerateinVoid) && (aWorld.getBlock(eX, eY, eZ).isAir(aWorld, eX, eY, eZ))) || ((tTargetedBlock != null) && ((tTargetedBlock.isReplaceableOreGen(aWorld, eX, eY, eZ, Blocks.stone)) || (tTargetedBlock.isReplaceableOreGen(aWorld, eX, eY, eZ, Blocks.end_stone)) || (tTargetedBlock.isReplaceableOreGen(aWorld, eX, eY, eZ, Blocks.netherrack)) || (tTargetedBlock.isReplaceableOreGen(aWorld, eX, eY, eZ, GregTech_API.sBlockGranites)) || (tTargetedBlock.isReplaceableOreGen(aWorld, eX, eY, eZ, GregTech_API.sBlockStones))))) {
|
||||||
aWorld.setBlock(eX, eY, eZ, this.mBlock, this.mBlockMeta, 0);
|
aWorld.setBlock(eX, eY, eZ, this.mBlock, this.mBlockMeta, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,8 @@ public class GT_Block_Ores extends GT_Block_Ores_Abstract {
|
||||||
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 18000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
|
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 18000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
|
||||||
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 19000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
|
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 19000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
|
||||||
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 20000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
|
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 20000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
|
||||||
|
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 21000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
|
||||||
|
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 22000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
|
||||||
if ((GregTech_API.sGeneratedMaterials[i].mTypes & 0x8) != 0) {
|
if ((GregTech_API.sGeneratedMaterials[i].mTypes & 0x8) != 0) {
|
||||||
GT_OreDictUnificator.registerOre(OrePrefixes.ore.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i));
|
GT_OreDictUnificator.registerOre(OrePrefixes.ore.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i));
|
||||||
GT_OreDictUnificator.registerOre(OrePrefixes.oreNetherrack.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 1000));
|
GT_OreDictUnificator.registerOre(OrePrefixes.oreNetherrack.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 1000));
|
||||||
|
@ -62,6 +63,8 @@ public class GT_Block_Ores extends GT_Block_Ores_Abstract {
|
||||||
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 18000));
|
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 18000));
|
||||||
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 19000));
|
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 19000));
|
||||||
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 20000));
|
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 20000));
|
||||||
|
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 21000));
|
||||||
|
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 22000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -110,6 +113,8 @@ public class GT_Block_Ores extends GT_Block_Ores_Abstract {
|
||||||
aList.add(new ItemStack(aItem, 1, i + 18000));
|
aList.add(new ItemStack(aItem, 1, i + 18000));
|
||||||
aList.add(new ItemStack(aItem, 1, i + 19000));
|
aList.add(new ItemStack(aItem, 1, i + 19000));
|
||||||
aList.add(new ItemStack(aItem, 1, i + 20000));
|
aList.add(new ItemStack(aItem, 1, i + 20000));
|
||||||
|
aList.add(new ItemStack(aItem, 1, i + 21000));
|
||||||
|
aList.add(new ItemStack(aItem, 1, i + 22000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,12 +4,9 @@ import gregtech.api.enums.Materials;
|
||||||
import gregtech.api.enums.OrePrefixes;
|
import gregtech.api.enums.OrePrefixes;
|
||||||
import gregtech.api.util.GT_LanguageManager;
|
import gregtech.api.util.GT_LanguageManager;
|
||||||
import gregtech.api.util.GT_OreDictUnificator;
|
import gregtech.api.util.GT_OreDictUnificator;
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.boss.EntityWither;
|
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.world.IBlockAccess;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class GT_Block_Stones extends GT_Block_Stones_Abstract {
|
public class GT_Block_Stones extends GT_Block_Stones_Abstract {
|
||||||
|
@ -64,8 +61,4 @@ public class GT_Block_Stones extends GT_Block_Stones_Abstract {
|
||||||
}
|
}
|
||||||
return gregtech.api.enums.Textures.BlockIcons.STONES[0].getIcon();
|
return gregtech.api.enums.Textures.BlockIcons.STONES[0].getIcon();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canEntityDestroy(IBlockAccess world, int x, int y, int z, Entity entity) {
|
|
||||||
return !(entity instanceof EntityWither);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,7 +126,6 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit
|
||||||
}
|
}
|
||||||
|
|
||||||
public void overrideOreBlockMaterial(Block aOverridingStoneBlock, byte aOverridingStoneMeta) {
|
public void overrideOreBlockMaterial(Block aOverridingStoneBlock, byte aOverridingStoneMeta) {
|
||||||
if (this.mMetaData < 3000) { //Avoid existing "stone" vein having it's ore meta changed if a new vein is generated around it.
|
|
||||||
this.mMetaData = ((short) (int) (this.mMetaData % 1000L + this.mMetaData / 16000L * 16000L));
|
this.mMetaData = ((short) (int) (this.mMetaData % 1000L + this.mMetaData / 16000L * 16000L));
|
||||||
if (aOverridingStoneBlock.isReplaceableOreGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, Blocks.netherrack)) {
|
if (aOverridingStoneBlock.isReplaceableOreGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, Blocks.netherrack)) {
|
||||||
this.mMetaData = ((short) (this.mMetaData + 1000));
|
this.mMetaData = ((short) (this.mMetaData + 1000));
|
||||||
|
@ -149,18 +148,19 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit
|
||||||
} else {
|
} else {
|
||||||
this.mMetaData = ((short) (this.mMetaData + 6000));
|
this.mMetaData = ((short) (this.mMetaData + 6000));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
this.mMetaData = ((short) (this.mMetaData + 5000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, getHarvestData(this.mMetaData), 0);
|
this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, getHarvestData(this.mMetaData), 0);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void convertOreBlock(World aWorld, short aMeta, int aX, int aY, int aZ) {
|
public void convertOreBlock(World aWorld, short aMeta, int aX, int aY, int aZ) {
|
||||||
aWorld.setBlock(aX, aY, aZ, GregTech_API.sBlockOres1);
|
aWorld.setBlock(aX, aY, aZ, GregTech_API.sBlockOres1);
|
||||||
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) {
|
||||||
((GT_TileEntity_Ores) tTileEntity).mMetaData = aMeta;
|
((GT_TileEntity_Ores) tTileEntity).mMetaData = (short)(aMeta % 1000);
|
||||||
this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, getHarvestData(this.mMetaData), 0);
|
this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, getHarvestData((short)(aMeta % 1000)), 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue