Fix shapeless recipes not being able to use NBT on output, and fixed issue with null groups.

This commit is contained in:
Vincent Lee 2017-06-19 18:49:21 -05:00 committed by LexManos
parent 303578b2f2
commit f7831fbe99
3 changed files with 4 additions and 3 deletions

View file

@ -503,7 +503,7 @@ public class CraftingHelper {
if (ings.size() > 9)
throw new JsonParseException("Too many ingredients for shapeless recipe");
ItemStack itemstack = ShapedRecipes.deserializeItem(JsonUtils.getJsonObject(json, "result"), true);
ItemStack itemstack = CraftingHelper.getItemStack(JsonUtils.getJsonObject(json, "result"), context);
return new ShapelessRecipes(group, itemstack, ings);
});
registerR("forge:ore_shaped", ShapedOreRecipe::factory);

View file

@ -40,6 +40,7 @@ import java.util.Set;
import java.util.Map.Entry;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
@ -171,7 +172,7 @@ public class ShapedOreRecipe extends IForgeRegistryEntry.Impl<IRecipe> implement
@Nonnull
public String getGroup()
{
return this.group.toString();
return this.group == null ? "" : this.group.toString();
}
@Override

View file

@ -162,7 +162,7 @@ public class ShapelessOreRecipe extends IForgeRegistryEntry.Impl<IRecipe> implem
if (ings.isEmpty())
throw new JsonParseException("No ingredients for shapeless recipe");
ItemStack itemstack = ShapedRecipes.deserializeItem(JsonUtils.getJsonObject(json, "result"), true);
ItemStack itemstack = CraftingHelper.getItemStack(JsonUtils.getJsonObject(json, "result"), context);
return new ShapelessOreRecipe(group.isEmpty() ? null : new ResourceLocation(group), ings, itemstack);
}
}