mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-10-26 14:24:22 +00:00
Merge branch 'MC19' of github.com:williewillus/Botania into MC19
This commit is contained in:
commit
65bf209835
1 file changed
+6
-4
@@ -48,22 +48,24 @@ public final class LexiconRecipeMappings {
|
||||
}
|
||||
|
||||
public static EntryData getDataForStack(ItemStack stack) {
|
||||
ItemStack wildCopy = stack.copy();
|
||||
wildCopy.setItemDamage(OreDictionary.WILDCARD_VALUE);
|
||||
String wildKey = stackToString(wildCopy);
|
||||
String wildKey = stackToString(stack, true);
|
||||
if (mappings.containsKey(wildKey))
|
||||
return mappings.get(wildKey);
|
||||
return mappings.get(stackToString(stack));
|
||||
}
|
||||
|
||||
public static String stackToString(ItemStack stack) {
|
||||
return stackToString(stack, false);
|
||||
}
|
||||
|
||||
public static String stackToString(ItemStack stack, boolean forceIgnore) {
|
||||
if(stack == null || stack.getItem() == null)
|
||||
return "NULL";
|
||||
|
||||
if(stack.hasTagCompound() && stack.getItem() instanceof IRecipeKeyProvider)
|
||||
return ((IRecipeKeyProvider) stack.getItem()).getKey(stack);
|
||||
|
||||
return stack.getUnlocalizedName() + (ignoreMeta(stack) ? "" : "~" + stack.getItemDamage());
|
||||
return stack.getUnlocalizedName() + (forceIgnore || ignoreMeta(stack) ? "" : "~" + stack.getItemDamage());
|
||||
}
|
||||
|
||||
public static boolean ignoreMeta(ItemStack stack) {
|
||||
|
||||
Reference in new issue
Block a user