This commit is contained in:
nulli0n 2024-11-26 12:56:20 +05:00
parent 9b6647c709
commit ad63adcac9
22 changed files with 155 additions and 70 deletions

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>ExcellentEnchants</artifactId>
<groupId>su.nightexpress.excellentenchants</groupId>
<version>4.3.0</version>
<version>4.3.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -4,6 +4,12 @@ public class ConfigBridge {
private static int enchantsTickInterval;
private static boolean globalDistEnchanting;
private static boolean globalDistTrading;
private static boolean globalDistMobEquipment;
private static boolean globalDistTradeEquipment;
private static boolean globalDistRandomLoot;
public static int getEnchantsTickInterval() {
return enchantsTickInterval;
}
@ -11,4 +17,44 @@ public class ConfigBridge {
public static void setEnchantsTickInterval(int enchantsTickInterval) {
ConfigBridge.enchantsTickInterval = enchantsTickInterval;
}
public static boolean isGlobalDistEnchanting() {
return globalDistEnchanting;
}
public static void setGlobalDistEnchanting(boolean globalDistEnchanting) {
ConfigBridge.globalDistEnchanting = globalDistEnchanting;
}
public static boolean isGlobalDistTrading() {
return globalDistTrading;
}
public static void setGlobalDistTrading(boolean globalDistTrading) {
ConfigBridge.globalDistTrading = globalDistTrading;
}
public static boolean isGlobalDistMobEquipment() {
return globalDistMobEquipment;
}
public static void setGlobalDistMobEquipment(boolean globalDistMobEquipment) {
ConfigBridge.globalDistMobEquipment = globalDistMobEquipment;
}
public static boolean isGlobalDistTradeEquipment() {
return globalDistTradeEquipment;
}
public static void setGlobalDistTradeEquipment(boolean globalDistTradeEquipment) {
ConfigBridge.globalDistTradeEquipment = globalDistTradeEquipment;
}
public static boolean isGlobalDistRandomLoot() {
return globalDistRandomLoot;
}
public static void setGlobalDistRandomLoot(boolean globalDistRandomLoot) {
ConfigBridge.globalDistRandomLoot = globalDistRandomLoot;
}
}

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>ExcellentEnchants</artifactId>
<groupId>su.nightexpress.excellentenchants</groupId>
<version>4.3.0</version>
<version>4.3.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -89,25 +89,25 @@
<dependency>
<groupId>su.nightexpress.excellentenchants</groupId>
<artifactId>API</artifactId>
<version>4.3.0</version>
<version>4.3.1</version>
</dependency>
<dependency>
<groupId>su.nightexpress.excellentenchants</groupId>
<artifactId>NMS</artifactId>
<version>4.3.0</version>
<version>4.3.1</version>
</dependency>
<dependency>
<groupId>su.nightexpress.excellentenchants</groupId>
<artifactId>MC_1_21_3</artifactId>
<version>4.3.0</version>
<version>4.3.1</version>
</dependency>
<dependency>
<groupId>su.nightexpress.excellentenchants</groupId>
<artifactId>MC_1_21</artifactId>
<version>4.3.0</version>
<version>4.3.1</version>
</dependency>
</dependencies>

View File

@ -98,7 +98,13 @@ public class EnchantsPlugin extends NightPlugin implements ImprovedCommands {
private void loadAPI() {
EnchantsAPI.load(this);
Keys.loadKeys(this);
ConfigBridge.setEnchantsTickInterval(Config.CORE_PASSIVE_ENCHANTS_TRIGGER_INTERVAL.get().intValue());
ConfigBridge.setGlobalDistEnchanting(Config.ENCHANTMENTS_GLOBAL_DIST_ENCHANTING.get());
ConfigBridge.setGlobalDistTrading(Config.ENCHANTMENTS_GLOBAL_DIST_TRADING.get());
ConfigBridge.setGlobalDistMobEquipment(Config.ENCHANTMENTS_GLOBAL_DIST_MOB_EQUIPMENT.get());
ConfigBridge.setGlobalDistTradeEquipment(Config.ENCHANTMENTS_GLOBAL_DIST_TRADE_EQUIPMENT.get());
ConfigBridge.setGlobalDistRandomLoot(Config.ENCHANTMENTS_GLOBAL_DIST_RANDOM_LOOT.get());
}
private void loadHooks() {

View File

@ -71,6 +71,41 @@ public class Config {
public static final ConfigValue<Boolean> ENCHANTMENTS_GLOBAL_DIST_ENCHANTING = ConfigValue.create("Enchantments.Global_Distribution.Enchanting_Table",
true,
"Controls whether excellent enchants can be obtained via enchanting table.",
"[*] Server reboot required.",
"[Default is true]"
);
public static final ConfigValue<Boolean> ENCHANTMENTS_GLOBAL_DIST_TRADING = ConfigValue.create("Enchantments.Global_Distribution.Trading",
true,
"Controls whether excellent enchants can be obtained via trading with villagers.",
"[*] Server reboot required.",
"[Default is true]"
);
public static final ConfigValue<Boolean> ENCHANTMENTS_GLOBAL_DIST_MOB_EQUIPMENT = ConfigValue.create("Enchantments.Global_Distribution.Mob_Equipment",
true,
"Controls whether excellent enchants can be populated on mob's equipment.",
"[*] Server reboot required.",
"[Default is true]"
);
public static final ConfigValue<Boolean> ENCHANTMENTS_GLOBAL_DIST_TRADE_EQUIPMENT = ConfigValue.create("Enchantments.Global_Distribution.Trade_Equipment",
true,
"Controls whether excellent enchants can be populated on traded equipment.",
"[*] Server reboot required.",
"[Default is true]"
);
public static final ConfigValue<Boolean> ENCHANTMENTS_GLOBAL_DIST_RANDOM_LOOT = ConfigValue.create("Enchantments.Global_Distribution.Random_Loot",
true,
"Controls whether excellent enchants can be populated on random loot.",
"[*] Server reboot required.",
"[Default is true]"
);
public static final ConfigValue<Set<String>> ENCHANTMENTS_DISABLED_LIST = ConfigValue.forSet("Enchantments.Disabled.List",
String::toLowerCase,
FileConfig::set,

View File

@ -11,20 +11,20 @@ import org.bukkit.potion.PotionEffectType;
import org.jetbrains.annotations.NotNull;
import su.nightexpress.excellentenchants.EnchantsPlugin;
import su.nightexpress.excellentenchants.api.Modifier;
import su.nightexpress.excellentenchants.api.enchantment.meta.ChanceMeta;
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
import su.nightexpress.excellentenchants.api.enchantment.TradeType;
import su.nightexpress.excellentenchants.api.enchantment.meta.ChanceMeta;
import su.nightexpress.excellentenchants.api.enchantment.meta.Probability;
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
import su.nightexpress.excellentenchants.enchantment.impl.EnchantDefinition;
import su.nightexpress.excellentenchants.enchantment.impl.EnchantDistribution;
import su.nightexpress.excellentenchants.enchantment.impl.GameEnchantment;
import su.nightexpress.excellentenchants.api.enchantment.meta.Probability;
import su.nightexpress.excellentenchants.rarity.EnchantRarity;
import su.nightexpress.excellentenchants.util.ItemCategories;
import su.nightexpress.nightcore.config.ConfigValue;
import su.nightexpress.nightcore.config.FileConfig;
import su.nightexpress.nightcore.util.NumberUtil;
import su.nightexpress.nightcore.util.bukkit.NightSound;
import su.nightexpress.nightcore.util.wrapper.UniParticle;
import su.nightexpress.nightcore.util.wrapper.UniSound;
import java.io.File;
@ -105,7 +105,7 @@ public class FireShieldEnchant extends GameEnchantment implements ChanceMeta, Co
if (this.hasVisualEffects()) {
UniParticle.of(Particle.FLAME).play(victim.getEyeLocation(), 0.5, 0.1, 35);
UniSound.of(Sound.ITEM_FIRECHARGE_USE).play(victim.getLocation());
NightSound.of(Sound.ITEM_FIRECHARGE_USE).play(victim.getLocation());
}
damager.setFireTicks(fireTicks);

View File

@ -13,18 +13,18 @@ import su.nightexpress.excellentenchants.EnchantsPlugin;
import su.nightexpress.excellentenchants.api.Modifier;
import su.nightexpress.excellentenchants.api.enchantment.TradeType;
import su.nightexpress.excellentenchants.api.enchantment.meta.ChanceMeta;
import su.nightexpress.excellentenchants.api.enchantment.meta.PotionEffects;
import su.nightexpress.excellentenchants.api.enchantment.meta.PotionMeta;
import su.nightexpress.excellentenchants.api.enchantment.meta.Probability;
import su.nightexpress.excellentenchants.api.enchantment.meta.PotionEffects;
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
import su.nightexpress.excellentenchants.enchantment.impl.EnchantDefinition;
import su.nightexpress.excellentenchants.enchantment.impl.EnchantDistribution;
import su.nightexpress.excellentenchants.enchantment.impl.GameEnchantment;
import su.nightexpress.excellentenchants.util.ItemCategories;
import su.nightexpress.excellentenchants.rarity.EnchantRarity;
import su.nightexpress.excellentenchants.util.ItemCategories;
import su.nightexpress.nightcore.config.FileConfig;
import su.nightexpress.nightcore.util.bukkit.NightSound;
import su.nightexpress.nightcore.util.wrapper.UniParticle;
import su.nightexpress.nightcore.util.wrapper.UniSound;
import java.io.File;
@ -79,7 +79,7 @@ public class IceShieldEnchant extends GameEnchantment implements ChanceMeta, Pot
if (this.hasVisualEffects()) {
UniParticle.blockCrack(Material.ICE).play(victim.getEyeLocation(), 0.5, 0.1, 35);
UniParticle.of(Particle.CLOUD).play(victim.getEyeLocation(), 0.25, 0.1, 25);
UniSound.of(Sound.BLOCK_GLASS_BREAK).play(victim.getLocation());
NightSound.of(Sound.BLOCK_GLASS_BREAK).play(victim.getLocation());
}
return true;

View File

@ -11,16 +11,16 @@ import su.nightexpress.excellentenchants.EnchantsPlugin;
import su.nightexpress.excellentenchants.api.Modifier;
import su.nightexpress.excellentenchants.api.enchantment.TradeType;
import su.nightexpress.excellentenchants.api.enchantment.meta.ChanceMeta;
import su.nightexpress.excellentenchants.api.enchantment.meta.Probability;
import su.nightexpress.excellentenchants.api.enchantment.type.FishingEnchant;
import su.nightexpress.excellentenchants.enchantment.impl.EnchantDefinition;
import su.nightexpress.excellentenchants.enchantment.impl.EnchantDistribution;
import su.nightexpress.excellentenchants.enchantment.impl.GameEnchantment;
import su.nightexpress.excellentenchants.api.enchantment.meta.Probability;
import su.nightexpress.excellentenchants.rarity.EnchantRarity;
import su.nightexpress.excellentenchants.util.ItemCategories;
import su.nightexpress.nightcore.config.FileConfig;
import su.nightexpress.nightcore.util.bukkit.NightSound;
import su.nightexpress.nightcore.util.wrapper.UniParticle;
import su.nightexpress.nightcore.util.wrapper.UniSound;
import java.io.File;
@ -68,7 +68,7 @@ public class CurseOfDrownedEnchant extends GameEnchantment implements FishingEnc
if (this.hasVisualEffects()) {
UniParticle.of(Particle.UNDERWATER).play(hook.getLocation(), 0.75, 0.1, 50);
UniSound.of(Sound.ENTITY_DROWNED_AMBIENT).play(event.getPlayer());
NightSound.of(Sound.ENTITY_DROWNED_AMBIENT).play(event.getPlayer());
}
return true;
}

View File

@ -18,17 +18,17 @@ import org.jetbrains.annotations.NotNull;
import su.nightexpress.excellentenchants.EnchantsPlugin;
import su.nightexpress.excellentenchants.api.enchantment.TradeType;
import su.nightexpress.excellentenchants.api.enchantment.meta.ChanceMeta;
import su.nightexpress.excellentenchants.api.enchantment.meta.Probability;
import su.nightexpress.excellentenchants.api.enchantment.type.BlockBreakEnchant;
import su.nightexpress.excellentenchants.api.enchantment.type.InteractEnchant;
import su.nightexpress.excellentenchants.enchantment.impl.EnchantDefinition;
import su.nightexpress.excellentenchants.enchantment.impl.EnchantDistribution;
import su.nightexpress.excellentenchants.enchantment.impl.GameEnchantment;
import su.nightexpress.excellentenchants.api.enchantment.meta.Probability;
import su.nightexpress.excellentenchants.rarity.EnchantRarity;
import su.nightexpress.excellentenchants.util.ItemCategories;
import su.nightexpress.nightcore.config.ConfigValue;
import su.nightexpress.nightcore.config.FileConfig;
import su.nightexpress.nightcore.util.wrapper.UniSound;
import su.nightexpress.nightcore.util.bukkit.NightSound;
import java.io.File;
import java.util.Set;
@ -133,7 +133,7 @@ public class ReplanterEnchant extends GameEnchantment implements ChanceMeta, Int
if (seed == Material.NETHER_WART && blockGround.getType() == Material.SOUL_SAND
|| seed != Material.NETHER_WART && blockGround.getType() == Material.FARMLAND) {
if (this.takeSeeds(player, seed)) {
UniSound.of(seed == Material.NETHER_WART ? Sound.ITEM_NETHER_WART_PLANT : Sound.ITEM_CROP_PLANT).play(player);
NightSound.of(seed == Material.NETHER_WART ? Sound.ITEM_NETHER_WART_PLANT : Sound.ITEM_CROP_PLANT).play(player);
plugin.getEnchantNMS().sendAttackPacket(player, 0);
blockPlant.setType(this.fineSeedsToBlock(seed));
break;

View File

@ -18,11 +18,11 @@ import su.nightexpress.excellentenchants.EnchantsPlugin;
import su.nightexpress.excellentenchants.api.Modifier;
import su.nightexpress.excellentenchants.api.enchantment.TradeType;
import su.nightexpress.excellentenchants.api.enchantment.meta.ChanceMeta;
import su.nightexpress.excellentenchants.api.enchantment.meta.Probability;
import su.nightexpress.excellentenchants.api.enchantment.type.BlockDropEnchant;
import su.nightexpress.excellentenchants.enchantment.impl.EnchantDefinition;
import su.nightexpress.excellentenchants.enchantment.impl.EnchantDistribution;
import su.nightexpress.excellentenchants.enchantment.impl.GameEnchantment;
import su.nightexpress.excellentenchants.api.enchantment.meta.Probability;
import su.nightexpress.excellentenchants.rarity.EnchantRarity;
import su.nightexpress.excellentenchants.util.ItemCategories;
import su.nightexpress.nightcore.config.ConfigValue;
@ -30,8 +30,8 @@ import su.nightexpress.nightcore.config.FileConfig;
import su.nightexpress.nightcore.util.BukkitThing;
import su.nightexpress.nightcore.util.Lists;
import su.nightexpress.nightcore.util.LocationUtil;
import su.nightexpress.nightcore.util.bukkit.NightSound;
import su.nightexpress.nightcore.util.wrapper.UniParticle;
import su.nightexpress.nightcore.util.wrapper.UniSound;
import java.io.File;
import java.util.ArrayList;
@ -45,7 +45,7 @@ public class SmelterEnchant extends GameEnchantment implements ChanceMeta, Block
public static final String ID = "smelter";
private UniSound sound;
private NightSound sound;
private boolean disableOnCrouch;
private final Set<Material> exemptedItems;
@ -82,11 +82,7 @@ public class SmelterEnchant extends GameEnchantment implements ChanceMeta, Block
"Sets whether or not enchantment will have no effect when crouching."
).read(config);
this.sound = ConfigValue.create("Settings.Sound",
UniSound.of(Sound.BLOCK_LAVA_EXTINGUISH),
"Sound to play on smelting.",
"https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html"
).read(config);
this.sound = ConfigValue.create("Settings.Sound", NightSound.of(Sound.BLOCK_LAVA_EXTINGUISH), "Sound to play on smelting.").read(config);
this.exemptedItems.addAll(ConfigValue.forSet("Settings.Exempted_Blocks",
BukkitThing::getMaterial,

View File

@ -11,18 +11,18 @@ import su.nightexpress.excellentenchants.EnchantsPlugin;
import su.nightexpress.excellentenchants.api.Modifier;
import su.nightexpress.excellentenchants.api.enchantment.TradeType;
import su.nightexpress.excellentenchants.api.enchantment.meta.ChanceMeta;
import su.nightexpress.excellentenchants.api.enchantment.meta.Probability;
import su.nightexpress.excellentenchants.api.enchantment.type.GenericEnchant;
import su.nightexpress.excellentenchants.enchantment.impl.EnchantDefinition;
import su.nightexpress.excellentenchants.enchantment.impl.EnchantDistribution;
import su.nightexpress.excellentenchants.enchantment.impl.GameEnchantment;
import su.nightexpress.excellentenchants.api.enchantment.meta.Probability;
import su.nightexpress.excellentenchants.rarity.EnchantRarity;
import su.nightexpress.excellentenchants.util.ItemCategories;
import su.nightexpress.excellentenchants.util.EnchantUtils;
import su.nightexpress.excellentenchants.util.ItemCategories;
import su.nightexpress.nightcore.config.FileConfig;
import su.nightexpress.nightcore.manager.SimpeListener;
import su.nightexpress.nightcore.util.NumberUtil;
import su.nightexpress.nightcore.util.wrapper.UniSound;
import su.nightexpress.nightcore.util.bukkit.NightSound;
import java.io.File;
@ -90,7 +90,7 @@ public class RestoreEnchant extends GameEnchantment implements GenericEnchant, C
EnchantUtils.remove(item, this.getBukkitEnchantment());
if (this.hasVisualEffects()) {
UniSound.of(Sound.ITEM_TOTEM_USE).play(event.getPlayer());
NightSound.of(Sound.ITEM_TOTEM_USE).play(event.getPlayer());
}
}
}

View File

@ -15,19 +15,19 @@ import su.nightexpress.excellentenchants.EnchantsPlugin;
import su.nightexpress.excellentenchants.api.Modifier;
import su.nightexpress.excellentenchants.api.enchantment.TradeType;
import su.nightexpress.excellentenchants.api.enchantment.meta.ChanceMeta;
import su.nightexpress.excellentenchants.api.enchantment.meta.Probability;
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
import su.nightexpress.excellentenchants.enchantment.impl.EnchantDefinition;
import su.nightexpress.excellentenchants.enchantment.impl.EnchantDistribution;
import su.nightexpress.excellentenchants.enchantment.impl.GameEnchantment;
import su.nightexpress.excellentenchants.api.enchantment.meta.Probability;
import su.nightexpress.excellentenchants.rarity.EnchantRarity;
import su.nightexpress.excellentenchants.util.ItemCategories;
import su.nightexpress.nightcore.config.ConfigValue;
import su.nightexpress.nightcore.config.FileConfig;
import su.nightexpress.nightcore.util.NumberUtil;
import su.nightexpress.nightcore.util.bukkit.NightSound;
import su.nightexpress.nightcore.util.random.Rnd;
import su.nightexpress.nightcore.util.wrapper.UniParticle;
import su.nightexpress.nightcore.util.wrapper.UniSound;
import java.io.File;
@ -117,7 +117,7 @@ public class CutterEnchant extends GameEnchantment implements ChanceMeta, Combat
if (this.hasVisualEffects()) {
UniParticle.itemCrack(itemCut).play(victim.getEyeLocation(), 0.25, 0.15, 30);
UniSound.of(Sound.ENTITY_ITEM_BREAK).play(victim.getLocation());
NightSound.of(Sound.ENTITY_ITEM_BREAK).play(victim.getLocation());
}
return true;

View File

@ -11,16 +11,16 @@ import su.nightexpress.excellentenchants.EnchantsPlugin;
import su.nightexpress.excellentenchants.api.Modifier;
import su.nightexpress.excellentenchants.api.enchantment.TradeType;
import su.nightexpress.excellentenchants.api.enchantment.meta.ChanceMeta;
import su.nightexpress.excellentenchants.api.enchantment.meta.Probability;
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
import su.nightexpress.excellentenchants.enchantment.impl.EnchantDefinition;
import su.nightexpress.excellentenchants.enchantment.impl.EnchantDistribution;
import su.nightexpress.excellentenchants.enchantment.impl.GameEnchantment;
import su.nightexpress.excellentenchants.api.enchantment.meta.Probability;
import su.nightexpress.excellentenchants.rarity.EnchantRarity;
import su.nightexpress.excellentenchants.util.ItemCategories;
import su.nightexpress.nightcore.config.FileConfig;
import su.nightexpress.nightcore.util.bukkit.NightSound;
import su.nightexpress.nightcore.util.wrapper.UniParticle;
import su.nightexpress.nightcore.util.wrapper.UniSound;
import java.io.File;
@ -63,7 +63,7 @@ public class DoubleStrikeEnchant extends GameEnchantment implements ChanceMeta,
if (this.hasVisualEffects()) {
UniParticle.of(Particle.EXPLOSION).play(victim.getEyeLocation(), 0.25, 0.15, 15);
UniSound.of(Sound.ENTITY_GENERIC_EXPLODE).play(victim.getLocation());
NightSound.of(Sound.ENTITY_GENERIC_EXPLODE).play(victim.getLocation());
}
return true;
}

View File

@ -13,18 +13,18 @@ import su.nightexpress.excellentenchants.EnchantsPlugin;
import su.nightexpress.excellentenchants.api.Modifier;
import su.nightexpress.excellentenchants.api.enchantment.TradeType;
import su.nightexpress.excellentenchants.api.enchantment.meta.ChanceMeta;
import su.nightexpress.excellentenchants.api.enchantment.meta.PotionEffects;
import su.nightexpress.excellentenchants.api.enchantment.meta.PotionMeta;
import su.nightexpress.excellentenchants.api.enchantment.meta.Probability;
import su.nightexpress.excellentenchants.api.enchantment.meta.PotionEffects;
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
import su.nightexpress.excellentenchants.enchantment.impl.EnchantDefinition;
import su.nightexpress.excellentenchants.enchantment.impl.EnchantDistribution;
import su.nightexpress.excellentenchants.enchantment.impl.GameEnchantment;
import su.nightexpress.excellentenchants.util.ItemCategories;
import su.nightexpress.excellentenchants.rarity.EnchantRarity;
import su.nightexpress.excellentenchants.util.ItemCategories;
import su.nightexpress.nightcore.config.FileConfig;
import su.nightexpress.nightcore.util.bukkit.NightSound;
import su.nightexpress.nightcore.util.wrapper.UniParticle;
import su.nightexpress.nightcore.util.wrapper.UniSound;
import java.io.File;
@ -74,7 +74,7 @@ public class IceAspectEnchant extends GameEnchantment implements ChanceMeta, Pot
if (this.hasVisualEffects()) {
UniParticle.blockCrack(Material.ICE).play(victim.getEyeLocation(), 0.5, 0.1, 35);
UniParticle.of(Particle.CLOUD).play(victim.getEyeLocation(), 0.25, 0.1, 25);
UniSound.of(Sound.BLOCK_GLASS_BREAK).play(victim.getLocation());
NightSound.of(Sound.BLOCK_GLASS_BREAK).play(victim.getLocation());
}
return true;
}

View File

@ -13,16 +13,16 @@ import su.nightexpress.excellentenchants.EnchantsPlugin;
import su.nightexpress.excellentenchants.api.Modifier;
import su.nightexpress.excellentenchants.api.enchantment.TradeType;
import su.nightexpress.excellentenchants.api.enchantment.meta.ChanceMeta;
import su.nightexpress.excellentenchants.api.enchantment.meta.Probability;
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
import su.nightexpress.excellentenchants.enchantment.impl.EnchantDefinition;
import su.nightexpress.excellentenchants.enchantment.impl.EnchantDistribution;
import su.nightexpress.excellentenchants.enchantment.impl.GameEnchantment;
import su.nightexpress.excellentenchants.api.enchantment.meta.Probability;
import su.nightexpress.excellentenchants.rarity.EnchantRarity;
import su.nightexpress.excellentenchants.util.ItemCategories;
import su.nightexpress.nightcore.config.FileConfig;
import su.nightexpress.nightcore.util.bukkit.NightSound;
import su.nightexpress.nightcore.util.random.Rnd;
import su.nightexpress.nightcore.util.wrapper.UniSound;
import java.io.File;
@ -78,7 +78,7 @@ public class RocketEnchant extends GameEnchantment implements ChanceMeta, Combat
Firework firework = this.createRocket(victim.getWorld(), victim.getLocation(), level);
firework.addPassenger(victim);
UniSound.of(Sound.ENTITY_FIREWORK_ROCKET_LAUNCH).play(victim.getLocation());
NightSound.of(Sound.ENTITY_FIREWORK_ROCKET_LAUNCH).play(victim.getLocation());
return true;
}

View File

@ -19,7 +19,7 @@ import su.nightexpress.excellentenchants.config.Keys;
import su.nightexpress.excellentenchants.util.EnchantUtils;
import su.nightexpress.nightcore.manager.AbstractListener;
import su.nightexpress.nightcore.util.PDCUtil;
import su.nightexpress.nightcore.util.wrapper.UniSound;
import su.nightexpress.nightcore.util.bukkit.NightSound;
import java.util.HashMap;
import java.util.Map;
@ -176,7 +176,7 @@ public class AnvilListener extends AbstractListener<EnchantsPlugin> {
event.getView().setCursor(item);
event.setCancelled(false);
UniSound.of(Sound.BLOCK_ENCHANTMENT_TABLE_USE).play(player);
NightSound.of(Sound.BLOCK_ENCHANTMENT_TABLE_USE).play(player);
ItemStack second = anvilInventory.getItem(1);
if (second != null && !second.getType().isAir()) {

View File

@ -6,7 +6,7 @@
<parent>
<groupId>su.nightexpress.excellentenchants</groupId>
<artifactId>ExcellentEnchants</artifactId>
<version>4.3.0</version>
<version>4.3.1</version>
</parent>
<artifactId>MC_1_21</artifactId>
@ -28,13 +28,13 @@
<dependency>
<groupId>su.nightexpress.excellentenchants</groupId>
<artifactId>API</artifactId>
<version>4.3.0</version>
<version>4.3.1</version>
</dependency>
<dependency>
<groupId>su.nightexpress.excellentenchants</groupId>
<artifactId>NMS</artifactId>
<version>4.3.0</version>
<version>4.3.1</version>
</dependency>
</dependencies>

View File

@ -51,6 +51,7 @@ import org.bukkit.entity.Player;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
import su.nightexpress.excellentenchants.api.ConfigBridge;
import su.nightexpress.excellentenchants.api.enchantment.*;
import su.nightexpress.excellentenchants.api.enchantment.bridge.FlameWalker;
import su.nightexpress.excellentenchants.nms.EnchantNMS;
@ -199,31 +200,31 @@ public class Internal_1_21 implements EnchantNMS {
else addInTag(EnchantmentTags.NON_TREASURE, reference);
// Any enchantment can be on random loot.
if (distribution.isOnRandomLoot()) {
if (distribution.isOnRandomLoot() && ConfigBridge.isGlobalDistRandomLoot()) {
addInTag(EnchantmentTags.ON_RANDOM_LOOT, reference);
}
// Only non-treasure enchantments should be on mob equipment, traded equipment and non-rebalanced trades.
if (!distribution.isTreasure()) {
if (distribution.isOnMobSpawnEquipment()) {
if (distribution.isOnMobSpawnEquipment() && ConfigBridge.isGlobalDistMobEquipment()) {
addInTag(EnchantmentTags.ON_MOB_SPAWN_EQUIPMENT, reference);
}
if (distribution.isOnTradedEquipment()) {
if (distribution.isOnTradedEquipment() && ConfigBridge.isGlobalDistTradeEquipment()) {
addInTag(EnchantmentTags.ON_TRADED_EQUIPMENT, reference);
}
}
// Any enchantment can be tradable.
if (experimentalTrades) {
if (distribution.isTradable()) {
if (distribution.isTradable() && ConfigBridge.isGlobalDistTrading()) {
distribution.getTrades().forEach(tradeType -> {
addInTag(getTradeKey(tradeType), reference);
});
}
}
else {
if (distribution.isTradable()) {
if (distribution.isTradable() && ConfigBridge.isGlobalDistTrading()) {
addInTag(EnchantmentTags.TRADEABLE, reference);
}
else removeFromTag(EnchantmentTags.TRADEABLE, reference);
@ -235,7 +236,7 @@ public class Internal_1_21 implements EnchantNMS {
else {
// Only non-curse and non-treasure enchantments should go in enchanting table.
if (!distribution.isTreasure()) {
if (distribution.isDiscoverable()) {
if (distribution.isDiscoverable() && ConfigBridge.isGlobalDistEnchanting()) {
addInTag(EnchantmentTags.IN_ENCHANTING_TABLE, reference);
}
else removeFromTag(EnchantmentTags.IN_ENCHANTING_TABLE, reference);

View File

@ -6,7 +6,7 @@
<parent>
<groupId>su.nightexpress.excellentenchants</groupId>
<artifactId>ExcellentEnchants</artifactId>
<version>4.3.0</version>
<version>4.3.1</version>
</parent>
<artifactId>MC_1_21_3</artifactId>
@ -28,13 +28,13 @@
<dependency>
<groupId>su.nightexpress.excellentenchants</groupId>
<artifactId>API</artifactId>
<version>4.3.0</version>
<version>4.3.1</version>
</dependency>
<dependency>
<groupId>su.nightexpress.excellentenchants</groupId>
<artifactId>NMS</artifactId>
<version>4.3.0</version>
<version>4.3.1</version>
</dependency>
</dependencies>

View File

@ -48,6 +48,7 @@ import org.bukkit.entity.Player;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
import su.nightexpress.excellentenchants.api.ConfigBridge;
import su.nightexpress.excellentenchants.api.enchantment.*;
import su.nightexpress.excellentenchants.api.enchantment.bridge.FlameWalker;
import su.nightexpress.nightcore.NightPlugin;
@ -270,31 +271,31 @@ public class Internal_1_21_3 implements EnchantNMS {
else addInTag(EnchantmentTags.NON_TREASURE, reference);
// Any enchantment can be on random loot.
if (distribution.isOnRandomLoot()) {
if (distribution.isOnRandomLoot() && ConfigBridge.isGlobalDistRandomLoot()) {
addInTag(EnchantmentTags.ON_RANDOM_LOOT, reference);
}
// Only non-treasure enchantments should be on mob equipment, traded equipment and non-rebalanced trades.
if (!distribution.isTreasure()) {
if (distribution.isOnMobSpawnEquipment()) {
if (distribution.isOnMobSpawnEquipment() && ConfigBridge.isGlobalDistMobEquipment()) {
addInTag(EnchantmentTags.ON_MOB_SPAWN_EQUIPMENT, reference);
}
if (distribution.isOnTradedEquipment()) {
if (distribution.isOnTradedEquipment() && ConfigBridge.isGlobalDistTradeEquipment()) {
addInTag(EnchantmentTags.ON_TRADED_EQUIPMENT, reference);
}
}
// Any enchantment can be tradable.
if (experimentalTrades) {
if (distribution.isTradable()) {
if (distribution.isTradable() && ConfigBridge.isGlobalDistTrading()) {
distribution.getTrades().forEach(tradeType -> {
addInTag(getTradeKey(tradeType), reference);
});
}
}
else {
if (distribution.isTradable()) {
if (distribution.isTradable() && ConfigBridge.isGlobalDistTrading()) {
addInTag(EnchantmentTags.TRADEABLE, reference);
}
else removeFromTag(EnchantmentTags.TRADEABLE, reference);
@ -306,7 +307,7 @@ public class Internal_1_21_3 implements EnchantNMS {
else {
// Only non-curse and non-treasure enchantments should go in enchanting table.
if (!distribution.isTreasure()) {
if (distribution.isDiscoverable()) {
if (distribution.isDiscoverable() && ConfigBridge.isGlobalDistEnchanting()) {
addInTag(EnchantmentTags.IN_ENCHANTING_TABLE, reference);
}
else removeFromTag(EnchantmentTags.IN_ENCHANTING_TABLE, reference);

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>ExcellentEnchants</artifactId>
<groupId>su.nightexpress.excellentenchants</groupId>
<version>4.3.0</version>
<version>4.3.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -34,7 +34,7 @@
<dependency>
<groupId>su.nightexpress.excellentenchants</groupId>
<artifactId>API</artifactId>
<version>4.3.0</version>
<version>4.3.1</version>
</dependency>
</dependencies>

View File

@ -7,7 +7,7 @@
<groupId>su.nightexpress.excellentenchants</groupId>
<artifactId>ExcellentEnchants</artifactId>
<packaging>pom</packaging>
<version>4.3.0</version>
<version>4.3.1</version>
<modules>
<module>API</module>
<module>Core</module>