mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2025-01-25 00:51:20 +01:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
8e1b5a022e
@ -18,7 +18,7 @@ public class EcoCraftEnchantment extends CraftEnchantment {
|
||||
|
||||
@Override
|
||||
public int getMaxLevel() {
|
||||
return metadata.getMaxLevel() == null ? this.getHandle().getMaxLevel() : metadata.getMaxLevel();
|
||||
return metadata.maxLevel() == null ? this.getHandle().getMaxLevel() : metadata.maxLevel();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,7 +18,7 @@ public class EcoCraftEnchantment extends CraftEnchantment {
|
||||
|
||||
@Override
|
||||
public int getMaxLevel() {
|
||||
return metadata.getMaxLevel() == null ? this.getHandle().getMaxLevel() : metadata.getMaxLevel();
|
||||
return metadata.maxLevel() == null ? this.getHandle().getMaxLevel() : metadata.maxLevel();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,7 +18,7 @@ public class EcoCraftEnchantment extends CraftEnchantment {
|
||||
|
||||
@Override
|
||||
public int getMaxLevel() {
|
||||
return metadata.getMaxLevel() == null ? this.getHandle().getMaxLevel() : metadata.getMaxLevel();
|
||||
return metadata.maxLevel() == null ? this.getHandle().getMaxLevel() : metadata.maxLevel();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,7 +18,7 @@ public class EcoCraftEnchantment extends CraftEnchantment {
|
||||
|
||||
@Override
|
||||
public int getMaxLevel() {
|
||||
return metadata.getMaxLevel() == null ? this.getHandle().getMaxLevel() : metadata.getMaxLevel();
|
||||
return metadata.maxLevel() == null ? this.getHandle().getMaxLevel() : metadata.maxLevel();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -28,8 +28,8 @@ public class Parasitic extends EcoEnchant {
|
||||
if (newHealth > attacker.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue()) {
|
||||
newHealth = attacker.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue();
|
||||
}
|
||||
if (attacker.getHealth() > 0) {
|
||||
attacker.setHealth(newHealth);
|
||||
}
|
||||
if (attacker.getHealth() > 0) {
|
||||
attacker.setHealth(newHealth);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -43,19 +43,19 @@ public class Soulbound extends EcoEnchant {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(event.getEntity() instanceof Arrow)) {
|
||||
if (player.getKiller() != null) {
|
||||
Player killer = player.getKiller();
|
||||
int reaperLevel = EnchantChecks.getMainhandLevel(killer, EcoEnchants.REAPER);
|
||||
if (reaperLevel > 0) {
|
||||
if (!(EcoEnchants.REAPER.getDisabledWorlds().contains(killer.getWorld()))) {
|
||||
if (EnchantmentUtils.passedChance(EcoEnchants.REAPER, reaperLevel)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!(event.getEntity() instanceof Arrow)) {
|
||||
if (player.getKiller() != null) {
|
||||
Player killer = player.getKiller();
|
||||
int reaperLevel = EnchantChecks.getMainhandLevel(killer, EcoEnchants.REAPER);
|
||||
if (reaperLevel > 0) {
|
||||
if (!(EcoEnchants.REAPER.getDisabledWorlds().contains(killer.getWorld()))) {
|
||||
if (EnchantmentUtils.passedChance(EcoEnchants.REAPER, reaperLevel)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (ItemStack itemStack : player.getInventory().getContents()) {
|
||||
if (itemStack == null) {
|
||||
continue;
|
||||
|
@ -1,11 +1,6 @@
|
||||
package com.willfp.ecoenchants.enchantments.support.vanilla;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class VanillaEnchantmentMetadata {
|
||||
/**
|
||||
* The maximum level for the enchantment.
|
||||
*/
|
||||
private Integer maxLevel = null;
|
||||
public record VanillaEnchantmentMetadata(
|
||||
Integer maxLevel
|
||||
) {
|
||||
}
|
||||
|
@ -51,9 +51,7 @@ public class VanillaEnchantments {
|
||||
));
|
||||
|
||||
for (Enchantment enchantment : enchantments) {
|
||||
VanillaEnchantmentMetadata metadata = new VanillaEnchantmentMetadata();
|
||||
|
||||
metadata.setMaxLevel(maxLevels.get(enchantment));
|
||||
VanillaEnchantmentMetadata metadata = new VanillaEnchantmentMetadata(maxLevels.get(enchantment));
|
||||
|
||||
map.put(enchantment, metadata);
|
||||
}
|
||||
|
@ -1,2 +1,2 @@
|
||||
version = 7.8.0
|
||||
version = 7.8.1
|
||||
plugin-name = EcoEnchants
|
Loading…
Reference in New Issue
Block a user