-
-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recipe Support #7150
base: dev/feature
Are you sure you want to change the base?
Recipe Support #7150
Conversation
# Conflicts: # src/main/java/ch/njol/skript/classes/data/BukkitClasses.java # src/main/java/ch/njol/skript/classes/data/BukkitEventValues.java # src/main/java/ch/njol/skript/classes/data/DefaultComparators.java # src/main/resources/lang/default.lang
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So uuh thinking about moving this to a module?
nada |
src/main/java/ch/njol/skript/conditions/CondDiscoveredRecipes.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/njol/skript/expressions/ExprRecipeCookingTime.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/njol/skript/expressions/ExprRecipeCookingTime.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/njol/skript/expressions/ExprRecipeCookingTime.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/njol/skript/expressions/ExprRecipeCookingTime.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/njol/skript/expressions/ExprRecipeExperience.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided more changes were needed, we're aiming for 100
src/main/java/org/skriptlang/skript/bukkit/recipes/elements/SecRegisterRecipe.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/RecipeModule.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/RecipeModule.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/RecipeModule.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/RecipeModule.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/njol/skript/classes/data/BukkitEventValues.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/njol/skript/classes/data/BukkitEventValues.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/njol/skript/classes/data/BukkitEventValues.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/njol/skript/classes/data/BukkitEventValues.java
Outdated
Show resolved
Hide resolved
I mentioned it to smurf once, but mentioning it in the pr itself will be good, what's the thought about a proper RecipeChoice implementation to have more support of ingredients. If this goes through a custom ItemTypeChoice should be created to enable skript's item types correctly and not converting to an itemstack always. This should be pretty safe due to the fact recipes and these can't be serialized by default |
src/main/java/org/skriptlang/skript/bukkit/recipes/elements/ExprRecipeGroup.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/elements/RecipeEventValues.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/elements/ExprRecipeType.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/elements/ExprRecipeKey.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/elements/ExprRecipeIngredients.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
almost there
src/main/java/org/skriptlang/skript/bukkit/recipes/elements/ExprAllRecipes.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/elements/ExprAllRecipes.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/RecipeCategory.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/RecipeWrapper.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
partial review
src/main/java/org/skriptlang/skript/bukkit/recipes/RecipeUtils.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/RecipeWrapper.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/RecipeWrapper.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/RecipeWrapper.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/RecipeWrapper.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/RecipeWrapper.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/RecipeWrapper.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/elements/EffDiscoverRecipe.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/elements/EffDiscoverRecipe.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/elements/EffDiscoverRecipe.java
Outdated
Show resolved
Hide resolved
So, I tried to have the subclasses extends their respective Bukkit recipe class, but unfortunately it wont let me. |
ah are they final? |
It just says "Class can not extend multiple classes" |
oh right the sub recipes aren't interfaces |
src/main/java/org/skriptlang/skript/bukkit/recipes/RegisterRecipeEvent.java
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/elements/EffDiscoverRecipe.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/elements/EffDiscoverRecipe.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/elements/EvtDiscoverRecipe.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/elements/ExprAllRecipes.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/elements/ExprRecipeCategory.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/elements/ExprRecipeCategory.java
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/elements/ExprRecipeCategory.java
Outdated
Show resolved
Hide resolved
providedName = (Expression<String>) exprs[1]; | ||
AtomicBoolean delayed = new AtomicBoolean(false); | ||
Runnable afterLoading = () -> delayed.set(!getParser().getHasDelayBefore().isFalse()); | ||
trigger = loadCode(sectionNode, "register recipe", afterLoading, providedType.getEventClass()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ideally you could check the trigger for the required things like result/ingredients and error during parse if they're missing entirely.
Unsure how doable that is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, if it was possible, personally, I feel like it's not worth the effort. Presumably, I would only be able to check what expressions are used within the trigger. But there's no guarantee I could safely identify if the conditions required for those expressions are being met. Also, it would just make a whole mess within the init for the section. In my opinion atleast.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well you wouldn't do it in the init of course
it'd be a helper method
and it wouldn't be a foolproof thing, just a first line of defence
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on the way to most commented pr 💪
src/main/java/org/skriptlang/skript/bukkit/recipes/elements/ExprRecipeResult.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/elements/ExprRecipeGroup.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/elements/ExprRecipeExperience.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/elements/ExprRecipeCookingTime.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/MutableRecipe.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/RecipeModule.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/RecipeCategory.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/recipes/elements/SecRegisterRecipe.java
Outdated
Show resolved
Hide resolved
# Conflicts: # src/main/java/ch/njol/skript/Skript.java # src/main/resources/lang/default.lang
Description
This PR aims to add support for recipes including:
Target Minecraft Versions: any
Requirements: none
Related Issues: #5261