mirror of
https://github.com/nulli0n/ExcellentEnchants-spigot.git
synced 2024-11-22 11:35:18 +01:00
v4.0.3 beta
This commit is contained in:
parent
79812ec42b
commit
77414a8172
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>ExcellentEnchants</artifactId>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<version>4.0.2</version>
|
||||
<version>4.0.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -32,6 +32,8 @@ public interface EnchantmentData {
|
||||
|
||||
boolean isAvailableToUse(@NotNull World world);
|
||||
|
||||
boolean checkEnchantLimit(@NotNull ItemStack item);
|
||||
|
||||
boolean checkEnchantCategory(@NotNull ItemStack item);
|
||||
|
||||
boolean checkItemCategory(@NotNull ItemStack item);
|
||||
|
14
Core/pom.xml
14
Core/pom.xml
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>ExcellentEnchants</artifactId>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<version>4.0.2</version>
|
||||
<version>4.0.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -73,32 +73,32 @@
|
||||
<dependency>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<artifactId>API</artifactId>
|
||||
<version>4.0.2</version>
|
||||
<version>4.0.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<artifactId>NMS</artifactId>
|
||||
<version>4.0.2</version>
|
||||
<version>4.0.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<artifactId>V1_19_R3</artifactId>
|
||||
<version>4.0.2</version>
|
||||
<version>4.0.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<artifactId>V1_20_R1</artifactId>
|
||||
<version>4.0.2</version>
|
||||
<version>4.0.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<artifactId>V1_20_R2</artifactId>
|
||||
<version>4.0.2</version>
|
||||
<version>4.0.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<artifactId>V1_20_R3</artifactId>
|
||||
<version>4.0.2</version>
|
||||
<version>4.0.3</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -51,6 +51,11 @@ public class Config {
|
||||
"[Default is true]"
|
||||
);
|
||||
|
||||
public static final ConfigValue<Integer> CORE_ITEM_ENCHANT_LIMIT = ConfigValue.create("Core.Item_Enchantments_Limit",
|
||||
3,
|
||||
"Sets max. amount of custom enchantments per item.",
|
||||
"[Default is 3]");
|
||||
|
||||
public static final ConfigValue<Boolean> CORE_SWORD_ENCHANTS_TO_AXES = ConfigValue.create("Core.Sword_Enchants_To_Axes",
|
||||
true,
|
||||
"Sets whether or not Sword enchantments can be applied on Axes.",
|
||||
|
@ -343,6 +343,14 @@ public abstract class AbstractEnchantmentData extends AbstractFileData<EnchantsP
|
||||
return this.isAvailableToUse(entity.getWorld());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEnchantLimit(@NotNull ItemStack item) {
|
||||
int limit = Config.CORE_ITEM_ENCHANT_LIMIT.get();
|
||||
int has = EnchantUtils.countCustomEnchantments(item);
|
||||
|
||||
return has < limit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean checkEnchantCategory(@NotNull ItemStack item) {
|
||||
EnchantmentTarget category = this.getCategory();
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>ExcellentEnchants</artifactId>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<version>4.0.2</version>
|
||||
<version>4.0.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
<dependency>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<artifactId>API</artifactId>
|
||||
<version>4.0.2</version>
|
||||
<version>4.0.3</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>ExcellentEnchants</artifactId>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<version>4.0.2</version>
|
||||
<version>4.0.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
<dependency>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<artifactId>NMS</artifactId>
|
||||
<version>4.0.2</version>
|
||||
<version>4.0.3</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -73,6 +73,8 @@ public class CustomEnchantment extends Enchantment {
|
||||
}
|
||||
|
||||
public boolean canEnchant(@NotNull org.bukkit.inventory.ItemStack bukkitItem) {
|
||||
if (!this.enchantmentData.checkEnchantLimit(bukkitItem)) return false;
|
||||
|
||||
if (!this.enchantmentData.hasItemCategory()) {
|
||||
if (this.enchantmentData.checkEnchantCategory(bukkitItem)) return true;
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>ExcellentEnchants</artifactId>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<version>4.0.2</version>
|
||||
<version>4.0.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
<dependency>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<artifactId>NMS</artifactId>
|
||||
<version>4.0.2</version>
|
||||
<version>4.0.3</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -73,6 +73,8 @@ public class CustomEnchantment extends Enchantment {
|
||||
}
|
||||
|
||||
public boolean canEnchant(@NotNull org.bukkit.inventory.ItemStack bukkitItem) {
|
||||
if (!this.enchantmentData.checkEnchantLimit(bukkitItem)) return false;
|
||||
|
||||
if (!this.enchantmentData.hasItemCategory()) {
|
||||
if (this.enchantmentData.checkEnchantCategory(bukkitItem)) return true;
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>ExcellentEnchants</artifactId>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<version>4.0.2</version>
|
||||
<version>4.0.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
<dependency>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<artifactId>NMS</artifactId>
|
||||
<version>4.0.2</version>
|
||||
<version>4.0.3</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -73,6 +73,8 @@ public class CustomEnchantment extends Enchantment {
|
||||
}
|
||||
|
||||
public boolean canEnchant(@NotNull org.bukkit.inventory.ItemStack bukkitItem) {
|
||||
if (!this.enchantmentData.checkEnchantLimit(bukkitItem)) return false;
|
||||
|
||||
if (!this.enchantmentData.hasItemCategory()) {
|
||||
if (this.enchantmentData.checkEnchantCategory(bukkitItem)) return true;
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>ExcellentEnchants</artifactId>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<version>4.0.2</version>
|
||||
<version>4.0.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -27,12 +27,12 @@
|
||||
<dependency>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<artifactId>API</artifactId>
|
||||
<version>4.0.2</version>
|
||||
<version>4.0.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<artifactId>NMS</artifactId>
|
||||
<version>4.0.2</version>
|
||||
<version>4.0.3</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -73,6 +73,8 @@ public class CustomEnchantment extends Enchantment {
|
||||
}
|
||||
|
||||
public boolean canEnchant(@NotNull org.bukkit.inventory.ItemStack bukkitItem) {
|
||||
if (!this.enchantmentData.checkEnchantLimit(bukkitItem)) return false;
|
||||
|
||||
if (!this.enchantmentData.hasItemCategory()) {
|
||||
if (this.enchantmentData.checkEnchantCategory(bukkitItem)) return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user