Update to new AuthMeReloaded API (Fixes BUKKIT-1318)

(cherry picked from commit 2243c2fbc6)
This commit is contained in:
Phoenix616 2018-10-15 20:27:17 +01:00
parent b30688b635
commit eb6a45c317
2 changed files with 7 additions and 8 deletions

View File

@ -35,7 +35,7 @@
</repository> </repository>
<repository> <repository>
<id>authme-repo</id> <id>authme-repo</id>
<url>http://ci.xephi.fr/plugin/repository/everything/</url> <url>https://repo.codemc.org/repository/maven-public/</url>
</repository> </repository>
<repository> <repository>
<id>minebench-repo</id> <id>minebench-repo</id>
@ -156,7 +156,7 @@
<dependency> <dependency>
<groupId>fr.xephi</groupId> <groupId>fr.xephi</groupId>
<artifactId>authme</artifactId> <artifactId>authme</artifactId>
<version>5.2-SNAPSHOT</version> <version>5.5.0-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
<exclusions> <exclusions>
<exclusion> <exclusion>

View File

@ -1,5 +1,6 @@
package com.Acrobot.ChestShop.Listeners; package com.Acrobot.ChestShop.Listeners;
import fr.xephi.authme.api.v3.AuthMeApi;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
@ -9,11 +10,9 @@ import com.Acrobot.ChestShop.Configuration.Properties;
import com.Acrobot.ChestShop.Events.PreTransactionEvent; import com.Acrobot.ChestShop.Events.PreTransactionEvent;
import com.Acrobot.ChestShop.Events.PreTransactionEvent.TransactionOutcome; import com.Acrobot.ChestShop.Events.PreTransactionEvent.TransactionOutcome;
import fr.xephi.authme.api.NewAPI;
public class AuthMeChestShopListener implements Listener { public class AuthMeChestShopListener implements Listener {
NewAPI AuthMeAPI = NewAPI.getInstance(); private AuthMeApi authmeApi = AuthMeApi.getInstance();
@EventHandler(ignoreCancelled = true, priority = EventPriority.LOWEST) @EventHandler(ignoreCancelled = true, priority = EventPriority.LOWEST)
public void onPreTransaction(PreTransactionEvent event) { public void onPreTransaction(PreTransactionEvent event) {
@ -26,15 +25,15 @@ public class AuthMeChestShopListener implements Listener {
return; return;
} }
if (AuthMeAPI.isUnrestricted(player)) { if (authmeApi.isUnrestricted(player)) {
return; return;
} }
if (!AuthMeAPI.isRegistered(player.getName()) && Properties.AUTHME_ALLOW_UNREGISTERED) { if (!authmeApi.isRegistered(player.getName()) && Properties.AUTHME_ALLOW_UNREGISTERED) {
return; return;
} }
if (AuthMeAPI.isAuthenticated(player)) { if (authmeApi.isAuthenticated(player)) {
return; return;
} }