Cleaned and generalised item loading/searching

Reimplemented subsets
Added regex searching
Fixed format error on delete all
Fixed GuiButton handling clicks before NEI widgets could override
Re-Implemented banned blocks implementation
Added brewing recipes again
note test obf ASM beacons
Fixed some calls being intercepted by item panel when mouse was over a gui element
Fixed crash on closing potion window with escape
Disabled fast transfer, scrolling, and drag 'n' drop in creative
Added item panel sorting
Removed TMI uninstaller
Fixed /give command
Updated to 1.7.10
This commit is contained in:
Chicken-Bomes committed 2014-06-29 20:42:02 +10:00
1 parent 3c9ebc6961
commit 3c84527806
67 files changed
+3251 -2319

No files matched your search

+23 -11
View File
@@ -24,9 +24,9 @@ import net.minecraft.world.WorldServer;
import net.minecraft.world.WorldSettings.GameType;
import net.minecraftforge.oredict.OreDictionary;
import java.util.AbstractList;
import java.util.ArrayList;
import java.util.List;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.*;
public class NEIServerUtils
{
@@ -128,10 +128,10 @@ public class NEIServerUtils
* @return whether the two items are the same in terms of damage and itemID.
*/
public static boolean areStacksSameType(ItemStack stack1, ItemStack stack2) {
if (stack1 == null || stack2 == null)
return stack1 == stack2;
return InventoryUtils.canStack(stack1, stack2);
return stack1 != null && stack2 != null &&
(stack1.getItem() == stack2.getItem() &&
(!stack2.getHasSubtypes() || stack2.getItemDamage() == stack1.getItemDamage()) &&
ItemStack.areItemStackTagsEqual(stack2, stack1));
}
/**
@@ -142,10 +142,8 @@ public class NEIServerUtils
* @return whether the two items are the same from the perspective of a crafting inventory.
*/
public static boolean areStacksSameTypeCrafting(ItemStack stack1, ItemStack stack2) {
if (stack1 == null || stack2 == null)
return false;
return stack1.getItem() == stack2.getItem() &&
return stack1 != null && stack2 != null &&
stack1.getItem() == stack2.getItem() &&
(stack1.getItemDamage() == stack2.getItemDamage() || stack1.getItemDamage() == OreDictionary.WILDCARD_VALUE || stack2.getItemDamage() == OreDictionary.WILDCARD_VALUE || stack1.getItem().isDamageable());
}
@@ -361,4 +359,18 @@ public class NEIServerUtils
sb.deleteCharAt(sb.length()-1);
return sb;
}
public static void logOnce(Throwable t, Set<String> stackTraces, String message) {
logOnce(t, stackTraces, message, "");
}
public static void logOnce(Throwable t, Set<String> stackTraces, String message, String identifier) {
StringWriter sw = new StringWriter();
t.printStackTrace(new PrintWriter(sw));
String stackTrace = identifier + sw.toString();
if (!stackTraces.contains(stackTrace)) {
NEIServerConfig.logger.error(message, t);
stackTraces.add(stackTrace);
}
}
}