Skip to content
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

Closed
wants to merge 7 commits into from
Closed

Unload chunks command #674

wants to merge 7 commits into from

Conversation

ChargedCreeper
Copy link
Contributor

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.

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>")
Copy link
Member

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.

@JeromSar
Copy link
Member

JeromSar commented Jun 7, 2015

@ChargedCreeper Looks good but needs a quick format. Use source -> format to auto-format your source. :)

@JeromSar JeromSar self-assigned this Jun 8, 2015
Updated formatting.
@ChargedCreeper
Copy link
Contributor Author

@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);
Copy link
Member

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.

@JeromSar
Copy link
Member

@ChargedCreeper Hey, sorry for the late reply. Just a small tweak, and we can merge this.

@ChargedCreeper
Copy link
Contributor Author

@JeromSar I'm not sure what you mean. What needs to be changed?

@JeromSar
Copy link
Member

See comment above.

@JeromSar
Copy link
Member

@ChargedCreeper Any updates on this?

@ChargedCreeper
Copy link
Contributor Author

I updated with what I thought you meant but I'm still not 100% sure what you mean by trailing full stop.

@lemonsked
Copy link
Member

bump?

@JeromSar
Copy link
Member

@ChargedCreeper Sorry for the confusion. The TFM_Util.adminMsg() message should not end with a full stop and should start with a capital letter. :)


@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH)
@CommandParameters(description = "Unloads chunks not currently in use.", usage = "/<command>")
public class Command_rc extends TFM_Command
Copy link
Member

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.

@ChargedCreeper
Copy link
Contributor Author

@JeromSar Ah ok. Fixed it.

{
numChunks += unloadUnusedChunks(world);
}
TFM_Util.adminAction(sender.getName(), "Unloading unused chunks", true);
Copy link
Member

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. :)

@JeromSar
Copy link
Member

@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.
@ChargedCreeper
Copy link
Contributor Author

@JeromSar I moved the message broadcast to before the chunks are unloaded.

@JeromSar
Copy link
Member

Thanks for contributing @ChargedCreeper! This PR will be merged soon. :)

@CLAassistant
Copy link

CLAassistant commented Feb 29, 2016

CLA assistant check
All committers have signed the CLA.

@ChargedCreeper
Copy link
Contributor Author

@JeromSar sorry about the delay. I've never seen anything like CLAassistant before and I wanted to be sure it was legit first.

@JeromSar
Copy link
Member

@ChargedCreeper No problem! :)

@JeromSar JeromSar removed their assignment Apr 21, 2016
@Wild1145
Copy link
Member

@JeromSar Bump

Copy link
Member

@Wild1145 Wild1145 left a 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.

JeromSar added a commit that referenced this pull request Nov 13, 2016
JeromSar pushed a commit that referenced this pull request Nov 13, 2016
@JeromSar
Copy link
Member

Merged in be8203a

Thanks for contributing!

@JeromSar JeromSar closed this Nov 13, 2016
JeromSar pushed a commit that referenced this pull request Jan 8, 2017
lemonsked pushed a commit to lemonsked/TotalFreedomMod that referenced this pull request Jun 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants