Added missing charges check
This commit is contained in:
parent
4a05fc50bd
commit
a8750a17e4
12
Core/pom.xml
12
Core/pom.xml
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>ExcellentEnchants</artifactId>
|
<artifactId>ExcellentEnchants</artifactId>
|
||||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||||
<version>3.5.3</version>
|
<version>3.5.4</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
@ -81,27 +81,27 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||||
<artifactId>NMS</artifactId>
|
<artifactId>NMS</artifactId>
|
||||||
<version>3.5.3</version>
|
<version>3.5.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||||
<artifactId>V1_17_R1</artifactId>
|
<artifactId>V1_17_R1</artifactId>
|
||||||
<version>3.5.3</version>
|
<version>3.5.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||||
<artifactId>V1_18_R2</artifactId>
|
<artifactId>V1_18_R2</artifactId>
|
||||||
<version>3.5.3</version>
|
<version>3.5.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||||
<artifactId>V1_19_R3</artifactId>
|
<artifactId>V1_19_R3</artifactId>
|
||||||
<version>3.5.3</version>
|
<version>3.5.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||||
<artifactId>V1_20_R1</artifactId>
|
<artifactId>V1_20_R1</artifactId>
|
||||||
<version>3.5.3</version>
|
<version>3.5.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
@ -358,11 +358,15 @@ public abstract class ExcellentEnchant extends Enchantment implements IEnchantme
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void consumeChargesNoUpdate(@NotNull ItemStack item, int level) {
|
public void consumeChargesNoUpdate(@NotNull ItemStack item, int level) {
|
||||||
|
if (!this.isChargesEnabled()) return;
|
||||||
|
|
||||||
EnchantUtils.consumeCharges(item, this, level);
|
EnchantUtils.consumeCharges(item, this, level);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void consumeCharges(@NotNull ItemStack item, int level) {
|
public void consumeCharges(@NotNull ItemStack item, int level) {
|
||||||
|
if (!this.isChargesEnabled()) return;
|
||||||
|
|
||||||
this.consumeChargesNoUpdate(item, level);
|
this.consumeChargesNoUpdate(item, level);
|
||||||
EnchantUtils.updateDisplay(item);
|
EnchantUtils.updateDisplay(item);
|
||||||
}
|
}
|
||||||
|
@ -282,9 +282,6 @@ public class EnchantUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void consumeCharges(@NotNull ItemStack item, @NotNull ExcellentEnchant enchant, int level) {
|
public static void consumeCharges(@NotNull ItemStack item, @NotNull ExcellentEnchant enchant, int level) {
|
||||||
if (!enchant.isChargesEnabled()) return;
|
|
||||||
|
|
||||||
//int level = getLevel(item, enchant);
|
|
||||||
int has = getCharges(item, enchant);
|
int has = getCharges(item, enchant);
|
||||||
int use = enchant.getChargesConsumeAmount(level);
|
int use = enchant.getChargesConsumeAmount(level);
|
||||||
setCharges(item, enchant, level,has - use);
|
setCharges(item, enchant, level,has - use);
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>ExcellentEnchants</artifactId>
|
<artifactId>ExcellentEnchants</artifactId>
|
||||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||||
<version>3.5.3</version>
|
<version>3.5.4</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>ExcellentEnchants</artifactId>
|
<artifactId>ExcellentEnchants</artifactId>
|
||||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||||
<version>3.5.3</version>
|
<version>3.5.4</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
@ -26,7 +26,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||||
<artifactId>NMS</artifactId>
|
<artifactId>NMS</artifactId>
|
||||||
<version>3.5.3</version>
|
<version>3.5.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>ExcellentEnchants</artifactId>
|
<artifactId>ExcellentEnchants</artifactId>
|
||||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||||
<version>3.5.3</version>
|
<version>3.5.4</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
@ -26,7 +26,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||||
<artifactId>NMS</artifactId>
|
<artifactId>NMS</artifactId>
|
||||||
<version>3.5.3</version>
|
<version>3.5.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>ExcellentEnchants</artifactId>
|
<artifactId>ExcellentEnchants</artifactId>
|
||||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||||
<version>3.5.3</version>
|
<version>3.5.4</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
@ -26,7 +26,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||||
<artifactId>NMS</artifactId>
|
<artifactId>NMS</artifactId>
|
||||||
<version>3.5.3</version>
|
<version>3.5.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>ExcellentEnchants</artifactId>
|
<artifactId>ExcellentEnchants</artifactId>
|
||||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||||
<version>3.5.3</version>
|
<version>3.5.4</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
@ -26,7 +26,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||||
<artifactId>NMS</artifactId>
|
<artifactId>NMS</artifactId>
|
||||||
<version>3.5.3</version>
|
<version>3.5.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
2
pom.xml
2
pom.xml
@ -7,7 +7,7 @@
|
|||||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||||
<artifactId>ExcellentEnchants</artifactId>
|
<artifactId>ExcellentEnchants</artifactId>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<version>3.5.3</version>
|
<version>3.5.4</version>
|
||||||
<modules>
|
<modules>
|
||||||
<module>Core</module>
|
<module>Core</module>
|
||||||
<module>NMS</module>
|
<module>NMS</module>
|
||||||
|
Loading…
Reference in New Issue
Block a user