diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/loot/chest/particle/CastingParticle.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/loot/chest/particle/CastingParticle.java index 993ec56f..24bd3827 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/loot/chest/particle/CastingParticle.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/loot/chest/particle/CastingParticle.java @@ -10,40 +10,44 @@ import org.bukkit.Particle; import org.bukkit.configuration.ConfigurationSection; public class CastingParticle { - private final Consumer display; + private final Consumer display; - public CastingParticle(ConfigurationSection config) { - Validate.notNull(config, "Casting particle config cannot be null"); + public CastingParticle(ConfigurationSection config) { + Validate.notNull(config, "Casting particle config cannot be null"); - String format = config.getString("particle"); - Validate.notNull(format, "Could not read particle name"); - Particle particle = Particle.valueOf(format.toUpperCase().replace("-", "_").replace(" ", "_")); + String format = config.getString("particle"); + Validate.notNull(format, "Could not read particle name"); + Particle particle = Particle.valueOf(format.toUpperCase().replace("-", "_").replace(" ", "_")); - if (config.contains("color")) { - final float size = (float) config.getDouble("size") == 0 ? 1 : (float) Math.max(config.getDouble("size"), 0); - Color color = Color.fromRGB(config.getInt("color.red"), config.getInt("color.green"), config.getInt("color.blue")); + if (config.contains("color")) { + final float size = (float) config.getDouble("size") == 0 ? 1 : (float) Math.max(config.getDouble("size"), 0); + Color color = Color.fromRGB(config.getInt("color.red"), config.getInt("color.green"), config.getInt("color.blue")); - display = (loc) -> loc.getWorld().spawnParticle(particle, loc, 1, new Particle.DustOptions(color, size)); - return; - } + display = (loc) -> loc.getWorld().spawnParticle(particle, loc, 1, new Particle.DustOptions(color, size)); + return; + } - if (config.contains("material")) { - format = config.getString("material"); - Validate.notNull(format, "Could not read material name"); - Material material = Material.valueOf(format.toUpperCase().replace("-", "_").replace(" ", "_")); + if (config.contains("material")) { + format = config.getString("material"); + Validate.notNull(format, "Could not read material name"); + Material material = Material.valueOf(format.toUpperCase().replace("-", "_").replace(" ", "_")); + if (material == Material.DIRT && particle == Particle.SUSPENDED) + display = (loc) -> { + return; + }; + else + display = (loc) -> loc.getWorld().spawnParticle(particle, loc, 1, material.createBlockData()); + return; + } - display = (loc) -> loc.getWorld().spawnParticle(particle, loc, 1, material.createBlockData()); - return; - } + display = (loc) -> loc.getWorld().spawnParticle(particle, loc, 0); + } - display = (loc) -> loc.getWorld().spawnParticle(particle, loc, 0); - } - - public CastingParticle(Particle particle) { - display = (loc) -> loc.getWorld().spawnParticle(particle, loc, 0); - } + public CastingParticle(Particle particle) { + display = (loc) -> loc.getWorld().spawnParticle(particle, loc, 0); + } - public void display(Location loc) { - display.accept(loc); - } + public void display(Location loc) { + display.accept(loc); + } } diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/manager/ConfigManager.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/manager/ConfigManager.java index e2c6cfef..95920fbb 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/manager/ConfigManager.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/manager/ConfigManager.java @@ -22,7 +22,7 @@ import java.util.logging.Level; public class ConfigManager { public final CommandVerbose commandVerbose = new CommandVerbose(); - public boolean overrideVanillaExp, canCreativeCast, cobbleGeneratorXP, saveDefaultClassInfo, attributesAsClassInfo, splitProfessionExp, questBossBar; + public boolean overrideVanillaExp, canCreativeCast, cobbleGeneratorXP, saveDefaultClassInfo, attributesAsClassInfo, splitProfessionExp, disableQuestBossBar; public String partyChatPrefix, noSkillBoundPlaceholder; public ChatColor staminaFull, staminaHalf, staminaEmpty; public long combatLogTimer, lootChestExpireTime, lootChestPlayerCooldown, globalSkillCooldown; @@ -109,7 +109,7 @@ public class ConfigManager { fishingDropsChanceWeight = MMOCore.plugin.getConfig().getDouble("chance-stat-weight.fishing-drops"); maxPartyLevelDifference = MMOCore.plugin.getConfig().getInt("party.max-level-difference"); splitProfessionExp = MMOCore.plugin.getConfig().getBoolean("party.profession-exp-split"); - questBossBar = MMOCore.plugin.getConfig().getBoolean("mmocore-quests.disable-boss-bar"); + disableQuestBossBar = MMOCore.plugin.getConfig().getBoolean("mmocore-quests.disable-boss-bar"); staminaFull = getColorOrDefault("stamina-whole", ChatColor.GREEN); staminaHalf = getColorOrDefault("stamina-half", ChatColor.DARK_GREEN);