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:
Muramasa 2016-07-23 03:09:25 +01:00
parent 2704680a2e
commit d756cebd17
4 changed files with 14 additions and 15 deletions

View file

@ -60,12 +60,13 @@ public class GT_Worldgen_Stone
if (tTargetedBlock instanceof GT_Block_Ores_Abstract) {
TileEntity tTileEntity = aWorld.getTileEntity(eX, eY, eZ);
if ((tTileEntity instanceof GT_TileEntity_Ores)) {
if(tTargetedBlock != GregTech_API.sBlockOres1) {
((GT_TileEntity_Ores) tTileEntity).convertOreBlock(aWorld, ((GT_TileEntity_Ores) tTileEntity).mMetaData, eX, eY, eZ);
short aMeta = ((GT_TileEntity_Ores) tTileEntity).mMetaData;
if (tTargetedBlock != GregTech_API.sBlockOres1) {
((GT_TileEntity_Ores) tTileEntity).convertOreBlock(aWorld, aMeta, eX, eY, eZ);
}
((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);
}
}

View file

@ -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 + 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 + 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) {
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));
@ -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 + 19000));
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 + 19000));
aList.add(new ItemStack(aItem, 1, i + 20000));
aList.add(new ItemStack(aItem, 1, i + 21000));
aList.add(new ItemStack(aItem, 1, i + 22000));
}
}
}

View file

@ -4,12 +4,9 @@ import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_LanguageManager;
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.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
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();
}
public boolean canEntityDestroy(IBlockAccess world, int x, int y, int z, Entity entity) {
return !(entity instanceof EntityWither);
}
}

View file

@ -126,7 +126,6 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit
}
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));
if (aOverridingStoneBlock.isReplaceableOreGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, Blocks.netherrack)) {
this.mMetaData = ((short) (this.mMetaData + 1000));
@ -149,18 +148,19 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit
} else {
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);
}
}
public void convertOreBlock(World aWorld, short aMeta, int aX, int aY, int aZ) {
aWorld.setBlock(aX, aY, aZ, GregTech_API.sBlockOres1);
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
if (tTileEntity instanceof GT_TileEntity_Ores) {
((GT_TileEntity_Ores) tTileEntity).mMetaData = aMeta;
this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, getHarvestData(this.mMetaData), 0);
((GT_TileEntity_Ores) tTileEntity).mMetaData = (short)(aMeta % 1000);
this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, getHarvestData((short)(aMeta % 1000)), 0);
}
}