Add a permission to allow players to bypass the tame limit.
This commit is contained in:
parent
de30d65fba
commit
91a8a54624
2
pom.xml
2
pom.xml
|
@ -6,7 +6,7 @@
|
|||
|
||||
<groupId>net.seanomik</groupId>
|
||||
<artifactId>tamablefoxes</artifactId>
|
||||
<version>1.7.7-SNAPSHOT</version>
|
||||
<version>1.7.8-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>Tamablefoxes</name>
|
||||
|
|
|
@ -15,9 +15,8 @@ import org.bukkit.plugin.java.JavaPlugin;
|
|||
|
||||
// @TODO:
|
||||
|
||||
/* @CHANGELOG (1.7.7-SNAPSHOT):
|
||||
* Make foxes sleep on the bed with players, similar to what cats do.
|
||||
* Add a configurable option to set the maximum about of foxes a player can tame.
|
||||
/* @CHANGELOG (1.7.8-SNAPSHOT):
|
||||
* Add a permission to allow players to bypass the tame limit.
|
||||
*/
|
||||
public final class TamableFoxes extends JavaPlugin implements Listener {
|
||||
private static TamableFoxes plugin;
|
||||
|
|
|
@ -315,7 +315,7 @@ public class EntityTamableFox extends EntityFox {
|
|||
|
||||
SQLiteHelper sqLiteHelper = SQLiteHelper.getInstance();
|
||||
int maxTameCount = Config.getMaxPlayerFoxTames();
|
||||
if (maxTameCount > 0 && sqLiteHelper.getPlayerFoxAmount(entityhuman.getUniqueID()) >= maxTameCount) {
|
||||
if ( !((Player) entityhuman.getBukkitEntity()).hasPermission("tamablefoxes.tame.unlimited") && maxTameCount > 0 && sqLiteHelper.getPlayerFoxAmount(entityhuman.getUniqueID()) >= maxTameCount) {
|
||||
((Player) entityhuman.getBukkitEntity()).sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getFoxDoesntTrust());
|
||||
|
||||
return true;
|
||||
|
|
|
@ -314,7 +314,7 @@ public class EntityTamableFox extends EntityFox {
|
|||
|
||||
SQLiteHelper sqLiteHelper = SQLiteHelper.getInstance();
|
||||
int maxTameCount = Config.getMaxPlayerFoxTames();
|
||||
if (maxTameCount > 0 && sqLiteHelper.getPlayerFoxAmount(entityhuman.getUniqueID()) >= maxTameCount) {
|
||||
if ( !((Player) entityhuman.getBukkitEntity()).hasPermission("tamablefoxes.tame.unlimited") && maxTameCount > 0 && sqLiteHelper.getPlayerFoxAmount(entityhuman.getUniqueID()) >= maxTameCount) {
|
||||
((Player) entityhuman.getBukkitEntity()).sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getFoxDoesntTrust());
|
||||
|
||||
return true;
|
||||
|
|
|
@ -317,7 +317,7 @@ public class EntityTamableFox extends EntityFox {
|
|||
|
||||
SQLiteHelper sqLiteHelper = SQLiteHelper.getInstance();
|
||||
int maxTameCount = Config.getMaxPlayerFoxTames();
|
||||
if (maxTameCount > 0 && sqLiteHelper.getPlayerFoxAmount(entityhuman.getUniqueID()) >= maxTameCount) {
|
||||
if ( !((Player) entityhuman.getBukkitEntity()).hasPermission("tamablefoxes.tame.unlimited") && maxTameCount > 0 && sqLiteHelper.getPlayerFoxAmount(entityhuman.getUniqueID()) >= maxTameCount) {
|
||||
((Player) entityhuman.getBukkitEntity()).sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getFoxDoesntTrust());
|
||||
|
||||
return EnumInteractionResult.SUCCESS;
|
||||
|
|
|
@ -314,7 +314,7 @@ public class EntityTamableFox extends EntityFox {
|
|||
|
||||
SQLiteHelper sqLiteHelper = SQLiteHelper.getInstance();
|
||||
int maxTameCount = Config.getMaxPlayerFoxTames();
|
||||
if (maxTameCount > 0 && sqLiteHelper.getPlayerFoxAmount(entityhuman.getUniqueID()) >= maxTameCount) {
|
||||
if ( !((Player) entityhuman.getBukkitEntity()).hasPermission("tamablefoxes.tame.unlimited") && maxTameCount > 0 && sqLiteHelper.getPlayerFoxAmount(entityhuman.getUniqueID()) >= maxTameCount) {
|
||||
((Player) entityhuman.getBukkitEntity()).sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getFoxDoesntTrust());
|
||||
|
||||
return EnumInteractionResult.SUCCESS;
|
||||
|
|
|
@ -17,3 +17,6 @@ permissions:
|
|||
tamablefoxes.tame:
|
||||
description: "Gives the player the ability to tame a fox."
|
||||
default: true
|
||||
tamablefoxes.tame.unlimited:
|
||||
description: "Lets players bypass the tame limit."
|
||||
default: op
|
||||
|
|
Loading…
Reference in New Issue