aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/tileentities/machines
diff options
context:
space:
mode:
authorDavid Vierra <codewarrior@hawaii.rr.com>2016-12-04 15:15:33 -1000
committerDream-Master <dream-master@gmx.net>2017-01-18 10:00:36 +0100
commit2c65fddb561a7050db240c61d20cfcb94acb5b7a (patch)
treeda7e100e3e8ba683e3582da641163d5819eb0e77 /src/main/java/gregtech/common/tileentities/machines
parent123b8527116b15ee8f4e6a8e177720b68adbcee2 (diff)
downloadGT5-Unofficial-2c65fddb561a7050db240c61d20cfcb94acb5b7a.tar.gz
GT5-Unofficial-2c65fddb561a7050db240c61d20cfcb94acb5b7a.tar.bz2
GT5-Unofficial-2c65fddb561a7050db240c61d20cfcb94acb5b7a.zip
Fix Advanced Miner II occasionally outputting the wrong blocks
AdvMinerII would occasionally output the drops from a block recently broken by the player. This happens when the wrong coordinates are passed to GT_Block_Ores_Abstract.getDrops(), which causes it to fail to find the TileEntity and then fall back to whatever the most recently broken block was. Fixes #751 (probably), #674, #508
Diffstat (limited to 'src/main/java/gregtech/common/tileentities/machines')
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AdvMiner2.java18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AdvMiner2.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AdvMiner2.java
index 14ac58c9e2..ba2aef3291 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AdvMiner2.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AdvMiner2.java
@@ -134,7 +134,8 @@ public class GT_MetaTileEntity_AdvMiner2 extends GT_MetaTileEntity_MultiBlockBas
}
ArrayList<ItemStack> tDrops = new ArrayList();
Block tMineBlock = null;
- ChunkPosition mle = null;;
+ ChunkPosition mle = null;
+ int posX, posY, posZ, offX, offY, offZ;
while ((tMineBlock==null || tMineBlock == Blocks.air) && !mMineList.isEmpty()) {
mle = mMineList.get(0);
mMineList.remove(0);
@@ -142,8 +143,15 @@ public class GT_MetaTileEntity_AdvMiner2 extends GT_MetaTileEntity_MultiBlockBas
}
if (tMineBlock!=null && tMineBlock!=Blocks.air) {
- int metadata = getBaseMetaTileEntity().getMetaIDOffset(mle.chunkPosX, mle.chunkPosY, mle.chunkPosZ);
- boolean silkTouch = tMineBlock.canSilkHarvest(getBaseMetaTileEntity().getWorld(), null, mle.chunkPosX, mle.chunkPosY, mle.chunkPosZ, metadata);
+ posX = mle.chunkPosX + getBaseMetaTileEntity().getXCoord();
+ posY = mle.chunkPosY + getBaseMetaTileEntity().getYCoord();
+ posZ = mle.chunkPosZ + getBaseMetaTileEntity().getZCoord();
+ offX = mle.chunkPosX;
+ offY = mle.chunkPosY;
+ offZ = mle.chunkPosZ;
+
+ int metadata = getBaseMetaTileEntity().getMetaIDOffset(offX, offY, offZ);
+ boolean silkTouch = tMineBlock.canSilkHarvest(getBaseMetaTileEntity().getWorld(), null, posX, posY, posZ, metadata);
if (silkTouch){
ItemStack IS = new ItemStack(tMineBlock);
IS.setItemDamage(metadata);
@@ -151,10 +159,10 @@ public class GT_MetaTileEntity_AdvMiner2 extends GT_MetaTileEntity_MultiBlockBas
tDrops.add(IS);
}
else{
- tDrops = tMineBlock.getDrops(getBaseMetaTileEntity().getWorld(), mle.chunkPosX, mle.chunkPosY, mle.chunkPosZ, metadata, 1);
+ tDrops = tMineBlock.getDrops(getBaseMetaTileEntity().getWorld(), posX, posY, posZ, metadata, 1);
}
- getBaseMetaTileEntity().getWorld().setBlockToAir(mle.chunkPosX + getBaseMetaTileEntity().getXCoord(), mle.chunkPosY + getBaseMetaTileEntity().getYCoord(), mle.chunkPosZ + getBaseMetaTileEntity().getZCoord());
+ getBaseMetaTileEntity().getWorld().setBlockToAir(posX, posY, posZ);
if (!tDrops.isEmpty()) {
ItemData tData = GT_OreDictUnificator.getItemData(tDrops.get(0).copy());
if (tData.mPrefix != OrePrefixes.crushed && tData.mMaterial.mMaterial != Materials.Oilsands) {