From b86bdf5f238e18de613cd345c943cc7dcf69ce8c Mon Sep 17 00:00:00 2001 From: games647 Date: Sun, 27 Mar 2016 11:18:46 +0200 Subject: [PATCH] Added check if player is already premium + Updated FakePlayer against the newest API changes --- CHANGELOG.md | 1 + README.md | 7 ++++--- .../bukkit/commands/PremiumCommand.java | 9 +++++++-- .../fastlogin/bukkit/hooks/UltraAuthHook.java | 20 +++++++++++++++++++ bukkit/src/main/resources/config.yml | 4 +--- 5 files changed, 33 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36450aef..f8feca3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ######0.7 +* Added a check if the player is already on the premium list * Added a forwardSkin config option * Added premium UUID support * Removes the need of an Bukkit auth plugin if you use a bungeecord one diff --git a/README.md b/README.md index 2be78654..b217291a 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ So they don't need to enter passwords. This is also called auto login (auto-logi * Cauldron support * Forge/Sponge message support * Premium UUID support +* Forwards Skins * BungeeCord support * Auto register new premium players * Plugin: ProtocolSupport is supported and can be used as an alternative to ProtocolLib @@ -37,7 +38,7 @@ So they don't need to enter passwords. This is also called auto login (auto-logi * Run Spigot and/or BungeeCord in offline mode (see server.properties or config.yml) * An auth plugin. Supported Plugins -#### Bukkit +####Bukkit * [AuthMe](http://dev.bukkit.org/bukkit-plugins/authme-reloaded/) * [xAuth](http://dev.bukkit.org/bukkit-plugins/xauth/) @@ -46,7 +47,7 @@ So they don't need to enter passwords. This is also called auto login (auto-logi * [RoyalAuth](http://dev.bukkit.org/bukkit-plugins/royalauth/) * [UltraAuth](http://dev.bukkit.org/bukkit-plugins/ultraauth-aa/) -#### BungeeCord +####BungeeCord * [BungeeAuth](https://www.spigotmc.org/resources/bungeeauth.493/) @@ -140,7 +141,7 @@ into the whitelist file of your Bukkit/Spigot server. For security reasons, don' This plugin will automatically detect if BungeeCord is running and handle premium checks on BungeeCord. ####Could premium players have a premium UUID and Skin? -Something like that is possible, but is not yet implemented. +Since 0.7 both features are implemented. You can check the config.yml in order to activate it. ####Is this plugin compatible with Cauldron? It's not tested yet, but all needed methods also exists in Cauldron so it could work together. diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/commands/PremiumCommand.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/commands/PremiumCommand.java index 322d7fec..b2476000 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/commands/PremiumCommand.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/commands/PremiumCommand.java @@ -33,8 +33,13 @@ public class PremiumCommand implements CommandExecutor { } String playerName = sender.getName(); - plugin.getEnabledPremium().add(playerName); - sender.sendMessage(ChatColor.DARK_GREEN + "Added to the list of premium players"); + boolean exist = plugin.getEnabledPremium().add(playerName); + if (exist) { + sender.sendMessage(ChatColor.DARK_RED + "You are already on the premium list"); + } else { + sender.sendMessage(ChatColor.DARK_GREEN + "Added to the list of premium players"); + } + notifiyBungeeCord((Player) sender); return true; } else { diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/UltraAuthHook.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/UltraAuthHook.java index 2ff0d8e6..46692425 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/UltraAuthHook.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/UltraAuthHook.java @@ -1428,5 +1428,25 @@ public class UltraAuthHook implements BukkitAuthPlugin { public void setGliding(boolean arg0) { throw new UnsupportedOperationException("Not supported yet."); } + + @Override + public void setAI(boolean arg0) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean hasAI() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setInvulnerable(boolean arg0) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isInvulnerable() { + throw new UnsupportedOperationException("Not supported yet."); + } } } diff --git a/bukkit/src/main/resources/config.yml b/bukkit/src/main/resources/config.yml index a0772908..ec8c98be 100644 --- a/bukkit/src/main/resources/config.yml +++ b/bukkit/src/main/resources/config.yml @@ -22,9 +22,7 @@ autoRegister: false # If this plugin detected that a player has a premium, it can also set the associated -# uuid from that account. -# -# So if the players changes their usernames, they will still have +# uuid from that account. So if the players changes their usernames, they will still have # the same playerdata (inventory, permissions, ...) # # Warning: This also means that the UUID will be different if the player is connecting