mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-11-12 13:34:52 +01:00
Fix authme hook
This commit is contained in:
parent
b040eafcc1
commit
973ce58461
6
pom.xml
6
pom.xml
@ -147,17 +147,13 @@
|
||||
<dependency>
|
||||
<groupId>fr.xephi</groupId>
|
||||
<artifactId>authme</artifactId>
|
||||
<version>5.0-SNAPSHOT</version>
|
||||
<version>5.2-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
|
@ -213,7 +213,7 @@ public class ChestShop extends JavaPlugin {
|
||||
registerEvent(new ItemInfoListener());
|
||||
registerEvent(new GarbageTextListener());
|
||||
|
||||
if (this.getServer().getPluginManager().getPlugin("AuthMe") != null && this.getServer().getPluginManager().getPlugin("ChestShop").isEnabled()){
|
||||
if (this.getServer().getPluginManager().getPlugin("AuthMe") != null && this.getServer().getPluginManager().getPlugin("AuthMe").isEnabled()){
|
||||
registerEvent(new AuthMeChestShopListener());
|
||||
}
|
||||
|
||||
|
@ -127,6 +127,13 @@ public class Properties {
|
||||
@ConfigurationComment("Do you want ChestShop to respect WorldGuard's chest protection?")
|
||||
public static boolean WORLDGUARD_USE_PROTECTION = false;
|
||||
|
||||
@PrecededBySpace
|
||||
@ConfigurationComment("Do you want to deny shop access to unlogged users?")
|
||||
public static boolean AUTHME_HOOK = true;
|
||||
|
||||
@ConfigurationComment("Do you want to allow shop access to unregistered users? (Example: registration is optional)")
|
||||
public static boolean AUTHME_ALLOW_UNREGISTERED = false;
|
||||
|
||||
@PrecededBySpace
|
||||
@ConfigurationComment("How much Heroes exp should people get for creating a ChestShop?")
|
||||
public static double HEROES_EXP = 100;
|
||||
|
@ -5,6 +5,7 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
import com.Acrobot.ChestShop.Configuration.Properties;
|
||||
import com.Acrobot.ChestShop.Events.PreTransactionEvent;
|
||||
import com.Acrobot.ChestShop.Events.PreTransactionEvent.TransactionOutcome;
|
||||
|
||||
@ -19,13 +20,20 @@ public class AuthMeChestShopListener implements Listener {
|
||||
if (event.getClient() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = event.getClient();
|
||||
|
||||
if (!Properties.AUTHME_HOOK) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (AuthMeAPI.isUnrestricted(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!AuthMeAPI.isRegistered(player.getName()) && Properties.AUTHME_ALLOW_UNREGISTERED) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (AuthMeAPI.isAuthenticated(player)) {
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user