aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech
diff options
context:
space:
mode:
authorMartin Robertz <dream-master@gmx.net>2020-03-03 19:22:14 +0100
committerGitHub <noreply@github.com>2020-03-03 19:22:14 +0100
commit3bca4b84a8a3c146c658cb238b85658c2e3ca4f0 (patch)
treebe0e584ae0612fe3043cf3377c96063e3cbc2368 /src/main/java/gregtech
parent60a98a8b69a58a0cdadb38da996f9d3aa0bca252 (diff)
parenta767a4badaf285f3172cff0477acac698c5ada9f (diff)
downloadGT5-Unofficial-3bca4b84a8a3c146c658cb238b85658c2e3ca4f0.tar.gz
GT5-Unofficial-3bca4b84a8a3c146c658cb238b85658c2e3ca4f0.tar.bz2
GT5-Unofficial-3bca4b84a8a3c146c658cb238b85658c2e3ca4f0.zip
Merge pull request #248 from GTNewHorizons/debug/more_debug_switches
Debug/more debug switches
Diffstat (limited to 'src/main/java/gregtech')
-rw-r--r--src/main/java/gregtech/GT_Mod.java3
-rw-r--r--src/main/java/gregtech/api/enums/GT_Values.java12
-rw-r--r--src/main/java/gregtech/common/GT_Proxy.java23
-rw-r--r--src/main/java/gregtech/common/misc/GT_Command.java6
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java37
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java52
6 files changed, 119 insertions, 14 deletions
diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java
index 2d0b7257d0..967c2e897e 100644
--- a/src/main/java/gregtech/GT_Mod.java
+++ b/src/main/java/gregtech/GT_Mod.java
@@ -260,6 +260,9 @@ public class GT_Mod implements IGT_Mod {
GT_Values.debugOrevein = tMainConfig.get(aTextGeneral, "debugOrevein", false).getBoolean(false);
GT_Values.debugSmallOres = tMainConfig.get(aTextGeneral, "debugSmallOres", false).getBoolean(false);
GT_Values.debugStones = tMainConfig.get(aTextGeneral, "debugStones", false).getBoolean(false);
+ GT_Values.debugBlockMiner = tMainConfig.get(aTextGeneral, "debugBlockMiner", false).getBoolean(false);
+ GT_Values.debugBlockPump = tMainConfig.get(aTextGeneral, "debugBlockPump", false).getBoolean(false);
+ GT_Values.debugEntityCramming = tMainConfig.get(aTextGeneral, "debugEntityCramming", false).getBoolean(false);
GT_Values.oreveinPercentage = tMainConfig.get(aTextGeneral, "oreveinPercentage_100",100).getInt(100);
GT_Values.oreveinAttempts = tMainConfig.get(aTextGeneral, "oreveinAttempts_64",64).getInt(64);
GT_Values.oreveinMaxPlacementAttempts = tMainConfig.get(aTextGeneral, "oreveinMaxPlacementAttempts_8",8).getInt(8);
diff --git a/src/main/java/gregtech/api/enums/GT_Values.java b/src/main/java/gregtech/api/enums/GT_Values.java
index 43c93450ab..80209db614 100644
--- a/src/main/java/gregtech/api/enums/GT_Values.java
+++ b/src/main/java/gregtech/api/enums/GT_Values.java
@@ -171,6 +171,18 @@ public class GT_Values {
*/
public static boolean debugStones = false;
/**
+ * Debug parameter for single block pump
+ */
+ public static boolean debugBlockPump = false;
+ /**
+ * Debug parameter for single block miner
+ */
+ public static boolean debugBlockMiner = false;
+ /**
+ * Debug parameter for entity cramming reduction
+ */
+ public static boolean debugEntityCramming = false;
+ /**
* Number of ticks between sending sound packets to clients for electric machines. Default is 1.5 seconds. Trying to mitigate lag and FPS drops.
*/
public static int ticksBetweenSounds = 30;
diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java
index 234920448d..3b668d805d 100644
--- a/src/main/java/gregtech/common/GT_Proxy.java
+++ b/src/main/java/gregtech/common/GT_Proxy.java
@@ -88,6 +88,9 @@ import java.io.File;
import java.text.DateFormat;
import java.util.*;
+import static gregtech.api.enums.GT_Values.debugEntityCramming;
+
+
public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
private static final EnumSet<OreGenEvent.GenerateMinable.EventType> PREVENTED_ORES = EnumSet.of(OreGenEvent.GenerateMinable.EventType.COAL,
OreGenEvent.GenerateMinable.EventType.IRON, OreGenEvent.GenerateMinable.EventType.GOLD,
@@ -1264,6 +1267,11 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
}
}
if ((aEvent.world.getTotalWorldTime() % 100L == 0L) && ((this.mItemDespawnTime != 6000) || (this.mMaxEqualEntitiesAtOneSpot > 0))) {
+ long startTime = System.nanoTime();
+ double oldX=0, oldY=0, oldZ=0;
+ if (debugEntityCramming && (aEvent.world.loadedEntityList.size()!=0)) {
+ GT_Log.out.println("CRAM: Entity list size " + aEvent.world.loadedEntityList.size());
+ }
for (int i = 0; i < aEvent.world.loadedEntityList.size(); i++) {
if ((aEvent.world.loadedEntityList.get(i) instanceof Entity)) {
Entity tEntity = (Entity) aEvent.world.loadedEntityList.get(i);
@@ -1283,11 +1291,26 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
}
}
if (tEntityCount > this.mMaxEqualEntitiesAtOneSpot) {
+ if (debugEntityCramming) {
+ // Cheeseball way of not receiving a bunch of spam caused by 1 location
+ // obviously fails if there are crammed entities in more than one spot.
+ if( tEntity.posX != oldX
+ && tEntity.posY != oldY
+ && tEntity.posZ != oldZ ) {
+ GT_Log.out.println("CRAM: Excess entities: " + tEntityCount + " at X " + tEntity.posX + " Y " + tEntity.posY + " Z " + tEntity.posZ);
+ oldX = tEntity.posX;
+ oldY = tEntity.posY;
+ oldZ = tEntity.posZ;
+ }
+ }
tEntity.attackEntityFrom(DamageSource.inWall, tEntityCount - this.mMaxEqualEntitiesAtOneSpot);
}
}
}
}
+ if(debugEntityCramming && (aEvent.world.loadedEntityList.size()!=0)) {
+ GT_Log.out.println("CRAM: Time spent checking " + (System.nanoTime() - startTime )/1000 + " microseconds" );
+ }
}
GT_Pollution.onWorldTick(aEvent);
diff --git a/src/main/java/gregtech/common/misc/GT_Command.java b/src/main/java/gregtech/common/misc/GT_Command.java
index 9d53027026..66ae7058bc 100644
--- a/src/main/java/gregtech/common/misc/GT_Command.java
+++ b/src/main/java/gregtech/common/misc/GT_Command.java
@@ -29,6 +29,9 @@ public final class GT_Command extends CommandBase {
sender.addChatMessage(new ChatComponentText("\"toggle D2\" - toggles general.Debug2 (D2)"));
sender.addChatMessage(new ChatComponentText("\"toggle debugCleanroom\" - toggles cleanroom debug log"));
sender.addChatMessage(new ChatComponentText("\"toggle debugDriller\" - toggles oil drill debug log"));
+ sender.addChatMessage(new ChatComponentText("\"toggle debugBlockPump\" - Possible issues with pumps"));
+ sender.addChatMessage(new ChatComponentText("\"toggle debugBlockMiner\" - Possible issues with miners"));
+ sender.addChatMessage(new ChatComponentText("\"toggle debugEntityCramming\" - How long it takes and how many entities it finds"));
sender.addChatMessage(new ChatComponentText("\"toggle debugWorldGen\" - toggles generic worldgen debug"));
sender.addChatMessage(new ChatComponentText("\"toggle debugOrevein\" - toggles worldgen ore vein debug"));
sender.addChatMessage(new ChatComponentText("\"toggle debugSmallOres\" - toggles worldgen small vein debug"));
@@ -49,7 +52,8 @@ public final class GT_Command extends CommandBase {
});
} else if (test.equals("toggle")) {
String test1 = ss.length == 1 ? "" : ss[1].trim();
- Arrays.stream(new String[]{"D1", "D2", "debugCleanroom", "debugDriller", "debugWorldGen", "debugOrevein", "debugSmallOres", "debugStones", "debugChunkloaders"}).forEach(s -> {
+ Arrays.stream(new String[]{"D1", "D2", "debugCleanroom", "debugDriller", "debugBlockPump", "debugBlockMiner", "debugWorldGen", "debugEntityCramming",
+ "debugOrevein", "debugSmallOres", "debugStones", "debugChunkloaders"}).forEach(s -> {
if (test1.isEmpty() || s.startsWith(test1))
l.add(s);
});
diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java
index 9757974cee..44db32e6b9 100644
--- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java
+++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java
@@ -7,6 +7,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.objects.ItemData;
+import gregtech.api.util.GT_Log;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
@@ -25,6 +26,7 @@ import net.minecraftforge.common.util.FakePlayer;
import java.util.ArrayList;
import static gregtech.api.enums.GT_Values.V;
+import static gregtech.api.enums.GT_Values.debugBlockMiner;
public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine {
private static final ItemStack MINING_PIPE = GT_ModHandler.getIC2Item("miningPipe", 0);
@@ -45,7 +47,7 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine {
new String[]{
"Digging ore instead of you",
"Use Screwdriver to regulate work area",
- ENERGY[aTier] + " EU/t, " + SPEED[aTier] / 20 + " sec per block",
+ ENERGY[aTier] + " EU/t, " + SPEED[aTier] / 20 + " sec per block, no stuttering",
"Maximum work area " + (RADIUS[aTier] * 2 + 1) + "x" + (RADIUS[aTier] * 2 + 1),
"Fortune bonus of " + aTier},
2, 2, "Miner.png", "",
@@ -125,12 +127,26 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine {
break miningPipe;
}
}
+ if (debugBlockMiner) {
+ GT_Log.out.println("MINER: Pipe found in input");
+ }
return;
}
aBaseMetaTileEntity.decreaseStoredEnergyUnits(ENERGY[mTier], true);
mMaxProgresstime = SPEED[mTier];
} else {
mMaxProgresstime = 0;
+ if (debugBlockMiner) {
+ if (!aBaseMetaTileEntity.isAllowedToWork()) {
+ GT_Log.out.println("MINER: Disabled");
+ }
+ if (!aBaseMetaTileEntity.isUniversalEnergyStored(ENERGY[mTier] * (SPEED[mTier] - mProgresstime))) {
+ GT_Log.out.println("MINER: Not enough energy yet, want " + (ENERGY[mTier] * SPEED[mTier]) + " have " + aBaseMetaTileEntity.getUniversalEnergyStored());
+ }
+ if (!hasFreeSpace()) {
+ GT_Log.out.println("MINER: No free space");
+ }
+ }
return;
}
if (mProgresstime == SPEED[mTier] - 1) {
@@ -138,6 +154,9 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine {
if (drillY == 0) {
aBaseMetaTileEntity.disableWorking();
isPickingPipes = false;
+ if (debugBlockMiner) {
+ GT_Log.out.println("MINER: Completed picking pipes");
+ }
} else if (aBaseMetaTileEntity.getBlockOffset(0, drillY, 0) == MINING_PIPE_TIP_BLOCK || aBaseMetaTileEntity.getBlockOffset(0, drillY, 0) == MINING_PIPE_BLOCK) {
mOutputItems[0] = MINING_PIPE.copy();
mOutputItems[0].stackSize = 1;
@@ -162,12 +181,22 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine {
TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityOffset(drillX, drillY, drillZ);
if (tTileEntity instanceof GT_TileEntity_Ores && ((GT_TileEntity_Ores) tTileEntity).mNatural) {
mineBlock(aBaseMetaTileEntity, drillX, drillY, drillZ);
+ if (debugBlockMiner) {
+ GT_Log.out.println("MINER: Mining GT ore block at " + drillX + " " + drillY + " " + drillZ);
+ }
return;
+ } else {
+ if (debugBlockMiner) {
+ GT_Log.out.println("MINER: Not natural ore, will not mine");
+ }
}
} else {
ItemData association = GT_OreDictUnificator.getAssociation(new ItemStack(block, 1, blockMeta));
if (association != null && association.mPrefix.toString().startsWith("ore")) {
mineBlock(aBaseMetaTileEntity, drillX, drillY, drillZ);
+ if (debugBlockMiner) {
+ GT_Log.out.println("MINER: Mining oredict ore block at " + drillX + " " + drillY + " " + drillZ);
+ }
return;
}
}
@@ -193,6 +222,9 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine {
|| GT_Utility.getBlockHardnessAt(aBaseMetaTileEntity.getWorld(), xCoord, yCoord + drillY - 1, zCoord) < 0
|| !GT_Utility.setBlockByFakePlayer(getFakePlayer(aBaseMetaTileEntity), xCoord, yCoord + drillY - 1, zCoord, MINING_PIPE_TIP_BLOCK, 0, true)) {
isPickingPipes = true;
+ if (debugBlockMiner) {
+ GT_Log.out.println("MINER: Hit bottom? Hit block with -1 hardness? Unable to set mining pipe tip?");
+ }
return false;
}
if (aBaseMetaTileEntity.getBlockOffset(0, drillY, 0) == MINING_PIPE_TIP_BLOCK) {
@@ -215,6 +247,9 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine {
}
if (aBaseMetaTileEntity.getBlockOffset(0, drillY - 1, 0) != Blocks.air) {
mineBlock(aBaseMetaTileEntity, 0, drillY - 1, 0);
+ if (debugBlockMiner) {
+ GT_Log.out.println("MINER: Removed block to replace with pipe" );
+ }
}
aBaseMetaTileEntity.getWorld().setBlock(xCoord, yCoord + drillY - 1, zCoord, MINING_PIPE_TIP_BLOCK);
drillY--;
diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java
index e4a2ffe771..0ff9f527e5 100644
--- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java
+++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java
@@ -31,17 +31,18 @@ import java.util.*;
import static gregtech.api.enums.GT_Values.D1;
import static gregtech.api.enums.GT_Values.V;
+import static gregtech.api.enums.GT_Values.debugBlockPump;
public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
private static final ItemStack MINING_PIPE = GT_ModHandler.getIC2Item("miningPipe", 0);
private static final Block MINING_PIPE_BLOCK = GT_Utility.getBlockFromStack(MINING_PIPE);
private static final Block MINING_PIPE_TIP_BLOCK = GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 0));
- public static int getMaxDistanceForTier(byte aTier) {
+ public static int getMaxDistanceForTier(int aTier) {
return (10 * ((int) Math.pow(1.6D, aTier)));
}
- public static long getEuUsagePerTier(byte aTier) {
+ public static long getEuUsagePerTier(int aTier) {
return (16 * ((long) Math.pow(4, aTier)));
}
@@ -57,7 +58,8 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
public GT_MetaTileEntity_Pump(int aID, String aName, String aNameRegional, int aTier) {
super(aID, aName, aNameRegional, aTier, 3,
new String[]{"The best way to empty Oceans! Outputs on top",
- "Maximum pumping area: " + (getMaxDistanceForTier((byte) aTier) * 2 + 1) + "x" + (getMaxDistanceForTier((byte) aTier) * 2 + 1),
+ getEuUsagePerTier(aTier) + " EU/operation, " + GT_Utility.safeInt(160 / (long)Math.pow(2, aTier) ) + " sec per bucket, no stuttering",
+ "Maximum pumping area: " + (getMaxDistanceForTier( aTier) * 2 + 1) + "x" + (getMaxDistanceForTier( aTier) * 2 + 1),
"Use Screwdriver to regulate pumping area"});
radiusConfig = getMaxDistanceForTier(mTier);
}
@@ -79,7 +81,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
public void saveNBTData(NBTTagCompound aNBT) {
boolean wasPumping = this.wasPumping || !this.mPumpList.isEmpty();
- if (D1) {
+ if (debugBlockPump) {
GT_Log.out.println("PUMP: NBT:Save - WasPumping - " + wasPumping + " blocks (" + this.mPrimaryPumpedBlock + ", " + this.mSecondaryPumpedBlock + ")");
}
super.saveNBTData(aNBT);
@@ -97,7 +99,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
this.mPrimaryPumpedBlock = Block.getBlockFromName(aNBT.getString("mPumpedBlock1"));
this.mSecondaryPumpedBlock = Block.getBlockFromName(aNBT.getString("mPumpedBlock2"));
- if (D1) {
+ if (debugBlockPump) {
GT_Log.out.println("PUMP: NBT:Load - WasPumping - " + this.wasPumping + "(" + aNBT.getString("mPumpedBlock1") + ") " + this.mPrimaryPumpedBlock);
}
}
@@ -198,6 +200,9 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
// The more pumps we have stacked, the faster the ones below go
((GT_MetaTileEntity_Pump) tTileEntity.getMetaTileEntity()).mPumpTimer -= 1;
}
+ if (debugBlockPump && (this.mPumpCountBelow != 0)) {
+ GT_Log.out.println("PUMP: Detected " + this.mPumpCountBelow + " pumps below this pump.");
+ }
if (this.mPumpCountBelow <= 0) {
// Only the bottom most pump does anything
if ((getBaseMetaTileEntity().isAllowedToWork()) && (getBaseMetaTileEntity().isUniversalEnergyStored(this.getEuUsagePerAction()))
@@ -206,10 +211,10 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
if ((this.mPumpList.isEmpty()) && (getBaseMetaTileEntity().getTimer() % 100L == 0L)) {
if (!this.wasPumping){
tMovedOneDown = moveOneDown();
- if (D1) {
+ if (debugBlockPump) {
GT_Log.out.println("PUMP: Moved down");
}
- } else if (D1) {
+ } else if (debugBlockPump) {
GT_Log.out.println("PUMP: Was pumping, didn't move down");
}
}
@@ -219,7 +224,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
// We don't have a valid block, let's try to find one
int y = getYOfPumpHead();
- if (D1 && this.mPrimaryPumpedBlock != null) {
+ if (debugBlockPump && this.mPrimaryPumpedBlock != null) {
GT_Log.out.println("PUMP: Had an invalid pump block. Trying to find a fluid at Y: " + y +
" Previous blocks 1: " + this.mPrimaryPumpedBlock + " 2: " + this.mSecondaryPumpedBlock);
}
@@ -249,7 +254,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
// 2) We were previously pumping (and possibly just reloaded)
// 3) We have an empty queue and enough time has passed
// 4) A long while has has passed
- if (D1) {
+ if (debugBlockPump) {
GT_Log.out.println("PUMP: Rebuilding pump list - Size " +
this.mPumpList.size() + " WasPumping: " + this.wasPumping + " Timer " + getBaseMetaTileEntity().getTimer());
}
@@ -257,7 +262,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
this.rebuildPumpQueue(x, yPump, z, yHead);
- if (D1) {
+ if (debugBlockPump) {
GT_Log.out.println("PUMP: Rebuilt pump list - Size " + this.mPumpList.size());
}
@@ -278,6 +283,8 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
// -- Clear the queue and we should try to move down until we can find a valid fluid
this.clearQueue(false);
}
+ } else if (debugBlockPump) {
+ GT_Log.out.println("PUMP: Disable? Not enough energy? Free space?");
}
getBaseMetaTileEntity().setActive(!this.mPumpList.isEmpty());
}
@@ -312,12 +319,18 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
private boolean moveOneDown() {
if ((this.mInventory[0] == null) || (this.mInventory[0].stackSize < 1) || (!GT_Utility.areStacksEqual(this.mInventory[0], MINING_PIPE))) {
// No mining pipes
+ if (debugBlockPump) {
+ GT_Log.out.println("PUMP: No mining pipes");
+ }
return false;
}
int yHead = getYOfPumpHead();
if (yHead <= 1) {
// Let's not punch through bedrock
+ if (debugBlockPump) {
+ GT_Log.out.println("PUMP: At bottom");
+ }
return false;
}
@@ -325,10 +338,16 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
if ((!consumeFluid(x, yHead - 1, z)) && (!getBaseMetaTileEntity().getBlock(x, yHead - 1, z).isAir(getBaseMetaTileEntity().getWorld(), x, yHead - 1, z))) {
// Either we didn't consume a fluid, or it's a non Air block
+ if (debugBlockPump) {
+ GT_Log.out.println("PUMP: Did not consume fluid, or non-airblock found");
+ }
return false;
}
// Try to set the block below us to a a tip
if (!GT_Utility.setBlockByFakePlayer(getFakePlayer(getBaseMetaTileEntity()), x, yHead - 1, z, MINING_PIPE_TIP_BLOCK, 0, false)) {
+ if (debugBlockPump) {
+ GT_Log.out.println("PUMP: Could not set block below to new tip");
+ }
return false;
}
// And change the previous block to a pipe -- as long as it isn't the pump itself!
@@ -336,6 +355,9 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
getBaseMetaTileEntity().getWorld().setBlock(x, yHead, z, MINING_PIPE_BLOCK);
}
getBaseMetaTileEntity().decrStackSize(0, 1);
+ if (debugBlockPump) {
+ GT_Log.out.println("PUMP: Using 1 pipe");
+ }
return true;
}
@@ -355,6 +377,9 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
// We're running into an existing set of pipes -- Turn this block into a pipe and keep going
this.clearQueue(true);
getBaseMetaTileEntity().getWorld().setBlock(x, y, z, MINING_PIPE_BLOCK);
+ if (debugBlockPump) {
+ GT_Log.out.println("PUMP: Hit pipes already in place, trying to merge");
+ }
}
y--;
@@ -368,6 +393,9 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
// We're below the pump at the bottom of the pipes, we haven't found a tip; make the previous pipe a tip!
this.clearQueue(true);
getBaseMetaTileEntity().getWorld().setBlock(x, y + 1, z, MINING_PIPE_TIP_BLOCK);
+ if (debugBlockPump) {
+ GT_Log.out.println("PUMP: Did not find a tip at bottom, setting last pipe as tip");
+ }
}
return y + 1;
}
@@ -474,7 +502,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
if (isWaterOrLava && getBaseMetaTileEntity().getMetaID(aX, aY, aZ) != 0) {
// Water/Lava that isn't a source block - do nothing here, but set the block to air and consume energy below
- if (D1) {
+ if (debugBlockPump) {
GT_Log.out.println("PUMP: Water/Lava - Not a source block");
}
} else if (this.mFluid == null) {
@@ -497,7 +525,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
this.mFluid.amount += 1000;
} else {
- if (D1) {
+ if (debugBlockPump) {
GT_Log.out.println("PUMP: Couldn't consume " + aBlock);
}
// We didn't do anything