Skip to content

Commit

Permalink
Fixed datagen for MI cable recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
shartte committed Jan 28, 2024
1 parent ce32bcd commit ed7a6d2
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@

public class RecipesProvider extends RecipeProvider {

private static final Gson GSON = new Gson();
private final PackOutput packOutput;

public RecipesProvider(PackOutput packOutput, CompletableFuture<HolderLookup.Provider> registries) {
Expand Down Expand Up @@ -180,11 +181,10 @@ private void writeRawRecipe(CachedOutput output, ResourceLocation id, Map<String
var path = recipePathProvider.json(id);
var outputFile = packOutput.getOutputFolder(PackOutput.Target.DATA_PACK).resolve(path);

var gson = new Gson();
var jsonObject = (JsonObject) gson.toJsonTree(recipe);
var jsonObject = (JsonObject) GSON.toJsonTree(recipe);
ICondition.writeConditions(JsonOps.INSTANCE, jsonObject, Arrays.asList(conditions));

var content = gson.toJson(jsonObject).getBytes(StandardCharsets.UTF_8);
var content = GSON.toJson(jsonObject).getBytes(StandardCharsets.UTF_8);

try {
output.writeIfNeeded(outputFile, content, HashCode.fromBytes(content));
Expand Down

0 comments on commit ed7a6d2

Please sign in to comment.