-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved recipe error handling, added
category
to shaped, shapeless…
… and cooking recipes
- Loading branch information
1 parent
39d8733
commit 85a63f0
Showing
31 changed files
with
294 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/main/java/dev/latvian/mods/kubejs/error/EmptyRecipeComponentException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package dev.latvian.mods.kubejs.error; | ||
|
||
import dev.latvian.mods.kubejs.recipe.component.RecipeComponent; | ||
|
||
public class EmptyRecipeComponentException extends KubeRuntimeException { | ||
public final RecipeComponent<?> component; | ||
|
||
public EmptyRecipeComponentException(RecipeComponent<?> component) { | ||
super("Component '" + component + "' is not allowed to be empty!"); | ||
this.component = component; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/dev/latvian/mods/kubejs/error/EmptyRecipeComponentValueException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package dev.latvian.mods.kubejs.error; | ||
|
||
import dev.latvian.mods.kubejs.recipe.component.RecipeComponent; | ||
|
||
public class EmptyRecipeComponentValueException extends KubeRuntimeException { | ||
public final RecipeComponent<?> component; | ||
|
||
public EmptyRecipeComponentValueException(RecipeComponent<?> component) { | ||
super("Component '" + component + "' is not allowed to contain empty values!"); | ||
this.component = component; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/dev/latvian/mods/kubejs/error/InvalidRecipeComponentException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package dev.latvian.mods.kubejs.error; | ||
|
||
import dev.latvian.mods.kubejs.recipe.component.RecipeComponentValue; | ||
|
||
public class InvalidRecipeComponentException extends KubeRuntimeException { | ||
public final RecipeComponentValue<?> componentValueHolder; | ||
|
||
public InvalidRecipeComponentException(RecipeComponentValue<?> h, Throwable cause) { | ||
super("Invalid component '" + h.key.name + "' (" + h.key.component + ")", cause); | ||
this.componentValueHolder = h; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/main/java/dev/latvian/mods/kubejs/error/MissingRequiredValueException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package dev.latvian.mods.kubejs.error; | ||
|
||
public class MissingRequiredValueException extends KubeRuntimeException { | ||
public MissingRequiredValueException() { | ||
super("Missing required value"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 0 additions & 74 deletions
74
src/main/java/dev/latvian/mods/kubejs/recipe/ErroredKubeRecipe.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/main/java/dev/latvian/mods/kubejs/recipe/component/BookCategoryComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package dev.latvian.mods.kubejs.recipe.component; | ||
|
||
import net.minecraft.world.item.crafting.CookingBookCategory; | ||
import net.minecraft.world.item.crafting.CraftingBookCategory; | ||
|
||
public class BookCategoryComponent { | ||
public static final EnumComponent<CraftingBookCategory> CRAFTING_BOOK_CATEGORY = EnumComponent.of("crafting_book_category", CraftingBookCategory.class, CraftingBookCategory.CODEC); | ||
public static final EnumComponent<CookingBookCategory> COOKING_BOOK_CATEGORY = EnumComponent.of("cooking_book_category", CookingBookCategory.class, CookingBookCategory.CODEC); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.