-
-
Notifications
You must be signed in to change notification settings - Fork 374
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
Add recipe support #5204
Add recipe support #5204
Conversation
097b075
to
450e304
Compare
450e304
to
00e8d53
Compare
Just a suggestion but do you think it would be worth this being a structure when they're released? I feel like as these aren't dependent on any event these can be utilised. on join:
send "§eWelcome §7%player%§e!"
create crafting recipe for gold sword with key "test":
dirt, dirt, air
air, dirt, air
air, air, air I just feel this is alot easier tbh, not that big of a difference but a nice enhancement to have |
I believe there was talk about whether they should be made as a structure but from what I remember we mostly put it down |
I see the reasoning here tbh, however arent structures able to be used as sections? i could be missing the ballpark completely but supporting both seems like something that structure is in range for, and if not that would be a nice imrpovment to structures |
I'm aware that you can add the entry stuff as it's public but structures are top level events so they should be limited to the same area events, functions and commands are right? |
Noo! we want theses |
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.
There should also be a Structure for recipe registration. This will allow for parsing time registration. Makes it easier and simpler for users while also having the sections.
Tests can be added.
src/main/java/ch/njol/skript/sections/recipe/SecCookingRecipe.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/njol/skript/sections/recipe/SecCookingRecipe.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/njol/skript/sections/recipe/SecCookingRecipe.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/njol/skript/sections/recipe/SecCookingRecipe.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/njol/skript/sections/recipe/SecCookingRecipe.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/njol/skript/sections/recipe/SecCookingRecipe.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/njol/skript/sections/recipe/SecShapedRecipe.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/njol/skript/sections/recipe/SecShapedRecipe.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/njol/skript/sections/recipe/SecShapedRecipe.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/njol/skript/sections/recipe/SecCookingRecipe.java
Outdated
Show resolved
Hide resolved
State of the syntax at time of writing:
Personal thoughts on the existing syntax:
Personal thoughts on additions:
This is mainly just to change the section as little as possible, but allow it to maintain the property of having an effect/section on each line of code. It could be extended with:
if desired. To summarize:I like the current implementation of the syntax, minus the |
Potentially add support for KnowledgeBookMeta? #617 |
Issue related #5261 |
static { | ||
Skript.registerEffect(EffDiscoverRecipe.class, | ||
"make %players% (discover|unlock) recipe[s] %strings%", | ||
"make %players% (undiscover|lock) recipe[s] %strings%", |
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.
whitespace is messed up
@SuppressWarnings("unchecked") | ||
public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelayed, SkriptParser.ParseResult parseResult) { | ||
discover = matchedPattern % 2 == 0; | ||
players = (Expression<Player>) exprs[matchedPattern <= 1 ? 0 : 1]; |
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.
store the condition in a variable
} | ||
|
||
try { | ||
Bukkit.getServer().addRecipe(recipe); |
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.
check this? it seems to return a boolean not throw an exception now that i look again
bd134d0
to
3f08853
Compare
Closing due to inactivity. |
Description
Adds recipe creation section like this:
Target Minecraft Versions: Any
Requirements: N/A
Related Issues: probably but I'll find them later