mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-11-27 12:38:40 +01:00
commit
cfd8cff209
6
pom.xml
6
pom.xml
@ -147,17 +147,13 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>fr.xephi</groupId>
|
<groupId>fr.xephi</groupId>
|
||||||
<artifactId>authme</artifactId>
|
<artifactId>authme</artifactId>
|
||||||
<version>5.0-SNAPSHOT</version>
|
<version>5.2-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
<artifactId>bukkit</artifactId>
|
<artifactId>bukkit</artifactId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
<exclusion>
|
|
||||||
<groupId>org.bukkit</groupId>
|
|
||||||
<artifactId>craftbukkit</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
@ -213,7 +213,7 @@ public class ChestShop extends JavaPlugin {
|
|||||||
registerEvent(new ItemInfoListener());
|
registerEvent(new ItemInfoListener());
|
||||||
registerEvent(new GarbageTextListener());
|
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());
|
registerEvent(new AuthMeChestShopListener());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,6 +127,13 @@ public class Properties {
|
|||||||
@ConfigurationComment("Do you want ChestShop to respect WorldGuard's chest protection?")
|
@ConfigurationComment("Do you want ChestShop to respect WorldGuard's chest protection?")
|
||||||
public static boolean WORLDGUARD_USE_PROTECTION = false;
|
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
|
@PrecededBySpace
|
||||||
@ConfigurationComment("How much Heroes exp should people get for creating a ChestShop?")
|
@ConfigurationComment("How much Heroes exp should people get for creating a ChestShop?")
|
||||||
public static double HEROES_EXP = 100;
|
public static double HEROES_EXP = 100;
|
||||||
|
@ -5,6 +5,7 @@ import org.bukkit.event.EventHandler;
|
|||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
@ -19,13 +20,20 @@ public class AuthMeChestShopListener implements Listener {
|
|||||||
if (event.getClient() == null) {
|
if (event.getClient() == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Player player = event.getClient();
|
Player player = event.getClient();
|
||||||
|
|
||||||
|
if (!Properties.AUTHME_HOOK) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (AuthMeAPI.isUnrestricted(player)) {
|
if (AuthMeAPI.isUnrestricted(player)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!AuthMeAPI.isRegistered(player.getName()) && Properties.AUTHME_ALLOW_UNREGISTERED) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (AuthMeAPI.isAuthenticated(player)) {
|
if (AuthMeAPI.isAuthenticated(player)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user