Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for GT granite/marble/basalt generating into ores #1571

Open
wants to merge 2 commits into
base: unstable
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public Packet getDescriptionPacket() {
}

public void overrideOreBlockMaterial(Block aOverridingStoneBlock, byte aOverridingStoneMeta) {
if(this.worldObj == null || blockType==null)return;
if(this.worldObj == null)return;
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));
Expand All @@ -174,7 +174,7 @@ public void overrideOreBlockMaterial(Block aOverridingStoneBlock, byte aOverridi
this.mMetaData = ((short) (this.mMetaData + 5000));
}
}
this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, getHarvestData(this.mMetaData, ((GT_Block_Ores_Abstract) blockType).getBaseBlockHarvestLevel(mMetaData % 16000 / 1000)), 0);
this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, getHarvestData(this.mMetaData, ((GT_Block_Ores_Abstract) GregTech_API.sBlockOres1).getBaseBlockHarvestLevel(mMetaData % 16000 / 1000)), 0);
}

public void convertOreBlock(World aWorld, int aX, int aY, int aZ) {
Expand All @@ -183,7 +183,7 @@ public void convertOreBlock(World aWorld, int aX, int aY, int aZ) {
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(aMeta, ((GT_Block_Ores_Abstract) tTileEntity.blockType).getBaseBlockHarvestLevel(aMeta % 16000 / 1000)), 0);
this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, getHarvestData(aMeta, ((GT_Block_Ores_Abstract) GregTech_API.sBlockOres1).getBaseBlockHarvestLevel(aMeta % 16000 / 1000)), 0);
}
}

Expand Down