Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ protected void handleReplace() {
@GroovyBlacklist
protected ResourceLocation createName(@Nullable String name, @Nullable String prefix) {
if (name == null) {
return new ResourceLocation(GroovyScript.ID, prefix == null ? RecipeName.generate() : RecipeName.generate(prefix));
return new ResourceLocation(GroovyScript.getRunConfig().getPackId(), prefix == null ? RecipeName.generate() : RecipeName.generate(prefix));
}
if (name.contains(":")) {
return new ResourceLocation(name);
}
return new ResourceLocation(GroovyScript.ID, name);
return new ResourceLocation(GroovyScript.getRunConfig().getPackId(), name);
}

public static class Shaped extends CraftingRecipeBuilder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
public class RecipeName {

private static int nextId = -1;
private static final String prefix = "groovyscript_";
private static String prefix = "";

public static String generate() {
if (prefix.isEmpty())
prefix = GroovyScript.getRunConfig().getPackId() + "_";

return generate(prefix);
}

Expand All @@ -17,6 +20,6 @@ public static String generate(String prefix) {
}

public static ResourceLocation generateRl(String prefix) {
return new ResourceLocation(GroovyScript.ID, prefix + Integer.toHexString(nextId--));
return new ResourceLocation(GroovyScript.getRunConfig().getPackId(), prefix + Integer.toHexString(nextId--));
}
}