-
Notifications
You must be signed in to change notification settings - Fork 222
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
Unload chunks command #674
Conversation
Unloads chunks that are not in use.
Forgot to test it from console. Fixed.
import org.bukkit.entity.Player; | ||
|
||
@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH) | ||
@CommandParameters(description = "Super admin command - unloads chunks not currently in use.", usage = "/<command>") |
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.
Don't prefix this with Super admin command - please.
@ChargedCreeper Looks good but needs a quick format. Use source -> format to auto-format your source. :) |
Updated formatting.
@JeromSar I updated the formatting, and added the braces. The no braces thing is a habit I picked up from a C++ class I took. |
{ | ||
numChunks += unloadUnusedChunks(world); | ||
} | ||
TFM_Util.adminAction(sender.getName(), "unloading unused chunks.", true); |
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.
Trailing full stop here, should also start with a capital.
@ChargedCreeper Hey, sorry for the late reply. Just a small tweak, and we can merge this. |
@JeromSar I'm not sure what you mean. What needs to be changed? |
See comment above. |
@ChargedCreeper Any updates on this? |
I updated with what I thought you meant but I'm still not 100% sure what you mean by trailing full stop. |
bump? |
@ChargedCreeper Sorry for the confusion. The |
|
||
@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH) | ||
@CommandParameters(description = "Unloads chunks not currently in use.", usage = "/<command>") | ||
public class Command_rc extends TFM_Command |
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.
Probably should be the full command name, and /rc as an alias.
@JeromSar Ah ok. Fixed it. |
{ | ||
numChunks += unloadUnusedChunks(world); | ||
} | ||
TFM_Util.adminAction(sender.getName(), "Unloading unused chunks", true); |
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.
Message should probably be sent before actually unloading chunks. :)
@ChargedCreeper Thanks for the quick update. One small fix, and I think this PR is ready for merging. :) |
Send the message before the actual unloading of chunks.
@JeromSar I moved the message broadcast to before the chunks are unloaded. |
Thanks for contributing @ChargedCreeper! This PR will be merged soon. :) |
@JeromSar sorry about the delay. I've never seen anything like CLAassistant before and I wanted to be sure it was legit first. |
@ChargedCreeper No problem! :) |
@JeromSar Bump |
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.
This should now be ready to merge.
Merged in be8203a Thanks for contributing! |
Unloads chunks that are not in use. I can change the name/label of the command if needed. I have already tested this code, and it does in fact unload chunks.