mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-18 19:39:06 +00:00
RecipeCatalyst Enhancements (#199)
* Fix serial handlers not searching catalysts
* Prevent null stack from being added
* Prevent duplicate stack from being added
* Prevent empty handlerID from being added
* Extract code to get modded items
* Use HANDLER_ID_FUNCTION to determine handler's id
This allows mods that don't implement getOverlayIdentifier to work with
* Implement priority
* Fix typo
* Allow catalysts to be loaded from csv
Add IC2 catalysts
* minor cleanup
* Add Avaritia, BM, Forestry
* Log if TransferRects fail
* Implement removing catalyst
* Add placeholder for version controlling
* Add a BUNCH of catalysts
* Add Schematics
* Add more NASA
* Add way to resolve conflict with handlerID
resolve conflict between IC2 Compressor and Mekanism Osmium Compressor
* Add more catalysts
* Add ALL GT catalysts
* Add more
* temporary "fix" for item rendering
reverts 9bbdd7b174
* enable by default
* forgot this one
* Add ability to skip search for catalysts
* resolve some todos
This commit is contained in:
1 parent
3ced04b4d3
commit
7834d72ecf
17 files changed
+1534
-118
No files matched your search
@@ -1,6 +1,7 @@
|
||||
package codechicken.nei.recipe;
|
||||
|
||||
import codechicken.nei.NEIClientConfig;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.drawable.DrawableBuilder;
|
||||
import codechicken.nei.drawable.DrawableResource;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
@@ -53,48 +54,10 @@ public class HandlerInfo {
|
||||
public boolean setItem(String itemId, String nbtString) {
|
||||
if(hasImageOrItem())
|
||||
return false;
|
||||
|
||||
int meta = -1;
|
||||
if (!itemId.contains(":")) {
|
||||
NEIClientConfig.logger.info("Item ID missing colon for handler " + handlerName + " - " + modName);
|
||||
return false;
|
||||
}
|
||||
final String[] split = itemId.split(":");
|
||||
// ModID:ItemID
|
||||
String itemLookupId = split[0] + ":" + split[1];
|
||||
|
||||
if(split.length >= 3) {
|
||||
int mIdx = -1;
|
||||
if (split[2].matches("\\d+")) {
|
||||
mIdx = 2;
|
||||
} else {
|
||||
itemLookupId += ":" + split[2];
|
||||
if (split.length >= 4) mIdx = 3;
|
||||
}
|
||||
if (mIdx != -1) meta = Integer.parseInt(split[mIdx]);
|
||||
}
|
||||
|
||||
if (meta != -1) {
|
||||
itemStack = GameRegistry.makeItemStack(itemLookupId, meta, 1, nbtString == null ? "" : nbtString);
|
||||
} else {
|
||||
itemStack = GameRegistry.findItemStack(split[0], split[1], 1);
|
||||
if (nbtString != null && !nbtString.equals("")) {
|
||||
try {
|
||||
final NBTBase nbttag = JsonToNBT.func_150315_a(nbtString);
|
||||
if (!(nbttag instanceof NBTTagCompound)) {
|
||||
NEIClientConfig.logger.info("Unexpected NBT string - multiple values {}", nbtString);
|
||||
return false;
|
||||
}
|
||||
|
||||
itemStack.setTagCompound((NBTTagCompound) nbttag);
|
||||
} catch (NBTException e) {
|
||||
FMLLog.getLogger().log(Level.WARN, "Encountered an exception parsing ItemStack NBT string {}", nbtString, e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
itemStack = NEIServerUtils.getModdedItem(itemId, nbtString);
|
||||
if (itemStack == null)
|
||||
NEIClientConfig.logger.info("Couldn't find " + modName + " - " + itemLookupId);
|
||||
NEIClientConfig.logger.info("Couldn't find " + modName + " - " + itemId);
|
||||
else {
|
||||
this.itemId = itemId;
|
||||
this.nbtString = nbtString;
|
||||
|
||||
Reference in new issue
Block a user