#463 Removed call causing a packet storm with item conduits and JABBA barrels.

Changed defaults for power and the travel staff.
This commit is contained in:
CrazyPants committed 2014-02-17 12:36:19 +08:00
1 parent 35a616bc52
commit 4113cd71de
2 files changed
+22 -24

No files matched your search

+2 -2
View File
@@ -67,8 +67,8 @@ public final class Config {
public static int travelAnchorMaxDistance = 48;
public static int travelStaffMaxDistance = 96;
public static float travelStaffPowerPerBlock = 100;
public static int travelStaffMaxStoredPower = 50000;
public static float travelStaffPowerPerBlock = 10;
public static int travelStaffMaxStoredPower = 25000;
public static int travelStaffMaxPowerIo = 500;
public static boolean travelAnchorEnabled = true;
public static double travelStaffMaxBlinkDistance = 8;
+20 -22
View File
@@ -47,31 +47,29 @@ public class ItemUtil {
int[] slots = sidedInv.getAccessibleSlotsFromSide(inventorySide.ordinal());
for (int i = 0; i < slots.length && numToInsert > 0; i++) {
int slot = slots[i];
if(!isStackFull(sidedInv.getStackInSlot(slot))) {
if(sidedInv.canInsertItem(slot, item, inventorySide.ordinal())) {
ItemStack contents = sidedInv.getStackInSlot(slot);
ItemStack toInsert = item.copy();
toInsert.stackSize = Math.min(toInsert.stackSize, sidedInv.getInventoryStackLimit());
toInsert.stackSize = Math.min(toInsert.stackSize, numToInsert);
int inserted = 0;
if(contents == null) {
inserted = toInsert.stackSize;
if(sidedInv.canInsertItem(slot, item, inventorySide.ordinal())) {
ItemStack contents = sidedInv.getStackInSlot(slot);
ItemStack toInsert = item.copy();
toInsert.stackSize = Math.min(toInsert.stackSize, sidedInv.getInventoryStackLimit());
toInsert.stackSize = Math.min(toInsert.stackSize, numToInsert);
int inserted = 0;
if(contents == null) {
inserted = toInsert.stackSize;
} else {
if(contents.isItemEqual(item) && ItemStack.areItemStackTagsEqual(contents, item)) {
int space = sidedInv.getInventoryStackLimit() - contents.stackSize;
space = Math.min(space, contents.getMaxStackSize() - contents.stackSize);
inserted += Math.min(space, toInsert.stackSize);
toInsert.stackSize = contents.stackSize + inserted;
} else {
if(contents.isItemEqual(item) && ItemStack.areItemStackTagsEqual(contents, item)) {
int space = sidedInv.getInventoryStackLimit() - contents.stackSize;
space = Math.min(space, contents.getMaxStackSize() - contents.stackSize);
inserted += Math.min(space, toInsert.stackSize);
toInsert.stackSize = contents.stackSize + inserted;
} else {
toInsert.stackSize = 0;
}
toInsert.stackSize = 0;
}
}
if(inserted > 0) {
numInserted += inserted;
numToInsert -= inserted;
sidedInv.setInventorySlotContents(slot, toInsert);
}
if(inserted > 0) {
numInserted += inserted;
numToInsert -= inserted;
sidedInv.setInventorySlotContents(slot, toInsert);
}
}
}