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) {
final String path;
final ItemStack itemStackOutput = recipe.getRecipeOutput();
assert itemStackOutput.getItem().getRegistryName() != null;
if (itemStackOutput.isEmpty()) {
path = recipe.toString();
} else if (itemStackOutput.getCount() == 1) {
path = String.format("%s@%d%s",
itemStackOutput.getItem().getRegistryName(),
itemStackOutput.getItem().getRegistryName().getPath(),
itemStackOutput.getItemDamage(),
suffix );
} else {
path = String.format("%s@%dx%d%s",
itemStackOutput.getItem().getRegistryName(),
itemStackOutput.getItem().getRegistryName().getPath(),
itemStackOutput.getItemDamage(),
itemStackOutput.getCount(),
suffix );