1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-01-21 07:31:26 +01:00

Add AbilityType and SuperAbilityType back

Adding both AbilityType and SuperAbilityType with com.gmail.nossr50.datatypes.skills as mcMMO api requires this to call.
This commit is contained in:
Josiah Jones 2019-03-06 20:49:28 -06:00 committed by GitHub
parent 5d64b67d72
commit 9b2945df50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
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,48 @@ 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);
}
} else {
Long t = InfoMap.get(AbilityType.TREE_FELLER);
if (t != null) {
if (t < System.currentTimeMillis())
return -(1 - Jobs.getGCManager().TreeFellerMultiplier);
InfoMap.remove(AbilityType.TREE_FELLER);
}
t = InfoMap.get(AbilityType.GIGA_DRILL_BREAKER);
if (t != null) {
if (t < System.currentTimeMillis())
return -(1 - Jobs.getGCManager().gigaDrillMultiplier);
InfoMap.remove(AbilityType.GIGA_DRILL_BREAKER);
}
t = InfoMap.get(AbilityType.SUPER_BREAKER);
if (t != null) {
if (t < System.currentTimeMillis())
return -(1 - Jobs.getGCManager().superBreakerMultiplier);
InfoMap.remove(AbilityType.SUPER_BREAKER);
}
} }
return 0D; return 0D;
@ -62,6 +88,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;
} }