diff --git a/src/main/java/com/gmail/nossr50/config/Config.java b/src/main/java/com/gmail/nossr50/config/Config.java index 18f337de0..56fa64429 100644 --- a/src/main/java/com/gmail/nossr50/config/Config.java +++ b/src/main/java/com/gmail/nossr50/config/Config.java @@ -106,6 +106,13 @@ public class Config extends AutoUpdateConfigLoader { public int getChimaeraItemId() { return config.getInt("Items.Chimaera_Wing.Item_ID", 288); } public boolean getChimaeraEnabled() { return config.getBoolean("Items.Chimaera_Wing.Enabled", true); } + /* Particles */ + public boolean getAbilityActivationEffectEnabled() { return config.getBoolean("Particles.Ability_Activation", true); } + public boolean getAbilityDeactivationEffectEnabled() { return config.getBoolean("Particles.Ability_Deactivation", true); } + public boolean getDodgeEffectEnabled() { return config.getBoolean("Particles.Dodge", true); } + public boolean getBleedEffectEnabled() { return config.getBoolean("Particles.Bleed", true); } + public boolean getGreaterImpactEffectEnabled() { return config.getBoolean("Particles.Greater_Impact", true); } + /* PARTY SETTINGS */ public int getAutoPartyKickInterval() { return config.getInt("Party.AutoKick_Interval", 12); } public int getAutoPartyKickTime() { return config.getInt("Party.Old_Party_Member_Cutoff", 7); } diff --git a/src/main/java/com/gmail/nossr50/util/ParticleEffectUtils.java b/src/main/java/com/gmail/nossr50/util/ParticleEffectUtils.java index d38ab8b8f..79f9c1cb5 100644 --- a/src/main/java/com/gmail/nossr50/util/ParticleEffectUtils.java +++ b/src/main/java/com/gmail/nossr50/util/ParticleEffectUtils.java @@ -14,15 +14,25 @@ import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.inventory.meta.FireworkMeta; +import com.gmail.nossr50.config.Config; + public final class ParticleEffectUtils { private ParticleEffectUtils() {}; public static void playBleedEffect(Player player) { + if (!Config.getInstance().getBleedEffectEnabled()) { + return; + } + player.getWorld().playEffect(player.getEyeLocation(), Effect.STEP_SOUND, Material.REDSTONE_WIRE); } public static void playDodgeEffect(Player player) { + if (!Config.getInstance().getDodgeEffectEnabled()) { + return; + } + Location location = player.getEyeLocation(); World world = player.getWorld(); @@ -38,16 +48,28 @@ public final class ParticleEffectUtils { } public static void playGreaterImpactEffect(LivingEntity livingEntity) { + if (!Config.getInstance().getGreaterImpactEffectEnabled()) { + return; + } + Location location = livingEntity.getEyeLocation(); livingEntity.getWorld().createExplosion(location.getX(), location.getY(), location.getZ(), 0F, false, false); } public static void playAbilityEnabledEffect(Player player) { + if (!Config.getInstance().getAbilityActivationEffectEnabled()) { + return; + } + fireworkParticleShower(player, Color.GREEN); } public static void playAbilityDisabledEffect(Player player) { + if (!Config.getInstance().getAbilityDeactivationEffectEnabled()) { + return; + } + fireworkParticleShower(player, Color.RED); } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 0979873dd..0a3f32e7f 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -355,4 +355,13 @@ Commands: Use_Display_Names: true a: #Allow mcMMO to use player display names in chat instead of their usernames - Use_Display_Names: true \ No newline at end of file + Use_Display_Names: true +# +# Settings for particles +### +Particles: + Ability_Activation: true + Ability_Deactivation: true + Dodge: true + Bleed: true + Greater_Impact: true