From eb6a45c3170916827cec524fac3cf9675e8cf32f Mon Sep 17 00:00:00 2001 From: Phoenix616 Date: Mon, 15 Oct 2018 20:27:17 +0100 Subject: [PATCH] Update to new AuthMeReloaded API (Fixes BUKKIT-1318) (cherry picked from commit 2243c2fbc6fe9f6cf098229dbfeadda2585fbad4) --- pom.xml | 4 ++-- .../ChestShop/Listeners/AuthMeChestShopListener.java | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index 94e516d..d869fb6 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ authme-repo - http://ci.xephi.fr/plugin/repository/everything/ + https://repo.codemc.org/repository/maven-public/ minebench-repo @@ -156,7 +156,7 @@ fr.xephi authme - 5.2-SNAPSHOT + 5.5.0-SNAPSHOT provided diff --git a/src/main/java/com/Acrobot/ChestShop/Listeners/AuthMeChestShopListener.java b/src/main/java/com/Acrobot/ChestShop/Listeners/AuthMeChestShopListener.java index 0bab71c..f2a869c 100644 --- a/src/main/java/com/Acrobot/ChestShop/Listeners/AuthMeChestShopListener.java +++ b/src/main/java/com/Acrobot/ChestShop/Listeners/AuthMeChestShopListener.java @@ -1,5 +1,6 @@ package com.Acrobot.ChestShop.Listeners; +import fr.xephi.authme.api.v3.AuthMeApi; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; 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.TransactionOutcome; -import fr.xephi.authme.api.NewAPI; - public class AuthMeChestShopListener implements Listener { - NewAPI AuthMeAPI = NewAPI.getInstance(); + private AuthMeApi authmeApi = AuthMeApi.getInstance(); @EventHandler(ignoreCancelled = true, priority = EventPriority.LOWEST) public void onPreTransaction(PreTransactionEvent event) { @@ -26,15 +25,15 @@ public class AuthMeChestShopListener implements Listener { return; } - if (AuthMeAPI.isUnrestricted(player)) { + if (authmeApi.isUnrestricted(player)) { return; } - if (!AuthMeAPI.isRegistered(player.getName()) && Properties.AUTHME_ALLOW_UNREGISTERED) { + if (!authmeApi.isRegistered(player.getName()) && Properties.AUTHME_ALLOW_UNREGISTERED) { return; } - if (AuthMeAPI.isAuthenticated(player)) { + if (authmeApi.isAuthenticated(player)) { return; }