Skip to content
Browse files

More work GJ didn't ask me to do

  • Loading branch information...
1 parent d778293 commit c53563e7d1edc78862605b1f44248673901c54c2 @NuclearW NuclearW committed
View
39 src/main/java/com/gmail/nossr50/datatypes/skills/SkillType.java
@@ -1,5 +1,7 @@
package com.gmail.nossr50.datatypes.skills;
+import org.bukkit.Color;
+
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.locale.LocaleLoader;
@@ -20,32 +22,35 @@
import com.gmail.nossr50.util.StringUtils;
public enum SkillType {
- ACROBATICS(AcrobaticsManager.class),
- ARCHERY(ArcheryManager.class),
- AXES(AxesManager.class, AbilityType.SKULL_SPLITTER, ToolType.AXE),
- EXCAVATION(ExcavationManager.class, AbilityType.GIGA_DRILL_BREAKER, ToolType.SHOVEL),
- FISHING(FishingManager.class),
- HERBALISM(HerbalismManager.class, AbilityType.GREEN_TERRA, ToolType.HOE),
- MINING(MiningManager.class, AbilityType.SUPER_BREAKER, ToolType.PICKAXE),
- REPAIR(RepairManager.class),
- SMELTING(SmeltingManager.class),
- SWORDS(SwordsManager.class, AbilityType.SERRATED_STRIKES, ToolType.SWORD),
- TAMING(TamingManager.class),
- UNARMED(UnarmedManager.class, AbilityType.BERSERK, ToolType.FISTS),
- WOODCUTTING(WoodcuttingManager.class, AbilityType.TREE_FELLER, ToolType.AXE);
+ ACROBATICS(AcrobaticsManager.class, Color.WHITE),
+ ARCHERY(ArcheryManager.class, Color.MAROON),
+ AXES(AxesManager.class, Color.AQUA, AbilityType.SKULL_SPLITTER, ToolType.AXE),
+ EXCAVATION(ExcavationManager.class, Color.fromRGB(139, 69, 19), AbilityType.GIGA_DRILL_BREAKER, ToolType.SHOVEL),
+ FISHING(FishingManager.class, Color.NAVY),
+ HERBALISM(HerbalismManager.class, Color.GREEN, AbilityType.GREEN_TERRA, ToolType.HOE),
+ MINING(MiningManager.class, Color.GRAY, AbilityType.SUPER_BREAKER, ToolType.PICKAXE),
+ REPAIR(RepairManager.class, Color.SILVER),
+ SMELTING(SmeltingManager.class, Color.YELLOW),
+ SWORDS(SwordsManager.class, Color.fromRGB(178, 34, 34), AbilityType.SERRATED_STRIKES, ToolType.SWORD),
+ TAMING(TamingManager.class, Color.PURPLE),
+ UNARMED(UnarmedManager.class, Color.BLACK, AbilityType.BERSERK, ToolType.FISTS),
+ WOODCUTTING(WoodcuttingManager.class, Color.OLIVE, AbilityType.TREE_FELLER, ToolType.AXE);
private Class<? extends SkillManager> managerClass;
+ private Color runescapeColor;
private AbilityType ability;
private ToolType tool;
- private SkillType(Class<? extends SkillManager> managerClass) {
+ private SkillType(Class<? extends SkillManager> managerClass, Color runescapeColor) {
this.managerClass = managerClass;
+ this.runescapeColor = runescapeColor;
ability = null;
tool = null;
}
- private SkillType(Class<? extends SkillManager> managerClass, AbilityType ability, ToolType tool) {
+ private SkillType(Class<? extends SkillManager> managerClass, Color runescapeColor, AbilityType ability, ToolType tool) {
this.managerClass = managerClass;
+ this.runescapeColor = runescapeColor;
this.ability = ability;
this.tool = tool;
}
@@ -116,4 +121,8 @@ public boolean isChildSkill() {
return false;
}
}
+
+ public Color getRunescapeModeColor() {
+ return runescapeColor;
+ }
}
View
20 src/main/java/com/gmail/nossr50/listeners/SelfListener.java
@@ -0,0 +1,20 @@
+package com.gmail.nossr50.listeners;
+
+import java.util.Calendar;
+
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+
+import com.gmail.nossr50.events.experience.McMMOPlayerLevelUpEvent;
+import com.gmail.nossr50.util.skills.ParticleEffectUtils;
+
+public class SelfListener implements Listener {
+ @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
+ public void onPlayerLevelUp(McMMOPlayerLevelUpEvent event) {
+ Calendar today = Calendar.getInstance();
+ if (today.get(Calendar.MONTH) == Calendar.APRIL && today.get(Calendar.DAY_OF_MONTH) == 1) {
+ ParticleEffectUtils.runescapeModeCelebration(event.getPlayer(), event.getSkill());
+ }
+ }
+}
View
3 src/main/java/com/gmail/nossr50/mcMMO.java
@@ -29,6 +29,7 @@
import com.gmail.nossr50.listeners.EntityListener;
import com.gmail.nossr50.listeners.InventoryListener;
import com.gmail.nossr50.listeners.PlayerListener;
+import com.gmail.nossr50.listeners.SelfListener;
import com.gmail.nossr50.listeners.WorldListener;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.metrics.MetricsManager;
@@ -59,6 +60,7 @@
private final BlockListener blockListener = new BlockListener(this);
private final EntityListener entityListener = new EntityListener(this);
private final InventoryListener inventoryListener = new InventoryListener(this);
+ private final SelfListener selfListener = new SelfListener();
private final WorldListener worldListener = new WorldListener();
private HashMap<Integer, String> tntTracker = new HashMap<Integer, String>();
@@ -351,6 +353,7 @@ private void registerEvents() {
pluginManager.registerEvents(blockListener, this);
pluginManager.registerEvents(entityListener, this);
pluginManager.registerEvents(inventoryListener, this);
+ pluginManager.registerEvents(selfListener, this);
pluginManager.registerEvents(worldListener, this);
}
View
5 src/main/java/com/gmail/nossr50/util/skills/ParticleEffectUtils.java
@@ -15,6 +15,7 @@
import org.bukkit.inventory.meta.FireworkMeta;
import com.gmail.nossr50.config.Config;
+import com.gmail.nossr50.datatypes.skills.SkillType;
public final class ParticleEffectUtils {
@@ -73,6 +74,10 @@ public static void playAbilityDisabledEffect(Player player) {
fireworkParticleShower(player, Color.RED);
}
+ public static void runescapeModeCelebration(Player player, SkillType skill) {
+ fireworkParticleShower(player, skill.getRunescapeModeColor());
+ }
+
private static void fireworkParticleShower(Player player, Color color) {
Location location = player.getLocation();
location.setY(location.getY() - 1.0);

0 comments on commit c53563e

Please sign in to comment.
Something went wrong with that request. Please try again.