This commit is contained in:
Steven Lawson 2013-07-11 18:22:12 -04:00
commit f8e62a9893
5 changed files with 35 additions and 121 deletions

View File

@ -1,63 +1,50 @@
# How to contribute # Contributing to TotalFreedomMod #
TotalFreedomMod is a CraftBukkit server plugin designed primarily to support the [Official TotalFreedom Minecraft Server](http://totalfreedom.me/). However, it can be used in a variety of other configurations with minimal fuss.
TotalFreedomMod aims to be a fully functional all-op server mod which works in For those who wish to contribute, we encourage you to fork the repository and submit pull requests. Below you will find guidelines that will explain this process in further detail.
a large range of configurations. In order to be as flexible as possible on the
server-end, we encourage contributing to TotalFreedomMod by making 'pull-requests'
to this repository.
## Getting Started
## Getting Started ##
* Make sure you have a [GitHub account](https://github.com/signup/free) * Make sure you have a [GitHub account](https://github.com/signup/free)
* If the issue is a bug, submit a ticket for it, assuming one does not already exist. * If the issue is a bug, submit a ticket for it, assuming one does not already exist.
* Clearly describe the issue including steps to reproduce it. * Clearly describe the issue including steps to reproduce it.
* Make sure you fill in the earliest version that you know has the issue. * Make sure you fill in the earliest version that you know has the issue.
* Fork the repository on GitHub * Fork the repository on GitHub
## Making Changes ## Making Changes ##
* Create a topic branch from where you want to base your work. * Create a topic branch from where you want to base your work.
* This is usually the master branch. * This is usually the master branch.
* Only target release branches if you are certain your addition must be on that * Only target release branches if you are certain your addition must be on that branch.
branch. * To quickly create a topic branch based on master; `git checkout -b contribution` - Please avoid working directly on the `master` branch.
* To quickly create a topic branch based on master; `git checkout -b contribution`
Please avoid working directly on the `master` branch.
* Make changes and commit where necessary. * Make changes and commit where necessary.
* Check for unnecessary whitespace with `git diff --check` before committing. * Check for unnecessary whitespace with `git diff --check` before committing.
* Make sure your commit messages are in line with those which are already made. * Make sure your commit messages are in line with those which are already made.
* Make sure your changes build (*and work!*). * Make sure your changes build (<b>and work!</b>).
## Tips on getting your pull request accepted ## Tips - How To Get Your Pull Request Accepted ##
* Make sure your changes work and compile without difficulty. * Make sure your changes work and compile without difficulty.
* Make sure your change adds something useful, do not add commands to micromanage * Make sure your change adds something useful, do not add commands to micromanage the server. (ie: Shorthands for a collection of commands)
the server. (ie: Shorthands for a collection of commands) * __Commands that make use of `org.bukkit.Server.dispatchCommand()` will probably be rejected.__
* Features must be in line the general idea of "Total Freedom". * Features must be in line the general idea of "Total Freedom".
* Changes must be directed towards the main "TotalFreedom" server. Adding names such * Changes must be directed towards the main "TotalFreedom" server. Adding names such as the name of your own TotalFreedom-like server will get your pull request denied.
as the name of your own TotalFreedom-like server will get your pull request denied.
* Do not add yourself to the developer list. * Do not add yourself to the developer list.
* Ensure that you use the correct whitespace-style. That is: 4 spaces as indentation. * Ensure that you use the correct whitespace-style. That is: 4 spaces as indentation.
* Please make sure your changes are written such as other features would be. Eg: commands * Please make sure your changes are written such as other features would be. Eg: commands have their own class and extend TFM_Command.
have their own class and extend TFM_Command. * __Make sure your code is written in the [Allman style](http://en.wikipedia.org/wiki/Indent_style#Allman_style).__
* Make sure your code is written in the [Allman style](http://en.wikipedia.org/wiki/Indent_style#Allman_style).
* Do not increment the version number. * Do not increment the version number.
* If you want to add multiple changes, please make one pull request per change. This * If you want to add multiple changes, please make one pull request per change. This way, it's easier to accept your changes faster and won't block the other changes if there is an issue with a specific line of code.
way, it's easier to accept your changes faster and won't block the other changes if there
is an issue with a specific line of code.
* Please make sure there are no bugs in your code. * Please make sure there are no bugs in your code.
* Please avoid having to add files in the main namespace where possible. * Please avoid having to add files in the main namespace where possible.
* Make sure all changes work before you commit these, this avoids having multiple * Make sure all changes work before you commit these, this avoids having multiple unnecessary commits.
unnecessary commits.
* Please refrain from using an excessive amount of commits. As few as possible is generally the best. * Please refrain from using an excessive amount of commits. As few as possible is generally the best.
* Please do not spread your addition over several pull-requests. * Please do not spread your addition over several pull-requests.
## Submitting Changes ## Submitting Your Changes ##
* Push your changes to a topic branch in your fork of the repository. * Push your changes to a topic branch in your fork of the repository.
* Submit a pull request to this repository. * Submit a pull request to this repository.
* Explain in detail what each one of your commits changes and point out any big changes. * Explain in detail what each one of your commits changes and point out any big changes.
* Wait as a developer evaluates your changes. * Wait as a developer evaluates your changes.
# Additional Resources ## Additional Resources ##
* [TotalFreedom information](http://totalfreedom.me) * [TotalFreedom information](http://totalfreedom.me)
* [TotalFreedom forums](http://totalfreedom.boards.net) * [TotalFreedom forums](http://totalfreedom.boards.net)
* [Bug tracker](https://github.com/TotalFreedom/TotalFreedomMod/issues) * [Bug tracker](https://github.com/TotalFreedom/TotalFreedomMod/issues)

View File

@ -1,16 +0,0 @@
# Legal
TotalFreedomMod by Madgeek1450 and DarthSalamon is an effort to create an opensource plugin to effectively run a "Total Freedom" like all-Op server. It consists of over 85 custom coded commands and a large variety of distinguishable features not included in any other plugin. The plugin has since its beginning grown immensely. Together with the main server "TotalFreedom" (http://totalfreedom.me) TotalFreedomMod has a long-standing reputation of effectiveness whilst maintaining a clear feel of openness towards the administrators and the players themselves.
## License
TotalFreedomMod sourcecode is freely available under the GNU GPLv3 License with a few restrictions in place. The license is available here: http://www.gnu.org/licenses/gpl.txt
The few restrictions are in place to make sure that credit is given to the original authors who remain the maintainers of the plugin and it's sourcecode.
These are the restrictions under which the sourcecode is licensed:
* A un-edited copy of this license must always be included with this sourcecode.
* TotalFreedomMod sourcecode and its derrivations are freely distributable between anyone who choses to download it.
* You may not remove the keywords "Madgeek1450", "StevenLawson", "DarthSalamon" and "jeromsar" from any part of the sourcecode.
* However, compiled binaries (*.jar's) are not to be distributed. If you wish to obtain a copy of TotalFreedomMod you must compile the original sourcecode or it's derivations yourself using an IDE like netbeans. Official superadmins and above of the TotalFreedom (totalfreedom.me) server may obtain a compiled libary with the same limitations as described in this document.
* Any conditions on this license may be waived by any of the official developers.

11
LICENSE.md Normal file
View File

@ -0,0 +1,11 @@
# TotalFreedomMod License #
TotalFreedomMod is primarily derived from the Bukkit and CraftBukkit library and server, respectively. Therefore, we have chosen for it to inherit the GNU GPLv3 License as used by those programs. This license is available at http://www.gnu.org/licenses/gpl-3.0.txt
We do, however, ask that you comply by several restrictions. These restrictions are in place to make sure that credit is given to the original authors, who remain the maintainers of the plugin and its source code.
* A un-edited copy of this LICENSE.md shall always be included with this source code.
* TotalFreedomMod source code and its derivations shall be freely distributable between anyone who chooses to download it.
* You shall not remove the keywords "Madgeek1450", "StevenLawson", "DarthSalamon" or "jeromsar" from any part of the source code.
* Compiled binaries (*.jar's) shall not to be distributed.
* If you wish to obtain a copy of TotalFreedomMod you must compile the original source code or it's derivations yourself.
* The primary developers, StevenLawson (Madgeek1450) and Jerom van der Sar (DarthSalamon), may choose to provide official binaries on a discretionary basis.
* Any restrictions listed here may be waived by any of the above mentioned primary developers.

View File

@ -1,6 +1,7 @@
TotalFreedomMod # TotalFreedomMod #
===============
TotalFreedomMod is a CraftBukkit mod for the TotalFreedom server. TotalFreedomMod is a CraftBukkit server plugin designed primarily to support the [Official TotalFreedom Minecraft Server](http://totalfreedom.me/). However, you are more than welcome to adapt the source for your own server.
Information about the TotalFreedom server can be found at http://totalfreedom.me/ This plugin was originally coded by StevenLawson (Madgeek1450), with Jerom van der Sar (DarthSalamon) becoming heavily involved in its development some time later. It consists of over 85 custom coded commands and a large variety of distinguishable features not included in any other plugin. The plugin has since its beginning grown immensely. Together, with the main TotalFreedom server, TotalFreedomMod has a long-standing reputation of effectiveness whilst maintaining a clear feeling of openness towards the administrators and the players themselves.
Please see [CONTRIBUTING.md](CONTRIBUTING.md) if you are interested in developing TotalFreedomMod. For information on how TotalFreedomMod is licensed, please see [LICENSE.md](LICENSE.md).

View File

@ -305,76 +305,7 @@ public class TFM_Util
return TFM_Util.mobtypes.get(mobname); return TFM_Util.mobtypes.get(mobname);
} }
public static void zip(File directory, File zipfile, boolean verbose, CommandSender sender) throws IOException
{
URI base = directory.toURI();
Deque<File> queue = new LinkedList<File>();
queue.push(directory);
OutputStream out = new FileOutputStream(zipfile);
Closeable res = out;
try
{
ZipOutputStream zout = new ZipOutputStream(out);
res = zout;
while (!queue.isEmpty())
{
directory = queue.pop();
for (File kid : directory.listFiles())
{
String name = base.relativize(kid.toURI()).getPath();
if (kid.isDirectory())
{
queue.push(kid);
name = name.endsWith("/") ? name : name + "/";
zout.putNextEntry(new ZipEntry(name));
}
else
{
zout.putNextEntry(new ZipEntry(name));
copy(kid, zout);
zout.closeEntry();
}
if (verbose)
{
sender.sendMessage("Zipping: " + name);
}
}
}
}
finally
{
res.close();
}
}
public static void unzip(File zipfile, File directory) throws IOException
{
ZipFile zfile = new ZipFile(zipfile);
Enumeration<? extends ZipEntry> entries = zfile.entries();
while (entries.hasMoreElements())
{
ZipEntry entry = entries.nextElement();
File file = new File(directory, entry.getName());
if (entry.isDirectory())
{
file.mkdirs();
}
else
{
file.getParentFile().mkdirs();
InputStream in = zfile.getInputStream(entry);
try
{
copy(in, file);
}
finally
{
in.close();
}
}
}
}
private static void copy(InputStream in, OutputStream out) throws IOException private static void copy(InputStream in, OutputStream out) throws IOException
{ {