mirror of
https://github.com/Zrips/Jobs.git
synced 2025-02-01 13:01:29 +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,11 +8,14 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
import com.gamingmesh.jobs.Jobs;
|
import com.gamingmesh.jobs.Jobs;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
|
||||||
|
|
||||||
public class McMMOManager {
|
public class McMMOManager {
|
||||||
|
|
||||||
public boolean mcMMOPresent = false;
|
public boolean mcMMOPresent = false;
|
||||||
|
|
||||||
|
public boolean mcMMOOverHaul = false;
|
||||||
|
|
||||||
private HashMap<UUID, HashMap<String, Long>> map = new HashMap<>();
|
private HashMap<UUID, HashMap<String, Long>> map = new HashMap<>();
|
||||||
|
|
||||||
public double getMultiplier(Player player) {
|
public double getMultiplier(Player player) {
|
||||||
@ -24,25 +27,27 @@ public class McMMOManager {
|
|||||||
if (InfoMap == null)
|
if (InfoMap == null)
|
||||||
return 0D;
|
return 0D;
|
||||||
|
|
||||||
Long t = InfoMap.get("TREE_FELLER");
|
if (mcMMOOverHaul = true) {
|
||||||
|
Long t = InfoMap.get(SuperAbilityType.TREE_FELLER);
|
||||||
if (t != null) {
|
if (t != null) {
|
||||||
if (t < System.currentTimeMillis())
|
if (t < System.currentTimeMillis())
|
||||||
return -(1 - Jobs.getGCManager().TreeFellerMultiplier);
|
return -(1 - Jobs.getGCManager().TreeFellerMultiplier);
|
||||||
InfoMap.remove("TREE_FELLER");
|
InfoMap.remove(SuperAbilityType.TREE_FELLER);
|
||||||
}
|
}
|
||||||
|
|
||||||
t = InfoMap.get("GIGA_DRILL_BREAKER");
|
t = InfoMap.get(SuperAbilityType.GIGA_DRILL_BREAKER);
|
||||||
if (t != null) {
|
if (t != null) {
|
||||||
if (t < System.currentTimeMillis())
|
if (t < System.currentTimeMillis())
|
||||||
return -(1 - Jobs.getGCManager().gigaDrillMultiplier);
|
return -(1 - Jobs.getGCManager().gigaDrillMultiplier);
|
||||||
InfoMap.remove("GIGA_DRILL_BREAKER");
|
InfoMap.remove(SuperAbilityType.GIGA_DRILL_BREAKER);
|
||||||
}
|
}
|
||||||
|
|
||||||
t = InfoMap.get("SUPER_BREAKER");
|
t = InfoMap.get(SuperAbilityType.SUPER_BREAKER);
|
||||||
if (t != null) {
|
if (t != null) {
|
||||||
if (t < System.currentTimeMillis())
|
if (t < System.currentTimeMillis())
|
||||||
return -(1 - Jobs.getGCManager().superBreakerMultiplier);
|
return -(1 - Jobs.getGCManager().superBreakerMultiplier);
|
||||||
InfoMap.remove("SUPER_BREAKER");
|
InfoMap.remove(SuperAbilityType.SUPER_BREAKER);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0D;
|
return 0D;
|
||||||
@ -53,6 +58,7 @@ public class McMMOManager {
|
|||||||
if (McMMO != null) {
|
if (McMMO != null) {
|
||||||
try {
|
try {
|
||||||
Class.forName("com.gmail.nossr50.api.AbilityAPI");
|
Class.forName("com.gmail.nossr50.api.AbilityAPI");
|
||||||
|
Class.forName("com.gmail.nossr50.datatypes.skills.SuperAbilityType");
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
// Disabling skill API check;
|
// Disabling skill API check;
|
||||||
mcMMOPresent = false;
|
mcMMOPresent = false;
|
||||||
@ -62,6 +68,7 @@ public class McMMOManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mcMMOPresent = true;
|
mcMMOPresent = true;
|
||||||
|
mcMMOOverHaul = true;
|
||||||
Jobs.consoleMsg("&e[Jobs] &6mcMMO" + McMMO.getDescription().getVersion() + " was found - Enabling capabilities.");
|
Jobs.consoleMsg("&e[Jobs] &6mcMMO" + McMMO.getDescription().getVersion() + " was found - Enabling capabilities.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user