mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-26 15:03:07 +00:00
Merged bug fixed from 1.0.4
This commit is contained in:
1 parent
dd26706383
commit
6aa22620b5
4 files changed
+29
-14
No files matched your search
@@ -37,6 +37,8 @@ public class ItemConduitNetwork extends AbstractConduitNetwork<IItemConduit, IIt
|
||||
|
||||
private boolean requiresSort = true;
|
||||
|
||||
private boolean doingSend = false;
|
||||
|
||||
private final InnerTickHandler tickHandler = new InnerTickHandler();
|
||||
|
||||
public ItemConduitNetwork() {
|
||||
@@ -104,26 +106,34 @@ public class ItemConduitNetwork extends AbstractConduitNetwork<IItemConduit, IIt
|
||||
}
|
||||
|
||||
public ItemStack sendItems(ItemConduit itemConduit, ItemStack item, ForgeDirection side) {
|
||||
if(doingSend) {
|
||||
return item;
|
||||
}
|
||||
|
||||
if(item == null) {
|
||||
return item;
|
||||
}
|
||||
|
||||
BlockCoord loc = itemConduit.getLocation().getLocation(side);
|
||||
try {
|
||||
doingSend = true;
|
||||
BlockCoord loc = itemConduit.getLocation().getLocation(side);
|
||||
|
||||
ItemStack result = item.copy();
|
||||
List<NetworkedInventory> invs = getOrCreate(loc);
|
||||
for (NetworkedInventory inv : invs) {
|
||||
ItemStack result = item.copy();
|
||||
List<NetworkedInventory> invs = getOrCreate(loc);
|
||||
for (NetworkedInventory inv : invs) {
|
||||
|
||||
if(inv.con.getLocation().equals(itemConduit.getLocation())) {
|
||||
int numInserted = inv.insertIntoTargets(item.copy());
|
||||
if(numInserted >= item.stackSize) {
|
||||
return null;
|
||||
if(inv.con.getLocation().equals(itemConduit.getLocation())) {
|
||||
int numInserted = inv.insertIntoTargets(item.copy());
|
||||
if(numInserted >= item.stackSize) {
|
||||
return null;
|
||||
}
|
||||
result.stackSize -= numInserted;
|
||||
}
|
||||
result.stackSize -= numInserted;
|
||||
}
|
||||
return result;
|
||||
} finally {
|
||||
doingSend = false;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<String> getTargetsForExtraction(BlockCoord extractFrom, IItemConduit con, ItemStack input) {
|
||||
|
||||
@@ -94,8 +94,6 @@ public final class ModdedCrops {
|
||||
}
|
||||
return super.canHarvest(farm, bc, block, meta);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -66,6 +66,11 @@ public class Util {
|
||||
|
||||
// derived from ItemBlock.onItemUse
|
||||
public static BlockCoord canPlaceItem(ItemStack itemUsed, Block blockIdToBePlaced, EntityPlayer player, World world, int x, int y, int z, int side) {
|
||||
|
||||
if(blockIdToBePlaced == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Block block = world.getBlock(x, y, z);
|
||||
|
||||
if(block == Blocks.snow_layer && (world.getBlockMetadata(x, y, z) & 7) < 1) {
|
||||
|
||||
Reference in new issue
Block a user