From aa3a12ea919798dc34505a83c0ddc98114ec4e83 Mon Sep 17 00:00:00 2001 From: Justin Aquadro Date: Wed, 25 Mar 2015 20:58:50 -0400 Subject: [PATCH] Make pipes even more likely to connect to controller --- .../block/tile/TileEntityController.java | 50 +++++++++++-------- .../inventory/StorageInventory.java | 2 +- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/src/com/jaquadro/minecraft/storagedrawers/block/tile/TileEntityController.java b/src/com/jaquadro/minecraft/storagedrawers/block/tile/TileEntityController.java index 4dc5516..067e9a9 100644 --- a/src/com/jaquadro/minecraft/storagedrawers/block/tile/TileEntityController.java +++ b/src/com/jaquadro/minecraft/storagedrawers/block/tile/TileEntityController.java @@ -199,15 +199,10 @@ public class TileEntityController extends TileEntity implements IDrawerGroup, IS if (te == null || !(te instanceof IDrawerGroup)) return; - if (te instanceof TileEntityController && depth < DEPTH_LIMIT) { - populateNeighborNodes(x, y, z, depth + 1); - return; - } - - IDrawerGroup group = (IDrawerGroup)te; - IDrawerInventory inventory = group.getDrawerInventory(); - if (inventory == null) - return; + //if (te instanceof TileEntityController && depth < DEPTH_LIMIT) { + // populateNeighborNodes(x, y, z, depth + 1); + // return; + //} BlockCoord coord = new BlockCoord(x, y, z); if (storage.containsKey(coord)) { @@ -220,24 +215,39 @@ public class TileEntityController extends TileEntity implements IDrawerGroup, IS } } - storage.put(coord, group); mark.put(coord, true); - invStorageSize.put(coord, inventory.getSizeInventory()); - drawerStorageSize.put(coord, group.getDrawerCount()); + if (te instanceof TileEntityController) { + storage.put(coord, null); - for (int i = 0, n = invStorageSize.get(coord); i < n; i++) { - invBlockList.add(coord); - invSlotList.add(i); + invStorageSize.put(coord, 1); + invBlockList.add(null); + invSlotList.add(0); } + else { + IDrawerGroup group = (IDrawerGroup)te; + IDrawerInventory inventory = group.getDrawerInventory(); + if (inventory == null) + return; - for (int i = 0, n = drawerStorageSize.get(coord); i < n; i++) { - drawerBlockList.add(coord); - drawerSlotList.add(i); + storage.put(coord, group); + + invStorageSize.put(coord, inventory.getSizeInventory()); + drawerStorageSize.put(coord, group.getDrawerCount()); + + for (int i = 0, n = invStorageSize.get(coord); i < n; i++) { + invBlockList.add(coord); + invSlotList.add(i); + } + + for (int i = 0, n = drawerStorageSize.get(coord); i < n; i++) { + drawerBlockList.add(coord); + drawerSlotList.add(i); + } + + drawerSize += drawerStorageSize.get(coord); } - drawerSize += drawerStorageSize.get(coord); - if (depth == DEPTH_LIMIT) return; diff --git a/src/com/jaquadro/minecraft/storagedrawers/inventory/StorageInventory.java b/src/com/jaquadro/minecraft/storagedrawers/inventory/StorageInventory.java index d8aa32c..b54c7b2 100644 --- a/src/com/jaquadro/minecraft/storagedrawers/inventory/StorageInventory.java +++ b/src/com/jaquadro/minecraft/storagedrawers/inventory/StorageInventory.java @@ -310,7 +310,7 @@ public class StorageInventory implements IDrawerInventory case OUTPUT: return drawer.canItemBeExtracted(item); default: - return drawer.canItemBeStored(item); + return false; } } } \ No newline at end of file