Debug for Removing Casting Mode particles.

This commit is contained in:
Ka0rX 2022-10-02 12:03:06 +02:00
parent 37220d5a3a
commit a6b2fa594e
2 changed files with 34 additions and 30 deletions

View File

@ -10,40 +10,44 @@ import org.bukkit.Particle;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
public class CastingParticle { public class CastingParticle {
private final Consumer<Location> display; private final Consumer<Location> display;
public CastingParticle(ConfigurationSection config) { public CastingParticle(ConfigurationSection config) {
Validate.notNull(config, "Casting particle config cannot be null"); Validate.notNull(config, "Casting particle config cannot be null");
String format = config.getString("particle"); String format = config.getString("particle");
Validate.notNull(format, "Could not read particle name"); Validate.notNull(format, "Could not read particle name");
Particle particle = Particle.valueOf(format.toUpperCase().replace("-", "_").replace(" ", "_")); Particle particle = Particle.valueOf(format.toUpperCase().replace("-", "_").replace(" ", "_"));
if (config.contains("color")) { if (config.contains("color")) {
final float size = (float) config.getDouble("size") == 0 ? 1 : (float) Math.max(config.getDouble("size"), 0); 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")); 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)); display = (loc) -> loc.getWorld().spawnParticle(particle, loc, 1, new Particle.DustOptions(color, size));
return; return;
} }
if (config.contains("material")) { if (config.contains("material")) {
format = config.getString("material"); format = config.getString("material");
Validate.notNull(format, "Could not read material name"); Validate.notNull(format, "Could not read material name");
Material material = Material.valueOf(format.toUpperCase().replace("-", "_").replace(" ", "_")); 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()); display = (loc) -> loc.getWorld().spawnParticle(particle, loc, 0);
return; }
}
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) { public void display(Location loc) {
display.accept(loc); display.accept(loc);
} }
} }

View File

@ -22,7 +22,7 @@ import java.util.logging.Level;
public class ConfigManager { public class ConfigManager {
public final CommandVerbose commandVerbose = new CommandVerbose(); 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 String partyChatPrefix, noSkillBoundPlaceholder;
public ChatColor staminaFull, staminaHalf, staminaEmpty; public ChatColor staminaFull, staminaHalf, staminaEmpty;
public long combatLogTimer, lootChestExpireTime, lootChestPlayerCooldown, globalSkillCooldown; public long combatLogTimer, lootChestExpireTime, lootChestPlayerCooldown, globalSkillCooldown;
@ -109,7 +109,7 @@ public class ConfigManager {
fishingDropsChanceWeight = MMOCore.plugin.getConfig().getDouble("chance-stat-weight.fishing-drops"); fishingDropsChanceWeight = MMOCore.plugin.getConfig().getDouble("chance-stat-weight.fishing-drops");
maxPartyLevelDifference = MMOCore.plugin.getConfig().getInt("party.max-level-difference"); maxPartyLevelDifference = MMOCore.plugin.getConfig().getInt("party.max-level-difference");
splitProfessionExp = MMOCore.plugin.getConfig().getBoolean("party.profession-exp-split"); 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); staminaFull = getColorOrDefault("stamina-whole", ChatColor.GREEN);
staminaHalf = getColorOrDefault("stamina-half", ChatColor.DARK_GREEN); staminaHalf = getColorOrDefault("stamina-half", ChatColor.DARK_GREEN);