Created
July 26, 2011 08:38
-
-
Save Flow86/1106295 to your computer and use it in GitHub Desktop.
Buildcraft Tile-Reinsertion on Inventory full instead of dropping
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- common\net\minecraft\src\buildcraft\transport\TilePipe.java Wed Jul 20 00:03:29 2011 | |
+++ ..\src\minecraft\net\minecraft\src\buildcraft\transport\TilePipe.java Tue Jul 26 10:36:02 2011 | |
@@ -138,6 +138,7 @@ | |
entitiesToLoad.clear(); | |
LinkedList <EntityData> toRemove = new LinkedList <EntityData> (); | |
+ LinkedList <EntityData> toReinsert = new LinkedList <EntityData> (); | |
for (EntityData data : travelingEntities.values()) { | |
Position motion = new Position (0, 0, 0, data.orientation); | |
@@ -192,6 +193,7 @@ | |
} else if (tile instanceof IInventory) { | |
StackUtil utils = new StackUtil(data.item.item); | |
+ boolean remove = true; | |
if (!APIProxy.isClient(worldObj)) { | |
if (utils.checkAvailableSlot((IInventory) tile, true, | |
destPos.orientation.reverse()) | |
@@ -199,6 +201,7 @@ | |
// Do nothing, we're adding the object to the world | |
} else { | |
+ /* | |
data.item.item = utils.items; | |
EntityItem dropped = data.item.toEntityItem( | |
worldObj, data.orientation); | |
@@ -208,10 +211,14 @@ | |
// items | |
onDropped(dropped); | |
} | |
+ */ | |
+ toReinsert.add(data); | |
+ remove = false; | |
} | |
} | |
- APIProxy.removeEntity(data.item); | |
+ if(remove) | |
+ APIProxy.removeEntity(data.item); | |
} else { | |
EntityItem dropped = data.item.toEntityItem(worldObj, | |
data.orientation); | |
@@ -228,6 +235,11 @@ | |
} | |
travelingEntities.values().removeAll(toRemove); | |
+ | |
+ for (EntityData data : toReinsert) { | |
+ data.orientation = data.orientation.reverse(); | |
+ entityEntering(data.item, data.orientation); | |
+ } | |
} | |
public boolean middleReached(EntityData entity) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment