AdvMinerII: check that ore block still exists; consider chance output
This commit is contained in:
Dream-Master 2016-06-22 23:11:45 +02:00
parent 18eb7bc358
commit e1ebdd82f8
2 changed files with 16 additions and 11 deletions

View file

@ -1,7 +1,7 @@
minecraft.version=1.7.10
forge.version=10.13.4.1566-1.7.10
gt.version=5.09.22.1
gt.version=5.09.22.2
ae2.version=rv2-beta-33
applecore.version=1.7.10-1.2.1+107.59407

View file

@ -62,7 +62,7 @@ public class GT_MetaTileEntity_AdvMiner2 extends GT_MetaTileEntity_MultiBlockBas
}
public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "Advanced_Miner2.png");
return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "DrillingRig.png");
}
@Override
@ -71,15 +71,15 @@ public class GT_MetaTileEntity_AdvMiner2 extends GT_MetaTileEntity_MultiBlockBas
ArrayList<ItemStack> tItems = getStoredInputs();
for (ItemStack tStack : tItems) {
if (tStack.isItemEqual(GT_ModHandler.getIC2Item("miningPipe", 1L))) {
tStack.stackSize--;
tStack.stackSize--;
if (tStack.stackSize < 1) {
tStack = null;
}
if (mInventory[1] == null) {
mInventory[1] = GT_ModHandler.getIC2Item("miningPipe", 1L);
} else {
mInventory[1].stackSize++;
}
if (mInventory[1] == null) {
mInventory[1] = GT_ModHandler.getIC2Item("miningPipe", 1L);
} else {
mInventory[1].stackSize++;
}
}
}
@ -119,10 +119,13 @@ public class GT_MetaTileEntity_AdvMiner2 extends GT_MetaTileEntity_MultiBlockBas
}
}else{return false;}
}
ArrayList<ItemStack> tDrops = new ArrayList();
if (!mMineList.isEmpty()) {
ChunkPosition oreBlockOffsetPos = mMineList.get(0);
tDrops = ((GT_TileEntity_Ores) getBaseMetaTileEntity().getTileEntityOffset(oreBlockOffsetPos.chunkPosX, oreBlockOffsetPos.chunkPosY, oreBlockOffsetPos.chunkPosZ)).getDrops(1);
ArrayList<ItemStack> tDrops = new ArrayList<ItemStack>();
GT_TileEntity_Ores oreBlockTileEntity = (GT_TileEntity_Ores) getBaseMetaTileEntity().getTileEntityOffset(oreBlockOffsetPos.chunkPosX, oreBlockOffsetPos.chunkPosY, oreBlockOffsetPos.chunkPosZ);
if (oreBlockTileEntity != null) {
tDrops = oreBlockTileEntity.getDrops(1);
}
if (!tDrops.isEmpty()) {
ItemData tData = GT_OreDictUnificator.getItemData(tDrops.get(0).copy());
if (tData.mPrefix != OrePrefixes.crushed&& tData.mMaterial.mMaterial != Materials.Oilsands) {
@ -131,7 +134,9 @@ public class GT_MetaTileEntity_AdvMiner2 extends GT_MetaTileEntity_MultiBlockBas
this.mOutputItems = new ItemStack[tRecipe.mOutputs.length];
for (int g = 0; g < mOutputItems.length; g++) {
mOutputItems[g] = tRecipe.mOutputs[g].copy();
mOutputItems[g].stackSize = mOutputItems[g].stackSize * (getBaseMetaTileEntity().getRandomNumber(4) + 1);
if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(g)) {
mOutputItems[g].stackSize *= getBaseMetaTileEntity().getRandomNumber(4) + 1;
}
}
}
} else {