Improved recipes naming logic

This commit is contained in:
Unknown 2018-09-10 00:18:05 +02:00
parent 03b01c2057
commit 9401258fca

View file

@ -838,16 +838,17 @@ public class WarpDrive {
if (registryName == null) { if (registryName == null) {
final String path; final String path;
final ItemStack itemStackOutput = recipe.getRecipeOutput(); final ItemStack itemStackOutput = recipe.getRecipeOutput();
assert itemStackOutput.getItem().getRegistryName() != null;
if (itemStackOutput.isEmpty()) { if (itemStackOutput.isEmpty()) {
path = recipe.toString(); path = recipe.toString();
} else if (itemStackOutput.getCount() == 1) { } else if (itemStackOutput.getCount() == 1) {
path = String.format("%s@%d%s", path = String.format("%s@%d%s",
itemStackOutput.getItem().getRegistryName(), itemStackOutput.getItem().getRegistryName().getPath(),
itemStackOutput.getItemDamage(), itemStackOutput.getItemDamage(),
suffix ); suffix );
} else { } else {
path = String.format("%s@%dx%d%s", path = String.format("%s@%dx%d%s",
itemStackOutput.getItem().getRegistryName(), itemStackOutput.getItem().getRegistryName().getPath(),
itemStackOutput.getItemDamage(), itemStackOutput.getItemDamage(),
itemStackOutput.getCount(), itemStackOutput.getCount(),
suffix ); suffix );