mirror of
https://github.com/Zrips/Jobs.git
synced 2025-01-20 23:21:19 +01:00
Merge pull request #384 from veteranmina/patch-1
Add support for SuperAbilityType in overhaul mcMMO
This commit is contained in:
commit
21049eb274
@ -8,10 +8,13 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import com.gamingmesh.jobs.Jobs;
|
||||
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
|
||||
|
||||
public class McMMOManager {
|
||||
|
||||
public boolean mcMMOPresent = false;
|
||||
|
||||
public boolean mcMMOOverHaul = false;
|
||||
|
||||
private HashMap<UUID, HashMap<String, Long>> map = new HashMap<>();
|
||||
|
||||
@ -23,26 +26,28 @@ public class McMMOManager {
|
||||
HashMap<String, Long> InfoMap = map.get(player.getUniqueId());
|
||||
if (InfoMap == null)
|
||||
return 0D;
|
||||
|
||||
if (mcMMOOverHaul = true) {
|
||||
Long t = InfoMap.get(SuperAbilityType.TREE_FELLER);
|
||||
if (t != null) {
|
||||
if (t < System.currentTimeMillis())
|
||||
return -(1 - Jobs.getGCManager().TreeFellerMultiplier);
|
||||
InfoMap.remove(SuperAbilityType.TREE_FELLER);
|
||||
}
|
||||
|
||||
Long t = InfoMap.get("TREE_FELLER");
|
||||
if (t != null) {
|
||||
if (t < System.currentTimeMillis())
|
||||
return -(1 - Jobs.getGCManager().TreeFellerMultiplier);
|
||||
InfoMap.remove("TREE_FELLER");
|
||||
}
|
||||
t = InfoMap.get(SuperAbilityType.GIGA_DRILL_BREAKER);
|
||||
if (t != null) {
|
||||
if (t < System.currentTimeMillis())
|
||||
return -(1 - Jobs.getGCManager().gigaDrillMultiplier);
|
||||
InfoMap.remove(SuperAbilityType.GIGA_DRILL_BREAKER);
|
||||
}
|
||||
|
||||
t = InfoMap.get("GIGA_DRILL_BREAKER");
|
||||
if (t != null) {
|
||||
if (t < System.currentTimeMillis())
|
||||
return -(1 - Jobs.getGCManager().gigaDrillMultiplier);
|
||||
InfoMap.remove("GIGA_DRILL_BREAKER");
|
||||
}
|
||||
|
||||
t = InfoMap.get("SUPER_BREAKER");
|
||||
if (t != null) {
|
||||
if (t < System.currentTimeMillis())
|
||||
return -(1 - Jobs.getGCManager().superBreakerMultiplier);
|
||||
InfoMap.remove("SUPER_BREAKER");
|
||||
t = InfoMap.get(SuperAbilityType.SUPER_BREAKER);
|
||||
if (t != null) {
|
||||
if (t < System.currentTimeMillis())
|
||||
return -(1 - Jobs.getGCManager().superBreakerMultiplier);
|
||||
InfoMap.remove(SuperAbilityType.SUPER_BREAKER);
|
||||
}
|
||||
}
|
||||
|
||||
return 0D;
|
||||
@ -53,6 +58,7 @@ public class McMMOManager {
|
||||
if (McMMO != null) {
|
||||
try {
|
||||
Class.forName("com.gmail.nossr50.api.AbilityAPI");
|
||||
Class.forName("com.gmail.nossr50.datatypes.skills.SuperAbilityType");
|
||||
} catch (ClassNotFoundException e) {
|
||||
// Disabling skill API check;
|
||||
mcMMOPresent = false;
|
||||
@ -62,6 +68,7 @@ public class McMMOManager {
|
||||
}
|
||||
|
||||
mcMMOPresent = true;
|
||||
mcMMOOverHaul = true;
|
||||
Jobs.consoleMsg("&e[Jobs] &6mcMMO" + McMMO.getDescription().getVersion() + " was found - Enabling capabilities.");
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user