I quite liked the fireworks display!

This commit is contained in:
TfT_02 2013-04-02 13:08:07 +02:00
parent 5a1ec745ce
commit d7f67d43b3
4 changed files with 23 additions and 7 deletions

View File

@ -9,6 +9,7 @@ Key:
Version 1.4.05-dev
+ Added option to allow refreshing of chunks after block-breaking abilities. (Disabled by default)
+ Added fireworks effects when a player levels-up, for every 50 levels (configurable)
= Fixed bug where /addxp was setting instead of adding experience
= Fixed bug where /addxp was not processessing level-ups for online players
= Fixed bug which allowed players to share experience with nearby dead players

View File

@ -115,7 +115,8 @@ public class Config extends AutoUpdateConfigLoader {
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); }
public boolean getLevelUpEffectsEnabled() { return config.getBoolean("Particles.LevelUp", true); }
public boolean getLevelUpEffectsEnabled() { return config.getBoolean("Particles.LevelUp_Enabled", true); }
public int getLevelUpEffectsTier() { return config.getInt("Particles.LevelUp_Tier", 100); }
/* PARTY SETTINGS */
public int getAutoPartyKickInterval() { return config.getInt("Party.AutoKick_Interval", 12); }

View File

@ -1,7 +1,6 @@
package com.gmail.nossr50.listeners;
import java.util.Calendar;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
@ -11,15 +10,27 @@ import com.gmail.nossr50.events.experience.McMMOPlayerLevelUpEvent;
import com.gmail.nossr50.util.skills.ParticleEffectUtils;
public class SelfListener implements Listener {
protected Player player;
protected float skillValue;
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerLevelUp(McMMOPlayerLevelUpEvent event) {
if (!Config.getInstance().getLevelUpEffectsEnabled()) {
return;
}
Calendar today = Calendar.getInstance();
if (today.get(Calendar.MONTH) == Calendar.APRIL && today.get(Calendar.DAY_OF_MONTH) == 1) {
ParticleEffectUtils.runescapeModeCelebration(event.getPlayer(), event.getSkill());
int tier = Config.getInstance().getLevelUpEffectsTier();
if (tier <= 0) {
return;
}
player = event.getPlayer();
skillValue = event.getSkillLevel();
if ((skillValue % tier) == 0) {
ParticleEffectUtils.runescapeModeCelebration(player, event.getSkill());
}
}
}

View File

@ -374,4 +374,7 @@ Particles:
Bleed: true
Greater_Impact: true
LevelUp: true
# These settings determine if fireworks should get launched when a player levels-up,
# this will happen by default for every 50 levels.
LevelUp_Enabled: true
LevelUp_Tier: 100