mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 15:16:45 +01:00
More work GJ didn't ask me to do
This commit is contained in:
parent
d778293531
commit
c53563e7d1
@ -1,5 +1,7 @@
|
|||||||
package com.gmail.nossr50.datatypes.skills;
|
package com.gmail.nossr50.datatypes.skills;
|
||||||
|
|
||||||
|
import org.bukkit.Color;
|
||||||
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
@ -20,32 +22,35 @@ import com.gmail.nossr50.skills.woodcutting.WoodcuttingManager;
|
|||||||
import com.gmail.nossr50.util.StringUtils;
|
import com.gmail.nossr50.util.StringUtils;
|
||||||
|
|
||||||
public enum SkillType {
|
public enum SkillType {
|
||||||
ACROBATICS(AcrobaticsManager.class),
|
ACROBATICS(AcrobaticsManager.class, Color.WHITE),
|
||||||
ARCHERY(ArcheryManager.class),
|
ARCHERY(ArcheryManager.class, Color.MAROON),
|
||||||
AXES(AxesManager.class, AbilityType.SKULL_SPLITTER, ToolType.AXE),
|
AXES(AxesManager.class, Color.AQUA, AbilityType.SKULL_SPLITTER, ToolType.AXE),
|
||||||
EXCAVATION(ExcavationManager.class, AbilityType.GIGA_DRILL_BREAKER, ToolType.SHOVEL),
|
EXCAVATION(ExcavationManager.class, Color.fromRGB(139, 69, 19), AbilityType.GIGA_DRILL_BREAKER, ToolType.SHOVEL),
|
||||||
FISHING(FishingManager.class),
|
FISHING(FishingManager.class, Color.NAVY),
|
||||||
HERBALISM(HerbalismManager.class, AbilityType.GREEN_TERRA, ToolType.HOE),
|
HERBALISM(HerbalismManager.class, Color.GREEN, AbilityType.GREEN_TERRA, ToolType.HOE),
|
||||||
MINING(MiningManager.class, AbilityType.SUPER_BREAKER, ToolType.PICKAXE),
|
MINING(MiningManager.class, Color.GRAY, AbilityType.SUPER_BREAKER, ToolType.PICKAXE),
|
||||||
REPAIR(RepairManager.class),
|
REPAIR(RepairManager.class, Color.SILVER),
|
||||||
SMELTING(SmeltingManager.class),
|
SMELTING(SmeltingManager.class, Color.YELLOW),
|
||||||
SWORDS(SwordsManager.class, AbilityType.SERRATED_STRIKES, ToolType.SWORD),
|
SWORDS(SwordsManager.class, Color.fromRGB(178, 34, 34), AbilityType.SERRATED_STRIKES, ToolType.SWORD),
|
||||||
TAMING(TamingManager.class),
|
TAMING(TamingManager.class, Color.PURPLE),
|
||||||
UNARMED(UnarmedManager.class, AbilityType.BERSERK, ToolType.FISTS),
|
UNARMED(UnarmedManager.class, Color.BLACK, AbilityType.BERSERK, ToolType.FISTS),
|
||||||
WOODCUTTING(WoodcuttingManager.class, AbilityType.TREE_FELLER, ToolType.AXE);
|
WOODCUTTING(WoodcuttingManager.class, Color.OLIVE, AbilityType.TREE_FELLER, ToolType.AXE);
|
||||||
|
|
||||||
private Class<? extends SkillManager> managerClass;
|
private Class<? extends SkillManager> managerClass;
|
||||||
|
private Color runescapeColor;
|
||||||
private AbilityType ability;
|
private AbilityType ability;
|
||||||
private ToolType tool;
|
private ToolType tool;
|
||||||
|
|
||||||
private SkillType(Class<? extends SkillManager> managerClass) {
|
private SkillType(Class<? extends SkillManager> managerClass, Color runescapeColor) {
|
||||||
this.managerClass = managerClass;
|
this.managerClass = managerClass;
|
||||||
|
this.runescapeColor = runescapeColor;
|
||||||
ability = null;
|
ability = null;
|
||||||
tool = 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.managerClass = managerClass;
|
||||||
|
this.runescapeColor = runescapeColor;
|
||||||
this.ability = ability;
|
this.ability = ability;
|
||||||
this.tool = tool;
|
this.tool = tool;
|
||||||
}
|
}
|
||||||
@ -116,4 +121,8 @@ public enum SkillType {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Color getRunescapeModeColor() {
|
||||||
|
return runescapeColor;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
20
src/main/java/com/gmail/nossr50/listeners/SelfListener.java
Normal file
20
src/main/java/com/gmail/nossr50/listeners/SelfListener.java
Normal file
@ -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());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -29,6 +29,7 @@ import com.gmail.nossr50.listeners.BlockListener;
|
|||||||
import com.gmail.nossr50.listeners.EntityListener;
|
import com.gmail.nossr50.listeners.EntityListener;
|
||||||
import com.gmail.nossr50.listeners.InventoryListener;
|
import com.gmail.nossr50.listeners.InventoryListener;
|
||||||
import com.gmail.nossr50.listeners.PlayerListener;
|
import com.gmail.nossr50.listeners.PlayerListener;
|
||||||
|
import com.gmail.nossr50.listeners.SelfListener;
|
||||||
import com.gmail.nossr50.listeners.WorldListener;
|
import com.gmail.nossr50.listeners.WorldListener;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.metrics.MetricsManager;
|
import com.gmail.nossr50.metrics.MetricsManager;
|
||||||
@ -59,6 +60,7 @@ public class mcMMO extends JavaPlugin {
|
|||||||
private final BlockListener blockListener = new BlockListener(this);
|
private final BlockListener blockListener = new BlockListener(this);
|
||||||
private final EntityListener entityListener = new EntityListener(this);
|
private final EntityListener entityListener = new EntityListener(this);
|
||||||
private final InventoryListener inventoryListener = new InventoryListener(this);
|
private final InventoryListener inventoryListener = new InventoryListener(this);
|
||||||
|
private final SelfListener selfListener = new SelfListener();
|
||||||
private final WorldListener worldListener = new WorldListener();
|
private final WorldListener worldListener = new WorldListener();
|
||||||
|
|
||||||
private HashMap<Integer, String> tntTracker = new HashMap<Integer, String>();
|
private HashMap<Integer, String> tntTracker = new HashMap<Integer, String>();
|
||||||
@ -351,6 +353,7 @@ public class mcMMO extends JavaPlugin {
|
|||||||
pluginManager.registerEvents(blockListener, this);
|
pluginManager.registerEvents(blockListener, this);
|
||||||
pluginManager.registerEvents(entityListener, this);
|
pluginManager.registerEvents(entityListener, this);
|
||||||
pluginManager.registerEvents(inventoryListener, this);
|
pluginManager.registerEvents(inventoryListener, this);
|
||||||
|
pluginManager.registerEvents(selfListener, this);
|
||||||
pluginManager.registerEvents(worldListener, this);
|
pluginManager.registerEvents(worldListener, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.inventory.meta.FireworkMeta;
|
import org.bukkit.inventory.meta.FireworkMeta;
|
||||||
|
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
|
|
||||||
public final class ParticleEffectUtils {
|
public final class ParticleEffectUtils {
|
||||||
|
|
||||||
@ -73,6 +74,10 @@ public final class ParticleEffectUtils {
|
|||||||
fireworkParticleShower(player, Color.RED);
|
fireworkParticleShower(player, Color.RED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void runescapeModeCelebration(Player player, SkillType skill) {
|
||||||
|
fireworkParticleShower(player, skill.getRunescapeModeColor());
|
||||||
|
}
|
||||||
|
|
||||||
private static void fireworkParticleShower(Player player, Color color) {
|
private static void fireworkParticleShower(Player player, Color color) {
|
||||||
Location location = player.getLocation();
|
Location location = player.getLocation();
|
||||||
location.setY(location.getY() - 1.0);
|
location.setY(location.getY() - 1.0);
|
||||||
|
Loading…
Reference in New Issue
Block a user