aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/common')
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java
index fce4e3758c..9e910574c4 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java
@@ -37,6 +37,7 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile
private final ArrayList<ChunkPosition> oreBlockPositions = new ArrayList<>();
protected int mTier = 1;
private int chunkRadiusConfig = getRadiusInChunks();
+ private boolean replaceWithCobblestone = true;
GT_MetaTileEntity_OreDrillingPlantBase(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
@@ -50,13 +51,18 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile
public void saveNBTData(NBTTagCompound aNBT) {
super.saveNBTData(aNBT);
aNBT.setInteger("chunkRadiusConfig", chunkRadiusConfig);
+ aNBT.setBoolean("replaceWithCobblestone", replaceWithCobblestone);
}
@Override
public void loadNBTData(NBTTagCompound aNBT) {
super.loadNBTData(aNBT);
- if (aNBT.hasKey("chunkRadiusConfig"))
+ if (aNBT.hasKey("chunkRadiusConfig")) {
chunkRadiusConfig = aNBT.getInteger("chunkRadiusConfig");
+ }
+ if (aNBT.hasKey("replaceWithCobblestone")) {
+ replaceWithCobblestone = aNBT.getBoolean("replaceWithCobblestone");
+ }
}
@Override
@@ -84,6 +90,13 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile
}
@Override
+ public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ replaceWithCobblestone = !replaceWithCobblestone;
+ GT_Utility.sendChatToPlayer(aPlayer, "Replace with cobblestone " + replaceWithCobblestone);
+ return true;
+ }
+
+ @Override
protected boolean workingDownward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) {
if (yHead != oldYHead)
oreBlockPositions.clear();
@@ -133,7 +146,11 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile
Collection<ItemStack> oreBlockDrops = getBlockDrops(oreBlock, x, y, z);
ItemStack cobble = GT_Utility.getCobbleForOre(oreBlock, metaData);
- getBaseMetaTileEntity().getWorld().setBlock(x, y, z, Block.getBlockFromItem(cobble.getItem()), cobble.getItemDamage(), 3);
+ if (replaceWithCobblestone) {
+ getBaseMetaTileEntity().getWorld().setBlock(x, y, z, Block.getBlockFromItem(cobble.getItem()), cobble.getItemDamage(), 3);
+ } else {
+ getBaseMetaTileEntity().getWorld().setBlockToAir(oreBlockPos.chunkPosX, oreBlockPos.chunkPosY, oreBlockPos.chunkPosZ);
+ }
mOutputItems = getOutputByDrops(oreBlockDrops);
}
return true;
@@ -220,7 +237,7 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile
GT_ChunkManager.requestChunkLoad((TileEntity)getBaseMetaTileEntity(), new ChunkCoordIntPair(nextChunkX, nextChunkZ));
return true;
}
-
+
@Override
protected boolean checkHatches(){
return !mMaintenanceHatches.isEmpty() && !mInputHatches.isEmpty() && !mOutputBusses.isEmpty() && !mEnergyHatches.isEmpty();
@@ -349,13 +366,14 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile
protected GT_Multiblock_Tooltip_Builder createTooltip(String tierSuffix) {
String casings = getCasingBlockItem().get(0).getDisplayName();
-
+
final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
tt.addMachineType("Miner")
.addInfo("Controller Block for the Ore Drilling Plant " + (tierSuffix != null ? tierSuffix : ""))
.addInfo("Use a Screwdriver to configure block radius")
.addInfo("Maximum radius is " + (getRadiusInChunks() << 4) + " blocks")
.addInfo("Use Soldering iron to turn off chunk mode")
+ .addInfo("Use Wire Cutter to toggle replacing mined blocks with cobblestone")
.addInfo("In chunk mode, working area center is the chunk corner nearest to the drill")
.addInfo("Gives ~3x as much crushed ore vs normal processing")
.addInfo("Fortune bonus of " + (mTier + 3) + ". Only works on small ores")