Package dev.latvian.mods.kubejs.recipe
Class KubeRecipe
java.lang.Object
dev.latvian.mods.kubejs.recipe.KubeRecipe
- All Implemented Interfaces:
RecipeLikeKJS,dev.latvian.mods.rhino.util.CustomJavaToJsWrapper
- Direct Known Subclasses:
ShapedKubeRecipe,ShapelessKubeRecipe,UnknownKubeRecipe
public class KubeRecipe
extends Object
implements RecipeLikeKJS, dev.latvian.mods.rhino.util.CustomJavaToJsWrapper
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanstatic final Stringbooleannet.minecraft.resources.ResourceLocationcom.google.gson.JsonObjectbooleancom.google.gson.JsonObjectprotected List<IngredientActionHolder> booleanstatic final dev.latvian.mods.rhino.type.TypeInfo -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidfinal voidafterLoaded(ErrorStack stack) final KubeRecipeconsumeIngredient(SlotFilter filter) final dev.latvian.mods.rhino.ScriptableconvertJavaToJs(dev.latvian.mods.rhino.Context cx, dev.latvian.mods.rhino.Scriptable scope, dev.latvian.mods.rhino.type.TypeInfo staticType) final KubeRecipecustomIngredientAction(SlotFilter filter, String id) final KubeRecipedamageIngredient(SlotFilter filter) final KubeRecipedamageIngredient(SlotFilter filter, int damage) voiddeserialize(boolean merge) @Nullable ObjectgetId()net.minecraft.resources.ResourceLocation@Nullable net.minecraft.world.item.crafting.Recipe<?> List<net.minecraft.world.item.crafting.Ingredient> net.minecraft.world.item.ItemStackgetPath()RecipeComponentValue<?>[]Only used bygetOrCreateId()andserializeChanges()in rare case that a recipe can be another recipe type than itself (e.g.<T> Tfinal booleanbooleanhasInput(RecipeMatchContext cx, ReplacementMatchInfo match) booleanhasOutput(RecipeMatchContext cx, ReplacementMatchInfo match) ingredientAction(SlotFilter filter, IngredientAction action) voidinitValues(boolean save) final RecipeComponentValue<?>[]final KubeRecipekeepIngredient(SlotFilter filter) final StringDeprecated.final net.minecraft.resources.ResourceLocationDeprecated.final RecipeSchemakjs$getSchema(dev.latvian.mods.rhino.Context cx) Deprecated.net.minecraft.world.item.crafting.RecipeSerializer<?> net.minecraft.resources.ResourceKey<net.minecraft.world.item.crafting.RecipeSerializer<?>> final voidkjs$setGroup(String group) Deprecated.merge(com.google.gson.JsonObject j) final KubeRecipemodifyResult(String id) final RecipeComponentValue<?>[]final voidremove()final KubeRecipereplaceIngredient(SlotFilter filter, net.minecraft.world.item.ItemStack item) booleanreplaceInput(RecipeScriptContext cx, ReplacementMatchInfo match, Object with) booleanreplaceOutput(RecipeScriptContext cx, ReplacementMatchInfo match, Object with) final voidsave()void<T> KubeRecipetoString()voidPerform additional validation after the recipe has been loaded.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.latvian.mods.kubejs.core.RecipeLikeKJS
kjs$getMod, kjs$getType
-
Field Details
-
CHANGED_MARKER
- See Also:
-
TYPE_INFO
public static final dev.latvian.mods.rhino.type.TypeInfo TYPE_INFO -
id
public net.minecraft.resources.ResourceLocation id -
type
-
newRecipe
public boolean newRecipe -
removed
public boolean removed -
sourceLine
-
modifyResult
-
originalJson
public com.google.gson.JsonObject originalJson -
json
public com.google.gson.JsonObject json -
changed
public boolean changed -
creationError
public boolean creationError -
recipeIngredientActions
-
-
Constructor Details
-
KubeRecipe
public KubeRecipe()
-
-
Method Details
-
convertJavaToJs
public final dev.latvian.mods.rhino.Scriptable convertJavaToJs(dev.latvian.mods.rhino.Context cx, dev.latvian.mods.rhino.Scriptable scope, dev.latvian.mods.rhino.type.TypeInfo staticType) - Specified by:
convertJavaToJsin interfacedev.latvian.mods.rhino.util.CustomJavaToJsWrapper
-
deserialize
public void deserialize(boolean merge) -
serialize
public void serialize() -
getValue
-
setValue
-
get
-
set
-
initValues
public void initValues(boolean save) -
getRecipeComponentValues
-
afterLoaded
-
afterLoaded
-
validate
Perform additional validation after the recipe has been loaded. -
save
public final void save() -
id
-
group
-
merge
-
hasChanged
public final boolean hasChanged() -
kjs$getTypeKey
public net.minecraft.resources.ResourceKey<net.minecraft.world.item.crafting.RecipeSerializer<?>> kjs$getTypeKey()- Specified by:
kjs$getTypeKeyin interfaceRecipeLikeKJS
-
kjs$getGroup
Deprecated.- Specified by:
kjs$getGroupin interfaceRecipeLikeKJS
-
kjs$setGroup
Deprecated.- Specified by:
kjs$setGroupin interfaceRecipeLikeKJS
-
kjs$getOrCreateId
Deprecated.- Specified by:
kjs$getOrCreateIdin interfaceRecipeLikeKJS
-
kjs$getSchema
Deprecated.- Specified by:
kjs$getSchemain interfaceRecipeLikeKJS
-
kjs$getSerializer
public net.minecraft.world.item.crafting.RecipeSerializer<?> kjs$getSerializer()- Specified by:
kjs$getSerializerin interfaceRecipeLikeKJS
-
inputValues
-
outputValues
-
hasInput
- Specified by:
hasInputin interfaceRecipeLikeKJS
-
replaceInput
- Specified by:
replaceInputin interfaceRecipeLikeKJS
-
hasOutput
- Specified by:
hasOutputin interfaceRecipeLikeKJS
-
replaceOutput
- Specified by:
replaceOutputin interfaceRecipeLikeKJS
-
toString
-
getId
-
getPath
-
getOrCreateId
@HideFromJS public net.minecraft.resources.ResourceLocation getOrCreateId() -
getFromToString
-
remove
public final void remove() -
stage
-
getSerializationTypeFunction
Only used bygetOrCreateId()andserializeChanges()in rare case that a recipe can be another recipe type than itself (e.g. kubejs:shaped -> minecraft:crafting_shaped) -
serializeChanges
-
getOriginalRecipe
@Nullable public @Nullable net.minecraft.world.item.crafting.Recipe<?> getOriginalRecipe() -
getOriginalRecipeResult
public net.minecraft.world.item.ItemStack getOriginalRecipeResult() -
getOriginalRecipeIngredients
-
ingredientAction
-
damageIngredient
-
damageIngredient
-
replaceIngredient
public final KubeRecipe replaceIngredient(SlotFilter filter, net.minecraft.world.item.ItemStack item) -
customIngredientAction
-
keepIngredient
-
consumeIngredient
-
modifyResult
-