mirror of
https://github.com/Zrips/Jobs.git
synced 2024-11-26 04:25:15 +01:00
Lets fix last PR double class check and throw error
- Fix not showing color in the chat when used chat-format option.
This commit is contained in:
parent
21049eb274
commit
5c3c064cb5
@ -13,7 +13,6 @@ 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;
|
public boolean mcMMOOverHaul = false;
|
||||||
|
|
||||||
private HashMap<UUID, HashMap<String, Long>> map = new HashMap<>();
|
private HashMap<UUID, HashMap<String, Long>> map = new HashMap<>();
|
||||||
@ -27,7 +26,7 @@ public class McMMOManager {
|
|||||||
if (InfoMap == null)
|
if (InfoMap == null)
|
||||||
return 0D;
|
return 0D;
|
||||||
|
|
||||||
if (mcMMOOverHaul = true) {
|
if (mcMMOOverHaul) {
|
||||||
Long t = InfoMap.get(SuperAbilityType.TREE_FELLER);
|
Long t = InfoMap.get(SuperAbilityType.TREE_FELLER);
|
||||||
if (t != null) {
|
if (t != null) {
|
||||||
if (t < System.currentTimeMillis())
|
if (t < System.currentTimeMillis())
|
||||||
@ -48,6 +47,27 @@ public class McMMOManager {
|
|||||||
return -(1 - Jobs.getGCManager().superBreakerMultiplier);
|
return -(1 - Jobs.getGCManager().superBreakerMultiplier);
|
||||||
InfoMap.remove(SuperAbilityType.SUPER_BREAKER);
|
InfoMap.remove(SuperAbilityType.SUPER_BREAKER);
|
||||||
}
|
}
|
||||||
|
} else if (mcMMOPresent) {
|
||||||
|
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("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");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0D;
|
return 0D;
|
||||||
@ -57,8 +77,13 @@ public class McMMOManager {
|
|||||||
Plugin McMMO = Bukkit.getPluginManager().getPlugin("mcMMO");
|
Plugin McMMO = Bukkit.getPluginManager().getPlugin("mcMMO");
|
||||||
if (McMMO != null) {
|
if (McMMO != null) {
|
||||||
try {
|
try {
|
||||||
Class.forName("com.gmail.nossr50.api.AbilityAPI");
|
|
||||||
Class.forName("com.gmail.nossr50.datatypes.skills.SuperAbilityType");
|
Class.forName("com.gmail.nossr50.datatypes.skills.SuperAbilityType");
|
||||||
|
} catch (ClassNotFoundException c) {
|
||||||
|
// Disabling skill API check;
|
||||||
|
mcMMOOverHaul = false;
|
||||||
|
Jobs.consoleMsg("&e[Jobs] &6mcMMO was found - &cBut your McMMO version is outdated, please update for full support.");
|
||||||
|
try {
|
||||||
|
Class.forName("com.gmail.nossr50.api.AbilityAPI");
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
// Disabling skill API check;
|
// Disabling skill API check;
|
||||||
mcMMOPresent = false;
|
mcMMOPresent = false;
|
||||||
@ -66,6 +91,9 @@ public class McMMOManager {
|
|||||||
// Still enabling event listener for repair
|
// Still enabling event listener for repair
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
// Still enabling event listener for repair
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
mcMMOPresent = true;
|
mcMMOPresent = true;
|
||||||
mcMMOOverHaul = true;
|
mcMMOOverHaul = true;
|
||||||
|
@ -847,7 +847,7 @@ public class PlayerManager {
|
|||||||
if (player == null || prog == null)
|
if (player == null || prog == null)
|
||||||
return boost;
|
return boost;
|
||||||
|
|
||||||
if (Jobs.getMcMMOlistener().mcMMOPresent)
|
if (Jobs.getMcMMOlistener().mcMMOPresent || Jobs.getMcMMOlistener().mcMMOOverHaul)
|
||||||
boost.add(BoostOf.McMMO, new BoostMultiplier().add(Jobs.getMcMMOlistener().getMultiplier(player.getPlayer())));
|
boost.add(BoostOf.McMMO, new BoostMultiplier().add(Jobs.getMcMMOlistener().getMultiplier(player.getPlayer())));
|
||||||
|
|
||||||
if (ent != null && (ent instanceof Tameable)) {
|
if (ent != null && (ent instanceof Tameable)) {
|
||||||
|
@ -56,7 +56,7 @@ public class bonus implements Cmd {
|
|||||||
printBoost(sender, boost, BoostOf.NearSpawner);
|
printBoost(sender, boost, BoostOf.NearSpawner);
|
||||||
printBoost(sender, boost, BoostOf.PetPay);
|
printBoost(sender, boost, BoostOf.PetPay);
|
||||||
|
|
||||||
if (Jobs.getMcMMOlistener().mcMMOPresent && boost.get(BoostOf.McMMO, CurrencyType.EXP) != 0D)
|
if (Jobs.getMcMMOlistener().mcMMOPresent || Jobs.getMcMMOlistener().mcMMOOverHaul && boost.get(BoostOf.McMMO, CurrencyType.EXP) != 0D)
|
||||||
printBoost(sender, boost, BoostOf.McMMO);
|
printBoost(sender, boost, BoostOf.McMMO);
|
||||||
|
|
||||||
sender.sendMessage(Jobs.getLanguage().getMessage("general.info.separator"));
|
sender.sendMessage(Jobs.getLanguage().getMessage("general.info.separator"));
|
||||||
|
@ -33,7 +33,6 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
import com.gamingmesh.jobs.Jobs;
|
import com.gamingmesh.jobs.Jobs;
|
||||||
import com.gamingmesh.jobs.resources.jfep.Parser;
|
import com.gamingmesh.jobs.resources.jfep.Parser;
|
||||||
import com.gamingmesh.jobs.stuff.ChatColor;
|
import com.gamingmesh.jobs.stuff.ChatColor;
|
||||||
import com.gamingmesh.jobs.stuff.Debug;
|
|
||||||
|
|
||||||
public class Job {
|
public class Job {
|
||||||
// job info
|
// job info
|
||||||
|
@ -690,7 +690,8 @@ public class JobsPlayer {
|
|||||||
|
|
||||||
honorific = builder.toString().trim();
|
honorific = builder.toString().trim();
|
||||||
if (honorific.length() > 0)
|
if (honorific.length() > 0)
|
||||||
honorific = Jobs.getGCManager().getModifyChatPrefix() + honorific + Jobs.getGCManager().getModifyChatSuffix();
|
honorific = org.bukkit.ChatColor.translateAlternateColorCodes('&',
|
||||||
|
Jobs.getGCManager().getModifyChatPrefix() + honorific + Jobs.getGCManager().getModifyChatSuffix());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user