mirror of
https://github.com/MilkBowl/VaultAPI.git
synced 2024-11-15 15:05:14 +01:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
8bad2c479f | ||
|
9520d8847e |
@ -67,8 +67,6 @@ Implementing Vault is quite simple. It requires getting the Economy, Permission,
|
|||||||
```java
|
```java
|
||||||
package com.example.plugin;
|
package com.example.plugin;
|
||||||
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
import net.milkbowl.vault.chat.Chat;
|
import net.milkbowl.vault.chat.Chat;
|
||||||
import net.milkbowl.vault.economy.Economy;
|
import net.milkbowl.vault.economy.Economy;
|
||||||
import net.milkbowl.vault.economy.EconomyResponse;
|
import net.milkbowl.vault.economy.EconomyResponse;
|
||||||
@ -82,20 +80,19 @@ import org.bukkit.plugin.java.JavaPlugin;
|
|||||||
|
|
||||||
public class ExamplePlugin extends JavaPlugin {
|
public class ExamplePlugin extends JavaPlugin {
|
||||||
|
|
||||||
private static final Logger log = Logger.getLogger("Minecraft");
|
|
||||||
private static Economy econ = null;
|
private static Economy econ = null;
|
||||||
private static Permission perms = null;
|
private static Permission perms = null;
|
||||||
private static Chat chat = null;
|
private static Chat chat = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
log.info(String.format("[%s] Disabled Version %s", getDescription().getName(), getDescription().getVersion()));
|
getLogger().info(String.format("[%s] Disabled Version %s", getDescription().getName(), getDescription().getVersion()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
if (!setupEconomy() ) {
|
if (!setupEconomy() ) {
|
||||||
log.severe(String.format("[%s] - Disabled due to no Vault dependency found!", getDescription().getName()));
|
getLogger().severe(String.format("[%s] - Disabled due to no Vault dependency found!", getDescription().getName()));
|
||||||
getServer().getPluginManager().disablePlugin(this);
|
getServer().getPluginManager().disablePlugin(this);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -129,7 +126,7 @@ public class ExamplePlugin extends JavaPlugin {
|
|||||||
|
|
||||||
public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args) {
|
public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args) {
|
||||||
if(!(sender instanceof Player)) {
|
if(!(sender instanceof Player)) {
|
||||||
log.info("Only players are supported for this Example Plugin, but you should not do this!!!");
|
getLogger().info("Only players are supported for this Example Plugin, but you should not do this!!!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,11 +79,6 @@ public class EconomyResponse {
|
|||||||
* @return Value
|
* @return Value
|
||||||
*/
|
*/
|
||||||
public boolean transactionSuccess() {
|
public boolean transactionSuccess() {
|
||||||
switch (type) {
|
return type == ResponseType.SUCCESS;
|
||||||
case SUCCESS:
|
|
||||||
return true;
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user