-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
[Update] Add new Features & Fixes (see desc) #4
[Update] Add new Features & Fixes (see desc) #4
Conversation
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.
idk if i like the mess in the main class now.
but i also dont want to be a burden in this pr
src/main/java/dev/j3fftw/worldeditslimefun/commands/WorldEditSlimefunCommands.java
Outdated
Show resolved
Hide resolved
src/main/java/dev/j3fftw/worldeditslimefun/slimefun/WandListener.java
Outdated
Show resolved
Hide resolved
Nah you're good, I can move stuff around |
Clean it up |
can we change the commands to bee --energy and --inputslots |
One thing worth noting is that I'd like to abstract this command flags system at some point, not sure how or to what but I could see it being useful in other projects |
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.
quick review.
Need to do a proper review later.
|
||
if (args.isEmpty()) { | ||
return availableFlags; | ||
} | ||
|
||
String currentArg = args.remove(args.size() - 1); | ||
if (args.isEmpty()) { | ||
return availableFlags; | ||
} |
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.
why do we return the same thing twice?
we both check the same thing here
should line 61 maybe be currentArg.isEmpty()?
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.
line 60 calls .remove, so args changes and the check is made again.
because if it's empty after removing one arg (the arg it's typing actively) it means it's the first argument, which would be a --flag
return availableFlags; | ||
} | ||
|
||
String lastArg = args.get(args.size() - 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.
shouldnt this use currentArg?
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.
no....?
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.
oh I guess I never actually use currentArg do I, lol.
I can probably remove the variable declaration then? But it might make it even less readable doing so
currentArg is the argument actively being typed. acf will handle filtering the options based on the current argument so leaving it alone is all we need to do. What's really important is knowing what the last full argument was.
src/main/java/dev/j3fftw/worldeditslimefun/commands/WorldEditSlimefunCommands.java
Show resolved
Hide resolved
Co-authored-by: J3fftw <[email protected]>
Btw do you plan on adding this to blob builds? Or just purely GitHub releases |
I am apparently not allowed to rename the branch, whoops lol |
I'll rebase and update the PR name & desc later today |
I've tested the new task flags, all now work as intended! |
One thing I still need to do is add those new flags to the readme |
have you tested this? |
This PR does a LARGE amount of things, I will do my best to cover them all here.
To Do
Changes (Small ones)
Items
where any slimefun items can be registered onItems#init
, currently only used for the wand/wesf wand
WandListener
used to detect when a player uses the wandPositionManager
Utils
Command Changes
There was some major changes made here
WorldEditSlimefunCommands Changes
@CommandPermission("wesf.admin")
annotation, as it will automatically apply to all commands instead of manually adding to each subcommandWorldEditSlimefunCommands#init
PositionManager
WorldEditSlimefunCommands#loopThroughSelection
CommandFlags
At the request of Jeff I have made a Command flag system, this is modular and can be easily updated in the future to add more features
CommandFlag
this abstract class accepts a type parameter for its value, ie, EnergyFlag stores a boolean, true to add, false to notCommandFlags
this class stores all actual flags & is the "brains" behind most of the operationCommandFlag
implementations are stored in theFLAG_TYPES
map, where the flag is mapped to the default instance of a flagOther
if you have any specific questions about implementation lmk