Merge pull request #560 from agaricusb/pipelog
Log coordinates of invalid pipes
This commit is contained in:
commit
d5420f8796
2 changed files with 10 additions and 1 deletions
|
@ -17,6 +17,7 @@ import net.minecraft.world.World;
|
||||||
import buildcraft.BuildCraftTransport;
|
import buildcraft.BuildCraftTransport;
|
||||||
import buildcraft.core.IItemPipe;
|
import buildcraft.core.IItemPipe;
|
||||||
import buildcraft.core.ItemBuildCraft;
|
import buildcraft.core.ItemBuildCraft;
|
||||||
|
import buildcraft.BuildCraftCore;
|
||||||
|
|
||||||
public class ItemPipe extends ItemBuildCraft implements IItemPipe {
|
public class ItemPipe extends ItemBuildCraft implements IItemPipe {
|
||||||
|
|
||||||
|
@ -67,6 +68,10 @@ public class ItemPipe extends ItemBuildCraft implements IItemPipe {
|
||||||
if (entityplayer.canCurrentToolHarvestBlock(i, j, k) && world.canPlaceEntityOnSide(blockID, i, j, k, false, side, entityplayer)) {
|
if (entityplayer.canCurrentToolHarvestBlock(i, j, k) && world.canPlaceEntityOnSide(blockID, i, j, k, false, side, entityplayer)) {
|
||||||
|
|
||||||
Pipe pipe = BlockGenericPipe.createPipe(itemID);
|
Pipe pipe = BlockGenericPipe.createPipe(itemID);
|
||||||
|
if (pipe == null) {
|
||||||
|
BuildCraftCore.bcLog.warning("Pipe failed to create during placement at "+i+","+j+","+k);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (BlockGenericPipe.placePipe(pipe, world, i, j, k, blockID, 0)) {
|
if (BlockGenericPipe.placePipe(pipe, world, i, j, k, blockID, 0)) {
|
||||||
|
|
||||||
Block.blocksList[blockID].onBlockPlacedBy(world, i, j, k, entityplayer);
|
Block.blocksList[blockID].onBlockPlacedBy(world, i, j, k, entityplayer);
|
||||||
|
|
|
@ -122,7 +122,9 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, ITank
|
||||||
|
|
||||||
if (pipe != null) {
|
if (pipe != null) {
|
||||||
pipe.readFromNBT(nbttagcompound);
|
pipe.readFromNBT(nbttagcompound);
|
||||||
}
|
} else {
|
||||||
|
BuildCraftCore.bcLog.warning("Pipe failed to load from NBT at "+xCoord+","+yCoord+","+zCoord);
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) {
|
for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) {
|
||||||
facadeBlocks[i] = nbttagcompound.getInteger("facadeBlocks[" + i + "]");
|
facadeBlocks[i] = nbttagcompound.getInteger("facadeBlocks[" + i + "]");
|
||||||
|
@ -292,6 +294,8 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, ITank
|
||||||
|
|
||||||
if (pipe != null) {
|
if (pipe != null) {
|
||||||
pipe.initialize();
|
pipe.initialize();
|
||||||
|
} else {
|
||||||
|
BuildCraftCore.bcLog.warning("Pipe failed to initialize pipe at "+xCoord+","+yCoord+","+zCoord);
|
||||||
}
|
}
|
||||||
|
|
||||||
initialized = true;
|
initialized = true;
|
||||||
|
|
Loading…
Reference in a new issue