Skip to content

Commit

Permalink
Added namespace support for recipe components
Browse files Browse the repository at this point in the history
  • Loading branch information
LatvianModder committed Jul 3, 2024
1 parent 5c6cbc0 commit 07c2a78
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
*/
@Nullable
public interface RecipeComponent<T> {
Codec<RecipeComponent<?>> CODEC = Codec.unit(null); // FIXME!!!

static RecipeComponentBuilder builder() {
return new RecipeComponentBuilder(4);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ public RecipeComponent<?> getComponent(String string) {
public RecipeComponent<?> readComponent(StringReader reader) throws Exception {
reader.skipWhitespace();
var key = reader.readUnquotedString();

if (reader.canRead() && reader.peek() == ':') {
reader.skip();
key += ":" + reader.readUnquotedString();
}

RecipeComponent<?> component = simpleComponents.get(key);

if (component == null) {
Expand Down

0 comments on commit 07c2a78

Please sign in to comment.