Skip to content

Commit

Permalink
feat: update to work with modonomicon 1.60
Browse files Browse the repository at this point in the history
  • Loading branch information
klikli-dev committed Feb 28, 2024
1 parent e7ee994 commit 52dff5e
Show file tree
Hide file tree
Showing 11 changed files with 72 additions and 37 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ mod_description=An open-source magic mod built around classical alchemy to repli

jei_version=15.2.0.23
jei_version_range=[15.2.0.0,)
modonomicon_version=1.54.4
modonomicon_version_range=[1.52.0,)
modonomicon_version=1.60.0
modonomicon_version_range=[1.60.0,)
almost_unified_version=0.5.0
almost_unified_version_range=[0.5.0,)
# geckolib currently names their files after 1.20
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import com.google.gson.JsonObject;
import com.klikli_dev.modonomicon.book.BookEntry;
import com.klikli_dev.modonomicon.book.BookTextHolder;
import com.klikli_dev.modonomicon.book.conditions.BookCondition;
import com.klikli_dev.modonomicon.book.conditions.BookNoneCondition;
import com.klikli_dev.modonomicon.book.page.BookRecipePage;
import com.klikli_dev.theurgy.content.recipe.AccumulationRecipe;
import com.klikli_dev.theurgy.integration.modonomicon.TheurgyModonomiconConstants;
Expand All @@ -20,20 +22,24 @@
import net.minecraft.world.level.Level;

public class BookAccumulationRecipePage extends BookRecipePage<AccumulationRecipe> {
public BookAccumulationRecipePage(BookTextHolder title1, ResourceLocation recipeId1, BookTextHolder title2, ResourceLocation recipeId2, BookTextHolder text, String anchor) {
super(RecipeTypeRegistry.ACCUMULATION.get(), title1, recipeId1, title2, recipeId2, text, anchor);
public BookAccumulationRecipePage(BookTextHolder title1, ResourceLocation recipeId1, BookTextHolder title2, ResourceLocation recipeId2, BookTextHolder text, String anchor, BookCondition condition) {
super(RecipeTypeRegistry.ACCUMULATION.get(), title1, recipeId1, title2, recipeId2, text, anchor, condition);
}

public static BookAccumulationRecipePage fromJson(JsonObject json) {
var common = BookRecipePage.commonFromJson(json);
var anchor = GsonHelper.getAsString(json, "anchor", "");
return new BookAccumulationRecipePage(common.title1(), common.recipeId1(), common.title2(), common.recipeId2(), common.text(), anchor);
var condition = json.has("condition")
? BookCondition.fromJson(json.getAsJsonObject("condition"))
: new BookNoneCondition();
return new BookAccumulationRecipePage(common.title1(), common.recipeId1(), common.title2(), common.recipeId2(), common.text(), anchor, condition);
}

public static BookAccumulationRecipePage fromNetwork(FriendlyByteBuf buffer) {
var common = BookRecipePage.commonFromNetwork(buffer);
var anchor = buffer.readUtf();
return new BookAccumulationRecipePage(common.title1(), common.recipeId1(), common.title2(), common.recipeId2(), common.text(), anchor);
var condition = BookCondition.fromNetwork(buffer);
return new BookAccumulationRecipePage(common.title1(), common.recipeId1(), common.title2(), common.recipeId2(), common.text(), anchor, condition);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

package com.klikli_dev.theurgy.integration.modonomicon.page.accumulation;

import com.klikli_dev.modonomicon.api.datagen.book.condition.BookConditionModel;
import com.klikli_dev.modonomicon.api.datagen.book.page.BookRecipePageModel;
import com.klikli_dev.theurgy.integration.modonomicon.TheurgyModonomiconConstants;
import org.jetbrains.annotations.NotNull;

public class BookAccumulationRecipePageModel extends BookRecipePageModel {
protected BookAccumulationRecipePageModel(@NotNull String anchor) {
super(TheurgyModonomiconConstants.Page.ACCUMULATION_RECIPE, anchor);
protected BookAccumulationRecipePageModel(@NotNull String anchor, @NotNull BookConditionModel condition) {
super(TheurgyModonomiconConstants.Page.ACCUMULATION_RECIPE, anchor, condition);
}

public static Builder builder() {
Expand All @@ -23,7 +24,7 @@ protected Builder() {
}

public BookAccumulationRecipePageModel build() {
var model = new BookAccumulationRecipePageModel(this.anchor);
var model = new BookAccumulationRecipePageModel(this.anchor, this.condition);
model.title1 = this.title1;
model.recipeId1 = this.recipeId1;
model.title2 = this.title2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

import com.google.gson.JsonObject;
import com.klikli_dev.modonomicon.book.BookTextHolder;
import com.klikli_dev.modonomicon.book.conditions.BookCondition;
import com.klikli_dev.modonomicon.book.conditions.BookNoneCondition;
import com.klikli_dev.modonomicon.book.page.BookProcessingRecipePage;
import com.klikli_dev.modonomicon.book.page.BookRecipePage;
import com.klikli_dev.theurgy.content.recipe.CalcinationRecipe;
Expand All @@ -16,20 +18,24 @@
import net.minecraft.util.GsonHelper;

public class BookCalcinationRecipePage extends BookProcessingRecipePage<CalcinationRecipe> {
public BookCalcinationRecipePage(BookTextHolder title1, ResourceLocation recipeId1, BookTextHolder title2, ResourceLocation recipeId2, BookTextHolder text, String anchor) {
super(RecipeTypeRegistry.CALCINATION.get(), title1, recipeId1, title2, recipeId2, text, anchor);
public BookCalcinationRecipePage(BookTextHolder title1, ResourceLocation recipeId1, BookTextHolder title2, ResourceLocation recipeId2, BookTextHolder text, String anchor, BookCondition condition) {
super(RecipeTypeRegistry.CALCINATION.get(), title1, recipeId1, title2, recipeId2, text, anchor, condition);
}

public static BookCalcinationRecipePage fromJson(JsonObject json) {
var common = BookRecipePage.commonFromJson(json);
var anchor = GsonHelper.getAsString(json, "anchor", "");
return new BookCalcinationRecipePage(common.title1(), common.recipeId1(), common.title2(), common.recipeId2(), common.text(), anchor);
var condition = json.has("condition")
? BookCondition.fromJson(json.getAsJsonObject("condition"))
: new BookNoneCondition();
return new BookCalcinationRecipePage(common.title1(), common.recipeId1(), common.title2(), common.recipeId2(), common.text(), anchor, condition);
}

public static BookCalcinationRecipePage fromNetwork(FriendlyByteBuf buffer) {
var common = BookRecipePage.commonFromNetwork(buffer);
var anchor = buffer.readUtf();
return new BookCalcinationRecipePage(common.title1(), common.recipeId1(), common.title2(), common.recipeId2(), common.text(), anchor);
var condition = BookCondition.fromNetwork(buffer);
return new BookCalcinationRecipePage(common.title1(), common.recipeId1(), common.title2(), common.recipeId2(), common.text(), anchor, condition);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

package com.klikli_dev.theurgy.integration.modonomicon.page.calcination;

import com.klikli_dev.modonomicon.api.datagen.book.condition.BookConditionModel;
import com.klikli_dev.modonomicon.api.datagen.book.page.BookRecipePageModel;
import com.klikli_dev.theurgy.integration.modonomicon.TheurgyModonomiconConstants;
import org.jetbrains.annotations.NotNull;

public class BookCalcinationRecipePageModel extends BookRecipePageModel {
protected BookCalcinationRecipePageModel(@NotNull String anchor) {
super(TheurgyModonomiconConstants.Page.CALCINATION_RECIPE, anchor);
protected BookCalcinationRecipePageModel(@NotNull String anchor, @NotNull BookConditionModel condition) {
super(TheurgyModonomiconConstants.Page.CALCINATION_RECIPE, anchor, condition);
}

public static Builder builder() {
Expand All @@ -23,7 +24,7 @@ protected Builder() {
}

public BookCalcinationRecipePageModel build() {
var model = new BookCalcinationRecipePageModel(this.anchor);
var model = new BookCalcinationRecipePageModel(this.anchor, this.condition);
model.title1 = this.title1;
model.recipeId1 = this.recipeId1;
model.title2 = this.title2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

import com.google.gson.JsonObject;
import com.klikli_dev.modonomicon.book.BookTextHolder;
import com.klikli_dev.modonomicon.book.conditions.BookCondition;
import com.klikli_dev.modonomicon.book.conditions.BookNoneCondition;
import com.klikli_dev.modonomicon.book.page.BookProcessingRecipePage;
import com.klikli_dev.modonomicon.book.page.BookRecipePage;
import com.klikli_dev.theurgy.content.recipe.DistillationRecipe;
Expand All @@ -16,20 +18,24 @@
import net.minecraft.util.GsonHelper;

public class BookDistillationRecipePage extends BookProcessingRecipePage<DistillationRecipe> {
public BookDistillationRecipePage(BookTextHolder title1, ResourceLocation recipeId1, BookTextHolder title2, ResourceLocation recipeId2, BookTextHolder text, String anchor) {
super(RecipeTypeRegistry.DISTILLATION.get(), title1, recipeId1, title2, recipeId2, text, anchor);
public BookDistillationRecipePage(BookTextHolder title1, ResourceLocation recipeId1, BookTextHolder title2, ResourceLocation recipeId2, BookTextHolder text, String anchor, BookCondition condition) {
super(RecipeTypeRegistry.DISTILLATION.get(), title1, recipeId1, title2, recipeId2, text, anchor, condition);
}

public static BookDistillationRecipePage fromJson(JsonObject json) {
var common = BookRecipePage.commonFromJson(json);
var anchor = GsonHelper.getAsString(json, "anchor", "");
return new BookDistillationRecipePage(common.title1(), common.recipeId1(), common.title2(), common.recipeId2(), common.text(), anchor);
var condition = json.has("condition")
? BookCondition.fromJson(json.getAsJsonObject("condition"))
: new BookNoneCondition();
return new BookDistillationRecipePage(common.title1(), common.recipeId1(), common.title2(), common.recipeId2(), common.text(), anchor, condition);
}

public static BookDistillationRecipePage fromNetwork(FriendlyByteBuf buffer) {
var common = BookRecipePage.commonFromNetwork(buffer);
var anchor = buffer.readUtf();
return new BookDistillationRecipePage(common.title1(), common.recipeId1(), common.title2(), common.recipeId2(), common.text(), anchor);
var condition = BookCondition.fromNetwork(buffer);
return new BookDistillationRecipePage(common.title1(), common.recipeId1(), common.title2(), common.recipeId2(), common.text(), anchor, condition);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

package com.klikli_dev.theurgy.integration.modonomicon.page.distillation;

import com.klikli_dev.modonomicon.api.datagen.book.condition.BookConditionModel;
import com.klikli_dev.modonomicon.api.datagen.book.page.BookRecipePageModel;
import com.klikli_dev.theurgy.integration.modonomicon.TheurgyModonomiconConstants;
import org.jetbrains.annotations.NotNull;

public class BookDistillationRecipePageModel extends BookRecipePageModel {
protected BookDistillationRecipePageModel(@NotNull String anchor) {
super(TheurgyModonomiconConstants.Page.DISTILLATION_RECIPE, anchor);
protected BookDistillationRecipePageModel(@NotNull String anchor, @NotNull BookConditionModel condition) {
super(TheurgyModonomiconConstants.Page.DISTILLATION_RECIPE, anchor, condition);
}

public static Builder builder() {
Expand All @@ -23,7 +24,7 @@ protected Builder() {
}

public BookDistillationRecipePageModel build() {
var model = new BookDistillationRecipePageModel(this.anchor);
var model = new BookDistillationRecipePageModel(this.anchor, this.condition);
model.title1 = this.title1;
model.recipeId1 = this.recipeId1;
model.title2 = this.title2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

import com.google.gson.JsonObject;
import com.klikli_dev.modonomicon.book.BookTextHolder;
import com.klikli_dev.modonomicon.book.conditions.BookCondition;
import com.klikli_dev.modonomicon.book.conditions.BookNoneCondition;
import com.klikli_dev.modonomicon.book.page.BookProcessingRecipePage;
import com.klikli_dev.modonomicon.book.page.BookRecipePage;
import com.klikli_dev.theurgy.content.recipe.IncubationRecipe;
Expand All @@ -16,20 +18,24 @@
import net.minecraft.util.GsonHelper;

public class BookIncubationRecipePage extends BookProcessingRecipePage<IncubationRecipe> {
public BookIncubationRecipePage(BookTextHolder title1, ResourceLocation recipeId1, BookTextHolder title2, ResourceLocation recipeId2, BookTextHolder text, String anchor) {
super(RecipeTypeRegistry.INCUBATION.get(), title1, recipeId1, title2, recipeId2, text, anchor);
public BookIncubationRecipePage(BookTextHolder title1, ResourceLocation recipeId1, BookTextHolder title2, ResourceLocation recipeId2, BookTextHolder text, String anchor, BookCondition condition) {
super(RecipeTypeRegistry.INCUBATION.get(), title1, recipeId1, title2, recipeId2, text, anchor, condition);
}

public static BookIncubationRecipePage fromJson(JsonObject json) {
var common = BookRecipePage.commonFromJson(json);
var anchor = GsonHelper.getAsString(json, "anchor", "");
return new BookIncubationRecipePage(common.title1(), common.recipeId1(), common.title2(), common.recipeId2(), common.text(), anchor);
var condition = json.has("condition")
? BookCondition.fromJson(json.getAsJsonObject("condition"))
: new BookNoneCondition();
return new BookIncubationRecipePage(common.title1(), common.recipeId1(), common.title2(), common.recipeId2(), common.text(), anchor, condition);
}

public static BookIncubationRecipePage fromNetwork(FriendlyByteBuf buffer) {
var common = BookRecipePage.commonFromNetwork(buffer);
var anchor = buffer.readUtf();
return new BookIncubationRecipePage(common.title1(), common.recipeId1(), common.title2(), common.recipeId2(), common.text(), anchor);
var condition = BookCondition.fromNetwork(buffer);
return new BookIncubationRecipePage(common.title1(), common.recipeId1(), common.title2(), common.recipeId2(), common.text(), anchor, condition);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

package com.klikli_dev.theurgy.integration.modonomicon.page.incubation;

import com.klikli_dev.modonomicon.api.datagen.book.condition.BookConditionModel;
import com.klikli_dev.modonomicon.api.datagen.book.page.BookRecipePageModel;
import com.klikli_dev.theurgy.integration.modonomicon.TheurgyModonomiconConstants;
import org.jetbrains.annotations.NotNull;

public class BookIncubationRecipePageModel extends BookRecipePageModel {
protected BookIncubationRecipePageModel(@NotNull String anchor) {
super(TheurgyModonomiconConstants.Page.INCUBATION_RECIPE, anchor);
protected BookIncubationRecipePageModel(@NotNull String anchor, @NotNull BookConditionModel condition) {
super(TheurgyModonomiconConstants.Page.INCUBATION_RECIPE, anchor, condition);
}

public static Builder builder() {
Expand All @@ -23,7 +24,7 @@ protected Builder() {
}

public BookIncubationRecipePageModel build() {
var model = new BookIncubationRecipePageModel(this.anchor);
var model = new BookIncubationRecipePageModel(this.anchor, this.condition);
model.title1 = this.title1;
model.recipeId1 = this.recipeId1;
model.title2 = this.title2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

import com.google.gson.JsonObject;
import com.klikli_dev.modonomicon.book.BookTextHolder;
import com.klikli_dev.modonomicon.book.conditions.BookCondition;
import com.klikli_dev.modonomicon.book.conditions.BookNoneCondition;
import com.klikli_dev.modonomicon.book.page.BookProcessingRecipePage;
import com.klikli_dev.modonomicon.book.page.BookRecipePage;
import com.klikli_dev.theurgy.content.recipe.LiquefactionRecipe;
Expand All @@ -16,20 +18,24 @@
import net.minecraft.util.GsonHelper;

public class BookLiquefactionRecipePage extends BookProcessingRecipePage<LiquefactionRecipe> {
public BookLiquefactionRecipePage(BookTextHolder title1, ResourceLocation recipeId1, BookTextHolder title2, ResourceLocation recipeId2, BookTextHolder text, String anchor) {
super(RecipeTypeRegistry.LIQUEFACTION.get(), title1, recipeId1, title2, recipeId2, text, anchor);
public BookLiquefactionRecipePage(BookTextHolder title1, ResourceLocation recipeId1, BookTextHolder title2, ResourceLocation recipeId2, BookTextHolder text, String anchor, BookCondition condition) {
super(RecipeTypeRegistry.LIQUEFACTION.get(), title1, recipeId1, title2, recipeId2, text, anchor, condition);
}

public static BookLiquefactionRecipePage fromJson(JsonObject json) {
var common = BookRecipePage.commonFromJson(json);
var anchor = GsonHelper.getAsString(json, "anchor", "");
return new BookLiquefactionRecipePage(common.title1(), common.recipeId1(), common.title2(), common.recipeId2(), common.text(), anchor);
var condition = json.has("condition")
? BookCondition.fromJson(json.getAsJsonObject("condition"))
: new BookNoneCondition();
return new BookLiquefactionRecipePage(common.title1(), common.recipeId1(), common.title2(), common.recipeId2(), common.text(), anchor, condition);
}

public static BookLiquefactionRecipePage fromNetwork(FriendlyByteBuf buffer) {
var common = BookRecipePage.commonFromNetwork(buffer);
var anchor = buffer.readUtf();
return new BookLiquefactionRecipePage(common.title1(), common.recipeId1(), common.title2(), common.recipeId2(), common.text(), anchor);
var condition = BookCondition.fromNetwork(buffer);
return new BookLiquefactionRecipePage(common.title1(), common.recipeId1(), common.title2(), common.recipeId2(), common.text(), anchor, condition);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

package com.klikli_dev.theurgy.integration.modonomicon.page.liquefaction;

import com.klikli_dev.modonomicon.api.datagen.book.condition.BookConditionModel;
import com.klikli_dev.modonomicon.api.datagen.book.page.BookRecipePageModel;
import com.klikli_dev.theurgy.integration.modonomicon.TheurgyModonomiconConstants;
import org.jetbrains.annotations.NotNull;

public class BookLiquefactionRecipePageModel extends BookRecipePageModel {
protected BookLiquefactionRecipePageModel(@NotNull String anchor) {
super(TheurgyModonomiconConstants.Page.LIQUEFACTION_RECIPE, anchor);
protected BookLiquefactionRecipePageModel(@NotNull String anchor, @NotNull BookConditionModel condition) {
super(TheurgyModonomiconConstants.Page.LIQUEFACTION_RECIPE, anchor, condition);
}

public static Builder builder() {
Expand All @@ -23,7 +24,7 @@ protected Builder() {
}

public BookLiquefactionRecipePageModel build() {
var model = new BookLiquefactionRecipePageModel(this.anchor);
var model = new BookLiquefactionRecipePageModel(this.anchor, this.condition);
model.title1 = this.title1;
model.recipeId1 = this.recipeId1;
model.title2 = this.title2;
Expand Down

0 comments on commit 52dff5e

Please sign in to comment.