Configuration options for particles

This commit is contained in:
NuclearW 2013-02-24 13:56:24 -05:00
parent e9dcb31002
commit 214079a3cd
3 changed files with 39 additions and 1 deletions

View File

@ -106,6 +106,13 @@ public class Config extends AutoUpdateConfigLoader {
public int getChimaeraItemId() { return config.getInt("Items.Chimaera_Wing.Item_ID", 288); } public int getChimaeraItemId() { return config.getInt("Items.Chimaera_Wing.Item_ID", 288); }
public boolean getChimaeraEnabled() { return config.getBoolean("Items.Chimaera_Wing.Enabled", true); } 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 */ /* PARTY SETTINGS */
public int getAutoPartyKickInterval() { return config.getInt("Party.AutoKick_Interval", 12); } public int getAutoPartyKickInterval() { return config.getInt("Party.AutoKick_Interval", 12); }
public int getAutoPartyKickTime() { return config.getInt("Party.Old_Party_Member_Cutoff", 7); } public int getAutoPartyKickTime() { return config.getInt("Party.Old_Party_Member_Cutoff", 7); }

View File

@ -14,15 +14,25 @@ import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.meta.FireworkMeta; import org.bukkit.inventory.meta.FireworkMeta;
import com.gmail.nossr50.config.Config;
public final class ParticleEffectUtils { public final class ParticleEffectUtils {
private ParticleEffectUtils() {}; private ParticleEffectUtils() {};
public static void playBleedEffect(Player player) { public static void playBleedEffect(Player player) {
if (!Config.getInstance().getBleedEffectEnabled()) {
return;
}
player.getWorld().playEffect(player.getEyeLocation(), Effect.STEP_SOUND, Material.REDSTONE_WIRE); player.getWorld().playEffect(player.getEyeLocation(), Effect.STEP_SOUND, Material.REDSTONE_WIRE);
} }
public static void playDodgeEffect(Player player) { public static void playDodgeEffect(Player player) {
if (!Config.getInstance().getDodgeEffectEnabled()) {
return;
}
Location location = player.getEyeLocation(); Location location = player.getEyeLocation();
World world = player.getWorld(); World world = player.getWorld();
@ -38,16 +48,28 @@ public final class ParticleEffectUtils {
} }
public static void playGreaterImpactEffect(LivingEntity livingEntity) { public static void playGreaterImpactEffect(LivingEntity livingEntity) {
if (!Config.getInstance().getGreaterImpactEffectEnabled()) {
return;
}
Location location = livingEntity.getEyeLocation(); Location location = livingEntity.getEyeLocation();
livingEntity.getWorld().createExplosion(location.getX(), location.getY(), location.getZ(), 0F, false, false); livingEntity.getWorld().createExplosion(location.getX(), location.getY(), location.getZ(), 0F, false, false);
} }
public static void playAbilityEnabledEffect(Player player) { public static void playAbilityEnabledEffect(Player player) {
if (!Config.getInstance().getAbilityActivationEffectEnabled()) {
return;
}
fireworkParticleShower(player, Color.GREEN); fireworkParticleShower(player, Color.GREEN);
} }
public static void playAbilityDisabledEffect(Player player) { public static void playAbilityDisabledEffect(Player player) {
if (!Config.getInstance().getAbilityDeactivationEffectEnabled()) {
return;
}
fireworkParticleShower(player, Color.RED); fireworkParticleShower(player, Color.RED);
} }

View File

@ -356,3 +356,12 @@ Commands:
a: a:
#Allow mcMMO to use player display names in chat instead of their usernames #Allow mcMMO to use player display names in chat instead of their usernames
Use_Display_Names: true Use_Display_Names: true
#
# Settings for particles
###
Particles:
Ability_Activation: true
Ability_Deactivation: true
Dodge: true
Bleed: true
Greater_Impact: true