-
Notifications
You must be signed in to change notification settings - Fork 126
Small formatting fixes (no code changes) #139
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
Closed
Closed
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
52b8f72
spelling/grammar/spacing fixes
Jack1424 fc76142
enhanced do-publish.sh
Jack1424 163e4df
fixed indents and updated some links
Jack1424 0a0454f
fixed indents and spacing
Jack1424 29ef487
remove the "-" before the build status and bold the inclusion example…
Jack1424 7069a17
separate the repositories and dependencies
Jack1424 a0542b8
added missing newlines
Jack1424 d754cb5
fixed grammar/spelling mistakes and formatting inconsistencies (comme…
Jack1424 0099eed
fix spacing mistake
Jack1424 a46a8ef
added some more missing spaces
Jack1424 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| #!/bin/bash | ||
| current_dir=`pwd` | ||
| current_dir=$(pwd) | ||
|
|
||
| if [[ "$TRAVIS_REPO_SLUG" != "MilkBowl/VaultAPI" || "$TRAVIS_PULL_REQUEST" == "true" || "$TRAVIS_BRANCH" != "master" ]] | ||
| then | ||
|
|
@@ -10,15 +10,15 @@ fi | |
| mvn clean javadoc:javadoc javadoc:jar deploy --settings .utility/settings.xml | ||
|
|
||
| # Get to the Travis build directory, configure git and clone the repo | ||
| cd $HOME | ||
| cd "$HOME" | ||
| git config --global user.email "[email protected]" | ||
| git config --global user.name "travis-ci" | ||
| git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/MilkBowl/VaultAPI gh-pages > /dev/null | ||
| git clone --quiet --branch=gh-pages https://"${GH_TOKEN}"@github.com/MilkBowl/VaultAPI gh-pages > /dev/null | ||
|
|
||
| # Commit and Push the Changes | ||
| cd gh-pages | ||
| git rm -rf * | ||
| cp -Rfv $current_dir/target/javadoc-latest/* ./ | ||
| git rm -rf ./* | ||
| cp -Rfv "$current_dir"/target/javadoc-latest/* ./ | ||
| git add -f . | ||
| git commit -m "Latest javadoc on successful travis build $TRAVIS_BUILD_NUMBER auto-pushed to gh-pages" | ||
| git push -fq origin gh-pages > /dev/null | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,4 +6,4 @@ | |
| <password>${env.DEPLOY_PASS}</password> | ||
| </server> | ||
| </servers> | ||
| </settings> | ||
| </settings> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,15 @@ | ||
| # VaultAPI - Abstraction Library API for Bukkit Plugins - [](https://travis-ci.org/MilkBowl/VaultAPI) | ||
| # VaultAPI - Abstraction Library API for Bukkit Plugins [](https://travis-ci.org/MilkBowl/VaultAPI) | ||
|
|
||
| How to include the API with Maven: | ||
| **How to include the API with Maven:** | ||
| ```xml | ||
| <repositories> | ||
| <repository> | ||
| <id>jitpack.io</id> | ||
| <url>https://jitpack.io</url> | ||
| </repository> | ||
| </repositories> | ||
| ``` | ||
| ```xml | ||
| <dependencies> | ||
| <dependency> | ||
| <groupId>com.github.MilkBowl</groupId> | ||
|
|
@@ -18,29 +20,31 @@ How to include the API with Maven: | |
| </dependencies> | ||
| ``` | ||
|
|
||
| How to include the API with Gradle: | ||
| **How to include the API with Gradle:** | ||
| ```groovy | ||
| repositories { | ||
| maven { url 'https://jitpack.io' } | ||
| } | ||
| ``` | ||
| ```groovy | ||
| dependencies { | ||
| compileOnly "com.github.MilkBowl:VaultAPI:1.7" | ||
| } | ||
| ``` | ||
|
|
||
| **Note**: The VaultAPI version has 2 numbers (major.minor), unlike Vault, which has 3. The 2 numbers in the VaultAPI will always correspond to the 2 beginning numbers in a Vault version to make it clear what versions your plugin will for sure work with. | ||
| **Note**: The VaultAPI version has 2 numbers (major.minor), unlike Vault, which has 3. The 2 numbers in the VaultAPI will always correspond to the 2 beginning numbers in a Vault version to make it clear what versions your plugin will work with. | ||
|
|
||
| ## Why Vault? | ||
| I have no preference which library suits your plugin and development efforts | ||
| best. Really, I thought a central suite (rather...Vault) of solutions was the | ||
| the proper avenue than focusing on a single category of plugin. That's where | ||
| best. Really, I thought a central suite (rather...Vault) of solutions was the | ||
| proper avenue than focusing on a single category of plugin. That's where | ||
| the idea for Vault came into play. | ||
|
|
||
| So, what features do I _think_ you'll like the most? | ||
|
|
||
| * No need to include my source code in your plugin | ||
| * Broad range of supported plugins | ||
| * Choice! | ||
| * No need to include my source code in your plugin | ||
| * Broad range of supported plugins | ||
| * Choice! | ||
|
|
||
| ## License | ||
| Copyright (C) 2011-2018 Morgan Humes <[email protected]> | ||
|
|
@@ -52,11 +56,11 @@ the Free Software Foundation, either version 3 of the License, or | |
|
|
||
| Vault is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU Lesser General Public License for more details. | ||
|
|
||
| You should have received a copy of the GNU Lesser General Public License | ||
| along with Vault. If not, see <http://www.gnu.org/licenses/>. | ||
| with Vault. If not, see <https://www.gnu.org/licenses/>. | ||
|
|
||
| ## Building | ||
| VaultAPI comes with all libraries needed to build from the current branch. | ||
|
|
@@ -81,93 +85,93 @@ import org.bukkit.plugin.RegisteredServiceProvider; | |
| import org.bukkit.plugin.java.JavaPlugin; | ||
|
|
||
| public class ExamplePlugin extends JavaPlugin { | ||
| private static final Logger log = Logger.getLogger("Minecraft"); | ||
| private static Economy econ = null; | ||
| private static Permission perms = null; | ||
| private static Chat chat = null; | ||
|
|
||
| @Override | ||
| public void onDisable() { | ||
| log.info(String.format("[%s] Disabled Version %s", getDescription().getName(), getDescription().getVersion())); | ||
| } | ||
|
|
||
| @Override | ||
| public void onEnable() { | ||
| if (!setupEconomy() ) { | ||
| log.severe(String.format("[%s] - Disabled due to no Vault dependency found!", getDescription().getName())); | ||
| getServer().getPluginManager().disablePlugin(this); | ||
| return; | ||
| } | ||
| setupPermissions(); | ||
| setupChat(); | ||
| } | ||
| private boolean setupEconomy() { | ||
| if (getServer().getPluginManager().getPlugin("Vault") == null) { | ||
| return false; | ||
| } | ||
| RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class); | ||
| if (rsp == null) { | ||
| return false; | ||
| } | ||
| econ = rsp.getProvider(); | ||
| return econ != null; | ||
| } | ||
| private boolean setupChat() { | ||
| RegisteredServiceProvider<Chat> rsp = getServer().getServicesManager().getRegistration(Chat.class); | ||
| chat = rsp.getProvider(); | ||
| return chat != null; | ||
| } | ||
| private boolean setupPermissions() { | ||
| RegisteredServiceProvider<Permission> rsp = getServer().getServicesManager().getRegistration(Permission.class); | ||
| perms = rsp.getProvider(); | ||
| return perms != null; | ||
| } | ||
| public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args) { | ||
| if(!(sender instanceof Player)) { | ||
| log.info("Only players are supported for this Example Plugin, but you should not do this!!!"); | ||
| return true; | ||
| } | ||
| Player player = (Player) sender; | ||
| if(command.getLabel().equals("test-economy")) { | ||
| // Lets give the player 1.05 currency (note that SOME economic plugins require rounding!) | ||
| sender.sendMessage(String.format("You have %s", econ.format(econ.getBalance(player.getName())))); | ||
| EconomyResponse r = econ.depositPlayer(player, 1.05); | ||
| if(r.transactionSuccess()) { | ||
| sender.sendMessage(String.format("You were given %s and now have %s", econ.format(r.amount), econ.format(r.balance))); | ||
| } else { | ||
| sender.sendMessage(String.format("An error occured: %s", r.errorMessage)); | ||
| } | ||
| return true; | ||
| } else if(command.getLabel().equals("test-permission")) { | ||
| // Lets test if user has the node "example.plugin.awesome" to determine if they are awesome or just suck | ||
| if(perms.has(player, "example.plugin.awesome")) { | ||
| sender.sendMessage("You are awesome!"); | ||
| } else { | ||
| sender.sendMessage("You suck!"); | ||
| } | ||
| return true; | ||
| } else { | ||
| return false; | ||
| } | ||
| } | ||
| public static Economy getEconomy() { | ||
| return econ; | ||
| } | ||
| public static Permission getPermissions() { | ||
| return perms; | ||
| } | ||
| public static Chat getChat() { | ||
| return chat; | ||
| } | ||
|
|
||
| private static final Logger log = Logger.getLogger("Minecraft"); | ||
| private static Economy econ = null; | ||
| private static Permission perms = null; | ||
| private static Chat chat = null; | ||
|
|
||
| @Override | ||
| public void onDisable() { | ||
| log.info(String.format("[%s] Disabled Version %s", getDescription().getName(), getDescription().getVersion())); | ||
| } | ||
|
|
||
| @Override | ||
| public void onEnable() { | ||
| if (!setupEconomy()) { | ||
| log.severe(String.format("[%s] - Disabled due to no Vault dependency found!", getDescription().getName())); | ||
| getServer().getPluginManager().disablePlugin(this); | ||
| return; | ||
| } | ||
| setupPermissions(); | ||
| setupChat(); | ||
| } | ||
|
|
||
| private boolean setupEconomy() { | ||
| if (getServer().getPluginManager().getPlugin("Vault") == null) { | ||
| return false; | ||
| } | ||
| RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class); | ||
| if (rsp == null) { | ||
| return false; | ||
| } | ||
| econ = rsp.getProvider(); | ||
| return econ != null; | ||
| } | ||
|
|
||
| private boolean setupChat() { | ||
| RegisteredServiceProvider<Chat> rsp = getServer().getServicesManager().getRegistration(Chat.class); | ||
| chat = rsp.getProvider(); | ||
| return chat != null; | ||
| } | ||
|
|
||
| private boolean setupPermissions() { | ||
| RegisteredServiceProvider<Permission> rsp = getServer().getServicesManager().getRegistration(Permission.class); | ||
| perms = rsp.getProvider(); | ||
| return perms != null; | ||
| } | ||
|
|
||
| public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args) { | ||
| if (!(sender instanceof Player)) { | ||
| log.info("Only players are supported for this Example Plugin, but you should not do this!!!"); | ||
| return true; | ||
| } | ||
|
|
||
| Player player = (Player) sender; | ||
|
|
||
| if (command.getLabel().equals("test-economy")) { | ||
| // Let's give the player 1.05 currency (note that SOME economic plugins require rounding!) | ||
| sender.sendMessage(String.format("You have %s", econ.format(econ.getBalance(player.getName())))); | ||
| EconomyResponse r = econ.depositPlayer(player, 1.05); | ||
| if (r.transactionSuccess()) { | ||
| sender.sendMessage(String.format("You were given %s and now have %s", econ.format(r.amount), econ.format(r.balance))); | ||
| } else { | ||
| sender.sendMessage(String.format("An error occurred: %s", r.errorMessage)); | ||
| } | ||
| return true; | ||
| } else if (command.getLabel().equals("test-permission")) { | ||
| // Let's test if user has the node "example.plugin.awesome" to determine if they are awesome or just suck | ||
| if (perms.has(player, "example.plugin.awesome")) { | ||
| sender.sendMessage("You are awesome!"); | ||
| } else { | ||
| sender.sendMessage("You suck!"); | ||
| } | ||
| return true; | ||
| } else { | ||
| return false; | ||
| } | ||
| } | ||
|
|
||
| public static Economy getEconomy() { | ||
| return econ; | ||
| } | ||
|
|
||
| public static Permission getPermissions() { | ||
| return perms; | ||
| } | ||
|
|
||
| public static Chat getChat() { | ||
| return chat; | ||
| } | ||
| } | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.